CN115941545B - Log management method and platform based on micro-service - Google Patents

Log management method and platform based on micro-service Download PDF

Info

Publication number
CN115941545B
CN115941545B CN202211257760.1A CN202211257760A CN115941545B CN 115941545 B CN115941545 B CN 115941545B CN 202211257760 A CN202211257760 A CN 202211257760A CN 115941545 B CN115941545 B CN 115941545B
Authority
CN
China
Prior art keywords
preset
score
less
determining
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211257760.1A
Other languages
Chinese (zh)
Other versions
CN115941545A (en
Inventor
王炳成
杨海军
李振明
王跃飞
徐婷婷
刘鲁清
杜万波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huaneng Information Technology Co Ltd
Original Assignee
Huaneng Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huaneng Information Technology Co Ltd filed Critical Huaneng Information Technology Co Ltd
Priority to CN202211257760.1A priority Critical patent/CN115941545B/en
Publication of CN115941545A publication Critical patent/CN115941545A/en
Application granted granted Critical
Publication of CN115941545B publication Critical patent/CN115941545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a log management method and a platform based on micro-service, and relates to the technical field of micro-service detection, wherein the method comprises the steps of obtaining monitoring index data, obtaining index scores according to the monitoring index data, and obtaining micro-service states according to the index scores; if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service in the micro-service detection range, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service; and acquiring container index data of all containers under fault service, and determining the fault container according to the container index data. The method and the device preliminarily judge the micro-service state through the index data monitored in the service grid. If so, determining the specific fault micro-service, and determining a fault container according to the container index data. The accuracy of fault positioning in the micro-service is improved, the realization of subsequent fault treatment is facilitated, and the micro-service management framework is optimized.

Description

Log management method and platform based on micro-service
Technical Field
The application relates to the technical field of micro-service detection, in particular to a log management method and platform based on micro-service.
Background
Micro services (Micro services) is a style of software architecture that breaks up a large and complex software application into multiple services, and implements and runs each as a small and independent system, providing access to its internal logic and data through well-defined network interfaces. The relative independence between services allows software applications to have faster delivery speeds, better extensibility, and greater autonomy. Micro-services are the latest trend of software service design, development and delivery, and more enterprises choose to adopt micro-service architecture to perform software development or modification of traditional megastone application. Micro-services are a new architecture compared to traditional software. It advocates the division of a single application into a small set of services, each of which independently performs a small function. The services are mutually coordinated and matched, and the final value is provided for the users. Each service runs in its independent process, and the services communicate with each other using a lightweight communication mechanism (typically an HTTP-based Restful API).
The container is a virtualization technology with better performance, lighter weight and better extensibility than the VM. Each container runs a process, and all the dependency environments needed by the process are packed in the container, so that the container has good portability. The containers operate independently of each other and are responsible for a single function. The containers can also be mutually matched and called to finish larger functions. The features of the container technology make it perfectly compatible with the microservice architecture.
A service grid is a specialized infrastructure layer for handling service-to-service communications. The main idea is to set up a reverse proxy component, i.e. the Sidecar, for each microservice instance (often in the form of a container). All traffic to and from the microservices will be hijacked by the Sidecar, processed and forwarded through the component, where the microservice architecture is also implemented using container technology.
Although microservices have many advantages and are widely used in various areas, they still face a number of challenges. The software stability under the micro-service architecture is not strong enough, the failure rate is relatively high, and the failure causes are complex, so that the failure positioning is difficult, the positioning accuracy is low, and the method is particularly used in a large cluster consisting of hundreds of servers.
Therefore, how to improve the fault location accuracy is a technical problem to be solved at present.
Disclosure of Invention
The invention provides a log management method based on micro-service, which is used for solving the technical problem of low fault positioning precision in the prior art. The method is applied to the service grid, and comprises the following steps:
acquiring monitoring index data, obtaining index scores according to the monitoring index data, and obtaining micro-service states according to the index scores;
if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service in the micro-service detection range, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service;
and acquiring container index data of all containers under fault service, and determining the fault container according to the container index data.
In some embodiments of the present application, the index score is obtained according to the monitoring index data, specifically:
monitoring index data including delay, flow, error amount, and saturation;
acquiring a first score according to the delay;
obtaining a delay A, and presetting a delay array A0 (A1, A2, A3 and A4), wherein the first preset delay is A1, the second preset delay is A2, the third preset delay is A3, the fourth preset delay is A4, and A1 is more than A2 and less than A3 and less than A4;
presetting a first score array Q0 (Q1, Q2, Q3 and Q4), wherein a first preset first score is Q1, a second preset first score is Q2, a third preset first score is Q3, a fourth preset first score is Q4, and Q1 is more than Q2 and less than Q3 and less than Q4;
determining a first score according to the relationship between the delays and each preset delay;
if A is less than A1, determining a first preset first score Q1 as a first score;
if A1 is less than or equal to A2, determining a second preset first score Q2 as a first score;
if A2 is less than or equal to A3, determining a third preset first score Q3 as a first score;
if A3 is less than or equal to A4, determining a fourth preset first score Q4 as the first score.
In some embodiments of the present application, the second score is obtained from traffic,
obtaining a flow B, and presetting a flow array B0 (B1, B2, B3 and B4), wherein the first preset flow is B1, the second preset flow is B2, the third preset flow is B3, the fourth preset flow is B4, and B1 is more than B2 and less than B3 and less than B4;
presetting a second fractional array W0 (W1, W2, W3, W4), wherein the first preset second fraction is W1, the second preset second fraction is W2, the third preset second fraction is W3, the fourth preset second fraction is W4, and W1 is more than W2 and less than W3 and more than W4;
determining a second fraction according to the relation between the flow and each preset flow;
if B is smaller than B1, determining a first preset second score W1 as a second score;
if B1 is less than or equal to B2, determining a second preset second fraction W2 as a second fraction;
if B2 is less than or equal to B3, determining a third preset second fraction W3 as a second fraction;
if B3 is less than or equal to B4, determining a fourth preset second fraction W4 as the second fraction.
In some embodiments of the present application, the third score is obtained based on the error amount,
obtaining an error quantity C, and presetting an error quantity array C0 (C1, C2, C3 and C4), wherein the first preset error quantity is C1, the second preset error quantity is C2, the third preset error quantity is C3, the fourth preset error quantity is C4, and C1 is more than C2 and less than C3 and less than C4;
presetting a third score array E0 (E1, E2, E3 and E4), wherein the first preset third score is E1, the second preset third score is E2, the third preset third score is E3, the fourth preset third score is E4, E1 is more than E2 and less than E3 and less than E4;
determining a third score according to the relation between the error amount and each preset error amount;
if C is smaller than C1, determining a first preset third score E1 as a third score;
if C1 is less than or equal to C2, determining a second preset third fraction E2 as a third fraction;
if C2 is less than or equal to C3, determining a third preset third fraction E3 as a third fraction;
if C3 is less than or equal to C4, determining a fourth preset third fraction E4 as the third fraction.
In some embodiments of the present application, the fourth score is obtained from saturation,
obtaining a saturation D, and presetting a saturation array D0 (D1, D2, D3 and D4), wherein the first preset saturation is D1, the second preset saturation is D2, the third preset saturation is D3, the fourth preset saturation is D4, and D1 is more than D2 and less than D3 and less than D4;
presetting a fourth fraction array R0 (R1, R2, R3 and R4), wherein the first preset fourth fraction is R1, the second preset fourth fraction is R2, the third preset fourth fraction is R3, the fourth preset fourth fraction is R4, and R1 is more than R2 and less than R3 and less than R4;
determining a fourth fraction according to the relation between the saturation and each preset saturation;
if D is smaller than D1, determining a first preset fourth fraction R1 as a fourth fraction;
if D1 is less than or equal to D2, determining a second preset fourth fraction R2 as a fourth fraction;
if D2 is less than or equal to D3, determining a third preset fourth fraction R3 as a fourth fraction;
if D3 is less than or equal to D4, determining a fourth preset fourth fraction R4 as a fourth fraction.
In some embodiments of the present application, the micro-service state is obtained according to the index score, specifically:
obtaining index scores according to the first score, the second score, the third score, the fourth score and the preset monitoring index data weight;
if the index score exceeds a preset threshold, the micro-service has faults;
if the index score does not exceed the preset threshold, the micro-service has no fault.
In some embodiments of the present application, determining a fault container according to container index data is specifically:
the container index data comprises average load of CPU and CPU frequency doubling in preset time;
determining a first difference degree according to the average load of the CPU in a preset time;
obtaining an average load S of a CPU in a preset time, and setting an average load array S0 (S1, S2, S3 and S4) of the CPU in the preset time, wherein the average load of the CPU in the first preset time is S1, the average load of the CPU in the second preset time is S2, the average load of the CPU in the third preset time is S3, the average load of the CPU in the fourth preset time is S4, and S1 is more than S2 and less than S3 and less than S4;
presetting a first difference degree array T0 (T1, T2, T3 and T4), wherein the first preset first difference degree is T1, the second preset first difference degree is T2, the third preset first difference degree is T3, the fourth preset first difference degree is T4, and T4 is more than T3 and less than T2 and less than T1;
if S is less than S1, determining a first preset first difference degree T1 as a first difference degree;
if S1 is less than or equal to S2, determining a second preset first difference degree T2 as a first difference degree;
if S2 is less than or equal to S3, determining a third preset first difference degree T3 as a first difference degree;
if S3 is less than or equal to S4, determining a fourth preset first difference degree T4 as the first difference degree.
In some embodiments of the present application, the second degree of difference is determined from a CPU frequency multiplication,
obtaining CPU frequency multiplication F, presetting a CPU frequency multiplication array F0 (F1, F2, F3 and F4), wherein the first preset CPU frequency multiplication is F1, the second preset CPU frequency multiplication is F2, the third preset CPU frequency multiplication is F3, the fourth preset CPU frequency multiplication is F4, and F1 is more than F2 and less than F3 and less than F4;
presetting a second difference degree array Y0 (Y1, Y2, Y3 and Y4), wherein the first preset second difference degree is Y1, the second preset second difference degree is Y2, the third preset second difference degree is Y3, the fourth preset second difference degree is Y4, and Y4 is more than Y3 and less than Y2 and less than Y1;
if F is smaller than F1, determining a first preset second difference Y1 as a second difference;
if F1 is less than or equal to F2, determining a second preset second difference degree Y2 as a second difference degree;
if F2 is less than or equal to F3, determining a third preset second difference degree Y3 as a second difference degree;
if F3 is less than or equal to F4, determining a fourth preset second difference degree Y4 as a second difference degree.
In some embodiments of the present application, determining a fault container according to container index data is specifically:
determining a fault container according to the sum of the first difference degree and the second difference degree;
if the first preset first difference degree T1 is determined to be the first difference degree, and the first preset second difference degree Y1 is determined to be the second difference degree, the corresponding container is a fault container.
Correspondingly, the application also provides a log management platform based on micro-service, which is applied to the service grid, and comprises:
the acquisition module is used for acquiring monitoring index data, obtaining index scores according to the monitoring index data and obtaining micro-service states according to the index scores;
the computing module is used for sending a plurality of requests to the micro-services in the micro-service detection range simultaneously if the micro-services have faults, obtaining the service score of the micro-services through a preset algorithm, and determining the micro-service with the highest service score as the fault service;
the determining module is used for acquiring container index data of all containers under the fault service and determining the fault container according to the container index data.
By applying the technical scheme, the monitoring index data are acquired, the index score is obtained according to the monitoring index data, and the micro-service state is obtained according to the index score; if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service in the micro-service detection range, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service; and acquiring container index data of all containers under fault service, and determining the fault container according to the container index data. The method and the device preliminarily judge the micro-service state through the index data monitored in the service grid. If so, determining the specific fault micro-service, and determining a fault container according to the container index data. The accuracy of fault positioning in the micro-service is improved, the realization of subsequent fault treatment is facilitated, and the micro-service management framework is optimized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a log management method based on micro services according to an embodiment of the present invention;
fig. 2 shows a schematic structural diagram of a log management platform based on micro services according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The embodiment of the application provides a log management method based on micro-services, which is applied to a service grid, as shown in fig. 1, and comprises the following steps:
step S101, obtaining monitoring index data, obtaining index scores according to the monitoring index data, and obtaining micro-service states according to the index scores.
In this embodiment, the service grid has a powerful monitoring function, can provide monitoring (delay, flow, error amount, saturation) of four gold indexes, and simultaneously provides a perfect log function, which is helpful for fault location and cause analysis. Delay, time required for servicing the request. Error amount, serving overall error rate. Flow, input and output flow. Saturation, service capacity usage.
In order to improve accuracy of state judgment, in some embodiments of the present application, the index score is obtained according to monitoring index data, which specifically includes:
monitoring index data including delay, flow, error amount, and saturation;
acquiring a first score according to the delay;
obtaining a delay A, and presetting a delay array A0 (A1, A2, A3 and A4), wherein the first preset delay is A1, the second preset delay is A2, the third preset delay is A3, the fourth preset delay is A4, and A1 is more than A2 and less than A3 and less than A4;
presetting a first score array Q0 (Q1, Q2, Q3 and Q4), wherein a first preset first score is Q1, a second preset first score is Q2, a third preset first score is Q3, a fourth preset first score is Q4, and Q1 is more than Q2 and less than Q3 and less than Q4;
determining a first score according to the relationship between the delays and each preset delay;
if A is less than A1, determining a first preset first score Q1 as a first score;
if A1 is less than or equal to A2, determining a second preset first score Q2 as a first score;
if A2 is less than or equal to A3, determining a third preset first score Q3 as a first score;
if A3 is less than or equal to A4, determining a fourth preset first score Q4 as the first score.
In some embodiments of the present application, the second score is obtained from traffic,
obtaining a flow B, and presetting a flow array B0 (B1, B2, B3 and B4), wherein the first preset flow is B1, the second preset flow is B2, the third preset flow is B3, the fourth preset flow is B4, and B1 is more than B2 and less than B3 and less than B4;
presetting a second fractional array W0 (W1, W2, W3, W4), wherein the first preset second fraction is W1, the second preset second fraction is W2, the third preset second fraction is W3, the fourth preset second fraction is W4, and W1 is more than W2 and less than W3 and more than W4;
determining a second fraction according to the relation between the flow and each preset flow;
if B is smaller than B1, determining a first preset second score W1 as a second score;
if B1 is less than or equal to B2, determining a second preset second fraction W2 as a second fraction;
if B2 is less than or equal to B3, determining a third preset second fraction W3 as a second fraction;
if B3 is less than or equal to B4, determining a fourth preset second fraction W4 as the second fraction.
In some embodiments of the present application, the third score is obtained based on the error amount,
obtaining an error quantity C, and presetting an error quantity array C0 (C1, C2, C3 and C4), wherein the first preset error quantity is C1, the second preset error quantity is C2, the third preset error quantity is C3, the fourth preset error quantity is C4, and C1 is more than C2 and less than C3 and less than C4;
presetting a third score array E0 (E1, E2, E3 and E4), wherein the first preset third score is E1, the second preset third score is E2, the third preset third score is E3, the fourth preset third score is E4, E1 is more than E2 and less than E3 and less than E4;
determining a third score according to the relation between the error amount and each preset error amount;
if C is smaller than C1, determining a first preset third score E1 as a third score;
if C1 is less than or equal to C2, determining a second preset third fraction E2 as a third fraction;
if C2 is less than or equal to C3, determining a third preset third fraction E3 as a third fraction;
if C3 is less than or equal to C4, determining a fourth preset third fraction E4 as the third fraction.
In some embodiments of the present application, the fourth score is obtained from saturation,
obtaining a saturation D, and presetting a saturation array D0 (D1, D2, D3 and D4), wherein the first preset saturation is D1, the second preset saturation is D2, the third preset saturation is D3, the fourth preset saturation is D4, and D1 is more than D2 and less than D3 and less than D4;
presetting a fourth fraction array R0 (R1, R2, R3 and R4), wherein the first preset fourth fraction is R1, the second preset fourth fraction is R2, the third preset fourth fraction is R3, the fourth preset fourth fraction is R4, and R1 is more than R2 and less than R3 and less than R4;
determining a fourth fraction according to the relation between the saturation and each preset saturation;
if D is smaller than D1, determining a first preset fourth fraction R1 as a fourth fraction;
if D1 is less than or equal to D2, determining a second preset fourth fraction R2 as a fourth fraction;
if D2 is less than or equal to D3, determining a third preset fourth fraction R3 as a fourth fraction;
if D3 is less than or equal to D4, determining a fourth preset fourth fraction R4 as a fourth fraction.
In this embodiment, the corresponding score is determined according to the relationship between the monitoring index data and each preset monitoring index data, and when the score exceeds a certain threshold value, the micro-service is in a fault state.
Step S102, if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service within the detection range of the micro-service, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service.
In this embodiment, the preset algorithm is an ICCA algorithm, for example, there are five micro services p1, p2, p3, p4, and p5 in total. If p1 is the source of the fault, all the end points of the fault chain converge to the service, increasing the p1 score, so the score of the final source of the fault (p 1) is highest.
In order to further improve accuracy of state judgment, in some embodiments of the present application, the micro-service state is obtained according to the index score, which specifically includes:
obtaining index scores according to the first score, the second score, the third score, the fourth score and the preset monitoring index data weight;
if the index score exceeds a preset threshold, the micro-service has faults;
if the index score does not exceed the preset threshold, the micro-service has no fault.
In this embodiment, the index score is obtained according to the first score, the second score, the third score, the fourth score and the preset monitoring index data weight, and the first score, the second score, the third score and the fourth score are multiplied by the corresponding weights respectively and summed to obtain the index score.
Step S103, obtaining container index data of all containers under the fault service, and determining the fault container according to the container index data.
In this embodiment, after determining the failed service, there may be multiple container backups for each service, and it is necessary to determine whether a specific failure occurs in a container. And determining the fault container according to the container index data. And setting a container index data array according to the container index data in the normal state to obtain the difference degree, wherein the difference degree is the container difference between the container state and the normal state. The higher the degree of differentiation, the more abnormal the container.
In some embodiments of the present application, determining a fault container according to container index data is specifically:
the container index data comprises average load of CPU and CPU frequency doubling in preset time;
determining a first difference degree according to the average load of the CPU in a preset time;
obtaining an average load S of a CPU in a preset time, and setting an average load array S0 (S1, S2, S3 and S4) of the CPU in the preset time, wherein the average load of the CPU in the first preset time is S1, the average load of the CPU in the second preset time is S2, the average load of the CPU in the third preset time is S3, the average load of the CPU in the fourth preset time is S4, and S1 is more than S2 and less than S3 and less than S4;
presetting a first difference degree array T0 (T1, T2, T3 and T4), wherein the first preset first difference degree is T1, the second preset first difference degree is T2, the third preset first difference degree is T3, the fourth preset first difference degree is T4, and T4 is more than T3 and less than T2 and less than T1;
if S is less than S1, determining a first preset first difference degree T1 as a first difference degree;
if S1 is less than or equal to S2, determining a second preset first difference degree T2 as a first difference degree;
if S2 is less than or equal to S3, determining a third preset first difference degree T3 as a first difference degree;
if S3 is less than or equal to S4, determining a fourth preset first difference degree T4 as the first difference degree.
In some embodiments of the present application, the second degree of difference is determined from a CPU frequency multiplication,
obtaining CPU frequency multiplication F, presetting a CPU frequency multiplication array F0 (F1, F2, F3 and F4), wherein the first preset CPU frequency multiplication is F1, the second preset CPU frequency multiplication is F2, the third preset CPU frequency multiplication is F3, the fourth preset CPU frequency multiplication is F4, and F1 is more than F2 and less than F3 and less than F4;
presetting a second difference degree array Y0 (Y1, Y2, Y3 and Y4), wherein the first preset second difference degree is Y1, the second preset second difference degree is Y2, the third preset second difference degree is Y3, the fourth preset second difference degree is Y4, and Y4 is more than Y3 and less than Y2 and less than Y1;
if F is smaller than F1, determining a first preset second difference Y1 as a second difference;
if F1 is less than or equal to F2, determining a second preset second difference degree Y2 as a second difference degree;
if F2 is less than or equal to F3, determining a third preset second difference degree Y3 as a second difference degree;
if F3 is less than or equal to F4, determining a fourth preset second difference degree Y4 as a second difference degree.
In some embodiments of the present application, determining a fault container according to container index data is specifically:
determining a fault container according to the sum of the first difference degree and the second difference degree;
if the first preset first difference degree T1 is determined to be the first difference degree, and the first preset second difference degree Y1 is determined to be the second difference degree, the corresponding container is a fault container.
In this embodiment, when the sum of the first difference and the second difference is t1+y1, the container corresponding to the data is a failure container.
In some embodiments of the present application, the method further comprises:
and when a request occurs each time, calling the relation among the micro services, recording the consumed time of each micro service in a log form, displaying the log in a visual form, and displaying and recording the monitoring index data and the container index data in the log and displaying each preset array point value.
By applying the technical scheme, the monitoring index data are acquired, the index score is obtained according to the monitoring index data, and the micro-service state is obtained according to the index score; if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service in the micro-service detection range, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service; and acquiring container index data of all containers under fault service, and determining the fault container according to the container index data. The method and the device preliminarily judge the micro-service state through the index data monitored in the service grid. If so, determining the specific fault micro-service, and determining a fault container according to the container index data. The accuracy of fault positioning in the micro-service is improved, the realization of subsequent fault treatment is facilitated, and the micro-service management framework is optimized.
From the above description of the embodiments, it will be clear to those skilled in the art that the present invention may be implemented in hardware, or may be implemented by means of software plus necessary general hardware platforms. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective implementation scenario of the present invention.
In order to further explain the technical idea of the invention, the technical scheme of the invention is described with specific application scenarios.
Correspondingly, the application also provides a log management platform based on micro-service, which is applied to a service grid, as shown in fig. 2, and comprises:
the acquisition module 202 is configured to acquire monitoring index data, obtain an index score according to the monitoring index data, and obtain a micro-service state according to the index score;
the computing module 202 is configured to, if a failure exists in the micro-service, send multiple requests to the micro-service within the detection range of the micro-service at the same time, obtain a service score of the micro-service through a preset algorithm, and determine the micro-service with the highest service score as the failure service;
the determining module 203 is configured to obtain container index data of all containers under the fault service, and determine a faulty container according to the container index data.
The platform further comprises:
in some embodiments of the present application, the obtaining module 201 is specifically configured to:
monitoring index data including delay, flow, error amount, and saturation;
acquiring a first score according to the delay;
obtaining a delay A, and presetting a delay array A0 (A1, A2, A3 and A4), wherein the first preset delay is A1, the second preset delay is A2, the third preset delay is A3, the fourth preset delay is A4, and A1 is more than A2 and less than A3 and less than A4;
presetting a first score array Q0 (Q1, Q2, Q3 and Q4), wherein a first preset first score is Q1, a second preset first score is Q2, a third preset first score is Q3, a fourth preset first score is Q4, and Q1 is more than Q2 and less than Q3 and less than Q4;
determining a first score according to the relationship between the delays and each preset delay;
if A is less than A1, determining a first preset first score Q1 as a first score;
if A1 is less than or equal to A2, determining a second preset first score Q2 as a first score;
if A2 is less than or equal to A3, determining a third preset first score Q3 as a first score;
if A3 is less than or equal to A4, determining a fourth preset first score Q4 as the first score.
In some embodiments of the present application, the obtaining module 201 is specifically configured to:
obtaining a second fraction according to the flow, and obtaining a flow B and a preset flow array B0 (B1, B2, B3 and B4), wherein the first preset flow is B1, the second preset flow is B2, the third preset flow is B3, the fourth preset flow is B4, and B1 is more than B2 and less than B3 and less than B4;
presetting a second fractional array W0 (W1, W2, W3, W4), wherein the first preset second fraction is W1, the second preset second fraction is W2, the third preset second fraction is W3, the fourth preset second fraction is W4, and W1 is more than W2 and less than W3 and more than W4;
determining a second fraction according to the relation between the flow and each preset flow;
if B is smaller than B1, determining a first preset second score W1 as a second score;
if B1 is less than or equal to B2, determining a second preset second fraction W2 as a second fraction;
if B2 is less than or equal to B3, determining a third preset second fraction W3 as a second fraction;
if B3 is less than or equal to B4, determining a fourth preset second fraction W4 as the second fraction.
In some embodiments of the present application, the obtaining module 201 is specifically configured to:
obtaining a third score according to the error quantity, and obtaining an error quantity C, wherein a preset error quantity array C0 (C1, C2, C3 and C4), wherein the first preset error quantity is C1, the second preset error quantity is C2, the third preset error quantity is C3, the fourth preset error quantity is C4, and C1 is more than C2 and less than C3 and less than C4;
presetting a third score array E0 (E1, E2, E3 and E4), wherein the first preset third score is E1, the second preset third score is E2, the third preset third score is E3, the fourth preset third score is E4, E1 is more than E2 and less than E3 and less than E4;
determining a third score according to the relation between the error amount and each preset error amount;
if C is smaller than C1, determining a first preset third score E1 as a third score;
if C1 is less than or equal to C2, determining a second preset third fraction E2 as a third fraction;
if C2 is less than or equal to C3, determining a third preset third fraction E3 as a third fraction;
if C3 is less than or equal to C4, determining a fourth preset third fraction E4 as the third fraction.
In some embodiments of the present application, the obtaining module 201 is specifically configured to:
obtaining a fourth fraction according to the saturation, obtaining the saturation D, and presetting a saturation array D0 (D1, D2, D3 and D4), wherein the first preset saturation is D1, the second preset saturation is D2, the third preset saturation is D3, the fourth preset saturation is D4, and D1 is more than D2 and less than D3 and less than D4;
presetting a fourth fraction array R0 (R1, R2, R3 and R4), wherein the first preset fourth fraction is R1, the second preset fourth fraction is R2, the third preset fourth fraction is R3, the fourth preset fourth fraction is R4, and R1 is more than R2 and less than R3 and less than R4;
determining a fourth fraction according to the relation between the saturation and each preset saturation;
if D is smaller than D1, determining a first preset fourth fraction R1 as a fourth fraction;
if D1 is less than or equal to D2, determining a second preset fourth fraction R2 as a fourth fraction;
if D2 is less than or equal to D3, determining a third preset fourth fraction R3 as a fourth fraction;
if D3 is less than or equal to D4, determining a fourth preset fourth fraction R4 as a fourth fraction.
In some embodiments of the present application, the obtaining module 201 is specifically configured to:
obtaining index scores according to the first score, the second score, the third score, the fourth score and the preset monitoring index data weight;
if the index score exceeds a preset threshold, the micro-service has faults;
if the index score does not exceed the preset threshold, the micro-service has no fault.
In some embodiments of the present application, the determining module 203 is specifically configured to:
the container index data comprises average load of CPU and CPU frequency doubling in preset time;
determining a first difference degree according to the average load of the CPU in a preset time;
obtaining an average load S of a CPU in a preset time, and setting an average load array S0 (S1, S2, S3 and S4) of the CPU in the preset time, wherein the average load of the CPU in the first preset time is S1, the average load of the CPU in the second preset time is S2, the average load of the CPU in the third preset time is S3, the average load of the CPU in the fourth preset time is S4, and S1 is more than S2 and less than S3 and less than S4;
presetting a first difference degree array T0 (T1, T2, T3 and T4), wherein the first preset first difference degree is T1, the second preset first difference degree is T2, the third preset first difference degree is T3, the fourth preset first difference degree is T4, and T4 is more than T3 and less than T2 and less than T1;
if S is less than S1, determining a first preset first difference degree T1 as a first difference degree;
if S1 is less than or equal to S2, determining a second preset first difference degree T2 as a first difference degree;
if S2 is less than or equal to S3, determining a third preset first difference degree T3 as a first difference degree;
if S3 is less than or equal to S4, determining a fourth preset first difference degree T4 as the first difference degree.
In some embodiments of the present application, the determining module 203 is specifically configured to:
determining a second difference according to CPU frequency multiplication, obtaining a CPU frequency multiplication F and presetting a CPU frequency multiplication array F0 (F1, F2, F3 and F4), wherein the first preset CPU frequency multiplication is F1, the second preset CPU frequency multiplication is F2, the third preset CPU frequency multiplication is F3, the fourth preset CPU frequency multiplication is F4, and F1 is more than F2 and less than F3 and less than F4;
presetting a second difference degree array Y0 (Y1, Y2, Y3 and Y4), wherein the first preset second difference degree is Y1, the second preset second difference degree is Y2, the third preset second difference degree is Y3, the fourth preset second difference degree is Y4, and Y4 is more than Y3 and less than Y2 and less than Y1;
if F is smaller than F1, determining a first preset second difference Y1 as a second difference;
if F1 is less than or equal to F2, determining a second preset second difference degree Y2 as a second difference degree;
if F2 is less than or equal to F3, determining a third preset second difference degree Y3 as a second difference degree;
if F3 is less than or equal to F4, determining a fourth preset second difference degree Y4 as a second difference degree.
In some embodiments of the present application, the determining module 203 is specifically configured to:
determining a fault container according to the sum of the first difference degree and the second difference degree;
if the first preset first difference degree T1 is determined to be the first difference degree, and the first preset second difference degree Y1 is determined to be the second difference degree, the corresponding container is a fault container.
Those skilled in the art will appreciate that modules in a platform in an implementation scenario may be distributed among platforms in an implementation scenario according to an implementation scenario description, or that corresponding changes may be located in one or more platforms different from the implementation scenario. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for managing a micro-service based log, applied to a service grid, the method comprising:
acquiring monitoring index data, obtaining index scores according to the monitoring index data, and obtaining micro-service states according to the index scores;
if the micro-service has faults, simultaneously sending a plurality of requests to the micro-service in the micro-service detection range, obtaining the service score of the micro-service through a preset algorithm, and determining the micro-service with the highest service score as the fault service;
and acquiring container index data of all containers under fault service, and determining the fault container according to the container index data.
2. The method according to claim 1, wherein the index score is obtained from monitoring index data, in particular:
monitoring index data including delay, flow, error amount, and saturation;
acquiring a first score according to the delay;
obtaining a delay A, and presetting a delay array A0 (A1, A2, A3 and A4), wherein the first preset delay is A1, the second preset delay is A2, the third preset delay is A3, the fourth preset delay is A4, and A1 is more than A2 and less than A3 and less than A4;
presetting a first score array Q0 (Q1, Q2, Q3 and Q4), wherein a first preset first score is Q1, a second preset first score is Q2, a third preset first score is Q3, a fourth preset first score is Q4, and Q1 is more than Q2 and less than Q3 and less than Q4;
determining a first score according to the relationship between the delays and each preset delay;
if A is less than A1, determining a first preset first score Q1 as a first score;
if A1 is less than or equal to A2, determining a second preset first score Q2 as a first score;
if A2 is less than or equal to A3, determining a third preset first score Q3 as a first score;
if A3 is less than or equal to A4, determining a fourth preset first score Q4 as the first score.
3. The method of claim 2, wherein the second score is obtained based on traffic,
obtaining a flow B, and presetting a flow array B0 (B1, B2, B3 and B4), wherein the first preset flow is B1, the second preset flow is B2, the third preset flow is B3, the fourth preset flow is B4, and B1 is more than B2 and less than B3 and less than B4;
presetting a second fractional array W0 (W1, W2, W3, W4), wherein the first preset second fraction is W1, the second preset second fraction is W2, the third preset second fraction is W3, the fourth preset second fraction is W4, and W1 is more than W2 and less than W3 and more than W4;
determining a second fraction according to the relation between the flow and each preset flow;
if B is smaller than B1, determining a first preset second score W1 as a second score;
if B1 is less than or equal to B2, determining a second preset second fraction W2 as a second fraction;
if B2 is less than or equal to B3, determining a third preset second fraction W3 as a second fraction;
if B3 is less than or equal to B4, determining a fourth preset second fraction W4 as the second fraction.
4. The method of claim 2, wherein the third score is obtained based on an amount of error,
obtaining an error quantity C, and presetting an error quantity array C0 (C1, C2, C3 and C4), wherein the first preset error quantity is C1, the second preset error quantity is C2, the third preset error quantity is C3, the fourth preset error quantity is C4, and C1 is more than C2 and less than C3 and less than C4;
presetting a third score array E0 (E1, E2, E3 and E4), wherein the first preset third score is E1, the second preset third score is E2, the third preset third score is E3, the fourth preset third score is E4, E1 is more than E2 and less than E3 and less than E4;
determining a third score according to the relation between the error amount and each preset error amount;
if C is smaller than C1, determining a first preset third score E1 as a third score;
if C1 is less than or equal to C2, determining a second preset third fraction E2 as a third fraction;
if C2 is less than or equal to C3, determining a third preset third fraction E3 as a third fraction;
if C3 is less than or equal to C4, determining a fourth preset third fraction E4 as the third fraction.
5. The method of claim 2, wherein the fourth score is obtained based on saturation,
obtaining a saturation D, and presetting a saturation array D0 (D1, D2, D3 and D4), wherein the first preset saturation is D1, the second preset saturation is D2, the third preset saturation is D3, the fourth preset saturation is D4, and D1 is more than D2 and less than D3 and less than D4;
presetting a fourth fraction array R0 (R1, R2, R3 and R4), wherein the first preset fourth fraction is R1, the second preset fourth fraction is R2, the third preset fourth fraction is R3, the fourth preset fourth fraction is R4, and R1 is more than R2 and less than R3 and less than R4;
determining a fourth fraction according to the relation between the saturation and each preset saturation;
if D is smaller than D1, determining a first preset fourth fraction R1 as a fourth fraction;
if D1 is less than or equal to D2, determining a second preset fourth fraction R2 as a fourth fraction;
if D2 is less than or equal to D3, determining a third preset fourth fraction R3 as a fourth fraction;
if D3 is less than or equal to D4, determining a fourth preset fourth fraction R4 as a fourth fraction.
6. The method according to claims 2-5, wherein the micro-service state is obtained from an index score, in particular:
obtaining index scores according to the first score, the second score, the third score, the fourth score and the preset monitoring index data weight;
if the index score exceeds a preset threshold, the micro-service has faults;
if the index score does not exceed the preset threshold, the micro-service has no fault.
7. The method according to claim 6, wherein the faulty container is determined from container index data, in particular:
the container index data comprises average load of CPU and CPU frequency doubling in preset time;
determining a first difference degree according to the average load of the CPU in a preset time;
obtaining an average load S of a CPU in a preset time, and setting an average load array S0 (S1, S2, S3 and S4) of the CPU in the preset time, wherein the average load of the CPU in the first preset time is S1, the average load of the CPU in the second preset time is S2, the average load of the CPU in the third preset time is S3, the average load of the CPU in the fourth preset time is S4, and S1 is more than S2 and less than S3 and less than S4;
presetting a first difference degree array T0 (T1, T2, T3 and T4), wherein the first preset first difference degree is T1, the second preset first difference degree is T2, the third preset first difference degree is T3, the fourth preset first difference degree is T4, and T4 is more than T3 and less than T2 and less than T1;
if S is less than S1, determining a first preset first difference degree T1 as a first difference degree;
if S1 is less than or equal to S2, determining a second preset first difference degree T2 as a first difference degree;
if S2 is less than or equal to S3, determining a third preset first difference degree T3 as a first difference degree;
if S3 is less than or equal to S4, determining a fourth preset first difference degree T4 as the first difference degree.
8. The method of claim 7, wherein the second degree of variance is determined based on CPU frequency doubling,
obtaining CPU frequency multiplication F, presetting a CPU frequency multiplication array F0 (F1, F2, F3 and F4), wherein the first preset CPU frequency multiplication is F1, the second preset CPU frequency multiplication is F2, the third preset CPU frequency multiplication is F3, the fourth preset CPU frequency multiplication is F4, and F1 is more than F2 and less than F3 and less than F4;
presetting a second difference degree array Y0 (Y1, Y2, Y3 and Y4), wherein the first preset second difference degree is Y1, the second preset second difference degree is Y2, the third preset second difference degree is Y3, the fourth preset second difference degree is Y4, and Y4 is more than Y3 and less than Y2 and less than Y1;
if F is smaller than F1, determining a first preset second difference Y1 as a second difference;
if F1 is less than or equal to F2, determining a second preset second difference degree Y2 as a second difference degree;
if F2 is less than or equal to F3, determining a third preset second difference degree Y3 as a second difference degree;
if F3 is less than or equal to F4, determining a fourth preset second difference degree Y4 as a second difference degree.
9. The method according to claim 8, characterized in that the faulty container is determined from container index data, in particular:
determining a fault container according to the sum of the first difference degree and the second difference degree;
if the first preset first difference degree T1 is determined to be the first difference degree, and the first preset second difference degree Y1 is determined to be the second difference degree, the corresponding container is a fault container.
10. A microservice-based log management platform for use in a service grid, the platform comprising:
the acquisition module is used for acquiring monitoring index data, obtaining index scores according to the monitoring index data and obtaining micro-service states according to the index scores;
the computing module is used for sending a plurality of requests to the micro-services in the micro-service detection range simultaneously if the micro-services have faults, obtaining the service score of the micro-services through a preset algorithm, and determining the micro-service with the highest service score as the fault service;
the determining module is used for acquiring container index data of all containers under the fault service and determining the fault container according to the container index data.
CN202211257760.1A 2022-10-14 2022-10-14 Log management method and platform based on micro-service Active CN115941545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211257760.1A CN115941545B (en) 2022-10-14 2022-10-14 Log management method and platform based on micro-service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211257760.1A CN115941545B (en) 2022-10-14 2022-10-14 Log management method and platform based on micro-service

Publications (2)

Publication Number Publication Date
CN115941545A CN115941545A (en) 2023-04-07
CN115941545B true CN115941545B (en) 2023-06-23

Family

ID=86549512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211257760.1A Active CN115941545B (en) 2022-10-14 2022-10-14 Log management method and platform based on micro-service

Country Status (1)

Country Link
CN (1) CN115941545B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117370064B (en) * 2023-10-31 2024-05-28 河北东软软件有限公司 Micro-service system based on container technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346936A (en) * 2020-11-27 2021-02-09 中国工商银行股份有限公司 Application fault root cause positioning method and system
CN112532455A (en) * 2020-12-01 2021-03-19 新华三人工智能科技有限公司 Abnormal root cause positioning method and device
CN113282635A (en) * 2021-04-12 2021-08-20 国电南瑞科技股份有限公司 Micro-service system fault root cause positioning method and device
CN113657715A (en) * 2021-07-15 2021-11-16 福建新大陆软件工程有限公司 Root cause positioning method and system based on kernel density estimation calling chain
CN114978968A (en) * 2022-05-10 2022-08-30 中国平安财产保险股份有限公司 Micro-service anomaly detection method and device, computer equipment and storage medium
CN115114064A (en) * 2022-06-24 2022-09-27 苏州浪潮智能科技有限公司 Micro-service fault analysis method, system, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10484410B2 (en) * 2017-07-19 2019-11-19 Cisco Technology, Inc. Anomaly detection for micro-service communications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346936A (en) * 2020-11-27 2021-02-09 中国工商银行股份有限公司 Application fault root cause positioning method and system
CN112532455A (en) * 2020-12-01 2021-03-19 新华三人工智能科技有限公司 Abnormal root cause positioning method and device
CN113282635A (en) * 2021-04-12 2021-08-20 国电南瑞科技股份有限公司 Micro-service system fault root cause positioning method and device
CN113657715A (en) * 2021-07-15 2021-11-16 福建新大陆软件工程有限公司 Root cause positioning method and system based on kernel density estimation calling chain
CN114978968A (en) * 2022-05-10 2022-08-30 中国平安财产保险股份有限公司 Micro-service anomaly detection method and device, computer equipment and storage medium
CN115114064A (en) * 2022-06-24 2022-09-27 苏州浪潮智能科技有限公司 Micro-service fault analysis method, system, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
微服务故障诊断相关技术研究探讨;赵建涛;黄立松;;网络新媒体技术(01);全文 *

Also Published As

Publication number Publication date
CN115941545A (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US7284146B2 (en) Markov model of availability for clustered systems
AU2004264635B2 (en) Fast application notification in a clustered computing system
EP2710461B1 (en) Cross-cloud computing for capacity management and disaster recovery
US7929684B2 (en) High availability multi-tenant feature
US7543305B2 (en) Selective event registration
CN107819861A (en) Business data processing method, apparatus and system
CN115941545B (en) Log management method and platform based on micro-service
US20170289236A1 (en) Cloud Operating System and Method
US20020147823A1 (en) Computer network system
Behl et al. Providing fault-tolerant execution of web-service-based workflows within clouds
CN109873714B (en) Cloud computing node configuration updating method and terminal equipment
US8812578B2 (en) Establishing future start times for jobs to be executed in a multi-cluster environment
CN110377664A (en) Method of data synchronization, device, server and storage medium
CN115952003A (en) Method, device, equipment and storage medium for cluster server load balancing
US20230153725A1 (en) Techniques for determining service risks and causes
Birman et al. Overcoming the ‘d’in cap: Using isis2 to build locally responsive cloud services
Arakawa et al. Availability‐aware virtual network function placement based on multidimensional universal generating functions
US11263094B2 (en) Recovering dynamic system data
Pohorec et al. The Challenges of the Move from the Desktop to the Cloud
JP2001216174A (en) Application substituting method and storage medium in which application substitution program is stored
US11966276B2 (en) Error testing for computers using temporary, self-terminating fault injectors
US10819777B1 (en) Failure isolation in a distributed system
US20230153736A1 (en) Providing business values with service health scores
Al-Wesabi et al. Improving performance in component based distributed systems
US11729082B2 (en) Techniques for providing inter-cluster dependencies

Legal Events

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