Application adaptability optimization method and system for a honkong system

By acquiring application data and historical records from the HarmonyOS system, predicting risky interfaces based on module function decoupling rules and interface rules, and formulating optimization strategies, the low operating efficiency and stability issues in existing technologies have been resolved, achieving precise code optimization and improving the operating efficiency and stability of applications.

CN120578577BActive Publication Date: 2026-04-17DERKEE INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DERKEE INFORMATION CO LTD
Filing Date
2025-05-30
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies in the HarmonyOS system lack dynamic decoupling analysis of functional modules and accurate prediction of interface risks, resulting in low operating efficiency and stability issues, making it difficult to cope with complex application scenarios.

Method used

By acquiring application data and historical operation records, the functional module architecture is determined based on module function decoupling rules. Combined with HarmonyOS system interface rules, risk interface information is predicted, and module optimization strategies are formulated to achieve precise code optimization.

Benefits of technology

It improves the operating efficiency and stability of applications on the HarmonyOS system and reduces potential operational risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120578577B_ABST
    Figure CN120578577B_ABST
Patent Text Reader

Abstract

This invention discloses an application adaptability optimization method and system for the HarmonyOS system. The method includes: acquiring application data and historical running records corresponding to the application to be optimized; determining the functional module architecture corresponding to the application to be optimized based on the application data and module function decoupling rules; predicting risk interface information corresponding to the application to be optimized based on the historical running records and the interface rules corresponding to the HarmonyOS system; and determining the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture. The module optimization strategy is used to limit the code optimization scheme corresponding to any functional module in the application to be optimized. Therefore, this invention can achieve precise code optimization based on functional decoupling and interface risk, improving the running efficiency and stability of applications in the HarmonyOS system and reducing potential running risks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an application compatibility optimization method and system for the HarmonyOS system. Background Technology

[0002] With the widespread adoption of HarmonyOS, developers are increasingly focusing on improving application efficiency and stability within the system through code optimization. Existing technologies typically involve collecting application data and historical execution records, employing static code analysis or general optimization tools to adjust the application architecture, and performing performance tuning based on standard interface call rules to meet system requirements. However, existing solutions lack dynamic decoupling analysis of functional modules and accurate prediction of interface risks. They struggle to effectively identify high-risk interfaces or adapt to HarmonyOS-specific interface rules. Commonly used optimization strategies cannot handle complex application scenarios, leading to low efficiency, stability issues, and potential operational risks, thus limiting application performance within HarmonyOS. Therefore, existing technologies have shortcomings that urgently need to be addressed. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide an application adaptability optimization method and system for the HarmonyOS system, which can achieve precise code optimization based on functional decoupling and interface risks, improve the running efficiency and stability of applications in the HarmonyOS system, and reduce potential running risks.

[0004] To address the aforementioned technical problems, the first aspect of this invention discloses an application compatibility optimization method for the HarmonyOS system, the method comprising:

[0005] Obtain application data and historical operation records for the application to be optimized;

[0006] Based on the application data and the module function decoupling rules, the functional module architecture corresponding to the application to be optimized is determined.

[0007] Based on the historical operation records and the corresponding interface rules of the HarmonyOS system, predict the risk interface information corresponding to the application to be optimized;

[0008] Based on the risk interface information and the functional module architecture, a module optimization strategy is determined for the application to be optimized; the module optimization strategy is used to limit the code optimization scheme for any functional module in the application to be optimized.

[0009] As an optional implementation, in the first aspect of the present invention, determining the functional module architecture corresponding to the application to be optimized based on the application data and module function decoupling rules includes:

[0010] Based on the identifier recognition rules, the code data of multiple different modules in the application data are determined;

[0011] For each piece of code data, the corresponding implementation function is determined based on the prediction algorithm;

[0012] Calculate the data similarity between this code data and each of the other code data;

[0013] Calculate the functional similarity between the implemented function of this code data and the implemented function of each other code data;

[0014] Based on the data similarity and the functional similarity, all the code data are clustered to obtain the functional module architecture corresponding to the application to be optimized.

[0015] As an optional implementation, in the first aspect of the present invention, determining the implementation function corresponding to the code data based on the prediction algorithm includes:

[0016] Based on annotation recognition rules, multiple annotation data corresponding to this code data are identified;

[0017] Based on similarity filtering rules, a core annotation set is selected from the multiple annotation data; the data similarity between any two annotation data in the core annotation set is greater than a first similarity threshold; the data similarity between any annotation data in the core annotation set and other annotation data not in the core annotation set is less than a second similarity threshold; the second similarity threshold is less than the first similarity threshold.

[0018] The core annotation set is input into the trained function prediction neural network to obtain the implementation function corresponding to the code data; the function prediction neural network is trained using a training dataset that includes multiple training code data and corresponding annotation data labels and implementation function labels.

[0019] As an optional implementation, in the first aspect of the present invention, the step of clustering all the code data based on the data similarity and the functional similarity to obtain the functional module architecture corresponding to the application to be optimized includes:

[0020] Based on the dynamic programming algorithm, all the code data are clustered and divided according to the data similarity and the functional similarity to obtain multiple code data sets;

[0021] The implementation function corresponding to all the code data in each of the code data sets is determined as the functional description of a functional module;

[0022] The data reference relationship between any code data in any two sets of code data is determined as the module connection information between the corresponding two functional modules;

[0023] The functional descriptions of all the functional modules and the corresponding module connection information are used to determine the functional module architecture corresponding to the application to be optimized.

[0024] As an optional implementation, in the first aspect of the invention, the dynamic programming algorithm is used to cluster all the code data according to the data similarity and the functional similarity to obtain multiple code data sets, including:

[0025] The objective function is set to minimize the total number of sets of all code data obtained from the partitioning.

[0026] The constraints include:

[0027] The data similarity between any two pieces of code data in each code dataset is greater than a third similarity threshold;

[0028] The functional similarity between any two pieces of code data in each code dataset is greater than a fourth similarity threshold;

[0029] The data similarity between any two sets of code data belonging to different code data sets is less than a fifth similarity threshold; the fifth similarity threshold is less than the third similarity threshold.

[0030] The functional similarity between any two sets of code data belonging to different code data sets is less than a sixth similarity threshold; the sixth similarity threshold is less than the fourth similarity threshold.

[0031] Based on the dynamic programming algorithm, all the code data are iteratively clustered and partitioned according to the objective function and the constraints until the optimal partitioning result is obtained, so as to obtain multiple code data sets.

[0032] As an optional implementation, in the first aspect of the present invention, the implemented functions include at least one of screen data processing, sensor data processing, display data processing, processor instruction processing, thermal management function, power on / off processing, encryption processing, and communication data processing.

[0033] As an optional implementation, in the first aspect of the present invention, predicting the risk interface information corresponding to the application to be optimized based on the historical operation records and the interface rules corresponding to the HarmonyOS system includes:

[0034] Based on the data matching algorithm, the running error records in the historical running records are identified;

[0035] By determining the error reference interface information corresponding to each runtime error record, a set of error interfaces is obtained;

[0036] Identify all the referenceable interfaces corresponding to the preset HarmonyOS system to obtain the system interface set;

[0037] The intersection of the error interface set and the system interface set is calculated to obtain the risk interface information corresponding to the application to be optimized.

[0038] As an optional implementation, in the first aspect of the present invention, determining the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture includes:

[0039] Based on historical interface reference data, determine the historical code module corresponding to each risk interface in the risk interface information;

[0040] For each functional module in the functional module architecture, the average information similarity between the module information corresponding to the functional module and the module information of each historical code module is calculated to obtain the risk parameter corresponding to the functional module; the module information includes the functional description and the module connection information;

[0041] From all the functional modules in the functional module architecture, the functional modules whose risk parameters are greater than a preset parameter threshold are selected to obtain the risk functional modules;

[0042] The risk interfaces corresponding to all historical code modules whose information similarity to each risk function module is greater than a preset seventh similarity threshold are determined as the interface information to be optimized for each risk function module.

[0043] Based on preset code optimization rules, the code optimization scheme corresponding to the interface information to be optimized is determined, so as to obtain the code optimization scheme corresponding to each risk function module.

[0044] A second aspect of this invention discloses an application compatibility optimization system for the HarmonyOS system, the system comprising:

[0045] The acquisition module is used to acquire application data and historical running records corresponding to the application to be optimized.

[0046] The determination module is used to determine the functional module architecture corresponding to the application to be optimized based on the application data and the module function decoupling rules.

[0047] The prediction module is used to predict the risk interface information of the application to be optimized based on the historical operation records and the corresponding interface rules of the HarmonyOS system.

[0048] The optimization module is used to determine the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture; the module optimization strategy is used to limit the code optimization scheme corresponding to any functional module in the application to be optimized.

[0049] As an optional implementation, in a second aspect of the invention, the determining module determines the specific method of the functional module architecture corresponding to the application to be optimized based on the application data and module function decoupling rules, including:

[0050] Based on the identifier recognition rules, the code data of multiple different modules in the application data are determined;

[0051] For each piece of code data, the corresponding implementation function is determined based on the prediction algorithm;

[0052] Calculate the data similarity between this code data and each of the other code data;

[0053] Calculate the functional similarity between the implemented function of this code data and the implemented function of each other code data;

[0054] Based on the data similarity and the functional similarity, all the code data are clustered to obtain the functional module architecture corresponding to the application to be optimized.

[0055] As an optional implementation, in the second aspect of the invention, the determining module determines the specific method of implementing the function corresponding to the code data based on a prediction algorithm, including:

[0056] Based on annotation recognition rules, multiple annotation data corresponding to this code data are identified;

[0057] Based on similarity filtering rules, a core annotation set is selected from the multiple annotation data; the data similarity between any two annotation data in the core annotation set is greater than a first similarity threshold; the data similarity between any annotation data in the core annotation set and other annotation data not in the core annotation set is less than a second similarity threshold; the second similarity threshold is less than the first similarity threshold.

[0058] The core annotation set is input into the trained function prediction neural network to obtain the implementation function corresponding to the code data; the function prediction neural network is trained using a training dataset that includes multiple training code data and corresponding annotation data labels and implementation function labels.

[0059] As an optional implementation, in a second aspect of the invention, the determining module clusters all the code data based on the data similarity and the functional similarity to obtain the specific method of the functional module architecture corresponding to the application to be optimized, including:

[0060] Based on the dynamic programming algorithm, all the code data are clustered and divided according to the data similarity and the functional similarity to obtain multiple code data sets;

[0061] The implementation function corresponding to all the code data in each of the code data sets is determined as the functional description of a functional module;

[0062] The data reference relationship between any code data in any two sets of code data is determined as the module connection information between the corresponding two functional modules;

[0063] The functional descriptions of all the functional modules and the corresponding module connection information are used to determine the functional module architecture corresponding to the application to be optimized.

[0064] As an optional implementation, in a second aspect of the invention, the determining module, based on a dynamic programming algorithm, clusters all the code data according to the data similarity and the functional similarity to obtain multiple code data sets. The specific method includes:

[0065] The objective function is set to minimize the total number of sets of all code data obtained from the partitioning.

[0066] The constraints include:

[0067] The data similarity between any two pieces of code data in each code dataset is greater than a third similarity threshold;

[0068] The functional similarity between any two pieces of code data in each code dataset is greater than a fourth similarity threshold;

[0069] The data similarity between any two sets of code data belonging to different code data sets is less than a fifth similarity threshold; the fifth similarity threshold is less than the third similarity threshold.

[0070] The functional similarity between any two sets of code data belonging to different code data sets is less than a sixth similarity threshold; the sixth similarity threshold is less than the fourth similarity threshold.

[0071] Based on the dynamic programming algorithm, all the code data are iteratively clustered and partitioned according to the objective function and the constraints until the optimal partitioning result is obtained, so as to obtain multiple code data sets.

[0072] As an optional implementation, in a second aspect of the present invention, the implemented functions include at least one of screen data processing, sensor data processing, display data processing, processor instruction processing, thermal management function, power on / off processing, encryption processing, and communication data processing.

[0073] As an optional implementation, in the second aspect of the present invention, the specific method by which the prediction module predicts the risk interface information corresponding to the application to be optimized based on the historical operation records and the interface rules corresponding to the HarmonyOS system includes:

[0074] Based on the data matching algorithm, the running error records in the historical running records are identified;

[0075] By determining the error reference interface information corresponding to each runtime error record, a set of error interfaces is obtained;

[0076] Identify all the referenceable interfaces corresponding to the preset HarmonyOS system to obtain the system interface set;

[0077] The intersection of the error interface set and the system interface set is calculated to obtain the risk interface information corresponding to the application to be optimized.

[0078] As an optional implementation, in a second aspect of the invention, the optimization module determines the specific method of the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture, including:

[0079] Based on historical interface reference data, determine the historical code module corresponding to each risk interface in the risk interface information;

[0080] For each functional module in the functional module architecture, the average information similarity between the module information corresponding to the functional module and the module information of each historical code module is calculated to obtain the risk parameter corresponding to the functional module; the module information includes the functional description and the module connection information;

[0081] From all the functional modules in the functional module architecture, the functional modules whose risk parameters are greater than a preset parameter threshold are selected to obtain the risk functional modules;

[0082] The risk interfaces corresponding to all historical code modules whose information similarity to each risk function module is greater than a preset seventh similarity threshold are determined as the interface information to be optimized for each risk function module.

[0083] Based on preset code optimization rules, the code optimization scheme corresponding to the interface information to be optimized is determined, so as to obtain the code optimization scheme corresponding to each risk function module.

[0084] A third aspect of this invention discloses another application compatibility optimization system for the HarmonyOS system, the system comprising:

[0085] Memory containing executable program code;

[0086] A processor coupled to the memory;

[0087] The processor calls the executable program code stored in the memory to execute some or all of the steps in the application adaptability optimization method for HarmonyOS disclosed in the first aspect of the present invention.

[0088] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked, are used to execute some or all of the steps in the application adaptability optimization method for the HarmonyOS system disclosed in the first aspect of the present invention.

[0089] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0090] This invention obtains application data and historical operation records of the application to be optimized, determines the functional module architecture based on module function decoupling rules, and predicts risk interface information by combining historical operation records and HarmonyOS system interface rules. Based on the risk interface information and functional module architecture, it formulates module optimization strategies, thereby achieving precise code optimization based on functional decoupling and interface risks, improving the application's operating efficiency and stability in HarmonyOS system, and reducing potential operational risks. Attached Figure Description

[0091] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0092] Figure 1 This is a flowchart illustrating an application compatibility optimization method for the HarmonyOS system disclosed in an embodiment of the present invention.

[0093] Figure 2 This is a schematic diagram of the structure of an application adaptability optimization system for the HarmonyOS system disclosed in an embodiment of the present invention.

[0094] Figure 3 This is a schematic diagram of another application adaptability optimization system for the HarmonyOS system disclosed in an embodiment of the present invention. Detailed Implementation

[0095] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0096] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0097] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0098] This invention discloses an application adaptability optimization method and system for the HarmonyOS system. By acquiring application data and historical operation records of the application to be optimized, the functional module architecture is determined based on module function decoupling rules. Furthermore, risk interface information is predicted by combining historical operation records and HarmonyOS interface rules. Based on the risk interface information and functional module architecture, a module optimization strategy is formulated. This enables precise code optimization based on functional decoupling and interface risks, improving the application's operational efficiency and stability within the HarmonyOS system and reducing potential operational risks. Detailed explanations follow.

[0099] Example 1

[0100] Please see Figure 1 , Figure 1This is a flowchart illustrating an application adaptability optimization method for the HarmonyOS system disclosed in an embodiment of the present invention. Figure 1 The application compatibility optimization method described for HarmonyOS can be applied to data processing systems / data processing devices / data processing servers (wherein, the server includes local processing servers or cloud processing servers). For example... Figure 1 As shown, the application compatibility optimization method for the HarmonyOS system may include the following operations:

[0101] 101. Obtain the application data and historical running records corresponding to the application to be optimized.

[0102] 102. Based on the application data and the module function decoupling rules, determine the functional module architecture corresponding to the application to be optimized.

[0103] 103. Based on historical operation records and the corresponding interface rules of the HarmonyOS system, predict the risk interface information of the application to be optimized.

[0104] 104. Based on the risk interface information and functional module architecture, determine the module optimization strategy corresponding to the application to be optimized.

[0105] Optionally, the module optimization strategy is used to limit the code optimization scheme for any functional module in the application to be optimized.

[0106] As can be seen, the above-described embodiments of the invention obtain application data and historical operation records of the application to be optimized, determine the functional module architecture based on module function decoupling rules, predict risk interface information by combining historical operation records and HarmonyOS system interface rules, and formulate module optimization strategies based on risk interface information and functional module architecture. This enables precise code optimization based on functional decoupling and interface risks, improves the operating efficiency and stability of the application in HarmonyOS system, and reduces potential operating risks.

[0107] As an optional embodiment, the step above, determining the functional module architecture corresponding to the application to be optimized based on application data and module function decoupling rules, includes:

[0108] Based on identifier recognition rules, the code data of multiple different modules in the application data is identified;

[0109] For each piece of code data, the corresponding implementation function is determined based on the prediction algorithm;

[0110] Calculate the data similarity between this code data and every other code data;

[0111] Calculate the functional similarity between the implemented functionality of this code data and the implemented functionality of every other code data;

[0112] All code data are clustered based on data similarity and functional similarity to obtain the functional module architecture corresponding to the application to be optimized.

[0113] As can be seen, through the above optional embodiments, code data of multiple modules is extracted from application data based on identifier recognition rules, the implementation function of each code data is determined using prediction algorithms, the data similarity and functional similarity between code data are calculated, and clustering is performed based on the two to form the functional module architecture of the application to be optimized. This achieves accurate module architecture determination based on code and functional features, assists in accurate code optimization based on functional decoupling and interface risks, improves the running efficiency and stability of the application in the HarmonyOS system, and reduces potential running risks.

[0114] As an optional embodiment, the step above, determining the implementation function corresponding to the code data based on the prediction algorithm, includes:

[0115] Based on annotation recognition rules, multiple annotation data corresponding to this code data are identified;

[0116] Based on similarity filtering rules, a core annotation set is selected from multiple annotation data; optionally, the data similarity between any two annotation data in the core annotation set is greater than a first similarity threshold; the data similarity between any annotation data in the core annotation set and annotation data in other non-core annotation sets is less than a second similarity threshold; the second similarity threshold is less than the first similarity threshold.

[0117] The core annotation set is input into the trained function prediction neural network to obtain the implementation function corresponding to the code data; the function prediction neural network is trained on a training dataset that includes multiple training code data and corresponding annotation data and implementation function annotations.

[0118] As can be seen, through the above optional embodiments, multiple annotation data are extracted from the code data based on annotation recognition rules, and a core annotation set is selected using similarity filtering rules. The core annotation set is then input into a trained function prediction neural network to determine the implemented function of the code data, thereby achieving accurate function prediction based on core annotations and neural networks. This assists in achieving accurate code optimization based on function decoupling and interface risks, improving the operating efficiency and stability of applications in the HarmonyOS system, and reducing potential operating risks.

[0119] As an optional embodiment, the above steps, including clustering all code data based on data similarity and functional similarity to obtain the functional module architecture corresponding to the application to be optimized, include:

[0120] Based on the dynamic programming algorithm, all code data are clustered according to data similarity and functional similarity to obtain multiple code data sets;

[0121] The implementation functions corresponding to all code data in each code data set are defined as the functional description of a functional module;

[0122] The data reference relationship between any code data in any two code data sets is determined as the module connection information between the corresponding two functional modules;

[0123] The functional descriptions of all functional modules and the corresponding module connection information are used to determine the functional module architecture of the application to be optimized.

[0124] As can be seen, through the above optional embodiments, code data is clustered and divided into multiple code data sets by using dynamic programming algorithms based on data similarity and functional similarity. The implemented functions of the code data in each set are determined as the functional descriptions of functional modules, and the data reference relationships between code data in the sets are determined as module connection information. The functional module architecture of the application to be optimized is formed by combining these elements, thereby achieving accurate module architecture prediction based on similarity and reference relationships. This assists in achieving accurate code optimization based on functional decoupling and interface risks, improving the running efficiency and stability of the application in the HarmonyOS system, and reducing potential running risks.

[0125] As an optional embodiment, in the above steps, based on the dynamic programming algorithm, all code data is clustered and divided according to data similarity and functional similarity to obtain multiple code data sets, including:

[0126] The objective function is set to minimize the total number of sets of all code data obtained from the partitioning.

[0127] The constraints include:

[0128] The data similarity between any two code data in each code dataset is greater than the third similarity threshold;

[0129] The functional similarity between any two code data in each code dataset is greater than the fourth similarity threshold;

[0130] The data similarity between any two code data belonging to different code data sets is less than the fifth similarity threshold; optionally, the fifth similarity threshold is less than the third similarity threshold.

[0131] The functional similarity between any two code data belonging to different code data sets is less than the sixth similarity threshold; optionally, the sixth similarity threshold is less than the fourth similarity threshold.

[0132] Based on the dynamic programming algorithm, all code data are iteratively clustered and partitioned according to the objective function and constraints until the optimal partitioning result is obtained, resulting in multiple code data sets.

[0133] As can be seen, through the above optional embodiments, by setting an objective function to minimize the total number of code data sets, and by using constraints to ensure that the data similarity and functional similarity of code data within the set meet threshold rules, the code data is iteratively clustered based on a dynamic programming algorithm to obtain the best partitioning result. This achieves accurate code module clustering based on multi-dimensional similarity constraints, improves the efficiency and accuracy of application functional module architecture prediction, assists in achieving accurate code optimization based on functional decoupling and interface risks, improves the operating efficiency and stability of applications in the HarmonyOS system, and reduces potential operating risks.

[0134] As an optional embodiment, the functions implemented in the above steps include at least one of screen data processing, sensor data processing, display data processing, processor instruction processing, thermal management function, power on / off processing, encryption processing, and communication data processing.

[0135] As can be seen, the above optional embodiments limit the types of devices that can implement the functions, effectively characterize device features, assist in achieving precise code optimization based on functional decoupling and interface risks, improve the operating efficiency and stability of applications in the HarmonyOS system, and reduce potential operating risks.

[0136] As an optional embodiment, the step above, predicting the risk interface information corresponding to the application to be optimized based on historical operation records and the corresponding interface rules of the HarmonyOS system, includes:

[0137] Based on the data matching algorithm, identify the runtime error records in the historical running records;

[0138] To determine the error reference interface information corresponding to each runtime error record, a set of error interfaces is obtained.

[0139] Identify all the referenceable interfaces corresponding to the preset HarmonyOS system to obtain the system interface set;

[0140] The intersection of the error interface set and the system interface set is calculated to obtain the risk interface information corresponding to the application to be optimized.

[0141] As can be seen, through the above optional embodiments, by identifying the runtime error records in the historical running records based on the data matching algorithm and extracting the interface information referenced when the error occurred to form an error interface set, the risk interface information is obtained by taking the intersection with the system interface set of all referenceable interfaces in the HarmonyOS system. This achieves accurate risk interface identification based on error records and system interface matching, assists in achieving accurate code optimization based on functional decoupling and interface risk, improves the running efficiency and stability of applications in the HarmonyOS system, and reduces potential running risks.

[0142] As an optional embodiment, the step above, determining the module optimization strategy corresponding to the application to be optimized based on the risk interface information and functional module architecture, includes:

[0143] Based on historical interface reference data, determine the historical code module corresponding to each risk interface in the risk interface information;

[0144] For each functional module in the functional module architecture, calculate the average information similarity between the module information corresponding to the functional module and the module information of each historical code module to obtain the risk parameter corresponding to the functional module; optionally, the module information includes functional description and module connection information.

[0145] From all functional modules in the functional module architecture, select those with risk parameters greater than a preset threshold to obtain risk functional modules;

[0146] The risk interfaces corresponding to all historical code modules whose information similarity to each risk function module is greater than the preset seventh similarity threshold are identified as the interface information to be optimized for each risk function module.

[0147] Based on preset code optimization rules, the code optimization scheme corresponding to the interface information to be optimized is determined, so as to obtain the code optimization scheme corresponding to each risky functional module.

[0148] Specifically, code optimization rules can be pre-defined code optimization strategies for specific interfaces, or code optimization recommendations based on prediction algorithms. For example, existing code-assisted prediction algorithms can make code optimization recommendations based on information about the risky interfaces to be optimized.

[0149] Optionally, the code optimization scheme in this invention can be an optimization of code standards, or an optimization of specific code modules, programming ideas, or computational logic.

[0150] As can be seen, through the above optional embodiments, by determining the historical code modules corresponding to risky interfaces based on historical interface reference data, calculating the average similarity between the module information of each functional module in the functional module architecture and the historical code module information as a risk parameter, screening risky functional modules whose risk parameters exceed the threshold, and extracting the risky interfaces corresponding to the historical code modules whose information similarity exceeds the threshold as interface information to be optimized, and generating code optimization schemes based on preset code optimization rules, a precise optimization scheme based on historical interface and module similarity can be formulated, thereby improving the operational stability and efficiency of the application to be optimized and reducing the risk of interface failure.

[0151] Example 2

[0152] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of an application adaptability optimization system for the HarmonyOS system disclosed in an embodiment of the present invention. Figure 2 The described application compatibility optimization system for HarmonyOS can be applied to data processing systems / data processing devices / data processing servers (including local processing servers or cloud processing servers). For example... Figure 2 As shown, the application compatibility optimization system for HarmonyOS may include:

[0153] The acquisition module 201 is used to acquire application data and historical running records corresponding to the application to be optimized.

[0154] Module 202 is used to determine the functional module architecture corresponding to the application to be optimized based on application data and module function decoupling rules.

[0155] The prediction module 203 is used to predict the risk interface information of the application to be optimized based on historical operation records and the corresponding interface rules of the HarmonyOS system.

[0156] Optimization module 204 is used to determine the module optimization strategy corresponding to the application to be optimized based on the risk interface information and functional module architecture.

[0157] Optionally, the module optimization strategy is used to limit the code optimization scheme for any functional module in the application to be optimized.

[0158] As can be seen, the above-described embodiments of the invention obtain application data and historical operation records of the application to be optimized, determine the functional module architecture based on module function decoupling rules, predict risk interface information by combining historical operation records and HarmonyOS system interface rules, and formulate module optimization strategies based on risk interface information and functional module architecture. This enables precise code optimization based on functional decoupling and interface risks, improves the operating efficiency and stability of the application in HarmonyOS system, and reduces potential operating risks.

[0159] As an optional implementation, the determining module determines the specific method of the functional module architecture corresponding to the application to be optimized based on application data and module function decoupling rules, including:

[0160] Based on identifier recognition rules, the code data of multiple different modules in the application data is identified;

[0161] For each piece of code data, the corresponding implementation function is determined based on the prediction algorithm;

[0162] Calculate the data similarity between this code data and every other code data;

[0163] Calculate the functional similarity between the implemented functionality of this code data and the implemented functionality of every other code data;

[0164] All code data are clustered based on data similarity and functional similarity to obtain the functional module architecture corresponding to the application to be optimized.

[0165] As can be seen, through the above optional embodiments, code data of multiple modules is extracted from application data based on identifier recognition rules, the implementation function of each code data is determined using prediction algorithms, the data similarity and functional similarity between code data are calculated, and clustering is performed based on the two to form the functional module architecture of the application to be optimized. This achieves accurate module architecture determination based on code and functional features, assists in accurate code optimization based on functional decoupling and interface risks, improves the running efficiency and stability of the application in the HarmonyOS system, and reduces potential running risks.

[0166] As an optional embodiment, the determining module determines the specific way of implementing the function corresponding to the code data based on a prediction algorithm, including:

[0167] Based on annotation recognition rules, multiple annotation data corresponding to this code data are identified;

[0168] Based on similarity filtering rules, a core annotation set is selected from multiple annotation data; optionally, the data similarity between any two annotation data in the core annotation set is greater than a first similarity threshold; the data similarity between any annotation data in the core annotation set and annotation data in other non-core annotation sets is less than a second similarity threshold; the second similarity threshold is less than the first similarity threshold.

[0169] The core annotation set is input into the trained function prediction neural network to obtain the implementation function corresponding to the code data; the function prediction neural network is trained on a training dataset that includes multiple training code data and corresponding annotation data and implementation function annotations.

[0170] As can be seen, through the above optional embodiments, multiple annotation data are extracted from the code data based on annotation recognition rules, and a core annotation set is selected using similarity filtering rules. The core annotation set is then input into a trained function prediction neural network to determine the implemented function of the code data, thereby achieving accurate function prediction based on core annotations and neural networks. This assists in achieving accurate code optimization based on function decoupling and interface risks, improving the operating efficiency and stability of applications in the HarmonyOS system, and reducing potential operating risks.

[0171] As an optional implementation, the specific method for determining the functional module architecture of the application to be optimized by clustering all code data based on data similarity and functional similarity includes:

[0172] Based on the dynamic programming algorithm, all code data are clustered according to data similarity and functional similarity to obtain multiple code data sets;

[0173] The implementation functions corresponding to all code data in each code data set are defined as the functional description of a functional module;

[0174] The data reference relationship between any code data in any two code data sets is determined as the module connection information between the corresponding two functional modules;

[0175] The functional descriptions of all functional modules and the corresponding module connection information are used to determine the functional module architecture of the application to be optimized.

[0176] As can be seen, through the above optional embodiments, code data is clustered and divided into multiple code data sets by using dynamic programming algorithms based on data similarity and functional similarity. The implemented functions of the code data in each set are determined as the functional descriptions of functional modules, and the data reference relationships between code data in the sets are determined as module connection information. The functional module architecture of the application to be optimized is formed by combining these elements, thereby achieving accurate module architecture prediction based on similarity and reference relationships. This assists in achieving accurate code optimization based on functional decoupling and interface risks, improving the running efficiency and stability of the application in the HarmonyOS system, and reducing potential running risks.

[0177] As an optional implementation, the determination module uses a dynamic programming algorithm to cluster all code data based on data similarity and functional similarity to obtain multiple code data sets. Specific methods for this include:

[0178] The objective function is set to minimize the total number of sets of all code data obtained from the partitioning.

[0179] The constraints include:

[0180] The data similarity between any two code data in each code dataset is greater than the third similarity threshold;

[0181] The functional similarity between any two code data in each code dataset is greater than the fourth similarity threshold;

[0182] The data similarity between any two code data belonging to different code data sets is less than the fifth similarity threshold; optionally, the fifth similarity threshold is less than the third similarity threshold.

[0183] The functional similarity between any two code data belonging to different code data sets is less than the sixth similarity threshold; optionally, the sixth similarity threshold is less than the fourth similarity threshold.

[0184] Based on the dynamic programming algorithm, all code data are iteratively clustered and partitioned according to the objective function and constraints until the optimal partitioning result is obtained, resulting in multiple code data sets.

[0185] As can be seen, through the above optional embodiments, by setting an objective function to minimize the total number of code data sets, and by using constraints to ensure that the data similarity and functional similarity of code data within the set meet threshold rules, the code data is iteratively clustered based on a dynamic programming algorithm to obtain the best partitioning result. This achieves accurate code module clustering based on multi-dimensional similarity constraints, improves the efficiency and accuracy of application functional module architecture prediction, assists in achieving accurate code optimization based on functional decoupling and interface risks, improves the operating efficiency and stability of applications in the HarmonyOS system, and reduces potential operating risks.

[0186] As an optional embodiment, the functions include at least one of screen data processing, sensor data processing, display data processing, processor instruction processing, thermal management functions, power on / off processing, encryption processing, and communication data processing.

[0187] As can be seen, the above optional embodiments limit the types of devices that can implement the functions, effectively characterize device features, assist in achieving precise code optimization based on functional decoupling and interface risks, improve the operating efficiency and stability of applications in the HarmonyOS system, and reduce potential operating risks.

[0188] As an optional embodiment, the prediction module predicts the specific method by which it predicts the risk interface information corresponding to the application to be optimized based on historical operation records and the corresponding interface rules of the HarmonyOS system, including:

[0189] Based on the data matching algorithm, identify the runtime error records in the historical running records;

[0190] To determine the error reference interface information corresponding to each runtime error record, a set of error interfaces is obtained.

[0191] Identify all the referenceable interfaces corresponding to the preset HarmonyOS system to obtain the system interface set;

[0192] The intersection of the error interface set and the system interface set is calculated to obtain the risk interface information corresponding to the application to be optimized.

[0193] As can be seen, through the above optional embodiments, by identifying the runtime error records in the historical running records based on the data matching algorithm and extracting the interface information referenced when the error occurred to form an error interface set, the risk interface information is obtained by taking the intersection with the system interface set of all referenceable interfaces in the HarmonyOS system. This achieves accurate risk interface identification based on error records and system interface matching, assists in achieving accurate code optimization based on functional decoupling and interface risk, improves the running efficiency and stability of applications in the HarmonyOS system, and reduces potential running risks.

[0194] As an optional implementation, the optimization module determines the specific method of the module optimization strategy corresponding to the application to be optimized based on the risk interface information and functional module architecture, including:

[0195] Based on historical interface reference data, determine the historical code module corresponding to each risk interface in the risk interface information;

[0196] For each functional module in the functional module architecture, calculate the average information similarity between the module information corresponding to the functional module and the module information of each historical code module to obtain the risk parameter corresponding to the functional module; optionally, the module information includes functional description and module connection information.

[0197] From all functional modules in the functional module architecture, select those with risk parameters greater than a preset threshold to obtain risk functional modules;

[0198] The risk interfaces corresponding to all historical code modules whose information similarity to each risk function module is greater than the preset seventh similarity threshold are identified as the interface information to be optimized for each risk function module.

[0199] Based on preset code optimization rules, the code optimization scheme corresponding to the interface information to be optimized is determined, so as to obtain the code optimization scheme corresponding to each risky functional module.

[0200] As can be seen, through the above optional embodiments, by determining the historical code modules corresponding to risky interfaces based on historical interface reference data, calculating the average similarity between the module information of each functional module in the functional module architecture and the historical code module information as a risk parameter, screening risky functional modules whose risk parameters exceed the threshold, and extracting the risky interfaces corresponding to the historical code modules whose information similarity exceeds the threshold as interface information to be optimized, and generating code optimization schemes based on preset code optimization rules, a precise optimization scheme based on historical interface and module similarity can be formulated, thereby improving the operational stability and efficiency of the application to be optimized and reducing the risk of interface failure.

[0201] Example 3

[0202] Please see Figure 3 , Figure 3 This is another application compatibility optimization system for the HarmonyOS system disclosed in the embodiments of the present invention. Figure 3 The described application compatibility optimization system for HarmonyOS is applied to data processing systems / data processing devices / data processing servers (wherein, the server includes local processing servers or cloud processing servers). For example... Figure 3 As shown, the application compatibility optimization system for HarmonyOS may include:

[0203] Memory 301 storing executable program code;

[0204] Processor 302 coupled to memory 301;

[0205] The processor 302 calls the executable program code stored in the memory 301 to execute the steps of the application adaptability optimization method for the HarmonyOS system described in Embodiment 1.

[0206] Example 4

[0207] This invention discloses a computer read storage medium that stores a computer program for electronic data interchange, wherein the computer program causes a computer to execute the steps of the application adaptation optimization method for the HarmonyOS system described in Embodiment 1.

[0208] Example 5

[0209] This invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps of the application adaptation optimization method for HarmonyOS described in Embodiment 1.

[0210] The foregoing has described specific embodiments of this specification; other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than those shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily have to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0211] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0212] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0213] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0214] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0215] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0216] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0217] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0218] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0219] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0220] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0221] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0222] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0223] Finally, it should be noted that the application compatibility optimization method and system for the HarmonyOS system disclosed in the embodiments of this invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this invention.

Claims

1. An application adaptability optimization method for a HongMeng system, characterized in that, The method includes: Obtain application data and historical operation records for the application to be optimized; Based on the application data and the module function decoupling rules, the functional module architecture corresponding to the application to be optimized is determined, including: Based on the identifier recognition rules, the code data of multiple different modules in the application data are determined; For each piece of code data, the corresponding implementation function is determined based on the prediction algorithm; Calculate the data similarity between this code data and each of the other code data; Calculate the functional similarity between the implemented function of this code data and the implemented function of each other code data; Based on the dynamic programming algorithm, all the code data are clustered according to the data similarity and the functional similarity to obtain multiple code data sets; The implementation function corresponding to all the code data in each of the code data sets is determined as the functional description of a functional module; The data reference relationship between any code data in any two sets of code data is determined as the module connection information between the corresponding two functional modules; The functional descriptions of all the functional modules and the connection information between them are determined as the functional module architecture corresponding to the application to be optimized; Based on the historical operation records and the corresponding interface rules of the HarmonyOS system, the risk interface information corresponding to the application to be optimized is predicted, including: Based on the data matching algorithm, the running error records in the historical running records are identified; By determining the error reference interface information corresponding to each runtime error record, a set of error interfaces is obtained; Identify all the referenceable interfaces corresponding to the preset HarmonyOS system to obtain the system interface set; Calculate the intersection of the error interface set and the system interface set to obtain the risk interface information corresponding to the application to be optimized; Based on the risk interface information and the functional module architecture, a module optimization strategy is determined for the application to be optimized; the module optimization strategy is used to limit the code optimization scheme for any functional module in the application to be optimized. 2.The application adaptability optimization method for a Hong Meng system according to claim 1, characterized in that, The process of determining the implementation function corresponding to the code data based on the prediction algorithm includes: Based on annotation recognition rules, multiple annotation data corresponding to this code data are identified; Based on similarity filtering rules, a core annotation set is selected from the multiple annotation data; the data similarity between any two annotation data in the core annotation set is greater than a first similarity threshold; the data similarity between any annotation data in the core annotation set and other annotation data not in the core annotation set is less than a second similarity threshold; the second similarity threshold is less than the first similarity threshold. The core annotation set is input into the trained function prediction neural network to obtain the implementation function corresponding to the code data; the function prediction neural network is trained using a training dataset that includes multiple training code data and corresponding annotation data annotations and implementation function annotations. 3.The application adaptability optimization method for a Hong Meng system according to claim 1, characterized in that, The dynamic programming algorithm is used to cluster all the code data according to the data similarity and the functional similarity, resulting in multiple code data sets, including: The objective function is set to minimize the total number of sets of all code data obtained from the partitioning. The constraints include: The data similarity between any two pieces of code data in each code dataset is greater than a third similarity threshold; The functional similarity between any two pieces of code data in each code dataset is greater than a fourth similarity threshold; The data similarity between any two sets of code data belonging to different code data sets is less than a fifth similarity threshold; the fifth similarity threshold is less than the third similarity threshold. The functional similarity between any two sets of code data belonging to different code data sets is less than a sixth similarity threshold; the sixth similarity threshold is less than the fourth similarity threshold. Based on the dynamic programming algorithm, all the code data are iteratively clustered and partitioned according to the objective function and the constraints until the optimal partitioning result is obtained, so as to obtain multiple code data sets. 4.The application adaptability optimization method for a Hong Meng system according to claim 1, characterized in that, The implemented functions include at least one of screen data processing, sensor data processing, display data processing, processor instruction processing, thermal management, power on / off processing, encryption processing, and communication data processing. 5.The application adaptability optimization method for a Hong Meng system according to claim 1, characterized in that, The step of determining the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture includes: Based on historical interface reference data, determine the historical code module corresponding to each risk interface in the risk interface information; For each functional module in the functional module architecture, the average information similarity between the module information corresponding to the functional module and the module information of each historical code module is calculated to obtain the risk parameter corresponding to the functional module; the module information includes the functional description and the module connection information; From all the functional modules in the functional module architecture, the functional modules whose risk parameters are greater than a preset parameter threshold are selected to obtain the risk functional modules; The risk interfaces corresponding to all historical code modules whose information similarity to each risk function module is greater than a preset seventh similarity threshold are determined as the interface information to be optimized for each risk function module. Based on preset code optimization rules, the code optimization scheme corresponding to the interface information to be optimized is determined, so as to obtain the code optimization scheme corresponding to each risk function module.

6. An application adaptability optimization system for a HongMeng system, comprising: The system executes the application adaptability optimization method for HarmonyOS as described in any one of claims 1-5, and the system includes: The acquisition module is used to acquire application data and historical running records of the application to be optimized. The determination module is used to determine the functional module architecture corresponding to the application to be optimized based on the application data and the module function decoupling rules. The prediction module is used to predict the risk interface information of the application to be optimized based on the historical operation records and the corresponding interface rules of the HarmonyOS system. The optimization module is used to determine the module optimization strategy corresponding to the application to be optimized based on the risk interface information and the functional module architecture; the module optimization strategy is used to limit the code optimization scheme corresponding to any functional module in the application to be optimized.

7. An application adaptability optimization system for a HongMeng system, characterized in that, The system includes: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the application compatibility optimization method for HarmonyOS as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Power line control method based on open source gap system

    CN117977580A

  • Audio and video SDK (Software Development Kit) interface for swan-gap system

    CN118803348A