CN108809763A - A kind of network performance parameter acquisition method, terminal installation and storage medium - Google Patents

A kind of network performance parameter acquisition method, terminal installation and storage medium Download PDF

Info

Publication number
CN108809763A
CN108809763A CN201810611644.2A CN201810611644A CN108809763A CN 108809763 A CN108809763 A CN 108809763A CN 201810611644 A CN201810611644 A CN 201810611644A CN 108809763 A CN108809763 A CN 108809763A
Authority
CN
China
Prior art keywords
class
exchange
classification
network
nsurlsession
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
CN201810611644.2A
Other languages
Chinese (zh)
Other versions
CN108809763B (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810611644.2A priority Critical patent/CN108809763B/en
Publication of CN108809763A publication Critical patent/CN108809763A/en
Application granted granted Critical
Publication of CN108809763B publication Critical patent/CN108809763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • 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
    • 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/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of network performance parameter acquisition method, terminal installation and storage mediums, are suitable for application and development field.Method provided by the invention includes:The classification for defining NSURLSession, the exchange method that setting network is asked in the classification;When terminal starts scheduled application, the agent object in NSURLSession, and the callback method in agent object described in dynamic exchange are obtained by the classification;When the network request for detecting the scheduled application, the network request is stored into predefined dictionary by the callback method after exchange.Pass through defining classification and exchange method in the present invention, get dynamic replacement call back function after agent object so that in the case where not influencing IOS Program normal functions, efficiently quickly collect network performance parameter, and then better service is provided to the user according to performance parameter, ensure user experience.

Description

A kind of network performance parameter acquisition method, terminal installation and storage medium
Technical field
The present invention relates to field of computer technology more particularly to a kind of network performance parameter acquisition method, terminal installation and Storage medium.
Background technology
In APM (application performance management) platform, to the monitoring management of application key business, it can ensure to provide to the user Preferably service.The network performance of application monitors the network performance parameter of acquisition applications as an important ring, can be to improve Time-consuming, request error of network etc. provides important evidence.
Currently, in the industry be directed to network performance monitoring frequently with means have NSURLProtocol and Fishhook Two kinds of CFNetwork.The former needs for the method for intercepting all-network request in IOS due to using NSURLProtocol methods Heavily loaded URL Loading System are wanted, cause response speed slow, performance is poor, and request needs to re-create every time NSURLSession rebuilds and is likely to result in system crash repeatedly;The latter exchanges CFNetwork methods, can exchange privately owned API, using the upper holder function of APP, while the memory consumption of this method is larger, influences the use of application.
Therefore, it is necessary to it proposes a kind of efficiently simple, and does not influence the performance parameter acquisition method of the original function of application.
Invention content
In view of this, an embodiment of the present invention provides a kind of network performance parameter acquisition method, terminal installation and storages to be situated between Matter, to solve the problems, such as existing acquisition method poor performance, influence original function.
The embodiment of the present invention in a first aspect, provide a kind of network performance parameter acquisition method, including:
The classification for defining NSURLSession, the exchange method that setting network is asked in the classification;
When terminal starts scheduled application, the agent object in NSURLSession, and dynamic are obtained by the classification Exchange the callback method in the agent object;
When the network request for detecting the scheduled application, the network request is stored by the callback method after exchange Into predefined dictionary.
The second aspect of the embodiment of the present invention provides a kind of network performance parameter terminal installation, including:
Definition module:Classification for defining NSURLSession, the exchange side that setting network is asked in the classification Method;
Switching Module:For when terminal starts scheduled application, the generation in NSURLSession to be obtained by the classification Manage object, and the callback method in agent object described in dynamic exchange;
Memory module:For when detecting the network request of the scheduled application, by the callback method after exchange by institute It states in network request storage to predefined dictionary.
The third aspect of the embodiment of the present invention, provides a kind of terminal installation, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program It realizes such as the step of first aspect the method for the embodiment of the present invention.
The fourth aspect of the embodiment of the present invention, provides a kind of computer readable storage medium, described computer-readable to deposit Storage media is stored with computer program, realizes that first aspect of the embodiment of the present invention carries when the computer program is executed by processor The step of the method for confession.
5th aspect of the embodiment of the present invention, provides a kind of computer program product, the computer program product packet Computer program is included, realizes that first aspect of the embodiment of the present invention carries when the computer program is executed by one or more processors The step of the method for confession.
In the embodiment of the present invention, by defining the classification of NSURLSession, exchange method defined in classification is enabling The exchange method is realized when APP, replaces call back function, and then asked by the acquisition of replaced call back function in network request Seek parameter.So that in the case where not influencing IOS Program normal functions, network performance parameter, and then basis are efficiently quickly collected Performance parameter provides better service to the user, ensures user experience.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment for those of ordinary skill in the art without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is one embodiment flow chart of network performance parameter acquisition method provided in an embodiment of the present invention;
Fig. 2 is another embodiment flow chart of network performance parameter acquisition method provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of network performance parameter acquisition terminal device provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of terminal installation provided in an embodiment of the present invention.
Specific implementation mode
An embodiment of the present invention provides a kind of network performance parameter acquisition method, terminal installation and storage mediums, for fast Fast accurately push hot spot live streaming.
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field All other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention Range.
Embodiment one:
Referring to Fig. 1, the flow diagram of network performance parameter acquisition method provided in an embodiment of the present invention, including it is following Step:
S101, the classification for defining NSURLSession, the exchange method that setting network is asked in the classification;
The NSURLSession is one group and is used to handle the class asked based on HTTP/HTTPS, can be managed network and be asked It asks, and is configured to request task is unified.The classification has for adding new method, and extended attribute on the basis of original class Body surface shows a structure pointer for being directed toward classification.The classification of system class NSURLSession is defined in embodiments of the present invention, The function of NSURLSession can be extended, and then realizes customized exchange method.
The exchange method is specially a customized tool-class, has hookmethod defined in the tool-class, is used for Replace primitive class, primitive class method and replaced class, replaced class method.Above-mentioned replacement mainly passes through runtime letters Number is realized.
S102, when terminal start scheduled application when, by it is described classification obtain NSURLSession in agent object, and Callback method in agent object described in dynamic exchange;
The startup scheduled application refers to that APP or certain section of program are opened in end point impact, i.e. the APP or certain section of program are in When operating status, it can just start replacement operation.The agent object is that the network request of instantiation and new come out The object of NSURLSession, the object can handle network interaction task and the information content.The callback method is system Give tacit consent to the call back function executed, specifically may include creating the calling after the method for NSURLSession, collection network performance parameter And the calling after the completion of network request.
The value of a Boolean type can be returned when being replaced successfully exchange method, can be to preset if not completing to replace Corresponding call back function, is injected into agent object, avoids, because replacement is unsuccessful, influencing the network request of application program.
Optionally, a tool-class is defined, defines the NSURLSession creation methods respectively in the tool-class Replacement, the agent object callback method replacement.The tool-class is mainly used for realizing replacement and the readjustment of agent object The replacement of method, replaced agent object can get original callback method, then exchange callback method, returning after exchange Tune method can spread out of network request information.In embodiments of the present invention, it directly in the tool-class, defines agent object and replaces The class method that the class method and callback method changed are replaced, the two class methods are executed in runtime functions, are ensured that in this way Dynamic exchange can be carried out, and on the basis of not influencing original code, obtain network request.
Optionally, a self-defined class, and singleton realizes the class, sets the exchange that the classification is realized inside the class Method.Being realized under singleton pattern can ensure that a class only has unique example, provide unique accessing points, reduce opening for memory Pin.In embodiments of the present invention, customized class can be used for setting the startup exchanged, and the internal expanded function for realizing classification, Carry out dynamic exchange.
Preferably, further include the establishment asynchronous serial queue inside the class, method all in the class is put into institute It states in asynchronous serial queue.Synchronous behaviour can be reduced to avoid the obstructing problem that multi-thread concurrent is brought by creating asynchronous serial queue The influence of work.
S103, when the network request for detecting the scheduled application, the network is asked by the callback method after exchange It asks in storage to predefined dictionary.
Whenever application program initiates network request, the callback method after required parameter can be replaced captures, the letter of interception Breath can be spread out of to be stored in a particular form, the described information, that is, network request, includes network performance ginseng in required parameter Number.In embodiments of the present invention, by arriving agent object, the callback method of agent object is replaced so that replaced readjustment letter Number can get the content of network request parameter, and replaced call back function has executed, and the acquiescence that can execute default is returned Letter of transfer number.The replaced call back function, which collects, to be received network performance parameter and spreads out of.
The dictionary is a kind of key assignments storage organization, specifically, setting the network request task as key, network performance is joined Number stores for value in the dictionary.Preferably, when creating dictionary, the lazy load of the dictionary is realized.
Optionally, further include obtaining request wrong in the network request task, mistake is removed from the dictionary Network request task and corresponding network request parameter, and in the dictionary server will be uploaded to after data conversion.
Above-mentioned steps replace callback method and collect ginseng to intercept network required parameter by obtaining agent object After number, system default function is executed, not only can not invade original code, while letter to avoid the interference to network normal request It is single efficient, it ensure that the convenient processing to parameter information.
Embodiment two:
On the basis of Fig. 1, by taking program coding as an example, the specific implementation that network performance parameter acquires is described in detail in conjunction with Fig. 2 Journey is as follows:
It initiates that during network request NSURLSession can be created, can generate request using NSURLSession appoints Business, and adjusted back by way of agency.' sessionWithConfiguration can generally be passed through:delegate:' method wound Build NSURLSession.
A tool-class DYNetworkSwizzleUtil defined in S201, the function exchanged defined in the tool-class HookMethod realizes the exchange of class method by runtime.Defined function hookDelegateMethod, passes through runtime Realize the replacement of call back function.
The classification that system class NSURLSession is created in S202 defines swizzleNetwork and is asked as exchange network The method asked calls the class method of DYNetworkSwizzleUtil by ' sessionWithConfiguration: delegate:' replace with ' dySessionWithConfiguration:delegate:', ‘dySessionWithConfiguration:delegate:' in again pass through DYNetworkSwizzleUtil replace readjustment side ' URLSession in method:task:didFinishCollectingMetrics:' and ' URLSession:task: didComleteWithError:'.More than, complete the replacement of the agent object and its callback method in network request.
It is the replacement function extended on the basis of NSURLSession in S202, replacement program can be started by S203 ?.A DYNetworkMonitor class is specifically first defined, realizes that its singleton loads.Class method defined in such StartMonitor, and the swizzleNetwork methods that its intrinsic call extends NSURLSession, while at such Defined in a dictionary PerformanceDic, for the network request parameter of acquisition to be saved.
In S204, the callback method after exchange calls the setMetrics in DYNetworkMonitor respectively: forTask:Method and setError:withTask:The network request parameter of method transmission acquisition.
It is realized in S205 by S204 and the parameter of acquisition is saved in dictionary PerformanceDic.Specifically with network request Task is key, and required parameter (performance parameter) is value.In this way according to request task, so that it may be believed with taking the parameter asked every time Breath.Optionally, further include defining a method setError:withTask:It is that request error and network request are appointed that method, which enters ginseng, Business is embodied as taking out using network request task as the performance parameter of key and removal from PerformanceDic.
Preferably, further include uploading onto the server to performance parameter conversion.
Preferably, an asynchronous serial queue is created in the DYNetworkMonitor of definition, it will be all in such Method is put into the queue, and when avoiding multi-thread concurrent, operation PerformanceDic leads to data contention.
In embodiments of the present invention, by replacing agent object call back function therein, after data intercept, readjustment is original Method executes, and reduces the influence to system and application program.
Embodiment three:
A kind of network performance parameter acquisition method is essentially described above, the terminal that will be acquired below to a kind of network performance Device is described in detail.
Fig. 3 shows the structural schematic diagram of network performance parameter acquisition terminal device, including:
Definition module 310:Classification for defining NSURLSession, the exchange that setting network is asked in the classification Method;
Classification is specific to indicate that is directed toward a classification for adding new method, and extended attribute on the basis of original class Structure pointer.The classification of system class NSURLSession is defined in embodiments of the present invention, can extend NSURLSession Function, and then realize customized exchange method.
Switching Module 320:For when terminal starts scheduled application, being obtained in NSURLSession by the classification Agent object, and the callback method in agent object described in dynamic exchange;
The agent object is the object of the NSURLSession of the network request and new of instantiation out, the object Network interaction task and the information content can be handled.The callback method is the call back function that system default executes, and can specifically be wrapped Include the calling after the method for creating NSURLSession, collection network performance parameter and the calling after the completion of network request
Optionally, the Switching Module 320 further includes:
Definition unit:For defining a tool-class, the NSURLSession wounds are defined respectively in the tool-class The replacement of construction method, the replacement of the agent object callback method.
The tool-class is mainly used for realizing the replacement of agent object and the replacement of callback method, replaced agent object Original callback method can be got, then exchanges callback method, the callback method after exchange can spread out of network request information. In embodiments of the present invention, directly in the tool-class, define agent object replace class method and callback method replace Class method, the two class methods execute in runtime functions, and dynamic exchange can be carried out in this way by ensuring that, and not influenced On the basis of original code, network request is obtained.
Optionally, realize that the function of Switching Module 320 further includes:A self-defined class, and under singleton pattern described in realization Class sets the exchange method that the classification is realized inside the class.
By above-mentioned customized class, setting starts the exchange method in application, in calls tool class, dynamic replacement readjustment Function, after being replaced in this way, so that it may to acquire interception network request, meanwhile, replaced callback method has been executed, can go to continue Other functions in former request are executed, the interference to normal network request is avoided.
Preferably, asynchronous serial queue is created inside the class, method all in the class is put into described asynchronous In tandem queue.
Memory module 330:It, will by the callback method after exchange for working as the network request for detecting the scheduled application In the network request storage to predefined dictionary.
By arriving agent object, the callback method of agent object is replaced so that replaced call back function can be got The content of network request parameter, replaced call back function have executed, and can execute the acquiescence call back function of default.It is described to replace Call back function after changing, which collects, to be received network performance parameter and spreads out of.
Optionally, the memory module 330 includes:
Setup unit:For setting the network request task as key, network performance parameter is that value stores in the dictionary.
Optionally, the memory module 330 further includes:
Remove unit:For obtaining request wrong in the network request task, mistake is removed from the dictionary Network request task and corresponding network request parameter, and in the dictionary server will be uploaded to after data conversion.
Example IV:
Fig. 4 is the schematic diagram for the network performance parameter acquisition terminal apparatus structure that one embodiment of the invention provides.The end End equipment, to have the mobile computer device of touch screen, including but not limited to smart mobile phone, smartwatch, notebook, tablet Computer, POS machine even include vehicle-mounted computer.As shown in figure 4, the server 4 of the embodiment includes:Memory 410, processor 420 and system bus 430, the memory 410 includes the program 4101 run of storage thereon, those skilled in the art It is appreciated that server architecture shown in Fig. 4 does not constitute the restriction to server, may include more more or less than illustrating Component, either combine certain components or different components arrangement.
Each component parts of terminal device is specifically introduced with reference to Fig. 4:
Memory 410 can be used for storing software program and module, and processor 420 is stored in memory 410 by operation Software program and module, to execute various function application and the data processing of terminal.Memory 410 can include mainly Storing program area and storage data field, wherein storing program area can storage program area, the application journey needed at least one function Sequence (such as sound-playing function, image player function etc.) etc.;Storage data field can be stored to be created according to using for server Data (such as audio data, phone directory etc.) etc..In addition, memory 410 may include high-speed random access memory, may be used also To include nonvolatile memory, for example, at least a disk memory, flush memory device or other volatile solid-states Part.
On memory 410 program 4101 is run comprising network performance parameter acquisition method, it is described to run program 4101 can be divided into one or more module/units, and one or more of module/units are stored in the memory It in 410, and is executed by processor 420, with the transmission of completion notice and obtains notice realization process, one or more of moulds Block/unit can be the series of computation machine program instruction section that can complete specific function, the instruction segment by describe it is described based on Implementation procedure of the calculation machine program 4101 in the server 4.For example, the computer program 4101 can be divided into definition Module, Switching Module and memory module.
Processor 420 is the control centre of server, utilizes each of various interfaces and the entire terminal device of connection Part by running or execute the software program and/or module that are stored in memory 410, and calls and is stored in memory Data in 410 execute the various functions and processing data of terminal, to carry out integral monitoring to terminal.Optionally, processor 420 may include one or more processing units;Preferably, processor 420 can integrate application processor and modem processor, Wherein, the main processing operation system of application processor, application program etc., modem processor mainly handles wireless communication.It can With understanding, above-mentioned modem processor can not also be integrated into processor 420.
System bus 430 is for connection to each functional component of computer-internal, can with data information, address information, Information is controlled, type can be such as pci bus, isa bus, VESA buses.The instruction of processor 420 is passed by bus It is handed to memory 410,410 feedback data of memory is responsible for processor 420 and memory to processor 420, system bus 430 Data, instruction interaction between 410.Certain system bus 430 can also access other equipment, such as network interface, display are set It is standby etc..
The server should include at least CPU, chipset, memory, disk system etc., other component parts are no longer superfluous herein It states.
In embodiments of the present invention, the program that runs of the execution of processor 420 included by the server is specially:
A kind of network performance parameter acquisition method, including:
The classification for defining NSURLSession, the exchange method that setting network is asked in the classification;
When terminal starts scheduled application, the agent object in NSURLSession, and dynamic are obtained by the classification Exchange the callback method in the agent object;
When the network request for detecting the scheduled application, the network request is stored by the callback method after exchange Into predefined dictionary.
Further, described when terminal starts scheduled application, the generation in NSURLSession is obtained by the classification Object is managed, and further includes before the callback method in agent object described in dynamic exchange:
Define a tool-class, replaced respectively by runtime functions defined in the tool-class described in The callback method of class method, the agent object that NSURLSession is created.
Further, described that agent object in NSURLSession is obtained by the classification, and described in dynamic exchange Callback method in agent object includes:
A self-defined class, and singleton loads the class, sets the exchange method that the classification is realized inside the class.
Further, a self-defined class, and singleton loads the class, sets and realizes the classification inside the class Exchange method further include:
Asynchronous serial queue is created inside the class, and method all in the class is put into the asynchronous serial queue In.
Further, the network request is stored into predefined dictionary and is had by the callback method by after exchange Body is:
The network request task is set as key, network performance parameter is that value stores in the dictionary.
Further, described to set the network request task as key, network performance parameter is that value stores in the dictionary Further include:
Obtain request wrong in the network request task, removed from the dictionary mistake network request task and Corresponding network request parameter, and in the dictionary server will be uploaded to after data conversion.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before Stating embodiment, invention is explained in detail, it will be understood by those of ordinary skill in the art that:It still can be to preceding The technical solution recorded in each embodiment is stated to modify or equivalent replacement of some of the technical features;And these Modification or replacement, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution.

Claims (10)

1. a kind of network performance parameter acquisition method, which is characterized in that including:
The classification for defining NSURLSession, the exchange method that setting network is asked in the classification;
When terminal starts scheduled application, the agent object in NSURLSession, and dynamic exchange are obtained by the classification Callback method in the agent object;
When detecting the network request of the scheduled application, the network request storage is arrived by the callback method after exchange In predefined dictionary.
2. according to the method described in claim 1, it is characterized in that, it is described when terminal start scheduled application when, pass through described point Class obtains the agent object in NSURLSession, and further includes before the callback method in agent object described in dynamic exchange:
A tool-class is defined, defines the replacement of the NSURLSession creation methods and described respectively in the tool-class The replacement of agent object callback method.
3. according to the method described in claim 1, it is characterized in that, described obtained by the classification
Agent object in NSURLSession, and the callback method in agent object described in dynamic exchange includes:
A self-defined class, and the class is realized under singleton pattern, set the exchange side that the classification is realized inside the class Method.
4. according to the method described in claim 3, it is characterized in that, a self-defined class, and being realized under singleton pattern The class sets and realizes that the exchange method of the classification further includes inside the class:
Asynchronous serial queue is created inside the class, and method all in the class is put into the asynchronous serial queue.
5. according to the method described in claim 1, it is characterized in that, the callback method by after exchange asks the network It asks in storage to predefined dictionary and is specially:
The network request task is set as key, network performance parameter is in value storage to the dictionary.
6. according to the method described in claim 5, it is characterized in that, described set the network request task as key, internetworking Energy parameter is in the value storage dictionary:
Request wrong in the network request task is obtained, the network request task and correspondence of mistake are removed from the dictionary Network request parameter, and will the network request packet that stored in the dictionary conversion after be uploaded to server.
7. a kind of network performance parameter acquisition terminal device, which is characterized in that including:
Definition module:Classification for defining NSURLSession, the exchange method that setting network is asked in the classification;
Switching Module:For when terminal starts scheduled application, the agency couple in NSURLSession to be obtained by the classification As, and the callback method in agent object described in dynamic exchange;
Memory module:For when detecting the network request of the scheduled application, by the callback method after exchange by the net In network request storage to predefined dictionary.
8. terminal installation according to claim 7, which is characterized in that the Switching Module includes:
Definition unit:For defining a tool-class, the establishment sides NSURLSession are defined respectively in the tool-class The replacement of method, the replacement of the agent object callback method.
9. a kind of terminal installation, including memory, processor and it is stored in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program Any one of the network performance parameter acquisition method the step of.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, feature to exist In realization network performance parameter as described in any one of claim 1 to 6 acquires when the computer program is executed by processor The step of method.
CN201810611644.2A 2018-06-14 2018-06-14 Network performance parameter acquisition method, terminal device and storage medium Active CN108809763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810611644.2A CN108809763B (en) 2018-06-14 2018-06-14 Network performance parameter acquisition method, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810611644.2A CN108809763B (en) 2018-06-14 2018-06-14 Network performance parameter acquisition method, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN108809763A true CN108809763A (en) 2018-11-13
CN108809763B CN108809763B (en) 2022-03-25

Family

ID=64086115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810611644.2A Active CN108809763B (en) 2018-06-14 2018-06-14 Network performance parameter acquisition method, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN108809763B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290204A (en) * 2019-06-25 2019-09-27 腾讯科技(深圳)有限公司 A kind of browser crosses implementation method, device and the terminal device of agency

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162549A1 (en) * 2006-01-11 2007-07-12 Bea Systems, Inc. System and method for conversation based on web service addressing
CN103944906A (en) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 HTTP traffic guiding method on iOS for APP
US9219774B2 (en) * 2009-11-16 2015-12-22 Sap Se Exchange of callback information
CN105426310A (en) * 2015-11-27 2016-03-23 北京奇虎科技有限公司 Method and apparatus for detecting performance of target process
CN107071017A (en) * 2017-03-31 2017-08-18 武汉斗鱼网络科技有限公司 Network request for Android system acts on behalf of instrument and Proxy Method
US20170302551A1 (en) * 2015-07-06 2017-10-19 Airwatch Llc Application network usage management
CN107436832A (en) * 2016-05-27 2017-12-05 阿里巴巴集团控股有限公司 A kind of dynamic buries method, apparatus and electronic equipment a little
CN107729452A (en) * 2017-10-09 2018-02-23 武汉斗鱼网络科技有限公司 Webpage loading method, device, electronic equipment and computer-readable recording medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070162549A1 (en) * 2006-01-11 2007-07-12 Bea Systems, Inc. System and method for conversation based on web service addressing
US9219774B2 (en) * 2009-11-16 2015-12-22 Sap Se Exchange of callback information
CN103944906A (en) * 2014-04-25 2014-07-23 厦门享游网络科技有限公司 HTTP traffic guiding method on iOS for APP
US20170302551A1 (en) * 2015-07-06 2017-10-19 Airwatch Llc Application network usage management
CN105426310A (en) * 2015-11-27 2016-03-23 北京奇虎科技有限公司 Method and apparatus for detecting performance of target process
CN107436832A (en) * 2016-05-27 2017-12-05 阿里巴巴集团控股有限公司 A kind of dynamic buries method, apparatus and electronic equipment a little
CN107071017A (en) * 2017-03-31 2017-08-18 武汉斗鱼网络科技有限公司 Network request for Android system acts on behalf of instrument and Proxy Method
CN107729452A (en) * 2017-10-09 2018-02-23 武汉斗鱼网络科技有限公司 Webpage loading method, device, electronic equipment and computer-readable recording medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
IGOR KOŠŤÁL,: ""The use of callback method in a threaded client of a distributed .NET application"", 《 14TH INTERNATIONAL CONFERENCE MECHATRONIKA》 *
严炜,郭燕慧,: ""一种基于黑盒评估的iOS平台应用安全评测方法研究"", 《2013年中国信息通信研究新进展论文集》 *
朱志强,: ""NeteaseAPM iOS SDK技术实现"", 《HTTPS://NEYOUFAN.GITHUB.IO/2016/12/16/IOS/NETEASEAPM IOS SDK技术实现/NETEASEAPM IOS SDK技术实现/》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290204A (en) * 2019-06-25 2019-09-27 腾讯科技(深圳)有限公司 A kind of browser crosses implementation method, device and the terminal device of agency

Also Published As

Publication number Publication date
CN108809763B (en) 2022-03-25

Similar Documents

Publication Publication Date Title
CN113641457B (en) Container creation method, device, apparatus, medium, and program product
EP3355187A1 (en) Loading method and device for terminal application (app)
CN108989238A (en) A kind of method and relevant device for distributing service bandwidth
CN108566290A (en) service configuration management method, system, storage medium and server
CN103092670A (en) Cross-platform virtual computing resource management method under cloud computing environment
CN104468226A (en) Nginx configuration method and device
CN110362401A (en) Data run the member host in batch method, apparatus, storage medium and cluster
CN109167820A (en) A kind of method for down loading of application program, device, storage medium and terminal
CN110213092A (en) Resource access method, platform management equipment, storage medium and the device of mixed cloud
CN108804484A (en) The data measures and procedures for the examination and approval, equipment and computer readable storage medium
CN111464331B (en) Control method and system for thread creation and terminal equipment
CN109561165A (en) Domain name system configuration method and relevant apparatus
CN112667405A (en) Information processing method, device, equipment and storage medium
CN105677481B (en) A kind of data processing method, system and electronic equipment
CN110442819A (en) Data processing method, device, storage medium and terminal
CN108809763A (en) A kind of network performance parameter acquisition method, terminal installation and storage medium
CN103729417A (en) Method and device for data scanning
CN109597825A (en) Regulation engine call method, device, equipment and computer readable storage medium
CN112448833B (en) Multi-management-domain communication method and device
CN107479870A (en) A kind of third party's class libraries call method, device, mobile terminal and storage medium
CN109753291A (en) A kind of intelligent terminal, its application management method, device and storage medium
CN113448867B (en) Software pressure testing method and device
CN101373464A (en) Method, apparatus and system for automatically adopting form setting
CN109150993A (en) A kind of method, terminal installation and storage medium obtaining network request section
CN106980575A (en) A kind of event-handling 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