Application bug repair method, device, and computer equipment
By receiving and comparing the information of the repaired file and the file to be repaired, it is judged whether it meets the hot loading conditions, and hot loading is performed directly in the application server. This solves the problem in the existing technology that bug fixing needs to wait for business idle time, and achieves fast and unnecessary Bug fix for restarting server.
Patent Information
- Application Number
- CN201910319586.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2039-04-19
AI Technical Summary
In the existing technology, bug fixes on application servers need to be carried out during business idle time, and an emergency version needs to be released for repairs after get off work the next day, resulting in delayed problem solving.
By receiving the repair file input by the user, copying it to the application deployment container, obtaining and comparing the specified information of the repair file and the file to be repaired, judging whether the hot loading conditions are met, and if so, hot loading is performed and the original file is directly replaced in the application server. , fix bugs and avoid restarting the server.
It realizes rapid repair of application server bugs during business idle time, avoids the problem of delayed release, and improves the efficiency and reliability of bug repair.
Smart Images

Figure CN110134432B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of system performance optimization, and in particular to an application bug repair method, device, and computer equipment. Background Art
[0002] There will always be some serious bugs involving the business when the requirements are iterated and launched. However, even if the bug code is modified as quickly as possible after the new version is launched, it will take until the next day after get off work when the business is idle to release the emergency version for repair.
[0003] Application Contents
[0004] In view of the shortcomings of the existing technology, the present application proposes an application bug repair method, device, and computer equipment, aiming to solve the problem that the existing bug repair requires the release of versions for repair during business idle time.
[0005] The technical solution proposed in this application is:
[0006] A method for repairing a bug in an application, the method comprising:
[0007] receiving a first type of file input by a user, where the first type of file is used to fix a bug in a class file running in an application server; and copying the first type of file to an application deployment container;
[0008] Obtaining specified information of the first category of files and specified information of the second category of files, where the second category of files are class files of the first category of files to be repaired;
[0009] Compare the specified information of the first category of files with the specified information of the second category of files, and determine whether the first category of files meets the hot loading condition according to the comparison result;
[0010] If the first-category files meet the hot loading condition, the first-category files in the application deployment container are hot loaded into the application server to replace the second-category files.
[0011] Furthermore, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0012] Obtaining the last modification time of the first class file; receiving a mark input by the user, wherein the mark is an identifier of the class file in the application server;
[0013] Searching the application server for a class file corresponding to the tag to obtain a second class file;
[0014] Get the last modification time of the second type of files.
[0015] Furthermore, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0016] Obtain the last modification time and file name of the first type of file;
[0017] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0018] Get the last modification time of the second type of files.
[0019] Furthermore, in the step of comparing the specified information of the first category of files with the specified information of the second category of files and judging whether the first category of files meets the hot loading condition according to the comparison result, the following steps are included:
[0020] comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0021] If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition;
[0022] If the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files, it is determined that the first category files do not meet the hot loading conditions.
[0023] Furthermore, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0024] Obtain the file content and file name of the first type of file;
[0025] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0026] Obtaining the file content of the second type of file;
[0027] The step of comparing the specified information of the first-category file with the specified information of the second-category file and determining whether the first-category file meets the hot loading condition according to the comparison result includes:
[0028] comparing the file content of the first category of files with the file content of the second category of files;
[0029] If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition;
[0030] If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
[0031] Further, after the step of hot loading the first type of files in the application deployment container and loading them into the application server to replace the second type of files if the first type of files meet the hot loading condition, the method further includes:
[0032] Detecting whether the last modification time of the first type of files has changed;
[0033] If no change occurs, get the current time;
[0034] Obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files;
[0035] comparing the first time value with a preset time threshold;
[0036] If the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0037] Further, after the step of hot loading the first type of files in the application deployment container and loading them into the application server to replace the second type of files if the first type of files meet the hot loading condition, the method further includes:
[0038] Detecting whether the last modification time of the second type of files has changed;
[0039] If any change occurs, hot loading of the first type of files is stopped.
[0040] The present application also provides a bug repair device for an application, the device comprising:
[0041] A receiving module, used for receiving a first type of file input by a user, wherein the first type of file is used for repairing a bug in a class file running in an application server;
[0042] A copy module, used to copy the first type of files to the application deployment container;
[0043] An acquisition module, used to acquire the specified information of the first category of files and the specified information of the second category of files, where the second category of files are class files of the first category of files to be repaired;
[0044] A judgment module, used to compare the specified information of the first category of files with the specified information of the second category of files, and judge whether the first category of files meets the hot loading condition according to the comparison result;
[0045] A hot loading module is used to hot load the first type of files in the application deployment container into the application server to replace the second type of files if the first type of files meet the hot loading conditions.
[0046] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.
[0047] The present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.
[0048] According to the above technical scheme, the beneficial effects of the present application are as follows: receiving the first category of files, copying the first category of files to the application deployment container, determining whether the first category of files meet the hot loading conditions, and if the first category of files meet the hot loading conditions, then hot loading the first category of files into the application server to replace the second category of files, without restarting the application server, and fixing the application bug, aiming to solve the problem of existing bug fixing, which requires releasing a version for repair during business idle time. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flowchart of a bug repair method for an application provided by an embodiment of the present application;
[0050] Figure 2 It is a functional module diagram of a bug repair device for an application provided by an embodiment of the present application;
[0051] Figure 3 It is a schematic block diagram of the structure of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] like Figure 1 As shown, the embodiment of the present application proposes a bug repair method for an application, the method comprising the following steps:
[0054] Step S101: receiving a first type of file input by a user, where the first type of file is used to repair a bug in a class file running in an application server.
[0055] The first type of file can be directly input by the user or indirectly input by the user. The indirect input method includes: receiving a Java file input by the user, compiling the Java file into a class file through a compiler, and obtaining the first type of file. After the application is launched, a bug appears in one or some classes of the application code. The user fixes the code to form a class file, thereby obtaining the first type of file.
[0056] Step S102: copy the first type of files to the application deployment container.
[0057] Step S103: obtaining designated information of the first category files and designated information of the second category files, where the second category files are category files of the first category files to be repaired.
[0058] The second type of files corresponds to the first type of files. The second type of files are class files running in the application server, and there are bugs in these class files. The first type of files are used to repair these class files. Repair means that the application server loads the first type of files instead of the second type of files. In this way, the application server operates on the first type of files instead of the second type of files, thus being able to repair the bugs previously brought by the second type of files.
[0059] Step S104: compare the specified information of the first category files with the specified information of the second category files, and determine whether the first category files meet the hot loading condition according to the comparison result.
[0060] There are multiple ways to determine the hot loading condition. According to different determination methods, different specified information of the first type of file and the second type of file are required.
[0061] In this embodiment, step S103 includes:
[0062] Obtain the last modification time of the first type of files;
[0063] receiving a tag input by the user, wherein the tag is an identifier of a class file in the application server;
[0064] Searching the application server for a class file corresponding to the tag to obtain a second class file;
[0065] Get the last modification time of the second type of files.
[0066] The designated information of the first category of files includes the last modification time, and the designated information of the second category of files includes the last modification time. The last modification time of the first category of files may be the same as or different from the last modification time of the second category of files. It is used to determine whether the first category of files meets the hot loading conditions based on the comparison of the last modification time of the first category of files with the last modification time of the second category of files. The user selects the class files in the application server, selects the class files of the first category of files to be repaired, and then searches for the corresponding class files in the application server according to the tags input by the user to obtain the second category of files.
[0067] Correspondingly, in step S104, it includes:
[0068] comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0069] If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition;
[0070] If the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files, it is determined that the first category files do not meet the hot loading conditions.
[0071] Whether the first category of files meets the hot loading condition is determined according to the time sequence of the last modification time of the first category of files and the last modification time of the second category of files.
[0072] In some embodiments, step S103 includes:
[0073] Obtain the last modification time and file name of the first type of file;
[0074] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0075] Get the last modification time of the second type of files.
[0076] The designated information of the first category of files includes the last modification time and the file name. In this embodiment, the user does not need to input a mark. The class file to be repaired of the first category of files has the same file name as the first category of files. Therefore, the second category of files can be obtained by directly searching the application server for the class file with the same file name as the first category of files, and then the last modification time of the second category of files can be obtained.
[0077] Correspondingly, in step S104, it includes:
[0078] comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0079] If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition;
[0080] If the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files, it is determined that the first category files do not meet the hot loading conditions.
[0081] In some embodiments, step S103 includes:
[0082] Obtaining the file content of the first type of file;
[0083] receiving a tag input by the user, wherein the tag is an identifier of a class file in the application server;
[0084] Searching the application server for a class file corresponding to the tag to obtain a second class file;
[0085] The file content of the second type of file is obtained.
[0086] The designated information of the first category of files includes file content, and the designated information of the second category of files includes file content. The user selects the class files in the application server, selects the class files of the first category of files to be repaired, selects the input mark, and then searches the corresponding class files in the application server according to the mark to obtain the second category of files.
[0087] Correspondingly, in step S104, it includes:
[0088] comparing the file content of the first category of files with the file content of the second category of files;
[0089] If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition;
[0090] If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
[0091] Whether the first-category file meets the hot loading condition is determined according to whether the file content of the first-category file is the same as the file content of the second-category file.
[0092] In some embodiments, step S103 includes:
[0093] Obtain the file content and file name of the first type of file;
[0094] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0095] The file content of the second type of file is obtained.
[0096] The designated information of the first category of files includes file content and file name. In this embodiment, the user does not need to input a mark. The class file to be repaired of the first category of files has the same file name as the first category of files. Therefore, the second category of files can be obtained by directly searching the application server for class files with the same file name as the first category of files, and then the file content of the second category of files can be obtained.
[0097] Correspondingly, in step S104, it includes:
[0098] comparing the file content of the first category of files with the file content of the second category of files;
[0099] If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition;
[0100] If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
[0101] Whether the first-category file meets the hot loading condition is determined according to whether the file content of the first-category file is the same as the file content of the second-category file.
[0102] Step S105: If the first-category files meet the hot loading condition, the first-category files in the application deployment container are hot loaded into the application server to replace the second-category files.
[0103] When the hot loading condition is met, the first type of files are loaded into the application server, and the application server no longer loads the second type of files, thereby fixing the bug caused by the second type of files. It should be noted that although the application server does not load the second type of files, the second type of files still exist in the application server.
[0104] In this embodiment, after step S105, the following steps are included:
[0105] Detecting whether the last modification time of the first type of files has changed;
[0106] If no change occurs, get the current time;
[0107] Obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files;
[0108] comparing the first time value with a preset time threshold;
[0109] If the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0110] The last modification time of the first type of files has not changed, indicating that the first type of files can run stably on the application server. If the preset conditions are met during stable operation, that is, the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0111] In this embodiment, after step S105, the following steps are included:
[0112] Detecting whether the last modification time of the second type of files has changed;
[0113] If any change occurs, hot loading of the first type of files is stopped.
[0114] If the user replaces the second type of file in the application server, the last modification time of the second type of file will change. At this time, it is considered that the replaced second type of file is a class file without a bug, so the hot loading of the first type of file is stopped.
[0115] To summarize, the first type of files are received, and the first type of files are copied to the application deployment container, and it is determined whether the first type of files meet the hot loading conditions. If the first type of files meet the hot loading conditions, the first type of files are hot loaded and loaded into the application server to replace the second type of files. There is no need to restart the application server to fix the application bug, which aims to solve the problem that the existing bug fixes need to be released during business idle time to fix the version.
[0116] like Figure 2 As shown, an embodiment of the present application proposes an application bug repair device 1, and the device 1 includes a receiving module 11, a copying module 12, an acquisition module 13, a judgment module 14 and a hot loading module 15.
[0117] The receiving module 11 is used to receive a first type of file input by a user, where the first type of file is used to repair a bug in a class file running in an application server.
[0118] The first type of file can be directly input by the user or indirectly input by the user. The indirect input method includes: receiving a Java file input by the user, compiling the Java file into a class file through a compiler, and obtaining the first type of file. After the application is launched, a bug appears in one or some classes of the application code. The user fixes the code to form a class file, thereby obtaining the first type of file.
[0119] The copy module 12 is used to copy the first type of files to the application deployment container.
[0120] The acquisition module 13 is used to acquire the specified information of the first category files and the specified information of the second category files, where the second category files are category files of the first category files to be repaired.
[0121] The second type of files corresponds to the first type of files. The second type of files are class files running in the application server, and there are bugs in these class files. The first type of files are used to repair these class files. Repair means that the application server loads the first type of files instead of the second type of files. In this way, the application server operates on the first type of files instead of the second type of files, thus being able to repair the bugs previously brought by the second type of files.
[0122] The judgment module 14 is used to compare the specified information of the first-category files with the specified information of the second-category files, and judge whether the first-category files meet the hot loading condition according to the comparison result.
[0123] There are multiple ways to determine the hot loading condition. According to different determination methods, different specified information of the first type of file and the second type of file are required.
[0124] In this embodiment, the acquisition module 13 includes:
[0125] A first sub-acquisition module, used to obtain the last modification time of the first type of files;
[0126] A first sub-receiving module, configured to receive a mark input by the user, wherein the mark is an identifier of a class file in the application server;
[0127] A first sub-search module, used to search the application server for a class file corresponding to the tag to obtain a second class file;
[0128] The second sub-acquisition module is used to obtain the last modification time of the second type of files.
[0129] The designated information of the first category of files includes the last modification time, and the designated information of the second category of files includes the last modification time. The last modification time of the first category of files may be the same as or different from the last modification time of the second category of files. It is used to determine whether the first category of files meets the hot loading conditions based on the comparison of the last modification time of the first category of files with the last modification time of the second category of files. The user selects the class files in the application server, selects the class files of the first category of files to be repaired, and then searches for the corresponding class files in the application server according to the tags input by the user to obtain the second category of files.
[0130] Correspondingly, the judging module 14 includes:
[0131] A first sub-comparison module, used for comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0132] A first sub-determination module, configured to determine that the first category of files meets the hot loading condition if the last modification time of the first category of files is after the last modification time of the second category of files;
[0133] The second sub-determination module is used to determine that the first category files do not meet the hot loading conditions if the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files.
[0134] Whether the first category of files meets the hot loading condition is determined according to the time sequence of the last modification time of the first category of files and the last modification time of the second category of files.
[0135] In some embodiments, the acquisition module 13 includes:
[0136] A third sub-acquisition module is used to obtain the last modification time and file name of the first type of files;
[0137] A second sub-search module is used to search the application server for a class file with the same file name as the first class file to obtain a second class file;
[0138] The fourth sub-acquisition module is used to obtain the last modification time of the second type of files.
[0139] The designated information of the first category of files includes the last modification time and the file name. In this embodiment, the user does not need to input a mark. The class file to be repaired of the first category of files has the same file name as the first category of files. Therefore, the second category of files can be obtained by directly searching the application server for the class file with the same file name as the first category of files, and then the last modification time of the second category of files can be obtained.
[0140] Correspondingly, the judging module 14 includes:
[0141] A second sub-comparison module, used for comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0142] A third sub-determination module, configured to determine that the first category of files meets the hot loading condition if the last modification time of the first category of files is after the last modification time of the second category of files;
[0143] The fourth sub-determination module is used to determine that the first category of files does not meet the hot loading conditions if the last modification time of the first category of files is before the last modification time of the second category of files, or the last modification time of the first category of files is the same as the last modification time of the second category of files.
[0144] In some embodiments, the acquisition module 13 includes:
[0145] A fifth sub-acquisition module, used to acquire the file content of the first category of files;
[0146] A second sub-receiving module, configured to receive a mark input by the user, wherein the mark is an identifier of a class file in the application server;
[0147] A third sub-search module is used to search the application server for a class file corresponding to the tag to obtain a second class file;
[0148] The sixth sub-acquisition module is used to obtain the file content of the second type of files.
[0149] The designated information of the first category of files includes file content, and the designated information of the second category of files includes file content. The user selects the class files in the application server, selects the class files of the first category of files to be repaired, selects the input mark, and then searches the corresponding class files in the application server according to the mark to obtain the second category of files.
[0150] Correspondingly, the judging module 14 includes:
[0151] A third sub-comparison module, used for comparing the file content of the first category of files with the file content of the second category of files;
[0152] a fifth sub-determination module, configured to determine that the first-category file meets the hot loading condition if the file content of the first-category file is different from the file content of the second-category file;
[0153] The sixth sub-determination module is used to determine that the first-category files do not meet the hot loading condition if the file content of the first-category files is the same as the file content of the second-category files.
[0154] Whether the first-category file meets the hot loading condition is determined according to whether the file content of the first-category file is the same as the file content of the second-category file.
[0155] In some embodiments, the acquisition module 13 includes:
[0156] A seventh sub-acquisition module, used to obtain the file content and file name of the first category of files;
[0157] A fourth sub-search module, used to search the application server for a class file with the same file name as the first class file, to obtain a second class file;
[0158] An eighth sub-acquisition module is used to acquire the file content of the second category files.
[0159] The designated information of the first category of files includes file content and file name. In this embodiment, the user does not need to input a mark. The class file to be repaired of the first category of files has the same file name as the first category of files. Therefore, the second category of files can be obtained by directly searching the application server for class files with the same file name as the first category of files, and then the file content of the second category of files can be obtained.
[0160] Correspondingly, the judging module 14 includes:
[0161] a fourth sub-comparison module, configured to compare the file content of the first category of files with the file content of the second category of files;
[0162] a seventh sub-determination module, configured to determine that the first-category file meets the hot loading condition if the file content of the first-category file is different from the file content of the second-category file;
[0163] The eighth sub-determination module is used to determine that the first-category files do not meet the hot loading condition if the file content of the first-category files is the same as the file content of the second-category files.
[0164] Whether the first-category file meets the hot loading condition is determined according to whether the file content of the first-category file is the same as the file content of the second-category file.
[0165] The hot loading module 15 is used to hot load the first type of files in the application deployment container into the application server to replace the second type of files if the first type of files meet the hot loading conditions.
[0166] When the hot loading condition is met, the first type of files are loaded into the application server, and the application server no longer loads the second type of files, thereby fixing the bug caused by the second type of files. It should be noted that although the application server does not load the second type of files, the second type of files still exist in the application server.
[0167] In this embodiment, the device 1 comprises:
[0168] A first detection module, used to detect whether the last modification time of the first type of files has changed;
[0169] A first acquisition module, used to acquire the current time if no change occurs;
[0170] A first obtaining module, used for obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files;
[0171] A first comparison module, used for comparing the first time value with a preset time threshold;
[0172] The first prompting module is used to prompt the user to replace the second type of files in the application server if the first time value is greater than the preset time threshold.
[0173] The last modification time of the first type of files has not changed, indicating that the first type of files can run stably on the application server. If the preset conditions are met during stable operation, that is, the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0174] In this embodiment, the device 1 comprises:
[0175] A second detection module, used to detect whether the last modification time of the second type of files has changed;
[0176] The first stopping module is used to stop hot loading of the first type of files if a change occurs.
[0177] If the user replaces the second type of file in the application server, the last modification time of the second type of file will change. At this time, it is considered that the replaced second type of file is a class file without a bug, so the hot loading of the first type of file is stopped.
[0178] To summarize, the first type of files are received, and the first type of files are copied to the application deployment container, and it is determined whether the first type of files meet the hot loading conditions. If the first type of files meet the hot loading conditions, the first type of files are hot loaded and loaded into the application server to replace the second type of files. There is no need to restart the application server to fix the application bug, which aims to solve the problem that the existing bug fixes need to be released during business idle time to fix the version.
[0179] like Figure 3 As shown, in the embodiment of the present application, a computer device is also provided, which may be a server, and its internal structure may be as shown in FIG. Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a model of an application bug repair method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a bug repair method for an application is implemented.
[0180] The above-mentioned processor executes the steps of the bug repair method of the above-mentioned application: receiving a first type of file input by a user, the first type of file is used to repair bugs in class files running in an application server; copying the first type of file to an application deployment container; obtaining specified information of the first type of file and specified information of the second type of file, the second type of file is the class file to be repaired by the first type of file; comparing the specified information of the first type of file with the specified information of the second type of file, and judging whether the first type of file meets the hot loading condition according to the comparison result; if the first type of file meets the hot loading condition, hot loading the first type of file in the application deployment container and loading it into the application server to replace the second type of file.
[0181] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0182] Obtaining the last modification time of the first class file; receiving a mark input by the user, wherein the mark is an identifier of the class file in the application server;
[0183] Searching the application server for a class file corresponding to the tag to obtain a second class file;
[0184] Get the last modification time of the second type of files.
[0185] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0186] Obtain the last modification time and file name of the first type of file;
[0187] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0188] Get the last modification time of the second type of files.
[0189] In one embodiment, the step of comparing the specified information of the first category of files with the specified information of the second category of files and determining whether the first category of files meets the hot loading condition according to the comparison result includes:
[0190] comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0191] If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition;
[0192] If the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files, it is determined that the first category files do not meet the hot loading conditions.
[0193] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0194] Obtain the file content and file name of the first type of file;
[0195] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0196] Obtaining the file content of the second type of file;
[0197] The step of comparing the specified information of the first-category file with the specified information of the second-category file and determining whether the first-category file meets the hot loading condition according to the comparison result includes:
[0198] comparing the file content of the first category of files with the file content of the second category of files;
[0199] If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition;
[0200] If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
[0201] In one embodiment, if the first type of file meets the hot loading condition, the first type of file in the application deployment container is hot loaded and loaded into the application server to replace the second type of file, and then the step includes:
[0202] Detecting whether the last modification time of the first type of files has changed;
[0203] If no change occurs, get the current time;
[0204] Obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files;
[0205] comparing the first time value with a preset time threshold;
[0206] If the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0207] In one embodiment, if the first type of file meets the hot loading condition, the first type of file in the application deployment container is hot loaded and loaded into the application server to replace the second type of file, and then the step includes:
[0208] Detecting whether the last modification time of the second type of files has changed;
[0209] If any change occurs, hot loading of the first type of files is stopped.
[0210] Those skilled in the art will understand that Figure 3 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0211] The computer device of the embodiment of the present application receives the first type of files, copies the first type of files to the application deployment container, and determines whether the first type of files meet the hot loading conditions. If the first type of files meet the hot loading conditions, the first type of files are hot loaded into the application server to replace the second type of files. There is no need to restart the application server to fix the bug of the application. This is aimed at solving the problem of existing bug fixing that requires releasing a version for repair during business idle time.
[0212] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which implements a method for repairing bugs in an application when the computer program is executed by a processor, specifically: receiving a first type of file input by a user, wherein the first type of file is used to repair bugs in a class file running in an application server; copying the first type of file to an application deployment container; obtaining specified information of the first type of file and specified information of a second type of file, wherein the second type of file is a class file to be repaired by the first type of file; comparing the specified information of the first type of file with the specified information of the second type of file, and determining whether the first type of file meets a hot loading condition based on the comparison result; if the first type of file meets the hot loading condition, hot loading the first type of file in the application deployment container and loading it into the application server to replace the second type of file.
[0213] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0214] Obtaining the last modification time of the first class file; receiving a mark input by the user, wherein the mark is an identifier of the class file in the application server;
[0215] Searching the application server for a class file corresponding to the tag to obtain a second class file;
[0216] Get the last modification time of the second type of files.
[0217] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0218] Obtain the last modification time and file name of the first type of file;
[0219] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0220] Get the last modification time of the second type of files.
[0221] In one embodiment, the step of comparing the specified information of the first category of files with the specified information of the second category of files and determining whether the first category of files meets the hot loading condition according to the comparison result includes:
[0222] comparing the last modification time of the first category of files with the last modification time of the second category of files;
[0223] If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition;
[0224] If the last modification time of the first category files is before the last modification time of the second category files, or the last modification time of the first category files is the same as the last modification time of the second category files, it is determined that the first category files do not meet the hot loading conditions.
[0225] In one embodiment, the step of obtaining the specified information of the first category of files and the specified information of the second category of files includes:
[0226] Obtain the file content and file name of the first type of file;
[0227] Searching the application server for a class file with the same file name as the first class file to obtain a second class file;
[0228] Obtaining the file content of the second type of file;
[0229] The step of comparing the specified information of the first-category file with the specified information of the second-category file and determining whether the first-category file meets the hot loading condition according to the comparison result includes:
[0230] comparing the file content of the first category of files with the file content of the second category of files;
[0231] If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition;
[0232] If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
[0233] In one embodiment, if the first type of file meets the hot loading condition, the first type of file in the application deployment container is hot loaded and loaded into the application server to replace the second type of file, and then the step includes:
[0234] Detecting whether the last modification time of the first type of files has changed;
[0235] If no change occurs, get the current time;
[0236] Obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files;
[0237] comparing the first time value with a preset time threshold;
[0238] If the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
[0239] In one embodiment, if the first type of file meets the hot loading condition, the first type of file in the application deployment container is hot loaded and loaded into the application server to replace the second type of file, and then the step includes:
[0240] Detecting whether the last modification time of the second type of files has changed;
[0241] If any change occurs, hot loading of the first type of files is stopped.
[0242] The storage medium of the embodiment of the present application receives a first type of file, copies the first type of file to an application deployment container, determines whether the first type of file meets the hot loading condition, and if the first type of file meets the hot loading condition, then hot loads the first type of file into the application server to replace the second type of file. There is no need to restart the application server to fix the bug of the application, which aims to solve the problem of existing bug fixing that requires releasing a version for repair during business idle time.
[0243] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0244] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A bug repair method for an application, It is characterized in that The method comprises: receiving a first type of file input by a user, where the first type of file is used to repair a bug in a class file running in an application server; Copying the first type of files to the application deployment container; Obtaining specified information of the first category of files and specified information of the second category of files, where the second category of files are class files of the first category of files to be repaired; Compare the specified information of the first category of files with the specified information of the second category of files, and determine whether the first category of files meets the hot loading condition according to the comparison result; If the first-category file meets the hot loading condition, hot loading the first-category file in the application deployment container into the application server to replace the second-category file; In the step of receiving a first type of file input by a user, wherein the first type of file is used to repair a bug in a class file running in an application server, wherein the first type of file is an indirect input, the step includes: Receive the java file input by the user, compile the java file into a class file through the compiler, and obtain the first type of file; Or after the application is launched, a bug appears in one or some classes of the application code, and the user fixes the code to form a class file and obtains the first type of file; The step of obtaining the specified information of the first category of files and the specified information of the second category of files includes: Obtaining the file content of the first type of file; receiving a tag input by the user, wherein the tag is an identifier of a class file in the application server; Searching the application server for a class file corresponding to the tag to obtain a second class file; Obtaining the file content of the second type of file; Obtain the last modification time of the first type of files; receiving a tag input by the user, wherein the tag is an identifier of a class file in the application server; Searching the application server for a class file corresponding to the tag to obtain a second class file; Obtain the last modification time of the second type of files; Obtain the last modification time and file name of the first type of file; Searching the application server for a class file with the same file name as the first class file to obtain a second class file; Obtain the last modification time of the second type of files; The step of comparing the specified information of the first-category file with the specified information of the second-category file and determining whether the first-category file meets the hot loading condition according to the comparison result includes: comparing the last modification time of the first category of files with the last modification time of the second category of files; If the last modification time of the first category file is later than the last modification time of the second category file, it is determined that the first category file meets the hot loading condition; If the last modification time of the first category file is before the last modification time of the second category file, or the last modification time of the first category file is the same as the last modification time of the second category file, it is determined that the first category file does not meet the hot loading condition; After the step of hot loading the first type of files in the application deployment container and loading them into the application server to replace the second type of files if the first type of files meet the hot loading condition, the method further includes: Detecting whether the last modification time of the first type of files has changed; If no change occurs, get the current time; Obtaining a first time value according to a time difference between the current time and the last modification time of the first type of files; comparing the first time value with a preset time threshold; If the first time value is greater than the preset time threshold, the user is prompted to replace the second type of files in the application server.
2. The bug repair method for an application according to claim 1, It is characterized in that The step of obtaining the specified information of the first category of files and the specified information of the second category of files includes: Obtain the file content and file name of the first type of file; Searching the application server for a class file with the same file name as the first class file to obtain a second class file; Obtaining the file content of the second type of file; The step of comparing the specified information of the first-category file with the specified information of the second-category file and determining whether the first-category file meets the hot loading condition according to the comparison result includes: comparing the file content of the first category of files with the file content of the second category of files; If the file content of the first category file is different from the file content of the second category file, it is determined that the first category file meets the hot loading condition; If the file content of the first category file is the same as the file content of the second category file, it is determined that the first category file does not meet the hot loading condition.
3. The bug repair method for an application according to claim 1, It is characterized in that After the step of hot loading the first type of files in the application deployment container and loading them into the application server to replace the second type of files if the first type of files meet the hot loading condition, the method further includes: Detecting whether the last modification time of the second type of files has changed; If any change occurs, hot loading of the first type of files is stopped.
4. A bug repair device for an application, used to implement the method according to any one of claims 1 to 3, It is characterized in that The device comprises: A receiving module, used for receiving a first type of file input by a user, wherein the first type of file is used for repairing a bug in a class file running in an application server; A copy module, used to copy the first type of files to the application deployment container; An acquisition module, used to acquire the specified information of the first category of files and the specified information of the second category of files, where the second category of files are class files of the first category of files to be repaired; A judgment module, used for comparing the specified information of the first category of files with the specified information of the second category of files, and judging whether the first category of files meets the hot loading condition according to the comparison result; A hot loading module is used to hot load the first type of files in the application deployment container into the application server to replace the second type of files if the first type of files meet the hot loading conditions.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Service pack installation method
CN103823693A
Processing method and device for realizing hot deployment and server
CN104102502A
Web application updating method, apparatus and system
CN105630522A
File updating method and device
CN106909411A
Method for loading patches based on class files in Android system
CN107329783A
