CN111381897A - Interface calling method and device, mobile terminal and storage medium - Google Patents

Interface calling method and device, mobile terminal and storage medium Download PDF

Info

Publication number
CN111381897A
CN111381897A CN201811617753.1A CN201811617753A CN111381897A CN 111381897 A CN111381897 A CN 111381897A CN 201811617753 A CN201811617753 A CN 201811617753A CN 111381897 A CN111381897 A CN 111381897A
Authority
CN
China
Prior art keywords
interface
client
operating system
calling
parameters
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
CN201811617753.1A
Other languages
Chinese (zh)
Other versions
CN111381897B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201811617753.1A priority Critical patent/CN111381897B/en
Priority claimed from CN201811617753.1A external-priority patent/CN111381897B/en
Publication of CN111381897A publication Critical patent/CN111381897A/en
Application granted granted Critical
Publication of CN111381897B publication Critical patent/CN111381897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions

Abstract

The present disclosure provides an interface calling method, which is used in a client, wherein the client can call different interfaces in an operating system; the method comprises the following steps: setting a protocol intermediate layer in the client; monitoring the change condition of an interface in the operating system through the protocol intermediate layer; when the state of the interface of the operating system is that the function exists and the interface is not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client. The disclosure also provides an interface calling device, a mobile terminal and a storage medium.

Description

Interface calling method and device, mobile terminal and storage medium
Technical Field
The present disclosure relates to interface calling technologies, and in particular, to an interface calling method and apparatus, a mobile terminal, and a storage medium.
Background
In the prior art, a client can call interfaces with different functions provided by an operating system in a using process, for example, a corresponding interface can be called to realize a function of calling a soft keyboard, a function of calling a camera, or a function of starting fingerprint identification (Touch ID), but when a Web View (Web View) exists as an independent plugin, version upgrade of the Web View may cause an interface originally exposed to the client to be incompletely consistent with an interface in a new version of the Web View, so that the client cannot normally call a required interface.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide an interface calling method, an interface calling device, and a storage medium, which can allocate the calling of the interface according to the monitored change condition of the interface, so as to implement uniform calling of different interfaces of the operating system through a service layer of the client.
The technical scheme of the embodiment of the disclosure is realized as follows:
the present disclosure provides an interface calling method, which is used in a client, wherein the client can call different interfaces in an operating system; the method comprises the following steps:
setting a protocol intermediate layer in the client;
monitoring the change condition of an interface in the operating system through the protocol intermediate layer;
when the state of the interface of the operating system is that the function exists and the interface is not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters;
and the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client.
In the foregoing solution, when the state of the interface of the operating system is that a function exists and is not exposed to the client, intercepting, by the protocol intermediate layer, a parameter input to the interface, and rewriting the intercepted parameter includes:
when the first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client,
and the protocol intermediate layer rewrites the parameters of the calling soft keyboard function intercepted by the protocol intermediate layer of the client according to the function information corresponding to the first interface so as to meet the parameter requirement of the first interface.
In the above solution, the step of inputting the rewritten parameters into the interface of the operating system by the service layer of the client to implement uniform call of different interfaces of the operating system through the service layer of the client includes:
the business layer of the client inputs the rewritten parameters of the calling soft keyboard function into an interface of the operating system;
and the service layer of the client calls a first interface corresponding to the calling soft keyboard function through the rewritten parameters of the calling soft keyboard function.
In the above scheme, the method further comprises:
intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters to realize the control of the client loading process.
In the above scheme, the method further comprises:
and the business layer of the client inputs the rewritten parameters into an interface of the operating system so as to realize that a corresponding business display interface is on a designated page in the loading process of the client through the business layer of the client.
In the above scheme, the method further comprises:
when the change condition of the interface is that the name is changed, the protocol intermediate layer performs conversion processing on the interface corresponding to the service logic layer of the client to obtain a target interface;
and the service logic layer calls the target interface obtained through the conversion processing.
In the above scheme, the method further comprises:
when the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol intermediate layer utilizes the local code of the client to carry out local processing on the interface corresponding to the service logic layer of the client to obtain a target interface;
and the service logic layer calls the target interface obtained through the conversion processing.
The present disclosure also provides an interface calling device, which is used in a client, where the client can call different interfaces in an operating system; the method comprises the following steps:
the control module is used for setting a protocol intermediate layer module in the client;
the protocol intermediate layer module is used for monitoring the change condition of an interface in the operating system;
the protocol intermediate layer module is used for intercepting parameters input to the interface when the state of the interface of the operating system is functional and is not exposed to the client, and rewriting the intercepted parameters;
and the business layer module is used for inputting the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client.
In the above-mentioned scheme, the first step of the method,
when the first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client,
and the protocol middle layer module is used for rewriting parameters of the calling soft keyboard function intercepted by the protocol middle layer of the client according to the function information corresponding to the first interface so as to meet the parameter requirement of the first interface.
In the above-mentioned scheme, the first step of the method,
the business layer module is used for inputting the rewritten parameters of the calling soft keyboard function into an interface of the operating system;
and the service layer module is used for calling a first interface corresponding to the calling soft keyboard function through the rewritten parameters of the calling soft keyboard function.
In the above-mentioned scheme, the first step of the method,
the protocol intermediate layer module is used for intercepting parameters input to the interface and rewriting the intercepted parameters so as to realize the control of the client loading process.
In the above-mentioned scheme, the first step of the method,
and the service layer module is used for inputting the rewritten parameters into an interface of the operating system so as to realize that a corresponding service display interface is on a designated page in the loading process of the client through the service layer of the client.
In the above-mentioned scheme, the first step of the method,
when the change condition of the interface is that the name is changed,
the protocol intermediate layer module is used for converting the corresponding interface of the service logic layer of the client to obtain a target interface;
and the service layer module is used for calling the target interface obtained through the conversion processing.
In the above-mentioned scheme, the first step of the method,
when the change condition of the interface is that the corresponding function of the interface is cancelled,
the protocol intermediate layer module is used for carrying out local processing on an interface corresponding to a service logic layer of the client by using a local code of the client to obtain a target interface;
and the service layer module is used for calling the target interface obtained through the conversion processing.
The present disclosure also provides a mobile terminal, including:
a memory for storing executable instructions;
and the processor is used for realizing the interface calling method provided by any one of the disclosure when the executable instruction is executed.
The present disclosure also provides a storage medium storing executable instructions, which when executed, are used to implement any one of the interface calling methods provided by the present disclosure.
The embodiment of the disclosure has the following technical effects:
the method can realize the allocation of the calling of the interface according to the change condition of the monitored interface, and when the state of the interface of the operating system is the function existence and is not exposed to the client, the parameters input to the interface are intercepted through the protocol intermediate layer, and the intercepted parameters are rewritten; the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client, thereby realizing uniform calling of different interfaces of the operating system through the business layer of the client and avoiding the interface required by the client which cannot be normally called due to incomplete consistency of the interfaces in the new version of Web View.
Drawings
Fig. 1 is a schematic view of an application scenario of an interface calling method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an alternative hardware structure of a mobile terminal 200 according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of an alternative component structure of an interface invoking device according to an embodiment of the present disclosure;
fig. 4 is an optional flowchart of the interface calling method according to the embodiment of the present disclosure;
fig. 5 is an optional flowchart of the interface calling method according to the embodiment of the present disclosure;
fig. 6 is a schematic diagram of an alternative usage process of the interface calling method according to the embodiment of the present disclosure.
Detailed Description
For the purpose of making the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present disclosure, and all other embodiments obtained by a person of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present disclosure.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of the disclosure only and is not intended to be limiting of the disclosure.
It should be noted that, in the embodiments of the present disclosure, the terms "comprises", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a method or server including a series of elements includes not only the explicitly recited elements but also other elements not explicitly listed or inherent to the method or server. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other related elements in a method or client that comprises the element (e.g., steps in a method or modules in a client, such as modules, which may be part of a circuit, part of a processor, part of a program or software, etc.).
For example, the interface calling method provided by the embodiment of the present disclosure includes a series of steps, but the interface calling method provided by the embodiment of the present disclosure is not limited to the described steps, and similarly, the terminal provided by the embodiment of the present disclosure includes a series of units, but the terminal provided by the embodiment of the present disclosure is not limited to include the explicitly described units, and may further include units that are required to be configured to acquire related information or perform processing based on the information. It should be noted that in the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
Before further detailed description of the embodiments of the present disclosure, terms and expressions referred to in the embodiments of the present disclosure are explained, and the terms and expressions referred to in the embodiments of the present disclosure are applied to the following explanations.
1) An Interface (API Application Programming Interface) is a set of definitions, programs and protocols, and realizes the mutual communication between computer software through the API Interface. One of the primary functions of the interface is to provide a set of functions.
2) The client is a program corresponding to the server and providing local services for the client.
3) In response to the condition or state on which the performed operation depends, one or more of the performed operations may be in real-time or may have a set delay when the dependent condition or state is satisfied; there is no restriction on the order of execution of the operations performed unless otherwise specified.
4) Web View is a webkit engine-based control for rendering Web pages, including but not limited to: WKWebView and UIWeb View.
The following describes an exemplary application of an apparatus implementing the embodiments of the present disclosure, and the apparatus provided by the embodiments of the present disclosure may be implemented as various types of electronic devices with client functions, such as a tablet computer, a notebook computer, a central processing unit, and the like.
A usage scenario of an interface calling method implementing an embodiment of the present disclosure will now be described with reference to the drawings. Referring to fig. 1, fig. 1 is an application scenario diagram of an interface calling method provided by the embodiment of the present disclosure, in order to support an exemplary application, a server implementing the embodiment of the present disclosure may be a background server, for example, a background server 30, a client 10 (an exemplary client 10-1 and a client 10-2 are shown) is connected to the background server 30 through a network 20, the network 20 may be a wide area network or a local area network, or a combination of the two, and data transmission is implemented using a wireless link.
The client 10 is used for setting a protocol middle layer; monitoring the change condition of the interface through the protocol intermediate layer; according to the change condition of the interface, allocating the calling of the interface so as to realize uniform calling of different interfaces of the operating system through a service layer of the client; the client 10 displays the called corresponding interface in the running process of the client through a graphical interface 110 (an example shows a video display interface 110-1 called by the interface and a video display interface 110-2 called by the interface), and the background server 30 is used for supporting background data of data information to be displayed in the interface calling process in cooperation with the client 10 so as to ensure that different functions of the terminal for normally processing data in the process of calling different interfaces are realized, for example, in the process of calling a soft keyboard function, video data sent by the background server 30 is received, and the like.
Based on the usage environment of the interface calling method shown in fig. 1, a client implementing the embodiment of the present disclosure is first described, and the client may be provided as hardware, software, or a combination of hardware and software. Various exemplary implementations of the client provided by the disclosed embodiments are described below.
The implementation of the client's combination of hardware and software is explained below. Specifically, the hardware structure of the client implementing the embodiment of the present disclosure will now be described with reference to the drawings, and in the following, with reference to fig. 2, fig. 2 is a schematic diagram of an alternative hardware structure of a mobile terminal 200 provided in the embodiment of the present disclosure.
The mobile terminal 200 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as a mobile phone, a notebook computer, a Digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a Portable Android Device, a Portable Multimedia Player (PMP), a car terminal (e.g., a car navigation terminal), and the like, and various types of electronic devices with a server function such as a Digital Television (TV), a desktop computer, and the like. The mobile terminal 200 shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 2, mobile terminal 200 may include a processing device (e.g., central processing unit, graphics processor, etc.) 201 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage device 208 into a Random Access Memory (RAM) 203. In the RAM203, various programs and data necessary for the operation of the mobile terminal 200 are also stored. The processing device 201, the ROM 202, and the RAM203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
Generally, the following devices may be connected to the I/O interface 205: input devices 206 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 207 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 208 including, for example, magnetic tape, hard disk, etc.; and a communication device 209. The communication means 209 may allow the mobile terminal 200 to perform wireless or wired communication with other devices to exchange data. While fig. 2 illustrates a mobile terminal 200 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 209, or installed from the storage means 208, or installed from the ROM 202. The computer program, when executed by the processing device 201, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a ROM, an Erasable Programmable Read-Only Memory (EPROM), an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the server; or may exist separately and not be assembled into the server.
The computer-readable medium carries one or more programs which, when executed by the server, enable the client to: setting a protocol intermediate layer in the client; monitoring the change condition of an interface in the operating system through the protocol intermediate layer; when the state of the interface of the operating system is that the function exists and the interface is not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
As an example of a hardware implementation or a software implementation of the interface invocation means, the interface invocation means may be provided as a series of modules having a coupling relation at the signal/information/data level, which will be described below with reference to fig. 3. Referring to fig. 3, fig. 3 is a schematic diagram of an optional component structure of the interface invoking device provided in the embodiment of the present disclosure, which shows a series of modules included in the implementation of the interface invoking device, but the module structure of the interface invoking device is not limited to that shown in fig. 3, for example, the modules in the interface invoking device may be further split or combined according to different functions implemented.
The following describes a purely hardware implementation of the interface invocation means, which may be in various types of clients for running applications, for example: fig. 3 is a schematic diagram illustrating an optional functional structure of an interface invoking device according to an embodiment of the present disclosure; as shown in fig. 3, the interface calling apparatus 300 includes: a control module 301, a protocol middle layer module 302 and a service layer module 303. The client can call different interfaces in the operating system, and the functions of the modules are described in detail below.
A control module 301, configured to set a protocol middle layer module in the client;
the protocol middle layer module 302 is configured to monitor a change condition of an interface in the operating system;
the protocol middle layer module 302 is configured to intercept a parameter input to an interface of the operating system when the state of the interface is a functional existence and is not exposed to the client, and rewrite the intercepted parameter;
the service layer module 303 is configured to input the rewritten parameter into an interface of the operating system, so as to implement uniform call on different interfaces of the operating system through the service layer of the client.
In some embodiments of the present disclosure, when the first interface corresponding to the soft keyboard calling function in the operating system is not exposed to the client, the protocol middle layer module 302 is configured to rewrite, according to the function information corresponding to the first interface, the parameter of the soft keyboard calling function intercepted by the protocol middle layer module 302 of the client, so as to meet the parameter requirement of the first interface. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 or above, a new version of Web View, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function of calling out the soft keyboard to be realized by the client, the wkwweb View still provides the function of calling the soft keyboard, but does not expose a corresponding interface to the client. According to the technical scheme shown in the embodiment, the protocol intermediate layer intercepts the parameters input to the interface and rewrites the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface for calling out the soft keyboard function can be exposed to the client. Therefore, the interface to be used can still be normally called when the state of the corresponding interface is that the function exists and the corresponding interface is not exposed to the client.
In some embodiments of the present disclosure, the service layer module 303 is configured to input the rewritten parameter of the outgoing software keyboard function into an interface of the operating system; the service layer module 303 is configured to call a first interface corresponding to the outgoing software keyboard function through the rewritten parameter of the outgoing software keyboard function. In the technical solution shown in this embodiment, taking an IOS operating system as an example, in an operating system of an IOS8.0 or above version, the service layer of the client inputs the rewritten parameter of the calling soft keyboard function into the interface of the operating system, and the client can successfully call the first interface for calling the soft keyboard function, which is not originally opened to the client, so as to avoid the unavailability of the calling soft keyboard function due to the wktweb View upgrade. Further, the client will typically be configured with interfaces for some default properties of the web page, such as inline, Media, Play, back, etc. Since wktweb View converges to wktweb View configuration class for this configuration and is used only at initialization time, in order to unify the configuration of web pages, it is necessary to enter setting at initialization time, analyze internally, and configure UIWeb View and wktweb View separately
In some embodiments of the present disclosure, the protocol middle layer module 302 is configured to intercept a parameter input to the interface, and rewrite the intercepted parameter, so as to implement control of the client loading process. Specifically, taking an IOS operating system as an example, in an operating system of an IOS8.0 version or above, by the technical solution shown in this embodiment, intercepting parameters input to the interface through the protocol intermediate layer and rewriting the intercepted parameters can be realized, and in the client triggering and loading process, a client loading process is tracked and whether to execute a jump is determined. Wherein the loading process of the client comprises: page start loading, load completion, and load failure.
In some embodiments of the present disclosure, the service layer module 303 is configured to input the rewritten parameter into an interface of the operating system, so that a corresponding service display interface is on a designated page in a loading process of the client through the service layer module 303 of the client. Specifically, taking an IOS operating system and a short video client as an example, in an operating system of an IOS8.0 version or above, by the technical scheme shown in this embodiment, intercepting parameters input to the interface through the protocol intermediate layer and rewriting the intercepted parameters can be realized, and in the loading process of a page related to the short video client, a soft keyboard is called out to be displayed on the page to be loaded, which is convenient for a user to use.
In some embodiments of the present disclosure, when the change in the interface is a change in name,
the protocol intermediate layer module 302 is configured to perform conversion processing on an interface corresponding to a service logic layer of the client to obtain a target interface; the service layer module 302 is configured to invoke the target interface obtained through the conversion processing. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 version or more, a new version of WebView, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function to be implemented by the client, the operating system still provides a corresponding interface, but the name of the interface exposed to the client is changed, so that the client using the old version UIWeb View cannot call the relevant interface of the operating system.
In some embodiments of the present disclosure, when the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol intermediate layer module 302 is configured to perform local processing on the interface corresponding to the service layer module 302 of the client by using the local code of the client, so as to obtain a target interface; the service layer module 303 is configured to invoke the target interface obtained through the conversion processing. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 or above, a new version of Web View, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function to be implemented by the client, the corresponding function of the interface of the operating system is cancelled, so that the client using the old version UIWeb View cannot call the relevant interface of the operating system.
Fig. 4 is a schematic diagram of an optional flow of the interface calling method provided in the embodiment of the present disclosure, and as shown in fig. 4, the optional flow of the interface calling method provided in the embodiment of the present disclosure includes the following steps:
step 401: setting a protocol intermediate layer in the client;
step 402: monitoring the change condition of an interface in the operating system through the protocol intermediate layer;
step 403: and when the state of the interface of the operating system is that the function exists and the interface is not exposed to the client, intercepting the parameters input to the interface through the protocol intermediate layer and rewriting the intercepted parameters.
Step 404: and the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client.
In some embodiments of the present disclosure, when the state of the interface of the operating system is that a function exists and is not exposed to the client, intercepting, by the protocol intermediate layer, a parameter input to the interface and rewriting the intercepted parameter includes:
when the first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client, the protocol intermediate layer rewrites the parameter of the calling soft keyboard function intercepted by the protocol intermediate layer of the client according to the function information corresponding to the first interface so as to meet the parameter requirement of the first interface. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 or above, a new version of Web View, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function of calling out the soft keyboard to be realized by the client, the wkwweb View still provides the function of calling the soft keyboard, but does not expose a corresponding interface to the client. According to the technical scheme shown in the embodiment, the protocol intermediate layer intercepts the parameters input to the interface and rewrites the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface for calling out the soft keyboard function can be exposed to the client. Therefore, the interface to be used can still be normally called when the state of the corresponding interface is that the function exists and the corresponding interface is not exposed to the client.
In some embodiments of the present disclosure, the inputting the rewritten parameter into the interface of the operating system by the service layer of the client to implement uniform call of different interfaces of the operating system by the service layer of the client includes:
the business layer of the client inputs the rewritten parameters of the calling soft keyboard function into an interface of the operating system; and the service layer of the client calls a first interface corresponding to the calling soft keyboard function through the rewritten parameters of the calling soft keyboard function. In the technical solution shown in this embodiment, taking an IOS operating system as an example, in an operating system of an IOS8.0 or above version, the service layer of the client inputs the rewritten parameter of the calling soft keyboard function into the interface of the operating system, and the client can successfully call the first interface for calling the soft keyboard function, which is not originally opened to the client, so as to avoid the unavailability of the calling soft keyboard function due to the wktweb View upgrade. Further, the client will typically be configured with interfaces for some default properties of the web page, such as inline, Media, Play, back, etc. Since wktweb View converges to wktweb View configuration class for this configuration and is only used at initialization time, in order to unify the configuration of the web page, it is necessary to enter setting at initialization time, analyze internally and configure UIWeb View and wktweb View separately, where WK configuration may adopt the following method:
Figure BDA0001926150150000151
in some embodiments of the present disclosure, the method further comprises:
intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters to realize the control of the client loading process. Specifically, taking an IOS operating system as an example, in an operating system of an IOS8.0 version or above, by the technical solution shown in this embodiment, intercepting parameters input to the interface through the protocol intermediate layer and rewriting the intercepted parameters can be realized, and in the client triggering and loading process, a client loading process is tracked and whether to execute a jump is determined. Wherein the loading process of the client comprises: page start loading, load completion, and load failure.
In some embodiments of the present disclosure, the method further comprises:
and the business layer of the client inputs the rewritten parameters into an interface of the operating system so as to realize that a corresponding business display interface is on a designated page in the loading process of the client through the business layer of the client. Specifically, taking an IOS operating system and a short video client as an example, in an operating system of an IOS8.0 version or above, by the technical scheme shown in this embodiment, intercepting parameters input to the interface through the protocol intermediate layer and rewriting the intercepted parameters can be realized, and in the loading process of a page related to the short video client, a soft keyboard is called out to be displayed on the page to be loaded, which is convenient for a user to use.
In some embodiments of the present disclosure, the method further comprises:
when the change condition of the interface is that the name is changed, the protocol intermediate layer performs conversion processing on the interface corresponding to the service logic layer of the client to obtain a target interface; and the service logic layer calls the target interface obtained through the conversion processing. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 or above, a new version of Web View, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function to be implemented by the client, the operating system still provides a corresponding interface, but the name of the interface exposed to the client is changed, so that the client using the old version UIWeb View cannot call the relevant interface of the operating system.
In some embodiments of the present disclosure, the method further comprises:
when the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol intermediate layer utilizes the local code of the client to carry out local processing on the interface corresponding to the service logic layer of the client to obtain a target interface; and the service logic layer calls the target interface obtained through the conversion processing. Specifically, taking an IOS operating system as an example, in an operating system with an IOS8.0 or above, a new version of Web View, namely WKWeb View, is provided to replace an old version of UIWeb View; for the function to be implemented by the client, the corresponding function of the interface of the operating system is cancelled, so that the client using the old version UIWeb View cannot call the relevant interface of the operating system.
Fig. 5 is a schematic view of an optional flow of the interface calling method provided by the embodiment of the present disclosure, where the client uses a short video client as an example, and the operating system uses an operating system of an IOS8.0 version as an example, as shown in fig. 5, an optional flow of the interface calling method provided by the embodiment of the present disclosure includes the following steps:
step 501: setting a protocol intermediate layer in the client;
step 502: monitoring the change condition of the interface through the protocol intermediate layer;
step 503: judging whether to expose the interface to the client when the interface of the calling soft keyboard function of the operating system exists, if so, executing step 504, and if not, executing step 505;
step 504: normally calling an interface for calling the keyboard function;
step 505: intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters;
step 506: and the business layer of the client inputs the rewritten parameters into an interface of the operating system so as to realize the calling of the interface of the soft keyboard calling function of the operating system through the business layer of the client.
In some embodiments of the disclosure, taking an IOS operating system as an example, in an operating system of an IOS8.0 or above version, a new version of Web View, i.e., wktweb View, is provided to replace an old version of UIWeb View; for the function of calling out the soft keyboard to be realized by the client, the wkwweb View still provides the function of calling the soft keyboard, but does not expose a corresponding interface to the client. According to the technical scheme shown in the embodiment, the protocol intermediate layer intercepts the parameters input to the interface and rewrites the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface for calling out the soft keyboard function can be exposed to the client. Therefore, the interface to be used can still be normally called when the state of the corresponding interface is that the function exists and the corresponding interface is not exposed to the client.
Fig. 6 is a schematic diagram illustrating an alternative usage process of the interface calling method according to the embodiment of the present disclosure, where the client is a client of a short video application, as shown in the figure, a user wants to call a camera function in a short video publishing page to capture video information, and an operating system run by the client is an IOS system. As shown in FIG. 6, in the operating system of IOS8.0 and above, a new version of Web View, i.e., WKWeb View, is provided to replace the old version of UIWebView; for the function of calling out the soft keyboard to be realized by the client, the wkwweb View still provides the function of calling the soft keyboard, but does not expose the corresponding interface to the client. According to the technical scheme shown in the embodiment, the protocol intermediate layer intercepts the parameters input to the interface and rewrites the intercepted parameters; and the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface for calling out the soft keyboard function can be exposed to the client. Therefore, the interface to be used can still be normally called when the state of the corresponding interface is that the function exists and the corresponding interface is not exposed to the client. Furthermore, parameters input to the interface are intercepted through the protocol intermediate layer, the intercepted parameters are rewritten, and the soft keyboard is called out to be displayed on the page to be loaded in the loading process of the page related to the short video client, so that the use of a user is facilitated.
As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as methods, systems, or computer program products. Accordingly, embodiments of the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the disclosed embodiments may take the form of a computer program product embodied on one or more computer-usable storage media (including magnetic disk storage, optical storage, and so forth) having computer-usable program code embodied therein.
Embodiments of the present disclosure are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program operations. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the operations performed by the processor of the computer or other programmable data processing apparatus produce a server for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program operations may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the operations stored in the computer-readable memory produce an article of manufacture including an operations server which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program operations may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the operations executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only exemplary of the present disclosure and should not be taken as limiting the scope of the present disclosure, which is intended to cover any variations, modifications, equivalents, and improvements included within the spirit and scope of the present disclosure.

Claims (16)

1. An interface calling method is used in a client, and the client can call different interfaces in an operating system; characterized in that the method comprises:
setting a protocol intermediate layer in the client;
monitoring the change condition of an interface in the operating system through the protocol intermediate layer;
when the state of the interface of the operating system is that the function exists and the interface is not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters;
and the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer of the client.
2. The method according to claim 1, wherein intercepting, by the protocol intermediate layer, parameters input to the interface and rewriting the intercepted parameters when the state of the interface of the operating system is that a function exists and is not exposed to the client comprises:
when the first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client,
and the protocol intermediate layer rewrites the parameters of the calling soft keyboard function intercepted by the protocol intermediate layer of the client according to the function information corresponding to the first interface so as to meet the parameter requirement of the first interface.
3. The method of claim 2, wherein the inputting the rewritten parameters into the interface of the operating system by the business layer of the client to implement uniform call to different interfaces of the operating system by the business layer of the client comprises:
the business layer of the client inputs the rewritten parameters of the calling soft keyboard function into an interface of the operating system;
and the service layer of the client calls a first interface corresponding to the calling soft keyboard function through the rewritten parameters of the calling soft keyboard function.
4. The method of claim 1, further comprising:
intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters to realize the control of the client loading process.
5. The method of claim 4, further comprising:
and the business layer of the client inputs the rewritten parameters into an interface of the operating system so as to control a corresponding business display interface to be on a designated page in the loading process of the client through the business layer of the client.
6. The method of claim 1, further comprising:
when the change condition of the interface is that the name is changed, the protocol intermediate layer performs conversion processing on the interface corresponding to the service logic layer of the client to obtain a target interface;
and the service logic layer calls the target interface obtained by the conversion processing.
7. The method of claim 1, further comprising:
when the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol intermediate layer utilizes the local code of the client to carry out local processing on the interface corresponding to the service logic layer of the client to obtain a target interface;
and the service logic layer calls the target interface obtained through conversion processing.
8. An interface calling device is used in a client, and the client can call different interfaces in an operating system; characterized in that the device comprises:
the control module is used for setting a protocol intermediate layer module in the client;
the protocol intermediate layer module is used for monitoring the change condition of an interface in the operating system;
the protocol intermediate layer module is used for intercepting parameters input to the interface when the state of the interface of the operating system is functional and is not exposed to the client, and rewriting the intercepted parameters;
and the business layer module is used for inputting the rewritten parameters into the interface of the operating system so as to realize uniform calling of different interfaces of the operating system through the business layer module of the client.
9. The apparatus of claim 8,
when the first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client,
and the protocol intermediate layer module is used for rewriting the parameters of the calling soft keyboard function intercepted by the protocol intermediate layer module of the client according to the function information corresponding to the first interface so as to meet the parameter requirement of the first interface.
10. The apparatus of claim 9,
the business layer module is used for inputting the rewritten parameters of the calling soft keyboard function into an interface of the operating system;
and the service layer module is used for calling a first interface corresponding to the calling soft keyboard function through the rewritten parameters of the calling soft keyboard function.
11. The apparatus of claim 8,
the protocol intermediate layer module is used for intercepting parameters input to the interface and rewriting the intercepted parameters so as to realize the control of the client loading process.
12. The apparatus of claim 11,
and the service layer module is used for inputting the rewritten parameters into the interface of the operating system so as to control the corresponding service display interface to be on a specified page in the loading process of the client through the service layer module of the client.
13. The apparatus of claim 8,
when the change condition of the interface is that the name is changed,
the protocol intermediate layer module is used for converting an interface corresponding to the service logic layer module of the client to obtain a target interface;
and the service layer module is used for calling the target interface obtained through the conversion processing.
14. The apparatus of claim 8,
when the change condition of the interface is that the corresponding function of the interface is cancelled,
the protocol intermediate layer module is used for carrying out local processing on an interface corresponding to the service logic layer module of the client by using the local code of the client to obtain a target interface;
and the service layer module is used for calling the target interface obtained through the conversion processing.
15. A mobile terminal, comprising:
a memory for storing executable instructions;
a processor, configured to implement the interface call method according to any one of claims 1 to 7 when executing the executable instructions.
16. A storage medium having stored thereon executable instructions for implementing an interface call method as claimed in any one of claims 1 to 7 when executed.
CN201811617753.1A 2018-12-28 Interface calling method and device, mobile terminal and storage medium Active CN111381897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811617753.1A CN111381897B (en) 2018-12-28 Interface calling method and device, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811617753.1A CN111381897B (en) 2018-12-28 Interface calling method and device, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111381897A true CN111381897A (en) 2020-07-07
CN111381897B CN111381897B (en) 2024-05-17

Family

ID=

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609792A (en) * 2003-10-24 2005-04-27 微软公司 Programming interface for a computer program
CN101482817A (en) * 2008-12-18 2009-07-15 浙江大学 Large-particle Java component assembly method based on black box
CN103761121A (en) * 2013-12-31 2014-04-30 深圳英飞拓科技股份有限公司 Embedded system and implementation method thereof
CN104461700A (en) * 2013-09-12 2015-03-25 中兴通讯股份有限公司 Application platform configuring method and device
CN106095226A (en) * 2016-06-01 2016-11-09 广州三星通信技术研究有限公司 The method and apparatus of application program is run in electric terminal
CN107864053A (en) * 2017-10-31 2018-03-30 北京小米移动软件有限公司 Dynamic Configuration and device based on zookeeper

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1609792A (en) * 2003-10-24 2005-04-27 微软公司 Programming interface for a computer program
CN101482817A (en) * 2008-12-18 2009-07-15 浙江大学 Large-particle Java component assembly method based on black box
CN104461700A (en) * 2013-09-12 2015-03-25 中兴通讯股份有限公司 Application platform configuring method and device
CN103761121A (en) * 2013-12-31 2014-04-30 深圳英飞拓科技股份有限公司 Embedded system and implementation method thereof
CN106095226A (en) * 2016-06-01 2016-11-09 广州三星通信技术研究有限公司 The method and apparatus of application program is run in electric terminal
CN107864053A (en) * 2017-10-31 2018-03-30 北京小米移动软件有限公司 Dynamic Configuration and device based on zookeeper

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张科;张红娟;: "多接口协议转换器的设计与实现", 信息化研究, no. 07, 20 July 2009 (2009-07-20) *

Similar Documents

Publication Publication Date Title
US10666745B2 (en) Method and procedure for dynamic services orchestration that runs within an on-device software container
CN110070592B (en) Generation method and device of special effect package and hardware device
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
CN111324834B (en) Method, device, electronic equipment and computer readable medium for image-text mixed arrangement
CN114489896B (en) Content display method and device, storage medium and electronic equipment
CN110865846B (en) Application management method, device, terminal, system and storage medium
JP2020004379A (en) Method and device for releasing information, and method and device for processing information
CN111460432B (en) On-line document authority control method, device, equipment and computer readable medium
CN111381897B (en) Interface calling method and device, mobile terminal and storage medium
CN111797160B (en) Method, system and electronic device for sharing intelligent contract
CN111382381B (en) User data sharing method and device, mobile terminal and storage medium
CN111382039A (en) Method, device, electronic equipment and storage medium for reporting user behavior event
CN111381897A (en) Interface calling method and device, mobile terminal and storage medium
CN111381898B (en) Interface calling method and device, mobile terminal and storage medium
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN113518183A (en) Camera calling method and device and electronic equipment
CN111182062A (en) Service multi-live calling method and system and electronic equipment
CN112306317A (en) Unread message notification method and device and electronic equipment
CN110908711A (en) Control development method and device of application program and electronic equipment
CN111324386A (en) Method and device for starting personal application program, electronic equipment and storage medium
CN111885194B (en) Communication method and device for communication application and electronic equipment
CN111796802B (en) Function package generation method and device and electronic equipment

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