WO2023065823A1 - Software development kit fixing method, terminal, server and device - Google Patents

Software development kit fixing method, terminal, server and device Download PDF

Info

Publication number
WO2023065823A1
WO2023065823A1 PCT/CN2022/115415 CN2022115415W WO2023065823A1 WO 2023065823 A1 WO2023065823 A1 WO 2023065823A1 CN 2022115415 W CN2022115415 W CN 2022115415W WO 2023065823 A1 WO2023065823 A1 WO 2023065823A1
Authority
WO
WIPO (PCT)
Prior art keywords
patch
repair
sdks
sdk
terminal
Prior art date
Application number
PCT/CN2022/115415
Other languages
French (fr)
Chinese (zh)
Inventor
魏君成
Original Assignee
北京字节跳动网络技术有限公司
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 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Publication of WO2023065823A1 publication Critical patent/WO2023065823A1/en

Links

Images

Classifications

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

Definitions

  • the present disclosure relates to the technical field of software maintenance, and in particular, relates to a method for repairing a software development kit, a terminal, a server and a device, and a storage medium storing readable computer programs.
  • SDK Software Development Kit
  • Embodiments of the present disclosure at least provide a method for repairing a software development kit, a terminal, a server, a device, and a storage medium.
  • An embodiment of the present disclosure provides a method for repairing a software development kit, which is applied to a terminal.
  • the terminal includes a plurality of software development kit SDKs, and at least some of the SDKs in the plurality of SDKs have different version numbers.
  • the methods include:
  • the determination of the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches includes:
  • repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
  • repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
  • the method includes:
  • the following steps are used to detect whether the repair patch is consistent with the corresponding local patch:
  • the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
  • the merging of the determined multiple executable files to obtain a fusion patch package for the multiple SDKs includes:
  • Fusion is performed according to the renamed executable file to obtain fusion patch packages for the plurality of SDKs.
  • the method before using the fusion patch package to repair the multiple SDKs, the method includes:
  • using the fusion patch package to repair the multiple SDKs includes:
  • the fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
  • the multiple SDKs include a main SDK and a function SDK that is accessed according to a function that the terminal needs to implement, and the accessed function SDK depends on the existence of the main SDK.
  • An embodiment of the present disclosure provides a method for repairing a software development kit, which is applied to a server, and the method includes:
  • each SDK determines the management information of each repair patch
  • the generated repair patches and the management information corresponding to each repair patch are sent to the terminal.
  • An embodiment of the present disclosure also provides a terminal, the terminal includes multiple software development kit SDKs, at least some of the SDKs have different version numbers, and the terminal includes:
  • An acquisition module configured to acquire a repair patch generated by the server for each SDK in the plurality of SDKs
  • the first determination module is used to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches;
  • the second determining module is used to decrypt and decompress the determined latest patch for each SDK, and obtain the executable file corresponding to each latest patch;
  • a fusion module configured to fuse the determined multiple executable files to obtain fusion patch packages for the multiple SDKs
  • a repair module configured to repair the plurality of SDKs by using the fusion patch package.
  • the first determination module is specifically configured to:
  • repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
  • repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
  • the first determination module is also used for:
  • the first determination module is configured to detect whether the repair patch is consistent with the corresponding local patch through the following steps:
  • the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
  • the fusion module is specifically used for:
  • Fusion patch packages of the plurality of SDKs are fused according to the renamed executable files.
  • the terminal further includes a clearing module, and the clearing module is used for:
  • the repair module is specifically used for:
  • the fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
  • An embodiment of the present disclosure also provides a server, and the server includes:
  • a generation module configured to generate a corresponding repair patch for each SDK in the plurality of SDKs, wherein the version numbers of at least some of the SDKs in the plurality of SDKs are different;
  • the information determination module is used to determine the management information of each repair patch according to the identification information of each SDK and the corresponding repair method;
  • the sending module is configured to, after receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The memories communicate with each other through the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned steps in the method for repairing the software development kit are executed.
  • An embodiment of the present disclosure further provides a computer storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps in the above method for repairing the software development kit are executed.
  • the server In the software development kit repair method, terminal, server, device, and storage medium provided by the embodiments of the present disclosure, the server generates a corresponding repair patch for each SDK in multiple SDKs, and according to the identification information of each SDK and the corresponding repair method , determine the management information of each repair patch, after receiving the patch request from the terminal, send the generated multiple repair patches and the management information corresponding to each repair patch to the terminal, and the terminal obtains the server for multiple software development
  • the repair patch generated by each SDK in the toolkit SDK based on the local patch of each SDK in the terminal and the plurality of repair patches, determine the latest patch for each SDK, and determine the latest patch for each SDK.
  • the latest patches of the SDKs are fused to obtain a fusion patch package for the multiple SDKs, and the multiple SDKs are repaired using the fusion patch package.
  • patches can be generated separately for each version of the SDK on the server side to ensure the independence of the SDK, and the SDK logo can be brought into the generated management information as independent information, which is conducive to the smooth progress of subsequent patch merging operations.
  • Multiple SDKs of different versions and related to each other can issue patches for all SDKs at one time, and then repair each SDK after merging the independent patches on the terminal side, so that different applications that access each SDK can receive the corresponding patches to repair the middle-end tools including all SDKs as a whole, which can not only greatly reduce the workload of hot repair and resource consumption, but also effectively take into account the independence, correlation and dependence between SDKs It greatly avoids repair failures caused by the correlation between SDKs, which is conducive to improving the success rate of hot repairs.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure
  • FIG. 2 is a flow chart of a method for repairing a software development kit provided by an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure
  • FIG. 4 is a flowchart of another method for repairing a software development kit provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a server provided by an embodiment of the present disclosure.
  • FIG. 6 is one of schematic diagrams of a terminal provided by an embodiment of the present disclosure.
  • FIG. 7 is a second schematic diagram of a terminal provided by an embodiment of the present disclosure.
  • Fig. 8 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
  • this disclosure provides a software development toolkit repair method, which can generate patches for each version of the SDK separately on the server side to ensure the independence of the SDK, and bring the SDK logo as independent information to the generated management In the class information, it is conducive to the smooth progress of subsequent patch merging operations. For multiple SDKs of different versions and associated multiple SDKs, all SDK patches can be issued at one time.
  • the execution subject of the toolkit repair method provided in the embodiments of the present disclosure is generally a computer device with certain computing capabilities.
  • the computer equipment includes, for example: terminal equipment or server or other processing equipment, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc.
  • the method for repairing the toolkit may be implemented by the processor invoking computer-readable instructions stored in the memory.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure.
  • various terminals have entered people's lives, such as various mobile terminals, wearable smart terminals, fixed terminals, etc.
  • developers will develop various application files required by users and patch files for upgrading and repairing applications on the background server side, and will develop application files and patch files and uploaded to an application platform for managing applications, such as various application stores, etc., users can download application files and patch files from the application platform to install the application and perform operations such as repairing the application.
  • FIG. 2 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure.
  • the method for repairing the software development kit provided by the embodiment of the present disclosure can be applied to the server shown in FIG. 1, and as shown in FIG. 2, the method includes:
  • S201 Generate a corresponding repair patch for each of the multiple SDKs, where at least some of the SDKs have different version numbers.
  • the target application may be installed in the terminal, and the target application includes multiple software development kit SDKs.
  • the multiple SDKs may include the main SDK and a function SDK that is accessed according to the functions required by the terminal.
  • the multiple SDKs At least some of the SDKs have different version numbers.
  • a corresponding repair patch is generated for each SDK, that is, a repair patch is separately generated for each SDK.
  • the repair patches corresponding to them can be the patches from the last repair.
  • S202 Determine the management class information of each repair patch according to the identification information of each SDK and the corresponding repair method.
  • the method to be repaired in the SDK (the old method with problems) and the corresponding repair method (the new one can replace the old method) new method for repairing)
  • determine the management class information for each repair patch according to the identification information of each SDK and the corresponding repair method, such as the name of the SDK, the method to be repaired in the SDK (the old method with problems) and the corresponding repair method (the new one can replace the old method) new method for repairing).
  • management class information of each repair patch may be recorded through Java source code.
  • each SDK after it changes, a corresponding repair patch can be generated each time.
  • each SDK may have multiple fixes. Patches, therefore, in order to facilitate management, different priorities can be configured for each repair patch generated according to the generation time. The closer the repair patch generation time is to the current server clock time, the higher the priority of the repair patch.
  • issuing a patch that is, when the patch needs to be sent to the terminal or uploaded to the management platform, compare the priorities of all the repair patches in the SDK, and determine that the repair patch with the highest priority is the repair patch to be sent to the terminal or uploaded to the management platform.
  • the determined repair patch with the highest priority and the management information corresponding to each repair patch can be sent to the terminal, that is, when there are multiple repair patches in the current SDK, the priority The highest level patch is sent to the terminal.
  • Sending the repair patch and the management class information corresponding to the repair patch together can ensure the correspondence between the patch and the patch management class, which is convenient for subsequent use.
  • the method for repairing the software development kit provided by the embodiment of the present disclosure generates a corresponding repair patch for each SDK in multiple SDKs, and determines the management information of each repair patch according to the identification information of each SDK and the corresponding repair method. , after receiving the patch request from the terminal, sending the generated repair patches and the management information corresponding to each repair patch to the terminal.
  • patches can be generated separately for each version of the SDK to ensure the independence of the SDK, and the SDK logo can be brought into the generated management information as independent information, which is conducive to the smooth progress of subsequent patch merging operations.
  • Different versions and associated multiple SDKs can issue patches for all SDKs at one time.
  • FIG. 3 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure.
  • the software development kit repair method provided by the embodiment of the present disclosure is applied to the terminal as shown in Figure 1.
  • the terminal includes multiple software development kit SDKs, at least some of which have different version numbers, as shown in Figure 3 , methods include:
  • the obtained repair patches may be obtained from the application platform, but not limited thereto, and may also be directly obtained from the server in other real-time manners.
  • multiple SDKs can be multiple SDKs that make up middle-end tools, which can include the main SDK, and multiple functional SDKs that are connected to the main SDK and accessed according to the functions that the terminal needs to achieve.
  • the accessed functional SDKs depend on In addition, there may also be dependencies between multiple functional SDKs.
  • the file type of the repair patch may be a jar file.
  • the repair patch obtained may be a packaged file sent by the receiving server, which includes repair patches of each SDK.
  • S302 Determine the latest patch for each SDK based on the local patch and multiple repair patches of each SDK in the terminal.
  • this step after obtaining multiple repair patches, you can compare the repair patches corresponding to each SDK with the local patches by comparing the multiple repair patches with the local patches of each SDK in the terminal. , and determine the latest patch of each SDK according to the comparison result of the repair patch and the local patch.
  • the file types of the local patch and multiple repair patches of each SDK in the terminal, and the determined latest patch are all jar files.
  • determining the latest patch of each SDK may be after receiving the file sent by the server, for example, after receiving the file package sent by the server, comparing the management information in the file package with the local patch to determine the latest patch .
  • each repair patch For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch corresponding to the repair patch and stored in the terminal; detect the repair patch and the corresponding local Whether the patch is consistent; if the repair patch is inconsistent with the corresponding local patch, determine that the repair patch is the latest patch of the corresponding SDK; if the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the corresponding The latest patch for the SDK.
  • the management information of each repair patch can be extracted from the received file, and for each repair patch, according to the records in the management information of the repair patch,
  • the identification information of the SDK to which the repair patch belongs determines the SDK to which the repair patch belongs, and then determines the local patch stored in the terminal by the SDK to which the repair patch belongs, and then compares the repair patch with the local patch to detect the repair Whether the patch is consistent with the corresponding local patch. If the repair patch is inconsistent with the corresponding local patch, the repair patch is considered to be the latest patch of the corresponding SDK. If the repair patch is consistent with the corresponding local patch, it can be considered to be the same as the repair patch The local patch corresponding to the patch is already the latest patch of the SDK.
  • the management class information corresponding to the repair patch can be obtained together, that is, the received packaged file can include records A file with administrative information.
  • the following steps may be used to detect whether the repair patch is consistent with the corresponding local patch:
  • the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch can be calculated respectively, and then by comparing the digest algorithm value of the repair patch with the corresponding The size of the digest algorithm value of the local patch, and check whether the repair patch is consistent with the corresponding local patch. If the digest algorithm value of the repair patch is equal to the digest algorithm value of the corresponding local patch, the repair patch and the corresponding local patch can be determined.
  • the local patches are the same.
  • the digest algorithm value of the repair patch and the corresponding digest algorithm value of the local patch may be the MD5 value of the repair patch and the corresponding MD5 value of the local patch.
  • the method includes:
  • the local patch corresponding to the repair patch can be deleted, so as to avoid the impact caused when the patch is used.
  • S303 Decrypt and decompress the determined latest patch for each SDK to obtain an executable file corresponding to each latest patch.
  • the type of the executable file is a dex file.
  • S304 Merge the determined multiple executable files to obtain a fusion patch package for multiple SDKs.
  • the file type of the fusion patch package of multiple SDKs is a jar file.
  • the obtained integrated patch package can be loaded with a class loader to make the integrated patch package take effect, so as to complete the repair of multiple SDKs.
  • the loading method can be determined according to the status of the terminal. Detect whether the Android system of the terminal is version 5.0 or lower. If so, you need to add each independent executable file in the fusion patch package of multiple SDKs to the path of the class loader to ensure that all patches will be merged after synthesis. Load and run.
  • the software development kit repair method obtains the repair patch generated by the server for each SDK in multiple SDKs; based on the local patch and multiple repair patches of each SDK in the terminal, determine the The latest patch of the SDK; decrypt and decompress the determined latest patch for each SDK to obtain the executable file corresponding to each latest patch; merge the determined executable files to obtain the Fusion patch package; use the fusion patch package to fix multiple SDKs.
  • each SDK is repaired after the independent patches are integrated on the terminal side, so that different applications connected to each SDK can receive the corresponding patches, so as to perform overall repairs on the middle platform tools including all SDKs, not only can It greatly reduces the workload and resource consumption of hot repair, and can effectively take into account the independence, correlation and dependence between SDKs, avoiding repair failures caused by the correlation between SDKs, and improving the efficiency of hot repair. Success rate.
  • FIG. 4 is a flow chart of another method for repairing a software development kit provided by an embodiment of the present disclosure.
  • the software development kit repair method provided by the embodiment of the present disclosure is applied to the terminal as shown in Figure 1.
  • the terminal includes multiple software development kit SDKs, at least some of which have different version numbers, as shown in Figure 4 , methods include:
  • S402 Determine the latest patch for each SDK based on the local patch and multiple repair patches of each SDK in the terminal.
  • S403 Decrypt and decompress the determined latest patch for each SDK to obtain an executable file corresponding to each latest patch.
  • S404 Merge the determined multiple executable files to obtain a fusion patch package for multiple SDKs.
  • S405 Determine the historical patch information generated by loading the historical patch package during the last repair before this repair.
  • the historical patch information is cleared, that is, the product generated by loading the fusion patch package last time is cleared, so as not to affect the loading and repairing of the fusion patch this time.
  • the historical patch information be cleared, that is, the premise that the local patches of the terminal are updated.
  • the historical patch information will be cleared only if the terminal is disabled. If the local patch of the terminal is not updated, there is no need to clear the historical patch information.
  • step S401 to step S404 and step S407 can refer to the description of step S301 to step S305, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
  • step S404 includes:
  • the sort order of each executable file after decompression and decryption can be identified, and then it can be renamed according to the sort order of each executable file, Then merge the renamed executable files into a fusion patch package.
  • step S405 includes:
  • the fusion patch package After recording and loading the fusion patch package to generate effective patch information, according to the recorded effective patch information, determine the patch that has not taken effect, and send the management information of the patch that has not taken effect to the server, requesting to re-download the repair patch.
  • the software development kit repair method obtains the repair patch generated by the server for each SDK in multiple SDKs; based on the local patch and multiple repair patches of each SDK in the terminal, determine the The latest patch of the SDK; decrypt and decompress the determined latest patch for each SDK to obtain the executable file corresponding to each latest patch; merge the determined executable files to obtain the The fusion patch package; determine the historical patch information generated by loading the historical patch package during the last repair before this repair; clear the historical patch information; use the fusion patch package to repair multiple SDKs.
  • each SDK is repaired after the independent patches are integrated on the terminal side, so that different applications connected to each SDK can receive the corresponding patches, so as to perform overall repairs on the middle platform tools including all SDKs, not only can It greatly reduces the workload and resource consumption of hot repair, and can effectively take into account the independence, correlation and dependence between SDKs, greatly avoiding repair failures caused by the correlation between SDKs, and is conducive to improving the efficiency of hot repair. Success rate, before repairing, delete the products generated by previous repairs, reduce the impact of products generated by previous repairs on this repair, and further improve the efficiency and success rate of hot repairs.
  • the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possible
  • the inner logic is OK.
  • the embodiments of the present disclosure also provide servers and terminals corresponding to the software development toolkit repair methods respectively. Since the problem solving principles of the server and the terminal in the embodiments of the present disclosure are the same as those of the above-mentioned toolkit repair methods in the embodiments of the present disclosure The method is similar, so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
  • FIG. 5 is a schematic diagram of a server provided by an embodiment of the present disclosure.
  • the server 500 provided in the embodiment of the present disclosure includes:
  • a generating module 500 configured to generate a corresponding repair patch for each of the multiple SDKs, wherein at least some of the SDKs have different version numbers;
  • An information determination module 510 configured to determine the management class information of each repair patch according to the identification information of each SDK and the corresponding repair method
  • the sending module 530 is configured to, after receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
  • the server provided by the embodiment of the present disclosure can separately generate patches for each version of the SDK to ensure the independence of the SDK, and bring the identification of the SDK as independent information to the generated management information, which is conducive to the smooth operation of subsequent patch merging
  • patches for all SDKs can be delivered at one time.
  • FIG. 6 is one of schematic diagrams of a terminal provided by an embodiment of the present disclosure
  • FIG. 7 is a second schematic diagram of a terminal provided by an embodiment of the present disclosure.
  • the terminal includes a plurality of software development kit SDKs, at least some of which have different version numbers.
  • the terminal 600 provided by the embodiment of the present disclosure includes:
  • the obtaining module 610 is configured to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches.
  • the first determining module 620 is configured to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches.
  • the second determination module 630 is configured to decrypt and decompress the determined latest patch for each SDK, and obtain the executable file corresponding to each latest patch.
  • a fusion module 640 configured to fuse the determined multiple executable files to obtain fusion patch packages for the multiple SDKs
  • the repair module 650 is configured to use the fusion patch package to repair the multiple SDKs.
  • the first determining module 620 is specifically configured to:
  • repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
  • repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
  • the first determining module 620 is also configured to:
  • the first determination module 620 is configured to detect whether the repair patch is consistent with the corresponding local patch through the following steps:
  • the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
  • the fusion module 640 is specifically used for:
  • Fusion patch packages of the plurality of SDKs are fused according to the renamed executable files.
  • the terminal further includes a clearing module 660, and the clearing module 660 is configured to:
  • the repair module 650 is specifically used for:
  • the fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
  • the terminal provided by the embodiment of the present disclosure can repair each SDK after merging the received independent patches, so that different applications connected to each SDK can receive corresponding patches, so that the middle platform including all SDKs
  • the overall repair of the tool can not only greatly reduce the workload and resource consumption of hot repair, but also effectively take into account the independence, correlation and dependence between SDKs, and greatly avoid repair failures caused by the correlation between SDKs , which is conducive to improving the success rate of thermal repair.
  • an embodiment of the present disclosure also provides an electronic device.
  • the embodiment of the present disclosure also provides an electronic device 800, as shown in FIG. 8, which is a schematic structural diagram of the electronic device 800 provided by the embodiment of the present disclosure, including:
  • An embodiment of the present disclosure also provides a computer storage medium, on which a computer program is stored, and when the computer program is run by a processor, the software development kit repair method shown in FIG. 2 or FIG. 3 and FIG. 4 is executed. step.
  • the storage medium may be a volatile or non-volatile computer and storage medium.
  • An embodiment of the present disclosure also provides a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the steps of the method for repairing the software development kit described in the above method embodiment, specifically, Refer to the foregoing method embodiments, and details are not repeated here.
  • the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • a software development kit Software Development Kit, SDK
  • the disclosed storage medium, device, device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division.
  • multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer and storage medium executable by a processor.
  • the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Abstract

Provided in the present disclosure are a software development kit fixing method, a terminal, a server, a device and a storage medium. On a server side, patches can be separately generated for various versions of SDKs, so as to ensure the independence of the SDKs, and as independent information, identifiers of the SDKs are brought into generated management-type information, thereby facilitating the smooth conducting of a subsequent patch merging operation. For a plurality of different versions of associated SDKs, patches of all the SDKs can be issued in one step. The independent patches are fused on a terminal side, and the SDKs are then fixed, such that different applications that access the SDKs can receive corresponding patches, so as to perform overall fix on a middleground tool that comprises all the SDKs; thus, not only can a hot fix workload and resource consumption be greatly reduced, but the independence, association and dependence between the SDKs can also be effectively taken into consideration, thereby greatly avoiding a fix failure caused by the association between the SDKs, and facilitating an improvement in a success rate of hot fix.

Description

一种软件开发工具包修复方法、终端、服务器及设备A software development kit repair method, terminal, server and equipment
本申请要求于2021年10月20日提交国家知识产权局、申请号为202111222884.1、申请名称为“一种软件开发工具包修复方法、终端、服务器及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the State Intellectual Property Office on October 20, 2021, with the application number 202111222884.1, and the application name is "a software development kit repair method, terminal, server and equipment", all of which The contents are incorporated by reference in this application.
技术领域technical field
本公开涉及软件维护技术领域,具体而言,涉及一种软件开发工具包修复方法、终端、服务器及设备,以及以存储有可供读取的计算机程序的存储介质。The present disclosure relates to the technical field of software maintenance, and in particular, relates to a method for repairing a software development kit, a terminal, a server and a device, and a storage medium storing readable computer programs.
背景技术Background technique
目前,市面上针对APP级别的热修复方案趋近成熟,然而对软件开发工具包(Software Development Kit,SDK)级别的热修复方案比较少,尤其是针对中台类工具而言,例如游戏中台,需要根据不同的游戏接入需求来提供不同功能,因此需要提供相互独立的、但是有依赖关系的多个SDK,在进行了SDK组件化之后,这些SDK大多有各自独立的工具版本,可以被接入方按照一定的规则重新组合接入。At present, the APP-level hot-fix solutions on the market are approaching maturity, but there are relatively few hot-fix solutions at the Software Development Kit (SDK) level, especially for middle-end tools, such as game middle-end , it is necessary to provide different functions according to different game access requirements, so it is necessary to provide multiple SDKs that are independent of each other but have dependencies. After the SDK is componentized, most of these SDKs have their own independent tool versions, which can be used The access party reassembles the access according to certain rules.
现在对于中台类工具的热修复,大多是对各SDK单独进行修复,或者将不同SDK进行组合当成整体以进行修复,而随着SDK数量的增多,组合数量呈指数级增长,导致热修复工作量大,资源消耗严重,难以估计各SDK相互之间的依赖性和关联性。At present, most of the hot repairs of middle-end tools are to repair each SDK separately, or combine different SDKs as a whole for repair, and as the number of SDKs increases, the number of combinations increases exponentially, resulting in hot repair work The volume is large, the resource consumption is serious, and it is difficult to estimate the dependencies and correlations between SDKs.
发明内容Contents of the invention
本公开实施例至少提供一种软件开发工具包修复方法、终端、服务器、设备以及存储介质。Embodiments of the present disclosure at least provide a method for repairing a software development kit, a terminal, a server, a device, and a storage medium.
本公开实施例提供了一种软件开发工具包修复方法,应用于终端,所述终端中包括有多个软件开发工具包SDK,所述多个SDK中的至少部分所述SDK的版本号不同,所述方法包括:An embodiment of the present disclosure provides a method for repairing a software development kit, which is applied to a terminal. The terminal includes a plurality of software development kit SDKs, and at least some of the SDKs in the plurality of SDKs have different version numbers. The methods include:
获取服务器针对所述多个SDK中每一个SDK生成的修复补丁;Obtain a repair patch generated by the server for each SDK in the plurality of SDKs;
基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁;Based on the local patch of each SDK in the terminal and the plurality of repair patches, determine the latest patch for each SDK;
将所述针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;Decrypt and decompress the latest patch for each SDK to obtain the executable file corresponding to each latest patch;
将多个可执行文件融合,得到针对所述多个SDK的融合补丁包;Merging multiple executable files to obtain a fusion patch package for the multiple SDKs;
使用所述融合补丁包对所述多个SDK进行修复。Repair the multiple SDKs by using the fusion patch package.
一种可选的实施方式中,所述基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁,包括:In an optional implementation manner, the determination of the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches includes:
针对每个修复补丁,基于该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定与该修复补丁对应的、所述终端中存储的本地补丁;For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch stored in the terminal corresponding to the repair patch;
检测该修复补丁和对应的本地补丁是否一致;Detect whether the repair patch is consistent with the corresponding local patch;
若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁;If the repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
若该修复补丁和对应的本地补丁一致,确定与该修复补丁对应的本地补丁为对应的 SDK的最新补丁。If the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
一种可选的实施方式中,在所述若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁之后,所述方法包括:In an optional implementation manner, after determining that the repair patch is the latest patch of the corresponding SDK if the repair patch is inconsistent with the corresponding local patch, the method includes:
将与该修复补丁对应的本地补丁删除。Delete the local patch corresponding to the repair patch.
一种可选的实施方式中,通过以下步骤检测该修复补丁和对应的本地补丁是否一致:In an optional implementation manner, the following steps are used to detect whether the repair patch is consistent with the corresponding local patch:
分别计算该修复补丁的摘要算法值和对应的本地补丁的摘要算法值;Calculate the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch respectively;
若该修复补丁的摘要算法值和对应的本地补丁的摘要算法值一致,确定该修复补丁和对应的本地补丁一致。If the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
一种可选的实施方式中,所述将确定出的多个可执行文件融合,得到针对所述多个SDK的融合补丁包,包括:In an optional implementation manner, the merging of the determined multiple executable files to obtain a fusion patch package for the multiple SDKs includes:
将多个可执行文件按照解压解密之后的文件排列顺序重新命名;Rename multiple executable files according to the order in which they are decompressed and decrypted;
根据重新命后的可执行文件进行融合,得到针对所述多个SDK的融合补丁包。Fusion is performed according to the renamed executable file to obtain fusion patch packages for the plurality of SDKs.
一种可选的实施方式中,在所述使用所述融合补丁包对所述多个SDK进行修复之前,所述方法包括:In an optional implementation manner, before using the fusion patch package to repair the multiple SDKs, the method includes:
确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息;Determine the historical patch information generated by loading the historical patch package during the previous repair before this repair;
清除所述历史补丁信息。Clear the historical patch information.
一种可选的实施方式中,使用所述融合补丁包对所述多个SDK进行修复,包括:In an optional implementation manner, using the fusion patch package to repair the multiple SDKs includes:
加载所述融合补丁包,并记录加载所述融合补丁包时产生有效补丁信息。The fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
一种可选的实施方式中,所述多个SDK包括主SDK和根据所述终端需要实现的功能接入的功能SDK,接入的所述功能SDK依赖于所述主SDK存在。In an optional implementation manner, the multiple SDKs include a main SDK and a function SDK that is accessed according to a function that the terminal needs to implement, and the accessed function SDK depends on the existence of the main SDK.
本公开实施例提供了一种软件开发工具包修复方法,应用于服务器,所述方法包括:An embodiment of the present disclosure provides a method for repairing a software development kit, which is applied to a server, and the method includes:
针对多个SDK中每个SDK生成对应的修复补丁,其中,所述多个SDK中至少部分所述SDK的版本号不同;Generate a corresponding repair patch for each SDK in the plurality of SDKs, wherein the version numbers of at least some of the SDKs in the plurality of SDKs are different;
根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息;According to the identification information of each SDK and the corresponding repair method, determine the management information of each repair patch;
在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至所述终端。After receiving the patch request from the terminal, the generated repair patches and the management information corresponding to each repair patch are sent to the terminal.
本公开实施例还提供一种终端,所述终端中包括有多个软件开发工具包SDK,至少部分所述SDK的版本号不同,所述终端包括:An embodiment of the present disclosure also provides a terminal, the terminal includes multiple software development kit SDKs, at least some of the SDKs have different version numbers, and the terminal includes:
获取模块,用于获取服务器针对所述多个SDK中每一个SDK生成的修复补丁;An acquisition module, configured to acquire a repair patch generated by the server for each SDK in the plurality of SDKs;
第一确定模块,用于基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁;The first determination module is used to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches;
第二确定模块,用于将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;The second determining module is used to decrypt and decompress the determined latest patch for each SDK, and obtain the executable file corresponding to each latest patch;
融合模块,用于将确定出的多个可执行文件融合,得到针对所述多个SDK的融合补丁包;A fusion module, configured to fuse the determined multiple executable files to obtain fusion patch packages for the multiple SDKs;
修复模块,用于使用所述融合补丁包对所述多个SDK进行修复。A repair module, configured to repair the plurality of SDKs by using the fusion patch package.
一种可选的实施方式中,所述第一确定模块具体用于:In an optional implementation manner, the first determination module is specifically configured to:
针对每个修复补丁,基于该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定与该修复补丁对应的、所述终端中存储的本地补丁;For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch stored in the terminal corresponding to the repair patch;
检测该修复补丁和对应的本地补丁是否一致;Detect whether the repair patch is consistent with the corresponding local patch;
若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁;If the repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
若该修复补丁和对应的本地补丁一致,确定与该修复补丁对应的本地补丁为对应的SDK的最新补丁。If the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
一种可选的实施方式中,所述第一确定模块还用于:In an optional implementation manner, the first determination module is also used for:
将与该修复补丁对应的本地补丁删除。Delete the local patch corresponding to the repair patch.
一种可选的实施方式中,所述第一确定模块用于通过以下步骤检测该修复补丁和对应的本地补丁是否一致:In an optional implementation manner, the first determination module is configured to detect whether the repair patch is consistent with the corresponding local patch through the following steps:
分别计算该修复补丁的摘要算法值和对应的本地补丁的摘要算法值;Calculate the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch respectively;
若该修复补丁的摘要算法值和对应的本地补丁的摘要算法值一致,确定该修复补丁和对应的本地补丁一致。If the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
一种可选的实施方式中,所述融合模块具体用于:In an optional implementation manner, the fusion module is specifically used for:
将确定出的多个可执行文件按照解压解密之后的文件排列顺序重新命名;Renaming the identified multiple executable files according to the order in which they are decompressed and decrypted;
按照重新命后的可执行文件融合成所述多个SDK的融合补丁包。Fusion patch packages of the plurality of SDKs are fused according to the renamed executable files.
一种可选的实施方式中,所述终端还包括清除模块,所述清除模块用于:In an optional implementation manner, the terminal further includes a clearing module, and the clearing module is used for:
确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息;Determine the historical patch information generated by loading the historical patch package during the previous repair before this repair;
清除所述历史补丁信息。Clear the historical patch information.
一种可选的实施方式中,所述修复模块具体用于:In an optional implementation manner, the repair module is specifically used for:
加载所述融合补丁包,并记录加载所述融合补丁包时产生有效补丁信息。The fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
本公开实施例还提供一种服务器,所述服务器包括:An embodiment of the present disclosure also provides a server, and the server includes:
生成模块,用于针对多个SDK中每个SDK生成对应的修复补丁,其中,所述多个SDK中至少部分所述SDK的版本号不同;A generation module, configured to generate a corresponding repair patch for each SDK in the plurality of SDKs, wherein the version numbers of at least some of the SDKs in the plurality of SDKs are different;
信息确定模块,用于根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息;The information determination module is used to determine the management information of each repair patch according to the identification information of each SDK and the corresponding repair method;
发送模块,用于在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至所述终端。The sending module is configured to, after receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
本公开实施例还提供一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行上述的软件开发工具包修复方法中的步骤。An embodiment of the present disclosure also provides an electronic device, including: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the The memories communicate with each other through the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned steps in the method for repairing the software development kit are executed.
本公开实施例还提供一种计算机存储介质,该计算机存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述的软件开发工具包修复方法中的步骤。An embodiment of the present disclosure further provides a computer storage medium, on which a computer program is stored, and when the computer program is run by a processor, the steps in the above method for repairing the software development kit are executed.
本公开实施例提供的软件开发工具包修复方法、终端、服务器、设备以及存储介质,服务器通过针对多个SDK中每个SDK生成对应的修复补丁,根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息,在接收到终端的补丁请求后,将生成 的多个修复补丁和每个修复补丁对应的管理类信息发送至终端,终端通过获取服务器针对多个软件开发工具包SDK中每一个SDK生成的修复补丁,基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁,将确定出的、针对每个SDK的最新补丁进行融合,得到针对所述多个SDK的融合补丁包,使用所述融合补丁包对所述多个SDK进行修复。In the software development kit repair method, terminal, server, device, and storage medium provided by the embodiments of the present disclosure, the server generates a corresponding repair patch for each SDK in multiple SDKs, and according to the identification information of each SDK and the corresponding repair method , determine the management information of each repair patch, after receiving the patch request from the terminal, send the generated multiple repair patches and the management information corresponding to each repair patch to the terminal, and the terminal obtains the server for multiple software development The repair patch generated by each SDK in the toolkit SDK, based on the local patch of each SDK in the terminal and the plurality of repair patches, determine the latest patch for each SDK, and determine the latest patch for each SDK. The latest patches of the SDKs are fused to obtain a fusion patch package for the multiple SDKs, and the multiple SDKs are repaired using the fusion patch package.
这样,可以在服务器侧针对各版本的SDK单独生成补丁,以保证SDK的独立性,并将SDK的标识作为独立信息带到生成的管理类信息中,有利于后续补丁合并操作的顺利进行,对于不同版本、并且有关联的多个SDK可以通过一次性下发即可下发全部SDK的补丁,在终端侧将独立的补丁进行融合之后再对各SDK进行修复,使得接入各SDK的不同应用都可以接收到相应的补丁,以对包括全部SDK的中台工具进行整体修复,不仅可以大大降低热修复工作量和资源消耗量,还可以有效顾及各SDK之间的独立性、关联性和依赖性,大大避免因为各SDK之间的关联性导致的修复失败,有利于提高热修复的成功率。In this way, patches can be generated separately for each version of the SDK on the server side to ensure the independence of the SDK, and the SDK logo can be brought into the generated management information as independent information, which is conducive to the smooth progress of subsequent patch merging operations. Multiple SDKs of different versions and related to each other can issue patches for all SDKs at one time, and then repair each SDK after merging the independent patches on the terminal side, so that different applications that access each SDK can receive the corresponding patches to repair the middle-end tools including all SDKs as a whole, which can not only greatly reduce the workload of hot repair and resource consumption, but also effectively take into account the independence, correlation and dependence between SDKs It greatly avoids repair failures caused by the correlation between SDKs, which is conducive to improving the success rate of hot repairs.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments will be described in detail below together with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to illustrate the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. The accompanying drawings here are incorporated into the specification and constitute a part of the specification. The drawings show the embodiments consistent with the present disclosure, and are used together with the description to explain the technical solution of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. For those skilled in the art, they can also make From these figures are obtained other related figures.
图1为本公开实施例的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure;
图2为本公开实施例提供的一种软件开发工具包修复方法的流程图;FIG. 2 is a flow chart of a method for repairing a software development kit provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种软件开发工具包修复方法的流程图;FIG. 3 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure;
图4为本公开实施例提供的另一种软件开发工具包修复方法的流程图;FIG. 4 is a flowchart of another method for repairing a software development kit provided by an embodiment of the present disclosure;
图5为本公开实施例提供的一种服务器的示意图;FIG. 5 is a schematic diagram of a server provided by an embodiment of the present disclosure;
图6为本公开实施例提供的一种终端的示意图之一;FIG. 6 is one of schematic diagrams of a terminal provided by an embodiment of the present disclosure;
图7为本公开实施例提供的一种终端的示意图之二;FIG. 7 is a second schematic diagram of a terminal provided by an embodiment of the present disclosure;
图8为本公开实施例所提供的一种电子设备的示意图。Fig. 8 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only It is a part of the embodiments of the present disclosure, but not all of them. The components of the disclosed embodiments generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations. Accordingly, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort shall fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters denote similar items in the following figures, therefore, once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article only describes an association relationship, which means that there can be three kinds of relationships, for example, A and/or B can mean: there is A alone, A and B exist at the same time, and B exists alone. situation. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of A, B, and C, which may mean including from A, Any one or more elements selected from the set formed by B and C.
经研究发现,目前,市面上针对APP级别的热修复方案趋近成熟,然而对软件开发工具包(Software Development Kit,SDK)级别的热修复方案比较少,尤其是针对中台类工具而言,例如游戏中台,需要根据不同的游戏接入需求来提供不同功能,因此需要提供相互独立的、但是有依赖关系的多个SDK,在进行了SDK组件化之后,这些SDK大多有各自独立的工具版本,可以被接入方按照一定的规则重新组合接入。After research, it is found that currently, the hot repair solutions for the APP level on the market are approaching maturity, but there are relatively few hot repair solutions for the software development kit (Software Development Kit, SDK) level, especially for middle-end tools. For example, the game platform needs to provide different functions according to different game access requirements, so it is necessary to provide multiple SDKs that are independent of each other but have dependencies. After the SDK is componentized, most of these SDKs have their own independent tools. Versions can be reassembled and accessed by the accessing party according to certain rules.
现在对于中台类工具的热修复,大多是对各SDK单独进行修复,或者将不同SDK进行组合当成整体以进行修复,而随着SDK数量的增多,组合数量呈指数级增长,导致热修复工作量大,资源消耗严重,难以估计各SDK相互之间的依赖性和关联性。At present, most of the hot repairs of middle-end tools are to repair each SDK separately, or combine different SDKs as a whole for repair, and as the number of SDKs increases, the number of combinations increases exponentially, resulting in hot repair work The volume is large, the resource consumption is serious, and it is difficult to estimate the dependencies and correlations between SDKs.
基于上述研究,本公开提供了一种软件开发工具包修复方法,可以在服务器侧针对各版本的SDK单独生成补丁,以保证SDK的独立性,并将SDK的标识作为独立信息带到生成的管理类信息中,有利于后续补丁合并操作的顺利进行,对于不同版本、并且有关联的多个SDK可以通过一次性下发即可下发全部SDK的补丁,在终端侧将独立的补丁进行融合之后再对各SDK进行修复,使得接入各SDK的不同应用都可以接收到相应的补丁,以对包括全部SDK的中台工具进行整体修复,不仅可以大大降低热修复工作量和资源消耗量,还可以有效顾及各SDK之间的独立性、关联性和依赖性,大大避免因为各SDK之间的关联性导致的修复失败,有利于提高热修复的成功率。Based on the above research, this disclosure provides a software development toolkit repair method, which can generate patches for each version of the SDK separately on the server side to ensure the independence of the SDK, and bring the SDK logo as independent information to the generated management In the class information, it is conducive to the smooth progress of subsequent patch merging operations. For multiple SDKs of different versions and associated multiple SDKs, all SDK patches can be issued at one time. After the independent patches are integrated on the terminal side Then repair each SDK, so that different applications connected to each SDK can receive corresponding patches, so as to perform overall repairs on the middle platform tools including all SDKs, which can not only greatly reduce the workload and resource consumption of hot repairs, but also It can effectively take into account the independence, correlation and dependence between SDKs, greatly avoid repair failures caused by the correlation between SDKs, and help improve the success rate of hot repair.
为便于对本实施例进行理解,首先对本公开实施例所公开的一种工具包修复方法进行详细介绍,本公开实施例所提供的工具包修复方法的执行主体一般为具有一定计算能力的计算机设备,该计算机设备例如包括:终端设备或服务器或其它处理设备,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该工具包修复方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In order to facilitate the understanding of this embodiment, a toolkit repair method disclosed in the embodiments of the present disclosure is firstly introduced in detail. The execution subject of the toolkit repair method provided in the embodiments of the present disclosure is generally a computer device with certain computing capabilities. The computer equipment includes, for example: terminal equipment or server or other processing equipment, and the terminal equipment can be user equipment (User Equipment, UE), mobile equipment, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc. In some possible implementation manners, the method for repairing the toolkit may be implemented by the processor invoking computer-readable instructions stored in the memory.
请参阅图1,图1为本公开实施例的应用场景示意图。如图1中所示,当下随着互联网技术的发展下,各种终端已经走进了人们的生活,例如各种移动终端、可穿戴的智能终端、固定终端等,人们在使用各种终端时,大多需要安装、升级各种功能应用和工具应用等,开发者会在后台服务器侧开发用户需求的各种应用文件和对应用进行升级、修复的补丁文件,并将开发的应用文件和补丁文件等上传到用于管理应用的应用平台,例如各应用商店等,用户可以从应用平台中下载应用文件和补丁文件等,以安装应用,以及对应用进行修复等动作。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present disclosure. As shown in Figure 1, with the development of Internet technology, various terminals have entered people's lives, such as various mobile terminals, wearable smart terminals, fixed terminals, etc. When people use various terminals , most of them need to install and upgrade various functional applications and tool applications, etc. Developers will develop various application files required by users and patch files for upgrading and repairing applications on the background server side, and will develop application files and patch files and uploaded to an application platform for managing applications, such as various application stores, etc., users can download application files and patch files from the application platform to install the application and perform operations such as repairing the application.
请参阅图2,图2为本公开实施例提供的一种软件开发工具包修复方法的流程图。本公开实施例提供的软件开发工具包修复方法,可以应用于如图1中所示的服务器,如图2所示,该方法包括:Please refer to FIG. 2 . FIG. 2 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure. The method for repairing the software development kit provided by the embodiment of the present disclosure can be applied to the server shown in FIG. 1, and as shown in FIG. 2, the method includes:
S201:针对多个SDK中每个SDK生成对应的修复补丁,其中,至少部分SDK的版本号不同。S201: Generate a corresponding repair patch for each of the multiple SDKs, where at least some of the SDKs have different version numbers.
该步骤中,终端中可以安装有目标应用,目标应用包括多个软件开发工具包SDK,进一步的,多个SDK可以包括主SDK和根据终端需要实现的功能接入的功能SDK,多个SDK中至少部分SDK的版本号不同,在目标应用需要版本升级或者需要修复,尤其是多个SDK中的至少部分SDK需要修复或者升级时,可以针对每个SDK生成对应的修复补丁。In this step, the target application may be installed in the terminal, and the target application includes multiple software development kit SDKs. Further, the multiple SDKs may include the main SDK and a function SDK that is accessed according to the functions required by the terminal. Among the multiple SDKs, At least some of the SDKs have different version numbers. When the target application needs to be upgraded or repaired, especially when at least some of the multiple SDKs need to be repaired or upgraded, a corresponding repair patch can be generated for each SDK.
其中,针对每个SDK生成对应的修复补丁,即针对每个SDK单独生成一个修复补丁。Wherein, a corresponding repair patch is generated for each SDK, that is, a repair patch is separately generated for each SDK.
进一步的,在部分SDK无需修复时,其对应生成的修复补丁可以是上次进行修复时的补丁。Further, when some SDKs do not need to be repaired, the repair patches corresponding to them can be the patches from the last repair.
S202:根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息。S202: Determine the management class information of each repair patch according to the identification information of each SDK and the corresponding repair method.
该步骤中,在根据每个SDK的标识信息和对应的修复方法,例如SDK名称、SDK中的待修复方法(旧的存在问题的旧方法)以及对应的修复方法(新的可以对就旧方法进行修复的新方法),确定每个修复补丁的管理类信息。In this step, according to the identification information of each SDK and the corresponding repair method, such as the name of the SDK, the method to be repaired in the SDK (the old method with problems) and the corresponding repair method (the new one can replace the old method) new method for repairing), determine the management class information for each repair patch.
其中,每一个修复补丁的管理类信息可以是通过Java源码来记录的。Wherein, the management class information of each repair patch may be recorded through Java source code.
S203:在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至终端。S203: After receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
该步骤中,在接收到终端发送的用于下载补丁的补丁请求之后,响应于补丁请求,将生成的多个修复补丁和每个修复补丁对应的管理类信息打包发送至终端。In this step, after receiving the patch request sent by the terminal for downloading the patch, in response to the patch request, the generated repair patches and the management information corresponding to each repair patch are packaged and sent to the terminal.
其中,在服务器侧,对于每个SDK而言,在其发生变化后,每次均可以生成一个对应的修复补丁,随着时间的积累和版本的更迭等,每个SDK可能会有多个修复补丁,因此,为了便于管理,可以为每次生成的修复补丁按照生成时间配置不同的优先级,修复补丁的生成时间越接近当前的服务器时钟时间,则修复补丁的优先级越高,相应的,在下发补丁,即需要将补丁发送给终端或者上传至管理平台的时候,对比SDK的所有修复补丁的优先级,确定优先级最高的修复补丁为要发送给终端或者上传到管理平台的修复补丁。Among them, on the server side, for each SDK, after it changes, a corresponding repair patch can be generated each time. With the accumulation of time and version changes, each SDK may have multiple fixes. Patches, therefore, in order to facilitate management, different priorities can be configured for each repair patch generated according to the generation time. The closer the repair patch generation time is to the current server clock time, the higher the priority of the repair patch. Correspondingly, When issuing a patch, that is, when the patch needs to be sent to the terminal or uploaded to the management platform, compare the priorities of all the repair patches in the SDK, and determine that the repair patch with the highest priority is the repair patch to be sent to the terminal or uploaded to the management platform.
具体的,在接收到终端的补丁请求后,可以将确定出的优先级最高的修复补丁以及每个修复补丁对应的管理类信息发送至终端,即在当前SDK有多个修复补丁时,选择优先级最高的补丁发送给终端。Specifically, after receiving the patch request from the terminal, the determined repair patch with the highest priority and the management information corresponding to each repair patch can be sent to the terminal, that is, when there are multiple repair patches in the current SDK, the priority The highest level patch is sent to the terminal.
将修复补丁和修复补丁对应的管理类信息一同发送,可以保证补丁与补丁管理类的对应性,便于后续使用。Sending the repair patch and the management class information corresponding to the repair patch together can ensure the correspondence between the patch and the patch management class, which is convenient for subsequent use.
本公开实施例提供的软件开发工具包修复方法,通过针对多个SDK中每个SDK生成对应的修复补丁,根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息,在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至终端。The method for repairing the software development kit provided by the embodiment of the present disclosure generates a corresponding repair patch for each SDK in multiple SDKs, and determines the management information of each repair patch according to the identification information of each SDK and the corresponding repair method. , after receiving the patch request from the terminal, sending the generated repair patches and the management information corresponding to each repair patch to the terminal.
这样,在服务器侧可以针对各版本的SDK单独生成补丁,以保证SDK的独立性,并将SDK的标识作为独立信息带到生成的管理类信息中,有利于后续补丁合并操作的顺利进行,对于不同版本、并且有关联的多个SDK可以通过一次性下发即可下发全部SDK的补丁。In this way, on the server side, patches can be generated separately for each version of the SDK to ensure the independence of the SDK, and the SDK logo can be brought into the generated management information as independent information, which is conducive to the smooth progress of subsequent patch merging operations. Different versions and associated multiple SDKs can issue patches for all SDKs at one time.
请同时参阅图3,图3为本公开实施例提供的一种软件开发工具包修复方法的流程图。本公开实施例提供的软件开发工具包修复方法,应用于如图1中所示的终端,终端中包括有多个软件开发工具包SDK,至少部分SDK的版本号不同,如图3中所示,方法包括:Please refer to FIG. 3 at the same time. FIG. 3 is a flowchart of a method for repairing a software development kit provided by an embodiment of the present disclosure. The software development kit repair method provided by the embodiment of the present disclosure is applied to the terminal as shown in Figure 1. The terminal includes multiple software development kit SDKs, at least some of which have different version numbers, as shown in Figure 3 , methods include:
S301:获取服务器针对多个SDK中每一个SDK生成的修复补丁。S301: Obtain a repair patch generated by the server for each of the multiple SDKs.
其中,获取的多个修复补丁,如图1中所示,可以从应用平台中获取,但并不局限于此,在其他实时方式中,也可以是直接从服务器处获取。Wherein, the obtained repair patches, as shown in FIG. 1 , may be obtained from the application platform, but not limited thereto, and may also be directly obtained from the server in other real-time manners.
其中,多个SDK可以是组成中台类工具的多个SDK,其可以包括主SDK,和接入主SDK的、根据终端需要实现的功能接入的多个功能SDK,接入的功能SDK依赖于主SDK,此外,多个功能SDK之间也可以存在依赖关系。Among them, multiple SDKs can be multiple SDKs that make up middle-end tools, which can include the main SDK, and multiple functional SDKs that are connected to the main SDK and accessed according to the functions that the terminal needs to achieve. The accessed functional SDKs depend on In addition, there may also be dependencies between multiple functional SDKs.
其中,修复补丁的文件类型可以是jar文件。Wherein, the file type of the repair patch may be a jar file.
其中,获取的修复补丁,可以是将接收的服务器发送的打包文件,其中包括有各SDK的修复补丁。Wherein, the repair patch obtained may be a packaged file sent by the receiving server, which includes repair patches of each SDK.
S302:基于终端中的、每个SDK的本地补丁和多个修复补丁,确定针对每个SDK的最新补丁。S302: Determine the latest patch for each SDK based on the local patch and multiple repair patches of each SDK in the terminal.
该步骤中,在获取到多个修复补丁之后,可以通过将多个修复补丁与终端中的、每个SDK的本地补丁进行对比等方式,即将每个SDK对应的修复补丁和本地补丁进行比对,根据修复补丁与本地补丁的对比结果,确定出各SDK的最新补丁。In this step, after obtaining multiple repair patches, you can compare the repair patches corresponding to each SDK with the local patches by comparing the multiple repair patches with the local patches of each SDK in the terminal. , and determine the latest patch of each SDK according to the comparison result of the repair patch and the local patch.
其中,终端中的、每个SDK的本地补丁和多个修复补丁以及确定的最新补丁的文件类型都是jar文件。Wherein, the file types of the local patch and multiple repair patches of each SDK in the terminal, and the determined latest patch are all jar files.
其中,确定每个SDK的最新补丁,可以是在接收到服务器发送的文件后,例如接收到服务器发送的文件包之后,通过文件包中的管理类信息与本地补丁进行比对,以确定最新补丁。Among them, determining the latest patch of each SDK may be after receiving the file sent by the server, for example, after receiving the file package sent by the server, comparing the management information in the file package with the local patch to determine the latest patch .
相应的,在一些具体的实施方式中,对于确定针对每个SDK的最新补丁,可以通过以下步骤:Correspondingly, in some specific implementation manners, for determining the latest patch for each SDK, the following steps may be taken:
针对每个修复补丁,基于该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定与该修复补丁对应的、终端中存储的本地补丁;检测该修复补丁和对应的本地补丁是否一致;若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁;若该修复补丁和对应的本地补丁一致,确定与该修复补丁对应的本地补丁为对应的SDK的最新补丁。For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch corresponding to the repair patch and stored in the terminal; detect the repair patch and the corresponding local Whether the patch is consistent; if the repair patch is inconsistent with the corresponding local patch, determine that the repair patch is the latest patch of the corresponding SDK; if the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the corresponding The latest patch for the SDK.
这里,在需要确定各SDK的最新补丁时,可以从收到的文件中,提取出每个修复补丁的管理类信息,针对每个修复补丁,可以根据该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定出该修复补丁所属的SDK,进而可以确定出所属的SDK在终端中存储的本地补丁,然后可以对该修复补丁和本地补丁进行比对,以检测该修复补 丁和对应的本地补丁是否一致,若该修复补丁和对应的本地补丁不一致,则认为该修复补丁为对应的SDK的最新补丁,若该修复补丁和对应的本地补丁一致,则可以认为与该修复补丁对应的本地补丁已经是SDK的最新补丁。Here, when it is necessary to determine the latest patch of each SDK, the management information of each repair patch can be extracted from the received file, and for each repair patch, according to the records in the management information of the repair patch, The identification information of the SDK to which the repair patch belongs determines the SDK to which the repair patch belongs, and then determines the local patch stored in the terminal by the SDK to which the repair patch belongs, and then compares the repair patch with the local patch to detect the repair Whether the patch is consistent with the corresponding local patch. If the repair patch is inconsistent with the corresponding local patch, the repair patch is considered to be the latest patch of the corresponding SDK. If the repair patch is consistent with the corresponding local patch, it can be considered to be the same as the repair patch The local patch corresponding to the patch is already the latest patch of the SDK.
其中,为了保证补丁与补丁管理类的对应性,以及此处的便利性,在获取修复补丁时,即可一并获取修复补丁对应的管理类信息,即在接收的打包的文件中可以包括记载有管理类信息的文件。Among them, in order to ensure the correspondence between the patch and the patch management class, as well as the convenience here, when the repair patch is obtained, the management class information corresponding to the repair patch can be obtained together, that is, the received packaged file can include records A file with administrative information.
具体的,在对该修复补丁和对应的本地补丁进行比对时,可以通过以下步骤检测该修复补丁和对应的本地补丁是否一致:Specifically, when comparing the repair patch with the corresponding local patch, the following steps may be used to detect whether the repair patch is consistent with the corresponding local patch:
分别计算该修复补丁的摘要算法值和对应的本地补丁的摘要算法值;若该修复补丁的摘要算法值和对应的本地补丁的摘要算法值一致,确定该修复补丁和对应的本地补丁一致。Calculate the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch respectively; if the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, determine that the repair patch is consistent with the corresponding local patch.
该步骤中,在检测修复补丁和对应的本地补丁是否一致时,可以分别计算出该修复补丁的摘要算法值和对应的本地补丁的摘要算法值,然后通过对比该修复补丁的摘要算法值和对应的本地补丁的摘要算法值的大小,检测该修复补丁和对应的本地补丁是否一致,如果该修复补丁的摘要算法值和对应的本地补丁的摘要算法值大小相等,则可以确定该修复补丁和对应的本地补丁一致。In this step, when detecting whether the repair patch is consistent with the corresponding local patch, the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch can be calculated respectively, and then by comparing the digest algorithm value of the repair patch with the corresponding The size of the digest algorithm value of the local patch, and check whether the repair patch is consistent with the corresponding local patch. If the digest algorithm value of the repair patch is equal to the digest algorithm value of the corresponding local patch, the repair patch and the corresponding local patch can be determined. The local patches are the same.
其中,该修复补丁的摘要算法值和对应的本地补丁的摘要算法值可以是修复补丁的MD5值和对应的本地补丁的MD5值。Wherein, the digest algorithm value of the repair patch and the corresponding digest algorithm value of the local patch may be the MD5 value of the repair patch and the corresponding MD5 value of the local patch.
进一步的,在确定出该修复补丁与对应的本地补丁不一致的时候,可以认为本地补丁是旧版本的补丁,需要进行修复,为避免本地补丁对修复过程产生影响,以及减少终端的内存占用量等,在若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁之后,该方法包括:Further, when it is determined that the repair patch is inconsistent with the corresponding local patch, it can be considered that the local patch is an old version of the patch and needs to be repaired. In order to avoid the impact of the local patch on the repair process and reduce the memory usage of the terminal, etc. , after determining that the repair patch is the latest patch of the corresponding SDK if the repair patch is inconsistent with the corresponding local patch, the method includes:
将与该修复补丁对应的本地补丁删除。Delete the local patch corresponding to the repair patch.
这样,在修复补丁和对应的本地补丁不一致,确定修复补丁为对应的SDK的最新补丁的情况下,即可以将与修复补丁对应的本地补丁删除,以避免在使用补丁时造成的影响。In this way, when the repair patch is inconsistent with the corresponding local patch, and the repair patch is determined to be the latest patch of the corresponding SDK, the local patch corresponding to the repair patch can be deleted, so as to avoid the impact caused when the patch is used.
S303:将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件。S303: Decrypt and decompress the determined latest patch for each SDK to obtain an executable file corresponding to each latest patch.
该步骤中,在确定出每个SDK的最新补丁,即保留下的本地补丁和新下载的修复补丁,可以对最新补丁全部进行解密和解压处理,从而得到补丁所在的可执行文件。In this step, after determining the latest patch of each SDK, that is, the retained local patch and the newly downloaded repair patch, all the latest patches can be decrypted and decompressed, so as to obtain the executable file where the patch is located.
其中,可执行文件的类型为dex文件。Wherein, the type of the executable file is a dex file.
S304:将确定出的多个可执行文件进行融合,得到针对多个SDK的融合补丁包。S304: Merge the determined multiple executable files to obtain a fusion patch package for multiple SDKs.
该步骤中,在得到补丁所在的可执行文件之后,可以将多个可执行文件进行融合,得到融合补丁包,进一步的,可以将所有的可执行文件(修复文件和本地文件)删除,以防止解密后的补丁代码泄漏。In this step, after obtaining the executable file where the patch is located, multiple executable files can be fused to obtain a fusion patch package. Further, all executable files (repair files and local files) can be deleted to prevent The decrypted patch code leaked.
其中,多个SDK的融合补丁包的文件类型是jar文件。Among them, the file type of the fusion patch package of multiple SDKs is a jar file.
S305:使用融合补丁包对多个SDK进行修复。S305: Use the fusion patch package to repair multiple SDKs.
该步骤中,可以将得到的融合补丁包用类加载器进行加载,使融合补丁包生效,以完成对多个SDK的修复。In this step, the obtained integrated patch package can be loaded with a class loader to make the integrated patch package take effect, so as to complete the repair of multiple SDKs.
其中,得到针对多个SDK的融合补丁包之后,在加载融合补丁包时,可以根据终端的状态决定加载方式,例如可以检测终端的系统版本是否足够,以终端的系统为安卓系统为例,需要检测终端的安卓系统是否是5.0以下版本,若是的话,需要将多个SDK的融合补丁包中的每个独立的可执行文件都添加到类加载器的路径下,以保证合成后所有补丁都会被加载运行。Among them, after obtaining the fusion patch package for multiple SDKs, when loading the fusion patch package, the loading method can be determined according to the status of the terminal. Detect whether the Android system of the terminal is version 5.0 or lower. If so, you need to add each independent executable file in the fusion patch package of multiple SDKs to the path of the class loader to ensure that all patches will be merged after synthesis. Load and run.
本公开实施例提供的软件开发工具包修复方法,通过获取服务器针对多个SDK中每一个SDK生成的修复补丁;基于终端中的、每个SDK的本地补丁和多个修复补丁,确定针对每个SDK的最新补丁;将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;将确定出的多个可执行文件融合,得到针对多个SDK的融合补丁包;使用融合补丁包对多个SDK进行修复。The software development kit repair method provided by the embodiment of the present disclosure obtains the repair patch generated by the server for each SDK in multiple SDKs; based on the local patch and multiple repair patches of each SDK in the terminal, determine the The latest patch of the SDK; decrypt and decompress the determined latest patch for each SDK to obtain the executable file corresponding to each latest patch; merge the determined executable files to obtain the Fusion patch package; use the fusion patch package to fix multiple SDKs.
这样,在终端侧将独立的补丁进行融合之后再对各SDK进行修复,使得接入各SDK的不同应用都可以接收到相应的补丁,以对包括全部SDK的中台工具进行整体修复,不仅可以大大降低热修复工作量和资源消耗量,还可以有效顾及各SDK之间的独立性、关联性和依赖性,能够避免因为各SDK之间的关联性导致的修复失败,有利于提高热修复的成功率。In this way, each SDK is repaired after the independent patches are integrated on the terminal side, so that different applications connected to each SDK can receive the corresponding patches, so as to perform overall repairs on the middle platform tools including all SDKs, not only can It greatly reduces the workload and resource consumption of hot repair, and can effectively take into account the independence, correlation and dependence between SDKs, avoiding repair failures caused by the correlation between SDKs, and improving the efficiency of hot repair. Success rate.
请参阅图4,图4为本公开实施例提供的另一种软件开发工具包修复方法的流程图。本公开实施例提供的软件开发工具包修复方法,应用于如图1中所示的终端,终端中包括有多个软件开发工具包SDK,至少部分SDK的版本号不同,如图4中所示,方法包括:Please refer to FIG. 4 . FIG. 4 is a flow chart of another method for repairing a software development kit provided by an embodiment of the present disclosure. The software development kit repair method provided by the embodiment of the present disclosure is applied to the terminal as shown in Figure 1. The terminal includes multiple software development kit SDKs, at least some of which have different version numbers, as shown in Figure 4 , methods include:
S401:获取服务器针对多个SDK中每一个SDK生成的修复补丁。S401: Obtain a repair patch generated by the server for each of the multiple SDKs.
S402:基于终端中的、每个SDK的本地补丁和多个修复补丁,确定针对每个SDK的最新补丁。S402: Determine the latest patch for each SDK based on the local patch and multiple repair patches of each SDK in the terminal.
S403:将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件。S403: Decrypt and decompress the determined latest patch for each SDK to obtain an executable file corresponding to each latest patch.
S404:将确定出的多个可执行文件融合,得到针对多个SDK的融合补丁包。S404: Merge the determined multiple executable files to obtain a fusion patch package for multiple SDKs.
S405:确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息。S405: Determine the historical patch information generated by loading the historical patch package during the last repair before this repair.
该步骤中,在使用融合补丁包对多个SDK进行修复之前,需要确定出在本次修复之前的上一次修复所产生的产物,即上一次加载融合补丁包所产生的历史补丁信息。In this step, before using the fusion patch package to repair multiple SDKs, it is necessary to determine the product of the last repair before this repair, that is, the historical patch information generated by the last loading of the fusion patch package.
S406:清除历史补丁信息。S406: Clear historical patch information.
该步骤中,清除历史补丁信息,即清除上一次加载融合补丁包所生成的产物,以免影响本次融合补丁的加载修复。In this step, the historical patch information is cleared, that is, the product generated by loading the fusion patch package last time is cleared, so as not to affect the loading and repairing of the fusion patch this time.
其中,只有在终端中的、每个SDK的本地补丁和多个修复补丁之间存在至少部分对应补丁不一致的前提下,才会进行清除历史补丁的信息,即在终端的本地补丁有更新的前提下,才会清除历史补丁信息,若终端的本地补丁无更新,则无需清除历史补丁信息。Among them, only under the premise that there are at least some inconsistencies between the local patches of each SDK and multiple repair patches in the terminal, will the historical patch information be cleared, that is, the premise that the local patches of the terminal are updated The historical patch information will be cleared only if the terminal is disabled. If the local patch of the terminal is not updated, there is no need to clear the historical patch information.
S407:使用融合补丁包对多个SDK进行修复。S407: Use the fusion patch package to repair multiple SDKs.
其中,步骤S401至步骤S404和步骤S407的描述,可以参照步骤S301至步骤S305的描述,并且可以达到相同的技术效果和解决相同的技术问题,在此不做赘述。Wherein, the description of step S401 to step S404 and step S407 can refer to the description of step S301 to step S305, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
接下来,结合具体实施方式进一步对本实施例进行说明。Next, this embodiment will be further described in conjunction with specific implementation methods.
一种可选的实施方式中,步骤S404包括:In an optional implementation manner, step S404 includes:
将确定出的多个可执行文件按照解压解密之后的文件排列顺序重新命名;按照重新命后的可执行文件融合成多个SDK的融合补丁包。Rename the determined executable files according to the order of the decompressed and decrypted files; merge the renamed executable files into multiple SDK fusion patch packages.
该步骤中,在解密和解压得到每个最新补丁的可执行文件之后,可以识别每个可执行文件再解压和解密之后的排序顺序,然后可以按照每个可执行文件排序顺序对其重新命名,进而将重新命名的多个可执行文件融合成融合补丁包。In this step, after decrypting and decompressing the executable file of each latest patch, the sort order of each executable file after decompression and decryption can be identified, and then it can be renamed according to the sort order of each executable file, Then merge the renamed executable files into a fusion patch package.
一种可选的实施方式中,步骤S405包括:In an optional implementation manner, step S405 includes:
加载融合补丁包,并记录加载融合补丁包时产生有效补丁信息。Load the fusion patch package, and record the effective patch information generated when the fusion patch package is loaded.
进一步的,可以在记录加载融合补丁包时产生有效补丁信息之后,根据记录的有效补丁信息,判断出未生效的补丁,将未生效补丁的管理类信息,发送给服务器,请求重新下载修复补丁。Further, after recording and loading the fusion patch package to generate effective patch information, according to the recorded effective patch information, determine the patch that has not taken effect, and send the management information of the patch that has not taken effect to the server, requesting to re-download the repair patch.
本公开实施例提供的软件开发工具包修复方法,通过获取服务器针对多个SDK中每一个SDK生成的修复补丁;基于终端中的、每个SDK的本地补丁和多个修复补丁,确定针对每个SDK的最新补丁;将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;将确定出的多个可执行文件融合,得到针对多个SDK的融合补丁包;确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息;清除历史补丁信息;使用融合补丁包对多个SDK进行修复。The software development kit repair method provided by the embodiment of the present disclosure obtains the repair patch generated by the server for each SDK in multiple SDKs; based on the local patch and multiple repair patches of each SDK in the terminal, determine the The latest patch of the SDK; decrypt and decompress the determined latest patch for each SDK to obtain the executable file corresponding to each latest patch; merge the determined executable files to obtain the The fusion patch package; determine the historical patch information generated by loading the historical patch package during the last repair before this repair; clear the historical patch information; use the fusion patch package to repair multiple SDKs.
这样,在终端侧将独立的补丁进行融合之后再对各SDK进行修复,使得接入各SDK的不同应用都可以接收到相应的补丁,以对包括全部SDK的中台工具进行整体修复,不仅可以大大降低热修复工作量和资源消耗量,还可以有效顾及各SDK之间的独立性、关联性和依赖性,大大避免因为各SDK之间的关联性导致的修复失败,有利于提高热修复的成功率,在进行修复之前,删除了以前修复生成的产物,减少了以前修复生成的产物对本次修复的影响,进一步提高热修复的效率与成功率。In this way, each SDK is repaired after the independent patches are integrated on the terminal side, so that different applications connected to each SDK can receive the corresponding patches, so as to perform overall repairs on the middle platform tools including all SDKs, not only can It greatly reduces the workload and resource consumption of hot repair, and can effectively take into account the independence, correlation and dependence between SDKs, greatly avoiding repair failures caused by the correlation between SDKs, and is conducive to improving the efficiency of hot repair. Success rate, before repairing, delete the products generated by previous repairs, reduce the impact of products generated by previous repairs on this repair, and further improve the efficiency and success rate of hot repairs.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of specific implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
基于同一发明构思,本公开实施例中还提供了分别与软件开发工具包修复方法对应的服务器和终端,由于本公开实施例中的服务器和终端解决问题的原理与本公开实施例上述工具包修复方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same inventive concept, the embodiments of the present disclosure also provide servers and terminals corresponding to the software development toolkit repair methods respectively. Since the problem solving principles of the server and the terminal in the embodiments of the present disclosure are the same as those of the above-mentioned toolkit repair methods in the embodiments of the present disclosure The method is similar, so the implementation of the device can refer to the implementation of the method, and the repetition will not be repeated.
请参阅图5,图5为本公开实施例提供的一种服务器的示意图。本公开实施例提供的服务器500,包括:Please refer to FIG. 5 , which is a schematic diagram of a server provided by an embodiment of the present disclosure. The server 500 provided in the embodiment of the present disclosure includes:
生成模块500,用于针对多个SDK中每个SDK生成对应的修复补丁,其中,至少部分所述SDK的版本号不同;A generating module 500, configured to generate a corresponding repair patch for each of the multiple SDKs, wherein at least some of the SDKs have different version numbers;
信息确定模块510,用于根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息;An information determination module 510, configured to determine the management class information of each repair patch according to the identification information of each SDK and the corresponding repair method;
发送模块530,用于在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至所述终端。The sending module 530 is configured to, after receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中的相关说明,这里不再详述。For the description of the processing flow of each module in the device and the interaction flow between the modules, reference may be made to the relevant description in the above method embodiment, and details will not be described here.
本公开实施例提供的服务器,可以针对各版本的SDK单独生成补丁,以保证SDK的独立性,并将SDK的标识作为独立信息带到生成的管理类信息中,有利于后续补丁合并操作的顺利进行,对于不同版本、并且有关联的多个SDK可以通过一次性下发即可下发全部SDK的补丁。The server provided by the embodiment of the present disclosure can separately generate patches for each version of the SDK to ensure the independence of the SDK, and bring the identification of the SDK as independent information to the generated management information, which is conducive to the smooth operation of subsequent patch merging For different versions and associated multiple SDKs, patches for all SDKs can be delivered at one time.
请参阅图6至图7,图6为本公开实施例提供的一种终端的示意图之一,图7为本公开实施例提供的一种终端的示意图之二。所述终端中包括有多个软件开发工具包SDK,至少部分所述SDK的版本号不同,如图6中所示,本公开实施例提供的终端600,包括:Referring to FIG. 6 to FIG. 7 , FIG. 6 is one of schematic diagrams of a terminal provided by an embodiment of the present disclosure, and FIG. 7 is a second schematic diagram of a terminal provided by an embodiment of the present disclosure. The terminal includes a plurality of software development kit SDKs, at least some of which have different version numbers. As shown in FIG. 6, the terminal 600 provided by the embodiment of the present disclosure includes:
获取模块610,用于基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁。The obtaining module 610 is configured to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches.
第一确定模块620,用于基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁。The first determining module 620 is configured to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches.
第二确定模块630,用于将确定出的、针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件.The second determination module 630 is configured to decrypt and decompress the determined latest patch for each SDK, and obtain the executable file corresponding to each latest patch.
融合模块640,用于将确定出的多个可执行文件融合,得到针对所述多个SDK的融合补丁包;A fusion module 640, configured to fuse the determined multiple executable files to obtain fusion patch packages for the multiple SDKs;
修复模块650,用于使用所述融合补丁包对所述多个SDK进行修复。The repair module 650 is configured to use the fusion patch package to repair the multiple SDKs.
一种可选的实施方式中,所述第一确定模块620具体用于:In an optional implementation manner, the first determining module 620 is specifically configured to:
针对每个修复补丁,基于该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定与该修复补丁对应的、所述终端中存储的本地补丁;For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch stored in the terminal corresponding to the repair patch;
检测该修复补丁和对应的本地补丁是否一致;Detect whether the repair patch is consistent with the corresponding local patch;
若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁;If the repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
若该修复补丁和对应的本地补丁一致,确定与该修复补丁对应的本地补丁为对应的SDK的最新补丁。If the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
一种可选的实施方式中,所述第一确定模块620还用于:In an optional implementation manner, the first determining module 620 is also configured to:
将与该修复补丁对应的本地补丁删除。Delete the local patch corresponding to the repair patch.
一种可选的实施方式中,所述第一确定模块620用于通过以下步骤检测该修复补丁和对应的本地补丁是否一致:In an optional implementation manner, the first determination module 620 is configured to detect whether the repair patch is consistent with the corresponding local patch through the following steps:
分别计算该修复补丁的摘要算法值和对应的本地补丁的摘要算法值;Calculate the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch respectively;
若该修复补丁的摘要算法值和对应的本地补丁的摘要算法值一致,确定该修复补丁和对应的本地补丁一致。If the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
一种可选的实施方式中,所述融合模块640具体用于:In an optional implementation manner, the fusion module 640 is specifically used for:
将确定出的多个可执行文件按照解压解密之后的文件排列顺序重新命名;Renaming the identified multiple executable files according to the order in which they are decompressed and decrypted;
按照重新命后的可执行文件融合成所述多个SDK的融合补丁包。Fusion patch packages of the plurality of SDKs are fused according to the renamed executable files.
一种可选的实施方式中,所述终端还包括清除模块660,所述清除模块660用于:In an optional implementation manner, the terminal further includes a clearing module 660, and the clearing module 660 is configured to:
确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息;Determine the historical patch information generated by loading the historical patch package during the previous repair before this repair;
清除所述历史补丁信息。Clear the historical patch information.
一种可选的实施方式中,所述修复模块650具体用于:In an optional implementation manner, the repair module 650 is specifically used for:
加载所述融合补丁包,并记录加载所述融合补丁包时产生有效补丁信息。The fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
本公开实施例提供的终端,可以将接收到的独立的补丁进行融合之后再对各SDK进行修复,使得接入各SDK的不同应用都可以接收到相应的补丁,以对包括全部SDK的中台工具进行整体修复,不仅可以大大降低热修复工作量和资源消耗量,还可以有效顾及各SDK之间的独立性、关联性和依赖性,大大避免因为各SDK之间的关联性导致的修复失败,有利于提高热修复的成功率。The terminal provided by the embodiment of the present disclosure can repair each SDK after merging the received independent patches, so that different applications connected to each SDK can receive corresponding patches, so that the middle platform including all SDKs The overall repair of the tool can not only greatly reduce the workload and resource consumption of hot repair, but also effectively take into account the independence, correlation and dependence between SDKs, and greatly avoid repair failures caused by the correlation between SDKs , which is conducive to improving the success rate of thermal repair.
基于同一技术构思,本公开实施例还提供了一种电子设备。本公开实施例还提供了一种电子设备800,如图8所示,为本公开实施例提供的电子设备800结构示意图,包括:Based on the same technical idea, an embodiment of the present disclosure also provides an electronic device. The embodiment of the present disclosure also provides an electronic device 800, as shown in FIG. 8, which is a schematic structural diagram of the electronic device 800 provided by the embodiment of the present disclosure, including:
处理器810、存储器820、和总线830;存储器820用于存储执行指令,包括内存821和外部存储器822;这里的内存821也称内存储器,用于暂时存放处理器810中的运算数据,以及与硬盘等外部存储器822交换的数据,处理器810通过内存821与外部存储器822进行数据交换,当所述电子设备800运行时,所述处理器810与所述存储器820之间通过总线830通信,使得所述处理器810可以执行上述图2或者图3与图4所示的软件开发工具包修复方法的步骤。 Processor 810, memory 820, and bus 830; memory 820 is used to store and execute instructions, including memory 821 and external memory 822; memory 821 here is also called internal memory, and is used for temporarily storing operation data in processor 810, and The data exchanged by the external memory 822 such as a hard disk, the processor 810 exchanges data with the external memory 822 through the memory 821, and when the electronic device 800 is running, the processor 810 communicates with the memory 820 through the bus 830, so that The processor 810 may execute the steps of the software development kit repair method shown in FIG. 2 or FIG. 3 and FIG. 4 above.
本公开实施例还提供一种计算机存储介质,该计算机存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述图2或者图3与图4所示的软件开发工具包修复方法的步骤。其中,该存储介质可以是易失性或非易失的计算机取存储介质。An embodiment of the present disclosure also provides a computer storage medium, on which a computer program is stored, and when the computer program is run by a processor, the software development kit repair method shown in FIG. 2 or FIG. 3 and FIG. 4 is executed. step. Wherein, the storage medium may be a volatile or non-volatile computer and storage medium.
本公开实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的软件开发工具包修复方法的步骤,具体可参见上述方法实施例,在此不再赘述。An embodiment of the present disclosure also provides a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the steps of the method for repairing the software development kit described in the above method embodiment, specifically, Refer to the foregoing method embodiments, and details are not repeated here.
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的存储介质、装置和设备的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的存储介质、设备、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the storage medium, device and equipment described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed storage medium, device, device and method may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a non-volatile computer and storage medium executable by a processor. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
最后应说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案,而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that: the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than limit them, and the protection scope of the present disclosure is not limited thereto, although referring to the aforementioned The embodiments have described the present disclosure in detail, and those skilled in the art should understand that any person familiar with the technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure Changes can be easily imagined, or equivalent replacements can be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in this disclosure. within the scope of protection. Therefore, the protection scope of the present disclosure should be defined by the protection scope of the claims.

Claims (13)

  1. 一种软件开发工具包修复方法,其特征在于,应用于终端,所述终端中包括有多个软件开发工具包SDK,所述多个SDK中的至少部分SDK的版本号不同,所述方法包括:A method for repairing a software development kit, characterized in that it is applied to a terminal, and the terminal includes a plurality of software development kit SDKs, and at least part of the SDKs in the plurality of SDKs have different version numbers, and the method includes :
    获取服务器针对所述多个SDK中每一个SDK生成的修复补丁;Obtain a repair patch generated by the server for each SDK in the plurality of SDKs;
    基于所述终端中的、每个SDK的本地补丁和多个修复补丁,确定针对每个SDK的最新补丁;Determine the latest patch for each SDK based on the local patch and multiple repair patches of each SDK in the terminal;
    将所述针对每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;Decrypt and decompress the latest patch for each SDK to obtain the executable file corresponding to each latest patch;
    将多个可执行文件融合,得到针对所述多个SDK的融合补丁包;Merging multiple executable files to obtain a fusion patch package for the multiple SDKs;
    使用所述融合补丁包对所述多个SDK进行修复。Repair the multiple SDKs by using the fusion patch package.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁,包括:The method according to claim 1, wherein the determination of the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches includes:
    针对每个修复补丁,基于该修复补丁的管理类信息中记载的、该修复补丁所属SDK的标识信息,确定与该修复补丁对应的、所述终端中存储的本地补丁;For each repair patch, based on the identification information of the SDK to which the repair patch belongs recorded in the management information of the repair patch, determine the local patch stored in the terminal corresponding to the repair patch;
    检测该修复补丁和对应的本地补丁是否一致;Detect whether the repair patch is consistent with the corresponding local patch;
    若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁;If the repair patch is inconsistent with the corresponding local patch, make sure that the repair patch is the latest patch of the corresponding SDK;
    若该修复补丁和对应的本地补丁一致,确定与该修复补丁对应的本地补丁为对应的SDK的最新补丁。If the repair patch is consistent with the corresponding local patch, determine that the local patch corresponding to the repair patch is the latest patch of the corresponding SDK.
  3. 根据权利要求2所述的方法,其特征在于,在所述若该修复补丁和对应的本地补丁不一致,确定该修复补丁为对应的SDK的最新补丁之后,所述方法包括:The method according to claim 2, wherein if the repair patch is inconsistent with the corresponding local patch, after determining that the repair patch is the latest patch of the corresponding SDK, the method includes:
    将与该修复补丁对应的本地补丁删除。Delete the local patch corresponding to the repair patch.
  4. 根据权利要求2所述的方法,其特征在于,通过以下步骤检测该修复补丁和对应的本地补丁是否一致:The method according to claim 2, characterized in that, whether the repair patch is consistent with the corresponding local patch is detected by the following steps:
    分别计算该修复补丁的摘要算法值和对应的本地补丁的摘要算法值;Calculate the digest algorithm value of the repair patch and the digest algorithm value of the corresponding local patch respectively;
    若该修复补丁的摘要算法值和对应的本地补丁的摘要算法值一致,确定该修复补丁和对应的本地补丁一致。If the digest algorithm value of the repair patch is consistent with the digest algorithm value of the corresponding local patch, it is determined that the repair patch is consistent with the corresponding local patch.
  5. 根据权利要求1所述的方法,其特征在于,所述将多个可执行文件融合,得到针对所述多个SDK的融合补丁包,包括:The method according to claim 1, wherein said merging a plurality of executable files to obtain a fusion patch package for said plurality of SDKs comprises:
    将多个可执行文件按照解压解密之后的文件排列顺序重新命名;Rename multiple executable files according to the order in which they are decompressed and decrypted;
    根据重新命名后的可执行文件进行融合,得到针对所述多个SDK的融合补丁包。Fusion is performed according to the renamed executable file to obtain fusion patch packages for the plurality of SDKs.
  6. 根据权利要求1所述的方法,其特征在于,在所述使用所述融合补丁包对所述多个SDK进行修复之前,所述方法包括:The method according to claim 1, wherein, before using the fusion patch package to repair the plurality of SDKs, the method comprises:
    确定在本次修复之前的上一次修复时,加载历史补丁包所产生的历史补丁信息;Determine the historical patch information generated by loading the historical patch package during the previous repair before this repair;
    清除所述历史补丁信息。Clear the historical patch information.
  7. 根据权利要求1所述的方法,其特征在于,使用所述融合补丁包对所述多个SDK进行修复,包括:The method according to claim 1, characterized in that, using the fusion patch package to repair the plurality of SDKs includes:
    加载所述融合补丁包,并记录加载所述融合补丁包时产生有效补丁信息。The fusion patch package is loaded, and effective patch information generated when the fusion patch package is loaded is recorded.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述多个SDK包括主SDK和根据所述终端需要实现的功能接入的功能SDK,接入的所述功能SDK依赖于所述主SDK存在。The method according to any one of claims 1-7, wherein the multiple SDKs include a main SDK and a function SDK that is accessed according to the functions that the terminal needs to implement, and the function SDKs that are accessed depend on exists in the main SDK.
  9. 一种软件开发工具包修复方法,其特征在于,应用于服务器,所述方法包括:A method for repairing a software development kit is characterized in that it is applied to a server, and the method includes:
    针对多个SDK中每个SDK生成对应的修复补丁,其中,所述多个SDK中至少部分所述SDK的版本号不同;Generate a corresponding repair patch for each SDK in the plurality of SDKs, wherein the version numbers of at least some of the SDKs in the plurality of SDKs are different;
    根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息;According to the identification information of each SDK and the corresponding repair method, determine the management information of each repair patch;
    在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至所述终端。After receiving the patch request from the terminal, the generated repair patches and the management information corresponding to each repair patch are sent to the terminal.
  10. 一种终端,其特征在于,所述终端中包括有多个SDK,所述多个SDK中至少部分所述SDK的版本号不同,所述终端包括:A terminal, characterized in that the terminal includes a plurality of SDKs, at least some of the SDKs have different version numbers, and the terminal includes:
    获取模块,用于获取服务器针对所述多个SDK中每一个SDK生成的修复补丁;An acquisition module, configured to acquire a repair patch generated by the server for each SDK in the plurality of SDKs;
    第一确定模块,用于基于所述终端中的、每个SDK的本地补丁和所述多个修复补丁,确定针对每个SDK的最新补丁;The first determination module is used to determine the latest patch for each SDK based on the local patch of each SDK in the terminal and the plurality of repair patches;
    第二确定模块,用于将所述每个SDK的最新补丁进行解密和解压操作,获得每个最新补丁对应的可执行文件;The second determining module is used for decrypting and decompressing the latest patches of each SDK to obtain the executable file corresponding to each latest patch;
    融合模块,用于将多个可执行文件融合,得到针对所述多个SDK的融合补丁包;A fusion module, configured to fuse multiple executable files to obtain fusion patch packages for the multiple SDKs;
    修复模块,用于使用所述融合补丁包对所述多个SDK进行修复。A repair module, configured to repair the plurality of SDKs by using the fusion patch package.
  11. 一种服务器,其特征在于,所述服务器包括:A server, characterized in that the server includes:
    生成模块,用于针对多个SDK中每个SDK生成对应的修复补丁,其中,所述多个SDK中至少部分所述SDK的版本号不同;A generation module, configured to generate a corresponding repair patch for each SDK in the plurality of SDKs, wherein the version numbers of at least some of the SDKs in the plurality of SDKs are different;
    信息确定模块,用于根据每个SDK的标识信息和对应的修复方法,确定每个修复补丁的管理类信息;The information determination module is used to determine the management information of each repair patch according to the identification information of each SDK and the corresponding repair method;
    发送模块,用于在接收到终端的补丁请求后,将生成的多个修复补丁和每个修复补丁对应的管理类信息发送至所述终端。The sending module is configured to, after receiving the patch request from the terminal, send the generated repair patches and the management information corresponding to each repair patch to the terminal.
  12. 一种电子设备,其特征在于,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至8中任一项所述的软件开发工具包修复方法,或者执行如权利要求9中所述的软件开发工具包修复方法的步骤。An electronic device, characterized in that it includes: a processor, a memory, and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the connection between the processor and the memory Communication through the bus, when the machine-readable instructions are executed by the processor, the software development kit repair method according to any one of claims 1 to 8 is executed, or the software described in claim 9 is executed Steps to develop a repair method for the kit.
  13. 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至9中任一项所述的软件开发工具 包修复方法。A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the software development kit according to any one of claims 1 to 9 is executed Repair method.
PCT/CN2022/115415 2021-10-20 2022-08-29 Software development kit fixing method, terminal, server and device WO2023065823A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111222884.1A CN113961226B (en) 2021-10-20 2021-10-20 Software development kit repairing method, terminal, server and equipment
CN202111222884.1 2021-10-20

Publications (1)

Publication Number Publication Date
WO2023065823A1 true WO2023065823A1 (en) 2023-04-27

Family

ID=79465056

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/115415 WO2023065823A1 (en) 2021-10-20 2022-08-29 Software development kit fixing method, terminal, server and device

Country Status (2)

Country Link
CN (1) CN113961226B (en)
WO (1) WO2023065823A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113961226B (en) * 2021-10-20 2023-11-07 抖音视界有限公司 Software development kit repairing method, terminal, server and equipment
CN115543404A (en) * 2022-08-26 2022-12-30 中国银联股份有限公司 SDK repairing method, device, terminal, equipment, system and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902562A (en) * 2012-09-17 2013-01-30 中兴通讯股份有限公司 Installation method and device of component type multimode patch pack
CN109857441A (en) * 2019-02-19 2019-06-07 深圳供电局有限公司 A kind of method that mobile terminal and its APP software package cloud update
CN112433747A (en) * 2020-12-16 2021-03-02 深圳乐播科技有限公司 Differential upgrading method and system suitable for Software Development Kit (SDK)
CN113961226A (en) * 2021-10-20 2022-01-21 北京字节跳动网络技术有限公司 Software development kit repairing method, terminal, server and equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648724B (en) * 2016-09-05 2020-05-01 Tcl集团股份有限公司 Application program hot repair method and terminal
CN107391107A (en) * 2017-06-12 2017-11-24 北京明朝万达科技股份有限公司 The restorative procedure and device of a kind of application program
US10606612B2 (en) * 2017-08-24 2020-03-31 Apptimize Llc Context check bypass to enable opening shared-object libraries
CN108241500B (en) * 2018-01-15 2022-02-01 腾讯科技(深圳)有限公司 Method, device and system for repairing hardware component and storage medium
CN111722857A (en) * 2019-03-20 2020-09-29 北京柏林互动科技有限公司 Updating method and device of software development kit, electronic equipment and storage medium
CN112416303B (en) * 2020-11-19 2023-06-27 抖音视界有限公司 Software development kit hot repair method and device and electronic equipment
CN112650521B (en) * 2020-12-28 2023-11-10 抖音视界有限公司 Software development kit SDK thermal restoration method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102902562A (en) * 2012-09-17 2013-01-30 中兴通讯股份有限公司 Installation method and device of component type multimode patch pack
CN109857441A (en) * 2019-02-19 2019-06-07 深圳供电局有限公司 A kind of method that mobile terminal and its APP software package cloud update
CN112433747A (en) * 2020-12-16 2021-03-02 深圳乐播科技有限公司 Differential upgrading method and system suitable for Software Development Kit (SDK)
CN113961226A (en) * 2021-10-20 2022-01-21 北京字节跳动网络技术有限公司 Software development kit repairing method, terminal, server and equipment

Also Published As

Publication number Publication date
CN113961226A (en) 2022-01-21
CN113961226B (en) 2023-11-07

Similar Documents

Publication Publication Date Title
WO2023065823A1 (en) Software development kit fixing method, terminal, server and device
US11388233B2 (en) Cloud-based data protection service
TWI716084B (en) Method for securely provisioning an asset to a target device and appliance device
WO2018137564A1 (en) Service processing method and apparatus
US9075693B2 (en) Methods for updating applications
US20170154185A1 (en) Method for Processing UEFI Protocols and System Therefor
US20130332916A1 (en) System and method for updating application archive files
KR100891325B1 (en) Key cache management method on TSS
WO2013078951A1 (en) Method and system for upgrading software
CN106648724B (en) Application program hot repair method and terminal
US20070118507A1 (en) Managing software configuration of a wireless device
CN108572986B (en) Data updating method and node equipment
CN107506221A (en) Application program updating method, apparatus and equipment
CN111008034B (en) Patch generation method and device
CN107797818A (en) Application program updating method and device
US9659171B2 (en) Systems and methods for detecting tampering of an information handling system
WO2019233022A1 (en) Rollback prevention method and system
CN112947981A (en) Application program resource updating method and device, terminal equipment and server
US10365910B2 (en) Systems and methods for uninstalling or upgrading software if package cache is removed or corrupted
US20230376600A1 (en) Method and system for upgrading firmware of vehicle infotainment system
US20230351050A1 (en) Method and apparatus for custom development of payment application, computer device, and storage medium
CN106294017A (en) A kind of information security back-up method
CN113791809B (en) Application exception handling method and device and computer readable storage medium
WO2019183806A1 (en) Resource permission processing method and apparatus, and storage medium and chip
CN111046389A (en) Method for securely updating firmware components and portable computer station for implementation

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882442

Country of ref document: EP

Kind code of ref document: A1