Hot repair method and device and electronic equipment
By processing the anonymous classes in the initial repair code set into target classes and generating the target repair code set and logical content, the problem of hot repair failure is solved and effective hot repair in the presence of anonymous classes is achieved.
Patent Information
- Application Number
- CN202310334619.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
Existing hot repair technology can easily cause hot repair failure when anonymous classes exist in the repair code collection, and cannot effectively execute the implementation logic code of the anonymous class.
By obtaining the anonymous class in the initial repair code collection, processing it into a target class, and generating the target repair code collection and target logic content, the implementation logic code of the target class is executed during the hot repair process to avoid hot repair failure.
When an anonymous class exists in the repair code collection, it can effectively avoid hot repair failure, ensure that the implementation logic code of the anonymous class is executed, and improve the integrity and efficiency of hot repair.
Smart Images

Figure CN118733308A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a thermal repair method, device and electronic equipment. Background Art
[0002] Hot fix refers to fixing online faults of systems and / or applications without releasing new versions. In related technologies, hot fixes of online systems and / or applications can be implemented based on a hot fix framework. The hot fix framework usually generates corresponding logical content (patch) for the repair code set, and executes the loading of the corresponding logical content (patch) at the repair logic insertion point.
[0003] In this way, if the original logic in the repair code set contains anonymous classes, the hot repair will fail. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the present disclosure proposes a hot repair method, a hot repair device, an electronic device, a non-transitory computer-readable storage medium storing computer instructions, and a computer program product, which can effectively avoid hot repair failure when the original logic contains anonymous classes in the repair code set.
[0006] The hot repair method proposed in the embodiment of the first aspect of the present disclosure includes: obtaining an anonymous class in an initial repair code set, and processing the anonymous class into a target class for execution in a hot repair process, wherein the anonymous class and the target class have the same implementation logic code; generating a target repair code set according to the target class and the initial repair code set; generating a target logic content corresponding to the target repair code set; determining the logic content corresponding to the implementation logic code of the target class from the target logic content; and executing the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0007] The hot repair device proposed in the second aspect of the embodiment of the present disclosure includes: an acquisition module, which is used to acquire an anonymous class in an initial repair code set, and process the anonymous class into a target class to be executed in a hot repair process, wherein the anonymous class and the target class have the same implementation logic code; a first generation module, which is used to generate a target repair code set according to the target class and the initial repair code set; a second generation module, which is used to generate a target logic content corresponding to the target repair code set; a determination module, which is used to determine the logic content corresponding to the implementation logic code of the target class from the target logic content; and a repair module, which is used to execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0008] The electronic device proposed in the third embodiment of the present disclosure includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the thermal repair method proposed in the first embodiment of the present disclosure is implemented.
[0009] The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the hot repair method proposed in the first aspect embodiment of the present disclosure is implemented.
[0010] The fifth embodiment of the present disclosure proposes a computer program product. When the instructions in the computer program product are executed by a processor, the hot repair method proposed in the first embodiment of the present disclosure is executed.
[0011] The hot repair method, device, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product provided by the present invention obtain anonymous classes in an initial repair code set, and process the anonymous classes into target classes for execution in the hot repair process, wherein the anonymous classes and the target classes have the same implementation logic code, and generate a target repair code set based on the target class and the initial repair code set, generate target logic content corresponding to the target repair code set, determine logic content corresponding to the implementation logic code of the target class from the target logic content, and execute logic content corresponding to the implementation logic code of the target class to perform the hot repair process, which can effectively avoid hot repair failure when there is an original logic containing anonymous classes in the repair code set.
[0012] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0014] Figure 1 is a flow chart of a thermal repair method proposed in one embodiment of the present disclosure;
[0015] Figure 2 is a flow chart of a thermal repair method proposed in another embodiment of the present disclosure;
[0016] Figure 3 is a flow chart of a thermal repair method proposed in another embodiment of the present disclosure;
[0017] Figure 4 is a schematic flow chart of a thermal repair method in an embodiment of the present disclosure;
[0018] Figure 5 is a schematic structural diagram of a thermal repair device proposed in an embodiment of the present disclosure;
[0019] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and are not to be construed as limitations of the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.
[0021] Figure 1 It is a flow chart of a thermal repair method proposed in an embodiment of the present disclosure.
[0022] This embodiment is illustrated by the heat repair method being configured as a heat repair device. In this embodiment, the heat repair method can be configured in a heat repair device, and the heat repair device can be set in a server, or can also be set in an electronic device, without limitation. This embodiment is illustrated by the heat repair method being configured in an electronic device. Among them, the electronic device is a hardware device with various operating systems, such as a smart phone, a tablet computer, a personal digital assistant, an e-book, etc.
[0023] It should be noted that the execution subject of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) in a server or electronic device in terms of hardware, or may be, for example, a related background service in a server or electronic device in terms of software, without limitation.
[0024] like Figure 1 As shown, the thermal repair method comprises:
[0025] S101: Obtain an anonymous class in an initial repair code set, and process the anonymous class into a target class to be executed during a hot repair process, wherein the anonymous class and the target class have the same implementation logic code.
[0026] Among them, the repair code set refers to the code set required for hot repair of online systems and / or applications. The code set contains computer program code. The repair code set can be presented in the form of a computer program file, or it can be multiple segments of computer program code in a computer program file, without limitation.
[0027] The repair code set may be compiled to generate corresponding logic content (patch), and the logic content (patch) is used to perform hot repair on online systems and / or applications.
[0028] Among them, the initial repair code set refers to the original repair code set constructed for hot repair. The repair code set may contain anonymous classes. If the repair code set contains anonymous classes, the anonymous classes cannot be executed during the hot repair process, which may affect the loading effect of the generated logical content (patch), thereby causing the hot repair to fail.
[0029] Therefore, in the embodiments of the present disclosure, support is provided for processing anonymous classes of the initial repair code set so that the implementation logic code contained in the anonymous class can be effectively executed, thereby effectively avoiding hot repair failure when the original logic containing anonymous classes exists in the repair code set.
[0030] In some embodiments, after obtaining the anonymous class in the initial repair code set, the anonymous class can be processed as a target class to be executed during the hot repair process, and the anonymous class and the target class can have the same implementation logic code. Since the target class is executed during the hot repair process, the implementation logic code of the target class can be effectively executed, and since the target class and the anonymous class have the same implementation logic code, the implementation logic code of the anonymous class is effectively executed, thereby avoiding hot repair failure.
[0031] For example, the initial repair code set may include multiple classes, and the multiple classes may include anonymous classes and non-anonymous classes (non-anonymous classes, for example, classes that are not anonymous classes), and there is no restriction on this.
[0032] In the disclosed embodiment, other classes (non-anonymous classes) in the initial repair code set may not be processed, and only anonymous classes may be processed, and there is no limitation on this.
[0033] Among them, the anonymous class and the target class have the same implementation logic code, which means that after compilation and running, the anonymous class and the target class can implement the same online system and / or application functions, and the implementation logic code of the anonymous class and the implementation logic code of the target class correspond to the same online business processing logic.
[0034] In some embodiments, anonymous classes in the initial repair code set can be obtained in advance, and the anonymous classes can be processed into target classes for execution during the hot repair process. Then, based on the target classes and the initial repair code set, a target repair code set is generated, the target repair code set is stored, and during the repair process, the pre-stored target repair code set is obtained; alternatively, anonymous classes in the initial repair code set can be obtained in real time during the repair process, and the anonymous classes can be processed into target classes for execution during the hot repair process, and a target repair code set can be generated; alternatively, any other possible method can be used to obtain anonymous classes in the initial repair code set and process the anonymous classes into target classes for execution during the hot repair process, such as obtaining anonymous classes in the initial repair code set from the cloud, and processing the anonymous classes into target classes for execution during the hot repair process based on a local code generation device, etc., without limitation.
[0035] S102: Generate a target repair code set according to the target class and the initial repair code set.
[0036] After the anonymous class is processed as a target class to be executed in the hot repair process, a target repair code set may be generated according to the target class and the initial repair code set, and there is no limitation on this.
[0037] In some embodiments, the repair code set obtained by processing the initial repair code set according to the target class may be referred to as a target repair code set, without limitation.
[0038] In some embodiments, the target repair code set may also be configured to include at least a target class. Of course, the target repair code set may also include other classes in the initial repair code set. Other classes may be classes that are not anonymous classes, and there is no limitation on this.
[0039] After the target repair code set is generated according to the target class and the initial repair code set, hot repair can be performed according to the target repair code set. For example, the target repair code set can be deployed online to perform hot repair on the online system and / or application; or, the target repair code set can be replaced into the online system and / or application based on the technology of implementing logical replacement for bytecode to perform hot repair; or, any other arbitrary method can be used to implement hot repair according to the target repair code set, which is not limited to this.
[0040] S103: Generate target logical content corresponding to the target repair code set.
[0041] Among them, the implementation logic code may refer to the logic code contained in the class that can realize the program function, and the logic content refers to the logic content (patch) compiled based on the logic code contained in the class that can be executed and loaded by the online logic insertion point. The logic content generated based on the target repair code set can be called the target logic content.
[0042] In some embodiments, in the process of generating target logical content corresponding to the target repair code set, the target repair code set can be parsed and compiled based on the parsing and compilation device in the Robust open source hot repair framework, and the content obtained by the parsing and compilation can be used as the target logical content, and there is no limitation on this.
[0043] In other embodiments, a hot fix script file can also be executed. After being executed, the hot fix script file can implement the overall hot fix processing function. During the execution of the hot fix script file, the implementation logic code of the class in the target repair code set can be called and executed to generate the corresponding target logic content. There is no limitation on this.
[0044] Of course, any other possible manner may be used to generate the target logic content corresponding to the target repair code set, and there is no limitation to this.
[0045] In some embodiments of the present disclosure, in the process of generating target logical content corresponding to the target repair code set, an executable script file of the target repair code set may be obtained, and a parser may be used to parse the executable script file, and the parsed content may be obtained, and the parsed content may be used as the target logical content, so as to quickly and accurately obtain the target logical content corresponding to the target repair code set and improve the efficiency of hot repair.
[0046] The executable script file refers to a file that can be loaded and executed (for example, it can be loaded and executed by an operating system, or loaded and executed by some parsers, without limitation).
[0047] The executable script file may include a target repair code set. When the executable script file is loaded and executed, the implementation logic code of the class in the target repair code set can be loaded and executed accordingly.
[0048] The parser may be, for example, a grammar and lexical parser in a Robust open source hot fix framework, and there is no limitation to this.
[0049] That is to say, a parser may be used to parse the executable script file and obtain the parsed content, and then the parsed content is used as the target logical content.
[0050] S104: Determine the logic content corresponding to the implementation logic code of the target class from the target logic content.
[0051] After the target logic content corresponding to the target repair code set is generated, the logic content corresponding to the implementation logic code of the target class can be determined from the target logic content, and there is no limitation on this.
[0052] In some embodiments, the target logical content may include logical content corresponding to the implementation logic code of each class. The logical content corresponding to different classes can be identified by using the class information of the corresponding class. The class information can be, for example, the class name. Alternatively, the logical content corresponding to different classes can also be marked with the class identifier of the corresponding class. The class identifier can be used to uniquely identify the corresponding class, and there is no limitation on this.
[0053] In some embodiments, the logical content corresponding to the implementation logic code of each class can be first determined from the target logical content, and then the class that is the same as the target class can be selected, and the logical content corresponding to the implementation logic code of the class that is the same as the target class can be used as the logical content corresponding to the implementation logic code of the target class, without any restriction.
[0054] In other embodiments, the target logical content includes: logical content corresponding to the class information of the target class. The logical content in the target logical content corresponding to the class information of the target class can be used as the logical content corresponding to the implementation logic code of the target class, so as to quickly and accurately identify the logical content corresponding to the implementation logic code of the target class from the target logical content.
[0055] The information related to the target class may be referred to as class information. The class information may include, for example, the name, identifier, type, etc. of the target class, and there is no limitation on this.
[0056] In other embodiments, the target logical content may also include logical content corresponding to each candidate class information, and the candidate class information that is the same as the class information of the target class can be determined, and the logical content corresponding to the same candidate class information can be used as the logical content corresponding to the implementation logic code of the target class, without any restriction.
[0057] S105: Execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0058] In some embodiments of the present disclosure, it is possible to generate target logical content corresponding to a target repair code set, determine logical content corresponding to an implementation logic code of a target class from the target logical content, and execute the logical content corresponding to the implementation logic code of the target class to perform a hot repair process, thereby achieving effective hot repair. In addition, the original repair structure can be used so that the repair logic follows the hot repair rules of Robust (Robust is an open source hot repair framework), and the hot repair process does not incur additional operating costs.
[0059] In some embodiments of the present disclosure, the target repair code set can be parsed and compiled to obtain corresponding logical content (patch). The generated corresponding logical content (patch) can be called target logical content, which may include partial logical content corresponding to the implementation logic code. The target logical content can then be loaded at the repair logic insertion point. Since the target class is used to be executed during the hot repair process, this partial logical content can also be effectively executed.
[0060] In this embodiment, an anonymous class in the initial repair code set is obtained, and the anonymous class is processed into a target class to be executed in the hot repair process, wherein the anonymous class and the target class have the same implementation logic code, and a target repair code set is generated according to the target class and the initial repair code set, a target logic content corresponding to the target repair code set is generated, the logic content corresponding to the implementation logic code of the target class is determined from the target logic content, and the logic content corresponding to the implementation logic code of the target class is executed to perform the hot repair process. This can effectively avoid hot repair failure when the original logic containing anonymous classes exists in the repair code set.
[0061] Figure 2 It is a flow chart of a thermal repair method proposed in another embodiment of the present disclosure.
[0062] like Figure 2 As shown, the thermal repair method comprises:
[0063] S201: Determine whether an initial repair code set includes an anonymous class.
[0064] In some embodiments, the initial repair code set can be analyzed and processed to determine whether the computer program contained in the initial repair code set contains anonymous classes. If anonymous classes are contained, the anonymous classes can be processed based on the hot repair method of the embodiment of the present disclosure. If anonymous classes are not contained, hot repair can be performed directly based on the initial repair code set.
[0065] In some embodiments, the number of anonymous classes in the initial repair code set may be one or more, and each anonymous class may be processed accordingly based on the hot repair method of the embodiment of the present disclosure, without limitation.
[0066] S202: In response to the initial repair code set including an anonymous class, generate a target class according to the implementation logic code of the anonymous class in the initial repair code set.
[0067] In the disclosed embodiment, the implementation logic code of the anonymous class of the initial repair code set may be migrated based on any method capable of migrating the implementation logic code of the anonymous class of the initial repair code set, without limitation.
[0068] In some embodiments, the implementation logic code of the anonymous class may be migrated to a new class, and the new class may be used as the target class, without limitation.
[0069] S203: Generate a target repair code set according to the target class and the initial repair code set.
[0070] S204: Generate target logic content corresponding to the target repair code set.
[0071] S205: Determine the logic content corresponding to the implementation logic code of the target class from the target logic content.
[0072] S206: Execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0073] For the description of S203 - S206 , please refer to the above embodiment for details, which will not be repeated here.
[0074] In this embodiment, the initial repair code set can be analyzed and processed to determine whether the computer program contained in the initial repair code set contains anonymous classes. If anonymous classes are contained, the anonymous classes can be processed based on the hot repair method of the embodiment of the present disclosure, which can effectively avoid hot repair failure when the original logic in the repair code set contains anonymous classes. If anonymous classes are not contained, hot repair can be directly performed according to the initial repair code set to ensure the practicality of the hot repair method.
[0075] Figure 3 It is a flow chart of a thermal repair method proposed in another embodiment of the present disclosure.
[0076] like Figure 3 As shown, the thermal repair method comprises:
[0077] S301: Determine whether an initial repair code set includes an anonymous class.
[0078] For the description of S301 , please refer to the above embodiment, which will not be repeated here.
[0079] S302: In response to the initial repair code set including an anonymous class, create a first class for inheriting the anonymous class.
[0080] S303: Implementing the implementation logic code of the anonymous class according to the first class, and taking the first class that implements the implementation logic code as the target class.
[0081] In some embodiments, in the process of generating a target class based on the implementation logic code of an anonymous class in an initial repair code set, a first class for inheriting the anonymous class may be created, and the implementation logic code of the anonymous class may be implemented based on the first class, and the first class that implements the implementation logic code of the anonymous class may be used as the target class, thereby conveniently implementing the migration processing of the implementation logic code of the anonymous class of the initial repair code set.
[0082] Among them, the new class created for inheriting the anonymous class can be called the first class, and the first class can be used to implement the implementation logic code of the anonymous class, thereby migrating the implementation logic code of the anonymous class to the first class, so that the first class can have the same implementation logic code as the anonymous class.
[0083] In some embodiments, an implementation method for implementing the implementation logic code of the anonymous class according to the first class may also be provided, so that the created first class can accurately express the implementation logic code of the anonymous class. In some embodiments, the first class may include a constructor and / or an implementation class. In the process of executing the implementation logic code of the anonymous class according to the first class, the object type parameter may be set in the constructor of the first class, the this keyword may be passed in the constructor parameter, and the implementation logic code of the anonymous class may be written in the implementation class of the first class.
[0084] In other embodiments, the first class may include a constructor. In the process of executing the implementation logic code of the anonymous class based on the first class, the object type parameter may be set in the constructor of the first class, and the this keyword may be passed in the constructor parameter. There is no restriction on this.
[0085] Among them, the this keyword is a computing technology term, and the this keyword is a reference used to save the memory address of the current object.
[0086] In some other embodiments, the first class may include an implementation class. In the process of executing the implementation logic code of the anonymous class implemented according to the first class, the implementation logic code of the anonymous class may be written into the implementation class of the first class, and there is no limitation on this.
[0087] S304: Replace the anonymous class in the initial repair code set with the target class to obtain a target repair code set.
[0088] After the implementation logic code of the anonymous class in the initial repair code set is migrated to the target class so that the anonymous class and the target class have the same implementation logic code, the anonymous class in the initial repair code set can be replaced with the target class to obtain the target repair code set.
[0089] S305: Annotate the target class in the target repair code set.
[0090] In the above, the anonymous class in the initial repair code set is replaced with the target class to obtain the target repair code set. The target class in the target repair code set can also be marked and annotated, which can facilitate the tracing of the anonymous class and help to annotate, maintain and update the target repair code set.
[0091] The following are examples: Figure 4 As shown, Figure 4 It is a flow chart of the hot repair method in the embodiment of the present disclosure, and takes the hot repair framework Robust as an example. If the initial repair code set contains an anonymous class, a class (first class) can be created to inherit the anonymous class in the initial repair code set, and the first class is marked with "@Add" at the position. Then, an object type parameter (object parameter) is set in the constructor of the first class, and the this keyword is passed in the constructor parameter, and the implementation logic code of the anonymous class is written in the implementation class of the first class to obtain the target class. At the position of the anonymous class in the initial repair code set, the anonymous class is replaced with the target class to obtain the target repair code set. Then, the target repair code set can be packaged based on the Robust hot repair framework to obtain the target logic content (patch) corresponding to the target repair code set, and the target logic content (patch) is applied.
[0092] S306: Generate target logical content corresponding to the target repair code set.
[0093] S307: Determine the logic content corresponding to the implementation logic code of the target class from the target logic content.
[0094] S308: Execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0095] For the description of S306 - S308 , please refer to the above embodiment for details, which will not be repeated here.
[0096] In this embodiment, by obtaining an anonymous class in the initial repair code set, and processing the anonymous class as a target class to be executed in the hot repair process, wherein the anonymous class and the target class have the same implementation logic code, and according to the target class and the initial repair code set, a target repair code set is generated, a target logic content corresponding to the target repair code set is generated, the logic content corresponding to the implementation logic code of the target class is determined from the target logic content, and the logic content corresponding to the implementation logic code of the target class is executed to perform the hot repair process, which can effectively avoid the failure of hot repair when the original logic contains anonymous classes in the repair code set. By creating a first class for inheriting an anonymous class, and implementing the implementation logic code of the anonymous class according to the first class, and taking the first class that can implement the implementation logic code of the anonymous class as the target class, the implementation logic code of the anonymous class of the initial repair code set can be conveniently migrated. By migrating the implementation logic code of the anonymous class of the initial repair code set to the target class, and replacing the anonymous class in the initial repair code set with the target class to obtain the target repair code set, it can be ensured that the implementation logic code of the anonymous class is effectively executed, so as to effectively improve the integrity of the repair logic in the hot repair process. By marking and annotating the target class in the target repair code set, it is possible to facilitate the tracing of anonymous classes, which is helpful for code annotation, maintenance and update of the target repair code set.
[0097] In summary, based on the hot repair method in the embodiment of the present invention, since the logic content corresponding to the implementation logic code of the target class is executed during the hot repair process, and the target class and the anonymous class have the same implementation logic code, the target class is used to be executed during the hot repair process, which can effectively solve the technical problem that the logic content corresponding to the implementation logic code of the anonymous class in the initial repair code set cannot be effectively executed during the hot repair process, thereby achieving coverage of all logic codes in the target repair code set. Since only the implementation logic code of the anonymous class of the initial repair code set is migrated to the target class, and the implementation logic code of the non-anonymous class of the initial repair code set is maintained unchanged, the original logic can be kept unchanged. Only the modification content for the anonymous class is completed according to the repair requirements, and the implementation logic code of the anonymous class is efficiently and accurately migrated to ensure the integrity of the logic.
[0098] Figure 5 It is a schematic diagram of the structure of a thermal repair device proposed in one embodiment of the present disclosure.
[0099] like Figure 5 As shown, the thermal repair device 50 comprises:
[0100] The acquisition module 501 is used to acquire the anonymous class in the initial repair code set, and process the anonymous class into a target class to be executed in the hot repair process, wherein the anonymous class and the target class have the same implementation logic code.
[0101] The first generating module 502 is used to generate a target repair code set according to the target class and the initial repair code set.
[0102] The second generating module 503 is used to generate target logic content corresponding to the target repair code set.
[0103] The determination module 504 is used to determine the logic content corresponding to the implementation logic code of the target class from the target logic content.
[0104] The repair module 505 is used to execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
[0105] It should be noted that the aforementioned explanation of the thermal repair method is also applicable to the thermal repair device of this embodiment and will not be repeated here.
[0106] In this embodiment, an anonymous class in the initial repair code set is obtained, and the anonymous class is processed into a target class to be executed in the hot repair process, wherein the anonymous class and the target class have the same implementation logic code, and a target repair code set is generated according to the target class and the initial repair code set, a target logic content corresponding to the target repair code set is generated, the logic content corresponding to the implementation logic code of the target class is determined from the target logic content, and the logic content corresponding to the implementation logic code of the target class is executed to perform the hot repair process. This can effectively avoid hot repair failure when the original logic containing anonymous classes exists in the repair code set.
[0107] Figure 6 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 6 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0108] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processing unit 16).
[0109] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
[0110] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0111] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive").
[0112] although Figure 6 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0113] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0114] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable the human body to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the hot repair method mentioned in the above embodiment.
[0116] In order to implement the above embodiments, the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the hot repair method proposed in the above embodiments of the present disclosure is implemented.
[0117] In order to implement the above embodiments, the present disclosure further proposes a computer program product. When the instructions in the computer program product are executed by a processor, the hot repair method proposed in the above embodiments of the present disclosure is executed.
[0118] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0119] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0120] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0121] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0122] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0123] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0124] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0125] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A thermal repair method, characterized in that: The method comprises: Obtaining an anonymous class in the initial repair code set, and processing the anonymous class into a target class to be executed in a hot repair process, wherein the anonymous class and the target class have the same implementation logic code; Generate a target repair code set according to the target class and the initial repair code set; Generate target logic content corresponding to the target repair code set; Determining logic content corresponding to the implementation logic code of the target class from the target logic content; and Execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
2. The method according to claim 1, characterized in that The method of obtaining an anonymous class in the initial repair code set and processing the anonymous class into a target class to be executed in the hot repair process includes: Determining whether the initial repair code set includes the anonymous class; In response to the initial repair code set including the anonymous class, the target class is generated according to the implementation logic code of the anonymous class in the initial repair code set.
3. The method according to claim 2, characterized in that The step of generating the target class according to the implementation logic code of the anonymous class in the initial repair code set includes: Create a first class that inherits the anonymous class; The implementation logic code of the anonymous class is implemented according to the first class, and the first class that implements the implementation logic code is used as the target class.
4. The method according to claim 3, characterized in that The first class includes a construction method and / or an implementation class; wherein the implementation logic code for implementing the anonymous class according to the first class includes: Setting an object type parameter in the constructor of the first class and passing a this keyword in the constructor parameter; and The implementation logic code of the anonymous class is written into the implementation class of the first class.
5. The method according to any one of claims 1 to 4, characterized in that: The step of generating a target repair code set according to the target class and the initial repair code set includes: The anonymous class in the initial repair code set is replaced with the target class to obtain the target repair code set.
6. The method according to claim 5, characterized in that After replacing the anonymous class in the initial repair code set with the target class to obtain the target repair code set, the method further includes: The target class in the target repair code set is marked and annotated.
7. The method according to any one of claims 1 to 4, characterized in that: The generating target logic content corresponding to the target repair code set includes: Obtaining an executable script file of the target repair code set; Parsing the executable script file using a parser and obtaining parsed content; and The content obtained by the analysis is used as the target logical content.
8. The method according to any one of claims 1 to 4, characterized in that: The target logical content includes: logical content corresponding to the class information of the target class; The step of determining the logic content corresponding to the implementation logic code of the target class from the target logic content includes: The logic content in the target logic content corresponding to the class information of the target class is used as the logic content corresponding to the implementation logic code of the target class.
9. A thermal repair device, characterized in that: The device comprises: An acquisition module, used for acquiring an anonymous class in an initial repair code set, and processing the anonymous class into a target class to be executed in a hot repair process, wherein the anonymous class and the target class have the same implementation logic code; A first generating module, configured to generate a target repair code set according to the target class and the initial repair code set; A second generating module, used to generate target logic content corresponding to the target repair code set; A determination module, configured to determine logic content corresponding to the implementation logic code of the target class from the target logic content; A repair module is used to execute the logic content corresponding to the implementation logic code of the target class to perform a hot repair process.
10. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
