CN112882732A - Method and device for updating function codes in Software Development Kit (SDK) - Google Patents

Method and device for updating function codes in Software Development Kit (SDK) Download PDF

Info

Publication number
CN112882732A
CN112882732A CN202110090820.4A CN202110090820A CN112882732A CN 112882732 A CN112882732 A CN 112882732A CN 202110090820 A CN202110090820 A CN 202110090820A CN 112882732 A CN112882732 A CN 112882732A
Authority
CN
China
Prior art keywords
sdk
function code
version
version information
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110090820.4A
Other languages
Chinese (zh)
Inventor
朱德亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110090820.4A priority Critical patent/CN112882732A/en
Publication of CN112882732A publication Critical patent/CN112882732A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The specification discloses a method and a device for updating function codes in a Software Development Kit (SDK). A method for updating function codes in a Software Development Kit (SDK), wherein the SDK is internally provided with a trigger engine, and the method comprises the following steps: after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine; receiving the version information sent by the SDK server; judging whether to execute the updating operation of the function code based on the version information; and if so, executing updating operation on the function code based on the version information.

Description

Method and device for updating function codes in Software Development Kit (SDK)
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for updating function codes in a software development kit SDK.
Background
An SDK (Software Development Kit) generally refers to a collection of Development tools used by a Software engineer to build application Software for a particular Software package, Software framework, hardware platform, operating system, etc. Currently, some application software installed in a terminal usually has an SDK built therein to implement corresponding functions. When a developer repairs or changes the SDK, how to update the SDK on the application software in time becomes a key point of attention in the industry.
Disclosure of Invention
In view of the above, the present specification provides a method and an apparatus for updating function codes in a software development kit SDK.
Specifically, the description is realized by the following technical scheme:
a method for updating function codes in a Software Development Kit (SDK), wherein the SDK is internally provided with a trigger engine, and the method comprises the following steps:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
An apparatus for updating function codes in a Software Development Kit (SDK), wherein the SDK is internally provided with a trigger engine, comprising:
the request unit is used for sending a version information acquisition request to the SDK server based on a built-in trigger engine after receiving a calling instruction sent by application software;
the receiving unit is used for receiving the version information sent by the SDK server;
a judging unit that judges whether or not an update operation of the function code is performed based on the version information;
and if so, executing updating operation on the function code based on the version information.
An apparatus for updating function codes in a Software Development Kit (SDK), comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to update logic of functional code in a Software Development Kit (SDK), the processor is caused to:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
One embodiment of the present specification realizes that a trigger engine may be built in an SDK, and after the SDK receives a call instruction sent by an application, the trigger engine may send a version information acquisition request to an SDK server, determine whether to execute an update operation of a function code based on version information sent by the SDK server, and update an existing function code based on the version information when the update operation is required.
By adopting the method, the updating code can be loaded based on the trigger engine built in the SDK so as to interact with the SDK server, and the updated function code provided by the server is obtained so as to be updated. Therefore, the SDK can be updated in time, and the use experience of a user is improved.
Drawings
FIG. 1 is a flowchart diagram illustrating a method for updating functional code in a software development kit SDK, in accordance with an exemplary embodiment of the present specification;
FIG. 2 is a diagram illustrating a multi-party interaction of a method for updating function code in a software development kit SDK according to an exemplary embodiment of the present disclosure;
FIG. 3 is a hardware block diagram of an apparatus for updating function code in a software development kit SDK according to an exemplary embodiment of the present specification;
fig. 4 is a block diagram illustrating an apparatus for updating function code in a software development kit SDK according to an exemplary embodiment of the present specification.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
SDK (software development kit) is a collection of development tools. When developing an application, a technician may embed the SDK into the application to directly use the functions provided by the SDK. For example, an application may want to provide the functionality of face-brushing payments, but the application itself does not develop code related to this functionality. Then, the application program may integrate a face-brushing payment SDK developed by other technicians, when the user initiates a face-brushing payment request, the application program may call the SDK, and the SDK may call a camera to acquire a face image of the user, compare the face image with a standard face image library, or perform matching based on a face recognition model, determine real-name identity information of the user, and then perform payment operation for the user.
In the related art, a technician may repair or change the SDK to obtain a new version of the SDK, and update the old version of the SDK built in the application program with the new version of the SDK.
A common update method is that an SDK built in an application program may call a system API to request a server to obtain update information for updating. However, due to the upgrade of the operating systems such as the android system and the IOS system, the system API is disabled after the upgrade due to the security, that is, the SDK is no longer allowed to call the system API, and then the SDK cannot be upgraded according to the method. In this case, if the user wants to update the SDK built in the application, the user can only download and install the new version of the SDK manually, which may result in the update of the SDK being too passive, and if the SDK is not updated in time, the user may be lost, and the user experience may be affected.
Based on this, the present specification provides an updating method and apparatus for function codes in a software development kit SDK, which may embed a trigger engine in the SDK, and load codes in the SDK through the trigger engine, so that the SDK may request update information to a server for updating. The type of trigger engine may be related to the programming language of the code in the SDK, among other things. For example, when the code in the SDK is written in the java language, then a JavaScript engine may be used. The embodiment is not particularly limited to the type of programming language of the code in the SDK and the type of engine.
First, the SDK in this specification is described, where the SDK in this specification may include two codes, which are a function code and an update code, respectively, and the function code is a code that can implement a function provided by the SDK, such as the face-brushing payment function mentioned in the foregoing example. The update code is different from the function code, and the update code is a code for realizing the SDK update related process, and for example, the function code for requesting the SDK server to obtain the update information, downloading and installing the SDK of the latest version can be realized. Both the update code and the function code may be loaded based on a trigger engine built into the SDK.
The following describes a method for updating function codes in an SDK provided in this specification.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for updating function codes in a software development kit SDK according to an exemplary embodiment of the present specification, including the following steps:
and step 102, after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine.
And 104, receiving the version information sent by the SDK server.
In this embodiment, when the application software needs to call the SDK, a call instruction may be sent to the SDK. For example, the SDK may be invoked by using java language invocation, including object name-based invocation, keyword-based invocation, and the like, which refer to the related art specifically, and this specification does not describe herein one by one.
After the SDK is invoked, code may be loaded based on a built-in trigger engine. In this embodiment, steps 102-108 are all executed by triggering the engine to load the update code.
First, a version information acquisition request may be sent to the SDK server based on the trigger engine.
In one example, the version information acquisition request may be sent to the server after each invocation.
In another example, after each call, it may be determined whether to send the version information obtaining request to the server based on a preset rule.
For example, the number of times of receiving the call instruction may be counted, after the call instruction is received, whether the current count value reaches a number threshold is determined, and if the current count value does not reach the number threshold, the function code may be directly loaded based on the trigger engine in the call to implement the function of the SDK itself; if the current time is reached, a version information acquisition request can be sent to the server side in the calling, the updated function codes are downloaded and installed, then the updated function codes are loaded based on the trigger engine, and the count value is cleared to carry out the next counting period.
For another example, a time period, such as 3 days, may also be set. The current time can be recorded and timing is started when a call instruction is received for the first time, and when the timing duration does not reach 3 days, if the call instruction is received in the time, a function code is loaded to realize the function of the SDK; when the timing duration reaches 3 days, if a calling instruction is received, sending a version information acquisition request to the server, downloading and installing the updated function code, then loading the updated function code based on the trigger engine, and resetting the timing duration to enter the next timing period. Certainly, the SDK may also automatically request the server to obtain version information for updating after the time duration is reached, and it is not necessary to receive a call instruction sent by the application software and then determine whether the time duration is reached, which is not particularly limited in this embodiment.
In this example, the address of the SDK server may be configured initially, and the version information obtaining request may be sent to the corresponding SDK server based on the address.
After receiving the request, the SDK server may send version information to the SDK, where the version information may be a latest version number, a latest version name, a release time of the latest version, and the like of the SDK, and this embodiment does not specially limit this.
The SDK of the latest version may be obtained by modifying the function code in the SDK of the old version by a technician, the SDK of the latest version may only include the function code, or may include the function code and an update code, and the update code may be the same as the update code in the SDK of the old version.
And 106, judging whether to execute the updating operation of the function code based on the version information.
In this embodiment, when the version information is the latest version number of the SDK, it may be compared whether the current version is consistent with the latest version number, and if so, it indicates that updating is not required; if not, the update is required.
Of course, when the version information is the name of the latest version, the release time of the latest version, and the like, it may also be compared whether the received version information is consistent with the current version information, so as to determine whether the version information needs to be updated, which is not exemplified herein.
It should be noted that, in other examples, the SDK server may determine whether the update is needed. For example, when sending the acquired version information to the SDK server in step 102, the current version information of the SDK may also be added to the request, and the SDK server may compare whether the current version information is consistent with the latest version information, and if so, the SDK server may directly return a message that does not need to be updated to the SDK; if not, the SDK server side can directly return a message needing updating to the SDK, and can also add a download address of the SDK with the latest version in the message. This specification does not specifically limit this.
And 108, if so, executing an updating operation on the function code based on the version information.
In this embodiment, if the update is required, the SDK of the latest version may be downloaded and installed based on the download address corresponding to the SDK of the latest version, so as to implement the update. The following description will be given taking an example in which only the latest version of the function code is included in the latest version of the SDK.
In one example, after determining that the update is needed, the SDK server may be requested to obtain a download address, and after receiving the request, the SDK server may send the download address, may download the latest version of the SDK based on the download address, and then replace the function code in the existing version of the SDK with the function code in the latest version of the SDK.
In another example, after sending the version information obtaining request to the SDK server in step 102, the SDK server may send the latest version number and the corresponding download address, and then after comparing that the latest version number is inconsistent with the current version number, the function code in the SDK of the latest version may be downloaded and installed directly based on the download address.
In this embodiment, after the function code in the SDK of the latest version is installed, the updated function code may be loaded based on a trigger engine built in the SDK, so as to implement the function of the SDK.
As can be seen from the above description, in an embodiment of the present specification, a trigger engine may be built in the SDK, and after receiving a call instruction sent by an application program, the trigger engine may send a version information acquisition request to the SDK server, determine whether to execute an update operation based on the version information sent by the SDK server, and update an existing function code based on the version information when the update is needed.
By adopting the method, on one hand, because the trigger engine is arranged in the SDK, the update code can be loaded based on the trigger engine to interact with the SDK server, and the updated function code provided by the server is obtained to update, and the system API is not required to be called in the process, so that the problem that the SDK cannot be updated due to the fact that the system API cannot be called in the related technology is solved, and the method can be suitable for various operating systems such as an android system and an IOS system. On the other hand, the new version of the SDK package may only contain the function code, so that after the new version of the SDK package is downloaded, only the function code in the existing version of the SDK package may be updated without updating the whole SDK package, and the influence on the existing version of the SDK package is small.
Moreover, by adopting the method, the SDK can be automatically updated when the application system calls the SDK, the user does not need to actively initiate the update, the use experience is better for the user, and the use of the normal function of the SDK is not influenced.
Another method for updating the function code in the software development kit SDK provided in the present specification is described below.
In this embodiment, the function code in the SDK is compiled in a WebAssembly (WASM, web assembly language for short) format, and the trigger engine built in the SDK is a WAMR (WebAssembly Micro Runtime, web assembly language Micro Runtime) engine. The following briefly describes WASM and WAMR.
WASM is a binary instruction format designed for stacked virtual machines, introduced by the W3C community organization, and is a new platform-independent intermediate bytecode format. The code is a new type of code which can be executed by a browser, aims to obtain better performance on the network, has the characteristics of small volume, fast loading and fast speed, and can meet the high-performance requirements of application software such as games, video editing, 3D rendering or music production and the like. Also, the technician need not write the WASM code directly, but can compile from other high-level languages. The WAMR is an engine that executes WASM bytecode, based on which WASM bytecode packages can be loaded.
In this embodiment, after a technician can write the code (function code and update code) of the SDK using a high-level language such as c + +, the code is compiled into the WASM format, and the WAMR engine is built in the SDK. On one hand, an update code can be loaded based on the built-in WAMR engine of the SDK so as to request the server to acquire the update information for updating, and a system API is not required to request to acquire the update information, so that the problem that the update cannot be performed due to the fact that the system API is forbidden can be avoided; on the other hand, because the function code is also in the WAMR format, the code written in the format has fewer bytes and faster loading, thereby providing better performance, and the function code can be dynamically loaded based on the WAMR engine without calling a system API to dynamically load the code. The method can automatically update the SDK without influencing the user experience, thereby avoiding the loss of the user.
In the following description of the embodiments, unless otherwise specified, the SDKs described below refer to SDKs written based on the WASM format, and the engines refer to WAMR engines.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating a multi-party interaction of a method for updating function codes in a software development kit SDK according to an exemplary embodiment of the present disclosure. The method may comprise the following steps
At step 202, the application software sends a call instruction to the SDK.
In step 204, the SDK determines whether the number of times the call instruction is received reaches a number threshold.
And step 206, if yes, the SDK sends a request for acquiring the latest version number to the SDK server based on the engine.
In this embodiment, the SDK may count the number of times of the received call instruction, assuming that the current count value is n, after receiving the call instruction sent by the application software, the SDK may count the count value +1 to obtain a count value of n +1, and then the SDK may determine whether n +1 is equal to a preset number threshold k, and if so, send a latest version number acquisition request to the SDK server, and mark the count value as 0; if (n +1) < k, the SDK may load a function code based on the built-in WAMR engine in the call, so as to implement the function provided by the SDK.
And step 208, the SDK server sends the latest version number and the download address to the SDK.
In step 210, the SDK determines whether the latest version number is consistent with the current version number.
If yes, the SDK downloads the SDK of the latest version, step 212.
In this embodiment, if the latest version number is not consistent with the current version number, the SDK may download the SDK of the latest version based on the download address. If the latest version number is consistent with the current version number, the SDK does not need to be updated, and a function code can be loaded based on a built-in WAMR engine to realize the function provided by the SDK.
And step 214, the SDK performs security check on the downloaded SDK of the latest version.
In this embodiment, the SDK may perform security verification on the downloaded data, for example, the SDK may perform the verification by using an MD5 verification method, which may specifically refer to related technologies, and this description is not described herein. If the security check passes, the SDK may perform step 218; if the security check fails, the SDK may re-download the SDK of the latest version based on the download address, or may re-request the SDK server to obtain the download address of the SDK of the latest version.
Step 216, install the latest version of the SDK.
In this step, the function code of the SDK of the current version may be replaced with the function code of the SDK of the latest version to implement updating.
The SDK loads the function code of the latest version of the SDK based on the engine, step 218.
In step 220, the SDK sends data related to the SDK invocation result to the application software.
In this embodiment, after the SDK of the latest version is installed, the function code of the SDK may be called based on a built-in engine to implement the original function of the SDK, and the data related to the SDK calling result may also be sent to the application software. Still taking the above-mentioned face-brushing payment SDK as an example, the face-brushing payment SDK may load a functional bytecode, obtain face data, perform real-name verification, perform payment operation, and then return a payment result to the application software.
As can be seen from the above description, in an embodiment of the present specification, the application software may send a call instruction to the SDK, and after receiving the call instruction, the SDK may determine whether the number of times of receiving the call instruction reaches a number threshold, if the number of times of receiving the call instruction reaches the number threshold, the SDK may request the SDK server to obtain a latest version number and a corresponding download address based on the engine, and if the latest version number is not consistent with the current version number, the SDK may download and install the SDK of the latest version based on the download address, and then load a function code of the SDK of the latest version based on the engine built in the SDK of the latest version to implement a corresponding function.
By adopting the method, whether the relevant updating steps need to be executed or not can be determined by judging whether the calling times reach the time threshold or not, so that the updating process is more controllable, the time threshold can be adjusted to adapt to the actual requirement, and compared with the method that the relevant updating steps are executed every time of calling, the method can greatly reduce the influence on the performance of the equipment and avoid the waste of resources.
The present specification also provides an embodiment of an apparatus for updating function codes in a software development kit SDK, corresponding to the aforementioned embodiment of the method for updating function codes in a software development kit SDK.
The embodiment of the device for updating the function codes in the software development kit SDK can be applied to the device. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. From a hardware aspect, as shown in fig. 3, the hardware structure diagram of the apparatus for updating function codes in the software development kit SDK in this specification is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 3, a device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the device, which is not described again.
Fig. 4 is a block diagram illustrating an apparatus for updating function code in a software development kit SDK according to an exemplary embodiment of the present specification.
Referring to fig. 4, the device for updating function codes in the software development kit SDK may be applied to the apparatus shown in fig. 3, and includes: the device comprises a requesting unit 410, a receiving unit 420, a judging unit 430, an acquiring unit 440, an updating unit 450, a first executing unit 460 and a second executing unit 470.
The requesting unit 410 sends a version information obtaining request to the SDK server based on a built-in trigger engine after receiving a call instruction sent by application software;
a receiving unit 420, configured to receive the version information sent by the SDK server;
a judging unit 430 that judges whether to perform an update operation of the function code based on the version information;
and if so, the updating unit 450 executes an updating operation on the function code based on the version information.
Optionally, the method further includes:
the first execution unit 460 loads the updated function code based on the trigger engine after the function code is updated.
Optionally, the requesting unit 410:
after receiving a calling instruction sent by application software, judging whether the number of times of receiving the calling instruction reaches a number threshold value;
and if the number of times reaches the threshold value, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
Optionally, the requesting unit 410:
after a calling instruction sent by application software is received, judging whether the time length from the last time of sending a version information acquisition request to an SDK server reaches a preset time length or not;
and if the preset duration is reached, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
Optionally, the version information includes a latest version number, and the determining unit 430:
judging whether the latest version number is consistent with the current version number;
and if not, determining to execute the updating operation.
Optionally, the method further includes:
the obtaining unit 440 obtains a download address of the function code of the SDK of the latest version;
the updating unit 450, when performing an update operation on the function code based on the version information:
and downloading the function code of the SDK of the latest version based on the download address, and replacing the function code of the SDK of the current version by using the function code of the SDK of the latest version.
Optionally, before replacing the function code of the current version of the SDK with the function code of the latest version of the SDK, the updating unit 450 further:
carrying out security check on the downloaded function code of the SDK of the latest version;
and under the condition that the security check is passed, replacing the function code of the current SDK version with the function code of the SDK of the latest version.
Optionally, the method further includes:
the second execution unit 470 loads the function code based on the trigger engine to implement the function of the SDK if it is determined that the update operation of the function code is not performed based on the version information.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the foregoing embodiment of the method for updating function codes in a software development kit SDK, the present specification further provides an apparatus for updating function codes in a software development kit SDK, including: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, by reading and executing machine-executable instructions stored by the memory that correspond to update logic of functional code in a software development kit SDK, the processor is caused to:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
Optionally, the fast search processor is further caused to:
and after the functional code is updated, loading the updated functional code based on the trigger engine.
Optionally, after receiving a call instruction sent by the application software, when sending a version information acquisition request to the SDK server based on a built-in trigger engine, the processor is caused to:
after receiving a calling instruction sent by application software, judging whether the number of times of receiving the calling instruction reaches a number threshold value;
and if the number threshold is reached, sending a version information acquisition request to the SDK server based on a built-in WAMR engine.
Optionally, after receiving the call instruction sent by the application software, the sending a version information obtaining request to the SDK server based on a built-in engine includes:
after a calling instruction sent by application software is received, judging whether the time length from the last time of sending a version information acquisition request to an SDK server reaches a preset time length or not;
and if the preset duration is reached, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
Optionally, the version information includes a latest version number, and when determining whether to perform an update operation based on the version information, the processor is caused to:
judging whether the latest version number is consistent with the current version number;
and if not, determining to execute the updating operation.
Optionally, the processor is further caused to:
acquiring a download address of a function code of the SDK of the latest version;
the performing an update operation on the function code based on the version information includes:
and downloading the function code of the SDK of the latest version based on the download address, and replacing the function code of the SDK of the current version by using the function code of the SDK of the latest version.
Optionally, before replacing the function code of the current version of the SDK with the function code of the latest version of the SDK, the processor is further caused to:
carrying out security check on the downloaded function code of the SDK of the latest version;
and under the condition that the security check is passed, replacing the function code of the current SDK version with the function code of the SDK of the latest version.
Optionally, the processor is further caused to:
and if the updating operation of the function code is determined not to be executed based on the version information, loading the function code based on the trigger engine to realize the function of the SDK.
Optionally, the functional code is compiled based on a web assembly language WebAssembly format, and the trigger engine is a web assembly language micro runtime WAMR engine for loading the code compiled in the WebAssembly format.
In correspondence with the aforementioned embodiment of the method for updating functional code in a software development kit SDK, the present specification also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
Optionally, the method further includes:
and after the functional code is updated, loading the updated functional code based on the trigger engine.
Optionally, after receiving the call instruction sent by the application software, the sending a version information acquisition request to the SDK server based on a built-in trigger engine includes:
after receiving a calling instruction sent by application software, judging whether the number of times of receiving the calling instruction reaches a number threshold value;
and if the number of times reaches the threshold value, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
Optionally, after receiving the call instruction sent by the application software, the sending a version information acquisition request to the SDK server based on a built-in trigger engine includes:
after a calling instruction sent by application software is received, judging whether the time length from the last time of sending a version information acquisition request to an SDK server reaches a preset time length or not;
and if the preset duration is reached, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
Optionally, the version information includes a latest version number, and the determining whether to perform the update operation based on the version information includes:
judging whether the latest version number is consistent with the current version number;
and if not, determining to execute the updating operation.
Optionally, the method further includes:
acquiring a download address of a function code of the SDK of the latest version;
the performing an update operation on the function code based on the version information includes:
and downloading the function code of the SDK of the latest version based on the download address, and replacing the function code of the SDK of the current version by using the function code of the SDK of the latest version.
Optionally, before replacing the function code of the current version of the SDK with the function code of the latest version of the SDK, the method further includes:
carrying out security check on the downloaded function code of the SDK of the latest version;
and under the condition that the security check is passed, replacing the function code of the current SDK version with the function code of the SDK of the latest version.
Optionally, the method further includes:
and if the updating operation of the function code is determined not to be executed based on the version information, loading the function code based on the trigger engine.
Optionally, the functional code is compiled based on a web assembly language WebAssembly format, and the trigger engine is a web assembly language micro runtime WAMR engine for loading the code compiled in the WebAssembly format.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (19)

1. A method for updating function codes in a Software Development Kit (SDK), wherein the SDK is internally provided with a trigger engine, and the method comprises the following steps:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
2. The method of claim 1, further comprising:
and after the functional code is updated, loading the updated functional code based on the trigger engine.
3. The method according to claim 1, wherein after receiving a call instruction sent by application software, sending a version information acquisition request to the SDK server based on a built-in trigger engine, includes:
after receiving a calling instruction sent by application software, judging whether the number of times of receiving the calling instruction reaches a number threshold value;
and if the number of times reaches the threshold value, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
4. The method according to claim 1, wherein after receiving a call instruction sent by application software, sending a version information acquisition request to the SDK server based on a built-in trigger engine, includes:
after a calling instruction sent by application software is received, judging whether the time length from the last time of sending a version information acquisition request to an SDK server reaches a preset time length or not;
and if the preset duration is reached, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
5. The method of claim 1, wherein the version information comprises a latest version number, and wherein the determining whether to perform the update operation based on the version information comprises:
judging whether the latest version number is consistent with the current version number;
and if not, determining to execute the updating operation.
6. The method of claim 5, further comprising:
acquiring a download address of a function code of the SDK of the latest version;
the performing an update operation on the function code based on the version information includes:
and downloading the function code of the SDK of the latest version based on the download address, and replacing the function code of the SDK of the current version by using the function code of the SDK of the latest version.
7. The method of claim 6, replacing the function code of the current version of the SDK with the function code of the latest version of the SDK before, further comprising:
carrying out security check on the downloaded function code of the SDK of the latest version;
and under the condition that the security check is passed, replacing the function code of the current SDK version with the function code of the SDK of the latest version.
8. The method of claim 1, further comprising:
and if the updating operation of the function code is determined not to be executed based on the version information, loading the function code based on the trigger engine.
9. The method according to any one of claims 1 to 8, wherein the functional code is compiled based on a web assembly language WebAssembly format, and the trigger engine is a web assembly language micro-runtime WAMR engine for loading the code compiled in the WebAssembly format.
10. An apparatus for updating function code in a Software Development Kit (SDK) having a trigger engine built therein, the apparatus comprising:
the request unit is used for sending a version information acquisition request to the SDK server based on a built-in trigger engine after receiving a calling instruction sent by application software;
the receiving unit is used for receiving the version information sent by the SDK server;
a judging unit that judges whether or not an update operation of the function code is performed based on the version information;
and if so, executing updating operation on the function code based on the version information.
11. The apparatus of claim 10, further comprising:
and the first execution unit loads the updated function code based on the trigger engine after the function code is updated.
12. The apparatus of claim 10, the request unit to:
after receiving a calling instruction sent by application software, judging whether the number of times of receiving the calling instruction reaches a number threshold value;
and if the number of times reaches the threshold value, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
13. The apparatus of claim 10, the request unit to:
after a calling instruction sent by application software is received, judging whether the time length from the last time of sending a version information acquisition request to an SDK server reaches a preset time length or not;
and if the preset duration is reached, sending a version information acquisition request to the SDK server based on a built-in trigger engine.
14. The apparatus according to claim 10, wherein the version information includes a latest version number, and the judging unit:
judging whether the latest version number is consistent with the current version number;
and if not, determining to execute the updating operation.
15. The apparatus of claim 14, further comprising:
the acquisition unit is used for acquiring a download address of the function code of the SDK of the latest version;
the update unit, when performing an update operation on the function code based on the version information:
and downloading the function code of the SDK of the latest version based on the download address, and replacing the function code of the SDK of the current version by using the function code of the SDK of the latest version.
16. The apparatus of claim 15, the updating unit, before replacing the function code of the current version of the SDK with the function code of the latest version of the SDK, further:
carrying out security check on the downloaded function code of the SDK of the latest version;
and under the condition that the security check is passed, replacing the function code of the current SDK version with the function code of the SDK of the latest version.
17. The apparatus of claim 10, further comprising:
and the second execution unit is used for loading the function code based on the trigger engine if the update operation of the function code is determined not to be executed based on the version information.
18. The apparatus according to any one of claims 10-17, wherein the functional code is compiled based on a web assembly language WebAssembly format, and the trigger engine is a web assembly language micro-runtime WAMR engine for loading the code compiled in the WebAssembly format.
19. An apparatus for updating function codes in a Software Development Kit (SDK), comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory that correspond to update logic of functional code in a Software Development Kit (SDK), the processor is caused to:
after receiving a calling instruction sent by application software, sending a version information acquisition request to an SDK server based on a built-in trigger engine;
receiving the version information sent by the SDK server;
judging whether to execute the updating operation of the function code based on the version information;
and if so, executing updating operation on the function code based on the version information.
CN202110090820.4A 2021-01-22 2021-01-22 Method and device for updating function codes in Software Development Kit (SDK) Pending CN112882732A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110090820.4A CN112882732A (en) 2021-01-22 2021-01-22 Method and device for updating function codes in Software Development Kit (SDK)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110090820.4A CN112882732A (en) 2021-01-22 2021-01-22 Method and device for updating function codes in Software Development Kit (SDK)

Publications (1)

Publication Number Publication Date
CN112882732A true CN112882732A (en) 2021-06-01

Family

ID=76050533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110090820.4A Pending CN112882732A (en) 2021-01-22 2021-01-22 Method and device for updating function codes in Software Development Kit (SDK)

Country Status (1)

Country Link
CN (1) CN112882732A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363990A (en) * 2021-12-28 2022-04-15 上海黑眸智能科技有限责任公司 Equipment end network distribution method and system compatible with multiple APPs, equipment end and APP end
CN114942774A (en) * 2022-07-26 2022-08-26 中恒信息科技(广州)有限公司 BIM modeling software-based plug-in function hot updating method
CN116700841A (en) * 2023-08-03 2023-09-05 北京中电华大电子设计有限责任公司 Method and device for calling native API (application program interface)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353844A (en) * 2013-06-25 2013-10-16 亿赞普(北京)科技有限公司 Upgrading method and system of SDK (software development kit)
CN107122200A (en) * 2016-02-25 2017-09-01 博雅网络游戏开发(深圳)有限公司 Load plug-in unit SDK method, system and client
CN108366127A (en) * 2018-03-07 2018-08-03 北京奇艺世纪科技有限公司 A kind of acquisition methods and device of software package
US20180365004A1 (en) * 2017-06-14 2018-12-20 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for calling software development kit
CN109062590A (en) * 2018-06-29 2018-12-21 武汉掌游科技有限公司 A kind of method and system of game SDK online updating
CN109240733A (en) * 2017-07-03 2019-01-18 Tcl集团股份有限公司 A kind of method and terminal updating advertisement SDK based on Android system
CN110837378A (en) * 2018-08-16 2020-02-25 腾讯科技(深圳)有限公司 Calling method and device for software development kit SDK function
CN111722857A (en) * 2019-03-20 2020-09-29 北京柏林互动科技有限公司 Updating method and device of software development kit, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353844A (en) * 2013-06-25 2013-10-16 亿赞普(北京)科技有限公司 Upgrading method and system of SDK (software development kit)
CN107122200A (en) * 2016-02-25 2017-09-01 博雅网络游戏开发(深圳)有限公司 Load plug-in unit SDK method, system and client
US20180365004A1 (en) * 2017-06-14 2018-12-20 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for calling software development kit
CN109240733A (en) * 2017-07-03 2019-01-18 Tcl集团股份有限公司 A kind of method and terminal updating advertisement SDK based on Android system
CN108366127A (en) * 2018-03-07 2018-08-03 北京奇艺世纪科技有限公司 A kind of acquisition methods and device of software package
CN109062590A (en) * 2018-06-29 2018-12-21 武汉掌游科技有限公司 A kind of method and system of game SDK online updating
CN110837378A (en) * 2018-08-16 2020-02-25 腾讯科技(深圳)有限公司 Calling method and device for software development kit SDK function
CN111722857A (en) * 2019-03-20 2020-09-29 北京柏林互动科技有限公司 Updating method and device of software development kit, electronic equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DETECTIVEHLH: "WebAssembly完全入门——了解wasm的前世今身", 《HTTPS://WWW.CNBLOGS.COM/DETECTIVEHLH/P/9928915.HTML》 *
單鵬飛: "WASM学习", 《HTTPS://BLOG.CSDN.NET/PNFY__SHAN/ARTICLE/DETAILS/98494865》 *
微小的鱼: "Wasm的简介", 《HTTPS://BLOG.CSDN.NET/CHENWEIYU11962/ARTICLE/DETAILS/86730031》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114363990A (en) * 2021-12-28 2022-04-15 上海黑眸智能科技有限责任公司 Equipment end network distribution method and system compatible with multiple APPs, equipment end and APP end
CN114363990B (en) * 2021-12-28 2024-01-12 上海黑眸智能科技有限责任公司 Equipment end network distribution method and system compatible with multiple APP, equipment end and APP end
CN114942774A (en) * 2022-07-26 2022-08-26 中恒信息科技(广州)有限公司 BIM modeling software-based plug-in function hot updating method
CN114942774B (en) * 2022-07-26 2022-11-08 中恒信息科技(广州)有限公司 BIM modeling software-based plug-in function hot updating method
CN116700841A (en) * 2023-08-03 2023-09-05 北京中电华大电子设计有限责任公司 Method and device for calling native API (application program interface)
CN116700841B (en) * 2023-08-03 2023-09-26 北京中电华大电子设计有限责任公司 Method and device for calling native API (application program interface)

Similar Documents

Publication Publication Date Title
CN112882732A (en) Method and device for updating function codes in Software Development Kit (SDK)
US20190324772A1 (en) Method and device for processing smart contracts
CN107506221B (en) Application program upgrading method, device and equipment
CN107967139B (en) Hot updating method and device for game
CN108121594B (en) Process management method and device
CN109933350B (en) Method and device for embedding codes in application and electronic equipment
CN106681749B (en) Local code patch updating method and device based on android platform
CN111782519A (en) Test method and device and electronic equipment
CN115378735B (en) Data processing method and device, storage medium and electronic equipment
CN107797818A (en) Application program updating method and device
CN107220074A (en) To the access of supporting layer software function, upgrade method and device
CN111290801A (en) Data processing method, data processing device, computer equipment and storage medium
CN106796521B (en) API version control independent of product release
CN110716786B (en) Page display method, system and storage medium
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN111625225A (en) Program specified data output method and device
CN109933355B (en) Application program upgrading method and device
CN109933407B (en) Block chain DAPP virtual machine, data processing method and computing equipment
CN116775087A (en) Thermal repair method, device, electronic equipment and storage medium
CN109426546B (en) Application starting method and device, computer storage medium and equipment
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
CN106778270B (en) Malicious application detection method and system
CN108845953B (en) Interface testing method and device
CN109933357B (en) Application program upgrading method and device
CN113157348A (en) Game starting method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210601