CN117076318A - Method, device, equipment and storage medium for repairing bug - Google Patents

Method, device, equipment and storage medium for repairing bug Download PDF

Info

Publication number
CN117076318A
CN117076318A CN202311082769.8A CN202311082769A CN117076318A CN 117076318 A CN117076318 A CN 117076318A CN 202311082769 A CN202311082769 A CN 202311082769A CN 117076318 A CN117076318 A CN 117076318A
Authority
CN
China
Prior art keywords
bug
generating
repairing
source file
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311082769.8A
Other languages
Chinese (zh)
Inventor
蒋再武
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202311082769.8A priority Critical patent/CN117076318A/en
Publication of CN117076318A publication Critical patent/CN117076318A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/57Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/08Insurance
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application provides a method, a device, equipment and a storage medium for repairing bug. The method comprises the following steps: obtaining a repair source file of the bug through an interface, and generating a corresponding byte code object through the repair source file; generating object information of the bug in a container corresponding to the bug based on the byte code object; registering the object information of the bug into a container corresponding to the bug, and generating a target object; and repairing the bug by the target object by using a method of calling a function by reflection according to preset input parameters. The embodiment of the application aims to quickly repair the bug on the insurance system when the bug occurs by providing the bug repairing method, and ensure the safety in the repairing process.

Description

Method, device, equipment and storage medium for repairing bug
Technical Field
The present application relates to the technical field of financial science and technology, and in particular, to a bug repairing method, a bug repairing device, a computer device, and a computer readable storage medium.
Background
In the financial field of insurance, etc., it is often necessary to implement the transaction of insurance business in an online system. When the insurance system is in bug, bug repair needs to be performed in time so as not to influence the use of the insurance system.
In the prior art, the bug repair of the insurance system can be realized only by being on line and going through a set of lengthy CICD process, and the whole bug repair process usually takes a few hours. Because this process is time consuming, it is difficult to meet the real-time nature of insurance system bug fixes, and business loss and even customer complaints are easily caused. In addition, the safety of the insurance system cannot be ensured during the whole bug repairing process.
Disclosure of Invention
The application provides a bug repairing method, a bug repairing device, computer equipment and a computer readable storage medium, aiming at rapidly repairing a bug on an insurance system when the bug occurs in the insurance system and ensuring the safety in the repairing process.
In order to achieve the above object, the present application provides a method of repairing a bug, the method comprising:
obtaining a repair source file of the bug through an interface, and generating a corresponding byte code object through the repair source file;
generating object information of the bug in a container corresponding to the bug based on the byte code object;
registering the object information of the bug into a container corresponding to the bug, and generating a target object;
and repairing the bug by the target object by using a method of calling a function by reflection according to preset input parameters.
In order to achieve the above object, the present application also provides an apparatus for repairing a bug, comprising:
the acquisition module is used for acquiring the bug repair source file through an interface and generating a corresponding byte code object through the repair source file;
the generation module is used for generating object information of the bug in a container corresponding to the bug based on the byte code object;
the registration module is used for registering the object information of the bug into a container corresponding to the bug and generating a target object;
and the repairing module is used for repairing the bug through the target object by using a method of calling a function by reflection according to preset input parameters.
In addition, to achieve the above object, the present application also provides a computer apparatus including a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the steps of the bug repairing method according to any one of the embodiments of the present application when the computer program is executed.
In addition, to achieve the above object, the present application also provides a computer-readable storage medium storing a computer program, which when executed by a processor, causes the processor to implement the steps of the method for repairing bug according to any one of the embodiments of the present application.
According to the bug repairing method, bug repairing device, computer equipment and computer readable storage medium disclosed by the embodiment of the application, the bug repairing source file can be obtained through the interface, and then the corresponding byte code object is generated through the repairing source file. And generating the object information of the bug in the container corresponding to the bug based on the byte code object. Further, the object information of the bug may be registered in a container corresponding to the bug, and a target object may be generated. Thus, the bug can be repaired by the target object by using a method of calling a function by reflection according to the preset input parameters. According to the method, when the bug appears in the insurance system, the bug on the insurance system can be quickly repaired in real time, the safety in the repairing process is ensured, and further the service loss of the insurance system caused by the bug is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of a bug repairing method according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for repairing bug according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for obtaining a bug fix source file according to an embodiment of the present application;
FIG. 4 is a flow chart of generating a corresponding bytecode object according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of generating a target object according to an embodiment of the present application;
FIG. 6 is a schematic block diagram of an apparatus for repairing a bug according to an embodiment of the present application;
fig. 7 is a schematic block diagram of a computer device provided by an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations. In addition, although the division of the functional modules is performed in the apparatus schematic, in some cases, the division of the modules may be different from that in the apparatus schematic.
The term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
As shown in FIG. 1, the method for repairing bug provided by the embodiment of the application can be applied to the application environment shown in FIG. 1. The application environment includes a terminal device 110 and a server 120, where the terminal device 110 may communicate with the server 120 through a network. Specifically, the server 120 can obtain the repair source file of the bug through an interface, and generate a corresponding bytecode object through the repair source file; generating object information of the bug in a container corresponding to the bug based on the byte code object; registering the object information of the bug into a container corresponding to the bug, and generating a target object; and finally, repairing the bug through the target object by using a method of calling a function by reflection according to preset input parameters. The server 120 may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal device 110 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the present application is not limited herein.
Referring to fig. 2, fig. 2 is a flowchart illustrating a bug repairing method according to an embodiment of the present application. As shown in fig. 2, the method of repairing a bug includes steps S11 to S14.
Step S11: and obtaining a repairing source file of the bug through the interface, and generating a corresponding byte code object through the repairing source file.
The application scenario of the bug is not limited, and may be, for example, an insurance system, or may be another system.
The repair source file is a source code file of a bug in the repair insurance system, which typically contains the original code of the computer program. The repair source file is usually generated outside the insurance system and then is transmitted into the insurance system through an interface so as to repair the bug in the insurance system through the method provided by the application.
Further, the bytecode object is a Class object, i.e., an object representing a Class. A class is a blueprint or template used to create an object that defines the properties and behavior of the object. A bytecode object is metadata representing this class that contains information about the class, such as the class name, parent class, method, attributes, etc. Through the bytecode object, the attribute and method of the class can be dynamically operated and accessed, and then a target object capable of replacing the bug is generated based on the corresponding attribute and method.
The method of generating the corresponding bytecode object by repairing the source file is not limited, and may be implemented using, for example, an import statement or a dynamic compiling and loading technique, which is not limited in the present application and will be described in detail later.
In the embodiment of the application, the repairing source file of the bug can be obtained through the interface, and the corresponding byte code object is generated through the repairing source file. In this way, the bug repair of the subsequent insurance system is realized based on the generated bytecode.
Step S12: based on the bytecode object, object information of the bug is generated in a container corresponding to the bug.
Step S13: registering the object information of the bug into a container corresponding to the bug, and generating a target object.
The container corresponding to the bug is a Spring container, which can be used for managing and organizing objects in the application program, namely beans. Spring containers provide a lightweight way to create, configure, and manage the lifecycle of objects.
Further, the target object is an object that can repair and replace a bug in the insurance system.
Specifically, the generation of the bug object information in the Spring container may be implemented by the method of beans definition build. Wherein the object information of the bug includes metadata of the target object. In this way, a target object capable of repairing and replacing a bug in an insurance system can be generated based on the object information of the bug.
In the process of generating the target object, the object information of the bug can be directly registered in the Spring container, so that the generation of the target object is realized.
It should be noted that the BeanDefinitionBuilder.genericBanDefinitions is an auxiliary method in the Spring framework for creating general BeanDefinitions objects, i.e. the object information of the bug. The object information of the bug is metadata object information for describing and defining a target object in the Spring framework. The method comprises the information of class names, scope, constructor parameters, attribute values, dependency relationships and the like of target objects.
In the embodiment of the application, the object information of the bug can be generated in the Spring container based on the byte code object. And registering the object information of the bug into a Spring container, and generating a target object for realizing repairing and replacing the bug in the insurance system based on the target object.
Step S14: according to preset input parameters, repairing the bug through the target object by using a method of calling a function by reflection.
It should be noted that the present application is not limited to the preset input parameters, and may include, for example, a method name or a method parameter value.
Optionally, the preset input parameters include a method name or a method parameter value; according to preset input parameters, repairing the bug by using a reflection calling function method through a target object, wherein the method comprises the following steps: according to the method name or the method parameter value, the bug is repaired by the target object by using the method of calling the function by reflection.
Specifically, after the target object is obtained, repairing bug can be executed by a method of calling function by reflection according to the input method name and the method parameter value, so as to realize bug repairing in the insurance system.
It should be noted that, the reflection calling function dynamically calls a method at runtime through the reflection mechanism. The reflection calling function can support calling a method through the method name and the method parameter value under the condition that the specific method name and the parameter type are not known in compiling, and further repairing bug is implemented.
According to the bug repairing method disclosed by the embodiment of the application, the repairing source file of the bug can be obtained through the interface, and then the corresponding byte code object is generated through the repairing source file. And generating the object information of the bug in the container corresponding to the bug based on the byte code object. Further, the object information of the bug may be registered in a container corresponding to the bug, and a target object may be generated. Thus, the bug can be repaired by the target object by using a method of calling a function by reflection according to the preset input parameters. According to the method, when the bug appears in the insurance system, the bug on the insurance system can be quickly repaired in real time, the safety in the repairing process is ensured, and further the service loss of the insurance system caused by the bug is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for obtaining a bug fix source file according to an embodiment of the present application. As shown in fig. 3, acquiring a repair source file of a bug may be achieved through steps S111 to S123.
Step S111: code information of the bug is obtained.
Step S112: and generating a bug repair source file based on the bug code information outside the interface.
Step S113: and obtaining the repairing source file of the bug through the interface.
Specifically, code information of the bug in the insurance system can be obtained outside the interface, and then the code information based on the bug is encoded in a Base64 mode, so as to generate a bug repair source file. Furthermore, the repairing source file of the bug can be obtained through the interface, and the repairing source file of the bug can be decrypted through a Base64 mode, so that the application of the repairing source file of the bug is realized.
It should be noted that Base64 is an encoding method for converting binary data into a text format of printable characters. Base64 is able to split the original data into fixed length blocks and encode each block into ASCII characters for use in transmission or storage.
In the embodiment of the application, the code information of the bug can be obtained, and then the bug repair source file is generated outside the interface based on the code information of the bug, so that the bug repair source file is obtained, and bug repair in the insurance system is realized through the bug repair source file based on the method provided by the application.
With continued reference to fig. 4, fig. 4 is a flowchart illustrating a method for generating a corresponding bytecode object according to an embodiment of the present application. As shown in fig. 4, generating a corresponding bytecode object by repairing a source file may be implemented through steps S114 to S115.
Step S114: and compiling the repair source file to obtain the byte code corresponding to the repair source file.
Step S115: and loading the byte code corresponding to the repair source file into the virtual machine to generate a byte code object.
Specifically, the repair source file can be compiled to obtain the corresponding byte code. And dynamically loading the byte code corresponding to the repairing source file into the virtual machine to generate a byte code object.
Note that a compiling operation refers to a process of converting source code or intermediate code into executable code at runtime. Since the compilation process is closely related to the runtime environment, one major advantage of the compilation operation is that it can be optimized or modified according to the environment or user's needs.
Load operations refer to the process of loading and using code or resources as needed while a program is running. In dynamic loading, programs may selectively load specific modules, library files, or other resources according to specific conditions or user requests to increase flexibility and extensibility. Dynamic loading techniques can help reduce memory footprint of programs, improve performance, and allow code to be updated or replaced as needed at runtime.
Thus, the present application may enable the generation of bytecode objects based on compilation operations as well as load operations.
Optionally, loading the byte code corresponding to the repair source file into the virtual machine to generate a byte code object, including: preprocessing the byte code corresponding to the repair source file to obtain the byte code after the preprocessing operation; wherein the preprocessing operation comprises at least one of optimization operation and variable replacement; and loading the pre-processed byte codes into the virtual machine to generate byte code objects.
Specifically, the pre-processing operation of optimizing operation or variable replacement can be performed on the byte code corresponding to the repair source file, and then the byte code after the pre-processing operation is loaded into the virtual machine, so that a byte code object is generated. In this way, the efficiency of generating the bytecode object can be improved.
In the embodiment of the application, the generation of the byte code object can be realized through compiling operation and loading operation. Furthermore, the preprocessing operation can be performed on the byte code corresponding to the repair source file, so that the generation efficiency of the byte code object is improved.
With continued reference to fig. 5, fig. 5 is a flowchart of generating a target object according to an embodiment of the present application. As shown in fig. 5, registering the object information of the bug into the container corresponding to the bug and generating the target object may be achieved through steps S131 to S134.
Step S131: and determining class name information of the bug according to the repair source file of the bug.
Step S132: based on the class name information of the bug, judging whether an initial object exists in a container corresponding to the bug.
Step S133: and when the initial object exists in the container corresponding to the bug, deleting the initial object to obtain a target container.
Step S134: registering the object information of the bug in the target container, and generating a target object.
Wherein, the initial object has bug and the target object has no bug; the target container is a pring container where no initial object exists.
Specifically, the class name information of the bug can be determined based on the repair source file of the bug, and then the class name information is searched in the Spring container to determine whether an initial object corresponding to the bug exists. When the initial object exists in the container corresponding to the bug, the initial object can be deleted to obtain a target container which does not comprise the bug. Therefore, the object information of the bug can be registered in the target container, and the target object is generated, so that the replacement of the object with the bug in the original Spring container is realized.
Optionally, after judging whether the initial object exists in the container corresponding to the bug based on the class name information of the bug, the method further comprises: when the initial object does not exist in the container corresponding to the bug, determining the container corresponding to the bug as a target container; registering the object information of the bug in the target container, and generating a target object.
Specifically, when the Spring container does not have the initial object, the Spring container can be directly determined as the target container, and the object information of the bug is registered in the target container to generate the target object, so as to be used for repairing the bug in the insurance system.
In the embodiment of the application, the class name information of the bug can be determined according to the repair source file of the bug, and whether the initial object exists in the container corresponding to the bug is further judged based on the class name information of the bug. And when the initial object exists in the container corresponding to the bug, deleting the initial object to obtain a target container, so that the object information of the bug can be registered in the target container to generate the target object, and the replacement of the object with the bug in the original Spring container is realized. In addition, when the Spring container does not have the initial object, the Spring container may be determined as a target container, and the object information of the bug may be registered in the target container to generate a target object for repairing the bug in the insurance system.
Referring to fig. 6, fig. 6 is a schematic block diagram of an apparatus for repairing a bug according to an embodiment of the present application. The bug repairing device can be configured in a server and used for executing the bug repairing method.
As shown in fig. 6, the bug repairing apparatus 200 includes: the device comprises an acquisition module 201, a generation module 202, a registration module 203 and a repair module 204.
The obtaining module 201 is configured to obtain a repair source file of the bug through an interface, and generate a corresponding bytecode object through the repair source file;
a generating module 202, configured to generate object information of the bug in a container corresponding to the bug based on the bytecode object;
a registration module 203, configured to register object information of the bug into a container corresponding to the bug, and generate a target object;
and the repairing module 204 is configured to repair the bug by using the target object by using a method of calling a function according to a preset input parameter.
An acquisition module 201, configured to acquire code information of the bug; generating a repair source file of the bug based on the code information of the bug outside an interface; and obtaining the repairing source file of the bug through an interface.
The generating module 202 is further configured to perform compiling operation on the repair source file to obtain a byte code corresponding to the repair source file; and loading the byte code corresponding to the repair source file into a virtual machine, and generating the byte code object.
The generating module 202 is further configured to perform a preprocessing operation on the bytecode corresponding to the repair source file, so as to obtain a bytecode after the preprocessing operation; wherein the preprocessing operation comprises at least one of an optimization operation and a variable replacement; and loading the byte codes subjected to the preprocessing operation into the virtual machine, and generating the byte code object.
The registration module 203 is further configured to determine class name information of the bug according to a repair source file of the bug; judging whether an initial object exists in a container corresponding to the bug based on the class name information of the bug; wherein the initial object has the bug and the target object does not have the bug; when the initial object exists in the container corresponding to the bug, deleting the initial object to obtain a target container; wherein the target container does not include the initial object; registering the object information of the bug into the target container, and generating a target object.
A registration module 203, configured to determine, when the initial object does not exist in the container corresponding to the bug, the container corresponding to the bug as the target container; registering the object information of the bug into the target container, and generating a target object.
The repairing module 204 is further configured to repair the bug by using a method of calling a function according to the method name or the method parameter value.
It should be noted that, for convenience and brevity of description, specific working processes of the above-described apparatus and each module, unit may refer to corresponding processes in the foregoing method embodiments, which are not repeated herein.
The methods and apparatus of the present application are operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
By way of example, the methods, apparatus described above may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic diagram of a computer device according to an embodiment of the application. The computer device may be a server.
As shown in fig. 7, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium, and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform any of a number of methods of repairing a bug.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium, which when executed by a processor, causes the processor to perform any of the methods of repairing a bug.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the architecture of the computer device, which is merely a block diagram of some of the structures associated with the present application, is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in some embodiments the processor is configured to run a computer program stored in the memory to implement the steps of: obtaining a repair source file of the bug through an interface, and generating a corresponding byte code object through the repair source file; generating object information of the bug in a container corresponding to the bug based on the byte code object; registering the object information of the bug into a container corresponding to the bug, and generating a target object; and repairing the bug by the target object by using a method of calling a function by reflection according to preset input parameters.
In some embodiments, the processor is further configured to obtain code information of the bug; generating a repair source file of the bug based on the code information of the bug outside an interface; and obtaining the repairing source file of the bug through an interface.
In some embodiments, the processor is further configured to perform a compiling operation on the repair source file to obtain a bytecode corresponding to the repair source file; and loading the byte code corresponding to the repair source file into a virtual machine, and generating the byte code object.
In some embodiments, the processor is further configured to perform a preprocessing operation on the bytecode corresponding to the repair source file, to obtain a bytecode after the preprocessing operation; wherein the preprocessing operation comprises at least one of an optimization operation and a variable replacement; and loading the byte codes subjected to the preprocessing operation into the virtual machine, and generating the byte code object.
In some embodiments, the processor is further configured to determine class name information of the bug from a repair source file of the bug; judging whether an initial object exists in a container corresponding to the bug based on the class name information of the bug; wherein the initial object has the bug and the target object does not have the bug; when the initial object exists in the container corresponding to the bug, deleting the initial object to obtain a target container; wherein the target container does not include the initial object; registering the object information of the bug into the target container, and generating a target object.
In some embodiments, the processor is further configured to determine the container corresponding to the bug as the target container when the initial object is not present in the container corresponding to the bug; registering the object information of the bug into the target container, and generating a target object.
In some embodiments, the processor is further configured to repair the bug with the target object using a method of reflecting call functions according to the method name or the method parameter value.
The embodiment of the application also provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed, any method for repairing bug provided by the embodiment of the application is realized.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like.
While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method of repairing a bug, the method comprising:
obtaining a repair source file of the bug through an interface, and generating a corresponding byte code object through the repair source file;
generating object information of the bug in a container corresponding to the bug based on the byte code object;
registering the object information of the bug into a container corresponding to the bug, and generating a target object;
and repairing the bug by the target object by using a method of calling a function by reflection according to preset input parameters.
2. The method of claim 1, wherein the obtaining the bug fix source file via an interface comprises:
acquiring code information of the bug;
generating a repair source file of the bug based on the code information of the bug outside an interface;
and obtaining the repairing source file of the bug through an interface.
3. The method of claim 1, wherein the generating the corresponding bytecode object from the repair source file comprises:
compiling the repair source file to obtain byte codes corresponding to the repair source file;
and loading the byte code corresponding to the repair source file into a virtual machine, and generating the byte code object.
4. The method of claim 3, wherein loading the bytecode corresponding to the repair source file into a virtual machine, generating the bytecode object, comprises:
preprocessing the byte code corresponding to the repair source file to obtain the byte code after the preprocessing operation; wherein the preprocessing operation comprises at least one of an optimization operation and a variable replacement;
and loading the byte codes subjected to the preprocessing operation into the virtual machine, and generating the byte code object.
5. The method of claim 1, wherein before registering the object information of the bug in the container corresponding to the bug and generating the target object, further comprising:
determining class name information of the bug according to the repair source file of the bug;
judging whether an initial object exists in a container corresponding to the bug based on the class name information of the bug; wherein the initial object has the bug and the target object does not have the bug;
when the initial object exists in the container corresponding to the bug, deleting the initial object to obtain a target container; wherein the target container does not include the initial object;
the registering the object information of the bug in the container corresponding to the bug, and generating a target object, includes:
registering the object information of the bug into the target container, and generating a target object.
6. The method of claim 5, wherein after determining whether the initial object exists in the container corresponding to the bug based on the class name information of the bug, further comprising:
determining a container corresponding to the bug as the target container when the initial object does not exist in the container corresponding to the bug;
the registering the object information of the bug in the container corresponding to the bug, and generating a target object, includes:
registering the object information of the bug into the target container, and generating a target object.
7. The method of claim 1, wherein the preset input parameters include a method name or a method parameter value; the repairing of the bug by the target object by using a method of calling a function by reflection according to preset input parameters comprises the following steps:
and repairing the bug through the target object by using a method of calling a function by reflection according to the method name or the method parameter value.
8. An apparatus for repairing a bug, the apparatus comprising:
the acquisition module is used for acquiring the bug repair source file through an interface and generating a corresponding byte code object through the repair source file;
the generation module is used for generating object information of the bug in a container corresponding to the bug based on the byte code object;
the registration module is used for registering the object information of the bug into a container corresponding to the bug and generating a target object;
and the repairing module is used for repairing the bug through the target object by using a method of calling a function by reflection according to preset input parameters.
9. A computer device, comprising: a memory and a processor; wherein the memory is connected to the processor for storing a program, the processor being adapted to implement the steps of the method of repairing a bug according to any of claims 1-7 by running the program stored in the memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the steps of the method of repairing a bug according to any of claims 1-7.
CN202311082769.8A 2023-08-24 2023-08-24 Method, device, equipment and storage medium for repairing bug Pending CN117076318A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311082769.8A CN117076318A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for repairing bug

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311082769.8A CN117076318A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for repairing bug

Publications (1)

Publication Number Publication Date
CN117076318A true CN117076318A (en) 2023-11-17

Family

ID=88716751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311082769.8A Pending CN117076318A (en) 2023-08-24 2023-08-24 Method, device, equipment and storage medium for repairing bug

Country Status (1)

Country Link
CN (1) CN117076318A (en)

Similar Documents

Publication Publication Date Title
US10678522B1 (en) Compiler and method for compiling business rules for a serverless runtime environment
CN109976761B (en) Software development kit generation method and device and terminal equipment
US10481884B2 (en) Systems and methods for dynamically replacing code objects for code pushdown
US11288055B2 (en) Model-based differencing to selectively generate and deploy images in a target computing environment
CN111367510B (en) Android function module development method and device
US8924944B2 (en) Implementation of distributed methods that support generic functions
US10613844B2 (en) Using comments of a program to provide optimizations
CN111400061A (en) Data processing method and system
CN111198863A (en) Rule engine and implementation method thereof
EP4268107A1 (en) Detecting added functionality in open source package
CN111694613A (en) Decoupling method between application program modules, electronic device and storage medium
CN113987337A (en) Search method, system, equipment and storage medium based on componentized dynamic arrangement
US20140372488A1 (en) Generating database processes from process models
CN115982491A (en) Page updating method and device, electronic equipment and computer readable storage medium
CN117076318A (en) Method, device, equipment and storage medium for repairing bug
US8036921B2 (en) System and method for optimization process repeatability in an on-demand computing environment
CN116226921A (en) Desensitization processing method and device
CN115185550A (en) Service deployment method, device, computer equipment and storage medium
JP7073813B2 (en) Control programs, control methods and information processing equipment
US11580555B2 (en) Systems and methods for rules-based decisioning of events
CN112035142B (en) Data processing method, device and equipment based on software maintenance
CN114385159A (en) File processing method and device, electronic equipment and computer readable storage medium
US20060010423A1 (en) Variable namespaces and scoping for variables in an object model
CN114021133A (en) Code processing method and device, electronic equipment and storage medium
CN116719548A (en) Flow control method, device and medium for updating software program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination