WO2024040916A1 - Sdk的修复方法、装置、终端、设备、系统及介质 - Google Patents

Sdk的修复方法、装置、终端、设备、系统及介质 Download PDF

Info

Publication number
WO2024040916A1
WO2024040916A1 PCT/CN2023/079809 CN2023079809W WO2024040916A1 WO 2024040916 A1 WO2024040916 A1 WO 2024040916A1 CN 2023079809 W CN2023079809 W CN 2023079809W WO 2024040916 A1 WO2024040916 A1 WO 2024040916A1
Authority
WO
WIPO (PCT)
Prior art keywords
sdk
repair
exception
target
information
Prior art date
Application number
PCT/CN2023/079809
Other languages
English (en)
French (fr)
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 WO2024040916A1 publication Critical patent/WO2024040916A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • This application belongs to the field of data processing, and in particular relates to an SDK repair method, device, terminal, equipment, system and medium.
  • SDK Software Development Kit
  • the SDK can be a toolkit that provides a certain function for a software framework, hardware platform, operating system or application.
  • the SDK can be embedded into hosts such as software frameworks, hardware platforms, operating systems or applications from different channels. When the SDK runs together with the host, exceptions may occur, and the SDK needs to be repaired so that the SDK can run normally.
  • Embodiments of the present application provide an SDK repair method, device, terminal, equipment, system and medium, which can meet the SDK repair needs of different channel parties.
  • embodiments of the present application provide an SDK repair method, which is applied to the repair platform.
  • the method includes: obtaining software development tool kit SDK information, host information, and SDK exception information of different exception types; according to the SDK information, host information and SDK for each exception type Exception information, obtain the exception impact parameters corresponding to each exception type of the target SDK.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information; based on the exception impact parameters and predictions corresponding to each exception type of the target SDK Set the exception hierarchical processing rules to obtain the target SDK repair strategy.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the abnormal impact parameters in the exception hierarchical processing rules; deliver the target SDK repair strategy to the user terminal so that the user terminal Execute the target SDK repair strategy to repair the target SDK.
  • embodiments of the present application provide an SDK repair method, which is applied to user terminals.
  • the method includes: providing software development tool kit SDK information, host information, and SDK exception information of different exception types to the repair platform, so that the repair platform The platform obtains the target SDK repair strategy based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification processing rules.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the exception impact parameters in the exception classification processing rules.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the exception impact parameters corresponding to each exception type of the target SDK are obtained based on the SDK information, host information and SDK exception information of each exception type; from the repair
  • the platform obtains the target SDK repair strategy and executes the target SDK repair strategy to repair the target SDK.
  • an SDK repair device which is applied to a repair platform.
  • the device includes: an acquisition module for acquiring software development tool kit SDK information, host information, and SDK exception information of different exception types; calculating Module, used to obtain the exception impact parameters corresponding to each exception type of the target SDK based on the SDK information, host information, and SDK exception information of each exception type, the host program indicated by the target SDK and host information, and the SDK version indicated by the SDK information.
  • the policy configuration module is used to obtain the target SDK repair strategy based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification processing rules.
  • the target SDK repair strategy includes the exception classification processing rules and exception impact parameters.
  • the corresponding abnormal level SDK repair strategy; the delivery module is used to deliver the target SDK repair strategy to the user terminal, so that the user terminal executes the target SDK repair strategy to repair the target SDK.
  • embodiments of the present application provide a user terminal, including: a sending module for providing software development tool kit SDK information, host information and different exception types to the repair platform.
  • SDK exception information so that the repair platform can obtain the target SDK repair strategy based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification processing rules.
  • the target SDK repair strategy includes the exception impact parameters corresponding to the exception classification processing rules.
  • Exception level SDK repair strategy the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the exception impact parameters corresponding to each exception type of the target SDK are based on the SDK information, host information and each exception type.
  • Obtain SDK exception information; the receiving module is used to obtain the target SDK repair strategy from the repair platform; the execution module is used to execute the target SDK repair strategy to repair the target SDK.
  • inventions of the present application provide an electronic device, which is used in a repair platform.
  • the electronic device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the repair method of the SDK of the first aspect is implemented. .
  • embodiments of the present application provide a user terminal, including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the repair method of the SDK of the second aspect is implemented.
  • embodiments of the present application provide an SDK repair system, including: a repair platform for executing the SDK repair method of the first aspect; and a user terminal for executing the SDK repair method of the second aspect.
  • embodiments of the present application provide a computer-readable storage medium.
  • Computer program instructions are stored on the computer-readable storage medium.
  • the repair method of the SDK of the first aspect or the second aspect is implemented. SDK fix method.
  • Embodiments of the present application provide an SDK repair method, device, terminal, equipment, system and medium.
  • the repair platform can obtain the SDK abnormality information representing the abnormal type based on the SDK information, host information and collected SDK exception information of different abnormal types. Based on the abnormal impact parameters corresponding to each exception type and the preset exception classification processing rules, the SDK repair strategy corresponding to the abnormal level is obtained and delivered to the user terminal.
  • the user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK.
  • Different host information corresponds to different host programs, different host programs correspond to different channel parties, and different versions of SDK also correspond to different SDK information. SDK exceptions generated by different versions of SDK embedded in the host programs of different channel parties The information is different.
  • the adapted SDK repair strategy can be automatically assigned to different versions of the SDK embedded in the host program of different channel parties, so that Meet the repair needs of SDKs from different channels.
  • Figure 1 is a schematic diagram of an example of an application scenario of the SDK repair method provided by the embodiment of the present application
  • Figure 2 is a schematic diagram of another example of an application scenario of the SDK repair method provided by the embodiment of the present application.
  • Figure 3 is a flow chart of the SDK repair method provided by an embodiment of the first aspect of the present application.
  • Figure 4 is a flow chart of the SDK repair method provided by another embodiment of the first aspect of the present application.
  • Figure 5 is a flow chart of the SDK repair method provided by yet another embodiment of the first aspect of the present application.
  • Figure 6 is a flow chart of the SDK repair method provided by an embodiment of the second aspect of the present application.
  • Figure 7 is a flow chart of the SDK repair method provided by another embodiment of the second aspect of the present application.
  • Figure 8 is a flow chart of the SDK repair method provided by yet another embodiment of the second aspect of the present application.
  • Figure 9 is a logical schematic diagram of an example of the SDK repair method provided by the embodiment of the present application.
  • Figure 10 is a schematic structural diagram of the repair device of the SDK provided by an embodiment of the third aspect of the present application.
  • Figure 11 is a schematic structural diagram of a user terminal provided by an embodiment of the fourth aspect of the present application.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the fifth aspect of the present application.
  • SDK Software Development Kit
  • the SDK can be a toolkit that provides a certain function for a software framework, hardware platform, operating system or application.
  • the SDK can be embedded into hosts such as software frameworks, hardware platforms, operating systems or applications from different channels. When the SDK runs together with the host, exceptions may occur, and the SDK needs to be repaired so that the SDK can run normally.
  • the development methods and host environments of each channel party also have certain differences, and the defects in the SDK may also be different. A single repair of the SDK is difficult to meet the repair needs of the SDKs of different channel parties.
  • the repair platform can obtain information that can characterize the impact of the exception type on the SDK based on the SDK information, host information and collected SDK exception information of different exception types. Based on the abnormality impact parameters corresponding to each exception type and the preset exception classification processing rules, the SDK repair strategy corresponding to the exception level is obtained and issued to the user terminal. The user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK. Different channel parties have different host information, and different versions of SDK have different SDK information. Different channel parties and different versions of SDK produce different SDK exception information. Through different information, you can get the information related to each channel party. , the abnormal level SDK repair strategy corresponding to each version of the SDK, that is, different channel parties and different versions of the SDK can receive adapted SDK repair strategies, which can meet the repair needs of the SDKs of different channel parties.
  • FIG. 1 is a schematic diagram of an example of an application scenario of the SDK repair method provided by the embodiment of the present application. As shown in Figure 1, the user terminal 11 can communicate and interact with the repair platform 12.
  • the user terminal 11 has at least one host program 111 and at least one SDK 112.
  • the same user terminal may have multiple different host programs 111, and different host programs 111 correspond to different channels.
  • the SDK 112 can be embedded in the host program 111, and the host program 111 can call the SDK 112 to use the functions provided by the SDK 112.
  • the user terminal 11 may specifically include a mobile phone, a tablet computer, an electronic computer, a smart wearable device, etc., which is not limited here.
  • the SDK 112 can serve as an information provider to provide the SDK 112 SDK information, SDK exception information, and host information of the host program 111 where the SDK 112 is located to the repair platform 12.
  • the user terminal 11 can obtain a targeted SDK repair strategy from the repair platform 12, and execute the SDK repair strategy to repair the SDK 112 that is the repair object.
  • the repair platform 12 may be a background system used to provide SDK repair services for user terminals, and may include more than one electronic device. Electronic devices may include servers, gateways, routers and other devices, and the type and quantity of electronic devices in the repair platform 12 are not limited here.
  • the repair platform 12 can provide SDK repair services for multiple user terminals 11 .
  • the host programs 111 in different user terminals may be the same or different.
  • the repair platform 12 can maintain the correspondence between different channel parties, host programs, users, SDKs, SDK exception information and SDK repair strategies, etc., can classify and summarize the exception types of SDK exceptions, and perform actions such as alarms and prompts.
  • the repair platform 12 can issue to different user terminals 11 targeted repair strategies for the SDKs 112 that need to be repaired in the user terminals 11.
  • the repair platform 12 can deliver targeted repair strategies to user terminals in a full, grayscale, and designated user manner, which is not limited here.
  • the SDK repair method provided by the embodiments of this application may also involve channel platforms.
  • FIG. 2 is a schematic diagram of another example of an application scenario of the SDK repair method provided by the embodiment of the present application. As shown in Figure 2, the channel platform 13 can communicate and interact with the repair platform 12.
  • the channel platform 13 may be an audit platform for SDK repair strategies, and may include more than one electronic device.
  • Electronic equipment may include servers, gateways, routers and other equipment, and the type and quantity of electronic equipment in the channel platform 13 is not limited here.
  • Each channel party can open an account on the channel platform 13, and review the SDK repair strategy provided by the SDK 112 embedded in the channel party's host program 11 through the channel platform 13.
  • the SDK repair strategy provided for the SDK 112 embedded in the host program 111 can first be sent to the channel platform 13 corresponding to the host program 111 for review. Only after the channel platform 13 passes the review of the SDK repair strategy, the repair platform 13 will The repair strategy is delivered to the user terminal 11.
  • the channel platform 13 may also provide SDK exception information to the repair platform 13 .
  • the first aspect of this application provides an SDK repair method that can be applied to a repair platform, that is, the SDK repair method can be executed by the repair platform.
  • FIG. 3 is a flow chart of the SDK repair method provided by an embodiment of the first aspect of the present application. As shown in Figure 3, the SDK repair method may include steps S201 to S204.
  • step S201 SDK information, host information, and SDK exception information of different exception types are obtained.
  • the SDK information includes basic information of the SDK.
  • the SDK information may include the SDK version, etc., which is not limited here.
  • SDK information may indicate the SDK version.
  • the host information includes information about the host program embedded in the SDK.
  • the host information may include the host program identifier, the channel party identifier to which the host program belongs, the host program environment information, etc., which is not limited here.
  • the host information can indicate the host program, and the host program has a corresponding relationship with the channel party.
  • the exception type is the exception type of the SDK, which can be set according to scenarios, needs, experience, etc.
  • exception types may include but are not limited to data exception types, file input and output exception types, business unreachable exception types, crash exception types, etc.
  • An SDK exception message includes information related to an exception that occurred in the SDK.
  • an SDK exception message may include SDK exception description information, the channel party identifier of the host program embedded in the SDK where the exception occurred, and whether there is channel party feedback for the exception that occurred in the SDK.
  • SDK online time users affected by SDK abnormality, terminal types affected by SDK abnormality, business success rate of abnormal SDK, business importance of abnormal SDK, etc. are not limited here.
  • the SDK exception information includes first SDK exception information and/or second SDK exception information.
  • the first SDK exception information is provided by the user terminal, and the second SDK is provided by the channel platform.
  • the first SDK exception information may be provided by the SDK in the user terminal where the SDK exception occurs.
  • the first SDK exception information can be obtained from the log of the SDK in the user terminal, and the second SDK exception information can be obtained from the log of the channel platform.
  • the first SDK exception information may also include buried point information, so that the location, time, and location of the SDK exception can be traced back during subsequent analysis. Reasons etc.
  • the second SDK abnormal information can be abnormal information entered by technical personnel provided by the channel platform, running time (i.e., runtime) information, etc.
  • step S202 the exception impact parameters corresponding to each exception type of the target SDK are obtained based on the SDK information, host information and SDK exception information of each exception type.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the target SDK can be determined based on the host information and SDK information.
  • the SDK exception information corresponding to the target SDK may also be different.
  • the SDK exceptions represented by different SDK exception information have different impact programs on the SDK.
  • the abnormality impact parameter can represent the degree of impact of SDK abnormality on the SDK.
  • the exception impact parameter corresponding to each exception type of the target SDK guarantees the degree of impact of the SDK exception of this exception type on the target SDK.
  • the exception impact parameters corresponding to different exception types of different target SDKs may be different.
  • the exception impact parameters corresponding to different exception types of different versions of SDK in different host programs may be different.
  • the exception impact parameters corresponding to the same exception type in different target SDKs may be different.
  • the exception impact parameters corresponding to the same exception type in different versions of SDK in different host programs may be different.
  • the same exception type corresponding to the same version of SDK in different host programs may have different corresponding exception impact parameters.
  • the exception impact parameters may be different, and the exception impact parameters corresponding to the same exception type in different versions of the SDK in the same host program may be different.
  • the abnormality impact parameter may be a parameter calculated using a standardized algorithm that can represent the degree of impact of the SDK abnormality on the SDK, that is, the abnormality impact parameter is standardized and comparable.
  • the abnormal impact parameters corresponding to different exception types of different target SDKs are comparable.
  • corresponding calculated values and weights can be set in advance for at least part of the SDK exception information to establish a unified standard, so that the abnormal impact parameters corresponding to different exception types under different target SDKs calculated using the weight algorithm are standardized and comparable. sex.
  • step S203 a target SDK repair strategy is obtained based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification processing rules.
  • Exception hierarchical processing rules may include the correspondence between exception types, exception impact parameters, exception levels, and SDK repair strategies.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the exception impact parameters in the exception hierarchical processing rules. That is, according to the exception impact parameters corresponding to each exception type of the target SDK, the exception level and SDK repair strategy corresponding to the exception type and exception impact parameters of the target SDK can be determined in the exception classification processing rules.
  • the SDK repair strategy can be used as the target SDK repair strategy.
  • the exception level can reflect the severity of the exception. Different exception levels correspond to different target SDK repair strategies. The higher the severity of the exception, the more remedial the SDK repair strategy required to fix the exception. In the same way, if the severity of the exception is low, the exception can be repaired by using an SDK repair strategy with a lower degree of repair. In other words, the higher the severity of the exception, the higher the degree of repair of the SDK repair strategy corresponding to the exception level.
  • SDK repair strategy A variety of SDK repair strategies can be recorded in the exception classification processing rules. Different SDK repair strategies have different degrees of repair. Different SDK repair strategies can repair SDK exceptions of different severity. You can use the exception classification processing rules to select the appropriate target SDK. SDK repair strategy. For example, suppose there are two SDKs, namely SDK1 and SDK2. Through the exception types and exception impact parameters of the two SDKs, it is determined that the exception level of SDK1 is level three, the exception level of SDK2 is level one, and the exception level is level three. If the severity is higher than the serious program with an exception level of level one, an SDK repair strategy with a higher degree of repair will be assigned to SDK1, and an SDK repair strategy with a lower degree of repair will be assigned to SDK2.
  • the target SDK repair strategy may include but is not limited to one or more of the following: first file, second file, and third file.
  • the first file includes a cache data clearing instruction, which is used to instruct to clear data in at least one cache folder corresponding to the target SDK.
  • the cache data clearing instruction can also be subdivided into different levels of sub-instructions according to the relative degree of repair.
  • the cache data clearing instruction includes a first sub-instruction and a second sub-instruction.
  • the first sub-instruction can be used to instruct the clearing of the corresponding data of the target SDK.
  • the second sub-instruction can be used to instruct the clearing of data in all cache folders corresponding to the target SDK; relative to the first sub-instruction, the second sub-instruction has a higher fix.
  • the cache data clearing instruction can be implemented through instruction statements, and the type of instruction statements is not limited here.
  • the second file includes exception source blocking instructions.
  • the exception source blocking instruction is used to instruct to set the switch state of at least one business function and/or sub-business function of the target SDK to a closed state.
  • the SDK can have multiple business functions, and each business function can also have at least one sub-business function.
  • the business functions and sub-business functions can have a tree structure.
  • the switching status of business functions and the switching status of sub-business functions can also be in a tree structure.
  • Each business function and sub-business function can be configured through the settings. Set the switch status to on to control the opening or closing of the business function and sub-business function.
  • the abnormal source blocking instructions can be divided into different abnormal source blocking instructions according to the relative degree of repair. For different exception types and exception impact parameters, different exception levels can be obtained. Corresponding to different exception levels, different exception source blocking instructions can be assigned. Different exception source blocking instructions indicate closed business functions and/or sub-business functions. different. For example, if the exception level is level two, the exception source blocking instruction in the second file indicates that the switch status of business function 1 and business function 2 in the target SDK is set to the off state; the exception level is level one, and in the second file The exception source blocking instruction instructs to set the switch state of business function 1 in the target SDK to the off state. In some examples, the content of the switch state setting of the business function by the exception source blocking instruction can be implemented as a string. For example, "111110" means setting the switch state of the sixth business function among the six business functions to the off state. Exception source blocking instructions can perform configuration actions when business functions and/or sub-business functions are initialized.
  • the third file includes a patch file, which is used to upgrade and repair the target SDK.
  • the patch file includes the difference file between the SDK files before the repair and the SDK files after the repair.
  • the patch file can be used to repair the areas where the SDK needs to be repaired.
  • the third file may be an apk file.
  • the target SDK repair strategy includes third files.
  • the repair platform can generate patch files. Specifically, the repair platform can obtain the pre-repair SDK archive file and the post-repair SDK archive file of the target SDK; obtain the first class file and the second class file.
  • the first class file includes the class file in the pre-repair SDK archive file.
  • the class file includes the class file in the repaired SDK archive file; the comparison algorithm is used to compare the first class file and the second class file to obtain the third class file.
  • the third class file includes the second class file and the first class file. There are differences in class files; convert the third class file into a patch file.
  • the SDK archive file before repair and the SDK archive file after repair can be an arr file or a jar file. If the SDK archive file before repair and the SDK archive file after repair are arr files, you can decompress the arr file and extract the jar file from it.
  • the jar file includes a class file and a manifest file. The jar file can be decompressed and the class file extracted from it, that is, the first class file and the second class file are obtained.
  • the third class file can be compressed into a jar file, and the third class file can be converted into a jar file through the Gradle transform application program interface (API). The file is converted into a dex file, and the dex file is the patch file.
  • API Gradle transform application program interface
  • the dex file is readable, that is, when the dex file is scanned, readable statements, classes, etc. can be obtained from it, which can facilitate the review by the auditors, and there will be no problems that cannot be restored to readable statements and cannot be restored. review status.
  • the third file can implement hot repair of the SDK.
  • the patch files in the third file can be different.
  • the above-mentioned first file, second file and third file can also be combined with each other.
  • the repair degree of the target SDK repair policy obtained by combining two or more files is higher than the repair degree of the target SDK repair policy corresponding to any one of the two or more files.
  • the repair degree of the target SDK repair strategy including the first file and the second file is higher than the repair degree of the target SDK repair strategy including only the first file.
  • step S204 the target SDK repair policy is delivered to the user terminal, so that the user terminal executes the target SDK repair policy to repair the target SDK.
  • the repair platform can deliver the target SDK repair strategy to the user terminal where the target SDK is located. This does not limit the number of user terminals where the target SDK is located.
  • the repair platform can deliver the target SDK repair strategy to all user terminals where the target SDK is located. It can also use grayscale distribution to deliver the target SDK in batches to the user terminals where the target SDK is located.
  • the terminal delivers the target SDK repair strategy, and can also deliver the target SDK repair strategy to the user terminal where the specified individual target SDK is located.
  • the target SDK repair strategy can be sent to the user terminal in a file or other form, and the form of the target SDK repair strategy is not limited here.
  • the user terminal After the user terminal obtains the target SDK repair strategy, it executes the target SDK repair strategy to repair the target SDK.
  • the user terminal may establish a repair process specifically designed to execute the target SDK repair policy, that is, the target SDK repair policy is executed by the repair process.
  • the repair process is independent of the target SDK process. Even if the target SDK process is interrupted, the repair process can record the repair progress and is not affected by the interruption of the target SDK process. When the target SDK process is started again, the repair progress can be recorded according to the repair progress. Continue to repair without restarting the repair, which improves the efficiency of SDK repair.
  • the repair platform can use SDK information, host information and collection
  • the SDK exception information of different exception types is obtained, and the exception impact parameters that represent the impact of the exception type on the SDK are obtained.
  • the SDK repair corresponding to the exception level is obtained.
  • the policy is issued to user terminals.
  • the user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK.
  • Different host information corresponds to different host programs, different host programs correspond to different channel parties, and different versions of SDK also correspond to different SDK information. SDK exceptions generated by different versions of SDK embedded in the host programs of different channel parties The information is different.
  • the exception-level SDK repair strategy corresponding to each version of the SDK embedded in the host program of each channel party can be obtained. That is, the SDK repair strategy for the different host programs embedded in different channel parties can be obtained.
  • the version of the SDK automatically assigns an adapted SDK repair strategy to meet the repair needs of the SDKs of different channels.
  • the exception impact parameter corresponding to each exception type may be determined based on the impact of each exception type on the SDK and the number of SDK exception occurrences of each exception type.
  • the target SDK repair strategy can also be determined based on the exception type with the largest exception impact parameter value, the exception impact parameters of this exception type, and the exception hierarchical processing rules.
  • Figure 4 is a flow chart of the SDK repair method provided by another embodiment of the first aspect of the present application. The difference between Figure 4 and Figure 3 is that step S202 in Figure 3 can be specifically refined into steps S2021 to step S2024 in Figure 4, and step S203 in Figure 3 can be specifically refined into steps S2031 and S2031 in Figure 4. Step S2032.
  • step S2021 the target SDK is determined based on the SDK information and the host information, and the feature information in the SDK exception information of each exception type of the target SDK is obtained, as well as the weight of the feature information.
  • the repair platform will obtain a large amount of SDK information, host information and SDK exception information.
  • SDK repair strategy adapted to the SDK is obtained based on the SDK exception information related to the SDK.
  • SDK information and host information the version of the SDK and the host program embedded in the SDK can be determined, and the target SDK is also determined.
  • SDK information, host information and SDK exception information are obtained in groups. That is, if an exception occurs in the SDK, SDK information, host information and SDK information can be provided correspondingly.
  • SDK exception information Determine the target SDK and summarize the SDK exception information for each exception type of the target SDK.
  • the SDK exception information may also include feature information, and the feature information may represent at least part of the characteristics of the SDK exception.
  • the characteristic information may include but is not limited to the channel party identifier of the host program embedded in the SDK where the exception occurs, whether there is feedback from the channel party for the exception that occurs in the SDK, the SDK online time, the users affected by the SDK exception, and the terminals affected by the SDK exception. Type, business success rate of the abnormal SDK, business importance of the abnormal SDK, etc.
  • the weight can be set for the feature information in advance, and the weights of different types of feature information can be different.
  • the setting of the weight can be set according to application scenarios, needs, experience, etc., and is not limited here.
  • the sum of the weights of various categories of feature information can be 1.
  • step S2022 the anomaly impact factor corresponding to each anomaly type of the target SDK is calculated based on the characteristic information and the weight of the characteristic information.
  • the value of the feature information may be the original value of the feature information.
  • the value of the feature information can also be the value obtained after processing the original value of the feature information, such as the value after normalization calculation, standardization calculation, or according to the preset classification rules, according to each category The category to which the original value of the feature information belongs, and the set value under this category is determined as the value of the feature information.
  • the characteristic information includes the channel party identifier of the host program embedded in the SDK where the exception occurred, whether the exception in the SDK has feedback from the channel party, the business success rate of the SDK where the exception occurred, and the business importance of the SDK where the exception occurred.
  • the channel party identifier of the host program embedded in the SDK where the exception occurs corresponding to a certain exception type of the target SDK is AA. Abnormalities in the SDK have feedback from the channel party.
  • the business success rate of the SDK where the exception occurs is 85%. Business importance is medium.
  • the preset classification rules can be shown in Tables 1 to 4 below. Table 1 represents the classification rules for the original value of the channel party identifier of the host program embedded in the SDK where an exception occurs.
  • Table 2 represents whether the abnormality that occurs in the SDK has the cause of the channel party's feedback.
  • Table 3 represents the classification rule of the business success rate of the abnormal SDK.
  • Table 4 represents the classification rule of the business importance of the abnormal SDK.
  • the exception impact factor corresponding to an exception type can represent the impact of the SDK exception of this exception type on the SDK. This impact reflects the impact of the exception type on the SDK in the dimension of feature information.
  • step S2023 based on the number of SDK exception information of each exception type of the target SDK and the total amount of SDK exception information, the output ratio corresponding to each exception type of the target SDK is calculated.
  • the output ratio corresponding to an exception type in the target SDK can represent the proportion of occurrence of this exception type among all exception types in the target SDK.
  • the corresponding output ratio of an exception type in the target SDK may be the ratio of the number of SDK exception information of this exception type in the target SDK to the weight of the number of SDK exception information of all exception types in the target SDK.
  • the target SDK has a total of n exception types of exception information, and the number of n exception types of exception information is b 1 to b n respectively. Then the output ratio corresponding to the i-th exception type can be obtained according to the following formula (2):
  • ⁇ i is the output ratio corresponding to the i-th anomaly type
  • b 1 is the number of abnormal information of the first anomaly type
  • b i is the number of abnormal information of the i-th anomaly type, 1 ⁇ i ⁇ n
  • b n is the number of exception information of the nth exception type.
  • step S2024 use the abnormality impact factor and output ratio corresponding to each exception type of the target SDK to calculate the abnormality impact parameters corresponding to each exception type of the target SDK.
  • the exception impact parameter can also reflect the impact of the exception type on the SDK in the dimension of the proportion of all exception types in the SDK.
  • the product of the exception impact factor corresponding to an exception type of the target SDK and the output ratio corresponding to the exception type can be used as the exception impact parameter corresponding to the exception type of the target SDK.
  • E(i) is the abnormal impact parameter corresponding to the i-th anomaly type
  • ⁇ i is the abnormal impact factor corresponding to the i-th anomaly type
  • ⁇ i is the output ratio corresponding to the i-th anomaly type.
  • step S2031 the target anomaly type is determined based on the anomaly impact parameter corresponding to each anomaly type.
  • the target anomaly type is the anomaly type corresponding to the anomaly impact parameter with the largest value. For example, assume that the target SDK corresponds to a total of four exception types of SDK exception information.
  • the values of the exception impact parameter corresponding to the first exception type to the exception impact parameter corresponding to the fourth exception type are f1, f2, f3 and f4, if f2 ⁇ f4 ⁇ f1 ⁇ f3, then the target exception type is the third exception type.
  • step S2032 the exception level corresponding to the target exception type and the exception impact parameters of the target exception type is determined according to the exception classification processing rules, and the target SDK repair strategy is determined based on the exception level.
  • the exception impact parameter corresponding to each exception type of the target SDK guarantees the degree of impact of the SDK exception of this exception type on the target SDK.
  • the exception type corresponding to the exception impact parameter with the largest value is the one that has the greatest impact on the target SDK among all exception types.
  • the target exception type and the exception impact parameters corresponding to the target exception type can reflect the impact on the target SDK. Which type of exception is mainly caused by the SDK exception, and the extent of the impact of this exception type on the target SDK. Different target exception types and exception impact parameters with different values may have different exception levels in the exception hierarchical processing rules, and the corresponding target SDK repair strategies may also be different.
  • the exception types include four exception types: data exception type, file input and output exception type, business unreachable exception type, and crash exception type.
  • the exception level may be a minor level, and the corresponding target SDK repair strategy may include the first file in the above embodiment; if the target exception type is a business unreachable exception type, The exception level may be a medium level, and the corresponding target SDK repair strategy may include the second file in the above embodiment; if the target exception type is a crash exception type, the exception level may be a severe level, and the corresponding target SDK repair strategy may include the above implementation The third file in the example.
  • a signature that reflects the host program that is, the channel party
  • the target SDK repair strategy may also include a first signature file
  • the repair platform may generate a first signature based on the host information, and generate a first signature file based on the first signature
  • the first signature file includes the first signature.
  • the signature algorithm used to generate the first signature is not limited here.
  • the SM3 signature algorithm can be used to generate the first signature based on the host information.
  • the user terminal After the user terminal obtains the target SDK repair policy, it can determine the target SDK targeted by the target SDK repair policy through verification of the first signature, thereby executing the target SDK repair policy to repair the target SDK.
  • the host program can be called to verify the first signature. If the signature verification is successful, it means that the host program has the target SDK, and the target SDK embedded in the host program can be repaired; if the signature verification fails, it means that the host program does not have the target SDK, which is incorrect. The SDK embedded in the host program is repaired.
  • FIG 5 is a flow chart of the SDK repair method provided by yet another embodiment of the first aspect of the present application. The difference between Figure 5 and Figure 3 is that the SDK shown in Figure 5
  • the repair method may also include step S205 and step S206. Step S204 in Figure 3 may be specifically refined into step S2041 in Figure 5.
  • step S205 the target SDK repair strategy is sent to the channel platform.
  • the channel platform receives the target SDK repair strategy, scans the target SDK repair strategy, and obtains the contents of the target SDK repair strategy, thereby reviewing the target SDK repair strategy.
  • the channel platform authorizes the target SDK repair strategy, generates a second signature based on the host information, and generates a second signature file based on the second signature.
  • the second signature file includes the second signature.
  • the channel platform adds the second signature file to the target SDK repair strategy and feeds back the target SDK repair strategy to the repair platform.
  • the channel platform can use its own signature algorithm to use the host information to sign the hash value of the target SDK repair strategy to obtain a second signature.
  • the channel platform will not authorize the target SDK repair strategy.
  • the channel platform can feedback a notification message to the repair platform to notify the repair platform that the review has not passed. If the channel platform scans the target SDK repair policy without authorization, the repair platform shall not issue the target SDK repair policy.
  • step S206 receive the target SDK repair strategy fed back by the channel platform.
  • the feedback target SDK repair strategy includes a second signature file.
  • the second signature file includes the second signature.
  • the second signature is generated by the channel platform based on the host information after scanning the target SDK repair policy and authorizing it.
  • step S2041 the target SDK repair strategy fed back by the channel platform is delivered to the user terminal.
  • the repair platform can interact with the channel platform, so that the channel platform can review the target SDK repair strategy. Only when the channel platform passes the review, the repair platform is allowed to issue the target SDK repair strategy to the user terminal, ensuring the target SDK repair strategy. security. Moreover, the channel platform can identify the channel party to which the host program of the target SDK belongs through the second signature. When the user terminal obtains the repair strategy of the target SDK, it can use the host information of the host program to verify the second signature and repair the target SDK. The policy only takes effect on the target SDK in the host program that has passed the signature verification to ensure that the target SDK repair policy takes effect in a targeted manner.
  • the second aspect of this application provides an SDK repair method, which can be applied to user terminals, namely The SDK's repair method can be executed by the user terminal.
  • FIG. 6 is a flow chart of the SDK repair method provided by an embodiment of the second aspect of the present application. As shown in Figure 6, the SDK repair method may include step S301 and step S302.
  • step S301 the software development tool kit SDK information, host information, and SDK exception information of different exception types are provided to the repair platform, so that the repair platform is based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification. Process the rules to get the target SDK repair strategy.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the exception impact parameters in the exception hierarchical processing rules.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the exception impact parameters corresponding to each exception type of the target SDK are obtained based on the SDK information, host information, and SDK exception information of each exception type.
  • step S302 obtain the target SDK repair strategy from the repair platform, and execute the target SDK repair strategy to repair the target SDK.
  • the target SDK when the target SDK is initialized, it can establish a repair process and send host information, SDK information, user information, etc. to the repair platform.
  • the repair platform can find the corresponding host information and SDK information based on the host information and SDK information.
  • Target SDK repair strategy and deliver the target SDK repair strategy.
  • the user terminal downloads the target SDK repair strategy from the repair platform, and executes the target SDK repair strategy through the repair process to repair the target SDK.
  • the target SDK repair strategy includes but is not limited to one or more of the following: first file, second file, and third file.
  • the first file includes a cache data clearing instruction, which is used to instruct to clear data in at least one cache folder corresponding to the target SDK.
  • the user terminal can clear the dirty data in the cache folder of the target SDK according to the cache data clearing instruction.
  • the second file includes an exception source blocking instruction, which is used to instruct to set the switch state of at least one service function and/or sub-service function of the target SDK to a closed state.
  • the user terminal may follow the abnormal source blocking instruction to set the switch status of the business function and/or sub-service function indicated by the abnormal source blocking instruction to a closed state.
  • the third file includes a patch file, which is used to upgrade and repair the target SDK.
  • the target SDK repair strategy includes a third file
  • the user terminal can extract the patch file in the third file and load the repaired class according to the class loading method to complete the repair of the target SDK.
  • the target SDK repair strategy includes a third file
  • the patch file is converted from the third class file
  • the third class file includes class files that are different from the second class file and the first class file
  • the first class file includes The class files in the pre-repair SDK archive of the target SDK
  • the second class file includes the class files in the post-repair SDK archive of the target SDK.
  • step S301 and step S302 please refer to the relevant descriptions in the above-mentioned embodiments, and will not be described again here.
  • the repair platform can obtain abnormality impact parameters that represent the impact of the abnormality type on the SDK based on the SDK information, host information and collected SDK exception information of different abnormality types, thereby based on the abnormality corresponding to each exception type. Impact parameters and preset exception classification processing rules are used to obtain the SDK repair strategy corresponding to the exception level and deliver it to the user terminal.
  • the user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK.
  • Different host information corresponds to different host programs, different host programs correspond to different channel parties, and different versions of SDK also correspond to different SDK information. SDK exceptions generated by different versions of SDK embedded in the host programs of different channel parties The information is different.
  • the exception-level SDK repair strategy corresponding to each version of the SDK embedded in the host program of each channel party can be obtained. That is, the SDK repair strategy for the different host programs embedded in different channel parties can be obtained.
  • the version of the SDK automatically assigns an adapted SDK repair strategy to meet the repair needs of the SDKs of different channels.
  • the anomaly impact parameter corresponding to each type of anomaly in the target SDK is calculated using the anomaly impact factor and output ratio corresponding to each anomaly type in the target SDK.
  • the output ratio corresponding to each exception type of the target SDK is calculated based on the number of SDK exception information for each exception type of the target SDK and the total amount of SDK exception information.
  • Target SDK per The exception impact factor corresponding to each exception type is calculated based on the feature information in the SDK exception information of each exception type of the target SDK, and the weight of the feature information.
  • the exception level corresponding to the target SDK repair strategy is obtained based on the exception hierarchical processing rules, the target exception type, and the exception impact parameters of the target exception type.
  • the target exception type is the exception type corresponding to the exception impact parameter with the largest value.
  • the target SDK repair strategy also includes a first signature file.
  • the first signature file includes a first signature.
  • the first signature is generated by the repair platform based on the host information.
  • the user terminal can call the host program indicated by the host information to verify the first signature. If the host program indicated by the host information successfully verifies the first signature, execute the target SDK Repair strategy repairs the target SDK.
  • the user terminal can agree with the repair platform in advance on the signature verification algorithm for verifying the first signature, which is not limited here.
  • the repair platform can use the agreed private key to generate the first signature, and the user terminal can use the agreed public key to verify the first signature.
  • the target SDK repair strategy can verify the integrity of the target SDK repair strategy and whether it has been tampered with, and on the other hand, it can also Verify the uniqueness of the target SDK repair strategy to the host program, that is, the channel party, thereby ensuring the content security of the target SDK repair strategy and the access security of the channel party.
  • the target SDK repair policy also includes a second signature file.
  • the second signature file includes a second signature.
  • the second signature is generated by the channel platform based on the host information after scanning the target SDK repair policy and determining authorization.
  • Figure 7 is a flow chart of the SDK repair method provided by another embodiment of the second aspect of the present application. The difference between Figure 7 and Figure 6 is that step S302 in Figure 6 can be specifically detailed into steps S3021 to step S3023 in Figure 7 .
  • step S3021 obtain the target SDK repair policy from the repair platform.
  • step S3022 the host program indicated by the host information is called to verify the second signature.
  • the user terminal can agree with the channel platform in advance on the signature verification algorithm for verifying the second signature.
  • the channel platform can use the agreed private key to generate a second signature, and the user terminal can use the agreed public key to verify the second signature.
  • it can verify the integrity of the target SDK repair strategy and whether it has been tampered with.
  • it can also It can verify the uniqueness of the target SDK repair strategy to the host program, that is, the channel party.
  • the third aspect can also verify the channel party's approval of the target SDK repair strategy, thereby ensuring the content security of the target SDK repair strategy and the channel party's access security. sex.
  • step S3023 if the host program indicated by the host information successfully verifies the second signature, execute the target SDK repair strategy to repair the target SDK.
  • the user terminal can establish a repair process, obtain the target SDK repair policy from the repair platform through the repair process, and execute the target SDK repair policy through the repair process to repair the target SDK.
  • the repair process is independent of the target SDK process, which can minimize the impact of the target SDK process on the SDK repair and improve the SDK repair efficiency.
  • Figure 8 is a flow chart of the SDK repair method provided by yet another embodiment of the second aspect of the present application. The difference between Figure 8 and Figure 6 is that step S302 in Figure 6 can be specifically detailed into steps S3024 to S3026 in Figure 8 .
  • step S3024 the process of the target SDK is monitored through the repair process.
  • step S3025 before the target SDK repair is completed, if it is monitored that the process of the target SDK is terminated and the target SDK repair policy has not been downloaded, the target SDK repair policy will continue to be downloaded through the repair process until the target SDK repair policy is downloaded and the repair is interrupted. process, when the process of monitoring the target SDK is started again, execute the target SDK repair strategy through the repair process to repair the target SDK.
  • the repair process may be terminated due to other reasons. You can use the breakpoint resume function provided by the operating system layer of the user terminal to ensure that the user terminal can obtain the complete target SDK repair. Strategy.
  • step S3026 before the repair of the target SDK is completed, if it is monitored that the process of the target SDK is terminated and the target SDK repair strategy has started to be executed, the target is recorded through the repair process. The repair progress of the SDK is monitored. When the process of the target SDK is started again, the repair process continues to repair the target SDK based on the repair progress.
  • FIG. 9 is a logical schematic diagram of an example of the SDK repair method provided by the embodiment of the present application.
  • the user terminal 41 has a host program 411 and an SDK 412.
  • the SDK 412 is embedded in the host program 411, and the user terminal 41 can establish a repair process 413.
  • the repair platform 42 has a log analysis function 421, a policy configuration function 422, and a file management function 423.
  • the channel platform 43 has a channel party log providing function 431, a policy content review function 432, and a policy signature function 433.
  • the repair platform 42 can obtain SDK logs from the SDK 412, and the logs can include host information, SDK information, and SDK exception information.
  • the repair platform 42 can also obtain the channel party's logs from the channel platform 43, and the channel party log providing function 431 of the channel platform 43 can provide the channel party's logs.
  • the log analysis function 421 in the repair platform 42 can extract host information, SDK information and SDK exception information from the logs.
  • the policy configuration function 422 can obtain the host information, SDK information and SDK exception information from the log analysis function 421, determine the exception level based on the host information, SDK information and SDK exception information, and determine the target SDK repair strategy corresponding to the exception level.
  • the file management function 423 manages various SDK repair strategies.
  • the policy configuration function 422 may obtain the target SDK repair policy from the file management function 423 .
  • the repair platform 42 sends the target SDK repair strategy to the channel platform 43 .
  • the channel platform 43 reviews the target SDK repair strategy through the policy content review function 432. If the review passes, the target SDK repair strategy is signed through the policy signature function 433, and the signed target SDK repair strategy is fed back to the repair platform 42. .
  • the SDK 412 may send host information and SDK information to the repair platform to trigger the repair platform 42 to provide the target SDK repair strategy to the user terminal 41 .
  • the SDK 412 can start the repair process 413, and the repair process 413 downloads the target SDK repair strategy from the repair platform 42.
  • the user terminal 41 verifies the signature in the target SDK repair policy through the repair process 413. After passing the signature verification, the target SDK repair policy is executed to repair the SDK 412.
  • FIG. 10 is a schematic structural diagram of an SDK repair device provided by an embodiment of the third aspect of the present application.
  • the repair device 500 of the SDK may include an acquisition module 501, a calculation module 502, a policy configuration module 503 and a delivery module 504.
  • the acquisition module 501 can be used to acquire SDK information, host information, and SDK exception information of different exception types.
  • the calculation module 502 may be used to obtain the exception impact parameters corresponding to each exception type of the target SDK based on the SDK information, host information and SDK exception information of each exception type.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the policy configuration module 503 can be used to obtain the target SDK repair strategy based on the abnormality impact parameters corresponding to each exception type of the target SDK and the preset exception hierarchical processing rules.
  • target SDK remediation strategies include one or more of the following:
  • the first file includes a cache data clearing instruction, and the cache data clearing instruction is used to instruct to clear the data in at least one cache folder corresponding to the target SDK;
  • the second file includes an exception source blocking instruction, the exception source blocking instruction is used to instruct to set the switch state of at least one business function and/or sub-business function of the target SDK to a closed state;
  • the third file includes a patch file, and the patch file is used to upgrade and repair the target SDK.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the exception impact parameters in the exception hierarchical processing rules.
  • the delivery module is used to deliver the target SDK repair strategy to the user terminal, so that the user terminal executes the target SDK repair strategy to repair the target SDK.
  • the target SDK repair strategy is executed by a repair process established by the user terminal, and the repair process is independent of the process of the target SDK.
  • the repair platform can use SDK information, host information and collection
  • the SDK exception information of different exception types is obtained, and the exception impact parameters that represent the impact of the exception type on the SDK are obtained.
  • the SDK repair corresponding to the exception level is obtained.
  • the policy is issued to user terminals.
  • the user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK.
  • Different host information corresponds to different host programs, different host programs correspond to different channel parties, and different versions of SDK also correspond to different SDK information. SDK exceptions generated by different versions of SDK embedded in the host programs of different channel parties The information is different.
  • the exception-level SDK repair strategy corresponding to each version of the SDK embedded in the host program of each channel party can be obtained. That is, the SDK repair strategy for the different host programs embedded in different channel parties can be obtained.
  • the version of the SDK automatically assigns an adapted SDK repair strategy to meet the repair needs of the SDKs of different channels.
  • the calculation module 502 may be used to: determine the target SDK according to the SDK information and host information, and obtain the feature information in the SDK exception information of each exception type of the target SDK, as well as the weight of the feature information; according to the feature information And the weight of the feature information, calculate the exception impact factor corresponding to each exception type of the target SDK; according to the number of SDK exception information for each exception type of the target SDK and the total number of SDK exception information, calculate each exception impact factor of the target SDK The output ratio corresponding to the exception type; use the exception impact factor and output ratio corresponding to each exception type of the target SDK to calculate the exception impact parameters corresponding to each exception type of the target SDK.
  • the policy configuration module 503 can be used to: determine the target anomaly type according to the anomaly impact parameter corresponding to each anomaly type, and the target anomaly type is the anomaly type corresponding to the anomaly impact parameter with the largest value; according to the anomaly hierarchical processing rules, Determine the exception level corresponding to the target exception type and the exception impact parameters of the target exception type, and determine the target SDK repair strategy based on the exception level.
  • the target SDK repair policy includes a third file.
  • the repair device 500 of the SDK may also include a patch generation module.
  • the patch generation module can be used to: obtain the pre-repair SDK archive file and the post-repair SDK archive file of the target SDK; obtain the first class file and the second class file.
  • the first class file includes the class file in the pre-repair SDK archive file.
  • class file includes the repaired The class file in the SDK archive file; use the comparison algorithm to compare the first class file and the second class file to obtain the third class file.
  • the third class file includes the class files that are different between the second class file and the first class file. ;Convert the third class file into a patch file.
  • the target SDK repair policy also includes a first signature file.
  • the repair device of the SDK may also include a first signature module.
  • the first signature module can be used to: generate a first signature according to the host information; generate a first signature file according to the first signature, and the first signature file includes the first signature.
  • the repair device of the SDK may also include a receiving module.
  • the above-mentioned delivery module 504 can also be used to: send the target SDK repair strategy to the channel platform.
  • the receiving module can be used to: receive the target SDK repair strategy fed back by the channel platform.
  • the feedback target SDK repair strategy includes a second signature file.
  • the second signature file includes a second signature.
  • the second signature is scanned by the channel platform and authorized by the target SDK repair strategy. In this case, it is generated based on the host information.
  • the above-mentioned delivery module 504 may be used to deliver the target SDK repair strategy fed back by the channel platform to the user terminal.
  • FIG. 11 is a schematic structural diagram of a user terminal provided by an embodiment of the fourth aspect of the present application.
  • the user terminal 600 may include a sending module 601 , a receiving module 602 and an execution module 603 .
  • the sending module 601 can be used to provide SDK information, host information and SDK exception information of different exception types to the repair platform, so that the repair platform obtains the target based on the exception impact parameters corresponding to each exception type of the target SDK and the preset exception classification processing rules. SDK fix strategy.
  • the target SDK repair strategy includes the SDK repair strategy for the exception level corresponding to the exception impact parameters in the exception hierarchical processing rules.
  • the target SDK corresponds to the host program indicated by the host information and the SDK version indicated by the SDK information.
  • the exception impact parameters corresponding to each exception type of the target SDK are obtained based on the SDK information, host information, and SDK exception information of each exception type.
  • the receiving module 602 may be used to obtain the target SDK repair policy from the repair platform.
  • target SDK remediation strategies include one or more of the following:
  • the first file includes a cache data clearing instruction, and the cache data clearing instruction is used to instruct to clear the data in at least one cache folder corresponding to the target SDK;
  • the second file includes an exception source blocking instruction, the exception source blocking instruction is used to instruct to set the switch state of at least one business function and/or sub-business function of the target SDK to a closed state;
  • the third file includes a patch file, and the patch file is used to upgrade and repair the target SDK.
  • the target SDK repair strategy includes a third file
  • the patch file is converted from the third class file
  • the third class file includes class files that are different from the second class file and the first class file
  • the first class file includes The class files in the pre-repair SDK archive of the target SDK
  • the second class file includes the class files in the post-repair SDK archive of the target SDK.
  • the execution module 603 may be used to execute the target SDK repair strategy to repair the target SDK.
  • the repair platform can obtain abnormality impact parameters that represent the impact of the abnormality type on the SDK based on the SDK information, host information and collected SDK exception information of different abnormality types, thereby based on the abnormality corresponding to each exception type. Impact parameters and preset exception classification processing rules are used to obtain the SDK repair strategy corresponding to the exception level and deliver it to the user terminal.
  • the user terminal can execute the SDK repair strategy corresponding to the abnormal level to repair the SDK.
  • Different host information corresponds to different host programs, different host programs correspond to different channel parties, and different versions of SDK also correspond to different SDK information. SDK exceptions generated by different versions of SDK embedded in the host programs of different channel parties The information is different.
  • the exception-level SDK repair strategy corresponding to each version of the SDK embedded in the host program of each channel party can be obtained. That is, the SDK repair strategy for the different host programs embedded in different channel parties can be obtained.
  • the version of the SDK automatically assigns an adapted SDK repair strategy to meet the repair needs of the SDKs of different channels.
  • the anomaly impact parameter corresponding to each type of anomaly in the target SDK is calculated using the anomaly impact factor and output ratio corresponding to each anomaly type in the target SDK.
  • the output ratio corresponding to each exception type of the target SDK is calculated based on the number of SDK exception information for each exception type of the target SDK and the total amount of SDK exception information.
  • the exception impact factor corresponding to each exception type of the target SDK is calculated based on the feature information in the SDK exception information of each exception type of the target SDK and the weight of the feature information.
  • the exception level corresponding to the target SDK repair strategy is obtained based on the exception hierarchical processing rules, the target exception type, and the exception impact parameters of the target exception type.
  • the target anomaly type is the anomaly type corresponding to the anomaly impact parameter with the largest value.
  • the target SDK repair policy further includes a first signature file, the first signature file includes a first signature, and the first signature is generated by the repair platform according to the host information.
  • the above execution module 603 can also be used to: call the host program indicated by the host information to verify the first signature, and execute the target SDK repair strategy to repair the target SDK when the host program indicated by the host information successfully verifies the first signature.
  • the target SDK repair policy also includes a second signature file.
  • the second signature file includes a second signature.
  • the second signature is generated by the channel platform based on the host information after scanning the target SDK repair policy and determining authorization.
  • the above execution module 603 can also be used to: call the host program indicated by the host information to verify the second signature. If the host program indicated by the host information successfully verifies the second signature, execute the target SDK repair strategy to repair the target SDK.
  • the above execution module 603 can be used to: establish a repair process, the repair process is independent of the process of the target SDK; obtain the target SDK repair strategy from the repair platform through the repair process, and execute the target SDK repair strategy to repair the target SDK.
  • the above execution module 603 can be used to: monitor the process of the target SDK through the repair process; before the target SDK repair is completed, if it is monitored that the process of the target SDK is terminated and the target SDK repair policy has not been downloaded, then through the repair process Continue to download the target SDK repair strategy until the target SDK repair strategy is downloaded and interrupt the repair process.
  • the process of monitoring the target SDK is started again, execute the target SDK repair strategy through the repair process to repair the target SDK; before the target SDK repair is completed, if If it is detected that the process of the target SDK has been terminated and the target SDK repair strategy has started to be executed, the repair progress of the target SDK will be recorded through the repair process.
  • the repair process will continue to repair the target SDK based on the repair progress.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the fifth aspect of the present application.
  • the electronic device 700 includes a memory 701, a processor 702, and a device stored on the memory 701 and capable of running on the processor 702. computer program.
  • the above-mentioned processor 702 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits that may be configured to implement embodiments of the present application.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • Memory 701 may include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical/tangible devices. Memory storage device.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk storage media devices magnetic disk storage media devices
  • optical storage media devices flash memory devices
  • electrical, optical or other physical/tangible devices Memory storage device.
  • memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or multiple processors), it is operable to perform operations described with reference to the repair method of the SDK according to the embodiment of the first aspect of the present application.
  • the processor 702 reads the executable program code stored in the memory 701 to run a computer program corresponding to the executable program code, so as to implement the SDK repair method in the embodiment of the first aspect.
  • electronic device 700 may also include communication interface 703 and bus 704 .
  • communication interface 703 and bus 704 are connected through the bus 704 and complete communication with each other.
  • the communication interface 703 is mainly used to implement communication between modules, devices, units and/or equipment in the embodiments of this application. Input devices and/or output devices may also be accessed through the communication interface 703.
  • Bus 704 includes hardware, software, or both, coupling the components of electronic device 700 to each other.
  • the bus 704 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), Hyper Transport (HT) interconnect, Industry Standard Architecture (ISA) bus, infinite bandwidth interconnect, low pin count (LPC) bus, memory bus, Micro Channel architecture Architecture, MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-E) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association A local (Video Electronics Standards Association Local Bus, VLB) bus or other suitable bus or a combination of two or more of these.
  • bus 704 may include one or more buses.
  • a sixth aspect of the present application provides a user terminal, which may include a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • Memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors ), it is operable to perform the operations described with reference to the repair method of the SDK according to the embodiment of the second aspect of the present application.
  • tangible (non-transitory) computer-readable storage media e.g., memory devices
  • the processor runs a computer program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the repair method of the SDK in the embodiment of the second aspect.
  • the user terminal may also include a communication interface and bus.
  • the memory, processor, and communication interface can be connected through the bus and communicate with each other.
  • connection relationship and specific implementation of the memory, processor, communication interface and bus please refer to the connection relationship and specific implementation of the memory 701, processor 702, communication interface 703 and bus 704 in the electronic device in the above embodiment, and will not be described again here.
  • a seventh aspect of this application provides an SDK repair system.
  • the SDK repair system may include the repair platform and a user terminal in the above embodiment.
  • the repair platform can execute the SDK repair method in the above-mentioned first aspect embodiment
  • the user terminal can execute the SDK repair method in the above-mentioned second aspect embodiment.
  • the repair system of the SDK may also include the channel platform in the above embodiment.
  • the channel platform can perform the steps performed by the channel platform in the above embodiment.
  • An eighth aspect of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer program instructions.
  • the above can be achieved.
  • the SDK repair method in the embodiment of the first aspect or the SDK repair method in the embodiment of the second aspect can achieve the same technical effect. To avoid duplication, it will not be described again here.
  • the above-mentioned computer-readable storage media may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disks or optical disks. etc. are not limited here.
  • Embodiments of the present application may also provide a computer program product.
  • the electronic device When instructions in the computer program product are executed by a processor of an electronic device, the electronic device causes the electronic device to execute the repair method of the SDK in the embodiment of the first aspect or the second aspect.
  • the SDK repair method in the embodiment please refer to the relevant instructions in the above embodiment for details, and can achieve the same technical effect. To avoid duplication, it will not be described again here.
  • Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It will also be understood that each block in the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can also be implemented by special purpose hardware that performs the specified functions or actions, or can be implemented by special purpose hardware and A combination of computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请公开了一种SDK的修复方法、装置、终端、设备、系统及介质,属于数据处理领域。该方法包括:根据获取的SDK信息、宿主信息和每个异常类型的SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数,目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应;基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略;向用户终端下发目标SDK修复策略,以使用户终端执行目标SDK修复策略以修复目标SDK。

Description

SDK的修复方法、装置、终端、设备、系统及介质
相关申请的交叉引用
本申请要求享有于2022年08月26日提交的名称为“SDK的修复方法、装置、终端、设备、系统及介质”的中国专利申请202211035360.6的优先权,该申请的全部内容通过引用并入本文中。
技术领域
本申请属于数据处理领域,尤其涉及一种SDK的修复方法、装置、终端、设备、系统及介质。
背景技术
软件开发工具包(Software Development Kit,SDK)可为为软件框架、硬件平台、操作系统或应用程序提供某项功能的工具包。SDK可嵌入至不同渠道方的软件框架、硬件平台、操作系统或应用程序等宿主中。SDK在与宿主共同运行的情况下,可能会产生异常,需要对SDK进行修复,使得SDK能够正常运行。
但由于渠道方不同,各渠道方的开发方式、宿主环境也具有一定的差异,SDK出现的缺陷也可能不同,对SDK单一的修复难以满足不同渠道方的SDK的修复需求。
发明内容
本申请实施例提供一种SDK的修复方法、装置、终端、设备、系统及介质,能够满足不同渠道方的SDK的修复需求。
第一方面,本申请实施例提供一种SDK的修复方法,应用于修复平台,该方法包括:获取软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息;根据SDK信息、宿主信息和每个异常类型的SDK 异常信息,得到目标SDK的每个异常类型对应的异常影响参数,目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应;基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略;向用户终端下发目标SDK修复策略,以使用户终端执行目标SDK修复策略以修复目标SDK。
第二方面,本申请实施例提供一种SDK的修复方法,应用于用户终端,该方法包括:向修复平台提供软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息,以使修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略,目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略,目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应,目标SDK的每个异常类型对应的异常影响参数根据SDK信息、宿主信息和每个异常类型的SDK异常信息得到;从修复平台获取目标SDK修复策略,并执行目标SDK修复策略修复目标SDK。
第三方面,本申请实施例提供一种SDK的修复装置,应用于修复平台,该装置包括:获取模块,用于获取软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息;计算模块,用于根据SDK信息、宿主信息和每个异常类型的SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数,目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应;策略配置模块,用于基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略;下发模块,用于向用户终端下发目标SDK修复策略,以使用户终端执行目标SDK修复策略以修复目标SDK。
第四方面,本申请实施例提供一种用户终端,包括:发送模块,用于向修复平台提供软件开发工具包SDK信息、宿主信息和不同异常类型的 SDK异常信息,以使修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略,目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略,目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应,目标SDK的每个异常类型对应的异常影响参数根据SDK信息、宿主信息和每个异常类型的SDK异常信息得到;接收模块,用于从修复平台获取目标SDK修复策略;执行模块,用于执行目标SDK修复策略修复目标SDK。
第五方面,本申请实施例提供一种电子设备,应用于修复平台,电子设备包括:处理器以及存储有计算机程序指令的存储器;处理器执行计算机程序指令时实现第一方面的SDK的修复方法。
第六方面,本申请实施例提供一种用户终端,包括:处理器以及存储有计算机程序指令的存储器;处理器执行计算机程序指令时实现第二方面的SDK的修复方法。
第七方面,本申请实施例提供一种SDK的修复系统,包括:修复平台,用于执行第一方面的SDK的修复方法;用户终端,用于执行第二方面的SDK的修复方法。
第八方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现第一方面的SDK的修复方法或第二方面的SDK的修复方法。
本申请实施例提供一种SDK的修复方法、装置、终端、设备、系统及介质,修复平台能够根据SDK信息、宿主信息和采集到的不同异常类型的SDK异常信息,得到表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同的宿主信息对应不同的宿主程序,不同的宿主程序对应不同的渠道方,不同版本的SDK也对应有不同的SDK信息,嵌入在不同渠道方的宿主程序中的不同版本的SDK产生的SDK异常信息不同,通过采集到的SDK异常信息,可得到与 嵌入每个渠道方的宿主程序的每个版本的SDK对应的异常级别的SDK修复策略,即,可为嵌入不同渠道方的宿主程序的不同版本的SDK自动分配适配的SDK修复策略,从而能够满足不同渠道方的SDK的修复需求。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单的介绍,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的SDK的修复方法的应用场景的一示例的示意图;
图2为本申请实施例提供的SDK的修复方法的应用场景的另一示例的示意图;
图3为本申请第一方面一实施例提供的SDK的修复方法的流程图;
图4为本申请第一方面另一实施例提供的SDK的修复方法的流程图;
图5为本申请第一方面又一实施例提供的SDK的修复方法的流程图;
图6为本申请第二方面一实施例提供的SDK的修复方法的流程图;
图7为本申请第二方面另一实施例提供的SDK的修复方法的流程图;
图8为本申请第二方面又一实施例提供的SDK的修复方法的流程图;
图9为本申请实施例提供的SDK的修复方法的一示例的逻辑示意图;
图10为本申请第三方面一实施例提供的SDK的修复装置的结构示意图;
图11为本申请第四方面一实施例提供的用户终端的结构示意图;
图12为本申请第五方面一实施例提供的电子设备的结构示意图。
具体实施方式
下面将详细描述本申请的各个方面的特征和示例性实施例,为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及具体实施例,对本申请进行进一步详细描述。应理解,此处所描述的具体实施例仅意在解释本申请,而不是限定本申请。对于本领域技术人员来说,本申请可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本申请的示例来提供对本申请更好的理解。
软件开发工具包(Software Development Kit,SDK)可为为软件框架、硬件平台、操作系统或应用程序提供某项功能的工具包。SDK可嵌入至不同渠道方的软件框架、硬件平台、操作系统或应用程序等宿主中。SDK在与宿主共同运行的情况下,可能会产生异常,需要对SDK进行修复,使得SDK能够正常运行。但由于渠道方不同,各渠道方的开发方式、宿主环境也具有一定的差异,SDK出现的缺陷也可能不同,对SDK单一的修复难以满足不同渠道方的SDK的修复需求。
本申请提供一种SDK的修复方法、装置、终端、设备、系统及介质,修复平台能够根据SDK信息、宿主信息和采集到的不同异常类型的SDK异常信息,得到能够表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略,并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同渠道方对应有不同的宿主信息,不同版本的SDK对应有不同的SDK信息,不同渠道方、不同版本的SDK对应产生的SDK异常信息也不同,通过不同的信息,可得到与每个渠道方、每个版本的SDK对应的异常级别的SDK修复策略,即,不同渠道方、不同版本的SDK可对应得到适配的SDK修复策略,能够满足不同渠道方的SDK的修复需求。
本申请实施例提供的SDK的修复方法可应用于对SDK修复的场景,可涉及修复平台和用户终端。图1为本申请实施例提供的SDK的修复方法的应用场景的一示例的示意图。如图1所示,用户终端11可与修复平台12通信交互。
用户终端11中具有至少一个宿主程序111和至少一个SDK 112。同一用户终端中可具有多个不同的宿主程序111,不同的宿主程序111对应的渠道方不同。SDK 112可嵌入在宿主程序111中,宿主程序111可调用SDK 112,从而使用SDK 112提供的功能。用户终端11具体可包括手机、平板电脑、电子计算机、智能穿戴设备等,在此并不限定。SDK 112可作为信息提供者向修复平台12提供SDK 112的SDK信息、SDK异常信息以及SDK 112所在的宿主程序111的宿主信息等。用户终端11可从修复平台12获取具有针对性的SDK修复策略,执行该SDK修复策略,以修复作为被修复对象的SDK 112。
修复平台12可为用于为用户终端提供SDK修复服务的后台系统,可包括一台以上的电子设备。电子设备可包括服务器、网关、路由器等设备,在此并不限定修复平台12中电子设备的类型和数量。修复平台12可为多个用户终端11提供SDK修复服务。不同的用户终端中具有的宿主程序111可以相同,也可以不同。修复平台12可维护不同的渠道方、宿主程序、用户、SDK、SDK异常信息和SDK修复策略等之间的对应关系,可分类归纳得到SDK异常的异常类型,并执行报警、提示等动作。修复平台12可为不同的用户终端11下发与对该用户终端11中需要修复的SDK 112具有针对性的修复策略。且修复平台12可通过全量、灰度、指定用户的方式向用户终端下发具有针对性的修复策略,在此并不限定。
在一些实施例中,本申请实施例提供的SDK的修复方法还可涉及渠道平台。图2为本申请实施例提供的SDK的修复方法的应用场景的另一示例的示意图。如图2所示,渠道平台13可与修复平台12通信交互。
渠道平台13可为SDK修复策略的审核平台,可包括一台以上的电子设备。电子设备可包括服务器、网关、路由器等设备,在此并不限定渠道平台13中电子设备的类型和数量。每个渠道方可在渠道平台13开设一个账号,通过渠道平台13对针对渠道方的宿主程序11嵌入的SDK 112提供的SDK修复策略进行审核。为宿主程序111中嵌入的SDK 112提供的SDK修复策略可先发送至与宿主程序111对应的渠道平台13进行审核,在渠道平台13对SDK修复策略审核通过后,修复平台13才会将该SDK 修复策略下发给用户终端11。在一些示例中,渠道平台13也可向修复平台13提供SDK异常信息。
下面对本申请中的SDK的修复方法、装置、终端、设备、系统及介质分别进行说明。
本申请第一方面提供一种SDK的修复方法,可应用于修复平台,即该SDK的修复方法可由修复平台执行。图3为本申请第一方面一实施例提供的SDK的修复方法的流程图。如图3所示,该SDK的修复方法可包括步骤S201至步骤S204。
在步骤S201中,获取SDK信息、宿主信息和不同异常类型的SDK异常信息。
SDK信息包括SDK的基础信息,例如,SDK信息可包括SDK版本等,在此并不限定。SDK信息可指示SDK版本。宿主信息包括SDK嵌入的宿主程序的信息,例如,宿主信息可包括宿主程序标识、宿主程序所属渠道方标识、宿主程序环境信息等,在此并不限定。宿主信息可指示宿主程序,宿主程序与渠道方具有对应关系。异常类型为SDK的异常类型,可根据场景、需求、经验等设定异常类型。例如,异常类型可包括但不限于数据异常类型、文件输入输出异常类型、业务不可达异常类型、崩溃异常类型等。一条SDK异常信息对应一次SDK异常。一条SDK异常信息包括与SDK发生的一次异常相关的信息,例如,一条SDK异常信息可包括SDK异常描述信息、发生异常的SDK嵌入的宿主程序的渠道方标识、SDK发生的异常是否有渠道方反馈、SDK上线时间、SDK异常影响的用户、SDK异常影响的终端类型、发生异常的SDK的业务成功率、发生异常的SDK的业务重要性等,在此并不限定。
在一些示例中,SDK异常信息包括第一SDK异常信息和/或第二SDK异常信息,第一SDK异常信息由用户终端提供,第二SDK由渠道平台提供。更进一步地,第一SDK异常信息可由用户终端中发生SDK异常的SDK提供。第一SDK异常信息可从用户终端中SDK的日志得到,第二SDK异常信息可从渠道平台的日志中得到。第一SDK异常信息也可包括埋点信息,以便于后续分析过程中可回溯SDK发生异常的位置、时间、 原因等。第二SDK异常信息可为渠道平台提供的技术人员录入的异常信息、运行时间(即runtime)信息等。
在步骤S202中,根据SDK信息、宿主信息和每个异常类型的SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数。
目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应。可根据宿主信息和SDK信息,确定目标SDK。目标SDK不同,目标SDK对应的SDK异常信息也有可能不同,不同的SDK异常信息表征的SDK异常对SDK的影响程序也不同。异常影响参数可表征SDK异常对SDK的影响程度。目标SDK的每个异常类型对应的异常影响参数保证该异常类型的SDK异常对目标SDK的影响程度。不同目标SDK的不同异常类型对应的异常影响参数可能不同,如,不同宿主程序中不同版本的SDK的不同异常类型对应的异常影响参数可能不同。不同目标SDK的同一异常类型对应的异常影响参数可能不同,如,不同宿主程序中不同版本的SDK的同一异常类型对应的异常影响参数可能不同,不同宿主程序中同一版本的SDK的同一异常类型对应的异常影响参数可能不同,相同宿主程序中不同版本SDK的同一异常类型对应的异常影响参数可能不同。
异常影响参数可为利用标准化算法计算得到的能够表征SDK异常对SDK的影响程度的参数,即异常影响参数标准化且具有可比性。如,不同目标SDK的不同异常类型对应的异常影响参数具有可比性。在一些示例中,可预先为至少部分SDK异常信息设置对应的计算值和权重,以建立统一的标准,从而使得利用权重算法计算得到不同目标SDK下不同异常类型对应的异常影响参数标准化且具有可比性。
在步骤S203中,基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略。
异常分级处理规则可包括异常类型、异常影响参数、异常级别和SDK修复策略的对应关系。目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略。即,根据目标SDK的每个异常类型对应的异常影响参数,可在异常分级处理规则中确定与目标SDK的异常类型、异常影响参数对应的异常级别和SDK修复策略,确定的该 SDK修复策略即可作为目标SDK修复策略。
异常级别可体现异常的严重程度,不同异常级别对应的目标SDK修复策略不同。异常的严重程度越高,修复该异常所需的SDK修复策略的修复程度越高。同理,异常的严重程度较低,采用修复程度较低的SDK修复策略就可以实现异常的修复。也就是说,体现异常的严重程度越高的异常级别对应的SDK修复策略的修复程度也越高。
异常分级处理规则中可记录有多种SDK修复策略,不同的SDK修复策略的修复程度不同,不同的SDK修复策略能够修复不同严重程度的SDK异常,可利用异常分级处理规则来为目标SDK选择合适的SDK修复策略。例如,设存在两种SDK,分别为SDK1和SDK2,通过两种SDK的异常类型和异常影响参数,确定SDK1的异常级别为三级,SDK2的异常级别为一级,异常级别为三级的异常严重程度高于异常级别为一级的严重程序,则为SDK1分配修复程度更高的SDK修复策略,为SDK2分配修复程度更低的SDK修复策略。
在一些示例中,目标SDK修复策略可包括但不限于以下一项或两项以上:第一文件、第二文件、第三文件。
第一文件包括缓存数据清除指令,缓存数据清除指令用于指示清除目标SDK对应的至少一个缓存文件夹中的数据。缓存数据清除指令还可根据修复程度相对的高低细分为不同级别的子指令,例如,缓存数据清除指令包括第一子指令和第二子指令,第一子指令可用于指示清除目标SDK对应的个别缓存文件夹中的数据,第二子指令可用于指示清除目标SDK对应的所有缓存文件夹中的数据;相对于第一子指令,第二子指令的修复程序更高。缓存数据清除指令可通过指令语句实现,在此并不限定指令语句的类型。
第二文件包括异常源阻断指令。异常源阻断指令用于指示将目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态。SDK可具有多种业务功能,每种业务功能还可具有至少一种子业务功能,业务功能与子业务功能可呈树状结构。对应地,业务功能的开关状态与子业务功能的开关状态也可呈树状结构,每种业务功能、子业务功能均可通过设 置开关状态开控制该业务功能、子业务功能的开启或关闭。
异常源阻断指令可根据修复程度相对的高低划分为不同的异常源阻断指令。对于不同异常类型和异常影响参数,可得到不同的异常级别,对应不同的异常级别,可分配不同的异常源阻断指令,不同的异常源阻断指令指示关闭的业务功能和/或子业务功能不同。例如,异常级别为二级,第二文件中的异常源阻断指令指示将目标SDK中的业务功能1和业务功能2的开关状态均设置为关闭状态;异常级别为一级,第二文件中的异常源阻断指令指示将目标SDK中的业务功能1的开关状态设置为关闭状态。在一些示例中,异常源阻断指令对业务功能的开关状态设置的内容可实现为字符串,如“111110”表示将六种业务功能中的第六种业务功能的开关状态设置为关闭状态。异常源阻断指令可在业务功能和/或子业务功能初始化时执行配置动作。
第三文件包括补丁文件,补丁文件用于对目标SDK进行升级修复。补丁文件包括修复前SDK的文件与修复后SDK的文件的差异文件。补丁文件可针对SDK的需要修复处进行修复。在一些示例中,第三文件可为apk文件。
在一些示例中,目标SDK修复策略包括第三文件。修复平台可生成补丁文件。具体地,修复平台可获取目标SDK的修复前SDK归档文件和修复后SDK归档文件;获取第一class文件和第二class文件,第一class文件包括修复前SDK归档文件中的class文件,第二class文件包括修复后SDK归档文件中的class文件;利用比对算法,比对第一class文件和第二class文件,得到第三class文件,第三class文件包括第二class文件与第一class文件存在差异的class文件;将第三class文件转换为补丁文件。
修复前SDK归档文件和修复后SDK归档文件可为arr文件,也可为jar文件。若修复前SDK归档文件和修复后SDK归档文件为arr文件,可对arr文件进行解压,从中提取jar文件。jar文件包括class文件与清单文件,可对jar文件解压,从中提取class文件,即,得到第一class文件和第二class文件。可将第三class文件压缩为jar文件,并通过Gradle transform应用程序接口(Application Program Interface,API)将第三class 文件转化为dex文件,dex文件即为补丁文件。该dex文件具有可读性,即该dex文件被扫描时,可从中获取到具有可读性的语句、类等,可便于审核人员进行审核,不会出现无法复原为具有可读性语句从而无法审核的情况。
第三文件可实现SDK的热修复,针对嵌入不同宿主程序的不同版本的SDK,第三文件中的补丁文件可不同。
上述第一文件、第二文件、第三文件之间也可相互组合。在一些示例中,两个以上文件组合后得到的目标SDK修复策略的修复程度高于两个以上文件中的任意一个文件对应的目标SDK修复策略的修复程度。例如,包括第一文件和第二文件的目标SDK修复策略的修复程度高于只包括第一文件的目标SDK修复策略的修复程度。
在步骤S204中,向用户终端下发目标SDK修复策略,以使用户终端执行目标SDK修复策略以修复目标SDK。
具体地,修复平台可向目标SDK所在的用户终端下发目标SDK修复策略。这里并不限定目标SDK所在的用户终端的数量,修复平台可向所有目标SDK所在的用户终端下发目标SDK修复策略,也可采用灰度下发的方式,分批次向目标SDK所在的用户终端下发目标SDK修复策略,还可向指定的个别目标SDK所在的用户终端下发目标SDK修复策略。目标SDK修复策略可以文件或其他形式发送至用户终端,在此并不限定目标SDK修复策略的形式。
用户终端获取到目标SDK修复策略后,执行目标SDK修复策略以修复目标SDK。
在一些示例中,用户终端可建立专门用于执行目标SDK修复策略的修复进程,即,目标SDK修复策略由修复进程执行。该修复进程与目标SDK的进程相互独立,即使在目标SDK的进程发生中断,修复进程可记录修复进度,不受目标SDK的进程的中断影响,在目标SDK的进程再次启动时,可根据修复进度继续进行修复,不需要重新开始修复,提高了SDK修复的效率。
在本申请实施例中,修复平台能够根据SDK信息、宿主信息和采集 到的不同异常类型的SDK异常信息,得到表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同的宿主信息对应不同的宿主程序,不同的宿主程序对应不同的渠道方,不同版本的SDK也对应有不同的SDK信息,嵌入在不同渠道方的宿主程序中的不同版本的SDK产生的SDK异常信息不同,通过采集到的SDK异常信息,可得到与嵌入每个渠道方的宿主程序的每个版本的SDK对应的异常级别的SDK修复策略,即,可为嵌入不同渠道方的宿主程序的不同版本的SDK自动分配适配的SDK修复策略,从而能够满足不同渠道方的SDK的修复需求。
在一些实施例中,可根据每个异常类型对SDK的影响和每个异常类型的SDK异常发生的次数共同确定每个异常类型对应的异常影响参数。还可根据异常影响参数的值最大的异常类型、该异常类型的异常影响参数,结合异常分级处理规则,确定目标SDK修复策略。图4为本申请第一方面另一实施例提供的SDK的修复方法的流程图。图4与图3的不同之处在于,图3中的步骤S202可具体细化为图4中的步骤S2021至步骤S2024,图3中的步骤S203可具体细化为图4中的步骤S2031和步骤S2032。
在步骤S2021中,根据SDK信息和宿主信息,确定目标SDK,并获取目标SDK的每个异常类型的SDK异常信息中的特征信息,以及特征信息的权重。
修复平台会获取到大量的SDK信息、宿主信息和SDK异常信息,为了能够为嵌入不同宿主程序的不同版本的SDK提供适配的SDK修复策略,对于嵌入一种宿主程序的一个版本的SDK,需要根据与该SDK相关的SDK异常信息来得到与该SDK适配的SDK修复策略。
根据SDK信息和宿主信息,即可确定SDK的版本和SDK嵌入的宿主程序,也就确定了目标SDK。SDK信息、宿主信息和SDK异常信息是成组获取的,即SDK发生一次异常,可对应提供SDK信息、宿主信息和 SDK异常信息。确定目标SDK,可汇总目标SDK的每个异常类型的SDK异常信息。SDK异常信息除了异常描述信息以外,还可包括特征信息,特征信息可表征SDK异常的至少部分特征。在一些示例中,特征信息可包括但不限于发生异常的SDK嵌入的宿主程序的渠道方标识、SDK发生的异常是否有渠道方反馈、SDK上线时间、SDK异常影响的用户、SDK异常影响的终端类型、发生异常的SDK的业务成功率、发生异常的SDK的业务重要性等。
可预先为特征信息设置权重,不同种类的特征信息的权重可不同,权重的设置可根据应用场景、需求、经验等设定,在此并不限定。各种类的特征信息的权重之和可为1。
在步骤S2022中,根据特征信息以及特征信息的权重,计算得到目标SDK的每个异常类型对应的异常影响因子。
对于一个异常类型的SDK异常信息,可先计算该异常类型的SDK异常信息中每个种类特征信息的值与各自的权重的乘积,将各个乘积的加和确定为目标SDK的该异常类型对应的异常影响因子。在一些示例中,特征信息的值可以是特征信息的原值。在另一些示例中,特征信息的值也可以是特征信息的原值经处理后得到的值,如经过归一化计算、标准化计算后的值,或按照预设的分类规则,根据每个种类特征信息的原值所属的分类,将该分类下的设定值确定为特征信息的值。
例如,特征信息包括发生异常的SDK嵌入的宿主程序的渠道方标识、SDK发生的异常是否有渠道方反馈、发生异常的SDK的业务成功率和发生异常的SDK的业务重要性。目标SDK的某一异常类型对应的发生异常的SDK嵌入的宿主程序的渠道方标识为AA、SDK发生的异常有渠道方反馈、发生异常的SDK的业务成功率为85%、发生异常的SDK的业务重要性为中。预设的分类规则可如下表一至表四所示,表一表征发生异常的SDK嵌入的宿主程序的渠道方标识的原值的分类规则,表二表征SDK发生的异常是否有渠道方反馈的原值的分类规则,标三表征发生异常的SDK的业务成功率的分类规则,表四表征发生异常的SDK的业务重要性的分类规则。
表一
表二
表三
表四
若发生异常的SDK嵌入的宿主程序的渠道方标识、SDK发生的异常是否有渠道方反馈、发生异常的SDK的业务成功率和发生异常的SDK的业务重要性各自对应的权重分别为d1、d2、d3和d4,则按照上述表一和表四,目标SDK的该异常类型对应的异常影响因子α可根据下式(1)得到:
α=c1×d1+c3×d2+c7×d3+c9×d4       (1)
一种异常类型对应的异常影响因子可表征该异常类型的SDK异常对SDK的影响,该影响体现的是异常类型在特征信息这个维度上对SDK的影响。
在步骤S2023中,根据目标SDK的每个异常类型的SDK异常信息的数量和SDK异常信息的总数量,计算得到目标SDK的每个异常类型对应的产出比。
目标SDK的一个异常类型对应的产出比可表征该异常类型在目标SDK的所有异常类型中出现的比重。目标SDK的一个异常类型的对应的产出比可为目标SDK的该异常类型的SDK异常信息的数量和目标SDK的所有异常类型的SDK异常信息的重数量的比值。例如,目标SDK共有n个异常类型的异常信息,n个异常类型的异常信息的数量分别为b1至bn, 则第i个异常类型对应的产出比可根据下式(2)得到:
其中,βi为第i个异常类型对应的产出比;b1为第1个异常类型的异常信息的数量;bi为第i个异常类型的异常信息的数量,1≤i≤n;bn为第n个异常类型的异常信息的数量。
在步骤S2024中,利用目标SDK的每个异常类型对应的异常影响因子和产出比,计算得到目标SDK的每个异常类型对应的异常影响参数。
异常影响参数除了体现异常类型在特征信息这个维度上对SDK的影响之外,还可体现该异常类型在SDK的所有异常类型中出现的比重这个维度上对SDK的影响。可将目标SDK的一个异常类型对应的异常影响因子与该异常类型对应的产出比的乘积作为目标SDK的该异常类型对应的异常影响参数。例如,第i个异常类型对应的异常影响参数可根据下式(3)得到:
E(i)=αi×βi    (3)
其中,E(i)为第i个异常类型对应的异常影响参数;αi为第i个异常类型对应的异常影响因子;βi为第i个异常类型对应的产出比。
在步骤S2031中,根据每个异常类型对应的异常影响参数,确定目标异常类型。
目标异常类型为值最大的异常影响参数对应的异常类型。例如,假设目标SDK共对应具有四种异常类型的SDK异常信息,第一种异常类型对应的异常影响参数的值至第四种异常类型对应的异常影响参数的值依次为f1、f2、f3和f4,若f2<f4<f1<f3,则目标异常类型为第三种异常类型。
在步骤S2032中,依据异常分级处理规则,确定与目标异常类型和目标异常类型的异常影响参数对应的异常级别,并根据异常级别,确定目标SDK修复策略。
目标SDK的每个异常类型对应的异常影响参数保证该异常类型的SDK异常对目标SDK的影响程度。值最大的异常影响参数对应的异常类型在各异常类型中,是对目标SDK的影响最大的一种异常类型。目标异常类型和目标异常类型对应的异常影响参数可体现目标SDK受到的影响 主要是由哪种异常类型的SDK异常引起的,以及该异常类型的SDK异常对目标SDK的影响程度。不同的目标异常类型以及不同值的异常影响参数在异常分级处理规则中对应的异常级别可能不同,对应的目标SDK修复策略也可能不同。
例如,假设异常类型包括但数据异常类型、文件输入输出异常类型、业务不可达异常类型和崩溃异常类型四种异常类型。若目标异常类型为数据异常类型或文件输入输出异常类型,异常级别可为轻微级别,对应的目标SDK修复策略可包括上述实施例中的第一文件;若目标异常类型为业务不可达异常类型,异常级别可为中等级别,对应的目标SDK修复策略可包括上述实施例中的第二文件;若目标异常类型为崩溃异常类型,异常级别可为严重级别,对应的目标SDK修复策略可包括上述实施例中的第三文件。
在一些实施例中,为了使目标SDK修复策略下发至用户终端,只能对目标SDK生效,可在目标SDK修复策略中添加能够体现宿主程序即渠道方的签名。具体地,目标SDK修复策略还可包括第一签名文件,修复平台可根据宿主信息,生成第一签名,以及,根据第一签名,生成第一签名文件,第一签名文件包括第一签名。生成第一签名的签名算法在此并不限定,例如,可根据宿主信息,利用SM3签名算法,生成第一签名。
用户终端获取到目标SDK修复策略后,可通过对第一签名的验签,确定该目标SDK修复策略针对的目标SDK,从而执行目标SDK修复策略对目标SDK进行修复。可调用宿主程序对第一签名进行验签,验签成功,表示该宿主程序具有目标SDK,可对该宿主程序嵌入的目标SDK进行修复;验签失败,表示该宿主程序不具有目标SDK,不对该宿主程序嵌入的SDK进行修复。
在一些实施例中,在修复平台得到目标SDK修复策略后,修复平台可将目标SDK修复策略向渠道平台发送,由渠道平台进行审核,在渠道平台审核通过的情况下,才向用户终端下发目标SDK修复策略,以保证目标SDK修复策略的安全性。图5为本申请第一方面又一实施例提供的SDK的修复方法的流程图。图5与图3的不同之处在于,图5所示的SDK 的修复方法还可包括步骤S205和步骤S206,图3中的步骤S204可具体细化为图5中的步骤S2041。
在步骤S205中,向渠道平台发送目标SDK修复策略。
渠道平台接收目标SDK修复策略,可扫描目标SDK修复策略,得到目标SDK修复策略的内容,从而对目标SDK修复策略进行审核。
若目标SDK修复策略审核通过,渠道平台为该目标SDK修复策略授权,根据宿主信息生成第二签名,并根据第二签名生成第二签名文件,第二签名文件包括第二签名。渠道平台将第二签名文件添加入目标SDK修复策略,并向修复平台反馈目标SDK修复策略。在一些示例中,渠道平台可通过自有的签名算法,利用宿主信息对目标SDK修复策略的哈希值进行签名,得到第二签名。
若目标SDK修复策略审核未通过,渠道平台不会为该目标SDK修复策略授权,渠道平台可向修复平台反馈通知消息,通知修复平台审核未通过。在渠道平台扫描目标SDK修复策略未授权的情况下,修复平台不得下发目标SDK修复策略。
在步骤S206中,接收渠道平台反馈的目标SDK修复策略。
反馈的目标SDK修复策略包括第二签名文件。第二签名文件包括第二签名。第二签名由渠道平台在扫描目标SDK修复策略并授权的情况下根据宿主信息生成。
在步骤S2041中,向用户终端下发渠道平台反馈的目标SDK修复策略。
修复平台可与渠道平台交互,以使渠道平台可对目标SDK修复策略进行审核,在渠道平台审核通过的情况下,才允许修复平台向用户终端下发目标SDK修复策略,保证了目标SDK修复策略的安全性。而且,渠道平台可通过第二签名标识目标SDK的宿主程序所属的渠道方,用户终端在获取到目标SDK修复策略的情况下,可利用宿主程序的宿主信息对第二签名验签,目标SDK修复策略只对验签通过的宿主程序中的目标SDK生效,以保证目标SDK修复策略生效的针对性。
本申请第二方面提供一种SDK的修复方法,可应用于用户终端,即 该SDK的修复方法可由用户终端执行。图6为本申请第二方面一实施例提供的SDK的修复方法的流程图。如图6所示,该SDK的修复方法可包括步骤S301和步骤S302。
在步骤S301中,向修复平台提供软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息,以使修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略。
目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略。目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应。目标SDK的每个异常类型对应的异常影响参数根据SDK信息、宿主信息和每个异常类型的SDK异常信息得到。
在步骤S302中,从修复平台获取目标SDK修复策略,并执行目标SDK修复策略修复目标SDK。
在一些示例中,目标SDK在初始化时,可建立修复进程,并向修复平台发送宿主信息、SDK信息、用户信息等,修复平台可根据宿主信息和SDK信息,查找与宿主信息和SDK信息对应的目标SDK修复策略,并下发目标SDK修复策略。用户终端从修复平台下载目标SDK修复策略,并通过修复进程执行该目标SDK修复策略对目标SDK进行修复。
在一些示例中,目标SDK修复策略包括但不限于以下一项或两项以上:第一文件、第二文件、第三文件。
第一文件包括缓存数据清除指令,缓存数据清除指令用于指示清除目标SDK对应的至少一个缓存文件夹中的数据。在目标SDK修复策略包括第一文件的情况下,用户终端可按照缓存数据清除指令,清除目标SDK的缓存文件夹中的脏数据。
第二文件包括异常源阻断指令,异常源阻断指令用于指示将目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态。在目标SDK修复策略包括第二文件的情况下,用户终端可按照异常源阻断指令将异常源阻断指令指示的业务功能和/或子业务功能的开关状态设置为关闭状态。
第三文件包括补丁文件,补丁文件用于对目标SDK进行升级修复。在目标SDK修复策略包括第三文件的情况下,用户终端可提取第三文件中的补丁文件,按照类加载的方式加载修复后的类完成目标SDK的修复。
在一些示例中,目标SDK修复策略包括第三文件,补丁文件由第三class文件转换而成,第三class文件包括第二class文件与第一class文件存在差异的class文件,第一class文件包括目标SDK的修复前SDK归档文件中的class文件,第二class文件包括目标SDK的修复后SDK归档文件中的class文件。
上述第一文件、第二文件和第三文件的具体内容可参见上述实施例中的相关说明,在此不再赘述。
上述步骤S301和步骤S302的具体内容可参见上述实施例中的相关说明,在此不再赘述。
在本申请实施例中,修复平台能够根据SDK信息、宿主信息和采集到的不同异常类型的SDK异常信息,得到表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同的宿主信息对应不同的宿主程序,不同的宿主程序对应不同的渠道方,不同版本的SDK也对应有不同的SDK信息,嵌入在不同渠道方的宿主程序中的不同版本的SDK产生的SDK异常信息不同,通过采集到的SDK异常信息,可得到与嵌入每个渠道方的宿主程序的每个版本的SDK对应的异常级别的SDK修复策略,即,可为嵌入不同渠道方的宿主程序的不同版本的SDK自动分配适配的SDK修复策略,从而能够满足不同渠道方的SDK的修复需求。
在一些实施例中,目标SDK的每个类型异常对应的异常影响参数利用目标SDK的每个异常类型对应的异常影响因子和产出比计算得到。目标SDK的每个异常类型对应的产出比根据目标SDK的每个异常类型的SDK异常信息的数量和SDK异常信息的总数量计算得到。目标SDK的每 个异常类型对应的异常影响因子根据目标SDK的每个异常类型的SDK异常信息中的特征信息,以及特征信息的权重计算得到。这部分的具体内容可参见上述实施例中的相关说明,在此不再赘述。
在一些实施例中,目标SDK修复策略对应的异常级别,依据异常分级处理规则、目标异常类型和目标异常类型的异常影响参数得到,目标异常类型为值最大的异常影响参数对应的异常类型。这部分的具体内容可参见上述实施例中的相关说明,在此不再赘述。
在一些实施例中,目标SDK修复策略还包括第一签名文件,第一签名文件包括第一签名,第一签名由修复平台根据宿主信息生成,具体内容可参见上述实施例中的相关说明,在此不再赘述。
用户终端可在从修复平台获取目标SDK修复策略后,调用宿主信息指示的宿主程序对第一签名进行验签,在宿主信息指示的宿主程序对第一签名验签成功的情况下,执行目标SDK修复策略修复目标SDK。对第一签名进行验签的验签算法,用户终端可预先与修复平台约定,在此并不限定。修复平台可利用约定的私钥生成第一签名,用户终端可利用约定的公钥对第一签名进行验签,一方面可验证目标SDK修复策略的完整性和是否被篡改,另一方面也可验证目标SDK修复策略对宿主程序即渠道方的唯一性,从而保证目标SDK修复策略的内容安全性和渠道方的接入安全性。
在一些实施例中,目标SDK修复策略还包括第二签名文件,第二签名文件包括第二签名,第二签名由渠道平台在扫描目标SDK修复策略并确定授权的情况下根据宿主信息生成,具体内容可参见上述实施例中的相关说明,在此不再赘述。图7为本申请第二方面另一实施例提供的SDK的修复方法的流程图。图7与图6的不同之处在于,图6中的步骤S302可具体细化为图7中的步骤S3021至步骤S3023。
在步骤S3021中,从修复平台获取目标SDK修复策略。
在步骤S3022中,调用宿主信息指示的宿主程序对第二签名进行验签。
对第二签名进行验签的验签算法,用户终端可预先与渠道平台约定, 在此并不限定。渠道平台可利用约定的私钥生成第二签名,用户终端可利用约定的公钥对第二签名进行验签,第一方面可验证目标SDK修复策略的完整性和是否被篡改,第二方面也可验证目标SDK修复策略对宿主程序即渠道方的唯一性,第三方面还可验证渠道方对目标SDK修复策略的审核通过,从而保证目标SDK修复策略的内容安全性和渠道方的接入安全性。
在步骤S3023中,在宿主信息指示的宿主程序对第二签名验签成功的情况下,执行目标SDK修复策略修复目标SDK。
在一些实施例中,用户终端可建立修复进程,通过修复进程从修复平台获取目标SDK修复策略,并通过修复进程执行目标SDK修复策略以修复目标SDK。该修复进程与目标SDK的进程相互独立,可最大化减小目标SDK的进程对SDK的修复的影响,提高SDK的修复效率。图8为本申请第二方面又一实施例提供的SDK的修复方法的流程图。图8与图6的不同之处在于,图6中的步骤S302可具体细化为图8中的步骤S3024至步骤S3026。
在步骤S3024中,通过修复进程监听目标SDK的进程。
在步骤S3025中,在目标SDK修复完成之前,若监听到目标SDK的进程中止且目标SDK修复策略未下载完成,则通过修复进程继续下载目标SDK修复策略,直至目标SDK修复策略下载完成后中断修复进程,在监听到目标SDK的进程再次启动时,通过修复进程执行目标SDK修复策略修复目标SDK。
下载得到目标SDK修复策略后,可对目标SDK修复策略中主要起修复作用的内容加密保存,例如,对缓存数据清除指令、异常源阻断指令、补丁文件等加密保存。
若在修复进程下载目标SDK修复策略的过程中,修复进程可能会因为其他原因中止,可利用用户终端的操作系统层提供的断点续传功能,以保证用户终端可获取到完整的目标SDK修复策略。
在步骤S3026中,在目标SDK修复完成之前,若监听到目标SDK的进程中止且已开始执行目标SDK修复策略,则通过修复进程记录目标 SDK的修复进度,在监听到目标SDK的进程再次启动时,通过修复进程基于修复进度继续修复目标SDK。
由上可得,无论宿主程序、目标SDK的进程是否存活,都不会影响用户终端获取目标SDK修复策略,能够确保目标SDK修复策略有效执行,提高SDK的修复率。
为了便于理解,下面通过用户终端、修复平台和渠道平台之间交互的逻辑图来对SDK的修复方法进行说明。图9为本申请实施例提供的SDK的修复方法的一示例的逻辑示意图。如图9所示,用户终端41中具有宿主程序411和SDK 412,SDK 412嵌入宿主程序411,用户终端41可建立修复进程413。修复平台42具有日志分析功能421、策略配置功能422和文件管理功能423。渠道平台43具有渠道方日志提供功能431、策略内容审核功能432和策略签名功能433。
修复平台42可从SDK 412获取SDK的日志,日志中可包括宿主信息、SDK信息和SDK异常信息。修复平台42也可从渠道平台43获取渠道方的日志,渠道平台43的渠道方日志提供功能431可提供渠道方的日志。修复平台42中的日志分析功能421可从日志中提取宿主信息、SDK信息和SDK异常信息。策略配置功能422可从日志分析功能421获取宿主信息、SDK信息和SDK异常信息,根据宿主信息、SDK信息和SDK异常信息确定异常级别,并确定异常级别对应的目标SDK修复策略。文件管理功能423管理各种SDK修复策略。策略配置功能422可从文件管理功能423获取目标SDK修复策略。修复平台42向渠道平台43发送目标SDK修复策略。渠道平台43通过策略内容审核功能432对目标SDK修复策略进行审核,在审核通过的情况下,通过策略签名功能433对目标SDK修复策略进行签名,将添加签名的目标SDK修复策略反馈给修复平台42。SDK 412可向修复平台发送宿主信息和SDK信息,以触发修复平台42向用户终端41提供目标SDK修复策略。SDK 412可启动修复进程413,修复进程413从修复平台42下载目标SDK修复策略。用户终端41通过修复进程413对目标SDK修复策略中的签名进行验签,验签通过后,执行该目标SDK修复策略,对SDK 412进行修复。
需要说明的是,本申请中对信息、数据的获取、存储、使用、处理等均得到用户或相关机构的授权,符合国家法律法规的相关规定。
本申请第三方面提供一种SDK的修复装置。图10为本申请第三方面一实施例提供的SDK的修复装置的结构示意图。如图10所示,该SDK的修复装置500可包括获取模块501、计算模块502、策略配置模块503和下发模块504。
获取模块501可用于获取SDK信息、宿主信息和不同异常类型的SDK异常信息。
计算模块502可用于根据SDK信息、宿主信息和每个异常类型的SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数。
目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应。
策略配置模块503可用于基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略。
在一些示例中,目标SDK修复策略包括以下一项或两项以上:
第一文件,第一文件包括缓存数据清除指令,缓存数据清除指令用于指示清除目标SDK对应的至少一个缓存文件夹中的数据;
第二文件,第二文件包括异常源阻断指令,异常源阻断指令用于指示将目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态;
第三文件,第三文件包括补丁文件,补丁文件用于对目标SDK进行升级修复。
目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略。
下发模块,用于向用户终端下发目标SDK修复策略,以使用户终端执行目标SDK修复策略以修复目标SDK。
在一些示例中,目标SDK修复策略由用户终端建立的修复进程执行,修复进程与目标SDK的进程相互独立。
在本申请实施例中,修复平台能够根据SDK信息、宿主信息和采集 到的不同异常类型的SDK异常信息,得到表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同的宿主信息对应不同的宿主程序,不同的宿主程序对应不同的渠道方,不同版本的SDK也对应有不同的SDK信息,嵌入在不同渠道方的宿主程序中的不同版本的SDK产生的SDK异常信息不同,通过采集到的SDK异常信息,可得到与嵌入每个渠道方的宿主程序的每个版本的SDK对应的异常级别的SDK修复策略,即,可为嵌入不同渠道方的宿主程序的不同版本的SDK自动分配适配的SDK修复策略,从而能够满足不同渠道方的SDK的修复需求。
在一些实施例中,计算模块502可用于:根据SDK信息和宿主信息,确定目标SDK,并获取目标SDK的每个异常类型的SDK异常信息中的特征信息,以及特征信息的权重;根据特征信息以及特征信息的权重,计算得到目标SDK的每个异常类型对应的异常影响因子;根据目标SDK的每个异常类型的SDK异常信息的数量和SDK异常信息的总数量,计算得到目标SDK的每个异常类型对应的产出比;利用目标SDK的每个异常类型对应的异常影响因子和产出比,计算得到目标SDK的每个异常类型对应的异常影响参数。
在一些实施例中,策略配置模块503可用于:根据每个异常类型对应的异常影响参数,确定目标异常类型,目标异常类型为值最大的异常影响参数对应的异常类型;依据异常分级处理规则,确定与目标异常类型和目标异常类型的异常影响参数对应的异常级别,并根据异常级别,确定目标SDK修复策略。
在一些实施例中,目标SDK修复策略包括第三文件。SDK的修复装置500还可包括补丁生成模块。
补丁生成模块可用于:获取目标SDK的修复前SDK归档文件和修复后SDK归档文件;获取第一class文件和第二class文件,第一class文件包括修复前SDK归档文件中的class文件,第二class文件包括修复后 SDK归档文件中的class文件;利用比对算法,比对第一class文件和第二class文件,得到第三class文件,第三class文件包括第二class文件与第一class文件存在差异的class文件;将第三class文件转换为补丁文件。
在一些实施例中,目标SDK修复策略还包括第一签名文件。该SDK的修复装置还可包括第一签名模块。第一签名模块可用于:根据宿主信息,生成第一签名;根据第一签名,生成第一签名文件,第一签名文件包括第一签名。
在一些实施例中,该SDK的修复装置还可包括接收模块。
上述下发模块504还可用于:向渠道平台发送目标SDK修复策略。
接收模块可用于:接收渠道平台反馈的目标SDK修复策略,反馈的目标SDK修复策略包括第二签名文件,第二签名文件包括第二签名,第二签名由渠道平台在扫描目标SDK修复策略并授权的情况下根据宿主信息生成。
上述下发模块504可用于:向用户终端下发渠道平台反馈的目标SDK修复策略。
本申请第四方面提供一种用户终端。图11为本申请第四方面一实施例提供的用户终端的结构示意图。如图11所示,该用户终端600可包括发送模块601、接收模块602和执行模块603。
发送模块601可用于向修复平台提供SDK信息、宿主信息和不同异常类型的SDK异常信息,以使修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略。
目标SDK修复策略包括异常分级处理规则中与异常影响参数对应的异常级别的SDK修复策略。目标SDK与宿主信息指示的宿主程序和SDK信息指示的SDK版本对应。目标SDK的每个异常类型对应的异常影响参数根据SDK信息、宿主信息和每个异常类型的SDK异常信息得到。
接收模块602可用于从修复平台获取目标SDK修复策略。
在一些示例中,目标SDK修复策略包括以下一项或两项以上:
第一文件,第一文件包括缓存数据清除指令,缓存数据清除指令用于指示清除目标SDK对应的至少一个缓存文件夹中的数据;
第二文件,第二文件包括异常源阻断指令,异常源阻断指令用于指示将目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态;
第三文件,第三文件包括补丁文件,补丁文件用于对目标SDK进行升级修复。
在一些示例中,目标SDK修复策略包括第三文件,补丁文件由第三class文件转换而成,第三class文件包括第二class文件与第一class文件存在差异的class文件,第一class文件包括目标SDK的修复前SDK归档文件中的class文件,第二class文件包括目标SDK的修复后SDK归档文件中的class文件。
执行模块603可用于执行目标SDK修复策略修复目标SDK。
在本申请实施例中,修复平台能够根据SDK信息、宿主信息和采集到的不同异常类型的SDK异常信息,得到表征异常类型对SDK的影响的异常影响参数,从而基于每个异常类型对应的异常影响参数和预设的异常分级处理规则,得到对应异常级别的SDK修复策略并下发给用户终端。用户终端可执行应异常级别的SDK修复策略,对SDK进行修复。不同的宿主信息对应不同的宿主程序,不同的宿主程序对应不同的渠道方,不同版本的SDK也对应有不同的SDK信息,嵌入在不同渠道方的宿主程序中的不同版本的SDK产生的SDK异常信息不同,通过采集到的SDK异常信息,可得到与嵌入每个渠道方的宿主程序的每个版本的SDK对应的异常级别的SDK修复策略,即,可为嵌入不同渠道方的宿主程序的不同版本的SDK自动分配适配的SDK修复策略,从而能够满足不同渠道方的SDK的修复需求。
在一些实施例中,目标SDK的每个类型异常对应的异常影响参数利用目标SDK的每个异常类型对应的异常影响因子和产出比计算得到。目标SDK的每个异常类型对应的产出比根据目标SDK的每个异常类型的SDK异常信息的数量和SDK异常信息的总数量计算得到。目标SDK的每个异常类型对应的异常影响因子根据目标SDK的每个异常类型的SDK异常信息中的特征信息,以及特征信息的权重计算得到。
在一些实施例中,目标SDK修复策略对应的异常级别依据异常分级处理规则、目标异常类型和目标异常类型的异常影响参数得到。目标异常类型为值最大的异常影响参数对应的异常类型。
在一些实施例中,目标SDK修复策略还包括第一签名文件,第一签名文件包括第一签名,第一签名由修复平台根据宿主信息生成。
上述执行模块603还可用于:调用宿主信息指示的宿主程序对第一签名进行验签,在宿主信息指示的宿主程序对第一签名验签成功的情况下,执行目标SDK修复策略修复目标SDK。
在一些实施例中,目标SDK修复策略还包括第二签名文件,第二签名文件包括第二签名,第二签名由渠道平台在扫描目标SDK修复策略并确定授权的情况下根据宿主信息生成。
上述执行模块603还可用于:调用宿主信息指示的宿主程序对第二签名进行验签,在宿主信息指示的宿主程序对第二签名验签成功的情况下,执行目标SDK修复策略修复目标SDK。
在一些实施例中,上述执行模块603可用于:建立修复进程,修复进程与目标SDK的进程相互独立;通过修复进程从修复平台获取目标SDK修复策略,并执行目标SDK修复策略修复目标SDK。
在一些实施例中,上述执行模块603可用于:通过修复进程监听目标SDK的进程;在目标SDK修复完成之前,若监听到目标SDK的进程中止且目标SDK修复策略未下载完成,则通过修复进程继续下载目标SDK修复策略,直至目标SDK修复策略下载完成后中断修复进程,在监听到目标SDK的进程再次启动时,通过修复进程执行目标SDK修复策略修复目标SDK;在目标SDK修复完成之前,若监听到目标SDK的进程中止且已开始执行目标SDK修复策略,则通过修复进程记录目标SDK的修复进度,在监听到目标SDK的进程再次启动时,通过修复进程基于修复进度继续修复目标SDK。
本申请第五方面还提供了一种电子设备。图12为本申请第五方面一实施例提供的电子设备的结构示意图。如图12所示,电子设备700包括存储器701、处理器702及存储在存储器701上并可在处理器702上运行 的计算机程序。
在一个示例中,上述处理器702可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。
存储器701可包括只读存储器(Read-Only Memory,ROM),随机存取存储器(Random Access Memory,RAM),磁盘存储介质设备,光存储介质设备,闪存设备,电气、光学或其他物理/有形的存储器存储设备。因此,通常,存储器包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本申请第一方面实施例中SDK的修复方法所描述的操作。
处理器702通过读取存储器701中存储的可执行程序代码来运行与可执行程序代码对应的计算机程序,以用于实现上述第一方面实施例中的SDK的修复方法。
在一些示例中,电子设备700还可包括通信接口703和总线704。其中,如图12所示,存储器701、处理器702、通信接口703通过总线704连接并完成相互间的通信。
通信接口703,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。也可通过通信接口703接入输入设备和/或输出设备。
总线704包括硬件、软件或两者,将电子设备700的部件彼此耦接在一起。举例来说而非限制,总线704可包括加速图形端口(Accelerated Graphics Port,AGP)或其他图形总线、增强工业标准架构(Enhanced Industry Standard Architecture,EISA)总线、前端总线(Front Side Bus,FSB)、超传输(Hyper Transport,HT)互连、工业标准架构(Industry Standard Architecture,ISA)总线、无限带宽互连、低引脚数(Low pin count,LPC)总线、存储器总线、微信道架构(Micro Channel Architecture,MCA)总线、外围组件互连(Peripheral Component Interconnect,PCI)总线、PCI-Express(PCI-E)总线、串行高级技术附件(Serial Advanced Technology Attachment,SATA)总线、视频电子标准协 会局部(Video Electronics Standards Association Local Bus,VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线704可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。
本申请第六方面提供一种用户终端,该用户终端可包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序。
存储器包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本申请第二方面实施例中SDK的修复方法所描述的操作。
处理器通过读取存储器中存储的可执行程序代码来运行与可执行程序代码对应的计算机程序,以用于实现上述第二方面实施例中的SDK的修复方法。
在一些示例中,用户终端还可包括通信接口和总线。存储器、处理器、通信接口可通过总线连接并完成相互间的通信。
存储器、处理器、通信接口和总线的连接关系和具体实现可参见上述实施例中电子设备中存储器701、处理器702、通信接口703和总线704的连接关系和具体实现,在此不再赘述。
本申请第七方面提供一种SDK的修复系统,该SDK的修复系统可包括上述实施例中的修复平台和用户终端。修复平台可执行上述第一方面实施例中的SDK的修复方法,用户终端可执行上述第二方面实施例中的SDK的修复方法,具体内容可参见上述实施例中的相关说明,且能达到相同的技术效果,为避免重复,这里不再赘述。
在一些实施例中,该SDK的修复系统还可包括上述实施例中的渠道平台,渠道平台可执行上述实施例中渠道平台执行的步骤,具体可参见上述实施例中的相关说明,且能达到相同的技术效果,为避免重复,这里不再赘述。
本申请第八方面提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令,该计算机程序指令被处理器执行时可实现上 述第一方面的实施例中的SDK的修复方法或第二方面的实施例中的SDK的修复方法,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,上述计算机可读存储介质可包括非暂态计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等,在此并不限定。
本申请实施例还可提供一种计算机程序产品,该计算机程序产品中的指令由电子设备的处理器执行时,使得电子设备执行上述第一方面的实施例中的SDK的修复方法或第二方面的实施例中的SDK的修复方法,具体可参见上述实施例中的相关说明,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要明确的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。对于装置实施例、设备实施例、用户终端实施例、系统实施例、计算机可读存储介质实施例、计算机程序产品实施例而言,相关之处可以参见方法实施例的说明部分。本申请并不局限于上文所描述并在图中示出的特定步骤和结构。本领域的技术人员可以在领会本申请的精神之后,作出各种改变、修改和添加,或者改变步骤之间的顺序。并且,为了简明起见,这里省略对已知方法技术的详细描述。
上面参考根据本申请的实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各方面。应当理解,流程图和/或框图中的每个方框以及流程图和/或框图中各方框的组合可以由计算机程序指令实现。这些计算机程序指令可被提供给通用计算机、专用计算机、或其它可编程数据处理装置的处理器,以产生一种机器,使得经由计算机或其它可编程数据处理装置的处理器执行的这些指令使能对流程图和/或框图的一个或多个方框中指定的功能/动作的实现。这种处理器可以是但不限于是通用处理器、专用处理器、特殊应用处理器或者现场可编程逻辑电路。还可理解,框图和/或流程图中的每个方框以及框图和/或流程图中的方框的组合,也可以由执行指定的功能或动作的专用硬件来实现,或可由专用硬件和计算机指令的组合来实现。
本领域技术人员应能理解,上述实施例均是示例性而非限制性的。在不同实施例中出现的不同技术特征可以进行组合,以取得有益效果。本领域技术人员在研究附图、说明书及权利要求书的基础上,应能理解并实现所揭示的实施例的其他变化的实施例。在权利要求书中,术语“包括”并不排除其他装置或步骤;数量词“一个”不排除多个;术语“第一”、“第二”用于标示名称而非用于表示任何特定的顺序。权利要求中的任何附图标记均不应被理解为对保护范围的限制。权利要求中出现的多个部分的功能可以由一个单独的硬件或软件模块来实现。某些技术特征出现在不同的从属权利要求中并不意味着不能将这些技术特征进行组合以取得有益效果。

Claims (23)

  1. 一种SDK的修复方法,应用于修复平台,所述方法包括:
    获取软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息;
    根据所述SDK信息、所述宿主信息和每个异常类型的所述SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数,所述目标SDK与所述宿主信息指示的宿主程序和所述SDK信息指示的SDK版本对应;
    基于所述目标SDK的每个异常类型对应的所述异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,所述目标SDK修复策略包括所述异常分级处理规则中与所述异常影响参数对应的异常级别的SDK修复策略;
    向用户终端下发所述目标SDK修复策略,以使所述用户终端执行所述目标SDK修复策略以修复所述目标SDK。
  2. 根据权利要求1所述的方法,其中,所述根据所述SDK信息、所述宿主信息和每个异常类型的所述SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数,包括:
    根据所述SDK信息和所述宿主信息,确定所述目标SDK,并获取所述目标SDK的每个异常类型的所述SDK异常信息中的特征信息,以及所述特征信息的权重;
    根据所述特征信息以及所述特征信息的权重,计算得到所述目标SDK的每个异常类型对应的异常影响因子;
    根据所述目标SDK的每个异常类型的所述SDK异常信息的数量和所述SDK异常信息的总数量,计算得到所述目标SDK的每个异常类型对应的产出比;
    利用所述目标SDK的每个异常类型对应的所述异常影响因子和所述产出比,计算得到所述目标SDK的每个异常类型对应的所述异常影响参数。
  3. 根据权利要求1所述的方法,其中,所述基于所述目标SDK的每个异常类型对应的所述异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,包括:
    根据每个异常类型对应的所述异常影响参数,确定目标异常类型,所述目标异常类型为值最大的所述异常影响参数对应的异常类型;
    依据所述异常分级处理规则,确定与所述目标异常类型和所述目标异常类型的所述异常影响参数对应的异常级别,并根据异常级别,确定所述目标SDK修复策略。
  4. 根据权利要求1所述的方法,其中,所述目标SDK修复策略包括以下一项或两项以上:
    第一文件,所述第一文件包括缓存数据清除指令,所述缓存数据清除指令用于指示清除所述目标SDK对应的至少一个缓存文件夹中的数据;
    第二文件,所述第二文件包括异常源阻断指令,所述异常源阻断指令用于指示将所述目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态;
    第三文件,所述第三文件包括补丁文件,所述补丁文件用于对所述目标SDK进行升级修复。
  5. 根据权利要求4所述的方法,其中,所述目标SDK修复策略包括所述第三文件,
    所述方法还包括:
    获取所述目标SDK的修复前SDK归档文件和修复后SDK归档文件;
    获取第一class文件和第二class文件,所述第一class文件包括修复前SDK归档文件中的class文件,所述第二class文件包括修复后SDK归档文件中的class文件;
    利用比对算法,比对所述第一class文件和所述第二class文件,得到第三class文件,所述第三class文件包括所述第二class文件与所述第一class文件存在差异的class文件;
    将所述第三class文件转换为所述补丁文件。
  6. 根据权利要求1所述的方法,其中,所述目标SDK修复策略还包 括第一签名文件,
    所述方法还包括:
    根据所述宿主信息,生成第一签名;
    根据所述第一签名,生成第一签名文件,所述第一签名文件包括所述第一签名。
  7. 根据权利要求1所述的方法,在所述按照预设的异常分级处理规则,基于所述目标SDK的每类所述SDK异常信息的所述异常影响因子,得到目标SDK修复策略之后,还包括:
    向渠道平台发送所述目标SDK修复策略;
    接收所述渠道平台反馈的所述目标SDK修复策略,反馈的所述目标SDK修复策略包括第二签名文件,所述第二签名文件包括第二签名,所述第二签名由所述渠道平台在扫描所述目标SDK修复策略并授权的情况下根据所述宿主信息生成;
    所述向所述用户终端下发所述目标SDK修复策略,包括:
    向所述用户终端下发所述渠道平台反馈的所述目标SDK修复策略。
  8. 根据权利要求1所述的方法,其中,所述目标SDK修复策略由所述用户终端建立的修复进程执行,所述修复进程与所述目标SDK的进程相互独立。
  9. 一种SDK的修复方法,应用于用户终端,所述方法包括:
    向修复平台提供软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息,以使所述修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略,所述目标SDK修复策略包括所述异常分级处理规则中与所述异常影响参数对应的异常级别的SDK修复策略,所述目标SDK与所述宿主信息指示的宿主程序和所述SDK信息指示的SDK版本对应,所述目标SDK的每个异常类型对应的所述异常影响参数根据所述SDK信息、所述宿主信息和每个异常类型的所述SDK异常信息得到;
    从修复平台获取所述目标SDK修复策略,并执行所述目标SDK修复策略修复所述目标SDK。
  10. 根据权利要求9所述的方法,其中,
    所述目标SDK的每个类型异常对应的所述异常影响参数利用所述目标SDK的每个异常类型对应的异常影响因子和产出比计算得到;所述目标SDK的每个异常类型对应的所述产出比根据所述目标SDK的每个异常类型的所述SDK异常信息的数量和所述SDK异常信息的总数量计算得到;所述目标SDK的每个异常类型对应的所述异常影响因子根据所述目标SDK的每个异常类型的所述SDK异常信息中的特征信息,以及所述特征信息的权重计算得到。
  11. 根据权利要求9所述的方法,其中,
    所述目标SDK修复策略对应的异常级别依据所述异常分级处理规则、目标异常类型和所述目标异常类型的所述异常影响参数得到,所述目标异常类型为值最大的所述异常影响参数对应的异常类型。
  12. 根据权利要求9所述的方法,其中,所述目标SDK修复策略包括以下一项或两项以上:
    第一文件,所述第一文件包括缓存数据清除指令,所述缓存数据清除指令用于指示清除所述目标SDK对应的至少一个缓存文件夹中的数据;
    第二文件,所述第二文件包括异常源阻断指令,所述异常源阻断指令用于指示将所述目标SDK的至少一种业务功能和/或子业务功能的开关状态设置为关闭状态;
    第三文件,所述第三文件包括补丁文件,所述补丁文件用于对所述目标SDK进行升级修复。
  13. 根据权利要求12所述的方法,其中,
    所述目标SDK修复策略包括所述第三文件,所述补丁文件由第三class文件转换而成,所述第三class文件包括第二class文件与第一class文件存在差异的class文件,所述第一class文件包括所述目标SDK的修复前SDK归档文件中的class文件,所述第二class文件包括所述目标SDK的修复后SDK归档文件中的class文件。
  14. 根据权利要求9所述的方法,其中,所述目标SDK修复策略还包括第一签名文件,所述第一签名文件包括第一签名,所述第一签名由所 述修复平台根据所述宿主信息生成,
    在所述从修复平台获取所述目标SDK修复策略之后,还包括:
    调用所述宿主信息指示的宿主程序对所述第一签名进行验签;
    所述执行所述目标SDK修复策略修复目标SDK,包括:
    在所述宿主信息指示的宿主程序对所述第一签名验签成功的情况下,执行所述目标SDK修复策略修复目标SDK。
  15. 根据权利要求9所述的方法,其中,所述目标SDK修复策略还包括第二签名文件,所述第二签名文件包括第二签名,所述第二签名由渠道平台在扫描所述目标SDK修复策略并确定授权的情况下根据所述宿主信息生成,
    在所述从修复平台获取所述目标SDK修复策略之后,还包括:
    调用所述宿主信息指示的宿主程序对所述第二签名进行验签;
    所述执行所述目标SDK修复策略修复目标SDK,包括:
    在所述宿主信息指示的宿主程序对所述第二签名验签成功的情况下,执行所述目标SDK修复策略修复目标SDK。
  16. 根据权利要求9至15中任意一项所述的方法,其中,所述从修复平台获取所述目标SDK修复策略,并执行所述目标SDK修复策略修复目标SDK,包括:
    建立修复进程,所述修复进程与所述目标SDK的进程相互独立;
    通过所述修复进程从所述修复平台获取所述目标SDK修复策略,并执行所述目标SDK修复策略修复所述目标SDK。
  17. 根据权利要求16所述的方法,其中,所述通过所述修复进程从所述修复平台获取所述目标SDK修复策略,并执行所述目标SDK修复策略修复所述目标SDK,包括:
    通过所述修复进程监听所述目标SDK的进程;
    在所述目标SDK修复完成之前,若监听到所述目标SDK的进程中止且所述目标SDK修复策略未下载完成,则通过所述修复进程继续下载所述目标SDK修复策略,直至所述目标SDK修复策略下载完成后中断所述修复进程,在监听到所述目标SDK的进程再次启动时,通过所述修复进 程执行所述目标SDK修复策略修复所述目标SDK;
    在所述目标SDK修复完成之前,若监听到所述目标SDK的进程中止且已开始执行所述目标SDK修复策略,则通过修复进程记录所述目标SDK的修复进度,在监听到所述目标SDK的进程再次启动时,通过所述修复进程基于所述修复进度继续修复所述目标SDK。
  18. 一种SDK的修复装置,应用于修复平台,所述装置包括:
    获取模块,用于获取软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息;
    计算模块,用于根据所述SDK信息、所述宿主信息和每个异常类型的所述SDK异常信息,得到目标SDK的每个异常类型对应的异常影响参数,所述目标SDK与所述宿主信息指示的宿主程序和所述SDK信息指示的SDK版本对应;
    策略配置模块,用于基于所述目标SDK的每个异常类型对应的所述异常影响参数和预设的异常分级处理规则,得到目标SDK修复策略,所述目标SDK修复策略包括所述异常分级处理规则中与所述异常影响参数对应的异常级别的SDK修复策略;
    下发模块,用于向所述用户终端下发所述目标SDK修复策略,以使用户终端执行所述目标SDK修复策略以修复所述目标SDK。
  19. 一种用户终端,包括:
    发送模块,用于向修复平台提供软件开发工具包SDK信息、宿主信息和不同异常类型的SDK异常信息,以使所述修复平台基于目标SDK的每个异常类型对应的异常影响参数和预设的异常分级处理规则得到目标SDK修复策略,所述目标SDK修复策略包括所述异常分级处理规则中与所述异常影响参数对应的异常级别的SDK修复策略,所述目标SDK与所述宿主信息指示的宿主程序和所述SDK信息指示的SDK版本对应,所述目标SDK的每个异常类型对应的所述异常影响参数根据所述SDK信息、所述宿主信息和每个异常类型的所述SDK异常信息得到;
    接收模块,用于从修复平台获取所述目标SDK修复策略;
    执行模块,用于执行所述目标SDK修复策略修复所述目标SDK。
  20. 一种电子设备,应用于修复平台,所述电子设备包括:处理器以及存储有计算机程序指令的存储器;
    所述处理器执行所述计算机程序指令时实现如权利要求1至8中任意一项所述的SDK的修复方法。
  21. 一种用户终端,包括:处理器以及存储有计算机程序指令的存储器;
    所述处理器执行所述计算机程序指令时实现如权利要求9至17中任意一项所述的SDK的修复方法。
  22. 一种SDK的修复系统,包括:
    修复平台,用于执行如权利要求1至8中任意一项所述的SDK的修复方法;
    用户终端,用于执行如权利要求9至17中任意一项所述的SDK的修复方法。
  23. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1至17中任意一项所述的SDK的修复方法。
PCT/CN2023/079809 2022-08-26 2023-03-06 Sdk的修复方法、装置、终端、设备、系统及介质 WO2024040916A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211035360.6A CN115543404A (zh) 2022-08-26 2022-08-26 Sdk的修复方法、装置、终端、设备、系统及介质
CN202211035360.6 2022-08-26

Publications (1)

Publication Number Publication Date
WO2024040916A1 true WO2024040916A1 (zh) 2024-02-29

Family

ID=84725156

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/079809 WO2024040916A1 (zh) 2022-08-26 2023-03-06 Sdk的修复方法、装置、终端、设备、系统及介质

Country Status (3)

Country Link
CN (1) CN115543404A (zh)
TW (1) TW202409825A (zh)
WO (1) WO2024040916A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543404A (zh) * 2022-08-26 2022-12-30 中国银联股份有限公司 Sdk的修复方法、装置、终端、设备、系统及介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050044389A1 (en) * 2003-07-01 2005-02-24 Oliphant Brett M. Multiple-path remediation
CN108121655A (zh) * 2016-11-30 2018-06-05 北京国双科技有限公司 一种异常处理方法及装置
CN113591079A (zh) * 2020-04-30 2021-11-02 中移互联网有限公司 获取异常应用安装包的方法、装置及电子设备
CN113961226A (zh) * 2021-10-20 2022-01-21 北京字节跳动网络技术有限公司 一种软件开发工具包修复方法、终端、服务器及设备
CN113986622A (zh) * 2021-10-11 2022-01-28 网易(杭州)网络有限公司 Sdk异常的自检方法、装置、介质和计算设备
CN115543404A (zh) * 2022-08-26 2022-12-30 中国银联股份有限公司 Sdk的修复方法、装置、终端、设备、系统及介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050044389A1 (en) * 2003-07-01 2005-02-24 Oliphant Brett M. Multiple-path remediation
CN108121655A (zh) * 2016-11-30 2018-06-05 北京国双科技有限公司 一种异常处理方法及装置
CN113591079A (zh) * 2020-04-30 2021-11-02 中移互联网有限公司 获取异常应用安装包的方法、装置及电子设备
CN113986622A (zh) * 2021-10-11 2022-01-28 网易(杭州)网络有限公司 Sdk异常的自检方法、装置、介质和计算设备
CN113961226A (zh) * 2021-10-20 2022-01-21 北京字节跳动网络技术有限公司 一种软件开发工具包修复方法、终端、服务器及设备
CN115543404A (zh) * 2022-08-26 2022-12-30 中国银联股份有限公司 Sdk的修复方法、装置、终端、设备、系统及介质

Also Published As

Publication number Publication date
CN115543404A (zh) 2022-12-30
TW202409825A (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
CN110879903A (zh) 证据存储方法、证据验证方法及装置、设备和介质
US11088828B2 (en) Blockchain-based data evidence storage method and apparatus
WO2024040916A1 (zh) Sdk的修复方法、装置、终端、设备、系统及介质
EP3934161A1 (en) Consensus method and data verification method, apparatus, and system of consortium blockchain
CN111586021B (zh) 一种远程办公业务授权方法、终端及系统
CN109145651B (zh) 一种数据处理方法及装置
CN115964684A (zh) 检测电子档案元数据真实性的方法、系统、设备及介质
CN112163412A (zh) 数据校验方法、装置、电子设备及存储介质
CN111277651B (zh) 一种远程投标方法及系统
CN110365634B (zh) 异常数据监控方法、装置、介质及电子设备
CN112448956A (zh) 一种短信验证码的权限处理方法、装置和计算机设备
CN115952560A (zh) 基于原笔迹签名校验电子档案文件真实性的方法、系统、设备及介质
CN111600701B (zh) 一种基于区块链的私钥存储方法、装置及存储介质
CN111586013B (zh) 网络入侵检测方法、装置、节点终端及存储介质
CN109522683A (zh) 软件溯源方法、系统、计算机设备及存储介质
CN108491734A (zh) 一种计算机软件在线调试方法
CN117201601A (zh) 物联网设备接入方法、装置、设备及存储介质
CN116450391A (zh) 一种故障定位方法、装置、设备及介质
WO2023273832A1 (zh) 数据验证的方法和装置
CN113360575B (zh) 联盟链中交易数据的监管方法、装置、设备及存储介质
CN115396206A (zh) 一种报文加密方法、报文解密方法、装置和程序产品
CN115543837A (zh) 软件测试方法、装置、电子设备及存储介质
CN112825093B (zh) 安全基线检查方法、主机、服务器、电子设备及存储介质
CN106791808A (zh) 一种视频加速器的检测方法及装置
WO2022239076A1 (ja) ファイル確認装置、ファイル確認方法、および、ファイル確認プログラム

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: 23856013

Country of ref document: EP

Kind code of ref document: A1