CN115934198A - SDK loading method, device, equipment and storage medium - Google Patents
SDK loading method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115934198A CN115934198A CN202211624559.2A CN202211624559A CN115934198A CN 115934198 A CN115934198 A CN 115934198A CN 202211624559 A CN202211624559 A CN 202211624559A CN 115934198 A CN115934198 A CN 115934198A
- Authority
- CN
- China
- Prior art keywords
- sdk
- version
- application program
- dynamic library
- loading
- 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
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Stored Programmes (AREA)
Abstract
The application belongs to the technical field of software development and provides an SDK loading method, device, equipment and storage medium, wherein the method comprises the following steps: when the application program is started, acquiring a first SDK of a new version, initializing the application program by using the first SDK, sending a first object of the first SDK to a pre-created dynamic library, acquiring a configuration instruction of a server, determining the version of the SDK of the application program according to the configuration instruction to obtain a target version, acquiring a second object of a second SDK from the dynamic library when the target version is determined to be an old version, loading the application program by using the second object, degrading the SDK version in a server configuration mode when the update span of the first SDK of the new version is large and having a problem, and loading the application program by using the second object of the second SDK to realize timely problem repair and reduce risks brought by upgrading the SDK.
Description
Technical Field
The present application relates to the field of software development technologies, and in particular, to an SDK loading method, apparatus, device, and storage medium.
Background
At present, the main mode of accessing the third-party SDK (Software development kit) by the application is to apply direct hard coding to statically load the third-party SDK. The static loading of the third-party SDK is to combine the logic of the application itself and the code and resource of the third-party SDK into an installation package when the application is released, and then release the installation package to the application market. Once the installation package is released, the installation package cannot be modified, the third-party SDK packaged by the installation package cannot be modified, if the third-party SDK has a problem, or when the third-party SDK is upgraded to cause a large number of application programs to crash on line, the original application project and the updated third-party SDK need to be fused again to form a new installation package and then released, or the problem is temporarily solved by closing the function of the SDK. In the two modes, the coupling of the development and the application of the functional software is high, the operation is complex, the problem cannot be repaired in time, and the repair period is long.
Disclosure of Invention
The application mainly aims to provide an SDK loading method, an SDK loading device, SDK loading equipment and a storage medium, so that when a problem occurs after a third-party SDK is upgraded, the problem can be repaired in time, and risk spread is avoided.
In order to achieve the above object, the present application provides an SDK loading method, including:
when an application program is started, acquiring a first SDK of a new version;
initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; wherein, the dynamic library stores the second SDK of the old version in advance;
acquiring a configuration instruction of a server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and when the target version is determined to be the old version, acquiring a second object of a second SDK from the dynamic library, and loading the application program by using the second object.
Further, the determining the version of the SDK according to the configuration instruction, after obtaining the target version, further includes:
and when the target version is determined to be a new version, acquiring a first object of the first SDK from the dynamic library, and loading the application program by using the first object.
Further, after the loading the application program by using the first object, the method further includes:
and when the first SDK is determined to be the character recognition SDK, calling character recognition service according to the first object.
Further, after the initializing the application program with the first SDK, the method further includes:
reporting the function expansion state of the first SDK to the server;
and when the function expansion state of the first SDK meets the requirement, determining that the target version is a new version, otherwise, determining that the target version is an old version.
Further, after the initializing the application program with the first SDK, the method further includes:
performing security detection on the first SDK;
and if the first SDK passes the security detection, determining that the target version is a new version, otherwise, determining that the target version is an old version.
Further, before the application program is started, the method further includes:
obtaining an old version of the SDK from the static library to obtain a second SDK;
and newly building a dynamic library depending on the static library, and storing the second SDK in the dynamic library.
Further, after storing the second SDK in the dynamic library, the method further includes:
responding to a version updating instruction, and acquiring a first SDK of a new version from a server;
and replacing a second SDK stored in the static library with the first SDK of the new version.
The present application further provides an SDK loading device, the device including:
the acquisition module is used for acquiring the first SDK of the new version when the application program is started;
the initialization module is used for initializing the application program by utilizing the first SDK and sending a first object of the first SDK to a pre-established dynamic library; the dynamic library is stored with a second SDK of an old version in advance;
the determining module is used for acquiring a configuration instruction of the server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and the loading module is used for acquiring a second object of a second SDK from the dynamic library and loading the application program by using the second object when the target version is determined to be the old version.
The present application further provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of any of the above methods when executing the computer program.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the methods described above.
According to the SDK loading method, the device, the equipment and the storage medium, when an application program is started, a first SDK of a new version is obtained, the application program is initialized by using the first SDK, and a first object of the first SDK is sent to a pre-established dynamic library; the method comprises the steps of storing a second SDK of an old version in advance in a dynamic library, obtaining a configuration instruction of a server, determining the version of the SDK of an application program according to the configuration instruction, obtaining a target version, obtaining a second object of the second SDK from the dynamic library when the target version is determined to be the old version, loading the application program by using the second object, obtaining the second SDK of the old version in a static library by using the link principle that the dynamic library depends on the static library, including the second SDK in a source code and a resource file of the dynamic library, and when a problem occurs in a large updating span of a first SDK of a new version, degrading the SDK version by using a server configuration mode, loading the application program by using the second object of the second SDK, repairing the problem in time and reducing risks caused by upgrading of the SDK.
Drawings
Fig. 1 is a schematic flowchart of an SDK loading method according to an embodiment of the present application;
fig. 2 is a schematic block diagram of a structure of an SDK loading apparatus according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
According to the SDK loading method, the execution main body is the computer equipment, and the SDK loading method is used for solving the problem that when the existing third-party SDK is in a problem, or when a large number of application programs are crashed on line due to the upgrade of the third-party SDK, the original application project and the updated third-party SDK need to be fused again to form a new installation package and then are issued, or the problem is temporarily solved in a mode of closing the function of the SDK. The two operation modes have the advantages that the coupling of the development and the application of the functional software is high, the operation is complex, the problems cannot be repaired in time, and the repair period is long.
In an embodiment of the present invention, the computer device may be an intelligent mobile terminal using an ios as a development platform. SDK (Software development kit) is generally a collection of development tools used by some Software engineers to build application Software for a specific Software package, software framework, hardware platform, operating system, and the like. A software development kit broadly refers to a collection of related documents, paradigms, and tools that assist in developing a certain class of software.
The SDK refers to a development kit with a certain function (such as login, payment, push, share, and the like) provided by a non-CP (content provider, for example, an application developer) party, and the CP party may integrate the third-party SDK by encoding and integrating file resources, so as to have a certain function and/or usage scenario provided by the third-party SDK. The types of the third-party SDKs are many, and generally from a development perspective, the third-party SDKs are classified according to functions provided by the SDKs, and currently, the types of market mainstream include, but are not limited to, login, payment, sharing, pushing, advertising, statistics, and the like.
Referring to fig. 1, in one embodiment, the present application provides an SDK loading method, where the method includes:
s11, when the application program is started, acquiring a first SDK of a new version;
s12, initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; the dynamic library is stored with a second SDK of an old version in advance;
s13, acquiring a configuration instruction of the server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and S14, when the target version is determined to be the old version, acquiring a second object of a second SDK from the dynamic library, and loading the application program by using the second object.
In this embodiment, when an application in the I OS system is started, the system may obtain the SDK of the latest version to obtain the first SDK, initialize the application using the first SDK, and load a code, a resource, a local library (a code library corresponding to the current application stored in the client) and the like in the first SDK by using a default class loader.
Typically, the application-initiated class loader will only load the code, resources, and local libraries that the first SDK of the application itself contains. Therefore, to dynamically load the first SDK, the code, the resource, and the local library in the first SDK and the code, the resource, and the local library in the current application need to be merged together, so that the first SDK and the application are seamlessly connected, and both use the same context (execution environment of the application).
In the embodiment, namely, the resources of the first SDK are integrated, the management of the resources in the I OS system is managed substantially by the application resource manager. Therefore, the addassetPath method of the AssetManager is called by reflection to load the resource into the Resources object, and then the resource of the first SDK can be accessed through the Resources.
In addition, in this embodiment, the first object of the first SDK is further sent to a pre-created dynamic library, the dynamic library stores the second SDK of the old version in advance, when a large number of application programs crash on line after the first SDK is upgraded, the configuration instruction of the server indicates to call the second SDK of the old version, and then it is determined that the target version is the old version, the second object of the second SDK is obtained from the dynamic library, and the application program is loaded by using the second object.
When the functions of the first SDK are normally operated after being upgraded and the application program is not crashed, the configuration instruction of the server indicates to call the first SDK of the new version, the target version is determined to be the new version, the first object of the first SDK is obtained from the dynamic library, and the application program is loaded by the first object.
Taking a character recognition SDK as an example, a system prepares SDKs of two versions of an OCR-V1 and an OCR-V2 in advance, wherein the OCR-V1 is a second SDK of an old version, the OCR-V2 is a first SDK of a new version, an application program engineering creates a new dynamic library mi dd l ware, the dynamic library mi dd l ware carries out a second SDK depending on the OCR-V1 version, the old version of the second SDK is stored in advance, when the application program is started, the system carries out initialization on the first SDK of the OCR-V2 version and transmits a second object of the OCR-V2 to the dynamic library mi dd l ware for reference, and carries out a configuration instruction issued by a request server, the configuration instruction contains the SDK version adopted by the application program, calling logics of different versions are carried out according to the configuration instruction, if the first SDK of the new version, namely the OCR-V2 version, the initialization of the application program is directly returned and transmitted to the dynamic library mi, the first SDK is loaded from the first SDK, and the first object of the dynamic library is loaded by using the first SDK; if the old version of the second SDK, namely the OCR-V1 version, is used, a second object of the OCR-V1 version which is depended by the dynamic library mdd l email is loaded and initialized, the second object is returned to the application program for use, and finally when the application program uses the identification service provided by the SDK, the corresponding service is called by using the object returned by the dynamic library mldd l email.
According to the SDK loading method, when an application program is started, a first SDK of a new version is obtained, the application program is initialized through the first SDK, and a first object of the first SDK is sent to a pre-established dynamic library; the method comprises the steps of storing a second SDK of an old version in advance in a dynamic library, obtaining a configuration instruction of a server, determining the version of the SDK of an application program according to the configuration instruction, obtaining a target version, obtaining a second object of the second SDK from the dynamic library when the target version is determined to be the old version, loading the application program by using the second object, obtaining the second SDK of the old version in a static library by using the link principle that the dynamic library depends on the static library, including the second SDK in a source code and a resource file of the dynamic library, and when a problem occurs in a large updating span of a first SDK of a new version, degrading the SDK version by using a server configuration mode, loading the application program by using the second object of the second SDK, repairing the problem in time and reducing risks caused by upgrading of the SDK.
In an embodiment, the determining the version of the SDK according to the configuration instruction, after obtaining the target version, may further include:
and when the target version is determined to be a new version, acquiring a first object of the first SDK from the dynamic library, and loading the application program by using the first object.
In this embodiment, when the functions of the first SDK are normally operated after being upgraded and the application program is not crashed, the configuration instruction of the server indicates to invoke the first SDK of the new version, and then determines that the target version is the new version, obtains the first object of the first SDK from the dynamic library, and loads the application program by using the first object, and loads the code, the resource, the local library (the code library stored in the client and corresponding to the current application) and the like in the first SDK by using a default class loader.
In an embodiment, after the loading the application program by using the first object, the method may further include:
and when the first SDK is determined to be the character recognition SDK, calling character recognition service according to the first object.
The method includes the steps that by taking a character recognition SDK as an example, a system prepares SDKs of two versions of an OCR-V1 and an OCR-V2 in advance, wherein the OCR-V1 is the second SDK of an old version, the OCR-V2 is the first SDK of a new version, a new dynamic library mdd l e ware is created in an application program project, when an application program is started, the system initializes the first SDK of the OCR-V2 version and transmits the second object of the OCR-V2 to a dynamic library mdd l e to be quoted, meanwhile, a configuration instruction sent by a request server is carried out, the configuration instruction contains version information of the SDK adopted by the application program, calling logic of different versions is carried out according to the configuration instruction, if the first SDK of the new version, namely the OCR-V2 version, the first object of the first SDK is directly returned to the application program initialization and transmitted to the dynamic library mdd l e, the first object of the first SDK is obtained from the dynamic library mdd e, and the first object of the first SDK is loaded by utilizing the first object, and the application program to finally, and the character recognition SDk to provide a corresponding character recognition service for the application program.
In an embodiment, after the initializing the application program with the first SDK, the method may further include:
reporting the function expansion state of the first SDK to the server;
and when the function expansion state of the first SDK meets the requirement, determining that the target version is a new version, and otherwise, determining that the target version is an old version.
In this embodiment, after the application program is initialized by using the first SDK, the operation data of the application program for operating each function newly extended by the first SDK is collected, a function extension state is generated, and the function extension state of the first SDK is reported to the server, the server determines whether each function newly extended by the first SDK normally operates, generates an audit result, and sends the audit result to the computer device, when the computer device determines that the function extension state of the first SDK meets the requirement according to the audit result, the target version is determined to be a new version, otherwise, the target version is determined to be an old version, therefore, when a problem occurs in a large update span of the first SDK of the new version, the SDK version can be degraded by using a server configuration mode, the application program is loaded by using a second object of the second SDK, and the problem is repaired, so that a risk caused by the SDK upgrade is reduced.
In an embodiment, after the initializing the application program with the first SDK, the method may further include:
performing security detection on the first SDK;
and if the first SDK passes the security detection, determining that the target version is a new version, otherwise, determining that the target version is an old version.
In this embodiment, after the application program is initialized by using the first SDK, security detection may be performed on the first SDK, security detection data when the application program runs the first SDK is collected, and the security detection data is reported to the server, the server determines whether the security detection data of the first SDK meets requirements, generates an audit result, and sends the audit result to the computer device, and when the computer device determines that the first SDK passes the security detection according to the audit result, it determines that the target version is a new version, otherwise, it determines that the target version is an old version, therefore, when a problem occurs in which the update span of the first SDK of the new version is large, the SDK version may be degraded by using a server configuration method, and a second object of the second SDK is used to load the application program, thereby timely repairing the problem and reducing risks caused by the update of the SDKs.
In an embodiment, before the application program is started, the method may further include:
obtaining an old version of the SDK from the static library to obtain a second SDK;
and newly building a dynamic library depending on the static library, and storing the second SDK in the dynamic library.
In the i OS system, when the dynamic library depends on the static library, in the link stage, the dynamic library copies all codes of the dependent static library into the dynamic library, and depends on the static library of the new version inside the application program, so the application program comprises all codes and resources of the static library of the new version, and then adds a new dynamic library for the application program to perform the static library of the dependent old version.
In an embodiment, after storing the second SDK in the dynamic library, may further comprise:
responding to a version updating instruction, and acquiring a first SDK of a new version from a server;
and replacing a second SDK stored in the static library with the first SDK of the new version.
In this embodiment, the version update instruction includes an application identifier of a current application program that the computer device needs to update the SDK. The application identifier can be the name, icon and the like of the current application program, the server queries the SDK of the new version according to the application identifier of the current application program to obtain the first SDK, the first SDK is sent to the computer equipment, and the computer equipment updates the second SDK stored in the static library into the first SDK of the new version.
Referring to fig. 2, an embodiment of the present application further provides an SDK loading apparatus, where the apparatus includes:
the obtaining module 11 is configured to obtain a first SDK of a new version when the application is started;
the initialization module 12 is configured to initialize the application program by using the first SDK, and send a first object of the first SDK to a pre-created dynamic library; the dynamic library is stored with a second SDK of an old version in advance;
the determining module 13 is configured to obtain a configuration instruction of the server, and determine the version of the application SDK according to the configuration instruction to obtain a target version;
and the loading module 14 is configured to, when it is determined that the target version is the old version, obtain a second object of the second SDK from the dynamic library, and load the application program by using the second object.
In this embodiment, when an application in the I OS system is started, the system may obtain the SDK of the latest version to obtain the first SDK, initialize the application using the first SDK, and load a code, a resource, a local library (a code library corresponding to the current application stored in the client) and the like in the first SDK by using a default class loader.
Typically, the application-initiated class loader will only load the code, resources, and local libraries that the first SDK of the application itself contains. Therefore, to dynamically load the first SDK, the code, the resource, and the local library in the first SDK and the code, the resource, and the local library in the current application need to be merged together, so that the first SDK and the application are seamlessly connected, and both use the same context (execution environment of the application).
In the embodiment, the resources of the first SDK are integrated, and the management of the resources in the I OS system is managed by the application resource manager. Therefore, the addassetPath method of the AssetManager is called by reflection to load the resource into the Resources object, and then the resource of the first SDK can be accessed through the Resources.
In addition, in this embodiment, the first object of the first SDK is further sent to a pre-created dynamic library, the dynamic library stores the second SDK of the old version in advance, when a large number of application programs crash on line after the first SDK is upgraded, the configuration instruction of the server indicates to call the second SDK of the old version, and then it is determined that the target version is the old version, the second object of the second SDK is obtained from the dynamic library, and the application program is loaded by using the second object.
When the functions of the first SDK are normally operated after being upgraded and the application program is not crashed, the configuration instruction of the server indicates to call the first SDK of the new version, the target version is determined to be the new version, the first object of the first SDK is obtained from the dynamic library, and the application program is loaded by the first object.
Taking a character recognition SDK as an example, a system prepares SDKs of two versions of an OCR-V1 and an OCR-V2 in advance, wherein the OCR-V1 is a second SDK of an old version, the OCR-V2 is a first SDK of a new version, an application program engineering creates a new dynamic library mi dd l ware, the dynamic library mi dd l ware carries out a second SDK depending on the OCR-V1 version, the old version of the second SDK is stored in advance, when the application program is started, the system carries out initialization on the first SDK of the OCR-V2 version and transmits a second object of the OCR-V2 to the dynamic library mi dd l ware for reference, and carries out a configuration instruction issued by a request server, the configuration instruction contains the SDK version adopted by the application program, calling logics of different versions are carried out according to the configuration instruction, if the first SDK of the new version, namely the OCR-V2 version, the initialization of the application program is directly returned and transmitted to the dynamic library mi, the first SDK is loaded from the first SDK, and the first object of the dynamic library is loaded by using the first SDK; if the old version of the second SDK, namely the OCR-V1 version, is used, a second object of the OCR-V1 version which is depended by the dynamic library mdd l email is loaded and initialized, the second object is returned to the application program for use, and finally when the application program uses the identification service provided by the SDK, the corresponding service is called by using the object returned by the dynamic library mldd l email.
When an application program is started, acquiring a first SDK of a new version, initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; the method comprises the steps of storing a second SDK of an old version in advance in a dynamic library, obtaining a configuration instruction of a server, determining the version of the SDK of an application program according to the configuration instruction, obtaining a target version, obtaining a second object of the second SDK from the dynamic library when the target version is determined to be the old version, loading the application program by using the second object, obtaining the second SDK of the old version in a static library by using the link principle that the dynamic library depends on the static library, including the second SDK in a source code and a resource file of the dynamic library, and when a problem occurs in a large updating span of a first SDK of a new version, degrading the SDK version by using a server configuration mode, loading the application program by using the second object of the second SDK, repairing the problem in time and reducing risks caused by upgrading of the SDK.
As described above, it can be understood that each component of the SDK loading apparatus provided in this application may implement the function of any one of the SDK loading methods described above, and the detailed structure is not described again.
Referring to fig. 3, an embodiment of the present application further provides a computer device, and an internal structure of the computer device may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer designed processor is used to provide computational and control capabilities. The memory of the computer device comprises a storage medium and an internal memory. The storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and computer programs in the storage medium. The database of the computer device is used for storing the related data of the SDK loading method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program when executed by a processor implements an SDK loading method.
The processor executes the SDK loading method, and the method includes:
when the application program is started, acquiring a first SDK of a new version;
initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; wherein, the dynamic library stores the second SDK of the old version in advance;
acquiring a configuration instruction of a server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and when the target version is determined to be the old version, acquiring a second object of a second SDK from the dynamic library, and loading the application program by using the second object.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, the computer program, when executed by a processor, implementing an SDK loading method, the method including:
when the application program is started, acquiring a first SDK of a new version;
initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; wherein, the dynamic library stores the second SDK of the old version in advance;
acquiring a configuration instruction of a server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and when the target version is determined to be the old version, acquiring a second object of a second SDK from the dynamic library, and loading the application program by using the second object.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database or other medium provided herein and used in the examples may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRDRAM), enhanced SDRAM (ESDRAM), synch i nk DRAM (SLDRAM), rambus Direct RAM (RDRAM), direct Rambus Dynamic RAM (DRDRAM), and Rambus Dynamic RAM (RDRAM).
To sum up, the most beneficial effect of this application lies in:
according to the SDK loading method, the device, the equipment and the storage medium, when an application program is started, a first SDK of a new version is obtained, the application program is initialized by using the first SDK, and a first object of the first SDK is sent to a pre-established dynamic library; the method comprises the steps of storing a second SDK of an old version in advance in a dynamic library, obtaining a configuration instruction of a server, determining the version of the SDK of an application program according to the configuration instruction, obtaining a target version, obtaining a second object of the second SDK from the dynamic library when the target version is determined to be the old version, loading the application program by using the second object, obtaining the second SDK of the old version in a static library by using the link principle that the dynamic library depends on the static library, including the second SDK in a source code and a resource file of the dynamic library, and when a problem occurs in a large updating span of a first SDK of a new version, degrading the SDK version by using a server configuration mode, loading the application program by using the second object of the second SDK, repairing the problem in time and reducing risks caused by upgrading of the SDK.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, apparatus, article, or method that comprises the element.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all the equivalent structures or equivalent processes that can be directly or indirectly applied to other related technical fields by using the contents of the specification and the drawings of the present application are also included in the scope of the present application.
Claims (10)
1. An SDK loading method, comprising:
when the application program is started, acquiring a first SDK of a new version;
initializing the application program by using the first SDK, and sending a first object of the first SDK to a pre-established dynamic library; wherein, the dynamic library stores the second SDK of the old version in advance;
acquiring a configuration instruction of a server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and when the target version is determined to be the old version, acquiring a second object of a second SDK from the dynamic library, and loading the application program by using the second object.
2. The method of claim 1, wherein determining the version of the SDK according to the configuration instruction, after obtaining the target version, further comprises:
and when the target version is determined to be a new version, acquiring a first object of the first SDK from the dynamic library, and loading the application program by using the first object.
3. The method of claim 2, wherein after the loading the application program with the first object, further comprising:
and when the first SDK is determined to be the character recognition SDK, calling character recognition service according to the first object.
4. The method of claim 2, wherein after initializing the application with the first SDK, further comprising:
reporting the function expansion state of the first SDK to the server;
and when the function expansion state of the first SDK meets the requirement, determining that the target version is a new version, otherwise, determining that the target version is an old version.
5. The method of claim 2, wherein after initializing the application with the first SDK, further comprising:
performing security detection on the first SDK;
and if the first SDK passes the security detection, determining that the target version is a new version, otherwise, determining that the target version is an old version.
6. The method of claim 1, wherein before the application program is launched, further comprising:
obtaining an old version of the SDK from the static library to obtain a second SDK;
and newly building a dynamic library depending on the static library, and storing the second SDK in the dynamic library.
7. The method of claim 6, wherein after storing the second SDK in the dynamic library, further comprising:
responding to a version updating instruction, and acquiring a first SDK of a new version from a server;
and replacing a second SDK stored in the static library with the first SDK of the new version.
8. An SDK loading apparatus, comprising:
the acquisition module is used for acquiring the first SDK of the new version when the application program is started;
the initialization module is used for initializing the application program by using the first SDK and sending a first object of the first SDK to a pre-established dynamic library; the dynamic library is stored with a second SDK of an old version in advance;
the determining module is used for acquiring a configuration instruction of the server, and determining the version of the application program SDK according to the configuration instruction to obtain a target version;
and the loading module is used for acquiring a second object of a second SDK from the dynamic library and loading the application program by using the second object when the target version is determined to be the old version.
9. A computer device, comprising:
a processor;
a memory;
wherein the memory stores a computer program which, when executed by the processor, implements the SDK loading method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the SDK loading method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211624559.2A CN115934198A (en) | 2022-12-16 | 2022-12-16 | SDK loading method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211624559.2A CN115934198A (en) | 2022-12-16 | 2022-12-16 | SDK loading method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115934198A true CN115934198A (en) | 2023-04-07 |
Family
ID=86553950
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211624559.2A Pending CN115934198A (en) | 2022-12-16 | 2022-12-16 | SDK loading method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115934198A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116560699A (en) * | 2023-07-10 | 2023-08-08 | 易方信息科技股份有限公司 | Method and device for quick repair through SDK version mixing |
-
2022
- 2022-12-16 CN CN202211624559.2A patent/CN115934198A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116560699A (en) * | 2023-07-10 | 2023-08-08 | 易方信息科技股份有限公司 | Method and device for quick repair through SDK version mixing |
CN116560699B (en) * | 2023-07-10 | 2024-02-13 | 易方信息科技股份有限公司 | Method and device for quick repair through SDK version mixing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8555272B2 (en) | System and method for implementing data-compatibility-based version scheme | |
EP1803313A1 (en) | Method and system for controlling software version updates | |
CN112130871A (en) | Method and device for remotely deploying middleware, computer equipment and storage medium | |
CN113835713B (en) | Source code packet downloading method, device, computer equipment and storage medium | |
CN115934198A (en) | SDK loading method, device, equipment and storage medium | |
CN111857777A (en) | System updating method and device based on double-core intelligent electric meter and computer equipment | |
CN111679888A (en) | Deployment method and device of agent container | |
CN115543429A (en) | Project environment building method, electronic equipment and computer readable storage medium | |
CN114490103A (en) | Operating system interface calling method and device and electronic equipment | |
CN115374083A (en) | Data source switching method and device, electronic equipment and storage medium | |
CN115437643A (en) | Project code conversion method, device, equipment and storage medium | |
CN115729590A (en) | Service deployment method, device, equipment and computer readable storage medium | |
CN113031964B (en) | Big data application management method, device, equipment and storage medium | |
CN115202665A (en) | Android compilation stage API (application program interface) replacement method and device, computer equipment and storage medium | |
CN115129348A (en) | Resource updating method, device and equipment of application program and readable storage medium | |
CN112835679A (en) | Hot patching method and system based on sandbox | |
CN112947956B (en) | Application software upgrading method | |
CN114443065A (en) | Platform deployment method, platform deployment device, electronic equipment and storage medium | |
CN111177718A (en) | Command execution method and device | |
CN114003486A (en) | Plug-in debugging method, client, server and storage medium | |
KR101169432B1 (en) | System and method for managing the performance environment java application | |
CN116860275A (en) | Client updating method, terminal device and computer readable storage medium | |
CN113176913B (en) | Processing method and device of JAVA agent, terminal equipment and storage medium | |
CN117130987B (en) | Flight control management method for large-scale unmanned aerial vehicle cluster | |
CN112486569A (en) | Plug-in SDK generation 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 |