CN-113326078-B - Method, equipment and storage medium for dynamically updating software development kit
Abstract
The application provides a method, equipment and a computer readable storage medium for dynamically updating a software development kit, wherein the method comprises the steps of determining that a target plug-in included in the software development kit corresponding to a host application program of a tool development end is updated when the host application program is started, copying the updated target plug-in to an engineering catalog of the host application program, changing a class loading mechanism through a hook, loading the class of the target plug-in the host application program based on the changed loading mechanism, and reflecting and calling the class of the target plug-in to realize the target plug-in.
Inventors
- GUO SHUXIA
- SHU YUQIANG
- LEI SHENGWEI
- LI WEI
- CAI ZHIJIE
- CHEN JIEDAN
- LU DAOHE
Assignees
- 深圳前海微众银行股份有限公司
- 深圳前海微众银行股份有限公司
Dates
- Publication Date
- 20260421
- Application Date
- 20210617
- Priority Date
- 20210617
Claims (7)
- 1. A method for dynamically updating a software development kit, comprising: when a host application program is started, determining that a target plug-in included in a software development kit corresponding to the host application program at a tool development end is updated; Copying the updated target plugin under the engineering directory of the host application program, wherein the updated target plugin comprises loading an executable file and a dynamic library file of a virtual machine contained in the updated target plugin under the engineering directory, the executable file of the virtual machine comprises a dex file, the updated executable file of the target plugin under the engineering directory comprises the steps of obtaining an executable file array of the host application program and an executable file array of the target plugin in a reflection mode, merging the executable file array of the host application program and the executable file array of the target plugin to obtain a target executable file array, assigning the target executable file array to the executable file array of the host application program, and loading the updated dynamic library file contained in the target plugin under the engineering directory, wherein the method comprises the steps of merging the dynamic library path array of the host application program and the dynamic library path array of the target plugin a reflection mode to obtain a target dynamic path; And changing a class loading mechanism through a hook, loading the class of the target plug-in the host application program based on the changed loading mechanism, and reflecting a method for calling the class of the target plug-in so as to realize the target plug-in.
- 2. The method according to claim 1, wherein when the host application is started, before determining that a tool development end updates a target plug-in included in a software development kit corresponding to the host application, the method includes: The software development kit issued by the tool development end is obtained, wherein the software development kit comprises a binary archive file and at least two plug-ins, and the target plug-in is one plug-in of the at least two plug-ins; copying the binary archive file and the at least two plugins to the engineering directory of an application program; And calling an interface in the binary archive file through the application program, and integrating the at least two plugins to obtain the host application program.
- 3. The method as recited in claim 1, wherein the method further comprises: when the host application program detects an algorithm switching event, acquiring at least two algorithm type zone bits issued by a cloud; selecting a target algorithm zone bit corresponding to the algorithm switching event from the at least two algorithm type zone bits through an intermediate layer, and loading a target algorithm plug-in from the cloud based on the target algorithm zone bit.
- 4. The method of claim 3, wherein after loading the target algorithm plug-in from the cloud based on the target algorithm flag bit, the method further comprises: Decompressing the target algorithm plug-in, copying the decompressed algorithm model file to the data original resource file directory corresponding to the host application program to replace the algorithm model file under the data original resource file directory, and installing the decompressed algorithm model file.
- 5. The method according to any one of claims 1 to 4, wherein when the host application is started, determining that the tool development end updates the target plug-in included in the software development kit corresponding to the host application, includes: When the host application program is started, the version numbers of the same plug-ins of the local and cloud sides are obtained; And when the same plug-in has a target association relationship between the version number corresponding to the local and the version number corresponding to the cloud, determining that the same plug-in is updated, wherein the target plug-in comprises the same plug-in.
- 6. An apparatus for dynamically updating a software development kit, comprising: A memory for storing executable instructions, and a processor for implementing the method of any one of claims 1 to 5 when executing the executable instructions stored in the memory.
- 7. A computer readable storage medium storing executable instructions for causing a processor to perform the method of any one of claims 1 to 5.
Description
Method, equipment and storage medium for dynamically updating software development kit Technical Field Embodiments of the present application relate to the field of data processing technology of financial technology (Fintech), and relate to, but are not limited to, a method, apparatus, and computer-readable storage medium for dynamically updating a software development kit. Background With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changed to the financial technology (Fintech), however, the financial technology also has higher requirements on the technology due to the requirements of safety and real-time performance of the financial industry. In the field of financial science and technology, various information can be directly displayed to a user through various application programs on a mobile terminal, and a more common way to display information to a user through an application program is to embed a Software development kit (Software DevelopmentKit, SDK) as a whole into an application. The update of the SDK needs to be performed through the component linker, and each time the update needs to generate a patch, the patch synthesis may fail, and the rollback to the old version may increase the cost. The existing SDK updating mode is to update the SDK by decompressing, repackaging, copying the dex file or the so file. However, this updating method is not only cumbersome, but also is prone to abnormality in the process of operating the file, such as sudden program exit or device power failure, which results in file writing failure, so that the method of copying the dex file or so file to update the SDK is prone to problems, resulting in update failure. Disclosure of Invention The embodiment of the application provides a method, equipment and a computer readable storage medium for dynamically updating a software development kit, which are used for solving the problem that updating failure easily occurs in a mode of updating an SDK by copying a dex file or a so file in the related technology. The technical scheme of the embodiment of the application is realized as follows: The embodiment of the application provides a method for dynamically updating a software development kit, which comprises the following steps: when a host application program is started, determining that a target plug-in included in a software development kit corresponding to the host application program at a tool development end is updated; Copying the updated target plug-in to an engineering catalog of the host application program; And changing a class loading mechanism through a hook, loading the class of the target plug-in the host application program based on the changed loading mechanism, and reflecting a method for calling the class of the target plug-in so as to realize the target plug-in. The embodiment of the application provides equipment, which comprises the following components: the processor is used for realizing the method when executing the executable instructions stored in the memory. The embodiment of the application provides a computer readable storage medium, which stores executable instructions for causing a processor to execute the method. The embodiment of the application has the following beneficial effects: The method comprises the steps of determining that a target plug-in included in a software development tool package corresponding to a host application program of a tool development end is updated when the host application program is started, copying the updated target plug-in to an engineering catalog of the host application program, loading the class of the target plug-in the host application program through a hook changing class loading mechanism, and reflecting and calling the class of the target plug-in to achieve the target plug-in, so that a mode of packaging and copying a dex file of the plug-in to update the SDK is abandoned, the plug-in type SDK is updated, the probability of file operation failure is reduced, the SDK can be split into a plurality of plug-ins, and accordingly updating of the SDK can be achieved in a plug-in type updating mode under the condition that a certain plug-in is updated, and flow of downloading the plug-in and time of integrating the plug-in are saved. Drawings FIG. 1 is a schematic diagram of a multi-threaded concurrency scenario provided by an embodiment of the present application; FIG. 2 is a schematic flow chart of an alternative method for dynamically updating a software development kit provided by an embodiment of the present application; FIG. 3 is a schematic flow chart of an alternative method for dynamically updating a software development kit provided by an embodiment of the present application; fig. 4 is a schematic diagram of an alternative architecture of an access control face-brushing SDK according to an embodiment of the present application; FIG. 5 is a s