CN108683550A - A kind of call method and relevant device of configuration interface - Google Patents

A kind of call method and relevant device of configuration interface Download PDF

Info

Publication number
CN108683550A
CN108683550A CN201810759320.3A CN201810759320A CN108683550A CN 108683550 A CN108683550 A CN 108683550A CN 201810759320 A CN201810759320 A CN 201810759320A CN 108683550 A CN108683550 A CN 108683550A
Authority
CN
China
Prior art keywords
network
target
target terminal
interface
state
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.)
Pending
Application number
CN201810759320.3A
Other languages
Chinese (zh)
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 CN201810759320.3A priority Critical patent/CN108683550A/en
Publication of CN108683550A publication Critical patent/CN108683550A/en
Pending legal-status Critical Current

Links

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/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

An embodiment of the present invention provides a kind of call methods and relevant device of configuration interface, for avoiding booting network interface unavailable or interface malloc failure malloc when network is bad.Present invention method includes:Whether the network state that target terminal is detected by network detection function startNotifier changes;The target proxy of destination application is added at the notice center of the target terminal;When the network state of the target terminal changes, the notification information for notifying to be centrally generated is monitored by the target proxy;When listening to the notification message, the notifying parameters that the target terminal is sent are received by the call back function reachabilityChanged;Judge whether the current network of the target terminal is connected to according to the notifying parameters;If the current network of the target terminal is connected to, the target interface of the target terminal is configured by the network configuration object of destination application described in performSelector function calls.

Description

A kind of call method and relevant device of configuration interface
Technical field
The present invention relates to software field more particularly to a kind of call methods and relevant device of configuration interface.
Background technology
With the fast development of mobile phone mobile terminal, connect commonly using startup interface or configuration during project development Mouthful.
The startup interface or configuration interface being commonly used in project development process, generally meeting when starting up Pulling data, if the starting up of mobile phone mobile terminal has failed, this interface will fail, and interface unsuccessfully may result in The function of project is lost, and interface caused by general starting up is unsuccessfully because the no network of booting or network are unavailable.
Invention content
An embodiment of the present invention provides a kind of call methods and relevant device of configuration interface, for avoiding booting network Interface malloc failure malloc when interface is unavailable or network is bad.
The first aspect of the embodiment of the present invention provides a kind of call method of configuration interface, including:
Whether the network state that target terminal is detected by network detection function startNotifier changes;
The target proxy of destination application is added at the notice center of the target terminal, the destination application is Whether the application program in the target terminal, the network state that the target proxy is used to monitor the target terminal become Change;
When the network state of the target terminal changes, the notice center is monitored by the target proxy and is given birth to At notification information, the notification information is used to indicate the situation of change of the network state of the target terminal, and the notice Call back function reachabilityChanged is carried in information;
When listening to the notification message, the mesh is received by the call back function reachabilityChanged Mark the notifying parameters that terminal is sent;
Judge whether the current network of the target terminal is connected to according to the notifying parameters, the notifying parameters with it is described Current network has incidence relation;
If the current network of the target terminal is connected to, pass through intended application described in performSelector function calls The network configuration object of program configures the target interface of the target terminal, the target interface and the current network With incidence relation.
Optionally, the network configuration object by destination application described in performSelector function calls Carrying out configuration to the target interface of the target terminal includes:
Judge whether the target interface initializes;
If so, determining the target configuration item of the target interface;
Obtain the isDeviceIdGot variables of the target configuration item;
When the value of the isDeviceIdGot variables is yes, it is determined that the target interface configuration is completed.
Optionally, the notice that the target terminal is sent is received by the call back function reachabilityChanged Before parameter, the method includes:
Pass through dispatch_async function creation targets asynchronous queue;
DefaultCenter functions are sent to the notice center, it is different in the target to control the notice center It walks in the main thread of queue and is dished out the notification information using the function postNotificationName that dishes out, the notification information Entitled kReachabilityChangedNotification.
Optionally, the network configuration object by destination application described in performSelector function calls Before being configured to the target interface of the target terminal, the method further includes:
Cancel the target terminal by cancelling function cancelPreviousPerformRequestsWithTarget Target network is asked, and the target network request is the ongoing network request of the terminal.
Optionally, the network configuration object by destination application described in performSelector function calls After being configured to the target interface of the target terminal, the method further includes:
The state of the current network connection is obtained by the network detection function startNotifier;
If the corresponding value of state of the current network connection is preset value, the state of the current network connection is judged Whether it is wireless network;
If so, executing upload operation by the target interface.
Optionally, described to judge whether the state of the current network connection is that wireless network includes:
The letter of the current situation of mobile network of the target terminal is obtained by condition managing class DYSwitchManager Breath;
If the corresponding cellUarUploadOn functions of the current mobile network are opened, it is determined that the current network The state of connection is wireless network.
Optionally, whether the network state that target terminal is detected by network detection function startNotifier is sent out Changing include:
Judge whether the network state of the target terminal is detected;
If it is not, being by the network detection function startNotifier network states for detecting the target terminal then It is no to change.
Second aspect of the embodiment of the present invention provides a kind of calling device of configuration interface, including:
Detection unit, for detected by network detection function startNotifier target terminal network state whether It changes;
Agent unit, the target proxy for adding destination application at the notice center of the target terminal are described Destination application is the application program in the target terminal, and the target proxy is used to monitor the network of the target terminal Whether state changes;
Monitoring unit, for when the network state of the target terminal changes, being monitored by the target proxy The notification information for notifying to be centrally generated, the notification information are used to indicate the variation feelings of the network state of the target terminal Condition, and call back function reachabilityChanged is carried in the notification information;
Transmit-Receive Unit, for when listening to the notification message, passing through the call back function ReachabilityChanged receives the notifying parameters that the target terminal is sent;
Judging unit, it is described for judging whether the current network of the target terminal is connected to according to the notifying parameters Notifying parameters have incidence relation with the current network;
Dispensing unit passes through performSelector function calls if the current network for the target terminal is connected to The network configuration object of the destination application configures the target interface of the target terminal, the target interface with The current network has incidence relation.
Optionally, the dispensing unit is specifically used for:
Judge whether the target interface initializes;
If so, determining the target configuration item of the target interface;
Obtain the isDeviceIdGot variables of the target configuration item;
When the value of the isDeviceIdGot variables is yes, it is determined that the target interface configuration is completed.
Optionally, described device further includes:
Creating unit, for passing through dispatch_async function creation targets asynchronous queue;
The Transmit-Receive Unit is additionally operable to defaultCenter functions being sent to the notice center, described logical to control It is described logical to know that center is dished out in the main thread of the target asynchronous queue using the function postNotificationName that dishes out Know information, the entitled kReachabilityChangedNotification of the notification information.
Optionally, described device further includes:
Cancel unit, for cancelling by cancelling function cancelPreviousPerformRequestsWithTarget The target network of the target terminal is asked, and the target network request is the ongoing network request of the terminal.
Optionally, described device further includes:
Acquiring unit, for obtaining the current network connection by the network detection function startNotifier State;
If the corresponding value of state that the judging unit is additionally operable to the current network connection is preset value, described in judgement Whether the state of current network connection is wireless network;
If so, executing upload operation by the target interface.
Optionally, the judging unit is specifically used for:
The letter of the current situation of mobile network of the target terminal is obtained by condition managing class DYSwitchManager Breath;
If the corresponding cellUarUploadOn functions of the current mobile network are opened, it is determined that the current network The state of connection is wireless network.
Optionally, the detection unit is specifically used for:
Judge whether the network state of the target terminal is detected;
If it is not, being by the network detection function startNotifier network states for detecting the target terminal then It is no to change.
Third aspect present invention provides a kind of electronic equipment, including memory, processor, which is characterized in that the place Reason device realizes the configuration interface as described in above-mentioned any one when being used to execute the computer management class method stored in memory Call method the step of.
Fourth aspect present invention provides a kind of computer readable storage medium, is stored thereon with computer management class Sequence, it is characterised in that:The configuration as described in above-mentioned any one is realized when the computer management class method is executed by processor The step of call method of interface.
In conclusion in the embodiment of the present invention, when the network state of terminal changes, a notice can be sent out and disappeared It ceasing, is carried in the notification message there are one call back function, destination application listens to this notification message by target proxy, The notifying parameters interrupted and sent are received by call back function, and judge whether the current network of terminal is connected to according to notifying parameters, When the connection of the current network of terminal, the network configuration object of invocation target application program carries out the target interface of target terminal Configuration thus can be to avoid net when starting up of terminal to ensure the target interface success of destination application invocation target terminal When network interface is unavailable or network is bad, the failure of interface calling.
Description of the drawings
Fig. 1 is a kind of flow diagram of the call method of configuration interface provided in an embodiment of the present invention;
Fig. 2 is a kind of embodiment schematic diagram of the calling device of configuration interface provided in an embodiment of the present invention;
Fig. 3 is a kind of hardware architecture diagram of the calling device of configuration interface provided in an embodiment of the present invention;
Fig. 4 is the embodiment schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention;
Fig. 5 is a kind of embodiment schematic diagram of computer readable storage medium provided in an embodiment of the present invention.
Specific implementation mode
An embodiment of the present invention provides a kind of call methods and relevant device of configuration interface, for avoiding booting network from connecing Interface malloc failure malloc when the unavailable or network of mouth is bad.
Term " first ", " second ", " third " in description and claims of this specification and above-mentioned attached drawing, " The (if present)s such as four " are for distinguishing similar object, without being used to describe specific sequence or precedence.It should manage The data that solution uses in this way can be interchanged in the appropriate case, so that the embodiments described herein can be in addition to illustrating herein Or the sequence other than the content of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that Cover it is non-exclusive include, for example, containing the process of series of steps or unit, method, system, product or equipment need not limit In those of clearly listing step or unit, but may include not listing clearly or for these processes, method, production The intrinsic other steps of product or equipment or unit.Following will be combined with the drawings in the embodiments of the present invention, in the embodiment of the present invention Technical solution be clearly and completely described, it is clear that described embodiments are only a part of the embodiments of the present invention, and The embodiment being not all of.
The call method for configuring interface is illustrated from the angle of the calling device of configuration interface below, the configuration interface Calling device can be server, or the service unit in server.
Referring to Fig. 1, Fig. 1 is one embodiment signal of the call method of configuration interface provided in an embodiment of the present invention Figure, including:
101, the target proxy of destination application is added at the notice center of target terminal.
In the present embodiment, the target proxy of destination application, the target can be added at the notice center of target terminal Application program is the application program in target terminal, which generates when being exactly the network change for monitoring target terminal Notification message.Specifically, when destination application starts, by the way that defaultCenter functions are sent to target The notice center of terminal, to add an observer, which is exactly target proxy, wherein addition observer needs one The name of the name of notification message, this notification message is kReachabilityChangedNotification.So far can To monitor notification message by target proxy.
Whether the network state that target terminal 102, is detected by network detection function startNotifier changes, If so, thening follow the steps 103.
In the present embodiment, the calling device for configuring interface may determine that whether the network state of target terminal is detected, when When the network state of target terminal is not detected among, then target terminal is detected by network detection function startNotifier Whether network state changes, if so, thening follow the steps 103.That is the network-like of target terminal can be first determined whether The corresponding detection object of state whether there is, if the object of detection has existed, or detects that there are one detection objects, and This detection object is oneself, then just directly returning, as soon as illustrating to have existed a network detection at this time, is directly returned, this The benefit that sample is done is to have avoided multiple detection objects, ensures the uniqueness of detection object, can effectively save memory.
It should be noted that whether the network state that target terminal can be detected by step 102 changes, pass through step Rapid 101 can add target proxy at the notice center of target terminal, however suitable there is no successively executing between the two steps The limitation of sequence can first carry out step 101, can also first carry out step 102, or be performed simultaneously, not limit specifically.
103, when the network state of target terminal changes, the notice that notice center is monitored by target proxy disappears Breath.
In the present embodiment, after the notice center of target terminal is added to target proxy, in the network-like of target terminal When state changes, you can to listen to notification message by this target proxy, which is used to indicate target The situation of change of the network state of terminal, and call back function reachabilityChanged is carried in the notification message.
104, when listening to notification message, target terminal hair is received by call back function reachabilityChanged The notifying parameters sent.
In the present embodiment, listen to after notification message, after the notification message that notice center is monitored by target proxy, The notification message can be dished out from the notice center of the target terminal, specifically, being created by dispatch_async functions Target asynchronous queue is built, defaultCenter functions are sent to notice center, to control notice center in target asynchronous queue Main thread in dished out notification information using the function postNotificationName that dishes out, notification information it is entitled kReachabilityChangedNotification.That is, after listening to notification message, in order to enable configuration connects Mouthful calling device can get and changes notification message, an asynchronous queue can be created and dished out notification message, dished out in this way Notification message is that sequence is dished out, and is not in congestion, or is had an impact to other operation.Notification message can be passed through at this time The call back function reachabilityChanged of middle carrying receives the notifying parameters that target terminal is sent, which is note。
105, judge whether the current network of target terminal is connected to according to notifying parameters, if so, thening follow the steps 106.
In the present embodiment, after receiving notifying parameters, the object of note can be extracted, by the object for judging note Attribute judge whether target terminal current network is connected to, if so, then follow the steps 106, wherein target interface and current net Network has incidence relation, that is to say, that can be with the current network of invocation target terminal by target interface.
If 106, the current network connection of target terminal, passes through performSelector function call destination applications Network configuration object the target interface of target terminal is configured.
In the present embodiment, when the connection of the current network of target terminal, then pass through performSelector function call mesh The network configuration object of mark application program configures the target interface of target terminal.Specifically, whether judging target interface Initialization, if so, determining the target configuration item of the target interface;The isDeviceIdGot variables for obtaining target configuration item, when The value of isDeviceIdGot variables is yes, it is determined that target interface configuration is completed.That is, a change can be defined first Amount for recording whether target interface is initialised needs that initialization interface is called to go to pull number if not being initialised Initialization operation is completed according to this, if target interface has completed initialization operation, for some special configuration items, such as h5 White list, the isDeviceIdGot that can obtain target configuration item (i.e. the white list of H5) again at this time is set to yes, if This variable is NO, illustrates that the white list of H5 at this time is not configured to work(, reconfigurable, until configuration successful, so far Just complete the configuration of target interface.
It should be noted that before being configured to target interface, target terminal can also be cancelled and currently carried out Network request, ensure target terminal current network request only there are one, specifically, pass through cancel function CancelPreviousPerformRequestsWithTarget cancels the target network request of target terminal, and target network is asked It asks as the ongoing network request of the terminal.That is, the side for cancelling last network request can be used first Method cancelPreviousPerformRequestsWithTarget cancels the behaviour of the ongoing network request of target terminal Make, it is to need that this function of cancelPreviousPerformRequestsWithTarget, which needs 2 parameters, first parameter, The function to be cancelled is inside that object, and second parameter is that operation executed needs to be cancelled, if target terminal After the function of current network request is cancelled, you can to use performSelector functions to execute certain by some object A operation, herein in it is i.e. whole by the network configuration object performance objective of destination application by performSelector functions The configuration of the network interface at end operates.
It should also be noted that, after being configured to target interface, network detection function can also be passed through StartNotifier obtains the state of current network;If the corresponding value of the state of current network is preset value, judge current Whether the state of network is wireless network;If the state of current network is wireless network, is executed by target interface and upload behaviour Make.
Wherein, judge whether the state of current network is that wireless network includes:
The information of the current situation of mobile network of target terminal is obtained by condition managing class DYSwitchManager;
If the corresponding cellUarUploadOn functions of current mobile network are opened, it is determined that the state of current network For wireless network.
It is specific as follows:
The state of target terminal current network connection is got by network detection function startNotifier, acquisition Network connection state netSate is 1 explanation when netState is preset value (this sentences preset value and is illustrated for 1) Network status at this time is good, if Network status is good, then judge the state of current network connection be wireless network or Mobile network, the method for judgement are the letters that use state management class DYSwitchManager takes current situation of mobile network Breath judges whether current Network status cellUarUploadOn is to open, if not opening, then illustrating current net Network state is wifi, can do the operation of some networks upload in the case of detecting wifi by target interface.
In conclusion in the embodiment of the present invention, when the network state of terminal changes, a notice can be sent out and disappeared It ceasing, is carried in the notification message there are one call back function, destination application listens to this notification message by target proxy, The notifying parameters interrupted and sent are received by call back function, and judge whether the current network of terminal is connected to according to notifying parameters, When the connection of the current network of terminal, the network configuration object of invocation target application program carries out the target interface of target terminal Configuration thus can be to avoid net when starting up of terminal to ensure the target interface success of destination application invocation target terminal When network interface is unavailable or network is bad, the failure of interface calling.
The call method that interface is configured in the embodiment of the present invention is described above, below in the embodiment of the present invention The calling device of configuration interface be described.
Referring to Fig. 2, one embodiment of the calling device of interface is configured in the embodiment of the present invention, including:
Detection unit 201, the network state for detecting target terminal by network detection function startNotifier are It is no to change;
Agent unit 202, the target proxy for adding destination application at the notice center of the target terminal, institute It is the application program in the target terminal to state destination application, and the target proxy is used to monitor the net of the target terminal Whether network state changes;
Monitoring unit 203, for when the network state of the target terminal changes, being supervised by the target proxy The notification information for notifying to be centrally generated, the notification information is listened to be used to indicate the variation of the network state of the target terminal Situation, and call back function reachabilityChanged is carried in the notification information;
Transmit-Receive Unit 204, for when listening to the notification message, passing through the call back function ReachabilityChanged receives the notifying parameters that the target terminal is sent;
Judging unit 205, for judging whether the current network of the target terminal is connected to according to the notifying parameters, institute Stating notifying parameters and the current network has incidence relation;
Dispensing unit 206 passes through performSelector functions if the current network for the target terminal is connected to The network configuration object of the destination application is called to configure the target interface of the target terminal, the target connects Mouth has incidence relation with the current network.
Optionally, the dispensing unit 206 is specifically used for:
Judge whether the target interface initializes;
If so, determining the target configuration item of the target interface;
Obtain the isDeviceIdGot variables of the target configuration item;
When the value of the isDeviceIdGot variables is yes, it is determined that the target interface configuration is completed.
Optionally, described device further includes:
Creating unit 207, for passing through dispatch_async function creation targets asynchronous queue;
The Transmit-Receive Unit is additionally operable to defaultCenter functions being sent to the notice center, described logical to control It is described logical to know that center is dished out in the main thread of the target asynchronous queue using the function postNotificationName that dishes out Know information, the entitled kReachabilityChangedNotification of the notification information.
Optionally, described device further includes:
Cancel unit 208, is taken for passing through cancellation function cancelPreviousPerformRequestsWithTarget Disappear the target network request of the target terminal, and target network request is the ongoing network request of the terminal.
Optionally, described device further includes:
Acquiring unit 209 is connected for obtaining the current network by the network detection function startNotifier State;
If the corresponding value of state that the judging unit 205 is additionally operable to the current network connection is preset value, judge Whether the state of the current network connection is wireless network;
If so, executing upload operation by the target interface.
Optionally, the judging unit 205 is specifically used for:
The letter of the current situation of mobile network of the target terminal is obtained by condition managing class DYSwitchManager Breath;
If the corresponding cellUarUploadOn functions of the current mobile network are opened, it is determined that the current network The state of connection is wireless network.
Optionally, the detection unit is specifically used for:
Judge whether the network state of the target terminal is detected;
If it is not, being by the network detection function startNotifier network states for detecting the target terminal then It is no to change.
In conclusion in the embodiment of the present invention, when the network state of terminal changes, a notice can be sent out and disappeared It ceasing, is carried in the notification message there are one call back function, destination application listens to this notification message by target proxy, The notifying parameters interrupted and sent are received by call back function, and judge whether the current network of terminal is connected to according to notifying parameters, When the connection of the current network of terminal, the network configuration object of invocation target application program carries out the target interface of target terminal Configuration thus can be to avoid net when starting up of terminal to ensure the target interface success of destination application invocation target terminal When network interface is unavailable or network is bad, the failure of interface calling.
Above figure 2 carries out the calling device of the configuration interface in the embodiment of the present invention from the angle of modular functionality entity Description, is below described in detail the calling device of the configuration interface in the embodiment of the present invention from the angle of hardware handles, Referring to Fig. 3,300 one embodiment of calling device of the configuration interface in the embodiment of the present invention, including:
(the wherein quantity of processor 303 can be with for input unit 301, output device 302, processor 303 and memory 304 One or more, in Fig. 3 by taking a processor 303 as an example).In some embodiments of the invention, input unit 301, output Device 302, processor 303 and memory 304 can be connected by bus or other means, wherein to be connected by bus in Fig. 3 For.
Wherein, pass through the operational order for calling memory 304 to store, processor 303, for executing following steps:
Whether the network state that target terminal is detected by network detection function startNotifier changes;
The target proxy of destination application is added at the notice center of the target terminal, the destination application is Whether the application program in the target terminal, the network state that the target proxy is used to monitor the target terminal become Change;
When the network state of the target terminal changes, the notice center is monitored by the target proxy and is given birth to At notification information, the notification information is used to indicate the situation of change of the network state of the target terminal, and the notice Call back function reachabilityChanged is carried in information;
When listening to the notification message, the mesh is received by the call back function reachabilityChanged Mark the notifying parameters that terminal is sent;
Judge whether the current network of the target terminal is connected to according to the notifying parameters, the notifying parameters with it is described Current network has incidence relation;
If the current network of the target terminal is connected to, pass through intended application described in performSelector function calls The network configuration object of program configures the target interface of the target terminal, the target interface and the current network With incidence relation.
Optionally, the network configuration object by destination application described in performSelector function calls Carrying out configuration to the target interface of the target terminal includes:
Judge whether the target interface initializes;
If so, determining the target configuration item of the target interface;
Obtain the isDeviceIdGot variables of the target configuration item;
When the value of the isDeviceIdGot variables is yes, it is determined that the target interface configuration is completed.
Optionally, the notice that the target terminal is sent is received by the call back function reachabilityChanged Before parameter, the method includes:
Pass through dispatch_async function creation targets asynchronous queue;
DefaultCenter functions are sent to the notice center, it is different in the target to control the notice center It walks in the main thread of queue and is dished out the notification information using the function postNotificationName that dishes out, the notification information Entitled kReachabilityChangedNotification.
Optionally, the network configuration object by destination application described in performSelector function calls Before being configured to the target interface of the target terminal, the method further includes:
Cancel the target terminal by cancelling function cancelPreviousPerformRequestsWithTarget Target network is asked, and the target network request is the ongoing network request of the terminal.
Optionally, the network configuration object by destination application described in performSelector function calls After being configured to the target interface of the target terminal, the method further includes:
The state of the current network connection is obtained by the network detection function startNotifier;
If the corresponding value of state of the current network connection is preset value, the state of the current network connection is judged Whether it is wireless network;
If so, executing upload operation by the target interface.
Optionally, described to judge whether the state of the current network connection is that wireless network includes:
The letter of the current situation of mobile network of the target terminal is obtained by condition managing class DYSwitchManager Breath;
If the corresponding cellUarUploadOn functions of the current mobile network are opened, it is determined that the current network The state of connection is wireless network.
Optionally, whether the network state that target terminal is detected by network detection function startNotifier is sent out Changing include:
Judge whether the network state of the target terminal is detected;
If it is not, being by the network detection function startNotifier network states for detecting the target terminal then It is no to change.
Referring to Fig. 4, Fig. 4 is the embodiment schematic diagram of electronic equipment provided in an embodiment of the present invention.
As shown in figure 4, an embodiment of the present invention provides a kind of electronic equipment, including memory 410, processor 420 and deposit The computer program 411 that can be run on memory 420 and on processor 420 is stored up, processor 420 executes computer program Following steps are realized when 411:
Whether the network state that target terminal is detected by network detection function startNotifier changes;
The target proxy of destination application is added at the notice center of the target terminal, the destination application is Whether the application program in the target terminal, the network state that the target proxy is used to monitor the target terminal become Change;
When the network state of the target terminal changes, the notice center is monitored by the target proxy and is given birth to At notification information, the notification information is used to indicate the situation of change of the network state of the target terminal, and the notice Call back function reachabilityChanged is carried in information;
When listening to the notification message, the mesh is received by the call back function reachabilityChanged Mark the notifying parameters that terminal is sent;
Judge whether the current network of the target terminal is connected to according to the notifying parameters, the notifying parameters with it is described Current network has incidence relation;
If the current network of the target terminal is connected to, pass through intended application described in performSelector function calls The network configuration object of program configures the target interface of the target terminal, the target interface and the current network With incidence relation.
In specific implementation process, when processor 420 executes computer program 411, the corresponding embodiments of Fig. 1 may be implemented Middle any embodiment.
Since the electronic equipment that the present embodiment is introduced is to implement a kind of calling dress of configuration interface in the embodiment of the present invention Used equipment is set, so based on the method described in the embodiment of the present invention, those skilled in the art can understand The specific implementation mode of the electronic equipment of the present embodiment and its various change form, thus herein for the electronic equipment how Realize that the method in the embodiment of the present invention is no longer discussed in detail, as long as those skilled in the art implement in the embodiment of the present invention Method used by equipment, belong to the range to be protected of the invention.
Referring to Fig. 5, Fig. 5 is a kind of embodiment signal of computer readable storage medium provided in an embodiment of the present invention Figure.
As shown in figure 5, present embodiments providing a kind of computer readable storage medium 500, it is stored thereon with computer journey Sequence 511, the computer program 511 realize following steps when being executed by processor:
Whether the network state that target terminal is detected by network detection function startNotifier changes;
The target proxy of destination application is added at the notice center of the target terminal, the destination application is Whether the application program in the target terminal, the network state that the target proxy is used to monitor the target terminal become Change;
When the network state of the target terminal changes, the notice center is monitored by the target proxy and is given birth to At notification information, the notification information is used to indicate the situation of change of the network state of the target terminal, and the notice Call back function reachabilityChanged is carried in information;
When listening to the notification message, the mesh is received by the call back function reachabilityChanged Mark the notifying parameters that terminal is sent;
Judge whether the current network of the target terminal is connected to according to the notifying parameters, the notifying parameters with it is described Current network has incidence relation;
If the current network of the target terminal is connected to, pass through intended application described in performSelector function calls The network configuration object of program configures the target interface of the target terminal, the target interface and the current network With incidence relation.
In specific implementation process, which may be implemented Fig. 1 corresponding embodiments when being executed by processor Middle any embodiment.
It should be noted that in the above-described embodiments, all emphasizing particularly on different fields to the description of each embodiment, in some embodiment The part being not described in may refer to the associated description of other embodiments.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that each flow in flowchart and/or the block diagram can be realized by computer program instructions And/or the combination of the flow and/or box in box and flowchart and/or the block diagram.These computer programs can be provided to refer to Enable the processor of all-purpose computer, special purpose computer, embedded computer or other programmable data processing devices to produce A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in a box or multiple boxes.
The embodiment of the present invention additionally provides a kind of computer program product, which includes computer software Instruction, when computer software instructions are run on a processing device so that processing equipment is executed such as the wind in Fig. 1 corresponding embodiments Flow in the method for electric field digital Platform design.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to the flow or function described in the embodiment of the present invention.The computer can To be all-purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (digital subscriber line, DSL)) or wireless (such as infrared, wireless, Microwave etc.) mode is transmitted to another web-site, computer, server or data center.It is described computer-readable to deposit Storage media can be the clothes that any usable medium that computer can store either is integrated comprising one or more usable mediums The data storage devices such as business device, data center.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), Optical medium (for example, DVD) or semiconductor medium (such as solid state disk (solid state disk, SSD)) etc..
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 several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be the indirect coupling by some interfaces, device or unit It closes or communicates to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words It embodies, which is stored in a storage medium, including some instructions are used so that a computer Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention Portion or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various can store program The medium of code.
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 carry out repairing this or equivalent replacement of some of the technical features;And these It repaiies this or replaces, 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 call method of configuration interface, which is characterized in that including:
Whether the network state that target terminal is detected by network detection function startNotifier changes;
The target proxy of destination application is added at the notice center of the target terminal, the destination application is described Whether the application program in target terminal, the network state that the target proxy is used to monitor the target terminal change;
When the network state of the target terminal changes, monitor what the notice was centrally generated by the target proxy Notification information, the notification information are used to indicate the situation of change of the network state of the target terminal, and the notification information In carry call back function reachabilityChanged;
When listening to the notification message, it is whole that the target is received by the call back function reachabilityChanged Hold the notifying parameters sent;
Judge whether the current network of the target terminal is connected to according to the notifying parameters, the notifying parameters with it is described current Network has incidence relation;
If the current network of the target terminal is connected to, pass through destination application described in performSelector function calls Network configuration object the target interface of the target terminal is configured, the target interface has with the current network Incidence relation.
2. according to the method described in claim 1, it is characterized in that, described by described in performSelector function calls The network configuration object of destination application carries out configuration to the target interface of the target terminal:
Judge whether the target interface initializes;
If so, determining the target configuration item of the target interface;
Obtain the isDeviceIdGot variables of the target configuration item;
When the value of the isDeviceIdGot variables is yes, it is determined that the target interface configuration is completed.
3. method according to claim 1 or 2, which is characterized in that pass through the call back function Before reachabilityChanged receives the notifying parameters that the target terminal is sent, the method includes:
Pass through dispatch_async function creation targets asynchronous queue;
DefaultCenter functions are sent to the notice center, to control the notice center in the asynchronous team of the target It is dished out the notification information using the function postNotificationName that dishes out in the main thread of row, the name of the notification information Referred to as kReachabilityChangedNotification.
4. method according to claim 1 or 2, which is characterized in that described to pass through performSelector function calls institute State destination application network configuration object the target interface of the target terminal is configured before, the method is also wrapped It includes:
Cancel the target of the target terminal by cancelling function cancelPreviousPerformRequestsWithTarget Network request, the target network request is the ongoing network request of the terminal.
5. method according to claim 1 or 2, which is characterized in that described to pass through performSelector function calls institute State destination application network configuration object the target interface of the target terminal is configured after, the method is also wrapped It includes:
The state of the current network connection is obtained by the network detection function startNotifier;
If the corresponding value of the state of current network connection is preset value, judge the current network connection state whether For wireless network;
If so, executing upload operation by the target interface.
6. according to the method described in claim 5, it is characterized in that, the state for judging current network connection whether be Wireless network includes:
The information of the current situation of mobile network of the target terminal is obtained by condition managing class DYSwitchManager;
If the corresponding cellUarUploadOn functions of the current mobile network are opened, it is determined that the current network connection State be wireless network.
7. according to claims 1 or 2 method, which is characterized in that it is described pass through network detection function startNotifier inspection Survey target terminal network state whether change including:
Judge whether the network state of the target terminal is detected;
If it is not, then whether being sent out by the network detection function startNotifier network states for detecting the target terminal Changing.
8. a kind of calling device of configuration interface, which is characterized in that including:
Whether detection unit, the network state for detecting target terminal by network detection function startNotifier occur Variation;
Agent unit, the target proxy for adding destination application at the notice center of the target terminal, the target Application program is the application program in the target terminal, and the target proxy is used to monitor the network state of the target terminal Whether change;
Monitoring unit, for when the network state of the target terminal changes, monitored by the target proxy described in The notification information being centrally generated, the notification information is notified to be used to indicate the situation of change of the network state of the target terminal, And call back function reachabilityChanged is carried in the notification information;
Transmit-Receive Unit, for when listening to the notification message, being connect by the call back function reachabilityChanged Receive the notifying parameters that the target terminal is sent;
Judging unit, for judging whether the current network of the target terminal is connected to according to the notifying parameters, the notice Parameter has incidence relation with the current network;
Dispensing unit, if the current network for the target terminal is connected to, described in performSelector function calls The network configuration object of destination application configures the target interface of the target terminal, the target interface with it is described Current network has incidence relation.
9. a kind of electronic equipment, including memory, processor, which is characterized in that the processor is deposited for executing in memory The call method for configuring interface as claimed in any of claims 1 to 7 in one of claims is realized when the computer management class method of storage Step.
10. a kind of computer readable storage medium is stored thereon with computer management class method, it is characterised in that:The calculating Machine management class method realizes the called side of configuration interface as claimed in any of claims 1 to 7 in one of claims when being executed by processor The step of method.
CN201810759320.3A 2018-07-11 2018-07-11 A kind of call method and relevant device of configuration interface Pending CN108683550A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810759320.3A CN108683550A (en) 2018-07-11 2018-07-11 A kind of call method and relevant device of configuration interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810759320.3A CN108683550A (en) 2018-07-11 2018-07-11 A kind of call method and relevant device of configuration interface

Publications (1)

Publication Number Publication Date
CN108683550A true CN108683550A (en) 2018-10-19

Family

ID=63814009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810759320.3A Pending CN108683550A (en) 2018-07-11 2018-07-11 A kind of call method and relevant device of configuration interface

Country Status (1)

Country Link
CN (1) CN108683550A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124795A (en) * 2018-11-01 2020-05-08 百度在线网络技术(北京)有限公司 Application start monitoring method, device and equipment
CN112630557A (en) * 2020-11-25 2021-04-09 深圳市宏电技术股份有限公司 Equipment state detection method, device, equipment and medium
CN113472903A (en) * 2021-09-02 2021-10-01 腾讯科技(深圳)有限公司 Data processing method and device
CN113536305A (en) * 2020-04-17 2021-10-22 武汉瓯越网视有限公司 Method and device for detecting acquisition behavior

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050203912A1 (en) * 2004-03-15 2005-09-15 Symbol Technologies, Inc. Method and apparatus for configuring a mobile device
CN102255961A (en) * 2011-06-30 2011-11-23 重庆新媒农信科技有限公司 Java 2 micro edition (J2ME)-based Web Service interface calling method
CN105677492A (en) * 2016-01-07 2016-06-15 中南大学 Reliable application execution method for terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050203912A1 (en) * 2004-03-15 2005-09-15 Symbol Technologies, Inc. Method and apparatus for configuring a mobile device
CN102255961A (en) * 2011-06-30 2011-11-23 重庆新媒农信科技有限公司 Java 2 micro edition (J2ME)-based Web Service interface calling method
CN105677492A (en) * 2016-01-07 2016-06-15 中南大学 Reliable application execution method for terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韩大辉: "基于IOS移动终端的协同绘图系统设计与实现", 《中国优秀硕士学位论文全文数据库(信息科技辑)》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124795A (en) * 2018-11-01 2020-05-08 百度在线网络技术(北京)有限公司 Application start monitoring method, device and equipment
CN111124795B (en) * 2018-11-01 2024-03-26 百度在线网络技术(北京)有限公司 Application starting monitoring method, device and equipment
CN113536305A (en) * 2020-04-17 2021-10-22 武汉瓯越网视有限公司 Method and device for detecting acquisition behavior
CN113536305B (en) * 2020-04-17 2022-09-09 武汉瓯越网视有限公司 Method and device for detecting acquisition behavior
CN112630557A (en) * 2020-11-25 2021-04-09 深圳市宏电技术股份有限公司 Equipment state detection method, device, equipment and medium
CN113472903A (en) * 2021-09-02 2021-10-01 腾讯科技(深圳)有限公司 Data processing method and device
CN113472903B (en) * 2021-09-02 2021-11-16 腾讯科技(深圳)有限公司 Data processing method and device

Similar Documents

Publication Publication Date Title
CN108683550A (en) A kind of call method and relevant device of configuration interface
US8938489B2 (en) Monitoring system performance changes based on configuration modification
CN110535902A (en) The processing method and electronic device of monitoring intelligent are realized based on micro services
CN110297766A (en) Method for testing software and software testing system based on distributed test node cluster
US8656009B2 (en) Indicating an impact of a change in state of a node
CN109743358A (en) Asynchronous message interface fusing control method, device, computer equipment and storage medium
CN108427644A (en) Service test method, service testing system and service testing device
CN107832329A (en) Page resource acquisition methods and terminal device
CN108268271A (en) The upgrade method and update device of micro services
CN109005085A (en) A kind of service availability monitoring system, method, device and equipment
CN107612727A (en) Distributed health examination method, computing device and computer-readable storage medium
CN108665239A (en) Workflow processing method, device, computer equipment and storage medium
CN105847237A (en) Safety management method and device based on NFV (Network Function Virtualization)
CN110225104A (en) Data capture method, device and terminal device
CN110365536A (en) A kind of the fault cues method and relevant apparatus of internet of things equipment
CN112560114B (en) Method and device for calling intelligent contract
CN108810125B (en) Service discovery method and system for physical node
CN108363610A (en) A kind of control method and equipment of virtual machine monitoring plug-in unit
CN109886683A (en) Monitor the method, apparatus and storage medium of block chain data
CN109802855A (en) A kind of Fault Locating Method and device
CN106663041A (en) Recovering usability of cloud based service from system failure
CN108683528A (en) A kind of data transmission method, central server, server and data transmission system
CN110399178A (en) A kind of call method of third party's service, device, electronic equipment and storage medium
CN108540509A (en) A kind of processing method of terminal browser, device and server, intelligent terminal
CN108366098A (en) A kind of data interactive method and device of network node

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181019