System service repair method, device and server
By generating request identification in the software system and associating the call conditions and exception information of the saved service, the problem of inconsistent exception information is solved, bugs can be quickly located, maintenance costs can be reduced, and system stability can be improved.
Patent Information
- Application Number
- CN202010137667.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-02
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-03-02
AI Technical Summary
When an exception occurs during the operation of the software system, the description of the exception information is inconsistent, making it difficult for engineers to quickly locate the bug, affecting repair efficiency and increasing maintenance costs.
Generate a request identifier, associate and save the calling conditions and exception information of the service, use the request identifier to quickly repair the service, including saving the calling conditions and exception information during the service call process, and obtain the calling conditions and exception information of the abnormal service through the request identifier for repair Serve.
It improves the efficiency of service repair, reduces the cost of maintaining the system, improves the stability of system operation, and reduces the number of repeated debugging by engineers.
Smart Images

Figure CN113342556B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system service repair, and in particular to a system service repair method, device and server. Background Art
[0002] During the operation of the software system, if an operation abnormality occurs, it is necessary to output abnormal information so that engineers can handle bugs (errors / vulnerabilities / failures) in the software system based on the abnormal information and maintain the stable operation of the system. This requires R&D personnel to enable the modules to have the function of outputting abnormal information during the development of each module of the software system. However, the description method and degree of detail of the abnormal information are easily affected by the personal habits and R&D experience of the R&D personnel, resulting in uneven quality of the output abnormal information. Some abnormal information only includes a single error message. Based on this single error message, engineers need to debug the system repeatedly to find the specific location of the bug, which affects the efficiency of repairing system bugs, resulting in high cost of maintaining the system and is not conducive to the stable operation of the system. Summary of the invention
[0003] The object of the present invention is to provide a method, device and server for repairing system services, so as to improve the efficiency of service repair, reduce the cost of maintaining the system, and improve the stability of system operation.
[0004] In the first aspect, an embodiment of the present invention provides a method for repairing a system service, the method comprising: if an access request is received from a client, generating a request identifier corresponding to the access request, and carrying the request identifier into the access request; calling a service associated with the access request to process the access request carrying the request identifier through the service; in the process of calling the service, associating and saving the calling conditions and request identifier of the service; if an exception occurs in the service during the calling process, associating and saving the exception information and request identifier of the service to repair the service through the calling conditions, exception information and request identifier.
[0005] Furthermore, the calling conditions of the service include: calling parameters of the service and / or system environment parameters of the current running of the service.
[0006] Furthermore, the above method also includes: if no exception occurs during the service call, the output parameters and request identifier of the service are associated and saved.
[0007] Furthermore, after the step of associating and saving the abnormal information of the service and the request identifier, the method further includes: generating an abnormality repair notification; the abnormality repair notification includes at least the request identifier.
[0008] In the second aspect, an embodiment of the present invention provides a method for repairing a system service, the method comprising: if an exception repair notification is received, extracting a request identifier from the exception repair notification; the request identifier corresponds to a preset access request; obtaining an operation record associated with the request identifier; the operation record comprises: the calling conditions and exception information of the preset service corresponding to the request identifier; the preset service is: the service called by the server when processing the access request; and repairing the service where the exception occurs according to the obtained operation record.
[0009] Furthermore, based on the acquired operation record, the step of repairing the service where the exception occurs includes: determining the target service where the exception occurs from the preset services in the operation record based on the exception information in the operation record; inputting the calling conditions corresponding to the target service in the operation record into the simulation service corresponding to the target service to obtain an output result; determining the service vulnerability of the target service based on the output result; and repairing the service vulnerability of the target service.
[0010] Furthermore, the above method also includes: obtaining operation records associated with multiple preset request identifiers; counting the number of calls of each preset service in the obtained operation records to obtain a first statistical result; and determining the utilization rate of each preset service based on the first statistical result.
[0011] Furthermore, the operation record also includes: the calling time of the preset service corresponding to the request identifier; the above method also includes: obtaining the operation records associated with multiple preset request identifiers; determining the processing time of the access request corresponding to each request identifier based on the calling time of the preset service corresponding to each request identifier; counting the processing time of the access request corresponding to each request identifier to obtain a second statistical result; and determining the operating efficiency of the service system corresponding to the preset service based on the second statistical result.
[0012] In a third aspect, an embodiment of the present invention provides a system service repair device, which includes: an identification generation module, which is used to generate a request identification corresponding to the access request if an access request is received from a client, and carry the request identification into the access request; a service calling module, which is used to call the service associated with the access request, so as to process the access request carrying the request identification through the service; in the process of calling the service, the calling conditions and request identification of the service are associated and saved; a service repair module, which is used to associate and save the exception information and request identification of the service if an exception occurs in the service calling process, so as to repair the service through the calling conditions, exception information and request identification.
[0013] In a fourth aspect, an embodiment of the present invention provides a system service repair device, which includes: an identifier extraction module, which is used to extract a request identifier from an exception repair notification if an exception repair notification is received; the request identifier corresponds to a preset access request; a record acquisition module, which is used to obtain an operation record associated with the request identifier; the operation record includes: the calling conditions and exception information of the preset service corresponding to the request identifier; the preset service is: the service called by the server when processing the access request; and a service repair module, which is used to repair the service with the exception according to the acquired operation record.
[0014] In a fifth aspect, an embodiment of the present invention provides a server, including a processor and a memory, the memory storing machine executable instructions that can be executed by the processor, and the processor executing the machine executable instructions to implement a method for repairing a system service of any implementation of the first aspect or the second aspect.
[0015] In a sixth aspect, an embodiment of the present invention provides a machine-readable storage medium having a computer program stored thereon. When the computer program is executed by a processing device, the steps of a method for repairing a system service as implemented in any one of the first aspect or the second aspect are executed.
[0016] The embodiments of the present invention bring the following beneficial effects:
[0017] The embodiment of the present invention provides a method, device and server for repairing a system service. In the method, first, a request identifier corresponding to the access request is generated according to the received access request. In the process of calling the service, the calling condition and the request identifier of the service are associated and saved; if an exception occurs in the service during the calling process, the abnormal information and the request identifier of the service are associated and saved, so as to repair the service through the calling condition, abnormal information and request identifier. In this method, in the process of calling the relevant service to handle the access request, the calling condition and the request identifier of the service are associated and saved; if an exception occurs in the service, the abnormal information and the request identifier of the service are also associated and saved; when the engineer subsequently repairs the abnormal service, the calling condition and the abnormal information of the abnormal service can be obtained through the request identifier; based on this information, the reason for the abnormality of the service can be quickly known, and then the service can be quickly repaired without the need for the engineer to repeatedly debug the system, thereby improving the efficiency of service repair, reducing the cost of maintaining the system, and improving the stability of system operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flowchart of a method for repairing a system service provided by an embodiment of the present invention;
[0020] Figure 2 A flowchart of another method for repairing a system service provided by an embodiment of the present invention;
[0021] Figure 3 A flowchart of another method for repairing a system service provided by an embodiment of the present invention;
[0022] Figure 4 A flowchart of a method for determining utilization of a preset service provided by an embodiment of the present invention;
[0023] Figure 5 A flowchart of a method for determining the operating efficiency of a service system provided by an embodiment of the present invention;
[0024] Figure 6 A flowchart of a specific method for repairing system services provided by an embodiment of the present invention;
[0025] Figure 7 A schematic diagram of the structure of a repair device for a system service provided by an embodiment of the present invention;
[0026] Figure 8 A schematic diagram of the structure of another system service repair device provided by an embodiment of the present invention;
[0027] Fig. 9 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] With the birth of computers and the development of software systems, bugs will appear in software development and operation. Programmers can usually fix them during the development process, but after the software is deployed to the production environment, it is difficult to fix the bugs in the production environment. Since the program needs to run based on the previous and next codes, when a bug occurs, it is necessary to clearly know the call logic and function execution parameters during the program operation process in order to accurately fix the bug in the system. The method of fixing bugs in the production environment usually uses the method of capturing exceptions and recording exception information. For example, when the client accesses the server, an operation exception occurs. The server can only write the exception information to the log and return the exception result to the client. At the same time, the exception will be graded. If a more urgent exception information is encountered, it will be sent directly to the corresponding person in charge through email, SMS, etc. However, this method can only record the exception information, but not the conditions for program operation. Developers usually cannot quickly handle bugs based on the exception information alone, which increases the cost of bug repair.
[0030] Based on this, the embodiment of the present invention provides a method, device and server for repairing a system service. The technology can be applied to bug repair scenarios of various system services such as websites. The technology can be implemented using relevant software and hardware, and is described below through an embodiment. To facilitate understanding of this embodiment, a method for repairing a system service disclosed in an embodiment of the present invention is first introduced in detail.
[0031] First, an embodiment of the present invention provides a method for repairing a system service, such as Figure 1 As shown, the execution subject of the method may be a server, and the method includes the following steps:
[0032] Step S102: if an access request is received from a client, a request identifier corresponding to the access request is generated, and the request identifier is carried in the access request;
[0033] The above-mentioned client can also be called the user end, which usually corresponds to the server end running on the server. It is a program that provides local services to customers. In addition to some applications that only run locally, the client can also cooperate with the server end to run. For example, a web browser, an email client, etc. The above-mentioned access request can be an access request sent by the client to the server end of the website to access the corresponding information in the website, for example, to access a certain web page, email, etc. The access request may include the user name, password, tasks to be completed, parameters to be called, etc. The above-mentioned request identifier may refer to an identifier corresponding to the access request, which is global and non-repetitive, and can represent the uniqueness of the corresponding access request. The identity identifier can be set to a unique digital code value, etc.
[0034] Specifically, when making an access request, a unique request identifier corresponding to the access request will be generated. When making a specific access, the generated request identifier will be carried in the access request, and the specific operation will be completed following the access request. For example, the request identifier can be added to a specific field of the access request.
[0035] Step S104, calling a service associated with the access request to process the access request carrying the request identifier through the service; in the process of calling the service, the calling condition of the service and the request identifier are associated and saved;
[0036] The above-mentioned associated services usually refer to programs associated with access requests, which can process tasks in access requests so that the client can obtain corresponding access request results. For example, when searching for content related to "computer" on a website, the website will call a related program with a search function, and by inputting corresponding parameters, the program returns the corresponding request results. Since there may be multiple services associated with an access request, the above-mentioned called services may include multiple services, and multiple associated services are called in a certain order to complete the access request task. The above-mentioned calling conditions may refer to conditions such as parameter information of the function in the calling program and operating environment information. During the calling process, each time the program is called, the condition information related to the calling program, the return value information and the request identifier corresponding to the access request will be saved.
[0037] Specifically, when processing an access request, multiple related services may be called. First, in the process of calling the first related service, the current calling condition and the request identifier corresponding to the access request will be saved. Each time a task is completed or a call is made, the above saving step will be performed. In addition, the process of processing each task may include checking the user name and password carried in the access request to ensure the security of access.
[0038] Step S106, if an exception occurs in the service during the calling process, the exception information and the request identifier of the service are associated and saved, so as to repair the service according to the calling condition, the exception information and the request identifier.
[0039] The above-mentioned exception information may be that an exception occurred during the process of calling the program, making it impossible to complete the access task and obtain the result of the access request, such as no access rights, unable to convert normally, and other exceptions. In addition, when an exception occurs, the current calling conditions and request identifiers will also be recorded. The above-mentioned saving process may be to persistently write the service's calling conditions, exception information, and request identifier data into a database to facilitate subsequent programmer calls. Specifically, the complete calling process associated with the access request can be obtained through the request identifier, wherein the calling process is recorded in a specific calling order, so the abnormal task program can be obtained according to the request identifier, and then the recorded exception information can be reproduced according to the calling conditions. According to the calling conditions, exception information, request identifier, and the reproduction process, the bugs of the system service can be repaired in a targeted manner.
[0040] An embodiment of the present invention provides a method for repairing a system service. In this method, first, a request identifier corresponding to the access request is generated according to a received access request. In the process of calling the service, the calling conditions and the request identifier of the service are associated and saved. If an exception occurs in the service during the calling process, the exception information and the request identifier of the service are associated and saved, so as to repair the service through the calling conditions, exception information and request identifier. In this method, in the process of calling the relevant service to handle the access request, the calling conditions and the request identifier of the service are associated and saved. If an exception occurs in the service, the exception information and the request identifier of the service are also associated and saved. When the engineer subsequently repairs the abnormal service, the calling conditions and the exception information of the abnormal service can be obtained through the request identifier. Based on this information, the cause of the abnormality of the service can be quickly known, and then the service can be quickly repaired without the need for the engineer to repeatedly debug the system, thereby improving the efficiency of service repair, reducing the cost of maintaining the system, and improving the stability of system operation.
[0041] Furthermore, the calling conditions of the above services include: calling parameters of the service and / or system environment parameters of the current running of the service.
[0042] The calling parameters of the above-mentioned services may refer to the parameters that the current service needs to call the function, and the parameters are usually sent to the server together with the access request. The system environment parameters of the current operation of the above-mentioned services may include the operating system of the server, for example, macOS, Linux, iOS, etc. Since the operating system parameters of different servers are different, exceptions may or may not occur when the service runs on different operating systems. Therefore, the calling conditions of the above-mentioned services may include the calling parameters of the service and the system environment parameters of the current operation of the service; they may also include the calling parameters of the service or the system environment parameters of the current operation of the service. A calling service that only includes the system environment parameters of the current operation of the service may indicate that the current service has no operation of calling the program. Specifically, the corresponding service tasks can be completed through the calling parameters of the above-mentioned services and the system environment parameters of the current operation of the service.
[0043] The method provided in this embodiment also includes: if no exception occurs during the service call, the output parameters of the service and the request identifier are associated and saved.
[0044] For a server, the number of access requests it may receive is very large. If all data is saved in the database, the amount of data in the database will be very large. Therefore, when no operational abnormalities occur, the data can be saved in a way that does not involve a cache with I / O (input / output) operations and does not perform data persistence operations, such as redis caching.
[0045] Furthermore, after the step of associating and saving the service exception information and the request identifier in the above step S206, the method further includes: generating an exception repair notification; the exception repair notification at least includes the request identifier.
[0046] When an operation exception occurs, in order to repair the exception, an exception repair notification can be generated, which includes at least a request identifier, and of course can also include call conditions, exception information, etc.; the above-generated exception repair notification can be used to notify the corresponding programmer to perform system service repair operations based on the information included in the exception repair notification. In addition, according to the level of the exception and the abnormal service, a corresponding notification object can usually be set, so the above-mentioned exception repair notification can include the corresponding notification object.
[0047] In the above method, by setting the identity identifier, the running process of the service call is recorded in a standardized manner through the interface, and the entire running process and information such as the called program parameters can be saved, especially the relevant information data of the exception that occurs can be persisted. This can solve the problem that developers have no way to return multiple exception information when developing products in a solution way, and thus can quickly resolve running errors.
[0048] The embodiment of the present invention provides another method for repairing system services, such as Figure 2 As shown, the execution subject of the method is a terminal device for repairing services, and the method includes the following steps:
[0049] Step S202: if an abnormality repair notification is received, extract a request identifier from the abnormality repair notification; the request identifier corresponds to a preset access request;
[0050] The above-mentioned exception repair notification at least includes a request identifier. The above-mentioned preset access request can be an access request sent by the client to the server, wherein each access request has a request identifier uniquely corresponding to it. If an exception repair notification is received, it means that an exception has occurred in the preset access request during operation, and the programmer needs to perform a repair operation on the corresponding exception repair notification. Specifically, the request identifier can be extracted from the exception repair notification, and the specific information of the operation exception can be understood through the request identifier.
[0051] Step S204, obtaining the operation record associated with the request identifier; the operation record includes: the calling condition and exception information of the preset service corresponding to the request identifier; the preset service is: the service called by the server when processing the access request;
[0052] Since the request identifier is saved for each service call, the request identifier is associated with the service call operation record, which may include the specific operation process and exception information. When processing an access request, multiple services may be called, so the corresponding multiple services can be obtained according to the request identifier, and the call conditions and exception information of the preset service can be obtained through the request identifier.
[0053] Step S206: repair the abnormal service according to the acquired operation record.
[0054] Since the operation record includes the calling conditions and exception information of the preset service where the exception occurred, the developer can reconstruct the exception information based on the operation record, which is equivalent to re-simulating the exception process in another scenario according to the running process in the access request, including the calling parameters, the input parameters of the preset service, and the programs included in the preset service, which are the same as the running process in the actual application program. Therefore, the programmer can repair the service where the exception occurs according to the problems encountered in the process.
[0055] The embodiments of the present invention provide a method, device and server for repairing system services. In the method, first, according to the received abnormal repair notification, the operation record associated with the request identifier is obtained, and according to the obtained operation record, the abnormal service is repaired. In this method, the received abnormal repair notification contains a variety of error information associated with the abnormal information, and the specific location of the bug can be quickly located by directly obtaining it, thereby improving the efficiency of repairing system bugs, reducing the cost of maintaining the system, and thus improving the stability of system operation.
[0056] The embodiment of the present invention provides another method for repairing system services, which is implemented on the basis of the method of the above embodiment; the method focuses on describing the specific implementation process of the step of repairing the abnormal service according to the acquired operation record (through steps S306-S310), such as Figure 3 As shown, the method comprises the following steps:
[0057] Step S302: if an abnormality repair notification is received, extract a request identifier from the abnormality repair notification; the request identifier corresponds to a preset access request;
[0058] Step S304, obtaining the operation record associated with the request identifier; the operation record includes: the calling condition and exception information of the preset service corresponding to the request identifier; the preset service is: the service called by the server when processing the access request;
[0059] Step S306, according to the abnormal information in the operation record, determine the target service where the abnormality occurs from the preset services in the operation record;
[0060] The target service may be a preset service corresponding to the exception information, so the target service may be determined by the record location of the exception information. If an exception repair notification is received, in the operation record associated with the request identifier included in the notification, since the call of the service in the access request will be stopped after the exception occurs, the last running service may be the target service of the exception.
[0061] Step S308, input the call condition corresponding to the target service in the operation record into the simulation service corresponding to the target service to obtain an output result;
[0062] Since the system services in the production environment cannot be debugged, the above-mentioned simulation service corresponding to the target service can be reproduced in the local system according to the target service in the operation record. At the same time, the calling conditions corresponding to the target service in the operation record are input into the simulation service corresponding to the target service, and an error result corresponding to the recorded exception information can be obtained.
[0063] Step S310, determining the service vulnerability of the target service according to the output result;
[0064] The above output results are usually more specific operation errors, such as wrong input parameter type, invalid input parameters, etc. For example, if the target service can only input fixed parameters, but other parameters are input in the access request, resulting in an operation exception, according to the method of step S308, the parameters are re-entered into the corresponding simulation service, and the output results for the exception can be obtained. The result can indicate that the wrong input parameters are input, etc., so that the service vulnerability of the target service can be accurately determined.
[0065] Step S312, repairing the service vulnerability of the target service.
[0066] According to the output results obtained above, the service vulnerability of the target service can be determined. According to the vulnerability, the service vulnerability of the target service can be repaired by optimizing the code, so that subsequent users can avoid the same problem when using the system service.
[0067] The embodiment of the present invention provides another method for repairing system services. In this method, according to the abnormal information in the operation record in the received abnormal repair notification, the target service where the abnormality occurs is determined from the preset services in the operation record; the call conditions corresponding to the target service in the operation record are input into the simulation service corresponding to the target service to obtain an output result; according to the output result, the service vulnerability of the target service is determined; and the service vulnerability of the target service is repaired. In this method, the abnormal repair notification contains a variety of error information associated with the abnormal information. According to the error information, the specific location of the bug can be quickly found, which improves the efficiency of repairing system bugs, reduces the cost of maintaining the system, and thus improves the stability of system operation.
[0068] Also, see Figure 4 The flowchart of a method for determining the utilization rate of a preset service is shown in FIG. 1 , wherein the method further comprises a method for determining the utilization rate of a preset service, such as Figure 4 As shown, the method comprises the following steps:
[0069] Step S402, obtaining operation records associated with a plurality of preset request identifiers;
[0070] Since each access request is saved during its operation and calling process, developers can monitor the system operation status according to their needs. They can obtain the operation records associated with multiple preset request identifiers through the saved database and perform relevant utilization statistics.
[0071] Step S404, counting the number of calls of each preset service in the acquired operation record to obtain a first statistical result;
[0072] The above-mentioned operation records usually include multiple preset services, among which some services have more functions and can complete many tasks; some services are less used and have fewer calls; the above-mentioned first statistical result can be the value of the number of calls of each preset service. Specifically, the number of calls of each preset service can be counted through data statistics to obtain the corresponding number of calls of each preset service.
[0073] Step S406: Determine the utilization rate of each preset service according to the first statistical result.
[0074] Specifically, the total number of times in the first result is counted, and for each preset service call, the ratio of the total number of times is calculated to obtain the utilization rate of each preset service. For example, the total number of times in the first result is 100 times, among which the number of calls of the first preset service is 19 times, and the utilization rate of the first preset service is 19%.
[0075] For further information, see Figure 5 The flowchart of a method for determining the operating efficiency of a service system shown in the figure, the method also includes a method for determining the operating efficiency of a service system, wherein the operation record also includes: the calling time of the preset service corresponding to the request identifier; Figure 5 As shown, the method comprises the following steps:
[0076] Step S502, obtaining operation records associated with a plurality of preset request identifiers;
[0077] Since each access request is saved during its operation and calling process, developers can monitor the system operation status according to their needs. They can obtain the operation records associated with multiple preset request identifiers through the saved database and perform statistics on related operation efficiency.
[0078] Step S504, determining the processing time of the access request corresponding to each request identifier according to the calling time of the preset service corresponding to each request identifier;
[0079] The above-mentioned call time may mean that when processing a request, each time the relevant service is performed, the server will record the current time and record it in the database together with the request identifier. Therefore, the above-mentioned processing time may be the time difference between the start time of receiving the access request and the final time of returning the data to the client.
[0080] Step S506, counting the processing time of the access request corresponding to each request identifier to obtain a second statistical result;
[0081] Through the above step S504, the processing time of the access requests corresponding to the multiple request identifiers can be obtained, and the processing time corresponding to the access request and the multiple access requests can be obtained by means of data statistics, and the processing time is used as the second result.
[0082] Step S508: determining the operating efficiency of the service system corresponding to the preset service according to the second statistical result.
[0083] Specifically, according to the processing time of each access request in the second result, the processing time of the preset service included in each access request can be counted, wherein the running time corresponding to the preset service included in each access request is the same as the processing time. Therefore, the processing time of the preset service included in each access request can reflect the operating efficiency of the service system corresponding to the preset service.
[0084] In this method, during the process of repairing system services through request identifiers, the utilization rate of preset services and the operating efficiency of the service system can be calculated through data statistics based on the operating records associated with the request identifiers, thereby monitoring the operating status of the system.
[0085] This embodiment provides a specific implementation method. Figure 6 A flowchart of a specific method for repairing a system service is shown, in which module A and module B correspond to the above-mentioned services associated with the access request, UUID (Universally Unique Identifier) corresponds to the above-mentioned request identifier, current function call parameters correspond to the call parameters of the above-mentioned service, the server environment corresponds to the system environment parameters of the above-mentioned service currently running, each small box in module A and module B represents a called program, and the boxes horizontally connected to the small boxes represent the process of data preservation.
[0086] Specifically, the access request in this embodiment needs to call two modules. First, module A needs to be called to complete the task of business A. The first small box in module A indicates that the program is called, and the parameters Cookie (data stored on the user's local terminal), clientIp (client IP), etc. in the access request are input into the program. At the same time, a unique value is given to the access request through UUID to identify the uniqueness of the request, and the current function call parameters and service environment are recorded, where the current function call parameters refer to Cookie and clientIp; the small box below the first small box indicates the verification of the user name and password carried in the access request. This process also needs to record the UUID, current function call parameters and service environment; according to the direction of the arrow marked in the figure, the programs represented by the remaining small boxes in module A are called, and the UUID, current function call parameters and service environment are also recorded.
[0087] When completing the task of business B, it is necessary to call the program in module B. Also, record the UUID, current function call parameters and service environment during the call and operation. An exception occurs at the first small box in module B. At this time, it is also necessary to record the UUID, current function call parameters and service environment. In addition, it is necessary to record the error information. The error information corresponds to the above exception information. According to the preset exception level, the information is sent to the corresponding person in charge. The information includes: error information, request UUID. The corresponding person in charge can quickly reproduce the scene where the bug occurs based on the call information. It should be noted that after the exception occurs, the access request will no longer be processed, and the service that is not called included in the access request will no longer be called.
[0088] Corresponding to the above-mentioned system service repair method embodiment, the embodiment of the present invention provides a structural schematic diagram of a system service repair device, such as Figure 7 As shown, the device comprises:
[0089] The identifier generating module 71 is used to generate a request identifier corresponding to the access request if an access request is received from a client, and carry the request identifier into the access request;
[0090] The service calling module 72 is used to call the service associated with the access request, so as to process the access request carrying the request identifier through the service; in the process of calling the service, the calling condition of the service and the request identifier are associated and saved;
[0091] The service repair module 73 is used to associate and save the service exception information and request identifier if an exception occurs during the service call process, so as to repair the service according to the call condition, exception information and request identifier.
[0092] Furthermore, the calling conditions of the above services include: calling parameters of the service and / or system environment parameters of the current running of the service.
[0093] Furthermore, the above device is also used for: if no exception occurs during the service call process, associating and saving the output parameters and request identifier of the service.
[0094] Furthermore, the above-mentioned device is also used for: generating an abnormality repair notification; the abnormality repair notification at least includes a request identifier.
[0095] An embodiment of the present invention provides a system service repair device. In this method, first, a request identifier corresponding to the access request is generated according to the received access request. In the process of calling the service, the calling conditions and the request identifier of the service are associated and saved. If an exception occurs in the service during the calling process, the abnormal information of the service and the request identifier are associated and saved, so as to repair the service through the calling conditions, abnormal information and request identifier. In this method, the request identifier is set, and the parameters in the service calling process are recorded. When an exception occurs, the saved multiple information is directly obtained, so as to accurately locate the specific location of the bug, improve the efficiency of repairing system bugs, reduce the cost of maintaining the system, and thus improve the stability of system operation.
[0096] Corresponding to the above-mentioned system service repair method embodiment, the present invention provides a structural diagram of another system service repair device, such as Figure 8 As shown, the device comprises:
[0097] The identifier extraction module 81 is used to extract the request identifier from the abnormality repair notification if the abnormality repair notification is received; the request identifier corresponds to the preset access request;
[0098] The record acquisition module 82 is used to acquire the operation record associated with the request identifier; the operation record includes: the calling condition and abnormal information of the preset service corresponding to the request identifier; the preset service is: the service called by the server when processing the access request;
[0099] The service repair module 83 is used to repair abnormal services according to the acquired operation records.
[0100] Furthermore, the service repair module is used to: determine the target service where the exception occurs from the preset services in the operation record based on the exception information in the operation record; input the calling conditions corresponding to the target service in the operation record into the simulation service corresponding to the target service to obtain the output result; determine the service vulnerability of the target service based on the output result; and repair the service vulnerability of the target service.
[0101] Furthermore, the above-mentioned device is also used to: obtain operation records associated with multiple preset request identifiers; count the number of calls of each preset service in the obtained operation records to obtain a first statistical result; and determine the utilization rate of each preset service based on the first statistical result.
[0102] Furthermore, the above-mentioned operation record also includes: the calling time of the preset service corresponding to the request identifier; the above-mentioned device is also used to: obtain the operation records associated with multiple preset request identifiers; determine the processing time of the access request corresponding to each request identifier according to the calling time of the preset service corresponding to each request identifier; count the processing time of the access request corresponding to each request identifier to obtain a second statistical result; determine the operation efficiency of the service system corresponding to the preset service according to the second statistical result.
[0103] An embodiment of the present invention provides a system service repair device. In this method, first, according to the received abnormal repair notification, the operation record associated with the request identifier is obtained, and according to the obtained operation record, the abnormal service is repaired. In this method, the received abnormal repair notification contains a variety of error information associated with the abnormal information, and the specific location of the bug can be located by directly obtaining it, thereby improving the efficiency of repairing system bugs, reducing the cost of maintaining the system, and thus improving the stability of system operation.
[0104] The system service repair device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned system service repair method embodiment. For the sake of brief description, for matters not mentioned in the system service repair device embodiment, reference may be made to the corresponding contents in the aforementioned system service repair method embodiment.
[0105] The embodiment of the present invention also provides a server, see Fig. 9 As shown, it includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the repair method of the above system service.
[0106] Further, Fig. 9 The server shown also includes a bus 132 and a communication interface 133 , and the processor 130 , the communication interface 133 and the memory 131 are connected via the bus 132 .
[0107] The memory 131 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 132 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] The processor 130 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 130. The above processor 130 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the above embodiment in combination with its hardware.
[0109] An embodiment of the present invention also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the repair method of the above-mentioned system service. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0110] The computer program product of the system service repair method, device and server provided in the embodiments of the present invention includes a machine-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a machine-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0112] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for repairing a system service, characterized in that: The method comprises: If an access request is received from a client, a request identifier corresponding to the access request is generated, and the request identifier is carried in the access request; Invoke a service associated with the access request to process the access request carrying the request identifier through the service; in the process of invoking the service, associate and save the calling condition of the service and the request identifier; If an exception occurs in the process of calling the service, the exception information of the service and the request identifier are associated and saved, so as to repair the service according to the calling condition, the exception information and the request identifier.
2. The method according to claim 1, characterized in that The method further comprises: If no exception occurs during the calling process of the service, the output parameter of the service and the request identifier are associated and saved.
3. The method according to claim 1, characterized in that: After the step of associating and saving the abnormal information of the service and the request identifier, the method further includes: Generate an exception repair notification; the exception repair notification at least includes the request identifier.
4. A method for repairing a system service, characterized in that: The method comprises: If an exception repair notification is received, extracting a request identifier from the exception repair notification; the request identifier corresponds to a preset access request; Acquire an operation record associated with the request identifier; the operation record includes: a calling condition and abnormal information of a preset service corresponding to the request identifier; the preset service is: a service called by the server when processing the access request; Repair the abnormal service according to the acquired operation record.
5. The method according to claim 4, characterized in that The steps of repairing the abnormal service according to the acquired operation record include: According to the abnormal information in the operation record, determining the target service where the abnormality occurs from the preset services in the operation record; Input the calling condition corresponding to the target service in the operation record into the simulation service corresponding to the target service to obtain an output result; Determine a service vulnerability of the target service according to the output result; Repair the service vulnerability of the target service.
6. The method according to claim 4, characterized in that The method further comprises: Obtaining operation records associated with a plurality of preset request identifiers; Counting the number of calls of each preset service in the acquired operation record to obtain a first statistical result; The utilization rate of each of the preset services is determined according to the first statistical result.
7. The method according to claim 4, characterized in that The operation record also includes: the calling time of the preset service corresponding to the request identifier; The method further comprises: Obtaining operation records associated with a plurality of preset request identifiers; Determining the processing time of the access request corresponding to each request identifier according to the calling time of the preset service corresponding to each request identifier; Counting the processing time of the access request corresponding to each request identifier to obtain a second statistical result; The operating efficiency of the service system corresponding to the preset service is determined according to the second statistical result.
8. A system service repair device, characterized in that: The device comprises: An identification generating module, configured to generate a request identification corresponding to an access request if an access request is received from a client, and carry the request identification into the access request; A service calling module, used for calling a service associated with the access request, so as to process the access request carrying the request identifier through the service; in the process of calling the service, the calling condition of the service and the request identifier are associated and saved; The service repair module is used to associate and save the abnormal information of the service and the request identifier if an abnormality occurs during the calling process of the service, so as to repair the service according to the calling condition, the abnormal information and the request identifier.
9. A system service repair device, characterized in that: The device comprises: An identifier extraction module, configured to extract a request identifier from the abnormality repair notification if an abnormality repair notification is received; the request identifier corresponds to a preset access request; A record acquisition module, used to acquire an operation record associated with the request identifier; the operation record includes: a calling condition and abnormal information of a preset service corresponding to the request identifier; the preset service is: a service called by the server when processing the access request; The service repair module is used to repair abnormal services based on the acquired operation records.
10. A server, characterized in that: It includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the system service repair method described in any one of claims 1-3 or the system service repair method described in any one of claims 4-7.
11. A machine-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method for repairing a system service according to any one of claims 1 to 3 or the steps of the method for repairing a system service according to any one of claims 4 to 7 are executed.
