Micro-service management method and device

文档序号:7226 发布日期:2021-09-17 浏览:56次 中文

1. A method for microservice management, the method comprising:

acquiring micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data;

acquiring performance data and fault data of each micro service;

generating corresponding micro-service fault information according to a preset micro-service calling threshold value and by combining the performance data and the fault data of each micro-service;

and determining the influence range of each micro-service fault information according to the micro-service fault information and the resource management data of the micro-service.

2. The method of claim 1, wherein:

the micro-service supply and marketing data comprise micro-service provider information and micro-service ordering party information;

the microservice orchestration data comprises service information and service flow information provided by microservices.

3. The method of claim 2, further comprising:

the performance data of each micro service is the calling time, calling time delay, calling times and calling success times of the micro service;

and the fault data of each micro service is the micro service fault occurrence time and the fault content.

4. The method according to claim 3, wherein the method for generating the corresponding micro service fault information according to the preset micro service invocation threshold in combination with the performance data and the fault data of each micro service specifically comprises:

presetting a micro-service calling success rate threshold and a calling delay threshold;

obtaining the average calling time delay of the micro-service according to the calling time and the calling time delay of the micro-service, and obtaining the calling success rate of the micro-service according to the calling times and the calling success times of the micro-service;

and when the micro-service calling success rate or calling delay exceeds the micro-service calling success rate threshold and the calling delay threshold, generating micro-service fault information according to the micro-service calling time and the micro-service arrangement data.

5. The method according to claim 4, wherein the method for determining the influence range of each micro-service fault information according to the each micro-service fault information in combination with the resource management data of the micro-service is specifically:

acquiring service flow information in the microservice arrangement data according to the microservice fault information;

acquiring service information provided by the micro service according to the service flow information;

acquiring the micro-service subscriber information according to the service information provided by the micro-service;

and determining the micro-service subscriber information as the influence range of the micro-service fault information.

6. A microservice management apparatus, the apparatus comprising:

the micro-service resource management unit is used for acquiring and managing micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data;

the data acquisition unit is used for acquiring performance data and fault data of each micro service;

the fault information generating unit is used for generating corresponding fault information of each micro-service according to a preset micro-service calling threshold value and by combining the performance data and the fault data of each micro-service collected by the data collecting unit;

and the influence analysis unit is used for determining the influence range of each micro-service fault information according to the micro-service fault information generated by the fault information generation unit and the fault data acquired by the data acquisition unit and the micro-service resource management data acquired by the micro-service resource management unit.

7. The apparatus of claim 6, wherein the micro service resource management unit further comprises:

the micro-service supply and sale data management module is used for acquiring and managing micro-service provider information and micro-service ordering party information contained in the micro-service supply and sale data;

and the micro-service arrangement data management module is used for acquiring and managing the service information and the service flow information provided by the micro-service contained in the micro-service arrangement data.

8. The apparatus of claim 7, wherein the data acquisition unit further comprises:

the performance data acquisition module is used for acquiring the calling time, calling time delay, calling times and calling success times of each micro service;

and the fault data acquisition module is used for acquiring the fault occurrence time and the fault content of each micro service.

9. The apparatus of claim 8, wherein the failure information generating unit further comprises:

the threshold setting module is used for presetting a micro-service calling success rate threshold and a calling delay threshold;

the calculation module is used for obtaining the average calling time delay of the micro-service according to the calling time and the calling time delay of the micro-service and obtaining the calling success rate of the micro-service according to the calling times and the calling success times of the micro-service;

and the fault information generation module is used for generating micro-service fault information according to micro-service calling time and the micro-service arrangement data when the micro-service calling success rate or calling time delay calculated by the calculation module exceeds the micro-service calling success rate threshold and calling time delay threshold set by the threshold setting module.

10. The apparatus of claim 9, wherein the impact analysis unit further comprises:

the service flow information acquisition module is used for acquiring service flow information in the micro-service arrangement data according to the micro-service fault information generated by the fault information generation module and the fault data acquired by the data acquisition unit;

the service information acquisition module is used for acquiring the service information provided by the microservice according to the service flow information acquired by the service flow information acquisition module;

the ordering information acquisition module acquires the micro-service ordering party information according to the service information provided by the micro-service acquired by the service information acquisition module;

and the influence range determining module is used for determining the influence range of the micro-service fault information according to the micro-service subscriber information acquired by the subscription information acquiring module.

Background

Microservice Architecture (Microservice Architecture) is an emerging software Architecture style that develops an independent and complete application system by developing a few tiny services. Each micro service is built around a business function, independent deployment can be carried out through an automatic deployment mechanism, the micro services run in own processes, and a lightweight communication mechanism is adopted among the micro services. These microservices can be written in different programming languages, can use different data storage technologies, and keep centralized management to a minimum.

Large-scale microservice systems involve thousands of microservices. Since there may be call dependencies between microservices, any component error may result in a large number of users not normally accessing. How to manage massive micro services and guarantee the service quality of the micro services become a difficult problem.

At present, micro services are often managed according to application topology, and the specific mode is that the calling relationship among the micro services is tracked to obtain the application topology, and then service fault points are located according to the application topology, but if the micro services are not managed by a good organization, the application topology may be a very complex mesh relationship, and under the condition that the number of the micro services is huge, the service fault points cannot be located according to the application topology, and the influence range of the fault micro services cannot be determined according to the application topology, so that massive micro services cannot be managed well.

Therefore, how to effectively manage the micro-services and accurately determine the influence range of the fault micro-services becomes a problem to be solved urgently.

Disclosure of Invention

The invention aims to provide a technical means for effectively and accurately determining the influence range of fault micro-services so as to achieve the aim of effectively managing the micro-services.

In order to achieve the above object, the present invention provides a micro service management method, including:

acquiring micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data;

acquiring performance data and fault data of each micro service;

generating corresponding micro-service fault information according to a preset micro-service calling threshold value and by combining the performance data and the fault data of each micro-service;

and determining the influence range of each micro-service fault information according to the micro-service fault information and the resource management data of the micro-service.

Further:

the micro-service supply and marketing data comprise micro-service provider information and micro-service ordering party information;

the microservice orchestration data comprises service information and service flow information provided by microservices.

Further, the method comprises the following steps:

the performance data of each micro service is the calling time, calling time delay, calling times and calling success times of the micro service;

and the fault data of each micro service is the micro service fault occurrence time and the fault content.

Specifically, the method for generating the corresponding micro service fault information according to the preset micro service invocation threshold in combination with the performance data and the fault data of each micro service specifically comprises the following steps:

presetting a micro-service calling success rate threshold and a calling delay threshold;

obtaining the average calling time delay of the micro-service according to the calling time and the calling time delay of the micro-service, and obtaining the calling success rate of the micro-service according to the calling times and the calling success times of the micro-service;

and when the micro-service calling success rate or calling delay exceeds the micro-service calling success rate threshold and the calling delay threshold, generating micro-service fault information according to the micro-service calling time and the micro-service arrangement data.

Specifically, the method for determining the influence range of each micro-service fault information according to the micro-service fault information in combination with the resource management data of the micro-service specifically includes:

acquiring service flow information in the microservice arrangement data according to the microservice fault information;

acquiring service information provided by the micro service according to the service flow information;

acquiring the micro-service subscriber information according to the service information provided by the micro-service;

and determining the micro-service subscriber information as the influence range of the micro-service fault information.

The present invention also provides a micro-service management device, comprising:

the micro-service resource management unit is used for acquiring and managing micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data;

the data acquisition unit is used for acquiring performance data and fault data of each micro service;

the fault information generating unit is used for generating corresponding fault information of each micro-service according to a preset micro-service calling threshold value and by combining the performance data and the fault data of each micro-service collected by the data collecting unit;

and the influence analysis unit is used for determining the influence range of each micro-service fault information according to the micro-service fault information generated by the fault information generation unit and the fault data acquired by the data acquisition unit and the micro-service resource management data acquired by the micro-service resource management unit.

Specifically, the micro service resource management unit further includes:

the micro-service supply and sale data management module is used for acquiring and managing micro-service provider information and micro-service ordering party information contained in the micro-service supply and sale data;

and the micro-service arrangement data management module is used for acquiring and managing the service information and the service flow information provided by the micro-service contained in the micro-service arrangement data.

Specifically, the data collection unit further includes:

the performance data acquisition module is used for acquiring the calling time, calling time delay, calling times and calling success times of each micro service;

and the fault data acquisition module is used for acquiring the fault occurrence time and the fault content of each micro service.

Specifically, the failure information generation unit further includes:

the threshold setting module is used for presetting a micro-service calling success rate threshold and a calling delay threshold;

the calculation module is used for obtaining the average calling time delay of the micro-service according to the calling time and the calling time delay of the micro-service and obtaining the calling success rate of the micro-service according to the calling times and the calling success times of the micro-service;

and the fault information generation module is used for generating micro-service fault information according to micro-service calling time and the micro-service arrangement data when the micro-service calling success rate or calling time delay calculated by the calculation module exceeds the micro-service calling success rate threshold and calling time delay threshold set by the threshold setting module.

Specifically, the influence analysis unit further includes:

the service flow information acquisition module is used for acquiring service flow information in the micro-service arrangement data according to the micro-service fault information generated by the fault information generation module and the fault data acquired by the data acquisition unit;

the service information acquisition module is used for acquiring the service information provided by the microservice according to the service flow information acquired by the service flow information acquisition module;

the ordering information acquisition module acquires the micro-service ordering party information according to the service information provided by the micro-service acquired by the service information acquisition module;

and the influence range determining module is used for determining the influence range of the micro-service fault information according to the micro-service subscriber information acquired by the subscription information acquiring module.

The invention discloses a micro-service management method and a device, which are used for acquiring the corresponding relation among micro-services, clients and service flows through order information and arrangement information registered by the micro-services, finding the service flow corresponding to a fault micro-service according to acquired micro-service performance data and fault data, further acquiring the clients corresponding to the service flow and accurately positioning the range of fault influence. The technology can simply and accurately locate the fault point without obtaining a complex micro-service mesh structure, thereby greatly reducing the management cost of micro-service and improving the management efficiency.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.

Fig. 1 is a schematic flowchart of a method for micro service management according to an embodiment of the present application;

FIG. 2 is a flowchart of a method provided in a second embodiment of the present application;

FIG. 3 is a flowchart of a method provided in a third embodiment of the present application;

fig. 4 is a schematic structural diagram of a five-kind micro-service management device according to an embodiment of the present application;

fig. 5 is a schematic structural diagram provided in a sixth embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive effort based on the embodiments of the present invention, are within the scope of the present invention.

The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.

As shown in fig. 1, it is a flowchart of a method for inventing a micro service management method, and this example includes the following steps:

step S01: acquiring micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data.

The microservice supply and marketing data comprises microservice provider information and microservice ordering party information.

The provider information includes a provider name and a service identifier, and the subscriber information includes a subscriber name to be subscribed and a service identifier to be subscribed.

The microservice orchestration data comprises service information and service flow information provided by microservices.

Some of the microservices may be service flows composed of other services in order; the service flow can also contain service and other service flows, and the micro-service arrangement data can be obtained from the micro-service orchestrator and can directly reflect the corresponding relation between the service and the service flow.

Step S02: and acquiring performance data and fault data of each micro-service.

The performance data is data reflecting the performance of the micro-service and comprises service identification, counting start time, counting end time, calling times and calling success times of the service and the like

The fault data is data reflecting micro-service faults and comprises contents such as service identification, occurrence time, fault title, fault text and the like.

Step S03: and generating corresponding micro-service fault information by combining the performance data and the fault data of each micro-service according to a preset micro-service calling threshold.

In practical application, the micro service does not send out fault information, but the calling failure probability is high, and a fault may exist, so that whether the micro service fails or not is evaluated according to the calling success condition of the micro service, and the accuracy of micro service fault judgment is ensured.

Step S04: and determining the influence range of each micro-service fault information according to the micro-service fault information and the resource management data of the micro-service.

Through the service identification of the micro-service, the service flow corresponding to the service can be obtained, and through the service in the service flow, the customers subscribed to the service can be obtained, so that the influence range of the customer as the micro-service fault is determined.

Therefore, the embodiment of the invention discloses a micro-service management method, which finds the relation of micro-service flows by acquiring supply and sales data and arrangement data of micro-services and combining the acquired micro-service performance data and fault data, and determines which micro-services are affected by faults according to the relation of the micro-service flows. By the method and the system, the influence range of the fault micro-service can be determined without acquiring the application topological relation of the micro-service, and the micro-service IT system can be managed more effectively.

In order to better explain the present invention, an embodiment two is given to explain in detail the method for generating each micro-service failure information, as shown in fig. 2.

Step S201: and presetting a micro-service calling success rate threshold and a calling delay threshold.

And setting a calling success threshold value and a calling delay threshold value according to experience.

The calling success threshold and the calling delay threshold can be adjusted according to actual conditions so as to accurately reflect the fault condition of the microservice.

Step S202: and obtaining the average calling time delay of the micro-service according to the calling time and the calling time delay of the micro-service, and obtaining the calling success rate of the micro-service according to the calling times and the calling success times of the micro-service.

The average calling time delay is obtained by averaging each calling time delay;

the call success rate is obtained by the call success number/call number.

Step S203: and when the micro-service calling success rate or calling delay exceeds the micro-service calling success rate threshold and the calling delay threshold, generating micro-service fault information according to the micro-service calling time and the micro-service arrangement data.

The method judges whether the micro service fails according to the calling success rate of the micro service besides the fault information reported by the micro service, and further more accurately determines the failure occurrence time and the influence range.

In order to better explain the invention, a third embodiment is provided, which elaborates the method for generating the failure information of each micro-service, as shown in fig. 3.

Step S301: and acquiring service flow information in the micro-service arrangement data according to the micro-service fault information.

Step S302: and acquiring the service information provided by the micro service according to the service flow information.

Step S303: and acquiring the micro-service subscriber information according to the service information provided by the micro-service.

Step S304: and determining the micro-service subscriber information as the influence range of the micro-service fault information.

By the technical scheme, the service flow information in the arrangement data of the micro service can be conveniently acquired through the micro service fault information, the service information contained in the service flow is determined, the information of the service provider and the subscriber is further acquired, and the subscriber is further determined to be the range influenced by the fault information. The method is simple, convenient and quick, the judgment can be made without knowing the topological information of the whole micro service, the management cost of the micro service is saved, and the efficiency is improved.

In order to better illustrate the present invention, the fourth embodiment of the present invention is given by referring to the example, which explains the method steps for determining the micro-service fault range.

Acquiring resource management data of the micro-service, wherein the resource management data comprises micro-service supply and sale data and micro-service arrangement data, the micro-service supply and sale data is shown in a table 1 and mainly comprises ordering information of a client:

TABLE 1 microservice offer-sell-off data

Client name Service identification
Customer A Composite service 1
Customer B Composite service 2
Customer C Composite service 3
…… ……

Generally, the orchestration data of the micro-acquisition service may be collected from the orchestrator, and the service flow may also include other service flows, as shown in tables 2 and 3: table 2 shows that some services are service flows consisting of other service orders; table 3 shows services included in the service flow.

Table 2 micro-service orchestration data-service to stream correspondence

Service identification Flow identifier
Composite service 1 Stream 1
Composite service 2 Stream 2
Composite service 3 Stream 3
…… ……

Table 3 micro-service orchestration data-service to stream correspondence

Performance data for each specific service is collected, as shown in table 4:

TABLE 4 Performance data collected

Service identification Counting the start time End time of statistics Number of calls Number of call successes Average call latency (seconds)
…… …… …… …… …… ……
Basic service 2 20190425 1600 20190425 1605 100 80 3
…… …… …… …… …… ……

The fault data for each specific service is collected, as shown in table 5:

TABLE 5 Fault data collected

Service identification Time of occurrence Fault title Text of failure
Basic service 3 20190425 1602 Process is hung dead ……
…… …… …… ……

The calling success rate threshold and the calling delay threshold of each specific service can be set according to experience; the set value can be adjusted according to actual conditions, and the best effect is achieved.

For example, the call success rate threshold for base service 2 may be 90%; the call latency threshold is 5 seconds.

When the data in table 4 indicates that the specific service (call success/call times) < call success threshold or the average call delay < call delay threshold, corresponding fault information is generated. The fault information may include information such as a service name, a time of occurrence, a header of the fault, a body of the fault, and the like.

The invocation success rate threshold of the base service 2 in table 4 from 20190425-1600 to 20190425-1605 is 80/100 ═ 80% < 90%, thus generating new fault data, as shown in table 6.

TABLE 6 newly generated Fault data

Service identification Time of occurrence Fault title Text of failure
Basic service 3 20190425-1605 Call failure ……
…… …… …… ……

When new data of table 5 is received or new data of table 6 is generated, the fault data is analyzed:

1) using the service identifier to find the flow identifier to which the service belongs from table 3;

the service identifier is: basic service 2 and basic service 3, then use "basic service 2" to find the flow id from table 3 as: stream 1, stream 2; the flow identification to which the "basic service 3" belongs is found from table 3 as: stream 1.

In summary, the stream identifier that can be found is: stream 1, stream 2.

2) Using the flow identifier to find the service identifier corresponding to the flow from the table 2;

using "flow 1" to find the service identifier corresponding to the flow from table 2 as: composite service 1; using "flow 2" to find the service identifier corresponding to the flow from table 2 is: composite service 2.

3) Using the new service identification to find the name of the client subscribing to it from table 1;

the customer name that ordered it is found from table 1 using "composite service 1": customer A

The customer name that ordered it is found from table 1 using "composite service 2": and (4) a client B.

4) Finding the affiliated flow identification from table 3 using the new service identification;

the flow identification to which the "composite service 1" belongs is found from table 3 as: stream 3

Using "flow 3" to find the service identification corresponding to the flow from table 2 as: composite service 3

The customer name that ordered it is found from table 1 using "composite service 3": and (4) a client C.

No new stream id and no new client name can be found so far

5) And externally outputting to find out the clients affected by the specific service failure: client a, client B, client C.

In conclusion, the method can clearly, concisely and quickly locate the range of the clients affected by the micro-service without complex micro-service topological relation.

The invention also discloses a micro-service management device, and a fifth embodiment of the invention is given first, as shown in fig. 4, to explain the structural characteristics of the device.

The device includes:

the micro-service resource management unit 1 is used for acquiring and managing micro-service resource management data, wherein the micro-service resource management data comprises micro-service supply and sale data and micro-service arrangement data.

The microservice supply and marketing data comprises microservice provider information and microservice ordering party information.

The microservice orchestration data comprises service information and service flow information provided by microservices.

And the data acquisition unit 2 is used for acquiring performance data and fault data of each micro service.

The performance data of each micro service comprises the calling time, calling time delay, calling times and calling success times of the micro service.

And the fault data of each micro service is the micro service fault occurrence time and the fault content.

And the fault information generating unit 3 is used for generating corresponding fault information of each micro service according to a preset micro service calling threshold value and by combining the performance data and the fault data of each micro service acquired by the data acquisition unit.

And the influence analysis unit 4 is used for determining the influence range of each micro-service fault information according to each micro-service fault information generated by the fault information generation unit and the fault data acquired by the data acquisition unit and combining the micro-service resource management data acquired by the micro-service resource management unit.

In order to better explain the structure and the working mode of each part of the device, a sixth embodiment of the invention is given, as shown in fig. 5.

Specifically, the micro service resource management unit 1 further includes:

and the microservice supply and marketing data management module 11 is used for acquiring and managing microservice provider information and microservice ordering party information contained in the microservice supply and marketing data.

And the microservice arrangement data management module 12 is configured to acquire and manage service information and service flow information provided by microservices included in the microservice arrangement data.

The data acquisition unit 2 further comprises:

and the performance data acquisition module 21 is configured to acquire the call time, the call delay, the call times, and the call success times of each microservice.

And the fault data acquisition module 22 is used for acquiring the fault occurrence time and the fault content of each micro service.

The failure information generation unit 3 further includes:

and a threshold setting module 31, configured to preset a micro-service invocation success rate threshold and an invocation delay threshold.

And the calculating module 32 is configured to obtain the average calling time delay of the micro service according to the calling time and the calling time delay of the micro service, and obtain the calling success rate of the micro service according to the number of calling times and the number of successful calling of the micro service.

And the fault information generating module 33 is configured to generate microservice fault information according to microservice calling time and the microservice arrangement data when the microservice calling success rate or the calling delay calculated by the calculating module exceeds the microservice calling success rate threshold and the calling delay threshold set by the threshold setting module.

The influence analysis unit 4 further includes:

and the service flow information acquiring module 41 is configured to acquire service flow information in the micro-service arrangement data according to the micro-service fault information generated by the fault information generating module and the fault data acquired by the data acquiring unit.

And a service information obtaining module 42, configured to obtain the service information provided by the microservice according to the service flow information obtained by the service flow information obtaining module.

The order information obtaining module 43 obtains the micro service order party information according to the service information provided by the micro service obtained by the service information obtaining module.

And an influence range determining module 44, configured to determine, according to the information of the micro-service subscriber acquired by the subscription information acquiring module, an influence range of the micro-service fault information.

It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the foregoing method may be referred to for the corresponding process in the above-described apparatus embodiment, and is not repeated herein.

The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the application described herein may be practiced in sequences other than those illustrated.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:代码清单的生成方法、装置、计算机设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!