Software service offline method and device, storage medium and electronic device
By monitoring and scoring the operation data of software services, determining the services that need to be offline is solved, and the problem of how to determine the need to be offline to deal with software services is achieved, achieving resource optimization and cost reduction.
Patent Information
- Application Number
- CN202411280095.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, software services that need to be processed offline cannot be effectively determined, resulting in waste of hardware resources.
By monitoring the operating data of the target software service, including business callers, application components and resource occupancy, scoring and weighting the score according to preset rules, it is determined that the score is less than the preset score and is processed offline.
Effectively determine and remove redundant or low-active software services, optimize hardware resource allocation, and reduce operation and maintenance costs.
Smart Images

Figure CN119225852A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a method, device, storage medium and electronic device for taking a software service offline. Background Art
[0002] Software service architecture refers to splitting a large application into multiple independent software services. With the development of enterprise digital transformation and the widespread application of cloud native technology, more and more systems and digital projects in enterprises adopt software service architecture. Due to the updates of business and developers, many software services that have been running for a long time without update and maintenance and occupying hardware resources have appeared. Existing developers are not familiar with the development background of the above software services and cannot rashly take them offline, resulting in a waste of hardware resources. Therefore, there is a problem in the relevant technology on how to determine the software services that need to be taken offline.
[0003] In the related art, there is no effective solution to the problem of how to determine the software services that need to be taken offline. Summary of the invention
[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for taking a software service offline, so as to at least solve the problem in the related art of how to determine the software service that needs to be taken offline.
[0005] According to an embodiment of the embodiments of the present application, a method for taking a software service offline is provided, comprising: monitoring operation data of a target software service to obtain target operation data, wherein the target operation data includes a business caller corresponding to the target software service, an application component having a dependency relationship with the target software service, and a resource occupancy rate of the target software service; scoring the target operation data according to preset rules to obtain multiple scoring values, and performing weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate; and when it is determined that the target score is less than the preset score, taking the target software service offline.
[0006] In an exemplary embodiment, the operating data of the target software service is monitored, and before obtaining the target operating data, the method further includes: obtaining the last update time of the current software service; determining the time difference between the last update time and the current time; and determining the current software service as the target software service when it is determined that the time difference is greater than a preset time difference.
[0007] In an exemplary embodiment, the target operating data is scored according to preset rules to obtain multiple scoring values, including: obtaining business callers corresponding to the target software service from the target operating data, and determining a first scoring value according to the number of business callers; obtaining application components that have a dependency relationship with the target software service from the target operating data, and determining a second scoring value according to the number of application components; obtaining resource occupancy of the target software service from the target operating data, and determining a third scoring value according to the resource occupancy; and determining the multiple scoring values based on the first scoring value, the second scoring value, and the third scoring value.
[0008] In an exemplary embodiment, the business callers corresponding to the target software service are obtained from the target operation data, and a first scoring value is determined according to the number of the business callers, including: when it is determined that the number of the business callers is greater than a first preset number, the first preset scoring value is determined as the first scoring value; when it is determined that the number of the business callers is greater than a second preset number and less than the first preset number, the second preset scoring value is determined as the first scoring value, wherein the second preset number is less than the first preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of the business callers is less than the second preset number, the third preset scoring value is determined as the first scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0009] In an exemplary embodiment, obtaining application components that have a dependency relationship with the target software service from the target operation data, and determining a second scoring value based on the number of the application components includes: when it is determined that the number of application components is greater than a third preset number, determining the first preset scoring value as the second scoring value; when it is determined that the number of application components is greater than a fourth preset number and less than the third preset number, determining the second preset scoring value as the second scoring value, wherein the fourth preset number is less than the third preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of application components is less than the fourth preset number, determining the third preset scoring value as the second scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0010] In an exemplary embodiment, the resource occupancy rate of the target software service includes at least processor occupancy rate, memory occupancy rate, storage space occupancy rate, and network bandwidth occupancy rate. The resource occupancy rate of the target software service is obtained from the target operation data, and a third scoring value is determined according to the resource occupancy rate, including: obtaining the average resource occupancy rate of all software services, wherein the average resource occupancy rate includes at least: average processor occupancy rate, average memory occupancy rate, average storage space occupancy rate, and average network bandwidth occupancy rate; respectively comparing the processor occupancy rate with the average processor occupancy rate, the memory occupancy rate with the average memory occupancy rate, the storage space occupancy rate with the average storage space occupancy rate, and the network bandwidth occupancy rate with the average network bandwidth occupancy rate to obtain multiple comparison results, wherein the multiple comparison results include a first comparison result and a second comparison result, and the first comparison result is used for Indicating that the resource occupancy rate of the target software service is not less than the average resource occupancy rate, the second comparison result is used to indicate that the resource occupancy rate of the target software service is less than the average resource occupancy rate; in the case of determining that the first ratio is greater than the first preset ratio, determining the first preset score value as the third score value, wherein the first ratio represents the ratio of the number of the first comparison results to the number of the multiple comparison results; in the case of determining that the first ratio is greater than the second preset ratio and less than the first preset ratio, determining the second preset score value as the third score value, wherein the second preset ratio is less than the first preset ratio, and the second preset score value is less than the first preset score value; in the case of determining that the first ratio is less than the second preset ratio, determining the third preset score value as the third score value, wherein the third preset score value is less than the second preset score value.
[0011] In an exemplary embodiment, weighted summation is performed on the multiple scoring values to obtain a target score, including: obtaining a first weight value corresponding to the first scoring value, a second weight value corresponding to the second scoring value, and a third weight value corresponding to the third scoring value; and determining the sum of the first score, the second score, and the third score as the target score, wherein the first score represents the product of the first scoring value and the first weight value, the second score represents the product of the second scoring value and the second weight value, and the third score represents the product of the third scoring value and the third weight value.
[0012] According to another aspect of an embodiment of the present application, a software service offline device is also provided, including: a monitoring module, used to monitor the operation data of a target software service to obtain target operation data, wherein the target operation data includes a business caller corresponding to the target software service, an application component having a dependency relationship with the target software service, and a resource occupancy rate of the target software service; a scoring module, used to score the target operation data according to preset rules to obtain multiple scoring values, and perform weighted summation of the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate; a processing module, used to perform offline processing on the target software service when it is determined that the target score is less than the preset score.
[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the offline method of the above-mentioned software service when running.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the offline method of the software service through the computer program.
[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0016] In an embodiment of the present application, the operating data of the target software service is monitored, the monitored operating data is scored according to preset rules to obtain multiple scoring values, and then the multiple scoring values are weighted and summed to obtain the target score, and then it is determined whether to take the target software service offline based on the target score; the above technical solution is used to solve the problem of how to determine the software services that need to be taken offline, thereby achieving the effect of determining the software services that need to be taken offline. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 It is a hardware environment diagram of a method for offline software service in an embodiment of the present application;
[0020] Figure 2 is a flowchart of a method for going offline of a software service according to an embodiment of the present application;
[0021] Figure 3 1 is a schematic diagram of a method for offline software service according to an embodiment of the present application (I);
[0022] Figure 4 Schematic diagram (II) of a method for offline software service according to an embodiment of the present application;
[0023] Figure 5 Schematic diagram of a method for offline software service according to an embodiment of the present application (III);
[0024] Figure 6 Schematic diagram (IV) of a method for offline software service according to an embodiment of the present application;
[0025] Figure 7 Schematic diagram (V) of a method for offline software service according to an embodiment of the present application;
[0026] Figure 8 It is a structural block diagram of a software service offline device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to one aspect of an embodiment of the present application, a method for shutting down a software service is provided. The method for shutting down a software service is widely used in application scenarios such as software development. Optionally, in this embodiment, the method for shutting down a software service can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0030] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0031] In this embodiment, a method for disconnecting a software service is provided, which is applied to the above terminal device. Figure 2: is a flowchart of a method for offline software service according to an embodiment of the present application, the process includes the following steps:
[0032] Step S202, monitoring the operation data of the target software service to obtain target operation data, wherein the target operation data includes the business caller corresponding to the target software service, the application component having a dependency relationship with the target software service, and the resource occupancy rate of the target software service;
[0033] Step S204, scoring the target operation data according to preset rules to obtain multiple scoring values, and performing weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate;
[0034] Optionally, in the above step S204, multiple scoring values may represent scoring of the software service from different aspects, including but not limited to the impact of the software service on the business, the dependency on other service components, resource utilization, etc., wherein the scoring values obtained from different aspects correspond to different operating data and scoring rules.
[0035] Step S206: When it is determined that the target score is less than a preset score, the target software service is taken offline.
[0036] Through the above steps, the operating data of the target software service is monitored, and the monitored operating data is scored according to preset rules to obtain multiple scoring values, and then the multiple scoring values are weighted and summed to obtain the target score, and then it is determined based on the target score whether to take the target software service offline. This solves the problem of how to determine the software service that needs to be taken offline in the related technology, and thus achieves the effect of determining the software service that needs to be taken offline.
[0037] In an exemplary embodiment, before executing the above step S202 to monitor the operating data of the target software service and obtaining the target operating data, the method also includes: obtaining the last update time of the current software service; determining the time difference between the last update time and the current time; and determining the current software service as the target software service when it is determined that the time difference is greater than a preset time difference.
[0038] Optionally, in the above embodiment, for example, all software services are regularly tested to identify software services that have not been updated for more than three months, and then the above software services are identified as target software services for key monitoring, and then the monitoring data is evaluated to determine whether to take them offline.
[0039] In an exemplary embodiment, the specific implementation process of the above-mentioned step S204 of scoring the target operation data according to preset rules to obtain multiple scoring values includes: obtaining the business callers corresponding to the target software service from the target operation data, and determining a first scoring value according to the number of the business callers; obtaining application components that have a dependency relationship with the target software service from the target operation data, and determining a second scoring value according to the number of the application components; obtaining the resource occupancy rate of the target software service from the target operation data, and determining a third scoring value according to the resource occupancy rate; and determining the multiple scoring values based on the first scoring value, the second scoring value, and the third scoring value.
[0040] Optionally, in the above embodiment, the first scoring value can be used to evaluate the business impact of the software service, and thus the scoring is performed according to the number of businesses that call the target software service; the second scoring value can be used to evaluate the degree of dependency of the software service and other service components, and thus the scoring is performed according to the number of application components with dependencies; the third scoring value can be used to evaluate the resource usage of the software service, and thus the scoring is performed according to the resource usage rate. It should be noted that this solution includes but is not limited to scoring the software service from the above aspects, and the scoring for any of these aspects includes but is not limited to the above scoring basis.
[0041] In an exemplary embodiment, the business callers corresponding to the target software service can be obtained from the target operation data in the following manner, and a first scoring value is determined according to the number of the business callers, specifically including: when it is determined that the number of the business callers is greater than a first preset number, the first preset scoring value is determined as the first scoring value; when it is determined that the number of the business callers is greater than a second preset number and less than the first preset number, the second preset scoring value is determined as the first scoring value, wherein the second preset number is less than the first preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of the business callers is less than the second preset number, the third preset scoring value is determined as the first scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0042] Optionally, in the above embodiment, for example, if the number of business callers corresponding to the target software service is more than 10, the first scoring value is determined to be 90 points; if the number of business callers corresponding to the target software service is more than 5 and less than 10, the first scoring value is determined to be 60 points; if the number of business callers corresponding to the target software service is less than 5, the first scoring value is determined to be 30 points.
[0043] In an exemplary embodiment, application components that have a dependency relationship with the target software service can be obtained from the target operation data in the following manner, and a second scoring value is determined according to the number of the application components, specifically including: when it is determined that the number of application components is greater than a third preset number, the first preset scoring value is determined as the second scoring value; when it is determined that the number of application components is greater than a fourth preset number and less than the third preset number, the second preset scoring value is determined as the second scoring value, wherein the fourth preset number is less than the third preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of application components is less than the fourth preset number, the third preset scoring value is determined as the second scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0044] Optionally, in the above embodiment, for example, if the number of application components that have dependencies on the target software service is more than 12, the second score value is determined to be 90 points; if the number of application components that have dependencies on the target software service is more than 6 and less than 12, the second score value is determined to be 60 points; if the number of application components that have dependencies on the target software service is less than 6, the second score value is determined to be 30 points.
[0045] Optionally, in the above embodiment, the application components that have a dependency relationship with the target software service include other software services, databases, middleware that the target software service depends on, and other software services, databases, middleware, etc. that depend on the target software service.
[0046] In an exemplary embodiment, the resource occupancy rate of the target software service includes at least processor occupancy rate, memory occupancy rate, storage space occupancy rate, and network bandwidth occupancy rate. The resource occupancy rate of the target software service is obtained from the target operation data, and the specific process of determining the third scoring value according to the resource occupancy rate includes: obtaining the average resource occupancy rate of all software services, wherein the average resource occupancy rate includes at least: average processor occupancy rate, average memory occupancy rate, average storage space occupancy rate, and average network bandwidth occupancy rate; respectively comparing the processor occupancy rate with the average processor occupancy rate, the memory occupancy rate with the average memory occupancy rate, the storage space occupancy rate with the average storage space occupancy rate, and the network bandwidth occupancy rate with the average network bandwidth occupancy rate to obtain multiple comparison results, wherein the multiple comparison results include a first comparison result, a second comparison result, and the first comparison result The first comparison result is used to indicate that the resource occupancy rate of the target software service is not less than the average resource occupancy rate, and the second comparison result is used to indicate that the resource occupancy rate of the target software service is less than the average resource occupancy rate; in the case where it is determined that the first ratio is greater than the first preset ratio, the first preset score value is determined as the third score value, wherein the first ratio represents the ratio of the number of the first comparison results to the number of the multiple comparison results; in the case where it is determined that the first ratio is greater than the second preset ratio and less than the first preset ratio, the second preset score value is determined as the third score value, wherein the second preset ratio is less than the first preset ratio, and the second preset score value is less than the first preset score value; in the case where it is determined that the first ratio is less than the second preset ratio, the third preset score value is determined as the third score value, wherein the third preset score value is less than the second preset score value.
[0047] Optionally, in the above embodiment, for example, the processor occupancy rate of the target software service is greater than the average processor occupancy rate, and a first comparison result is obtained; the memory occupancy rate of the target software service is not less than the average memory occupancy rate, and a second comparison result is obtained; the network bandwidth occupancy rate of the target software service is less than the average network bandwidth occupancy rate, and a second comparison result is obtained. Then the number of first comparison results is 1, and the number of second comparison results is 2. When it is determined that the ratio of the first comparison result to the number of multiple comparison results is greater than 2 / 3, the third scoring value is determined to be 90 points; when it is determined that the ratio of the first comparison result to the number of multiple comparison results is greater than 1 / 3 and less than 2 / 3, the third scoring value is determined to be 60 points; when it is determined that the ratio of the first comparison result to the number of multiple comparison results is less than 1 / 3, the third scoring value is determined to be 30 points.
[0048] It should be noted that, in the scoring process of the above embodiment, the scoring process can be further refined according to actual application conditions, the scoring steps can be adjusted, and more scoring values can be added.
[0049] In an exemplary embodiment, the process of performing weighted summation on the multiple scoring values to obtain the target score in the above-mentioned step S206 specifically includes: obtaining a first weight value corresponding to the first scoring value, a second weight value corresponding to the second scoring value, and a third weight value corresponding to the third scoring value; determining the sum of the first score, the second score, and the third score as the target score, wherein the first score represents the product of the first scoring value and the first weight value, the second score represents the product of the second scoring value and the second weight value, and the third score represents the product of the third scoring value and the third weight value.
[0050] Optionally, in the above embodiment, the sum of the weight values is 1. For example, the weight of the first score value is 0.4, the weight of the second score value is 0.3, and the score value of the third weight value is 0.3. When the first score value is 60 points, the second score value is 30 points, and the third score value is 60 points, the target score is calculated as: 0.4*60+0.3*30+0.3*60=51 points.
[0051] In order to better understand the process of the offline method of the above-mentioned software service, the implementation method flow of the offline of the above-mentioned software service is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0052] In an optional embodiment, if Figure 3 As shown, the offline method of the software service in the embodiment of the present application can be Figure 3 The service governance platform shown in the figure is implemented by first accessing the microservice (equivalent to the above-mentioned software service) for monitoring through the Agent plug-in (a microservice plug-in used to handle communication and coordination with other software services). Each microservice is connected to the Agent plug-in to obtain HTTP (a communication protocol) interface call data, RPC (Remote Procedure Call) call data, database statement execution data, scheduled task execution log and other operation data. The service comprehensive governance platform uniformly collects the operation information generated by all connected Agents, and counts the service behaviors and service dependencies. Then, the offline risk is evaluated through the risk model to obtain the offline score (equivalent to the target score).
[0053] In an optional embodiment, if Figure 4 As shown, the above-mentioned Agent plug-in specifically includes:
[0054] 1. Pinpoint plug-in, used to locate problems in the code, monitor the performance and behavior of the application, and help troubleshoot and solve performance problems.
[0055] 2. Open telemetry plug-in, which is used to implement cross-language and cross-platform distributed tracing and indicator collection, helping developers monitor and optimize application performance.
[0056] 3. Metrics plug-in, used to collect and display application performance indicators and statistics, to help developers understand the operation and performance of the application.
[0057] 4. Sentinel plug-in, used to implement flow control, circuit breaker degradation, system load protection and other functions to help protect the stability and reliability of the application.
[0058] 5.arthas plug-in, used for real-time monitoring and diagnosis of applications, provides rich commands and functions to help developers locate and solve problems.
[0059] In an optional embodiment, the above risk assessment model can perform risk assessment on microservices in the following manner:
[0060] 1. Determine risk assessment indicators.
[0061] For example, define the following indicators for offline risk assessment:
[0062] Business impact is used to evaluate the impact of service offline on the business and business users. It is evaluated through data such as the number of business callers, business process analysis, business department evaluation, and business user feedback.
[0063] Technical dependency is used to evaluate the interdependence strength of a microservice with other microservices, databases, middleware, etc. It can be evaluated through service dependency reference relationships and service call data.
[0064] Optionally, the above services depend on reference relationships such as Figure 5 As shown, Figure 5 Each icon represents a microservice or database, or other application component. The lines between microservices indicate dependencies. Furthermore, you can also count information such as the number of requests between services or application components.
[0065] Optionally, the above service call data is as follows Figure 6 As shown, Figure 6 It shows the information of microservice request to call database. Each call of microservice will be recorded in the form of log. According to the call log, the request of microservice to database can be determined, and then the dependency strength between microservice and database can be determined.
[0066] Resource utilization is used to evaluate the efficiency of using service resources such as CPU, memory, storage and network bandwidth.
[0067] Optionally, the data of the above service resource utilization is as follows Figure 7 As shown, Figure 7 The CPU usage, memory usage, and network usage of the microservice are displayed. Based on the above data, it can be determined whether the microservice occupies more service resources, and then whether there is any resource waste.
[0068] Potential risks are used to predict indirect risks that may be caused by service offline, such as data integrity and security compliance, which can be evaluated through data such as security audit reports and compliance inspection results.
[0069] 2. Rating calculation method.
[0070] For example, according to the enterprise's strategic goals and technical environment, the above four indicators of business impact, technical dependence, resource utilization, and potential risk are assigned different weight values W1, W2, W3, and W4, and the total weight is 1. According to the operation data, each indicator is scored from 0 to 100 points, and the scores of the four indicators S1, S2, S3, and S4 are obtained, among which 100 points indicates the highest risk of going offline. The final offline score is W1×S1+W2×S2+W3×S3+W4×S4. If the offline score is less than 30 points, it is considered low risk and suitable for going offline. If it is 30-60 points, further analysis and risk mitigation measures need to be formulated. If it is greater than 60 points, it is not suitable for going offline temporarily, and high-risk problems need to be solved first.
[0071] Through the above embodiments, the operation data of multi-dimensional indicators of software services can be automatically collected and analyzed, and low-activity or redundant software services can be identified for offline processing. By estimating the offline risk, the safety of offline decision-making is ensured, reducing operation and maintenance costs, while optimizing system resource allocation and costs.
[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0073] Figure 8is a structural block diagram of a software service offline device according to an embodiment of the present application; Figure 8 As shown, including:
[0074] A monitoring module 82 is used to monitor the operation data of the target software service to obtain target operation data, wherein the target operation data includes the service caller corresponding to the target software service, the application component having a dependency relationship with the target software service, and the resource occupancy rate of the target software service;
[0075] A scoring module 84 is used to score the target operation data according to a preset rule to obtain multiple scoring values, and perform weighted summation on the multiple scoring values to obtain a target score, wherein the preset rule includes a correspondence between the target operation data and the scoring value, wherein the preset rule is determined according to the number of the business callers, the number of the application components, and the resource occupancy rate;
[0076] The processing module 86 is used to take the target software service offline when it is determined that the target score is less than a preset score.
[0077] Through the above-mentioned device, the operating data of the target software service is monitored, and the monitored operating data is scored according to preset rules to obtain multiple scoring values, and then the multiple scoring values are weighted and summed to obtain the target score, and then it is determined according to the target score whether to take the target software service offline. This solves the problem of how to determine the software service that needs to be taken offline in the related technology, and thus achieves the effect of determining the software service that needs to be taken offline.
[0078] In an exemplary embodiment, the monitoring module 82 is further used to: obtain the most recent update time of the current software service; determine the time difference between the most recent update time and the current time; and when it is determined that the time difference is greater than a preset time difference, determine the current software service as the target software service.
[0079] In an exemplary embodiment, the scoring module 84 is further used to: obtain the business callers corresponding to the target software service from the target operation data, and determine a first scoring value according to the number of the business callers; obtain application components that have a dependency relationship with the target software service from the target operation data, and determine a second scoring value according to the number of the application components; obtain the resource occupancy rate of the target software service from the target operation data, and determine a third scoring value according to the resource occupancy rate; determine the multiple scoring values based on the first scoring value, the second scoring value, and the third scoring value.
[0080] In an exemplary embodiment, the scoring module 84 is further used to: when it is determined that the number of business callers is greater than a first preset number, determine a first preset scoring value as the first scoring value; when it is determined that the number of business callers is greater than a second preset number and less than the first preset number, determine a second preset scoring value as the first scoring value, wherein the second preset number is less than the first preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of business callers is less than the second preset number, determine a third preset scoring value as the first scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0081] In an exemplary embodiment, the scoring module 84 is further used to: when it is determined that the number of application components is greater than a third preset number, determine the first preset scoring value as the second scoring value; when it is determined that the number of application components is greater than a fourth preset number and less than the third preset number, determine the second preset scoring value as the second scoring value, wherein the fourth preset number is less than the third preset number, and the second preset scoring value is less than the first preset scoring value; when it is determined that the number of application components is less than the fourth preset number, determine the third preset scoring value as the second scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0082] In an exemplary embodiment, the scoring module 84 is further used to: obtain the average resource occupancy of all software services, wherein the average resource occupancy includes at least: average processor occupancy, average memory occupancy, average storage space occupancy, and average network bandwidth occupancy; respectively compare the processor occupancy with the average processor occupancy, the memory occupancy with the average memory occupancy, the storage space occupancy with the average storage space occupancy, and the network bandwidth occupancy with the average network bandwidth occupancy to obtain multiple comparison results, wherein the multiple comparison results include a first comparison result and a second comparison result, wherein the first comparison result is used to indicate that the resource occupancy of the target software service is not less than the average resource occupancy, and the second comparison result is used to indicate that the resource occupancy of the target software service is not less than the average resource occupancy. In the case where it is determined that the first ratio is greater than the first preset ratio, the first preset scoring value is determined as the third scoring value, wherein the first ratio represents the ratio of the number of the first comparison results to the number of the multiple comparison results; in the case where it is determined that the first ratio is greater than the second preset ratio and less than the first preset ratio, the second preset scoring value is determined as the third scoring value, wherein the second preset ratio is less than the first preset ratio, and the second preset scoring value is less than the first preset scoring value; in the case where it is determined that the first ratio is less than the second preset ratio, the third preset scoring value is determined as the third scoring value, wherein the third preset scoring value is less than the second preset scoring value.
[0083] In an exemplary embodiment, the scoring module 84 is further used to: obtain a first weight value corresponding to the first scoring value, a second weight value corresponding to the second scoring value, and a third weight value corresponding to the third scoring value; determine the sum of the first score, the second score, and the third score as the target score, wherein the first score represents the product of the first scoring value and the first weight value, the second score represents the product of the second scoring value and the second weight value, and the third score represents the product of the third scoring value and the third weight value.
[0084] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0085] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0086] S1, monitoring the operation data of the target software service to obtain target operation data, wherein the target operation data includes the business caller corresponding to the target software service, the application component having a dependency relationship with the target software service, and the resource occupancy rate of the target software service;
[0087] S2, scoring the target operation data according to preset rules to obtain multiple scoring values, and performing weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate;
[0088] S3: When it is determined that the target score is less than a preset score, the target software service is taken offline.
[0089] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0090] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0091] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0092] S1, monitoring the operation data of the target software service to obtain target operation data, wherein the target operation data includes the business caller corresponding to the target software service, the application component having a dependency relationship with the target software service, and the resource occupancy rate of the target software service;
[0093] S2, scoring the target operation data according to preset rules to obtain multiple scoring values, and performing weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate;
[0094] S3: When it is determined that the target score is less than a preset score, the target software service is taken offline.
[0095] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0096] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0097] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0098] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in any one of the above method embodiments.
[0099] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0100] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0101] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for taking a software service offline, characterized in that: include: Monitoring the operation data of the target software service to obtain target operation data, wherein the target operation data includes a business caller corresponding to the target software service, an application component having a dependency relationship with the target software service, and a resource occupancy rate of the target software service; Scoring the target operation data according to preset rules to obtain multiple scoring values, and performing weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a corresponding relationship between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate; When it is determined that the target score is less than a preset score, the target software service is taken offline.
2. The offline method of software service according to claim 1, characterized in that: Before monitoring the operating data of the target software service and obtaining the target operating data, the method further includes: Get the latest update time of the current software service; Determine the time difference between the most recent update time and the current time; In the case where it is determined that the time difference is greater than a preset time difference, the current software service is determined as the target software service.
3. The offline method of software service according to claim 1, characterized in that: Scoring the target operation data according to preset rules to obtain multiple scoring values, including: Obtaining the business callers corresponding to the target software service from the target operation data, and determining a first scoring value according to the number of the business callers; Acquire application components that have a dependency relationship with the target software service from the target operation data, and determine a second scoring value according to the number of the application components; Acquire a resource occupancy rate of the target software service from the target operation data, and determine a third scoring value according to the resource occupancy rate; The multiple rating values are determined based on the first rating value, the second rating value, and the third rating value.
4. The offline method of software service according to claim 3, characterized in that: Acquiring a business caller corresponding to the target software service from the target operation data, and determining a first scoring value according to the number of the business callers, including: In the case where it is determined that the number of the service callers is greater than a first preset number, determining a first preset score value as the first score value; When it is determined that the number of business callers is greater than a second preset number and less than the first preset number, the second preset score value is determined as the first score value, wherein the second preset number is less than the first preset number, and the second preset score value is less than the first preset score value; when it is determined that the number of business callers is less than the second preset number, the third preset score value is determined as the first score value, wherein the third preset score value is less than the second preset score value.
5. The offline method of software service according to claim 3, characterized in that: Acquiring application components having a dependency relationship with the target software service from the target operation data, and determining a second scoring value according to the number of the application components, including: In the case where it is determined that the number of the application components is greater than a third preset number, determining the first preset score value as the second score value; In the case where it is determined that the number of the application components is greater than a fourth preset number and less than the third preset number, determining a second preset score value as the second score value, wherein the fourth preset number is less than the third preset number, and the second preset score value is less than the first preset score value; In the case where it is determined that the number of the application components is less than the fourth preset number, a third preset score value is determined as the second score value, wherein the third preset score value is less than the second preset score value.
6. The offline method of software service according to claim 3, characterized in that: The resource occupancy rate of the target software service at least includes a processor occupancy rate, a memory occupancy rate, a storage space occupancy rate, and a network bandwidth occupancy rate. The resource occupancy rate of the target software service is obtained from the target operation data, and a third scoring value is determined according to the resource occupancy rate, including: Obtaining average resource occupancy rates of all software services, wherein the average resource occupancy rates at least include: average processor occupancy rate, average memory occupancy rate, average storage space occupancy rate, and average network bandwidth occupancy rate; Respectively comparing the processor occupancy rate with the average processor occupancy rate, the memory occupancy rate with the average memory occupancy rate, the storage space occupancy rate with the average storage space occupancy rate, and the network bandwidth occupancy rate with the average network bandwidth occupancy rate to obtain a plurality of comparison results, wherein the plurality of comparison results include a first comparison result and a second comparison result, the first comparison result is used to indicate that the resource occupancy rate of the target software service is not less than the average resource occupancy rate, and the second comparison result is used to indicate that the resource occupancy rate of the target software service is less than the average resource occupancy rate; In the case where it is determined that the first ratio is greater than a first preset ratio, determining the first preset score value as the third score value, wherein the first ratio represents a ratio of the number of the first comparison results to the number of the plurality of comparison results; In the case where it is determined that the first ratio is greater than a second preset ratio and less than the first preset ratio, determining a second preset score value as the third score value, wherein the second preset ratio is less than the first preset ratio, and the second preset score value is less than the first preset score value; In the case where it is determined that the first ratio is smaller than the second preset ratio, a third preset score value is determined as the third score value, wherein the third preset score value is smaller than the second preset score value.
7. The offline method of software service according to claim 3, characterized in that: The weighted sum of the multiple scoring values is performed to obtain a target score, including: Obtaining a first weight value corresponding to the first scoring value, a second weight value corresponding to the second scoring value, and a third weight value corresponding to the third scoring value; The sum of a first score, a second score, and a third score is determined as the target score, wherein the first score represents the product of the first score value and the first weight value, the second score represents the product of the second score value and the second weight value, and the third score represents the product of the third score value and the third weight value.
8. A device for offline software service, characterized in that: include: A monitoring module, used to monitor the operation data of the target software service to obtain target operation data, wherein the target operation data includes the business caller corresponding to the target software service, the application component having a dependency relationship with the target software service, and the resource occupancy rate of the target software service; A scoring module, configured to score the target operation data according to preset rules to obtain multiple scoring values, and perform weighted summation on the multiple scoring values to obtain a target score, wherein the preset rules include a correspondence between the target operation data and the scoring values, wherein the preset rules are determined according to the number of the business callers, the number of the application components, and the resource occupancy rate; The processing module is used to take the target software service offline when it is determined that the target score is less than a preset score.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
