CN109582400B - Program calling method and device - Google Patents

Program calling method and device Download PDF

Info

Publication number
CN109582400B
CN109582400B CN201811460068.2A CN201811460068A CN109582400B CN 109582400 B CN109582400 B CN 109582400B CN 201811460068 A CN201811460068 A CN 201811460068A CN 109582400 B CN109582400 B CN 109582400B
Authority
CN
China
Prior art keywords
application
calling
target code
request
software development
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
CN201811460068.2A
Other languages
Chinese (zh)
Other versions
CN109582400A (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 Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201811460068.2A priority Critical patent/CN109582400B/en
Publication of CN109582400A publication Critical patent/CN109582400A/en
Application granted granted Critical
Publication of CN109582400B publication Critical patent/CN109582400B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms

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)

Abstract

The disclosure relates to a program calling method and a device, wherein the method comprises the following steps: sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code; when the target code is stored in the second application, receiving a calling instruction returned by the second application in response to the calling request; and calling the target code in the second application according to the calling instruction. The method and the device can solve the problem of version incompatibility between the SDK and the application program, not only can reduce the volume of the SDK package, but also can ensure the running stability of the SDK.

Description

Program calling method and device
Technical Field
The present disclosure relates to the field of computer software technologies, and in particular, to a method and an apparatus for program calling.
Background
Software engineering often calls some special functions of host Software through an SDK (Software Development Kit) integrated with a third-party APP (Application), for example, when a certain host Software needs to use a payment function, the host Software must integrate the SDK developed by a payment company to complete the function. However, with the continuous update of the SDK function, a phenomenon that the SDK version is incompatible with the local APP version may occur, for example, the function cannot be used due to different implementation codes of the function, or a new function of the SDK is not supported, so that the stability of the SDK may be affected.
Disclosure of Invention
In order to overcome the problems in the related art, embodiments of the present disclosure provide a method and an apparatus for program calling. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a program calling method, applied to a first application, the method including:
sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code;
when the target code is stored in the second application, receiving a calling instruction returned by the second application in response to the calling request;
and calling the target code in the second application according to the calling instruction.
In one embodiment, the object code is not configured in the software development kit, the object code being for implementing an object function.
In one embodiment, sending a call request to a second application to invoke object code using a pre-configured software development kit includes:
acquiring a function protocol for calling the target code from a pre-configured software development kit;
and sending a calling request for calling the target code to the second application according to the functional protocol.
In one embodiment, the method further comprises:
and when the target code is not stored in the second application, receiving first prompt information returned by the second application according to the call request, wherein the first prompt information prompts that the call is failed.
In one embodiment, the method further comprises:
and generating second prompt information when the feedback message sent by the second application is not received in a preset time period, wherein the second prompt information prompts that the calling is failed.
According to a second aspect of the embodiments of the present disclosure, there is provided a program calling method applied to a second application, the method including:
receiving a calling request for calling a target code, which is sent by a first application through a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code;
and when the target code is configured, returning a calling instruction to the first application in response to the calling request so that the first application calls the target code according to the calling instruction.
In one embodiment, the method further comprises:
the object code is pre-configured.
In one embodiment, the method further comprises:
and when the target code is not configured, returning first prompt information to the first application according to the calling request, wherein the first prompt information prompts that the calling fails.
According to a third aspect of the embodiments of the present disclosure, there is provided a program calling apparatus applied to a first application, the apparatus including:
the request module is used for sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, and the software development kit comprises a functional protocol for calling the target code;
a first receiving module, configured to receive, when the target code is stored in the second application, a call instruction returned by the second application in response to the call request;
and the calling module is used for calling the target code in the second application according to the calling instruction.
In one embodiment, the object code is not configured in the software development kit, the object code being for implementing an object function.
In one embodiment, the request module includes:
the acquisition unit is used for acquiring a functional protocol for calling the target code from a pre-configured software development kit;
and the request unit is used for sending a calling request for calling the target code to the second application according to the functional protocol.
In one embodiment, the apparatus further comprises:
and the second receiving module is used for receiving first prompt information returned by the second application according to the calling request when the target code is not stored in the second application, and the first prompt information prompts that the calling fails.
In one embodiment, the apparatus further comprises:
and the generating module is used for generating second prompt information when the feedback message sent by the second application is not received in a preset time period, wherein the second prompt information prompts that the calling is failed.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a program calling apparatus, which is applied to a second application, the apparatus including:
the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for receiving a calling request for calling a target code sent by a first application through a pre-configured software development kit, and the software development kit comprises a functional protocol for calling the target code;
and the indicating module is used for responding to the calling request and returning a calling instruction to the first application when the target code is configured, so that the first application calls the target code according to the calling instruction.
In one embodiment, the apparatus further comprises:
and the configuration module is used for configuring the object code in advance.
In one embodiment, the apparatus further comprises:
and the feedback module is used for returning first prompt information to the first application according to the calling request when the target code is not configured, and the first prompt information prompts that the calling fails.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a program calling apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method of any of the embodiments of the first aspect or to perform the steps of the method of any of the embodiments of the second aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any one of the embodiments of the first aspect, or implement the steps of the method according to any one of the embodiments of the second aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
this disclosed technical scheme can define the functional protocol who realizes the target function in SDK, and the target code who realizes the target function is saved in APP, this target code also follows same functional protocol, when the first application that disposes SDK needs to use the target function, only need according to the functional protocol call the second application be the target code in APP can, so alright effectual avoiding by the realization mode in SDK inconsistent and the compatibility problem that causes in APP, so not only can guarantee SDK's operational stability, but also can reduce the volume of SDK package, make SDK's integration more simple and convenient.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flowchart illustrating a method for program invocation on a first application side in accordance with an illustrative embodiment;
FIG. 2 is a flowchart illustrating a method of program invocation on a first application side in accordance with an illustrative embodiment;
FIG. 3 is a flowchart illustrating a method for program invocation on a first application side in accordance with an illustrative embodiment;
FIG. 4 is a flowchart illustrating a method for program invocation at the second application side in accordance with an illustrative embodiment;
FIG. 5 is a flowchart illustrating a method of program invocation on the second application side in accordance with an illustrative embodiment;
FIG. 6 is a flowchart illustrating a method of program invocation on the second application side in accordance with an illustrative embodiment;
FIG. 7a is a block diagram illustrating a first application-side program invocation device in accordance with an illustrative embodiment;
FIG. 7b is a block diagram illustrating a first application side program invocation device in accordance with an illustrative embodiment;
FIG. 7c is a block diagram illustrating a first application-side program invocation device in accordance with an illustrative embodiment;
FIG. 7d is a block diagram illustrating a first application side program invocation device, according to an exemplary embodiment;
FIG. 8a is a block diagram illustrating a second application-side program invocation device in accordance with an illustrative embodiment;
FIG. 8b is a block diagram illustrating a second application-side program invocation device in accordance with an illustrative embodiment;
FIG. 8c is a block diagram illustrating a second application-side program invocation device in accordance with an illustrative embodiment;
fig. 9 is a block diagram illustrating an apparatus for program invocation according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The technical scheme provided by the embodiment of the disclosure relates to a terminal, in particular to an APP installed in the terminal. In the related art, if host software needs to implement a specific function of an APP, such as a payment function, it is necessary to integrate an SDK corresponding to the APP. In actual operation, the SDK packet may be statically packaged into the host software, and if a compatibility problem occurs between the SDK and its corresponding APP, the SDK itself performs compatibility processing. However, this approach has problems: the development difficulty of the SDK becomes greater and greater as the function is updated and iterated, and even a low-version APP may not be compatible. Based on this, the technical scheme that this disclosure embodiment provided can define the function agreement that realizes the target function in SDK, and the target code that realizes the target function is stored in APP, this target code also follows same function agreement, when the first application that disposes SDK needs to use the target function, only need according to the function agreement call the second application namely the target code in APP can, so just can effectually avoid the compatibility problem that causes by the realization mode in SDK and the realization mode in APP are inconsistent, so not only can guarantee SDK's operational stability, but also can reduce the volume of SDK package, make SDK's integration more simple and convenient.
In the program calling method provided by the technical scheme of the disclosure, an execution main body for implementing the method comprises a first application and a second application. The embodiment of the present disclosure arranges two sets of embodiments according to different implementation main bodies, as follows:
first application side
Fig. 1 illustrates a flowchart of a program calling method provided by an embodiment of the present disclosure. As shown in fig. 1, the program calling method may be applied to a first application, that is, a host application, and specifically includes the following steps S101 to S103:
in step S101, a pre-configured SDK is used to send a call request for calling the target code to the second application, where the SDK includes a function protocol for calling the target code.
For example, the first application is a host application such as a taxi cab APP, the second application is a payment application such as a payment APP, and the SDK of the second application is integrated in the first application. Wherein, a function protocol for realizing the target function is predefined in the SDK, and when the second application can realize the target function, it necessarily also includes a program code following the function protocol, so that the SDK can call the target code through the function protocol. Taking the defined password payment function agreement Pay-password as an example, the first application integrated SDK is configured with the password payment function agreement Pay-password, and the second application is stored with a target code for implementing the password payment function, and the target code also follows the password payment function agreement Pay-password. Based on this, when the first application needs to use a target function, such as a password payment function, a function protocol for calling a target code, namely, a function protocol for password payment, may be obtained from the preconfigured SDK, and a coupling with the second application is established based on the function protocol for password payment, so as to send a call request to the second application, where the call request is used to request to call the target code for implementing the password payment function, and the second application may find whether the target code for implementing the password payment function is currently stored or not when receiving the call request.
In step S102, when the target code is stored in the second application, a call instruction returned by the second application in response to the call request is received.
For example, when the second application detects that object code capable of implementing the target function is currently stored, the second application returns a call instruction to the SDK of the first application, where the call instruction instructs the first application to call the object code. Taking the example that the first application requests to call the target code for realizing the password payment function, when the second application detects the target code for realizing the password payment function, the feedback information including the call instruction can be generated, so that the first application calls the required target code according to the call instruction.
In step S103, the object code in the second application is called according to the call instruction.
For example, when receiving feedback information including a call instruction returned by the second application, the first application may call, according to the call instruction, an object code for implementing a password payment function from the second application, thereby implementing the password payment function.
Based on this, the program calling method provided by the embodiment of the disclosure may define a function protocol for implementing a target function in an SDK integrated by a first application, and configure an object code for implementing the target function in a second application, where the object code also follows the same function protocol, and when the first application configured with the SDK needs to use the target function, only the second application, i.e., the object code in the APP, needs to be called according to the function protocol, so that a compatibility problem caused by inconsistency between an implementation manner in the SDK and an implementation manner in the APP can be effectively avoided, which not only can ensure operation stability of the SDK, but also can reduce a volume of an SDK packet, so that integration of the SDK is simpler and more convenient.
Based on the above description, it can be seen that the SDK of the first application is not configured with the target code for implementing the target function, but only defines a series of function protocols, such as Pay-password function protocol, and the specific program code for implementing the function protocol is stored in the second application, so that the conflict between the SDK and the APP function version can be avoided, and the volume of the SDK package can be reduced.
In one embodiment, referring to fig. 2, the program calling method further includes the following step S104:
in step S104, when the object code is not stored in the second application, first prompt information returned by the second application according to the call request is received, and the first prompt information prompts that the call fails.
For example, when the second application detects that the object code for implementing the target function is not currently stored, for example, the function protocol Pay-fingerprint for the fingerprint payment function is not defined in the second application, the second application cannot provide the object code for implementing the fingerprint payment function. At this time, the second application may not respond to the call request sent by the first application, or may also feed back first prompt information based on the call request sent by the first application, where the first prompt information is used to prompt that the program call fails this time.
Because the SDK of the first application and the object code of the second application are coupled and communicated through the functional protocol, namely the functional protocol is adopted to solve the compatibility problem of different versions of the SDK and the APP. If the SDK of the low version calls the APP of the high version, all functions of the SDK are positively supported; if the SDK of the high version calls the APP of the low version, only the APP is required to be ensured not to respond to the functional protocol which is not defined by the APP, and therefore normal use of other functions of the SDK is not influenced. Therefore, in the development process of the SDK, only functional logic needs to be concerned so as to supplement the protocol, and the compatibility problem of different versions does not need to be considered, so that the integration difficulty of the SDK is simplified, and the volume of an SDK packet is reduced.
In another embodiment, referring to fig. 3, the program calling method further includes the following step S105:
in step S105, when a feedback message sent by the second application is not received within a preset time period, a second prompt message is generated, and the second prompt message prompts that the call fails.
For example, the first application may perform timing after sending the call request to the second application, and if the first application does not receive any feedback message for the call request from the second application within a preset time period, for example, within one minute, including a call instruction indicating that the call is successful and first prompt information indicating that the call is failed, it may be that a relevant function protocol is not defined in the second application, or that timeout is caused by a problem such as a network failure, and the like, at this time, the first application may automatically generate second prompt information when the preset time period ends, for example, one minute arrives, where the second prompt information is used for prompting the program call failure this time. When the second prompt message is generated, an error code can be added according to the actual situation, so that the user can know the specific reason of the call failure.
Based on the method, the first application can prompt the calling state of the target code of the user according to the actual feedback condition of the second application, namely whether the target code is successfully called or not, so that good experience can be provided for the user.
Second application side
Fig. 4 illustrates a flowchart of a program calling method provided by an embodiment of the present disclosure. As shown in fig. 4, the program calling method may be applied to a second application, that is, a functional application, and specifically includes the following steps S401 to S402:
in step S401, a call request for calling a target code sent by a first application through a preconfigured SDK is received, where the SDK includes a functional protocol for calling the target code.
For example, the first application is a host application such as a taxi cab APP, the second application is a payment application such as a payment APP, and the SDK of the second application is integrated in the first application. Wherein, a function protocol for realizing the target function is predefined in the SDK, and when the second application can realize the target function, it necessarily also includes a program code following the function protocol, so that the SDK can call the target code through the function protocol. Taking the Pay-password function as an example, the first application integrated SDK is configured with a Pay-password function, and the second application is configured with a target code for implementing the Pay-password function, which also follows the Pay-password function. Based on this, when the first application needs to use a target function, such as a password payment function, a function protocol for calling a target code, namely, a function protocol for password payment Pay, may be obtained from a preconfigured SDK, and a coupling with the second application is established based on the function protocol for password payment, so that the second application receives a call request sent by the first application, where the call request is used to request to call the target code for implementing the password payment function, and the second application may find whether the target code for implementing the password payment function is currently stored when receiving the call request.
In step S402, when the object code is configured, a call instruction is returned to the first application in response to the call request, so that the first application calls the object code according to the call instruction.
For example, when the second application detects that object code capable of implementing the target function is currently stored, the second application returns a call instruction to the SDK of the first application in response to the received call request, where the call instruction indicates the object code required for the first application to call. Taking the example that the first application requests to call the object code for realizing the password payment function, when the second application detects the object code capable of realizing the password payment function, the feedback information including the call instruction can be generated, so that the first application calls the required object code according to the call instruction, thereby realizing the password payment function.
Based on this, the program calling method provided by the embodiment of the disclosure may define a function protocol for implementing a target function in an SDK integrated by a first application, and configure an object code for implementing the target function in a second application, where the object code also follows the same function protocol, and when the first application configured with the SDK needs to use the target function, only the second application, i.e., the object code in the APP, needs to be called according to the function protocol, so that a compatibility problem caused by inconsistency between an implementation manner in the SDK and an implementation manner in the APP can be effectively avoided, which not only can ensure operation stability of the SDK, but also can reduce a volume of an SDK packet, so that integration of the SDK is simpler and more convenient.
In one embodiment, as shown with reference to fig. 5, the procedure call further includes the following step S403:
in step S403, object code for realizing the object function is configured in advance.
For example, in the second application, an object code for implementing a password payment function may be pre-configured, the object code complying with a password payment function protocol Pay-password. Therefore, when the second application receives the calling request sent by the first application, the second application can allow the first application to call the target code, so that the first application can realize the password payment function.
In another embodiment, referring to fig. 6, the procedure call further includes the following step S404:
in step S404, when the object code is not configured, a first prompt message is returned to the first application according to the call request, and the first prompt message prompts that the call is failed.
For example, when the second application detects that the object code for implementing the target function is not currently stored, for example, the function protocol Pay-fingerprint for the fingerprint payment function is not defined in the second application, the second application cannot provide the object code for implementing the fingerprint payment function. At this time, the second application may not respond to the call request sent by the first application, or may feed back first prompt information according to the call request sent by the first application, where the first prompt information is used to prompt that the program call fails this time.
Because the SDK of the first application and the object code of the second application are coupled and communicated through the functional protocol, namely the functional protocol is adopted to solve the compatibility problem of different versions of the SDK and the APP. If the SDK of the low version calls the APP of the high version, each function of the SDK is positively supported; if the SDK of the high version calls the APP of the low version, only the APP is ensured not to respond to the function protocol which is not defined by the APP, and therefore the normal use of other functions of the SDK is not influenced. Therefore, in the development process of the SDK, only functional logic needs to be concerned so as to supplement the protocol, and the compatibility problem of different versions does not need to be considered, so that the integration difficulty of the SDK is simplified, and the volume of an SDK packet is reduced.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. Fig. 7a is a schematic diagram illustrating a structure of a program calling apparatus, which may be implemented as part or all of an electronic device by software, hardware, or a combination of the two, according to an exemplary embodiment. As shown in fig. 7a, the program calling device may be applied to a first application, namely a host application, and specifically includes a request module 701, a first receiving module 702, and a calling module 703. The request module 701 may be configured to send a call request for calling a target code to a second application by using a pre-configured software development kit, where the software development kit includes a function protocol for calling the target code; the first receiving module 702 may be configured to receive, when the object code is stored in the second application, a call instruction returned by the second application in response to the call request; the calling module 703 may be configured to call the object code in the second application according to the calling instruction.
In one embodiment, the object code is not configured in the SDK, and the object code is used to implement an object function.
In one embodiment, referring to fig. 7b, the request module 701 includes a obtaining unit 7011 and a requesting unit 7012. The obtaining unit 7011 may be configured to obtain, from a pre-configured software development kit, a function protocol for invoking the object code; requesting unit 7012 may be configured to send, to the second application, a call request for calling the target code according to the functional protocol.
In an embodiment, as shown in fig. 7c, the program invoking device further includes a second receiving module 704, where the second receiving module 704 may receive, when the object code is not stored in the second application, a first prompt message returned by the second application according to the invocation request, where the first prompt message prompts that the invocation fails.
In an embodiment, referring to fig. 7d, the program invoking device further includes a generating module 705, where the generating module 705 may generate a second prompt message when a feedback message sent by the second application is not received within a preset time period, where the second prompt message prompts that the invocation fails.
The utility model provides a program calling device, can define the function agreement who realizes the target function in first application integrated SDK, and the configuration realizes the target code of target function in the second application, and this target code also follows same function agreement, when the first application that disposes SDK needs to use the target function, only need according to the function agreement call the second application be the target code in the APP can, so alright effectual avoiding by the realization mode among the SDK inconsistent and the compatibility problem that causes of realization mode among the APP, so not only can guarantee SDK's operating stability, but also can reduce the volume of SDK package, make SDK's integration more simple and convenient.
Fig. 8a is a schematic structural diagram illustrating a procedure call apparatus, which may be implemented as part or all of an electronic device by software, hardware, or a combination of both, according to an exemplary embodiment. As shown in fig. 8a, the program calling device can be applied to a second application, namely, a function application, and specifically includes an obtaining module 801 and an indicating module 802. The obtaining module 801 may be configured to receive a call request for calling a target code, which is sent by a first application through a pre-configured software development kit, where the software development kit includes a function protocol for calling the target code; the indication module 802 may be configured to, when the object code is configured, return a call instruction to the first application in response to the call request, so that the first application calls the object code according to the call instruction.
In one embodiment, as shown in fig. 8b, the program calling device further includes a configuration module 803, and the configuration module 803 may be used to pre-configure the object code for implementing the target function.
In an embodiment, as shown in fig. 8c, the program invoking device further includes a feedback module 804, where the feedback module 804 is configured to return a first prompt message to the first application according to the invocation request when the object code is not configured, and the first prompt message prompts that the invocation fails.
The utility model provides a program calling device, can define the function agreement who realizes the target function in first application integrated SDK, and the configuration realizes the target code of target function in the second application, and this target code also follows same function agreement, when the first application that disposes SDK needs to use the target function, only need according to the function agreement call the second application be the target code in the APP can, so alright effectual avoiding by the realization mode among the SDK inconsistent and the compatibility problem that causes of realization mode among the APP, so not only can guarantee SDK's operating stability, but also can reduce the volume of SDK package, make SDK's integration more simple and convenient.
With regard to the apparatus in the above embodiment, the specific manner of performing the operations by the respective modules thereof has been described in detail in the embodiment related to the method, and will not be elaborated herein.
The embodiment of the present disclosure further provides a program invoking device, which is applicable to a first application, and the device includes:
a first processor;
a first memory for storing first processor-executable instructions;
wherein the first processor is configured to perform:
sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code;
when the target code is stored in the second application, receiving a calling instruction returned by the second application in response to the calling request;
and calling the target code in the second application according to the calling instruction.
In one embodiment, the first processor may be further configured to:
the object code is not configured in the software development kit, and the object code is used for realizing an object function.
In one embodiment, the first processor may be further configured to:
acquiring a function protocol for calling the target code from a pre-configured software development kit;
and sending a calling request for calling the target code to the second application according to the functional protocol.
In one embodiment, the first processor may be further configured to:
and when the target code is not stored in the second application, receiving first prompt information returned by the second application according to the call request, wherein the first prompt information prompts that the call fails.
In one embodiment, the first processor may be further configured to:
and generating second prompt information when the feedback message sent by the second application is not received in a preset time period, wherein the second prompt information prompts that the calling is failed.
Based on this, the program calling device provided by the embodiment of the present disclosure may define a function protocol for implementing a target function in an SDK integrated in a first application, configure an object code for implementing the target function in a second application, and the object code also follows the same function protocol, when the first application configured with the SDK needs to use the target function, only the second application, that is, the object code in the APP, needs to be called according to the function protocol, so that the compatibility problem caused by the inconsistency between the implementation manner in the SDK and the implementation manner in the APP can be effectively avoided, thus not only the operation stability of the SDK can be ensured, but also the volume of an SDK packet can be reduced, so that the integration of the SDK is simpler and more convenient.
The embodiment of the present disclosure further provides a program calling apparatus, which may be applied to a second application, and the apparatus includes:
a second processor;
a second memory for storing second processor-executable instructions;
wherein the second processor is configured to perform:
receiving a calling request for calling a target code, which is sent by a first application through a pre-configured software development kit, wherein the software development kit comprises a function protocol for calling the target code;
and when the target code is configured, returning a calling instruction to the first application in response to the calling request so that the first application calls the target code according to the calling instruction.
In one embodiment, the second processor may be further configured to:
the object code is pre-configured.
In one embodiment, the second processor may be further configured to:
and when the target code is not configured, returning first prompt information to the first application according to the calling request, wherein the first prompt information prompts that the calling fails.
Based on this, the program calling device provided by the embodiment of the present disclosure may define a function protocol for implementing a target function in an SDK integrated in a first application, configure an object code for implementing the target function in a second application, and the object code also follows the same function protocol, when the first application configured with the SDK needs to use the target function, only the second application, that is, the object code in the APP, needs to be called according to the function protocol, so that the compatibility problem caused by the inconsistency between the implementation manner in the SDK and the implementation manner in the APP can be effectively avoided, thus not only the operation stability of the SDK can be ensured, but also the volume of an SDK packet can be reduced, so that the integration of the SDK is simpler and more convenient.
Fig. 9 is a block diagram illustrating a structure of a program calling apparatus 90 according to an exemplary embodiment, where the apparatus 90 is applied to a terminal device. For example, the apparatus 90 may be a mobile telephone, a computer, a digital paging terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
The apparatus 90 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 90, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing component 902 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the apparatus 90. Examples of such data include instructions for any application or method operating on the device 90, contact data, phonebook data, messages, pictures, videos, and the like. The memory 904 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 906 provides power to the various components of the device 90. The power components 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 90.
The multimedia component 908 comprises a screen providing an output interface between the device 90 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 90 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, the audio component 910 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 90 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 further includes a speaker for outputting audio signals.
The I/O interface 912 provides an interface between the processing component 902 and a peripheral interface module, which may be a keyboard, click wheel, button, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the device 90. For example, the sensor assembly 914 may detect the open/closed status of the device 90, the relative positioning of the components, such as the display and keypad of the device 90, the sensor assembly 914 may also detect a change in the position of the device 90 or a component of the device 90, the presence or absence of user contact with the device 90, the orientation or acceleration/deceleration of the device 90, and a change in the temperature of the device 90. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate wired or wireless communication between the apparatus 90 and other devices. The device 90 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a paging signal or paging related information from an external paging management system via a paging channel. In an exemplary embodiment, the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 90 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as memory 904 comprising instructions executable by processor 820 of device 90 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The disclosed embodiment also provides a non-transitory computer readable storage medium, where when instructions in the storage medium are executed by a processor of the apparatus 90, the apparatus 90 is enabled to execute the above-mentioned method for calling a program on the first application side, where the method includes:
sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code;
when the target code is stored in the second application, receiving a calling instruction returned by the second application in response to the calling request;
and calling the target code in the second application according to the calling instruction.
In one embodiment, the object code is not configured in the software development kit, the object code being for implementing an object function.
In one embodiment, sending a call request to a second application to invoke target code using a pre-configured software development kit includes:
acquiring a function protocol for calling the target code from a pre-configured software development kit;
and sending a calling request for calling the target code to the second application according to the functional protocol.
In one embodiment, the method further comprises:
and when the target code is not stored in the second application, receiving first prompt information returned by the second application according to the call request, wherein the first prompt information prompts that the call is failed.
In one embodiment, the method further comprises:
and when the feedback message sent by the second application is not received within a preset time period, generating second prompt information, wherein the second prompt information prompts that the calling is failed.
The disclosed embodiment also provides a non-transitory computer readable storage medium, where when instructions in the storage medium are executed by a processor of the apparatus 90, the apparatus 90 is enabled to execute the second application-side program calling method, where the method includes:
receiving a calling request for calling a target code, which is sent by a first application through a pre-configured software development kit, wherein the software development kit comprises a function protocol for calling the target code;
and when the target code is configured, returning a calling instruction to the first application in response to the calling request so that the first application calls the target code according to the calling instruction.
In one embodiment, the method further comprises:
the object code is pre-configured.
In one embodiment, the method further comprises:
and when the target code is not configured, returning first prompt information to the first application according to the calling request, wherein the first prompt information prompts that the calling fails.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure should be limited only by the attached claims.

Claims (16)

1. A program calling method applied to a first application is characterized by comprising the following steps:
sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code, and the software development kit of the first application and the target code of the second application are in coupling communication through the functional protocol;
when the target code is stored in the second application, receiving a calling instruction returned by the second application in response to the calling request;
calling the object code in the second application according to the calling instruction,
sending a call request for calling the target code to the second application by adopting a pre-configured software development kit comprises the following steps:
acquiring a function protocol for calling the target code from a pre-configured software development kit;
and sending a calling request for calling the target code to the second application according to the functional protocol.
2. The method of claim 1, wherein the object code is not configured in the software development kit, and wherein the object code is used to implement an object function.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the target code is not stored in the second application, receiving first prompt information returned by the second application according to the call request, wherein the first prompt information prompts that the call is failed.
4. The method according to claim 1 or 2, characterized in that the method further comprises:
and when the feedback message sent by the second application is not received within a preset time period, generating second prompt information, wherein the second prompt information prompts that the calling is failed.
5. A program calling method applied to a second application, the method comprising:
receiving a calling request for calling a target code, which is sent by a first application through a pre-configured software development kit, wherein the software development kit comprises a functional protocol for calling the target code, and the software development kit of the first application and the target code of the second application are in coupling communication through the functional protocol;
when the object code is configured, returning a calling instruction to the first application in response to the calling request so as to enable the first application to call the object code according to the calling instruction,
wherein the functional protocol of the object code is used for obtaining a call from a pre-configured software development kit by the first application and sending a call request for calling the object code to the second application according to the functional protocol.
6. The method of claim 5, further comprising:
the object code is pre-configured.
7. The method of claim 5, further comprising:
and when the target code is not configured, returning first prompt information to the first application according to the calling request, wherein the first prompt information prompts that the calling fails.
8. A program calling apparatus, applied to a first application, the apparatus comprising:
the request module is used for sending a calling request for calling a target code to a second application by adopting a pre-configured software development kit, wherein the software development kit comprises a function protocol for calling the target code, and the software development kit of the first application and the target code of the second application are coupled and communicated through the function protocol;
a first receiving module, configured to receive, when the target code is stored in the second application, a call instruction returned by the second application in response to the call request;
a calling module for calling the target code in the second application according to the calling instruction,
wherein the request module comprises:
the acquisition unit is used for acquiring a functional protocol for calling the target code from a pre-configured software development kit;
and the request unit is used for sending a calling request for calling the target code to the second application according to the functional protocol.
9. The apparatus of claim 8, wherein the object code is not configured in the software development kit, and wherein the object code is configured to implement an object function.
10. The apparatus of claim 8 or 9, further comprising:
and the second receiving module is used for receiving first prompt information returned by the second application according to the calling request when the target code is not stored in the second application, and the first prompt information prompts that the calling fails.
11. The apparatus of claim 8 or 9, further comprising:
and the generating module is used for generating second prompt information when the feedback message sent by the second application is not received in a preset time period, wherein the second prompt information prompts that the calling is failed.
12. A program calling apparatus applied to a second application, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for receiving a calling request for calling a target code sent by a first application through a pre-configured software development kit, the software development kit comprises a functional protocol for calling the target code, and the software development kit of the first application and the target code of the second application are coupled and communicated through the functional protocol;
an indication module, configured to, when the target code is configured, return a call instruction to the first application in response to the call request, so that the first application calls the target code according to the call instruction,
the function protocol of the object code is used for obtaining a call from a pre-configured software development kit by the first application, and sending a call request for calling the object code to the second application according to the function protocol.
13. The apparatus of claim 12, further comprising:
and the configuration module is used for configuring the object code in advance.
14. The apparatus of claim 12, further comprising:
and the feedback module is used for returning first prompt information to the first application according to the calling request when the target code is not configured, and the first prompt information prompts that the calling fails.
15. A program calling apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method of any one of claims 1-4, or to perform the steps of the method of any one of claims 5-7.
16. A computer readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1 to 4, or perform the steps of the method of any one of claims 5 to 7.
CN201811460068.2A 2018-11-30 2018-11-30 Program calling method and device Active CN109582400B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811460068.2A CN109582400B (en) 2018-11-30 2018-11-30 Program calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811460068.2A CN109582400B (en) 2018-11-30 2018-11-30 Program calling method and device

Publications (2)

Publication Number Publication Date
CN109582400A CN109582400A (en) 2019-04-05
CN109582400B true CN109582400B (en) 2023-02-21

Family

ID=65925781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811460068.2A Active CN109582400B (en) 2018-11-30 2018-11-30 Program calling method and device

Country Status (1)

Country Link
CN (1) CN109582400B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221840B (en) * 2019-06-05 2023-04-25 百度在线网络技术(北京)有限公司 Function implementation method and device of application program, equipment and storage medium
CN112463515A (en) * 2019-09-09 2021-03-09 北京国双科技有限公司 Data acquisition method and device based on small program, storage medium and electronic equipment
CN112181514B (en) 2019-09-18 2021-08-20 华为技术有限公司 Method and system for realizing plug-in
CN111309407B (en) * 2020-02-21 2023-07-11 咪咕文化科技有限公司 Processing method and device for integrated third party library
CN111400068B (en) * 2020-03-17 2023-09-22 北京字节跳动网络技术有限公司 Interface control method and device, readable medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005008431A2 (en) * 2003-07-11 2005-01-27 Computer Associates Think, Inc. Software development kit for client server applications
CN103647879A (en) * 2013-12-11 2014-03-19 珠海市魅族科技有限公司 Method for displaying application content the terminal thereof
CN105718313A (en) * 2016-01-22 2016-06-29 北京京东尚科信息技术有限公司 Application operation method and device
CN106095423A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 There is provided and browse the method for service, terminal and server
CN107729063A (en) * 2017-10-25 2018-02-23 武汉斗鱼网络科技有限公司 Call method, device and the terminal of SDK

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005008431A2 (en) * 2003-07-11 2005-01-27 Computer Associates Think, Inc. Software development kit for client server applications
CN103647879A (en) * 2013-12-11 2014-03-19 珠海市魅族科技有限公司 Method for displaying application content the terminal thereof
CN105718313A (en) * 2016-01-22 2016-06-29 北京京东尚科信息技术有限公司 Application operation method and device
CN106095423A (en) * 2016-06-02 2016-11-09 腾讯科技(深圳)有限公司 There is provided and browse the method for service, terminal and server
CN107729063A (en) * 2017-10-25 2018-02-23 武汉斗鱼网络科技有限公司 Call method, device and the terminal of SDK

Also Published As

Publication number Publication date
CN109582400A (en) 2019-04-05

Similar Documents

Publication Publication Date Title
CN109582400B (en) Program calling method and device
EP2991275B1 (en) Making router management application compatible with router firmware
EP3200116B1 (en) Method and apparatus for acquiring information via a virtual identity module from lost or stolen terminal
US20170123781A1 (en) Method, device and system for application updating
US9870239B2 (en) Method and device for running application program
EP3010187B1 (en) Method for upgrading and device and apparatus thereof
CN109669730B (en) Process keep-alive method, device, electronic equipment and medium
US11647425B2 (en) Methods and devices for reducing temperature for user equipment
CN108702763B (en) Method and device for sending lead code and scheduling request
CN110839073A (en) Method for acquiring push information, method and device for sending push information
CN113783774A (en) Cross-cluster network configuration method and device, communication equipment and storage medium
CN105578391B (en) Information processing method, device and system and terminal equipment
EP3160112A1 (en) Reminding method and device
CN110547029A (en) information configuration and reporting method and device, base station and user equipment
CN108347718B (en) Method, device and storage medium for monitoring communication packet
CN107371222B (en) Virtual card disabling method and device
CN106990984B (en) Method and device for updating system
CN107733674B (en) Component upgrading method and terminal
CN109885360B (en) Data processing method, device and storage medium
CN107395724B (en) Network request method and device
CN109194639B (en) Message receiving and processing method, device, terminal and readable storage medium
US11910422B2 (en) Methods and apparatuses for self-interference processing
CN109032583B (en) Data interaction method and device
CN107734072B (en) Processing method and device for push information
CN116133120A (en) Time gap request method and device, time gap configuration method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant