Code hot repair method, device, equipment, medium, product and vehicle
By modifying and compiling the names of new code functions, and using mapping relationships to generate patches, the problem of existing hot repair tools that function names do not comply with the rules in new code projects is solved, and effective hot repair of new code projects is achieved.
Patent Information
- Application Number
- CN202310153905.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2024-08-20
AI Technical Summary
Existing hot repair tools often output errors during the compilation process of new code projects, making hot repair impossible. This is mainly because the function names do not comply with the rules of the compiled language.
Obtain the function of the code to be repaired through the hot repair tool, modify its name to comply with the compilation language rules, create a new function, compile it through the compiler, use the mapping relationship to restore the class name, and generate a patch for hot repair.
Implemented hot fixes for new code projects to ensure that function names comply with rules and can be compiled by the compiler to generate effective patches for repair.
Smart Images

Figure CN118519636A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information technology, and in particular relates to a code hot repair method, device, equipment, medium, product and vehicle. Background Art
[0002] As technology develops, codes are constantly updated.
[0003] Currently, since the hot fix tool has not been maintained and updated for a long time, errors are often output when using the hot fix tool to compile new code projects, resulting in the inability to use the hot fix tool to hot fix the new code projects. Summary of the invention
[0004] Embodiments of the present application provide a code hot repair method, apparatus, device, medium, product, and vehicle, which can use a hot repair tool to perform hot repair on a new code project.
[0005] On the one hand, an embodiment of the present application provides a code hot repair method, comprising:
[0006] Acquire a first function of the code to be repaired by a hot repair tool; the code to be repaired is written in a first compiled language or a second compiled language; the hot repair tool supports the first compiled language used by a first compiler;
[0007] If a first function name of the first function does not conform to a rule of the first compiled language, modify the first function name to a second function name that conforms to the rule;
[0008] Creating a second function according to the second function name and the internal code of the first function;
[0009] Compiling the second function by using the first compiler to determine a first category;
[0010] According to the mapping relationship, the class name of the first class is restored to the first function name, so as to obtain a second class after the name is restored; the mapping relationship is the mapping relationship between the first function name and the second function name;
[0011] According to the patch composed of the second category, internal code of the first function is hot-fixed.
[0012] In a possible implementation, when the name of the first function conforms to the rule, the first function is compiled by the first compiler to determine the third category;
[0013] According to the patches composed of the third category, the internal code is hot-fixed.
[0014] In a possible implementation, before restoring the class name of the first class to the first function name according to the mapping relationship to obtain the second class after the name is restored, the method further includes:
[0015] The mapping relationship is determined according to the first function name and the second function name.
[0016] In a possible implementation, restoring the class name of the first class to the first function name according to the mapping relationship to obtain the second class after the name is restored includes:
[0017] Recognize the class name of the first class to obtain a first byte of the class name of the first class that cannot be recognized by the first compiler and a second byte that can be recognized by the first compiler;
[0018] According to each first byte of the class name of the first class, searching the mapping relationship to determine the third byte corresponding to each first byte;
[0019] A class name of the second class is obtained according to the second byte and the third byte.
[0020] In a possible implementation, the hot fix tool is Robust; the first compilation language is Java, and the second compilation language is Kotlin; or the first compilation language is Kotlin, and the second compilation language is Java.
[0021] On the other hand, an embodiment of the present application provides a code hot repair device, including:
[0022] An acquisition module, used for acquiring a first function of the code to be repaired through a hot repair tool; the code to be repaired is written in a first compilation language or a second compilation language; the hot repair tool supports the first compilation language used by the first compiler;
[0023] a modification module, configured to modify the first function name to a second function name that complies with the rule when the first function name of the first function does not comply with the rule of the first compiled language;
[0024] A creation module, used for creating a second function according to the name of the second function and the internal code of the first function;
[0025] A determination module, configured to compile the second function by using the first compiler to determine a first category;
[0026] A restoration module, used for restoring the class name of the first class to the first function name according to a mapping relationship, to obtain a second class after the name is restored; the mapping relationship is a mapping relationship between the first function name and the second function name;
[0027] A hot repair module is used to perform hot repair on the internal code of the first function according to the patch composed of the second category.
[0028] In another aspect, an embodiment of the present application provides a code hot repair device, the device comprising: a processor and a memory storing computer program instructions;
[0029] When the processor executes the computer program instructions, the code hot repair method as described in any one of the above items is implemented.
[0030] On the other hand, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the code hot repair method as described in any one of the above is implemented.
[0031] On the other hand, an embodiment of the present application provides a computer program product, characterized in that when instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the code hot repair methods described above.
[0032] In another aspect, an embodiment of the present application provides a vehicle, the vehicle comprising at least one of the following:
[0033] Such as the code hot fix device mentioned above;
[0034] Such as the code hot fix equipment mentioned above;
[0035] The computer-readable storage medium as described above;
[0036] A computer program product as described above.
[0037] The code hot repair method, device, equipment, medium, product and vehicle of the embodiments of the present application obtain the first function of the code to be repaired through a hot repair tool; when the first function name of the first function does not comply with the rules of the first compiled language, the first function name is modified to a second function name that complies with the rules, and the first function that does not comply with the rules is converted into a second function that complies with the rules according to the second function name and the internal code of the first function, so that the second function can be compiled by the first compiler to obtain a first class that complies with the rules, and the class name of the first class is restored to the first function name through a mapping relationship to obtain a second class corresponding to the first function with the restored name, and the internal code of the first function is repaired according to the patch composed of the second class, so as to realize hot repair of the new code project using the hot repair tool. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0039] Figure 1 It is a flowchart of the code hot repair method provided in the embodiment of the present application;
[0040] Figure 2 is a schematic diagram of the structure of a code hot repair device provided in an embodiment of the present application;
[0041] Figure 3 It is a structural diagram of a code hot repair device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0043] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0044] Related technologies such as background technologies are provided by the inventors based on this, and a method, apparatus, device, medium, product and vehicle for hot repairing a code is provided, wherein a first function of the code to be repaired is obtained through a hot repair tool; when the first function name of the first function does not conform to the rules of the first compiled language, the first function name is modified to a second function name conforming to the rules, and the first function that does not conform to the rules is converted into a second function conforming to the rules according to the second function name and the internal code of the first function, so that the second function can be compiled by the first compiler to obtain a first class conforming to the rules, and the class name of the first class is restored to the first function name through a mapping relationship to obtain a second class corresponding to the first function with the name restored, and the internal code of the first function is repaired according to the patch composed of the second class, so as to realize hot repair of the new code project using the hot repair tool.
[0045] In order to solve the problems of the prior art, the embodiments of the present application provide a code hot repair method, device, equipment, medium, product and vehicle. The code hot repair method provided by the embodiments of the present application is first introduced below.
[0046] Figure 1 FIG. 1 is a flow chart of a code hot repair method provided by an embodiment of the present application. Figure 1 As shown, the code hot repair method provided in the embodiment of the present application includes the following steps: S101 to S106.
[0047] S101, obtaining a first function of the code to be repaired by using a hot repair tool.
[0048] As a possible implementation of S101, the code to be repaired is determined by a hot repair tool, and a first function to be repaired is determined. The code to be repaired is written in a first compilation language or a second compilation language, and the hot repair tool supports the first compilation language used by a first compiler. The first function is a section of code in the code to be repaired, and the first function includes a first function name and internal code.
[0049] S102: When a first function name of a first function does not conform to a rule of a first compiled language, modify the first function name to a second function name conforming to the rule.
[0050] As a possible implementation of S102, when the first function name of the first function does not comply with the rules of the first compilation language, the first compiler cannot obtain the first function name of the first function, and thus modifies the first function name to a second function name that complies with the rules.
[0051] As a possible implementation manner of S102, the rule of the first compiled language may be a naming specification of the first compiled language.
[0052] As a possible implementation of S102, when the first function name of the first function does not conform to the rule of the first compiled language, it can be understood that the first function name of the first function conforms to the preset rule of the second compiled language.
[0053] In one example, when a first function is Kotlin and has lambda syntax sugar, the first function name is modified to a second function name that complies with the rules.
[0054] When the first function name of the first function does not conform to the rule of the first compiled language, prompt information may be generated to prompt the user that a hot fix after the mapping relationship is adopted.
[0055] S103: Create a second function according to the second function name and the internal code of the first function.
[0056] As a possible implementation of S103, the second function is created by combining the second function name and the internal code of the first function. The second function can be understood as the first function with the function name modified.
[0057] S104, compile the second function by using the first compiler to determine the first category.
[0058] As a possible implementation of S104, the first compiler performs lexical analysis, grammatical analysis, semantic checking, intermediate code generation, and code optimization on the second function, and finally generates the first category. The first category is the code compiled by the second function.
[0059] S105, restoring the class name of the first class to the first function name according to the mapping relationship, to obtain a second class with the name restored.
[0060] As a possible implementation of S105, the mapping relationship is a mapping relationship between the first function name and the second function name. The second type is the code after the second function is compiled and the name is restored.
[0061] S106: Perform a hot fix on the internal code of the first function according to the patch composed of the second category.
[0062] As a possible implementation of S106, the patch may be loaded into the program where the first function is located, thereby completing the hot repair of the internal code of the first function.
[0063] The code hot repair method of the present application obtains the first function of the code to be repaired through a hot repair tool; when the first function name of the first function does not comply with the rules of the first compiled language, the first function name is modified to a second function name that complies with the rules; according to the second function name and the internal code of the first function, the first function that does not comply with the rules is converted into a second function that complies with the rules, so that the second function can be compiled by the first compiler to obtain a first class that complies with the rules; the class name of the first class is restored to the first function name through a mapping relationship to obtain a second class corresponding to the first function with the restored name; according to the patch composed of the second class, the internal code of the first function is repaired, thereby realizing hot repair of the new code project using the hot repair tool.
[0064] In a possible implementation, when the name of the first function complies with the rule, the first function is compiled by a first compiler to determine the third category;
[0065] Patches composed according to the third category are used to perform hot fixes on internal codes.
[0066] In one example, when the name of the first function complies with the Java naming rule, the first function is compiled by a Java compiler to generate a third class consisting of Java bytecodes. The hot fix can be completed by loading the patch into the Java program.
[0067] Therefore, when the name of the first function complies with the rules, the first function can be directly compiled by the first compiler to obtain a patch of internal code for hot repair.
[0068] In a possible implementation, before restoring the class name of the first class to the first function name according to the mapping relationship to obtain the second class after the name is restored, the method further includes:
[0069] A mapping relationship between the first compiled language and the second compiled language is determined according to the first function name and the second function name.
[0070] In an example, the first function name is "lambda$oncreate$0" and the second function name is "lambda-oncreate-0", so it can be determined that there is a mapping relationship between "$" in the first compiled language and "-" in the second compiled language.
[0071] Thus, the mapping relationship between the first function name and the second function name is determined.
[0072] In a possible implementation, the class name of the first class is restored to the first function name according to the mapping relationship to obtain the second class after the name is restored, including:
[0073] Recognize the class name of the first class to obtain a first byte of the class name of the first class that cannot be recognized by the first compiler and a second byte that can be recognized by the first compiler;
[0074] According to each first byte of the class name of the first class, searching for a mapping relationship, and determining a third byte corresponding to each first byte;
[0075] According to the second byte and the third byte, the class name of the second class is obtained.
[0076] Among them, the first byte is the byte in the class name of the first category that can be recognized by the first compiler, the second byte is the byte in the class name of the first category that cannot be recognized by the first compiler, and the third byte is the first byte after conversion through the mapping relationship, and the third byte is the byte that can be recognized by the first compiler.
[0077] As a possible implementation, when restoring the class name of the first category, the class name is split into the smallest bytes, and a mapping relationship is searched for each byte. If a mapping relationship is found, the corresponding byte is replaced. If no mapping relationship is found, the byte remains unchanged. After searching for a mapping relationship for each byte, the restored class name of the second category is obtained.
[0078] As a possible implementation method, when restoring the class name of the first category, the special bytes in the class name are identified according to the semantic grammar, and the mapping relationship of the special bytes is searched. When the mapping relationship is found, the corresponding special bytes are replaced. When the mapping relationship is not found, the special bytes remain unchanged. After searching for the mapping relationships of all special bytes, the restored class name of the second category is obtained.
[0079] Thus, through the mapping relationship, the class name of the first category is converted into the class name of the second category.
[0080] In a possible implementation, the hotfix tool is Robust, the first compiled language is Java, and the second compiled language is Kotlin. The first compiler is Javassist, which is a bytecode processing open source framework, or the first compiled language is Kotlin, and the second compiled language is Java.
[0081] Therefore, through the code hot repair method of the present application, hot repair of the program is achieved through Robust.
[0082] Based on the above-mentioned code hot repair method, accordingly, the present application also provides a specific implementation method of a code hot repair device.
[0083] Figure 2 is a schematic diagram of the structure of the code hot repair device provided in the embodiment of the present application, such as Figure 2 As shown, the code hot repair device 200 of the present application includes:
[0084] The acquisition module 201 is used to acquire a first function of the code to be repaired through a hot repair tool; the code to be repaired is written in a first compilation language or a second compilation language; the hot repair tool supports the first compilation language used by the first compiler;
[0085] A modification module 202, configured to modify the first function name to a second function name that complies with the rules if the first function name of the first function does not comply with the rules of the first compiled language;
[0086] A creation module 203, used to create a second function according to the second function name and the internal code of the first function;
[0087] A determination module 204 is used to compile the second function by using a first compiler to determine a first category;
[0088] The restoration module 205 is used to restore the class name of the first class to the first function name according to the mapping relationship, so as to obtain the second class after the name is restored; the mapping relationship is the mapping relationship between the first function name and the second function name;
[0089] The hot repair module 206 is used to perform hot repair on the internal code of the first function according to the patch composed of the second type.
[0090] The code hot repair device of the present application obtains the first function of the code to be repaired through a hot repair tool; when the first function name of the first function does not comply with the rules of the first compiled language, the first function name is modified to a second function name that complies with the rules; according to the second function name and the internal code of the first function, the first function that does not comply with the rules is converted into a second function that complies with the rules, so that the second function can be compiled by the first compiler to obtain a first class that complies with the rules; the class name of the first class is restored to the first function name through a mapping relationship to obtain a second class corresponding to the first function with the restored name; according to the patch composed of the second class, the internal code of the first function is repaired, thereby realizing hot repair of the new code project using the hot repair tool.
[0091] In a possible implementation, the code hot repair device 200 of the present application may further include:
[0092] A third category determination module, configured to compile the first function by using a first compiler to determine a third category when the name of the first function conforms to the rule;
[0093] The hot repair module 206 can also be used to perform hot repair on the internal code according to the patches composed of the third category.
[0094] Therefore, when the name of the first function complies with the rules, the first function can be directly compiled by the first compiler to obtain a patch of internal code for hot repair.
[0095] In a possible implementation, before restoring the class name of the first class to the first function name according to the mapping relationship to obtain the second class after the name is restored, the code hot repair device 200 of the present application may further include:
[0096] The mapping relationship determination module is used to determine the mapping relationship according to the first function name and the second function name.
[0097] Thus, the mapping relationship between the first function name and the second function name is determined.
[0098] In a possible implementation, the restoration module 205 may also be used to:
[0099] Recognize the class name of the first class to obtain a first byte of the class name of the first class that cannot be recognized by the first compiler and a second byte that can be recognized by the first compiler;
[0100] According to each first byte of the class name of the first class, searching for a mapping relationship, and determining a third byte corresponding to each first byte;
[0101] The class name of the second class is obtained according to the second byte and the third byte. Thus, the class name of the first class is converted into the class name of the second class through the mapping relationship.
[0102] In a possible implementation, the hot fix tool is Robust, the first compilation language is Java, the second compilation language is Kotlin, or the first compilation language is Kotlin, and the second compilation language is Java.
[0103] Therefore, through the code hot repair method of the present application, hot repair of the program is achieved through Robust.
[0104] Based on the code hot repair method provided in the above embodiment, the present application also provides a specific implementation method of the code hot repair device.
[0105] Figure 3 The schematic diagram of the structure of the code hot repair device provided in the embodiment of the present application is shown as follows: Figure 3 As shown, the code hot repair device may include a processor 301 and a memory 302 storing computer program instructions.
[0106] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0107] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0108] The memory 302 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.
[0109] The processor 301 implements any one of the code hot repair methods in the above embodiments by reading and executing computer program instructions stored in the memory 302 .
[0110] In one example, the code hot repair device may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301, the memory 302, and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0111] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0112] Bus 310 comprises hardware, software or both, and the parts of code hot repair equipment are coupled to each other.For example, but not limitation, bus may comprise accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransmission (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.In suitable cases, bus 310 may comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0113] The code hot repair device can execute the code hot repair method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 2 A code hot repair method and apparatus are described.
[0114] In addition, in combination with the code hot repair method in the above embodiment, the embodiment of the present application also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, a code hot repair method such as any one of the above is implemented.
[0115] In combination with the code hot repair method in the above embodiment, the embodiment of the present application also provides a computer program product, characterized in that when the instructions in the computer program product are executed by the processor of the electronic device, the electronic device executes any of the code hot repair methods described above.
[0116] In combination with the code hot repair method in the above embodiment, the embodiment of the present application further provides a vehicle, the vehicle comprising at least one of the following:
[0117] Such as the code hot fix device mentioned above;
[0118] Such as the code hot fix equipment mentioned above;
[0119] The computer-readable storage medium as described above;
[0120] A computer program product as described above.
[0121] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0122] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0123] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0124] The above reference is according to the flowchart and / or block diagram of the method, device and computer program product of the embodiment of the present application to describe various aspects of the present application.It should be understood that each square block in the flowchart and / or block diagram and the combination of each square block in the flowchart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square blocks of the flowchart and / or block diagram.Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square block in the block diagram and / or flowchart and the combination of square blocks in the block diagram and / or flowchart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0125] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A code hot fix method, It is characterized in that include: Obtain the first function of the code to be repaired through a hot repair tool; The code to be repaired is written in a first compiled language or a second compiled language; the hot repair tool supports the first compiled language used by the first compiler; If a first function name of the first function does not conform to a rule of the first compiled language, modify the first function name to a second function name that conforms to the rule; Creating a second function according to the second function name and the internal code of the first function; Compiling the second function by using the first compiler to determine a first category; According to the mapping relationship, the class name of the first class is restored to the first function name, so as to obtain a second class after the name is restored; the mapping relationship is the mapping relationship between the first function name and the second function name; According to the patch composed of the second category, internal code of the first function is hot-fixed.
2. The code hot repair method according to claim 1, It is characterized in that Also includes: When the name of the first function conforms to the rule, compile the first function by using the first compiler to determine the third category; According to the patches composed of the third category, the internal code is hot-fixed.
3. The code hot repair method according to claim 1, It is characterized in that Before restoring the class name of the first class to the first function name according to the mapping relationship to obtain the second class after the name is restored, the method further includes: The mapping relationship is determined according to the first function name and the second function name.
4. The code hot repair method according to claim 1, It is characterized in that The step of restoring the class name of the first class to the first function name according to the mapping relationship to obtain a second class after the name is restored includes: Recognize the class name of the first class to obtain a first byte of the class name of the first class that cannot be recognized by the first compiler and a second byte that can be recognized by the first compiler; According to each first byte of the class name of the first class, searching the mapping relationship to determine the third byte corresponding to each first byte; A class name of the second class is obtained according to the second byte and the third byte.
5. The code hot repair method according to claim 1, It is characterized in that The hot fix tool is Robust; the first compilation language is Java, and the second compilation language is Kotlin; or the first compilation language is Kotlin, and the second compilation language is Java.
6. A code hot repair device, It is characterized in that include: An acquisition module, used for acquiring a first function of the code to be repaired through a hot repair tool; The code to be repaired is written in a first compiled language or a second compiled language; the hot repair tool supports the first compiled language used by the first compiler; a modification module, configured to modify the first function name to a second function name that complies with the rule when the first function name of the first function does not comply with the rule of the first compiled language; A creation module, used for creating a second function according to the name of the second function and the internal code of the first function; A determination module, configured to compile the second function by using the first compiler to determine a first category; A restoration module, used for restoring the class name of the first class to the first function name according to a mapping relationship, to obtain a second class after the name is restored; the mapping relationship is a mapping relationship between the first function name and the second function name; A hot repair module is used to perform hot repair on the internal code of the first function according to the patch composed of the second category.
7. A code hot repair device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the code hot repair method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the code hot repair method according to any one of claims 1 to 5 is implemented.
9. A computer program product, It is characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the code hot repair method as described in any one of claims 1 to 5.
10. A vehicle, It is characterized in that The vehicle comprises at least one of the following: The code hot repair device as claimed in claim 6; The code hot repair device as claimed in claim 7; The computer readable storage medium of claim 8; A computer program product as claimed in claim 9.
