Thermal repair method, system, device and readable storage medium

The thermal repair method using JSON files for hot fix patches addresses the inefficiencies of existing Flutter repair solutions by enabling rapid and compliant hot repairs on both iOS and Android platforms.

CN114924777BActive Publication Date: 2024-12-20HANGZHOU YOUZAN TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210586887.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-12-17
Filing Date
2022-05-27
Publication Date
2024-12-20
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

Existing solutions for Flutter hot repairs are not universal, time-consuming, and do not meet the timeliness requirements, particularly for iOS platforms due to Apple's review rules prohibiting the download and execution of compiled products.

Method used

A thermal repair method using a JSON file for hot fix patches that includes generating a symbol table from application source code to identify nodes requiring repair, allowing hot repair on both iOS and Android without compilation, adhering to Apple's review principles.

Benefits of technology

The method ensures timely and efficient hot repair by using JSON files, reducing time consumption to seconds and ensuring compliance with Apple's review principles, thus accelerating the repair process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114924777B_ABST
    Figure CN114924777B_ABST
Patent Text Reader

Abstract

The present invention provides a hot repair method, system, device and readable storage medium, the method comprising: an application terminal sends a query request to a cloud management platform to determine whether there is a latest hot repair patch file; obtains the query result of the cloud management platform, if there is, obtains the latest hot repair patch file and parses it to generate a compiled intermediate file; parses the compiled intermediate file to obtain mapping information of repaired nodes and repaired nodes; based on a symbol table, finds the corresponding node to be hot repaired; performs hot repair, and completes the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table. This solution is applicable to hot repair solutions for iOS and Android, and the hot repair patch file is a JSON file, which is used as a hot repair patch to ensure the correctness of hot repair patch generation and improve work efficiency; by issuing a JSON file instead of a compiled product, it complies with Apple's review principles, and hot repair is performed with the help of a hot repair patch, and because no compilation is required, the time consumption can reach seconds, which accelerates the processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular, relates to a thermal repair method, system, device and readable storage medium. Background Art

[0002] Flutter is a cross-end development framework for mobile applications launched and open-sourced by Google. It focuses on building, testing, and publishing exquisite applications for mobile, Web, desktop, and embedded platforms with just one set of code bases. The current mobile business needs have high quality requirements, and they hope to quickly fix online problems to avoid online failures that cause large losses. At present, Flutter has no official plans for Flutter hot repairs, and the existing solutions are also implemented based on Flutter product replacement.

[0003] That is to say, this type of solution is currently only applicable to Android, is not universal, and is time-consuming. Patch generation takes from several minutes to several hours, and timeliness cannot be guaranteed. This method issues Flutter compilation products, and the generation of compilation products takes from several minutes to several hours, which takes a long time and cannot guarantee the timeliness of online problem repair. For example, the patent number 201910551006.0 states: a new version of the Flutter product is obtained from the server and stored in the backup directory; when the application is started again, the new version of the Flutter product is obtained from the backup directory, overwriting the old version of the Flutter product, and starting. This solution issues Flutter compilation products (AAR for Android and framework for iOS) to complete hot repair. However, for iOS, according to the App Store review rules, it is strictly forbidden to download and execute executable code such as compilation products, so the feasibility of this solution on iOS is broken from the rule level. In reality, to solve the hot repair problem in the iOS scenario, it can only be solved by uploading the updated application to the App Store again and then downloading the update again, which takes 2-3 days. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a thermal repair method, system, device and readable storage medium.

[0005] In order to solve the above technical problems, the present invention is solved by the following technical solutions:

[0006] A thermal repair method comprises the following steps:

[0007] The application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0008] Get the query results of the cloud management platform. If they exist, get the latest hot fix patch file and parse it to generate a compiled intermediate file.

[0009] Parsing the compiled intermediate file to obtain mapping information of the repaired nodes and the repaired nodes;

[0010] Based on the symbol table, find the corresponding node to be hot-repaired, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0011] Execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0012] As an implementable method, the hotfix file is obtained by:

[0013] Obtain the repaired application source code and parse it to obtain the compiled intermediate file;

[0014] A JSON file is generated based on the compiled intermediate file, wherein the JSON file at least includes a repaired node and a path corresponding to the repaired node, and the repaired node includes a class or a method or an expression.

[0015] As an implementable method, the node to be hot-repaired is generated in a pre-processing process, and the pre-processing process includes the following steps:

[0016] Generate a first compilation intermediate product based on the application source code, parse the first compilation intermediate product, obtain all nodes in the first compilation intermediate product and generate a statistical file;

[0017] The first compilation intermediate product is screened by using a preset hot repair configuration file and the statistical file to find out nodes with hot repair capability and generate nodes to be hot repaired, thereby obtaining a second compilation intermediate product;

[0018] A symbol table is generated based on the preset hot repair configuration file and the statistical file, and the symbol table is written into the second compilation intermediate product and replaces the first compilation intermediate product. The symbol table is a mapping relationship between the node to be hot repaired and the string, and the string is a unique identifier of the node to be hot repaired.

[0019] As an implementable method, parsing the first compilation intermediate product, obtaining all nodes in the first compilation intermediate product and generating a statistical file includes the following steps:

[0020] The first compilation intermediate product is traversed to obtain all main nodes in the first compilation intermediate product and all child nodes under the main nodes, and a statistical file is generated with the traversed results.

[0021] As an implementable method, finding out nodes with hot repair capability and generating nodes to be hot repaired, and then obtaining the second compilation intermediate product, includes the following steps:

[0022] Find a node with hot repair capability, and confirm the code of the class, method or expression corresponding to the node;

[0023] Inserting a hot repair mark code into the node object code to generate a corresponding node to be hot repaired;

[0024] The node to be hot-repaired is replaced with the first compiled intermediate product to obtain a second compiled intermediate product.

[0025] As an implementable method, the hot repair process of the node to be hot repaired is completed according to the mapping relationship of the symbol table, including the following steps:

[0026] Parsing the repaired node to obtain a repaired class or method or expression corresponding to the repaired node, and parsing the node to be repaired into a class or method or expression to be repaired corresponding to the node to be repaired;

[0027] The class, method or expression to be repaired is replaced with the repaired class, method or expression through the mapping relationship in the symbol table.

[0028] A hot repair system includes a request module, a first parsing module, a second parsing module, a search module and an execution module;

[0029] The request module, the application end sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0030] The first parsing module is used to obtain the query result of the cloud management platform, and if it exists, obtain the latest hot fix patch file and parse it to generate a compiled intermediate file;

[0031] The second parsing module parses the compiled intermediate file to obtain the mapping information of the repaired node and the repaired node;

[0032] The search module finds the corresponding node to be hot-repaired based on the symbol table, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0033] The execution module is used to execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0034] As an implementable method, it further includes a front module, wherein the front module includes a first processing unit, a screening and generating unit, and a generating and replacing unit;

[0035] The first processing unit generates a first compilation intermediate product based on the application source code, and parses the first compilation intermediate product to obtain all nodes in the first compilation intermediate product and generate a statistical file;

[0036] The screening and generating unit is used to screen the first compilation intermediate product through a preset hot repair configuration file and the statistical file, find out nodes with hot repair capability, and generate nodes to be hot repaired, thereby obtaining a second compilation intermediate product;

[0037] The generation and replacement unit generates a symbol table based on the preset hot repair configuration file and the statistical file, writes the symbol table into the second compilation intermediate product and replaces the first compilation intermediate product, the symbol table is a mapping relationship between the node to be hot repaired and the string, and the string is a unique identifier of the node to be hot repaired.

[0038] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0039] The application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0040] Get the query results of the cloud management platform. If they exist, get the latest hot fix patch file and parse it to generate a compiled intermediate file.

[0041] Parsing the compiled intermediate file to obtain mapping information of the repaired nodes and the repaired nodes;

[0042] Based on the symbol table, find the corresponding node to be hot-repaired, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0043] Execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0044] A thermal repair device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following method steps when executing the computer program:

[0045] The application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0046] Get the query results of the cloud management platform. If they exist, get the latest hot fix patch file and parse it to generate a compiled intermediate file.

[0047] Parsing the compiled intermediate file to obtain mapping information of the repaired nodes and the repaired nodes;

[0048] Based on the symbol table, find the corresponding node to be hot-repaired, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0049] Execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0050] The present invention has significant technical effects due to the adoption of the above technical solution:

[0051] The present invention discloses a hot repair method and system applicable to an application end, and the present solution is applicable to hot repair solutions for iOS and Android. The hot repair patch file of the present invention is a JSON file, which, as a hot repair patch, ensures the correctness of hot repair patch generation and improves work efficiency; by issuing a JSON file instead of a compiled product, it complies with Apple's review principles, and hot repair is performed with the help of a hot repair patch, and since no compilation is required, the time consumption can reach the second level, thereby accelerating the processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0053] Figure 1 is a schematic flow chart of the thermal repair method;

[0054] Figure 2 It is a schematic diagram of the pre-processing process;

[0055] Figure 3 It is a schematic diagram of the overall structure of the thermal repair system;

[0056] Figure 4 It is a structural diagram of the front module. DETAILED DESCRIPTION

[0057] The present invention is further described in detail below in conjunction with embodiments. The following embodiments are for explanation of the present invention but the present invention is not limited to the following embodiments.

[0058] Embodiment 1:

[0059] A thermal repair method, such as Figure 1 As shown, the following steps are included:

[0060] S100, the application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0061] S200, obtaining the query result of the cloud management platform, and if it exists, obtaining the latest hot fix patch file and parsing it to generate a compiled intermediate file;

[0062] S300, parsing the compiled intermediate file to obtain mapping information of the repaired node and the repaired node;

[0063] S400, based on the symbol table, find the corresponding node to be hot-repaired, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0064] S500, executing hot repair, completing the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0065] Here, it needs to be stated that the repaired node is repaired for one, several or all of the nodes to be hot-repaired. In other words, it can be understood that, if the number is considered, the number of nodes to be hot-repaired is not less than the number of repaired nodes.

[0066] The hot-repair patch file and the repaired node file of the present invention are for the same set of application source code, therefore, the mapping relationship of the symbol table applied subsequently is obtained based on the application source code parsing process. The symbol table is the mapping relationship between all nodes and strings obtained after the source code parsing, and since the nodes to be hot-repaired are screened out based on the application source code, and the repaired nodes are repaired for one, several or all nodes in the nodes to be hot-repaired, therefore, the mapping relationship of the symbol table is universal.

[0067] In this embodiment, the query request sent by the application end includes at least relevant parameters of the corresponding hot fix patch file, the application identifier and version number, etc. Through this information, the cloud management platform can search or match the corresponding hot fix patch file.

[0068] The information contained in the repaired node is actually the identifier and the repaired object, which can be a method, class, or expression.

[0069] The hotfix file of the present invention is a JSON file. As a hotfix, the correctness of the generation of the hotfix is ​​guaranteed, and the work efficiency is improved. By issuing a JSON file instead of a compiled product, it complies with Apple's review principles. Hot repair is performed with the help of a hotfix, and since no compilation is required, the time consumption can reach the second level, thereby accelerating the processing.

[0070] In one embodiment, the hotfix file is obtained by:

[0071] Obtain the repaired application source code and parse it to obtain the compiled intermediate file;

[0072] A JSON file is generated based on the compiled intermediate file, wherein the JSON file at least includes a repaired node and a path corresponding to the repaired node, wherein the repaired node includes a class or a method or an expression. The repaired application source code is a repaired application source code obtained by repairing the application source code.

[0073] In one embodiment, Figure 2 As shown, the node to be hot-repaired is generated in a pre-processing process, and the pre-processing process includes the following steps:

[0074] S001. Generate a first compilation intermediate product based on the application source code, parse the first compilation intermediate product, obtain all nodes in the first compilation intermediate product and generate a statistical file;

[0075] S002, screening the first compilation intermediate product by using a preset hot repair configuration file and the statistical file, finding out nodes with hot repair capability, and generating nodes to be hot repaired, thereby obtaining a second compilation intermediate product;

[0076] S003. Generate a symbol table based on the preset hot repair configuration file and the statistical file, write the symbol table into the second compilation intermediate product and replace the first compilation intermediate product, the symbol table is a mapping relationship between the node to be hot repaired and the string, and the string is a unique identifier of the node to be hot repaired.

[0077] This embodiment is implemented using the tool Flutter, which can be understood as a pre-processing process before hot repair. The first compilation intermediate product is generated by using the Flutter compilation front end, and hot repair interception code is added to the node that needs hot repair, as follows:

[0078] The construction of the first compilation intermediate product by Flutter's built-in compilation tool can be divided into two major steps. The compilation front end completes the generation of the source code to the first compilation intermediate product. This stage will generate a first compilation intermediate product with the suffix .dill. This first compilation intermediate product is actually an AST (abstract syntax tree). The main task of the compilation back end is to convert the first compilation intermediate product of the compilation front end into the target code;

[0079] Parse the first compilation intermediate product and generate a statistical file: After detecting that the first compilation intermediate product is generated, read the first compilation intermediate product. Since the first compilation intermediate product is an AST (abstract syntax tree), all Library nodes and all class nodes and method nodes under the Library node are obtained by traversing the abstract syntax tree, and the traversed results are written into the statistical file according to the agreed data structure. Here, the statistical file is generated to quickly find which nodes or methods need to be hot-fixed, and the preset data format is not mandatory here, as long as they can be mutually recognized later. The purpose of the preset data format is to read the statistical file according to the agreed data structure;

[0080] Based on the statistical file and the preset hot repair configuration file, it is obtained which nodes need to be hot repaired. The method is: traverse the first compilation intermediate product again, filter out the Library nodes / classes / methods that need to support hot repair capabilities, refer to the AST data structure, and generate a new hot repair interception AST node. In fact, it is to add hot repair interception code to the Library nodes / classes / methods that need to be hot repaired to form a hot repair interception AST node, and replace the hot repair interception AST node with the AST abstract syntax tree. The second compilation intermediate product obtained is an abstract syntax tree with a new AST structure. The preset hot repair configuration file in this embodiment is actually a pre-configured black and white list configuration information, which focuses on which libraries / classes / methods need to support hot repair capabilities and which libraries / classes / methods do not need to support hot repair capabilities. Since all compilation intermediate products contain a large amount of Flutter / Dart SDK code, which does not need to support hot repair capabilities, this preset hot repair configuration file can directly distinguish whether these codes support hot repair capabilities;

[0081] Through the statistical file and the preset hot repair configuration file symbol table, the symbol table here refers to the use of characters to map real nodes (classes / methods) to form a mapping relationship. Since Flutter does not support runtime / reflection, with the help of this layer of mapping relationship, the method in the original Flutter can be called through string mapping and written into the second compiled intermediate product; and the first compiled intermediate product is replaced by the second compiled intermediate product.

[0082] In one embodiment, the hot repair process of the node to be hot repaired is completed according to the mapping relationship of the symbol table, including the following steps:

[0083] Parsing the repaired node to obtain the repaired class, method or expression, and parsing the node to be repaired into the class, method or expression to be repaired;

[0084] Through the mapping relationship of the symbol table, the class, method or expression to be repaired is replaced with the repaired class, method or expression. When performing hot repair, the class, method or expression is replaced by parsing the node. Therefore, during the hot repair process, the repaired node and the node to be repaired need to be parsed separately to obtain the corresponding class, method or expression, and then the class, method or expression corresponding to the node to be hot repaired is replaced through the mapping relationship of the symbol table.

[0085] Embodiment 2:

[0086] A thermal repair system, such as Figure 3 As shown, it includes a request module 100, a first parsing module 200, a second parsing module 300, a search module 400 and an execution module 500;

[0087] The request module 100, the application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code;

[0088] The first parsing module 200 is used to obtain the query result of the cloud management platform, and if it exists, obtain the latest hot fix patch file and parse it to generate a compiled intermediate file;

[0089] The second parsing module 300 parses the compiled intermediate file to obtain the repaired node mapping information and the repaired node;

[0090] The search module 400 finds the corresponding node to be hot-repaired based on the symbol table, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string symbol and the node to be hot-repaired;

[0091] The execution module 500 is used to execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table.

[0092] In one embodiment, Figure 4 As shown, it also includes a front module 600, and the front module 600 includes a first processing unit 610, a screening and generating unit 620, and a generating and replacing unit 630;

[0093] The first processing unit 610 generates a first compilation intermediate product based on the application source code, and parses the first compilation intermediate product to obtain all nodes in the first compilation intermediate product and generate a statistical file;

[0094] The screening and generating unit 620 screens the first compilation intermediate product through a preset hot repair configuration file and the statistical file, finds out nodes with hot repair capability, generates nodes to be hot repaired, and then obtains a second compilation intermediate product;

[0095] The generating and replacing unit 630 generates a symbol table based on the preset hot repair configuration file and the statistical file, writes the symbol table into the second compilation intermediate product and replaces the first compilation intermediate product, wherein the symbol table is a mapping relationship between the node to be hot repaired and a character string, and the character string is a unique identifier of the node to be hot repaired.

[0096] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0097] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may 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.

[0098] The present invention is described with reference to the flowcharts and / or block diagrams of the method, terminal device (system), and computer program product according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0099] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0101] It should be noted that:

[0102] The "one embodiment" or "embodiment" mentioned in the specification means that the specific features, structures or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present invention. Therefore, the phrases "one embodiment" or "embodiment" appearing in various places throughout the specification do not necessarily refer to the same embodiment.

[0103] In addition, it should be noted that the shapes and names of the parts and components of the specific embodiments described in this specification may be different. Any equivalent or simple changes made based on the structure, features and principles described in the patent concept of the present invention are included in the protection scope of the patent of the present invention. The technicians in the technical field of the present invention can make various modifications or supplements to the specific embodiments described or replace them in a similar manner, as long as they do not deviate from the structure of the present invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A thermal repair method, characterized in that: The following steps are involved: The application sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code; Get the query results of the cloud management platform. If they exist, get the latest hot fix patch file and parse it to generate a compiled intermediate file. Parsing the compiled intermediate file to obtain mapping information of the repaired nodes and the repaired nodes; Based on the symbol table, find the corresponding node to be hot-repaired, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string and the node to be hot-repaired; Execute hot repair, and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table; The node to be hot-repaired is generated in a pre-processing process, and the pre-processing process includes the following steps: Generate a first compilation intermediate product based on the application source code, parse the first compilation intermediate product, obtain all nodes in the first compilation intermediate product and generate a statistical file; The first compilation intermediate product is screened by using a preset hot repair configuration file and the statistical file to find out nodes with hot repair capability and generate nodes to be hot repaired, thereby obtaining a second compilation intermediate product; Generate a symbol table based on the preset hot repair configuration file and the statistical file, write the symbol table into the second compilation intermediate product and replace the first compilation intermediate product, the symbol table is a mapping relationship between the node to be hot repaired and the string, and the string is a unique identifier of the node to be hot repaired; The step of finding a node with hot repair capability and generating a node to be hot repaired, and then obtaining a second compilation intermediate product, includes the following steps: Find a node with hot repair capability, and confirm the code of the class, method or expression corresponding to the node; Insert the hot repair mark code into the node object code to generate the corresponding node to be hot repaired; Replace the node to be hot-repaired with the first compilation intermediate product to obtain a second compilation intermediate product; The hot repair process of the node to be hot-repaired is completed according to the mapping relationship of the symbol table, and includes the following steps: Parsing the repaired node to obtain a repaired class or method or expression corresponding to the repaired node, and parsing the node to be repaired into a class or method or expression to be repaired corresponding to the node to be repaired; The class, method or expression to be repaired is replaced with the repaired class, method or expression through the mapping relationship in the symbol table.

2. The thermal repair method according to claim 1, characterized in that: The hotfix file is obtained in the following way: Obtain the repaired application source code and parse it to obtain the compiled intermediate file; A JSON file is generated based on the compiled intermediate file, wherein the JSON file at least includes a repaired node and a path corresponding to the repaired node, and the repaired node includes a class or a method or an expression.

3. The thermal repair method according to claim 1, characterized in that: The step of parsing the first compilation intermediate product, obtaining all nodes in the first compilation intermediate product and generating a statistical file comprises the following steps: The first compilation intermediate product is traversed to obtain all main nodes in the first compilation intermediate product and all child nodes under the main nodes, and a statistical file is generated with the traversed results.

4. A thermal repair system, characterized in that: It includes a request module, a first parsing module, a second parsing module, a search module and an execution module; The request module, the application end sends a query request to the cloud management platform whether there is a latest hot fix patch file, wherein the hot fix patch file is a JSON file generated by the repaired application source code; The first parsing module is used to obtain the query result of the cloud management platform, and if it exists, obtain the latest hot fix patch file and parse it to generate a compiled intermediate file; The second parsing module parses the compiled intermediate file to obtain the mapping information of the repaired nodes and the repaired nodes; The search module finds the corresponding node to be hot-repaired based on the symbol table, wherein the node to be hot-repaired is a node with hot-repair capability obtained by parsing the application source code, and the symbol table is a mapping relationship between a string and the node to be hot-repaired; The execution module is used to execute the hot repair and complete the hot repair process of the node to be hot repaired according to the mapping relationship of the symbol table; Among them, it also includes a front module, which includes a first processing unit, a screening and generating unit, and a generating and replacing unit; The first processing unit generates a first compilation intermediate product based on the application source code, and parses the first compilation intermediate product to obtain all nodes in the first compilation intermediate product and generate a statistical file; The screening and generating unit is used to screen the first compilation intermediate product through a preset hot repair configuration file and the statistical file, find out nodes with hot repair capability, and generate nodes to be hot repaired, thereby obtaining a second compilation intermediate product; The generating and replacing unit generates a symbol table based on the preset hot repair configuration file and the statistical file, writes the symbol table into the second compilation intermediate product and replaces the first compilation intermediate product, wherein the symbol table is a mapping relationship between the node to be hot repaired and a character string, and the character string is a unique identifier of the node to be hot repaired; The step of finding a node with hot repair capability and generating a node to be hot repaired, and then obtaining a second compilation intermediate product, includes the following steps: Find a node with hot repair capability, and confirm the code of the class, method or expression corresponding to the node; Insert the hot repair mark code into the node object code to generate the corresponding node to be hot repaired; Replace the node to be hot-repaired with the first compilation intermediate product to obtain a second compilation intermediate product; The hot repair process of the node to be hot-repaired is completed according to the mapping relationship of the symbol table, and includes the following steps: Parsing the repaired node to obtain a repaired class or method or expression corresponding to the repaired node, and parsing the node to be repaired into a class or method or expression to be repaired corresponding to the node to be repaired; The class, method or expression to be repaired is replaced with the repaired class, method or expression through the mapping relationship in the symbol table.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

6. A thermal repair device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Hot updating method, device for Flutter application, and equipment

    CN110286927A

  • Thermal repair method and device and readable storage medium

    CN110457151A

  • File hot repair method, device and equipment and storage medium

    CN111796972A