CN111381898B - 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
CN111381898B
CN111381898B CN201811618049.8A CN201811618049A CN111381898B CN 111381898 B CN111381898 B CN 111381898B CN 201811618049 A CN201811618049 A CN 201811618049A CN 111381898 B CN111381898 B CN 111381898B
Authority
CN
China
Prior art keywords
interface
client
operating system
middle layer
protocol
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
CN201811618049.8A
Other languages
Chinese (zh)
Other versions
CN111381898A (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 CN201811618049.8A priority Critical patent/CN111381898B/en
Publication of CN111381898A publication Critical patent/CN111381898A/en
Application granted granted Critical
Publication of CN111381898B publication Critical patent/CN111381898B/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)
  • 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 the interface through the protocol middle layer; and allocating the call of the interface according to the change condition of the interface so as 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, an apparatus, a mobile terminal, and a 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 embodiment of the disclosure provides an interface calling method, which is used in a client, wherein 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 the interface through the protocol middle layer;
and allocating the call of the interface according to the change condition of the interface so as to realize unified call of different interfaces of the operating system through the business layer of the client.
In the above solution, the allocating the call of the interface according to the change condition of the interface includes:
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 solution, when the change condition of the interface is that the name changes, the protocol middle layer performs conversion processing on the corresponding interface of the service logic layer of the client to obtain a target interface, including:
when the name of the first interface corresponding to the calling camera function in the operating system changes,
and the protocol middle layer converts the first interface corresponding to the business logic layer of the client according to the function information corresponding to the first interface to obtain information of a second interface, wherein the second interface is used for calling an interface of a camera function after the representation name is changed.
In the above solution, the allocating the call of the interface according to the change condition of the interface includes:
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.
In the above scheme, the method further comprises:
and when the protocol middle layer monitors that the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol middle layer solidifies the codes corresponding to the function in the local codes of the client according to the corresponding function of the interface.
In the above scheme, the method further comprises:
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 embodiment of the disclosure also provides an interface calling device, which is used in the client, and the client can call different interfaces in the 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 the interface through the protocol middle layer;
And the protocol middle layer module is used for allocating the call of the interface according to the change condition of the interface so as to realize unified call of different interfaces of the operating system through the business layer module 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 interface corresponding to the business logic layer module of the client to obtain a target interface;
and the business logic layer module is used for calling the target interface obtained through conversion processing.
In the above-described arrangement, the first and second embodiments,
when the name of the first interface corresponding to the calling camera function in the operating system changes,
the protocol middle layer module is used for converting the first interface corresponding to the business logic layer module of the client according to the function information corresponding to the first interface to obtain information of a second interface, and the second interface is used for calling an interface of a camera function after the representation name is changed.
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 module of the client by utilizing the local code of the client to obtain a target interface;
And the business logic layer module is used for calling the target interface obtained through conversion processing.
In the above-described arrangement, the first and second embodiments,
and when the protocol middle layer monitors that the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol middle layer solidifies the codes corresponding to the function in the local codes of the client according to the corresponding function of the interface.
In the above-described arrangement, the first and second embodiments,
when the state of the interface of the operating system is functional, not exposed to the client,
the protocol middle layer module is used for intercepting parameters input to the interface 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 module of the client.
The embodiment of the disclosure also provides a mobile terminal, which comprises:
a memory for storing executable instructions;
and the processor is used for realizing any one of the interface calling methods provided by the embodiment of the disclosure when executing the executable instructions.
The embodiment of the disclosure also provides a storage medium, which is characterized in that executable instructions are stored, and the executable instructions are used for realizing the interface calling method of any one of the disclosure when being executed.
The embodiment of the disclosure has the following technical effects:
the method can allocate the call of the interface according to the monitored change condition of the interface, when the change condition of the interface is that the name is changed, the corresponding interface is converted to obtain the target interface, when the change condition of the interface is that the corresponding function of the interface is cancelled, the corresponding interface is locally processed by using a local code to obtain the target interface, thereby realizing the uniform call of different interfaces of the operating system through a business layer of the client, and avoiding the interface required by the abnormal call of the client caused by incomplete consistency of the interfaces in the Web View of a new version.
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, the element defined by the phrase "comprising one … …" does not exclude the presence of additional 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 (PDA, personal Digital Assistant), tablet computers (PAD, portable Android Device), portable multimedia players (PMP, 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, liquid Crystal Display), 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 the interface through the protocol middle layer; and allocating the call of the interface according to the change condition of the interface so as 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 the interface call device, the interface call device 300 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 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, through the protocol middle layer, a change condition of the interface;
the protocol middle layer module 302 is configured to allocate the call of the interface according to the change condition of the interface, so as to implement unified call of different interfaces of the operating system through the service layer module of the client.
In some embodiments of the present disclosure, when the change condition of the interface is that the name changes, the protocol middle layer module 302 is configured to perform conversion processing on an interface corresponding to a service logic layer module of the client to obtain a target interface; the service layer module 303 is configured to invoke the target interface obtained through the conversion process. Specifically, taking an IOS operating system as an example, in the operating system of IOS8.0 and above, providing a new version of Web View, i.e., WKWeb View, to replace the old version of uiwbview; for the function to be implemented by the client, the operating system still provides a corresponding interface, but the interface name exposed to the client changes, so that the client using the old version uifeb View cannot call the related interface of the operating system.
In some embodiments of the present disclosure, when a name of a first interface corresponding to a call camera function in the operating system changes, the protocol middle layer module 302 is configured to perform conversion processing on the first interface corresponding to the service logic layer module of the client according to function information corresponding to the first interface, to obtain information of a second interface, where the second interface is used to characterize an interface that calls camera function after the name changes. Specifically, when the wweeb View is used, the name of the interface calling the camera function in the operating system is changed, and the client of the uieeb View cannot call a new interface to realize the function of calling the camera. Through the technical scheme shown in the embodiment, when the name of the first interface corresponding to the call camera function in the operating system is monitored to change, the protocol middle layer performs conversion processing on the first interface corresponding to the business logic layer of the client according to the function information corresponding to the first interface, so as to obtain the information of the second interface, and ensure that the camera function is normally called.
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, by using the local code of the client, the interface corresponding to the service logic layer module of the client, to obtain a target interface; the service layer module 303 is configured to invoke the target interface obtained through the conversion process. Specifically, taking an IOS operating system as an example, in the operating system of IOS8.0 and above, providing a new version of Web View, i.e., WKWeb View, to replace the old version of uiwieb 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 uieeb View cannot call the related interface of the operating system.
In some embodiments of the present disclosure, when the protocol middle layer module 302 monitors that 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 cure the code corresponding to the function in the native code of the client according to the corresponding function of the interface. By taking the IOS operating system as an example and solidifying the cancelled interface function in the local code of the client, the technical scheme can avoid that the corresponding function which can be realized by the uixeb View can not be realized in the use process of the WKWeb View.
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, the protocol middle layer module 302 is configured to intercept parameters input to the interface, 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 module of the client. Specifically, taking an IOS operating system as an example, in the operating system of IOS8.0 and above, the provided WKWeb View replaces the uiwieb View; for the functions to be realized by the client, when the corresponding functions exist and are not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting 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 corresponding function can be exposed to the client. Through the technical scheme of the embodiment, 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. 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 the interface through the protocol middle layer;
step 403: and allocating the call of the interface according to the change condition of the interface.
Therefore, unified calling of different interfaces of the operating system is achieved through the business layer of the client.
In some embodiments of the disclosure, the allocating the call of the interface according to the change condition of the interface includes:
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 an IOS operating system as an example, in the operating system of IOS8.0 and above, providing a new version of Web View, i.e., WKWeb View, to replace the old version of uiwieb View; for the function to be implemented by the client, the operating system still provides a corresponding interface, but the interface name exposed to the client changes, so that the client using the old version uifeb 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 name changes, the protocol middle layer performs conversion processing on the corresponding interface of the service logic layer of the client to obtain a target interface, including:
when the name of the first interface corresponding to the calling camera function in the operating system changes, the protocol middle layer converts the first interface corresponding to the business logic layer of the client according to the function information corresponding to the first interface to obtain information of a second interface, and the second interface is used for representing the interface which calls the camera function after the name changes. Specifically, when the wweeb View is used, the name of the interface calling the camera function in the operating system is changed, and the client of the uieeb View cannot call a new interface to realize the function of calling the camera. Through the technical scheme shown in the embodiment, when the name of the first interface corresponding to the call camera function in the operating system is monitored to change, the protocol middle layer performs conversion processing on the first interface corresponding to the business logic layer of the client according to the function information corresponding to the first interface, so as to obtain the information of the second interface, and ensure that the camera function is normally called.
In some embodiments of the disclosure, the allocating the call of the interface according to the change condition of the interface includes:
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 an IOS operating system as an example, in the operating system of IOS8.0 and above, providing a new version of Web View, i.e., WKWeb View, to replace the old version of uiwieb 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 uieeb View cannot call the related interface of the operating system.
In some embodiments of the present disclosure, the method further comprises:
and when the protocol middle layer monitors that the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol middle layer solidifies the codes corresponding to the function in the local codes of the client according to the corresponding function of the interface. By taking the IOS operating system as an example and solidifying the cancelled interface function in the local code of the client, the technical scheme can avoid that the corresponding function which can be realized by the uixeb View can not be realized in the use process of the WKWeb View.
In some embodiments of the present disclosure, the method further comprises:
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. Specifically, taking an IOS operating system as an example, in the operating system of IOS8.0 and above, the provided WKWeb View replaces the uiwieb View; for the functions to be realized by the client, when the corresponding functions exist and are not exposed to the client, intercepting parameters input to the interface through the protocol intermediate layer, and rewriting 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 corresponding function can be exposed to the client. Through the technical scheme of the embodiment, 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. 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: a protocol middle layer is arranged in the client.
Step 502: and monitoring the change condition of the interface through the protocol middle layer.
Step 503: it is determined whether the name of the interface to be invoked is changed, if so, step 504 is performed, and if not, step 505 is performed.
Step 504: and the protocol middle layer performs conversion processing on the corresponding interface of the business logic layer of the client to obtain a target interface.
Step 505: it is determined whether the interface corresponding function to be called is canceled, if yes, step 506 is executed, otherwise, step 507 is executed.
Step 506: and 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.
Step 507: the target interface is invoked normally.
Step 508: and the service logic layer calls the target interface obtained through conversion processing.
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, i.e., WKWeb View, is provided to replace the old version of uiwieb View; for the function to be implemented by the client, the operating system still provides a corresponding interface, but the interface name exposed to the client is changed, so that the client using the old version uifeb View cannot call the interface of the operating system for calling the camera function.
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 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 UIWeb View; for the function of calling the camera to be implemented by the client, the operating system still provides a corresponding interface, but the interface name exposed to the client changes, so that the client using the old version uieeb View cannot call the related interface of the operating system. And converting the old interface corresponding to the business logic layer of the client according to the call camera function corresponding to the old interface through the protocol middle layer of the client to obtain information of a new interface, wherein the new interface is used for representing the interface which calls the camera function after the name is changed, so that the short video application client can normally call the camera function to shoot video information.
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 (12)

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 middle layer in the client;
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;
wherein the method further comprises:
and when the protocol middle layer monitors that the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol middle layer solidifies the codes corresponding to the function in the local codes of the client according to the corresponding function of the interface.
2. The method according to claim 1, wherein the adapting the call of the interface according to the change condition of the interface includes:
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.
3. The method according to claim 2, wherein when the change condition of the interface is that the name changes, the protocol middle layer performs conversion processing on the corresponding interface of the service logic layer of the client to obtain a target interface, including:
When the name of the first interface corresponding to the calling camera function in the operating system changes,
and the protocol middle layer converts the first interface corresponding to the business logic layer of the client according to the function information corresponding to the first interface to obtain information of a second interface, wherein the second interface is used for calling an interface of a camera function after the representation name is changed.
4. The method according to claim 2, wherein the adapting the call of the interface according to the change condition of the interface includes:
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 business logic layer calls the target interface obtained through conversion processing.
5. The method according to claim 1, wherein the method further comprises:
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.
6. 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;
the protocol middle layer module is used for monitoring the change condition of the interface through the protocol middle layer;
the protocol middle layer module is used for allocating the call of the interface according to the change condition of the interface so as to realize the uniform call of different interfaces of the operating system through the business layer module of the client;
when the protocol intermediate layer monitors that the change condition of the interface is that the corresponding function of the interface is cancelled, the protocol intermediate layer solidifies the codes corresponding to the function in the local codes of the client according to the corresponding function of the interface.
7. The apparatus of claim 6, 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 business logic layer module is used for calling the target interface obtained through conversion processing.
8. The apparatus of claim 7, wherein the device comprises a plurality of sensors,
when the name of the first interface corresponding to the calling camera function in the operating system changes,
the protocol middle layer module is used for converting the first interface corresponding to the business logic layer module of the client according to the function information corresponding to the first interface to obtain information of a second interface, and the second interface is used for calling an interface of a camera function after the representation name is changed.
9. The apparatus of claim 7, 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 business logic layer module is used for calling the target interface obtained through conversion processing.
10. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
when the state of the interface of the operating system is functional, not exposed to the client,
the protocol middle layer module is used for intercepting parameters input to the interface 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 module of the client.
11. 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 5 when executing said executable instructions.
12. A storage medium storing executable instructions which, when executed, are adapted to implement the interface invocation method of any of claims 1 to 5.
CN201811618049.8A 2018-12-28 2018-12-28 Interface calling method and device, mobile terminal and storage medium Active CN111381898B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811618049.8A CN111381898B (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
CN201811618049.8A CN111381898B (en) 2018-12-28 2018-12-28 Interface calling method and device, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111381898A CN111381898A (en) 2020-07-07
CN111381898B true CN111381898B (en) 2023-12-22

Family

ID=71219863

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN111381898B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867831B (en) * 2021-09-08 2024-07-05 深圳Tcl新技术有限公司 Intelligent device control method, intelligent device, storage medium and electronic device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
USH1897H (en) * 1997-09-26 2000-10-03 Dsc/Celcore, Inc. Merged operations and maintenance center and method for operation
US6330006B1 (en) * 1998-05-12 2001-12-11 Silverstream Software, Inc. Method and apparatus for synchronizing an application's interface and data
CN103262025A (en) * 2010-10-01 2013-08-21 Flex Electronics ID Co.,Ltd. Cross-environment communication using application space API
CN104105218A (en) * 2014-07-25 2014-10-15 Tcl通讯(宁波)有限公司 Method and system for achieving Android system mobile phone hotspot WPS connection
CN105843789A (en) * 2016-04-01 2016-08-10 乐视控股(北京)有限公司 Rich text monitoring method and device
CN106095226A (en) * 2016-06-01 2016-11-09 广州三星通信技术研究有限公司 The method and apparatus of application program is run in electric terminal
JP2018005344A (en) * 2016-06-28 2018-01-11 日本電信電話株式会社 Function extension system, function extension method, and function extension program
CN107832099A (en) * 2017-10-26 2018-03-23 咪咕数字传媒有限公司 A kind of client release compatible method, apparatus and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7398361B2 (en) * 2005-08-30 2008-07-08 P.A. Semi, Inc. Combined buffer for snoop, store merging, load miss, and writeback operations
US11265202B2 (en) * 2015-12-04 2022-03-01 Vmware, Inc. Integrated automated application deployment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
USH1897H (en) * 1997-09-26 2000-10-03 Dsc/Celcore, Inc. Merged operations and maintenance center and method for operation
US6330006B1 (en) * 1998-05-12 2001-12-11 Silverstream Software, Inc. Method and apparatus for synchronizing an application's interface and data
CN103262025A (en) * 2010-10-01 2013-08-21 Flex Electronics ID Co.,Ltd. Cross-environment communication using application space API
CN104105218A (en) * 2014-07-25 2014-10-15 Tcl通讯(宁波)有限公司 Method and system for achieving Android system mobile phone hotspot WPS connection
CN105843789A (en) * 2016-04-01 2016-08-10 乐视控股(北京)有限公司 Rich text monitoring method and device
CN106095226A (en) * 2016-06-01 2016-11-09 广州三星通信技术研究有限公司 The method and apparatus of application program is run in electric terminal
JP2018005344A (en) * 2016-06-28 2018-01-11 日本電信電話株式会社 Function extension system, function extension method, and function extension program
CN107832099A (en) * 2017-10-26 2018-03-23 咪咕数字传媒有限公司 A kind of client release compatible method, apparatus and storage medium

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109582310B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN109857486B (en) Method, device, equipment and medium for processing program page data
US20220094758A1 (en) Method and apparatus for publishing video synchronously, electronic device, and readable storage medium
CN111367516B (en) Application interface generation method and device and electronic equipment
CN112286529A (en) Development method, device and equipment of front-end page and storage medium
CN110069308B (en) Page starting method and device, electronic equipment and storage medium
CN110865846B (en) Application management method, device, terminal, system and storage medium
CN111309415B (en) User Interface (UI) information processing method and device of application program and electronic equipment
CN111324376B (en) Function configuration method, device, electronic equipment and computer readable medium
CN111309375A (en) Method, device, medium and electronic equipment for generating remote procedure call toolkit
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
CN111381898B (en) Interface calling method and device, mobile terminal and storage medium
CN113391860B (en) Service request processing method and device, electronic equipment and computer storage medium
CN111314351A (en) Anti-crawler data processing method and device, electronic equipment and storage medium
CN111381897B (en) Interface calling method and device, mobile terminal and storage medium
CN111382381B (en) User data sharing method and device, mobile terminal and storage medium
CN111290812B (en) Display method, device, terminal and storage medium of application control
CN111797160B (en) Method, system and electronic device for sharing intelligent contract
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN111324386B (en) Method and device for starting split application program, electronic equipment and storage medium
CN114237819A (en) Method and device for processing based on Java virtual machine and electronic equipment
CN110086880B (en) Method and apparatus for creating instances of network requests
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

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