CN111381897B - 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
CN111381897B
CN111381897B CN201811617753.1A CN201811617753A CN111381897B CN 111381897 B CN111381897 B CN 111381897B CN 201811617753 A CN201811617753 A CN 201811617753A CN 111381897 B CN111381897 B CN 111381897B
Authority
CN
China
Prior art keywords
interface
client
parameters
operating system
calling
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.)
Active
Application number
CN201811617753.1A
Other languages
Chinese (zh)
Other versions
CN111381897A (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
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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Computer And Data Communications (AREA)

Abstract

The present disclosure provides an interface calling method, which is used in a client, and the client can call different interfaces in an operating system; comprising the following steps: setting a protocol middle layer in the client; monitoring the change condition of an interface in the operating system through the protocol middle layer; when the state of the interface of the operating system is functional, and 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 to realize unified call 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, an apparatus, a mobile terminal, and a storage medium.
Background
In the prior art, the client can call the interfaces with different functions provided by the operating system in the use process, for example, the functions of calling a soft keyboard, calling a camera or starting fingerprint identification (Touch ID) can be called by the corresponding interfaces, but when a Web page View (Web View) exists as an independent plug-in, the version upgrading of the Web View may cause the interfaces which are originally exposed to the client to be incompletely consistent with the interfaces in the Web View of the new version, so that the client cannot call the interfaces required normally.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide an interface calling method, apparatus, and storage medium, which can allocate the call of the interface according to the monitored change condition of the interface, so as to implement unified call of different interfaces of the operating system through the 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, and the client can call different interfaces in an operating system; comprising the following steps:
Setting a protocol middle layer in the client;
monitoring the change condition of an interface in the operating system through the protocol middle layer;
When the state of the interface of the operating system is functional, and 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 to realize unified call of different interfaces of the operating system through the business layer of the client.
In the above solution, when the state of the interface of the operating system is functional, and is not exposed to the client, intercepting, by the protocol intermediate layer, a parameter input to the interface, and overwriting the intercepted parameter, including:
When a first interface corresponding to the expired soft keyboard function in the operating system is not exposed to the client,
And the protocol middle layer rewrites parameters of the function of the call-out soft keyboard 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 requirements of the first interface.
In the above solution, the service layer of the client inputs the rewritten parameters into the interface of the operating system, so as to implement unified call for different interfaces of the operating system through the service layer of the client, including:
The business layer of the client inputs the rewritten parameters of the calling soft keyboard function into the 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 middle 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 the interface of the operating system so as to realize that the 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 middle layer carries out conversion processing on the corresponding interface of the business logic layer of the client to obtain a target interface;
and the service logic layer calls the target interface obtained through 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 middle layer utilizes the local code of the client to carry out local processing on the interface corresponding to the business logic layer of the client so as to obtain a target interface;
and the service logic layer calls the target interface obtained through conversion processing.
The disclosure also provides an interface calling device, which is used in a client, and the client can call different interfaces in an operating system; comprising the following steps:
The control module is used for setting a protocol middle layer module in the client;
The protocol middle layer module is used for monitoring the change condition of an interface in the operating system;
The protocol middle 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 service layer module is used for inputting the rewritten parameters into the interfaces of the operating system so as to realize unified call of different interfaces of the operating system through the service layer of the client.
In the above-described arrangement, the first and second embodiments,
When a first interface corresponding to the expired 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 function of the calling soft keyboard 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 requirements of the first interface.
In the above-described arrangement, the first and second embodiments,
The business layer module is used for inputting the rewritten parameters of the calling soft keyboard function into the 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-described arrangement, the first and second embodiments,
The protocol middle layer module is used for intercepting parameters input to the interface and rewriting the intercepted parameters so as to control the loading process of the client.
In the above-described arrangement, the first and second embodiments,
And the service layer module is used for inputting the rewritten parameters into the interface of the operating system so as to realize that the 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-described arrangement, the first and second embodiments,
When the interface changes in name,
The protocol middle layer module is used for converting the corresponding interface of the business 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-described arrangement, the first and second embodiments,
When the change of the interface is that the corresponding function of the interface is cancelled,
The protocol middle layer module is used for locally processing the interface corresponding to the business logic layer of the client by utilizing 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.
The present disclosure also provides a mobile terminal, including:
a memory for storing executable instructions;
And the processor is used for realizing any one of the interface calling methods provided by the disclosure when executing the executable instructions.
The present disclosure also provides a storage medium storing executable instructions that, when executed, are configured 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 call of the interface according to the change condition of the monitored interface, and intercept parameters input to the interface through the protocol middle layer and rewrite the intercepted parameters when the interface state of the operating system is functional and is not exposed to the client; the business layer of the client inputs the rewritten parameters into the interface of the operating system to realize unified call of different interfaces of the operating system through the business layer of the client, thereby realizing unified call of different interfaces of the operating system through the business layer of the client and avoiding interfaces which are required by the interface which are not completely consistent in the Web View of a new version and are not normally called by the client.
Drawings
Fig. 1 is an application scenario schematic diagram of an interface calling method provided in 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 disclosure;
FIG. 3 is a schematic diagram of an alternative composition of an interface calling device according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of an alternative method for calling an interface according to an embodiment of the disclosure;
FIG. 5 is a schematic flow chart of an alternative method for calling an interface according to an embodiment of the disclosure;
Fig. 6 is a schematic diagram of an alternative use procedure of the interface calling method provided by the embodiment of the disclosure.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings, and the described embodiments should not be construed as limiting the present disclosure, and all other embodiments obtained by those skilled in the art without making inventive efforts are within the scope of protection 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 present disclosure only and is not intended to be limiting of the present 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, such that a method or server comprising a list of elements does not include only those elements explicitly recited, but may include other elements not expressly listed or inherent to such method or server. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other related elements in a method or client comprising the element (e.g., a step in a method or a module in a client, e.g., a module may be part of a circuit, part of a processor, part of a program or software, etc.).
For example, the interface calling method provided in the embodiment of the present disclosure includes a series of steps, but the interface calling method provided in the embodiment of the present disclosure is not limited to the described steps, and similarly, the terminal provided in the embodiment of the present disclosure includes a series of units, but the terminal provided in the embodiment of the present disclosure is not limited to including the explicitly described units, and may also include units that are required to be set when acquiring related information or performing 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 should be 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 explaining the embodiments of the present disclosure in further detail, terms and terminology involved in the embodiments of the present disclosure are explained, and the terms and terminology involved in the embodiments of the present disclosure are applicable to the following explanation.
1) An interface, (API Application Programming Interface) is a set of definitions, programs and protocols that enable the communication between computer software via an API interface. One of the main functions of the interface is to provide a set of functions.
2) The client refers to a program corresponding to the server and providing local service for the client.
3) In response to a condition or state that is used to represent the condition or state upon which the performed operation depends, the performed operation or operations may be in real-time or with a set delay when the condition or state upon which it depends is satisfied; without being specifically described, there is no limitation in the execution sequence of the plurality of operations performed.
4) Web View is a webkit engine-based control that exposes Web pages, including but not limited to: WKWeb View and UIWeb View.
An exemplary application of an apparatus implementing the embodiments of the present disclosure is described below, and the apparatus provided by the embodiments of the present disclosure may be implemented as various types of electronic devices with a client function, such as a tablet computer, a notebook computer, a central processing unit, and the like.
A use scenario of an interface calling method implementing an embodiment of the present disclosure will now be described with reference to the accompanying drawings. Referring to fig. 1, fig. 1 is a schematic application scenario of an interface calling method provided by an embodiment of the present disclosure, in order to support an exemplary application, a server implementing an embodiment of the present disclosure may be a background server, taking a background server 30 as an example, a client 10 (a client 10-1 and a client 10-2 are exemplarily shown) is connected to the background server 30 through a network 20, where 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 middle layer; according to the change condition of the interface, the calling of the interface is allocated so as to realize the uniform calling of different interfaces of the operating system through the business layer of the client; the client 10 displays the corresponding interfaces called in the operation process of the client through a graphic interface 110 (the video display interface 110-1 of interface call and the video display interface 110-2 of interface call are exemplarily shown), and the background server 30 is used for supporting background data of data information to be displayed in the interface call process in cooperation with the client 10, so as to ensure that different functions of the terminal for normally performing data processing 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.
Based on the use environment of the interface calling method shown in fig. 1, a client implementing an embodiment of the disclosure is first described, where the client may be provided as hardware, software, or a combination of hardware and software. Various exemplary implementations of clients provided by embodiments of the present disclosure are described below.
The implementation of the combination of hardware and software of the client is described first. Specifically, a hardware structure of a client implementing an embodiment of the present disclosure will now be described with reference to the accompanying drawings, and referring to fig. 2, fig. 2 is a schematic diagram of an alternative hardware structure of a mobile terminal 200 provided in an embodiment of the present disclosure.
The mobile terminal 200 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, personal Digital Assistants (PDAs), personal computers (PADs, portable Android Device), portable multimedia players (PMPs, portable MEDIA PLAYER), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and various types of electronic devices with server functions such as digital Televisions (TVs), desktop computers, and the like. The mobile terminal 200 shown in fig. 2 is only one example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 2, the mobile terminal 200 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 201, which may perform various appropriate actions and processes according to 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, random Access Memory) 203. In the RAM203, various programs and data required for the operation of the mobile terminal 200 are also stored. The processing device 201, ROM 202, and RAM203 are connected to each other through a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
In general, the following devices may be connected to the I/O interface 205: input devices 206 including, for example, a touch screen, touchpad, 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 communicate with other devices wirelessly or by wire to exchange data. While fig. 2 illustrates a mobile terminal 200 having various devices, it is to be understood that not all illustrated devices are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to 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 shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 209, or from the storage means 208, or from the ROM 202. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 201.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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, erasable Programmable Read-Only Memory), an optical fiber, a portable compact disc read-Only Memory (CD-ROM, compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, radio Frequency (RF), and the like, or any suitable combination thereof.
The computer readable medium may be contained in the server; or may exist alone without being assembled into the server.
The computer readable medium carries one or more programs which, when executed by the server, cause the client to implement: setting a protocol middle layer in the client; monitoring the change condition of an interface in the operating system through the protocol middle layer; when the state of the interface of the operating system is functional, and 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 to realize unified call of different interfaces of the operating system through the business layer of the client.
Computer program code for carrying out operations of the present disclosure may be written in 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 kind of network, including a local area network (LAN, local Area Network) or a wide area network (WAN, wide Area Network), or may be connected to an external computer (e.g., connected through the internet using an internet service provider).
The flowcharts 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 in software or hardware. The name of a module does not in some cases define the module itself.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
As an example of a hardware implementation or a software implementation of the interface invoking means, the interface invoking means may be provided as a series of modules having a coupling relation at the signal/information/data level, as will be described below in connection with fig. 3. Referring to fig. 3, fig. 3 is a schematic diagram of an optional component structure of an interface calling device according to an embodiment of the present disclosure, which shows a series of modules included in implementing the interface calling device, but the module structure of the interface calling device is not limited to that shown in fig. 3, for example, the modules therein may be further split or combined according to different implemented functions.
The following describes a pure hardware implementation of an interface calling device, which may be used in various types of clients for running applications, such as: fig. 3 is a schematic functional structure diagram of an optional interface calling device according to an embodiment of the present disclosure; as shown in fig. 3, the interface calling device 300 includes: a control module 301, a protocol middle layer module 302 and a traffic layer module 303. The client can call different interfaces in the operating system, and the functions of each module 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 parameters input to the interface when the state of the interface of the operating system is functional, and not exposed to the client, and rewrite the intercepted parameters;
The service layer module 303 is configured to input the rewritten parameter into an interface of the operating system, so as to implement unified call to different interfaces of the operating system through the service layer of the client.
In some embodiments of the present disclosure, when a first interface corresponding to an outgoing soft keyboard function in the operating system is not exposed to the client, the protocol middle layer module 302 is configured to rewrite parameters of the outgoing soft keyboard function intercepted by the protocol middle layer module 302 of the client according to function information corresponding to the first interface, so as to meet parameter requirements of the first interface. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the old version of UIWeb View; for the function of the outgoing soft keyboard to be implemented by the client, WKWeb 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, the protocol middle layer intercepts parameters input to the interface and rewrites the intercepted parameters; the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface of the calling soft keyboard function can be exposed to the client. Therefore, the interface which needs to be used can still be normally called when the state of the corresponding interface is functional and is not exposed to the client.
In some embodiments of the present disclosure, the service layer module 303 is configured to input parameters of the rewritten calling soft keyboard function into an interface of the operating system; the service layer module 303 is configured to invoke a first interface corresponding to the outgoing soft keyboard function through the rewritten parameter of the outgoing soft keyboard function. In the technical solution shown in this embodiment, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, the service layer of the client inputs the parameters of the rewritten calling soft keyboard function into the interface of the operating system, and the client can successfully call the first interface for calling soft keyboard function which is not opened to the client, so that the incapacity of using the calling soft keyboard function caused by WKWeb View upgrade is avoided. Further, the client typically configures some default properties of the web page through interfaces, such as inline, media, play, back interfaces. Since WKWeb View converges to WKWeb View Configuration class for this configuration and is only used at initialization, to unify configuration for web pages, it is necessary to enter setting at initialization, parse internally and configure for UIWeb View and WKWeb View respectively
In some embodiments of the present disclosure, the protocol middle layer module 302 is configured to intercept parameters input to the interface, and rewrite the intercepted parameters to implement control of the client loading process. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, by using the technical scheme shown in this embodiment, intercepting parameters input to the interface through the protocol middle layer, and rewriting the intercepted parameters, tracking the client loading process in the client triggering loading process, and determining whether to execute the jump. The loading process of the client comprises the following steps: the page starts loading, loading is completed, and loading fails.
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 as to implement that, in a loading process of the client by the service layer module 303 of the client, a corresponding service display interface is on a designated page. Specifically, taking an IOS operating system and a short video client as an example, in the IOS8.0 and operating systems with versions above, through the technical scheme shown in the embodiment, interception of parameters input to the interface through the protocol intermediate layer can be achieved, the intercepted parameters are rewritten, and in the loading process of a page related to the short video client, a soft keyboard is expired to be displayed on the page to be loaded, so that the use of a user is facilitated.
In some embodiments of the present disclosure, when the change in the interface is a change in name,
The protocol middle layer module 302 is configured to perform conversion processing on the interface corresponding to the 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 process. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the 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 related 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 middle layer module 302 is configured to locally process 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 process. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the old version of UIWeb View; for the function to be implemented by the client, the corresponding function of the operating system interface is cancelled, so that the client using the old version UIWeb View cannot call the related interface of the operating system.
Fig. 4 is a schematic flowchart of an alternative method for calling an interface according to an embodiment of the present disclosure, and as shown in fig. 4, an alternative flow of the method for calling an interface according to an embodiment of the present disclosure includes the following steps:
step 401: setting a protocol middle layer in the client;
Step 402: monitoring the change condition of an interface in the operating system through the protocol middle layer;
Step 403: when the state of the interface of the operating system is functional, and is not exposed to the client, intercepting 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 to realize unified call 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 functional, and is not exposed to the client, intercepting, by the protocol middle layer, a parameter input to the interface, and overwriting the intercepted parameter, including:
And when a first interface corresponding to the calling soft keyboard function in the operating system is not exposed to the client, the protocol middle layer rewrites 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 requirements of the first interface. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the old version of UIWeb View; for the function of the outgoing soft keyboard to be implemented by the client, WKWeb 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, the protocol middle layer intercepts parameters input to the interface and rewrites the intercepted parameters; the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface of the calling soft keyboard function can be exposed to the client. Therefore, the interface which needs to be used can still be normally called when the state of the corresponding interface is functional and is not exposed to the client.
In some embodiments of the present disclosure, the service layer of the client inputs the rewritten parameters into the interface of the operating system, so as to implement unified call to different interfaces of the operating system through the service layer of the client, including:
The business layer of the client inputs the rewritten parameters of the calling soft keyboard function into the 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 the IOS operating system as an example, in the operating system of IOS8.0 and above, the service layer of the client inputs the parameters of the rewritten calling soft keyboard function into the interface of the operating system, and the client can successfully call the first interface for calling soft keyboard function which is not opened to the client, so that the incapacity of using the calling soft keyboard function caused by WKWeb View upgrade is avoided. Further, the client typically configures some default properties of the web page through interfaces, such as inline, media, play, back interfaces. Since WKWeb View converges to WKWeb ViewConfiguration class for this configuration and is only used at initialization, in order to unify the configuration for the web page, it is necessary to enter setting at initialization, parse internally and configure for UIWeb View and WKWeb View respectively, where WK configuration can be as follows:
In some embodiments of the present disclosure, the method further comprises:
Intercepting parameters input to the interface through the protocol middle layer, and rewriting the intercepted parameters to realize the control of the client loading process. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, by using the technical scheme shown in this embodiment, intercepting parameters input to the interface through the protocol middle layer, and rewriting the intercepted parameters, tracking the client loading process in the client triggering loading process, and determining whether to execute the jump. The loading process of the client comprises the following steps: the page starts loading, loading is completed, and loading fails.
In some embodiments of the present disclosure, the method further comprises:
And the business layer of the client inputs the rewritten parameters into the interface of the operating system so as to realize that the 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 the IOS8.0 and operating systems with versions above, through the technical scheme shown in the embodiment, interception of parameters input to the interface through the protocol intermediate layer can be achieved, the intercepted parameters are rewritten, and in the loading process of a page related to the short video client, a soft keyboard is expired to be displayed on the page to be loaded, so that the use of a user is facilitated.
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 middle layer carries out conversion processing on the corresponding interface of the business logic layer of the client to obtain a target interface; and the service logic layer calls the target interface obtained through conversion processing. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the 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 related 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 middle layer utilizes the local code of the client to carry out local processing on the interface corresponding to the business logic layer of the client so as to obtain a target interface; and the service logic layer calls the target interface obtained through conversion processing. Specifically, taking the IOS operating system as an example, in the operating system of IOS8.0 and above, a new version of Web View, that is WKWeb View, is provided to replace the old version of UIWeb View; for the function to be implemented by the client, the corresponding function of the operating system interface is cancelled, so that the client using the old version UIWeb View cannot call the related interface of the operating system.
Fig. 5 is a schematic flow chart of an alternative method for calling an interface provided by an embodiment of the present disclosure, where the client is exemplified by a short video client, and the operating system is exemplified by an IOS8.0 version of operating system, as shown in fig. 5, and an alternative flow chart of the method for calling an interface provided by the embodiment of the present disclosure includes the following steps:
step 501: setting a protocol middle layer in the client;
Step 502: monitoring the change condition of the interface through the protocol middle layer;
Step 503: judging whether the interface is exposed to the client when the interface of the calling soft keyboard function of the operating system exists, if so, executing step 504, otherwise, executing step 505;
Step 504: normally calling an interface calling out a natural 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 the interface of the operating system to realize the calling of the interface of the calling soft keyboard function of the operating system through the business layer of the client.
In some embodiments of the present disclosure, taking IOS operating systems as an example, in IOS8.0 and above versions of operating systems, a new version of Web View, WKWeb View, is provided to replace the old version of UIWeb View; for the function of the outgoing soft keyboard to be implemented by the client, WKWeb 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, the protocol middle layer intercepts parameters input to the interface and rewrites the intercepted parameters; the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface of the calling soft keyboard function can be exposed to the client. Therefore, the interface which needs to be used can still be normally called when the state of the corresponding interface is functional and is not exposed to the client.
Fig. 6 is a schematic diagram of an alternative use process of the interface calling method provided by the embodiment of the present disclosure, where the client is a client of a short video application, as shown in the drawing, a user wants to call a camera function in a short video publishing page to capture video information, and an operating system running on the client is an IOS system. As shown in fig. 6, in the IOS8.0 and above version of the operating system, a new version of Web View, WKWeb View, is provided to replace the old version of UIWeb View; for the function of the outgoing soft keyboard to be implemented for the client, WKWeb 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, the protocol middle layer intercepts parameters input to the interface and rewrites the intercepted parameters; the business layer of the client inputs the rewritten parameters into the interface of the operating system, so that the interface of the calling soft keyboard function can be exposed to the client. Therefore, the interface which needs to be used can still be normally called when the state of the corresponding interface is functional and is not exposed to the client. Further, parameters input to the interface are intercepted through the protocol middle layer, the intercepted parameters are rewritten, and in the loading process of the related page of the short video client, a soft keyboard is expired to be displayed on the page to be loaded, so that the user can use the device conveniently.
It will be apparent to those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the disclosed embodiments may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present disclosure may take the form of a computer program product on one or more computer-usable storage media (including disk storage, optical storage, etc.) 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 operation server which implements 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 performed 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 foregoing description of the preferred embodiments of the present disclosure is not intended to limit the scope of the present disclosure, but is intended to cover any modifications, equivalents, and improvements within the spirit and principles 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:
after the webpage view of the client is updated, setting a protocol middle layer in the client;
monitoring the change condition of the updated interface in the webpage view in the operating system through the protocol middle layer;
When the state of the interface is functional and is not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting the intercepted parameters; the rewritten parameters meet the parameter requirements of the interface;
And the business layer of the client inputs the rewritten parameters into the interface so as to expose the interface to the client, thereby realizing unified calling of different interfaces of the operating system through the business layer of the client.
2. The method according to claim 1, wherein intercepting parameters input to the interface through the protocol middle layer and overwriting the intercepted parameters when the state of the interface is functional presence and not exposed to the client comprises:
When a first interface corresponding to the expired soft keyboard function in the operating system is not exposed to the client,
And the protocol middle layer rewrites parameters of the function of the call-out soft keyboard 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 requirements of the first interface.
3. The method of claim 2, wherein the business layer of the client inputs the rewritten parameters into the interface to expose the interface to the client to enable unified invocation of different interfaces of the operating system by the business layer of the client, comprising:
The business layer of the client inputs the rewritten parameters of the calling soft keyboard function into the interface;
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 according to claim 1, wherein the method further comprises:
Intercepting parameters input to the interface through the protocol middle layer, and rewriting the intercepted parameters to realize the control of the client loading process.
5. The method according to claim 4, wherein the method further comprises:
And the business layer of the client inputs the rewritten parameters into the interface so as to control the 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 according to claim 1, wherein the method further comprises:
when the change condition of the interface is that the name is changed, the protocol middle layer carries out conversion processing on the interface corresponding to the business 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 according to claim 1, wherein the method further comprises:
When the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol middle layer utilizes the local code of the client to carry out local processing on the interface corresponding to the business logic layer of the client so as to obtain a target interface;
and the service logic layer calls a target interface obtained through local 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 middle layer module in the client after the webpage view of the client is updated;
the protocol middle layer module is used for monitoring the change condition of the updated interface in the webpage view in the operating system;
The protocol middle layer module is used for intercepting parameters input to the interface when the state of the interface is functional and is not exposed to the client, and rewriting the intercepted parameters; the rewritten parameters meet the parameter requirements of the interface;
And the business layer module is used for inputting the rewritten parameters into the interface so as to expose the interface to the client, thereby realizing unified calling of different interfaces of the operating system through the business layer module of the client.
9. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
When a first interface corresponding to the expired 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 function of the calling soft keyboard intercepted by the protocol middle layer module of the client according to the function information corresponding to the first interface so as to meet the parameter requirements of the first interface.
10. The apparatus of claim 9, wherein the device comprises a plurality of sensors,
The business layer module is used for inputting the rewritten parameters of the calling soft keyboard function into the interface;
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, wherein the device comprises a plurality of sensors,
The protocol middle layer module is used for intercepting parameters input to the interface and rewriting the intercepted parameters so as to control the loading process of the client.
12. The apparatus of claim 11, wherein the device comprises a plurality of sensors,
And the service layer module is used for inputting the rewritten parameters into the interface so as to realize the control of the corresponding service display interface on a designated page in the loading process of the client.
13. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
When the interface changes in name,
The protocol middle layer module is used for converting the interface corresponding to the business 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 conversion processing.
14. The apparatus of claim 8, wherein the device comprises a plurality of sensors,
When the change of the interface is that the corresponding function of the interface is cancelled,
The protocol middle layer module is used for locally processing the interface corresponding to the business logic layer module of the client by utilizing the local code of the client to obtain a target interface;
And the service layer module is used for calling the target interface obtained by the local processing.
15. A mobile terminal, comprising:
a memory for storing executable instructions;
a processor for implementing the interface call method according to any one of claims 1 to 7 when executing said executable instructions.
16. A storage medium storing executable instructions which, when executed, are adapted to implement the interface invocation method of any of claims 1 to 7.
CN201811617753.1A 2018-12-28 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 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 2018-12-28 Interface calling method and device, mobile terminal and storage medium

Publications (2)

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

Family

ID=71214663

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN111381897B (en)

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
多接口协议转换器的设计与实现;张科;张红娟;;信息化研究;20090720(07);全文 *

Also Published As

Publication number Publication date
CN111381897A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
CN110489101B (en) Interface simulation method, system, medium and electronic equipment
CN109753332B (en) Method and device for displaying information
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
CN110865846B (en) Application management method, device, terminal, system and storage medium
CN111400068B (en) Interface control method and device, readable medium and electronic equipment
JP2020004379A (en) Method and device for releasing information, and method and device for processing information
CN114489896B (en) Content display method and device, storage medium and electronic equipment
CN109800020B (en) Automatic code adjusting method, device, equipment and medium for program development
CN111381897B (en) Interface calling method and device, mobile terminal and storage medium
CN113296762B (en) Page embedding method and device, storage medium and electronic equipment
CN110618811A (en) Information presentation method and device
CN111382381B (en) User data sharing method and device, mobile terminal and storage medium
CN111381898B (en) Interface calling method and device, mobile terminal and storage medium
CN110086880B (en) Method and apparatus for creating instances of network requests
CN111797160B (en) Method, system and electronic device for sharing intelligent contract
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN110113416B (en) Method and device for displaying information
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN113778566A (en) Native application calling method and device, electronic equipment and computer readable medium
CN110908711A (en) Control development method and device of application program and electronic equipment
CN111182062A (en) Service multi-live calling method and system and electronic equipment
CN111324386A (en) Method and device for starting personal application program, electronic equipment and storage medium
CN110099122B (en) Method and apparatus for sending network request
CN111885194B (en) Communication method and device for communication application 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
GR01 Patent grant