EP-4557086-B1 - SDK REPAIR METHOD AND APPARATUS, TERMINAL, DEVICE, SYSTEM, AND MEDIUM
Inventors
- WU, WENCHUAN
- XIA, Ji
- SHEN, XI
- TANG, Zhixiong
- LIU, QIANG
Dates
- Publication Date
- 20260513
- Application Date
- 20230306
Claims (15)
- A software development kit, SDK, repair method, applied to a repair platform, comprising: obtaining (S201) SDK information, host information and SDK anomaly information of different anomaly types; determining (S202) an anomaly impact index corresponding to each anomaly type of a target SDK according to the SDK information, the host information, and the SDK anomaly information of each anomaly type, wherein the target SDK corresponds to a host program indicated by the host information and an SDK version indicated by the SDK information, and the anomaly impact index corresponding to each anomaly type of the target SDK represents a degree of impact of an SDK anomaly of each anomaly type on the target SDK; obtaining (S203) a repair policy for the target SDK according to the anomaly impact index corresponding to each anomaly type of the target SDK and a preset anomaly grading processing rule, wherein the anomaly grading processing rule comprises a corresponding relationship between anomaly types, anomaly impact indexes, anomaly levels and repair policies, the repair policy for the target SDK includes a repair policy, in the anomaly grading processing rule, with an anomaly level corresponding to the anomaly impact index; and delivering (S204) the repair policy for the target SDK to a user terminal, so that the user terminal executes the repair policy for the target SDK to repair the target SDK.
- The method according to claim 1, wherein determining (S202) the anomaly impact index corresponding to each anomaly type of the target SDK according to the SDK information, the host information and the SDK anomaly information of each anomaly type comprises: determining (S2021) the target SDK according to the SDK information and the host information, and obtaining feature information in the SDK anomaly information of each anomaly type of the target SDK as well as weights of the feature information; calculating (S2022) an anomaly impact factor corresponding to each anomaly type of the target SDK according to the feature information and the weights of the feature information; calculating (S2023) an output ratio corresponding to each anomaly type of the target SDK according to a number of the SDK anomaly information of each anomaly type of the target SDK and a total number of the SDK anomaly information; and calculating (S2024) the anomaly impact index corresponding to each anomaly type of the target SDK by using the anomaly impact factor and the output ratio corresponding to each anomaly type of the target SDK.
- The method according to claim 1, wherein obtaining (S 203)the repair policy for the target SDK according to the anomaly impact index corresponding to each anomaly type of the target SDK and the preset anomaly grading processing rule comprises: determining (S 2031) a target anomaly type according to the anomaly impact index corresponding to each anomaly type, wherein the target anomaly type is an anomaly type corresponding to an anomaly impact index having a largest value; and according to the anomaly grading processing rule, determining (S2032) an anomaly level corresponding to the target anomaly type and the anomaly impact index of the target anomaly type, and determining the repair policy for the target SDK according to the anomaly level.
- The method according to claim 1, wherein the repair policy for the target SDK includes one or more of the following: a first file, wherein the first file includes a cache data clearing instruction, and the cache data clearing instruction is used to instruct to clear data in at least one cache folder corresponding to the target SDK; a second file, wherein the second file includes an anomaly source blocking instruction, and the anomaly source blocking instruction is used to instruct to set an on/off state of at least one service function and/or sub-service function of the target SDK to an off state; and a third file, wherein the third file includes a patch file, and the patch file is used to upgrade and repair the target SDK.
- The method according to claim 4, wherein the repair policy for the target SDK includes the third file, and the method further includes: obtaining a pre-repair SDK archive file and a post-repair SDK archive file of the target SDK; obtaining a first class file and a second class file, wherein the first class file includes a class file in the pre-repair SDK archive file, and the second class file includes a class file in the post-repair SDK archive file; using a comparison algorithm to compare the first class file and the second class file to obtain a third class file, wherein the third class file includes a class file indicating a difference between the second class file and the first class file; and converting the third class file into the patch file.
- The method according to claim 1, wherein the repair policy for the target SDK further includes a first signature file, and the method further includes: generating a first signature according to the host information; and generating a first signature file according to the first signature, wherein the first signature file includes the first signature.
- The method according to claim 1, wherein, after obtaining (S203) the repair policy for the target SDK according to the anomaly impact index corresponding to each anomaly type of the target SDK and the preset anomaly grading processing rule, the method further includes: delivering (S205) the repair policy for the target SDK to a provider platform; and receiving (S206) a repair policy for the target SDK fed back by the provider platform, wherein the fed back repair policy for the target SDK includes a second signature file, the second signature file includes a second signature, and the second signature is generated by the provider platform according to the host information after scanning and authorizing the repair policy for the target SDK, wherein delivering (S204) the repair policy for the target SDK to the user terminal includes: delivering (S2041) the repair policy for the target SDK fed back by the provider platform to the user terminal.
- The method according to claim 1, wherein the repair policy for the target SDK is executed by a repair process established by the user terminal, and the repair process is independent of a processing of the target SDK.
- An SDK repair method, applied to a user terminal, comprising: providing (S301) SDK information, host information and SDK anomaly information of different anomaly types to a repair platform, so that the repair platform obtains a repair policy for a target SDK according to an anomaly impact index corresponding to each anomaly type of the target SDK and a preset anomaly grading processing rule, wherein the anomaly grading processing rule comprises a corresponding relationship between anomaly types, anomaly impact indexes, anomaly levels and repair policies; the repair policy for the target SDK includes a repair policy, in the anomaly grading processing rule, with an anomaly level corresponding to the anomaly impact index; the target SDK corresponds to a host program indicated by the host information and an SDK version indicated by the SDK information; the anomaly impact index corresponding to each anomaly type of the target SDK is obtained according to the SDK information, the host information and the SDK anomaly information of each anomaly type; and the anomaly impact index corresponding to each anomaly type of the target SDK represents a degree of impact of an SDK anomaly of each anomaly type on the target SDK; and obtaining (S302) the repair policy for the target SDK from the repair platform, and executing the repair policy for the target SDK to repair the target SDK.
- The method according to claim 9, wherein: calculating the anomaly impact index corresponding to each type of anomaly of the target SDK using an anomaly impact factor and an output ratio corresponding to each anomaly type of the target SDK, wherein the output ratio corresponding to each anomaly type of the target SDK is calculated according to a number of SDK anomaly information of each anomaly type of the target SDK and a total number of the SDK anomaly information, and the anomaly impact factor corresponding to each anomaly type of the target SDK is calculated according to feature information in the SDK anomaly information of each anomaly type of the target SDK and weights of the feature information.
- The method according to claim 9, wherein the anomaly level corresponding to the repair policy for the target SDK is obtained according to the anomaly grading processing rule, a target anomaly type and an anomaly impact index of the target anomaly type, and the target anomaly type is an anomaly type corresponding to an anomaly impact index with a largest value.
- The method according to claim 9, wherein the repair policy for the target SDK includes one or more of the following: a first file, wherein the first file includes a cache data clearing instruction, and the cache data clearing instruction is used to instruct to clear data in at least one cache folder corresponding to the target SDK; a second file, wherein the second file includes an anomaly source blocking instruction, and the anomaly source blocking instruction is used to instruct to set an on/off state of at least one service function and/or sub-service function of the target SDK to an off state; and a third file, where the third file includes a patch file, and the patch file is used to upgrade and repair the target SDK.
- The method according to claim 9, wherein: the repair policy for the target SDK further includes a first signature file, the first signature file includes a first signature, and the first signature is generated by the repair platform according to the host information; after obtaining (S302) the repair policy for the target SDK from the repair platform, the method further includes: calling the host program indicated by the host information to verify the first signature; and executing (S302) the repair policy for the target SDK to repair the target SDK includes: executing the repair policy for the target SDK to repair the target SDK when the host program indicated by the host information successfully verifies the first signature.
- The method according to claim 9, wherein: the repair policy for the target SDK further includes a second signature file, the second signature file includes a second signature, and the second signature is generated by the provider platform according to the host information after scanning the repair policy for the target SDK and granting authorization; after obtaining (S302, 3021) the repair policy for the target SDK from the repair platform, the method further includes: calling (S3022) the host program indicated by the host information to verify the second signature; and executing (S302) the repair policy for the target SDK to repair the target SDK includes: executing (S3023) the repair policy for the target SDK to repair the target SDK when the host program indicated by the host information successfully verifies the second signature.
- The method according to any one of claims 9 to 14, wherein obtaining (S302) the repair policy for the target SDK from the repair platform and executing the repair policy for the target SDK to repair the target SDK comprises: establishing a repair process, wherein the repair process is independent of a processing of the target SDK; and obtaining the repair policy for the target SDK from the repair platform through the repair process, and executing the repair policy for the target SDK to repair the target SDK. wherein obtaining the repair policy for the target SDK from the repair platform through the repair process and executing the repair policy for the target SDK to repair the target SDK comprises: monitoring (S3024) the processing of the target SDK through the repair process, before the target SDK is repaired, when it is detected that the processing of the target SDK is terminated and the repair policy for the target SDK has not been downloaded, continuing (S3025) to download the repair policy for the target SDK through the repair process until the repair policy for the target SDK is downloaded and then interrupting the repair process, and when it is detected that the processing of the target SDK is started again, executing (S3025) the repair policy for the target SDK through the repair process to repair the target SDK; or before the target SDK is repaired, when it is detected that the processing of the target SDK is terminated and the repair policy for the target SDK has begun to be executed, recording (S3026) a repair progress of the target SDK through the repair process, and when it is detected that the processing of the target SDK is started again, continuing (S3026) to repair the target SDK through the repair process according to the repair progress.
Description
CROSS-REFERENCE TO RELATED APPLICATION This application claims priority to Chinese Patent Application No. 202211035360.6 entitled "SDK REPAIR METHOD AND APPARATUS, TERMINAL, DEVICE, SYSTEM, AND MEDIUM," filed on August 26, 2022. FIELD OF THE DISCLOSURE The disclosure generally relates to the field of data processing technology and, more particularly, relates to a method, apparatus, terminal, device, system and medium for repairing an SDK. BACKGROUND Software development kit (SDK) is a toolkit that provides certain functions for a software framework, hardware platform, operating system or application. SDK may be embedded in hosts such as software frameworks, hardware platforms, operating systems or applications of different content providers. When SDK runs with a host, the SDK may cause anomalies and the SDK needs to be repaired so that it may run normally. However, due to the differences in development methods and host environments of different content providers, the defects in the SDK may also be different. A single repair of the SDK is difficult to meet the repair needs of the SDKs of different content providers. Patent Application US2016/321067A1 discloses a system and method for hosting and publishing software packages. An example method includes receiving and storing artifacts related to a software development kit and metadata describing a version of the software development kit. The received artifacts and metadata may be converted into a package for the software development kit. The package may then be staged and the package's dependencies may be checked to ensure that the package's dependencies exist and that there are no conflicts with another staged package. The currently staged packages may then be tested to determine if there are any incompatibilities among the staged packages and access control information may be used to provide the currently staged packages in a common format to the appropriate users. SUMMARY The embodiments of the disclosure provide a method, apparatus, terminal, device, system and medium for repairing an SDK, which may meet the repair requirements of SDKs of different content providers. In a first aspect, embodiments of the disclosure provide an SDK repair method, which is applied to a repair platform, the method including: obtaining SDK information, host information and SDK anomaly information of different anomaly types, determining an anomaly impact index corresponding to each anomaly type of a target SDK according to the SDK information, the host information, and the SDK anomaly information of each anomaly type, where the target SDK corresponds to a host program indicated by the host information and an SDK version indicated by the SDK information, and the anomaly impact index corresponding to each anomaly type of the target SDK represents a degree of impact of an SDK anomaly of each anomaly type on the target SDK; obtaining a repair policy for the target SDK according to the anomaly impact index corresponding to each anomaly type of the target SDK and a preset anomaly grading processing rule, where the anomaly grading processing rule comprises a corresponding relationship between anomaly types, anomaly impact indexes, anomaly levels and repair policies, the repair policy for the target SDK includes a repair policy, in the anomaly grading processing rule, with an anomaly level corresponding to the anomaly impact index; and delivering the repair policy for the target SDK to a user terminal, so that the user terminal executes the repair policy for the target SDK to repair the target SDK. In a second aspect, embodiments of the disclosure provide an SDK repair method, which is applied to a user terminal, and the method includes: providing SDK information, host information and SDK anomaly information of different anomaly types to a repair platform, so that the repair platform obtains a repair policy for a target SDK according to an anomaly impact index corresponding to each anomaly type of the target SDK and a preset anomaly grading processing rule, where the anomaly grading processing rule comprises a corresponding relationship between anomaly types, anomaly impact indexes, anomaly levels and repair policies; the repair policy for the target SDK includes a repair policy, in the anomaly grading processing rule, with an anomaly level corresponding to the anomaly impact index; the target SDK corresponds to a host program indicated by the host information and an SDK version indicated by the SDK information; the anomaly impact index corresponding to each anomaly type of the target SDK is obtained according to the SDK information, the host information and SDK anomaly information of each anomaly type; and the anomaly impact index corresponding to each anomaly type of the target SDK represents a degree of impact of an SDK anomaly of each anomaly type on the target SDK; and obtaining the repair policy for the target SDK from the repair platform, and executing the repair policy for the t