[go: up one dir, main page]

CN118860771A - Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection - Google Patents

Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection Download PDF

Info

Publication number
CN118860771A
CN118860771A CN202410797313.8A CN202410797313A CN118860771A CN 118860771 A CN118860771 A CN 118860771A CN 202410797313 A CN202410797313 A CN 202410797313A CN 118860771 A CN118860771 A CN 118860771A
Authority
CN
China
Prior art keywords
inspection
microservice
instances
call chain
inspection task
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.)
Pending
Application number
CN202410797313.8A
Other languages
Chinese (zh)
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.)
China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Digital Platform Technology Guangdong 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 China Southern Power Grid Digital Platform Technology Guangdong Co ltd filed Critical China Southern Power Grid Digital Platform Technology Guangdong Co ltd
Priority to CN202410797313.8A priority Critical patent/CN118860771A/en
Publication of CN118860771A publication Critical patent/CN118860771A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3452Performance evaluation by statistical analysis
    • 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

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请涉及一种基于微服务的实例数和调用链巡检方法、装置、计算机设备、可读存储介质和计算机程序产品,涉及计算机技术领域。本申请能够提高对微服务架构的监控效率,同时还有助于提高系统的稳定性、可拓展性以及可维护性。该方法包括:响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,得到微服务实例数;基于微服务实例数和调用链信息,创建巡检任务;巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;按照预设频率定时执行巡检任务,并根据巡检任务对应的数据收集结果同步生成巡检报告;对巡检报告进行分析,得到巡检结果,将巡检结果进行消息推送。

The present application relates to a method, device, computer equipment, readable storage medium and computer program product for microservice instance number and call chain inspection, and relates to the field of computer technology. The present application can improve the monitoring efficiency of the microservice architecture, and also help to improve the stability, scalability and maintainability of the system. The method includes: responding to an inspection request for a microservice, obtaining the microservice instances existing in the microservice architecture and the call chain information corresponding to each microservice instance, counting the microservice instances, and obtaining the number of microservice instances; creating an inspection task based on the number of microservice instances and the call chain information; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain; executing the inspection task regularly according to a preset frequency, and synchronously generating an inspection report according to the data collection results corresponding to the inspection task; analyzing the inspection report, obtaining the inspection result, and pushing the inspection result by message.

Description

基于微服务的实例数和调用链巡检方法、装置、计算机设备、 可读存储介质和程序产品Method, device, computer equipment, readable storage medium and program product based on the number of microservice instances and call chain inspection

技术领域Technical Field

本申请涉及计算机技术领域,特别是涉及一种基于微服务的实例数和调用链巡检方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for inspecting the number of microservice instances and call chains.

背景技术Background Art

随着计算机技术的发展,出现了微服务架构这种软件架构风格,微服务架构将应用程序拆分为一系列小型独立的服务,每个服务都可以独立部署、扩展和维护。但是,由于微服务架构中存在大量的微服务实例,监控和管理这些微服务实例变得非常复杂,而且各微服务实例之间存在复杂的调用关系,调用链路繁多,难以追踪和分析。With the development of computer technology, a software architecture style called microservice architecture has emerged. Microservice architecture splits applications into a series of small independent services, each of which can be independently deployed, expanded, and maintained. However, due to the large number of microservice instances in the microservice architecture, monitoring and managing these microservice instances becomes very complicated, and there are complex call relationships between microservice instances, and the call links are numerous, making it difficult to track and analyze.

传统技术中,主要通过使用一些监控和巡检工具来监控微服务架构的运行情况。然而,这些工具大多是针对单个微服务实例或调用链进行监控和分析,缺乏对整个微服务架构的全面评估,导致目前技术中的微服务架构监控方法存在监控效率较低的问题。In traditional technology, the operation of microservice architecture is mainly monitored by using some monitoring and inspection tools. However, most of these tools monitor and analyze a single microservice instance or call chain, lacking a comprehensive assessment of the entire microservice architecture, resulting in low monitoring efficiency in the current microservice architecture monitoring methods.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种基于微服务的实例数和调用链巡检方法、装置、计算机设备、计算机可读存储介质和计算机程序产品。Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for inspecting the number of instances and call chains based on microservices in order to solve the above technical problems.

第一方面,本申请提供了一种基于微服务的实例数和调用链巡检方法,包括:In a first aspect, the present application provides a method for inspecting the number of microservice instances and call chains, including:

响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;In response to an inspection request for a microservice, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each of the microservice instances, count the microservice instances, and obtain the number of microservice instances;

基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;Based on the number of microservice instances and the call chain information, an inspection task is created; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain;

按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;The inspection task is executed regularly according to a preset frequency, and an inspection report is generated synchronously according to the data collection results corresponding to the inspection task;

对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。The inspection report is analyzed to obtain inspection results, and the inspection results are pushed as messages.

在其中一个实施例中,所述按照预设频率定时执行所述巡检任务,包括:In one embodiment, the periodically performing the inspection task according to a preset frequency includes:

按照预设频率定时对所述微服务架构中的微服务实例状况和调用链状态进行监测,得到监测结果;对所述监测结果进行识别,得到在线状态的目标微服务实例以及异常状态的目标调用链;对所述目标微服务实例和所述目标调用链进行汇总,得到所述在线实例数和所述调用链异常状态数。The microservice instance status and the call chain status in the microservice architecture are monitored regularly according to a preset frequency to obtain monitoring results; the monitoring results are identified to obtain target microservice instances in an online state and target call chains in an abnormal state; the target microservice instances and the target call chains are summarized to obtain the number of online instances and the number of abnormal states of the call chains.

在其中一个实施例中,所述根据所述巡检任务中的数据收集结果同步生成巡检报告,包括:In one embodiment, the synchronously generating an inspection report according to the data collection results in the inspection task includes:

根据所述在线实例数和所述微服务实例数,得到所述微服务架构中的微服务在线比例;根据所述调用链异常状态数和所述调用链信息,得到微服务架构中的调用链异常比例;同步生成包含所述微服务在线比例和所述调用链异常比例的所述巡检报告。According to the number of online instances and the number of microservice instances, the online proportion of microservices in the microservice architecture is obtained; according to the number of call chain abnormal states and the call chain information, the abnormal proportion of call chains in the microservice architecture is obtained; and the inspection report including the online proportion of microservices and the abnormal proportion of call chains is synchronously generated.

在其中一个实施例中,所述对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送,包括:In one embodiment, analyzing the inspection report to obtain the inspection result, and pushing the inspection result as a message includes:

分别判断所述微服务在线比例和所述调用链异常比例是否满足对应的阈值条件;在所述微服务在线比例和所述调用链异常比例中至少一项数值未满足所述阈值条件的情况下,生成包含未满足所述阈值条件的数值的所述巡检结果,并将所述巡检结果按照预设的推送方式进行消息推送。Respectively determine whether the online proportion of the microservices and the abnormal proportion of the call chain meet corresponding threshold conditions; if at least one of the values of the online proportion of the microservices and the abnormal proportion of the call chain does not meet the threshold condition, generate the inspection result including the value that does not meet the threshold condition, and push the inspection result as a message according to a preset push method.

在其中一个实施例中,所述基于所述微服务实例数和所述调用链信息,创建巡检任务之后,还包括:In one embodiment, after creating the inspection task based on the number of microservice instances and the call chain information, the method further includes:

生成所述巡检任务对应的唯一标识信息;根据所述唯一标识信息,匹配巡检任务列表中的目标信息条目;将所述巡检任务录入所述巡检任务列表中的所述目标信息条目进行存储。Generate unique identification information corresponding to the inspection task; match the target information entry in the inspection task list according to the unique identification information; enter the inspection task into the target information entry in the inspection task list for storage.

在其中一个实施例中,所述方法还包括:In one embodiment, the method further comprises:

在接收到针对目标巡检任务的导出指令时,根据所述导出指令,提取所述目标巡检任务对应的唯一标识信息;根据所述目标巡检任务对应的唯一标识信息,在所述巡检任务列表中识别并提取所述目标巡检任务,得到所述目标巡检任务对应的巡检任务信息。When an export instruction for a target inspection task is received, the unique identification information corresponding to the target inspection task is extracted according to the export instruction; based on the unique identification information corresponding to the target inspection task, the target inspection task is identified and extracted from the inspection task list to obtain the inspection task information corresponding to the target inspection task.

第二方面,本申请还提供了一种基于微服务的实例数和调用链巡检装置,包括:In a second aspect, the present application also provides a device for inspecting the number of microservice instances and call chains, including:

实例获取模块,用于响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;An instance acquisition module is used to respond to inspection requests for microservices, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each of the microservice instances, and count the microservice instances to obtain the number of microservice instances;

任务创建模块,用于基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;A task creation module, used to create an inspection task based on the number of microservice instances and the call chain information; the inspection items in the inspection task include monitoring of the number of online instances and the number of abnormal states of the call chain;

报告生成模块,用于按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;A report generation module, used to execute the inspection task regularly according to a preset frequency, and synchronously generate an inspection report based on the data collection results corresponding to the inspection task;

消息推送模块,用于对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。The message push module is used to analyze the inspection report, obtain the inspection result, and push the inspection result as a message.

第三方面,本申请还提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。In response to an inspection request for a microservice, the microservice instances existing in the microservice architecture and the call chain information corresponding to each of the microservice instances are obtained, the microservice instances are counted to obtain the number of microservice instances; based on the number of microservice instances and the call chain information, an inspection task is created; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain; the inspection task is executed regularly at a preset frequency, and an inspection report is synchronously generated according to the data collection result corresponding to the inspection task; the inspection report is analyzed to obtain the inspection result, and the inspection result is pushed as a message.

第四方面,本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。In response to an inspection request for a microservice, the microservice instances existing in the microservice architecture and the call chain information corresponding to each of the microservice instances are obtained, the microservice instances are counted to obtain the number of microservice instances; based on the number of microservice instances and the call chain information, an inspection task is created; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain; the inspection task is executed regularly at a preset frequency, and an inspection report is synchronously generated according to the data collection result corresponding to the inspection task; the inspection report is analyzed to obtain the inspection result, and the inspection result is pushed as a message.

第五方面,本申请还提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。In response to an inspection request for a microservice, the microservice instances existing in the microservice architecture and the call chain information corresponding to each of the microservice instances are obtained, the microservice instances are counted to obtain the number of microservice instances; based on the number of microservice instances and the call chain information, an inspection task is created; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain; the inspection task is executed regularly at a preset frequency, and an inspection report is synchronously generated according to the data collection result corresponding to the inspection task; the inspection report is analyzed to obtain the inspection result, and the inspection result is pushed as a message.

上述基于微服务的实例数和调用链巡检方法、装置、计算机设备、计算机可读存储介质和计算机程序产品,能够对整个微服务架构进行全面评估,包括监控和评估微服务架构中各个微服务实例的数量以及调用链的运行情况,通过创建巡检任务的方式来收集微服务实例的运行数据和调用链的跟踪信息,为分析微服务实例数和调用链的性能指标提供参考依据,从而更准确且高效地识别出潜在的性能瓶颈和故障原因,并及时地向用户提供相应的巡检结果以帮助用户优化微服务架构,由此提高了对微服务架构的监控效率,同时还有助于提高系统的稳定性、可拓展性以及可维护性。The above-mentioned inspection method, device, computer equipment, computer-readable storage medium and computer program product based on the number of microservice instances and call chain can comprehensively evaluate the entire microservice architecture, including monitoring and evaluating the number of each microservice instance in the microservice architecture and the operation of the call chain, and collecting the operation data of the microservice instance and the tracking information of the call chain by creating inspection tasks, so as to provide a reference basis for analyzing the performance indicators of the number of microservice instances and the call chain, so as to more accurately and efficiently identify potential performance bottlenecks and causes of failures, and provide users with corresponding inspection results in a timely manner to help users optimize the microservice architecture, thereby improving the monitoring efficiency of the microservice architecture, and also helping to improve the stability, scalability and maintainability of the system.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或相关技术中的技术方案,下面将对本申请实施例或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

图1为一个实施例中基于微服务的实例数和调用链巡检方法的应用环境图;FIG1 is an application environment diagram of a method for inspecting the number of microservice instances and call chains in one embodiment;

图2为一个实施例中基于微服务的实例数和调用链巡检方法的流程示意图;FIG2 is a flow chart of a method for inspecting the number of microservice instances and call chains in one embodiment;

图3为一个实施例中执行巡检任务步骤的流程示意图;FIG3 is a schematic diagram of a flow chart of steps for executing an inspection task in one embodiment;

图4为一个具体实施例中基于微服务的实例数和调用链巡检方法的流程示意图;FIG4 is a flow chart of a method for inspecting the number of microservice instances and call chains in a specific embodiment;

图5为一个实施例中基于微服务的实例数和调用链巡检装置的结构框图;FIG5 is a structural block diagram of a device for inspecting the number of microservice instances and call chains in one embodiment;

图6为一个实施例中计算机设备的内部结构图。FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment.

具体实施方式DETAILED DESCRIPTION

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

本申请实施例提供的基于微服务的实例数和调用链巡检方法,可以应用于如图1所示的应用环境中。其中,终端通过网络与服务器进行通信。数据存储系统可以存储服务器需要处理的数据。数据存储系统可以集成在服务器上,也可以放在云上或其他网络服务器上。The microservice-based instance number and call chain inspection method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or it can be placed on the cloud or other network servers.

具体地,本申请实施例提供的基于微服务的实例数和调用链巡检方法,可以由服务器执行。Specifically, the microservice-based instance number and call chain inspection method provided in the embodiments of the present application can be executed by the server.

示例性的,服务器响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,得到微服务实例数;服务器基于微服务实例数和调用链信息,创建巡检任务;巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;服务器按照预设频率定时执行巡检任务,并根据巡检任务对应的数据收集结果同步生成巡检报告;服务器对巡检报告进行分析,得到巡检结果,并将巡检结果进行消息推送。Exemplarily, the server responds to an inspection request for a microservice, obtains the microservice instances existing in the microservice architecture and the call chain information corresponding to each microservice instance, counts the microservice instances, and obtains the number of microservice instances; the server creates an inspection task based on the number of microservice instances and the call chain information; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal call chain states; the server executes the inspection task at a preset frequency, and synchronously generates an inspection report based on the data collection results corresponding to the inspection task; the server analyzes the inspection report, obtains the inspection results, and pushes the inspection results as a message.

在如图1所示的应用环境中,终端可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。In the application environment shown in FIG1 , the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

在一个实施例中,如图2所示,提供了一种基于微服务的实例数和调用链巡检方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG2 , a method for inspecting the number of microservice instances and call chains is provided. The method is described by taking the application of the method to the server in FIG1 as an example, and includes the following steps:

步骤S201,响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,得到微服务实例数。Step S201, in response to an inspection request for a microservice, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each microservice instance, count the microservice instances, and obtain the number of microservice instances.

其中,微服务架构是一种软件架构设计模式,在该模式中应用程序被划分为一系列小型、自治的服务单元,每个服务单元都围绕特定的业务功能构建,可以独立部署、独立扩展和独立更新。Among them, the microservice architecture is a software architecture design pattern in which the application is divided into a series of small, autonomous service units. Each service unit is built around a specific business function and can be independently deployed, expanded, and updated.

其中,微服务实例可以是微服务架构中一个或多个的运行实例,负责提供特定的业务功能或服务,可以独立部署和运行。Among them, a microservice instance can be one or more running instances in the microservice architecture, responsible for providing specific business functions or services, and can be deployed and run independently.

其中,调用链可以是在分布式系统或微服务架构中由多个微服务之间相互调用形成的调用关系链,可用于完成复杂的业务逻辑或业务流程。Among them, the call chain can be a call relationship chain formed by mutual calls between multiple microservices in a distributed system or microservice architecture, which can be used to complete complex business logic or business processes.

具体地,服务器响应于用户针对微服务的巡检请求,查询并获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,汇总得到微服务实例数。Specifically, the server responds to the user's inspection request for the microservice, queries and obtains the microservice instances existing in the microservice architecture and the call chain information corresponding to each microservice instance, counts the microservice instances, and summarizes the number of microservice instances.

步骤S202,基于微服务实例数和调用链信息,创建巡检任务;巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测。Step S202: Create an inspection task based on the number of microservice instances and call chain information; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain.

其中,巡检任务可以是服务器根据微服务实例数和调用链信息对应配置的针对微服务架构进行定期监测和维护的一种作业任务。Among them, the inspection task can be an operation task for regular monitoring and maintenance of the microservice architecture configured by the server according to the number of microservice instances and call chain information.

具体地,服务器基于微服务实例数和调用链信息,确定巡检配置,并根据巡检配置创建巡检任务;巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测。Specifically, the server determines the inspection configuration based on the number of microservice instances and the call chain information, and creates an inspection task according to the inspection configuration; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain.

步骤S203,按照预设频率定时执行巡检任务,并根据巡检任务对应的数据收集结果同步生成巡检报告。Step S203, regularly executing the inspection task according to the preset frequency, and synchronously generating an inspection report according to the data collection result corresponding to the inspection task.

其中,巡检报告可以是根据巡检过程中收集的相关数据而形成的报告,用于记录微服务架构中在线实例数以及调用链异常状态数等关键信息,可以为巡检结果的生成提供数据支撑。Among them, the inspection report can be a report generated based on relevant data collected during the inspection process, which is used to record key information such as the number of online instances in the microservice architecture and the number of abnormal states of the call chain, and can provide data support for the generation of inspection results.

其中,数据收集结果可以是收集系统运行时的各种数据,包括但不限于微服务实例的运行数据和调用链的跟踪信息等,可用于后续的分析和评估。The data collection results may include various data collected during system operation, including but not limited to the operation data of microservice instances and tracking information of call chains, which can be used for subsequent analysis and evaluation.

具体地,服务器按照预设频率定时执行巡检任务,收集系统运行时的各种数据,得到数据收集结果,并根据巡检任务对应的数据收集结果同步生成巡检报告。Specifically, the server regularly performs inspection tasks according to a preset frequency, collects various data during system operation, obtains data collection results, and synchronously generates inspection reports based on the data collection results corresponding to the inspection tasks.

步骤S204,对巡检报告进行分析,得到巡检结果,将巡检结果进行消息推送。Step S204, analyzing the inspection report, obtaining the inspection result, and pushing the inspection result as a message.

其中,巡检结果可以是巡检报告对应的分析结果,用于总结系统的性能状况、发现的问题、分析的结果和提出的建议,为系统的优化和改进提供参考依据。The inspection result may be an analysis result corresponding to the inspection report, which is used to summarize the system's performance status, problems found, analysis results and suggestions, and provide a reference for system optimization and improvement.

具体地,服务器对巡检报告中包含的数据收集结果进行判断和分析,得到巡检结果,并将巡检结果按照用户预设的推送方式进行消息推送。Specifically, the server judges and analyzes the data collection results contained in the inspection report to obtain the inspection results, and pushes the inspection results in a message according to the push method preset by the user.

上述基于微服务的实例数和调用链巡检方法中,能够对整个微服务架构进行全面评估,包括监控和评估微服务架构中各个微服务实例的数量以及调用链的运行情况,通过创建巡检任务的方式来收集微服务实例的运行数据和调用链的跟踪信息,为分析微服务实例数和调用链的性能指标提供参考依据,从而更准确且高效地识别出潜在的性能瓶颈和故障原因,并及时地向用户提供相应的巡检结果以帮助用户优化微服务架构,由此提高了对微服务架构的监控效率,同时还有助于提高系统的稳定性、可拓展性以及可维护性。The above-mentioned inspection method based on the number of microservice instances and call chains can comprehensively evaluate the entire microservice architecture, including monitoring and evaluating the number of each microservice instance in the microservice architecture and the operation of the call chain, and collecting the operation data of the microservice instance and the tracking information of the call chain by creating inspection tasks, so as to provide a reference for analyzing the performance indicators of the number of microservice instances and the call chain, so as to more accurately and efficiently identify potential performance bottlenecks and causes of failures, and provide users with corresponding inspection results in a timely manner to help users optimize the microservice architecture, thereby improving the monitoring efficiency of the microservice architecture, and also helping to improve the stability, scalability and maintainability of the system.

在其中一个实施例中,如图3所示,上述步骤S203中,按照预设频率定时执行巡检任务,具体包括如下步骤:In one embodiment, as shown in FIG. 3 , in the above step S203, the inspection task is performed regularly according to a preset frequency, specifically including the following steps:

步骤S301,按照预设频率定时对微服务架构中的微服务实例状况和调用链状态进行监测,得到监测结果。Step S301, monitor the microservice instance status and call chain status in the microservice architecture at a preset frequency to obtain monitoring results.

步骤S302,对监测结果进行识别,得到在线状态的目标微服务实例以及异常状态的目标调用链。Step S302: Identify the monitoring results to obtain the target microservice instance in the online state and the target call chain in the abnormal state.

步骤S303,对目标微服务实例和目标调用链进行汇总,得到在线实例数和调用链异常状态数。Step S303: Summarize the target microservice instances and target call chains to obtain the number of online instances and the number of abnormal call chain states.

其中,调用链的异常状态是指在一个分布式系统中由多个微服务组成的请求处理过程中由于某些服务出现了错误或异常而导致整个请求的处理链路出现问题的错误或异常情况,包括但不限于超时异常、网络异常以及服务故障等情况。Among them, the abnormal state of the call chain refers to the error or abnormal situation in which the entire request processing chain has problems due to errors or exceptions in some services during the request processing process composed of multiple microservices in a distributed system, including but not limited to timeout exceptions, network exceptions, and service failures.

具体地,服务器从数据库中获取巡检配置,并根据预设频率和巡检配置定时对微服务架构中的微服务实例状况和调用链状态进行监测,得到微服务详细信息;对微服务详细信息进行分析和识别,得到在线状态的目标微服务实例以及异常状态的目标调用链;对目标微服务实例和目标调用链进行汇总,并统计出在线实例数和调用链异常状态数。Specifically, the server obtains the inspection configuration from the database, and monitors the status of the microservice instances and the call chain in the microservice architecture according to the preset frequency and the inspection configuration, and obtains the detailed information of the microservices; analyzes and identifies the detailed information of the microservices, obtains the target microservice instances in the online state and the target call chain in the abnormal state; summarizes the target microservice instances and the target call chain, and counts the number of online instances and the number of abnormal states of the call chain.

本实施例中,通过定时对微服务架构中的微服务实例状况和调用链状态进行监测,并对监测结果进行识别和汇总,从而准确地统计出在线实例数和调用链异常状态数,为分析微服务实例数和调用链的性能指标提供了有效依据。In this embodiment, by regularly monitoring the status of microservice instances and call chain status in the microservice architecture, and identifying and summarizing the monitoring results, the number of online instances and the number of abnormal call chain states are accurately counted, providing an effective basis for analyzing the number of microservice instances and the performance indicators of the call chain.

在其中一个实施例中,上述步骤S203中,根据巡检任务中的数据收集结果同步生成巡检报告,具体包括如下步骤:In one embodiment, in the above step S203, the inspection report is synchronously generated according to the data collection result in the inspection task, which specifically includes the following steps:

根据在线实例数和微服务实例数,得到微服务架构中的微服务在线比例;根据调用链异常状态数和调用链信息,得到微服务架构中的调用链异常比例;同步生成包含微服务在线比例和调用链异常比例的巡检报告。According to the number of online instances and the number of microservice instances, the online proportion of microservices in the microservice architecture is obtained; according to the number of call chain abnormal states and call chain information, the call chain abnormal proportion in the microservice architecture is obtained; and an inspection report including the online proportion of microservices and the call chain abnormal proportion is generated synchronously.

具体地,服务器根据在线实例数和微服务实例数,通过第一运算模型计算得到微服务架构中的微服务在线比例;再根据调用链异常状态数和调用链信息,通过第二运算模型计算得到微服务架构中的调用链异常比例;同步生成包含微服务在线比例和调用链异常比例的巡检报告。Specifically, the server calculates the online proportion of microservices in the microservice architecture through the first computing model based on the number of online instances and the number of microservice instances; then calculates the call chain abnormality proportion in the microservice architecture through the second computing model based on the number of call chain abnormal states and call chain information; and simultaneously generates an inspection report including the microservice online proportion and the call chain abnormality proportion.

本实施例中,通过计算出微服务架构中的微服务在线比例和调用链异常比例,并同步生成包含微服务在线比例和调用链异常比例的巡检报告,从而为巡检结果的生成提供了科学准确的数据支撑。In this embodiment, by calculating the online proportion of microservices and the abnormal proportion of call chains in the microservice architecture, and synchronously generating an inspection report including the online proportion of microservices and the abnormal proportion of call chains, scientific and accurate data support is provided for the generation of inspection results.

在其中一个实施例中,上述步骤S204中,对巡检报告进行分析,得到巡检结果,将巡检结果进行消息推送,具体包括如下步骤:In one embodiment, in the above step S204, the inspection report is analyzed to obtain the inspection result, and the inspection result is pushed as a message, which specifically includes the following steps:

分别判断微服务在线比例和调用链异常比例是否满足对应的阈值条件;在微服务在线比例和调用链异常比例中至少一项数值未满足阈值条件的情况下,生成包含未满足阈值条件的数值的巡检结果,并将巡检结果按照预设的推送方式进行消息推送。Determine whether the online proportion of microservices and the abnormal proportion of call chains meet the corresponding threshold conditions respectively; if at least one of the values of the online proportion of microservices and the abnormal proportion of call chains does not meet the threshold conditions, generate an inspection result including the value that does not meet the threshold conditions, and push the inspection result by message according to the preset push method.

其中,阈值条件可以是用户根据实际情况设置的一个界限值或门槛值,用来判断微服务在线比例和调用链异常比例是否满足对应的条件。The threshold condition may be a limit value or threshold value set by the user according to the actual situation, which is used to determine whether the online proportion of microservices and the abnormal proportion of call chains meet the corresponding conditions.

其中,预设的推送方式可以是以邮件或者短信的方式进行推送。The preset push method may be to push via email or text message.

具体地,服务器分别判断微服务在线比例和调用链异常比例是否满足对应的阈值条件;在识别到微服务在线比例和调用链异常比例中至少一项数值未满足阈值条件的情况下,确定未满足阈值条件的目标数值,并生成包含目标数值的巡检结果,再将巡检结果按照预设的推送方式进行消息推送。Specifically, the server determines whether the online proportion of microservices and the call chain abnormality proportion meet the corresponding threshold conditions respectively; when it is identified that at least one of the values of the online proportion of microservices and the call chain abnormality proportion does not meet the threshold condition, the target value that does not meet the threshold condition is determined, and an inspection result including the target value is generated, and then the inspection result is pushed as a message according to a preset push method.

本实施例中,通过识别出未满足阈值条件的目标数值,并生成包含目标数值的巡检结果,从而实现了对巡检报告的准确分析,且能够及时地向用户提供包含分析内容的巡检结果以帮助用户优化微服务架构。In this embodiment, by identifying the target values that do not meet the threshold conditions and generating inspection results containing the target values, accurate analysis of the inspection report is achieved, and the inspection results containing the analysis content can be provided to users in a timely manner to help users optimize the microservice architecture.

在其中一个实施例中,基于微服务实例数和调用链信息,创建巡检任务之后,本申请的方法还包括如下步骤:In one embodiment, after creating the inspection task based on the number of microservice instances and the call chain information, the method of the present application further includes the following steps:

生成巡检任务对应的唯一标识信息;根据唯一标识信息,匹配巡检任务列表中的目标信息条目;将巡检任务录入巡检任务列表中的目标信息条目进行存储。Generate unique identification information corresponding to the inspection task; match the target information item in the inspection task list according to the unique identification information; enter the inspection task into the target information item in the inspection task list for storage.

其中,唯一标识信息可以是巡检任务的任务名称或者任务编号,巡检任务列表中的信息条目通过标识信息与各巡检任务进行一一对应。The unique identification information may be a task name or a task number of the inspection task, and the information items in the inspection task list correspond one-to-one with each inspection task through the identification information.

其中,信息条目可以是巡检任务列表中按照一定规则排列而成的短小的信息单位,类似于一个标题或者一个小节。The information entry may be a short information unit arranged according to certain rules in the inspection task list, similar to a title or a section.

具体地,服务器在创建巡检任务之后对应生成该巡检任务对应的唯一标识信息,根据唯一标识信息,匹配巡检任务列表中的目标信息条目;将巡检任务录入巡检任务列表中的目标信息条目进行存储。Specifically, after creating the inspection task, the server generates unique identification information corresponding to the inspection task, matches the target information item in the inspection task list according to the unique identification information; and enters the inspection task into the target information item in the inspection task list for storage.

本实施例中,通过根据唯一标识信息,匹配巡检任务列表中的目标信息条目,并将巡检任务录入巡检任务列表中的目标信息条目进行存储,从而以巡检任务对应的唯一标识信息为划分标准,规则有序地将巡检任务录入巡检任务列表,有利于巡检任务的高效准确执行。In this embodiment, the target information items in the inspection task list are matched according to the unique identification information, and the inspection tasks are entered into the target information items in the inspection task list for storage. Thus, the inspection tasks are entered into the inspection task list in a regular and orderly manner based on the unique identification information corresponding to the inspection tasks, which is conducive to the efficient and accurate execution of the inspection tasks.

在其中一个实施例中,本申请的方法还包括如下步骤:In one embodiment, the method of the present application further includes the following steps:

在接收到针对目标巡检任务的导出指令时,根据导出指令,提取目标巡检任务对应的唯一标识信息;根据目标巡检任务对应的唯一标识信息,在巡检任务列表中识别并提取目标巡检任务,得到目标巡检任务对应的巡检任务信息。When an export instruction for a target inspection task is received, the unique identification information corresponding to the target inspection task is extracted according to the export instruction; based on the unique identification information corresponding to the target inspection task, the target inspection task is identified and extracted from the inspection task list to obtain the inspection task information corresponding to the target inspection task.

其中,导出指令可以是对巡检任务列表有查看权限的相关运维人员所发出的指令。The export instruction may be an instruction issued by a relevant operation and maintenance personnel who has the authority to view the inspection task list.

具体地,服务器在接收到针对目标巡检任务的导出指令时,根据导出指令,提取目标巡检任务对应的唯一标识信息;根据目标巡检任务对应的唯一标识信息,在巡检任务列表中识别并提取目标巡检任务,并将目标巡检任务对应的巡检任务信息发送至终端以供终端进行展示。Specifically, when the server receives an export instruction for a target inspection task, it extracts the unique identification information corresponding to the target inspection task according to the export instruction; based on the unique identification information corresponding to the target inspection task, it identifies and extracts the target inspection task from the inspection task list, and sends the inspection task information corresponding to the target inspection task to the terminal for display by the terminal.

本实施例中,通过根据目标巡检任务对应的唯一标识信息,在巡检任务列表中识别并提取目标巡检任务,并将目标巡检任务对应的巡检任务信息发送至终端以供终端进行展示,从而快速准确地识别并获取到目标巡检任务对应的巡检任务信息,便于运维人员对巡检任务信息进行后续分析和处理。In this embodiment, the target inspection task is identified and extracted from the inspection task list based on the unique identification information corresponding to the target inspection task, and the inspection task information corresponding to the target inspection task is sent to the terminal for display by the terminal, so as to quickly and accurately identify and obtain the inspection task information corresponding to the target inspection task, thereby facilitating the operation and maintenance personnel to perform subsequent analysis and processing of the inspection task information.

在一个实施例中,如图4所示,提供了一个具体实施例中基于微服务的实例数和调用链巡检方法,具体包括以下步骤:In one embodiment, as shown in FIG4 , a method for inspecting the number of microservice instances and call chains is provided, which specifically includes the following steps:

步骤S401,响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,得到微服务实例数。Step S401, in response to an inspection request for a microservice, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each microservice instance, count the microservice instances, and obtain the number of microservice instances.

步骤S402,基于微服务实例数和调用链信息,创建巡检任务。Step S402: Create an inspection task based on the number of microservice instances and call chain information.

步骤S403,生成巡检任务对应的唯一标识信息;根据唯一标识信息,匹配巡检任务列表中的目标信息条目;将巡检任务录入巡检任务列表中的目标信息条目进行存储。Step S403, generating unique identification information corresponding to the inspection task; matching the target information item in the inspection task list according to the unique identification information; entering the inspection task into the target information item in the inspection task list for storage.

步骤S404,按照预设频率定时对微服务架构中的微服务实例状况以及调用链状态进行监测,得到监测结果;对监测结果进行识别,得到在线状态的目标微服务实例以及异常状态的目标调用链;对目标微服务实例和目标调用链进行汇总,得到在线实例数和调用链异常状态数。Step S404, monitor the status of microservice instances and call chain status in the microservice architecture at a preset frequency to obtain monitoring results; identify the monitoring results to obtain target microservice instances in online status and target call chains in abnormal status; summarize the target microservice instances and target call chains to obtain the number of online instances and the number of abnormal call chain statuses.

步骤S405,根据在线实例数和微服务实例数,得到微服务架构中的微服务在线比例;根据调用链异常状态数和调用链信息,得到微服务架构中的调用链异常比例;同步生成包含微服务在线比例和调用链异常比例的巡检报告。Step S405, according to the number of online instances and the number of microservice instances, obtain the online proportion of microservices in the microservice architecture; according to the number of call chain abnormal states and the call chain information, obtain the call chain abnormal proportion in the microservice architecture; and synchronously generate an inspection report including the online proportion of microservices and the call chain abnormal proportion.

步骤S406,分别判断微服务在线比例和调用链异常比例是否满足对应的阈值条件;在微服务在线比例和调用链异常比例中至少一项数值未满足阈值条件的情况下,生成包含未满足阈值条件的数值的巡检结果,并将巡检结果按照预设的推送方式进行消息推送。Step S406, respectively determine whether the online proportion of microservices and the abnormal proportion of call chains meet the corresponding threshold conditions; if at least one of the values of the online proportion of microservices and the abnormal proportion of call chains does not meet the threshold condition, generate an inspection result including the value that does not meet the threshold condition, and push the inspection result in a message according to a preset push method.

步骤S407,在接收到针对目标巡检任务的导出指令时,根据导出指令,提取目标巡检任务对应的唯一标识信息;根据目标巡检任务对应的唯一标识信息,在巡检任务列表中识别并提取目标巡检任务,得到目标巡检任务对应的巡检任务信息。Step S407, when receiving the export instruction for the target inspection task, extract the unique identification information corresponding to the target inspection task according to the export instruction; identify and extract the target inspection task in the inspection task list according to the unique identification information corresponding to the target inspection task, and obtain the inspection task information corresponding to the target inspection task.

上述实施例带来的有益效果如下:The beneficial effects brought by the above embodiments are as follows:

1)全面性:本申请能够对整个微服务架构进行全面评估,包括微服务实例的数量和调用链的性能指标,从而更准确地发现潜在的性能瓶颈和故障原因。1) Comprehensiveness: This application can comprehensively evaluate the entire microservice architecture, including the number of microservice instances and performance indicators of the call chain, so as to more accurately discover potential performance bottlenecks and causes of failures.

2)简易性:本申请采用简单易用的方法和工具,使运营人员可以轻松地进行微服务巡检,无需具备专业的技术知识和经验。2) Simplicity: This application uses simple and easy-to-use methods and tools, allowing operators to easily perform microservice inspections without the need for professional technical knowledge and experience.

3)科学性:本申请不仅提供监控和分析功能,还能对性能瓶颈和故障原因进行深入分析,并提供相应的优化建议,帮助用户优化微服务架构,提高系统的稳定性、可扩展性以及可维护性。3) Scientificity: This application not only provides monitoring and analysis functions, but also conducts in-depth analysis of performance bottlenecks and failure causes, and provides corresponding optimization suggestions to help users optimize the microservice architecture and improve the stability, scalability and maintainability of the system.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的基于微服务的实例数和调用链巡检方法的基于微服务的实例数和调用链巡检装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个基于微服务的实例数和调用链巡检装置实施例中的具体限定可以参见上文中对于基于微服务的实例数和调用链巡检方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides a device for inspecting the number of microservice-based instances and call chains for implementing the above-mentioned method for inspecting the number of microservice-based instances and call chains. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more microservice-based instance number and call chain inspection devices provided below can refer to the limitations of the microservice-based instance number and call chain inspection method above, and will not be repeated here.

在一个示例性的实施例中,如图5所示,提供了一种基于微服务的实例数和调用链巡检装置,包括:In an exemplary embodiment, as shown in FIG5 , a device for inspecting the number of microservice instances and call chains is provided, including:

实例获取模块501,用于响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各微服务实例对应的调用链信息,对微服务实例进行统计,得到微服务实例数;The instance acquisition module 501 is used to respond to the inspection request for the microservice, obtain the microservice instances existing in the microservice architecture and the call chain information corresponding to each microservice instance, count the microservice instances, and obtain the number of microservice instances;

任务创建模块502,用于基于微服务实例数和调用链信息,创建巡检任务;巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;The task creation module 502 is used to create an inspection task based on the number of microservice instances and call chain information; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain;

报告生成模块503,用于按照预设频率定时执行巡检任务,并根据巡检任务对应的数据收集结果同步生成巡检报告;The report generation module 503 is used to perform the inspection task regularly according to the preset frequency, and synchronously generate the inspection report according to the data collection results corresponding to the inspection task;

消息推送模块504,用于对巡检报告进行分析,得到巡检结果,将巡检结果进行消息推送。The message push module 504 is used to analyze the inspection report, obtain the inspection result, and push the inspection result as a message.

在一个实施例中,报告生成模块503,还用于按照预设频率定时对微服务架构中的微服务实例状况和调用链状态进行监测,得到监测结果;对监测结果进行识别,得到在线状态的目标微服务实例以及异常状态的目标调用链;对目标微服务实例和目标调用链进行汇总,得到在线实例数和调用链异常状态数。In one embodiment, the report generation module 503 is also used to monitor the microservice instance status and call chain status in the microservice architecture at a preset frequency to obtain monitoring results; identify the monitoring results to obtain the target microservice instance in the online state and the target call chain in the abnormal state; summarize the target microservice instance and the target call chain to obtain the number of online instances and the number of abnormal call chains.

在一个实施例中,报告生成模块503,还用于根据在线实例数和微服务实例数,得到微服务架构中的微服务在线比例;根据调用链异常状态数和调用链信息,得到微服务架构中的调用链异常比例;同步生成包含微服务在线比例和调用链异常比例的巡检报告。In one embodiment, the report generation module 503 is also used to obtain the online proportion of microservices in the microservice architecture based on the number of online instances and the number of microservice instances; obtain the call chain abnormality proportion in the microservice architecture based on the number of call chain abnormal states and call chain information; and synchronously generate an inspection report including the microservice online proportion and the call chain abnormality proportion.

在一个实施例中,消息推送模块504,还用于分别判断微服务在线比例和调用链异常比例是否满足对应的阈值条件;在微服务在线比例和调用链异常比例中至少一项数值未满足阈值条件的情况下,生成包含未满足阈值条件的数值的巡检结果,并将巡检结果按照预设的推送方式进行消息推送。In one embodiment, the message push module 504 is also used to determine whether the online proportion of microservices and the abnormal proportion of call chains meet the corresponding threshold conditions; when at least one of the values of the online proportion of microservices and the abnormal proportion of call chains does not meet the threshold conditions, an inspection result containing the value that does not meet the threshold conditions is generated, and the inspection result is pushed as a message according to a preset push method.

在一个实施例中,基于微服务的实例数和调用链巡检装置还包括任务录入模块,用于生成巡检任务对应的唯一标识信息;根据唯一标识信息,匹配巡检任务列表中的目标信息条目;将巡检任务录入巡检任务列表中的目标信息条目进行存储。In one embodiment, the microservice instance number and call chain inspection device also includes a task entry module for generating unique identification information corresponding to the inspection task; matching the target information entry in the inspection task list according to the unique identification information; and entering the inspection task into the target information entry in the inspection task list for storage.

在一个实施例中,基于微服务的实例数和调用链巡检装置还包括任务导出模块,用于在接收到针对目标巡检任务的导出指令时,根据导出指令,提取目标巡检任务对应的唯一标识信息;根据目标巡检任务对应的唯一标识信息,在巡检任务列表中识别并提取目标巡检任务,得到目标巡检任务对应的巡检任务信息。In one embodiment, the microservice instance number and call chain inspection device also includes a task export module, which is used to extract the unique identification information corresponding to the target inspection task according to the export instruction when receiving the export instruction for the target inspection task; according to the unique identification information corresponding to the target inspection task, identify and extract the target inspection task in the inspection task list to obtain the inspection task information corresponding to the target inspection task.

上述基于微服务的实例数和调用链巡检装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned microservice-based instance number and call chain inspection device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

在一个示例性的实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图6所示。该计算机设备包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储巡检任务数据。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于微服务的实例数和调用链巡检方法。In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store inspection task data. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for inspecting the number of instances and call chains based on microservices is implemented.

本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

在一个实施例中,还提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现上述各方法实施例中的步骤。In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要符合相关规定。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性存储器和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(Resistive Random Access Memory,ReRAM)、磁变存储器(Magnetoresistive RandomAccess Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。本申请提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器、人工智能(Artificial Intelligence,AI)处理器等,不限于此。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本申请记载的范围。The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (10)

1.一种基于微服务的实例数和调用链巡检方法,其特征在于,所述方法包括:1. A method for inspecting the number of microservice instances and call chains, characterized in that the method comprises: 响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;In response to an inspection request for a microservice, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each of the microservice instances, count the microservice instances, and obtain the number of microservice instances; 基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;Based on the number of microservice instances and the call chain information, an inspection task is created; the inspection items in the inspection task include monitoring the number of online instances and the number of abnormal states of the call chain; 按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;The inspection task is executed regularly according to a preset frequency, and an inspection report is generated synchronously according to the data collection results corresponding to the inspection task; 对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。The inspection report is analyzed to obtain inspection results, and the inspection results are pushed as messages. 2.根据权利要求1所述的方法,其特征在于,所述按照预设频率定时执行所述巡检任务,包括:2. The method according to claim 1, characterized in that the step of regularly performing the inspection task at a preset frequency comprises: 按照预设频率定时对所述微服务架构中的微服务实例状况和调用链状态进行监测,得到监测结果;Monitor the microservice instance status and call chain status in the microservice architecture regularly according to a preset frequency to obtain monitoring results; 对所述监测结果进行识别,得到在线状态的目标微服务实例以及异常状态的目标调用链;Identify the monitoring results to obtain the target microservice instance in the online state and the target call chain in the abnormal state; 对所述目标微服务实例和所述目标调用链进行汇总,得到所述在线实例数和所述调用链异常状态数。The target microservice instances and the target call chains are summarized to obtain the number of online instances and the number of abnormal states of the call chains. 3.根据权利要求2所述的方法,其特征在于,所述根据所述巡检任务中的数据收集结果同步生成巡检报告,包括:3. The method according to claim 2, characterized in that the step of synchronously generating an inspection report according to the data collection results in the inspection task comprises: 根据所述在线实例数和所述微服务实例数,得到所述微服务架构中的微服务在线比例;According to the number of online instances and the number of microservice instances, an online proportion of microservices in the microservice architecture is obtained; 根据所述调用链异常状态数和所述调用链信息,得到微服务架构中的调用链异常比例;According to the number of abnormal states of the call chain and the call chain information, a call chain abnormality ratio in the microservice architecture is obtained; 同步生成包含所述微服务在线比例和所述调用链异常比例的所述巡检报告。The inspection report including the online proportion of the microservices and the abnormal proportion of the call chain is synchronously generated. 4.根据权利要求3所述的方法,其特征在于,所述对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送,包括:4. The method according to claim 3, characterized in that the analyzing the inspection report to obtain the inspection result and pushing the inspection result as a message comprises: 分别判断所述微服务在线比例和所述调用链异常比例是否满足对应的阈值条件;Determine whether the online proportion of the microservices and the abnormal proportion of the call chain meet corresponding threshold conditions respectively; 在所述微服务在线比例和所述调用链异常比例中至少一项数值未满足所述阈值条件的情况下,生成包含未满足所述阈值条件的数值的所述巡检结果,并将所述巡检结果按照预设的推送方式进行消息推送。When at least one of the values of the online proportion of the microservices and the abnormal proportion of the call chain does not meet the threshold condition, the inspection result including the value that does not meet the threshold condition is generated, and the inspection result is pushed as a message according to a preset push method. 5.根据权利要求1所述的方法,其特征在于,所述基于所述微服务实例数和所述调用链信息,创建巡检任务之后,还包括:5. The method according to claim 1, characterized in that after creating the inspection task based on the number of microservice instances and the call chain information, it also includes: 生成所述巡检任务对应的唯一标识信息;Generate unique identification information corresponding to the inspection task; 根据所述唯一标识信息,匹配巡检任务列表中的目标信息条目;According to the unique identification information, matching the target information entry in the inspection task list; 将所述巡检任务录入所述巡检任务列表中的所述目标信息条目进行存储。The inspection task is entered into the target information item in the inspection task list for storage. 6.根据权利要求5所述的方法,其特征在于,所述方法还包括:6. The method according to claim 5, characterized in that the method further comprises: 在接收到针对目标巡检任务的导出指令时,根据所述导出指令,提取所述目标巡检任务对应的唯一标识信息;When receiving an export instruction for a target inspection task, extracting unique identification information corresponding to the target inspection task according to the export instruction; 根据所述目标巡检任务对应的唯一标识信息,在所述巡检任务列表中识别并提取所述目标巡检任务,得到所述目标巡检任务对应的巡检任务信息。According to the unique identification information corresponding to the target inspection task, the target inspection task is identified and extracted in the inspection task list to obtain the inspection task information corresponding to the target inspection task. 7.一种基于微服务的实例数和调用链巡检装置,其特征在于,所述装置包括:7. A device for inspecting the number of microservice instances and call chains, characterized in that the device comprises: 实例获取模块,用于响应于针对微服务的巡检请求,获取微服务架构中存在的微服务实例以及各所述微服务实例对应的调用链信息,对所述微服务实例进行统计,得到微服务实例数;An instance acquisition module is used to respond to inspection requests for microservices, obtain microservice instances existing in the microservice architecture and call chain information corresponding to each of the microservice instances, and count the microservice instances to obtain the number of microservice instances; 任务创建模块,用于基于所述微服务实例数和所述调用链信息,创建巡检任务;所述巡检任务中的巡检项包括在线实例数以及调用链异常状态数的监测;A task creation module, used to create an inspection task based on the number of microservice instances and the call chain information; the inspection items in the inspection task include monitoring of the number of online instances and the number of abnormal states of the call chain; 报告生成模块,用于按照预设频率定时执行所述巡检任务,并根据所述巡检任务对应的数据收集结果同步生成巡检报告;A report generation module, used to execute the inspection task regularly according to a preset frequency, and synchronously generate an inspection report based on the data collection results corresponding to the inspection task; 消息推送模块,用于对所述巡检报告进行分析,得到巡检结果,将所述巡检结果进行消息推送。The message push module is used to analyze the inspection report, obtain the inspection result, and push the inspection result as a message. 8.一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至6中任一项所述的方法的步骤。8. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。9. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented. 10.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至6中任一项所述的方法的步骤。10. A computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
CN202410797313.8A 2024-06-20 2024-06-20 Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection Pending CN118860771A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410797313.8A CN118860771A (en) 2024-06-20 2024-06-20 Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410797313.8A CN118860771A (en) 2024-06-20 2024-06-20 Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection

Publications (1)

Publication Number Publication Date
CN118860771A true CN118860771A (en) 2024-10-29

Family

ID=93161960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410797313.8A Pending CN118860771A (en) 2024-06-20 2024-06-20 Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection

Country Status (1)

Country Link
CN (1) CN118860771A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119576708A (en) * 2024-11-26 2025-03-07 天翼云科技有限公司 Service abnormal state alarm method, device, computer equipment, readable storage medium and program product

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119576708A (en) * 2024-11-26 2025-03-07 天翼云科技有限公司 Service abnormal state alarm method, device, computer equipment, readable storage medium and program product

Similar Documents

Publication Publication Date Title
Bogatinovski et al. Self-supervised anomaly detection from distributed traces
CN111459766A (en) A call chain tracking and analysis method for microservice system
CN111581104A (en) DevOps research and development operation integration-based measurement method
CN106909676A (en) The analysis method and device of user power utilization behavior
CN113468159A (en) Data application full-link management and control method and system
Zeng et al. Traceark: Towards actionable performance anomaly alerting for online service systems
CN111913824B (en) Method for determining data link fault cause and related equipment
CN117971606B (en) Log management system and method based on elastic search
CN116205396A (en) A data panorama monitoring method and system based on a data middle platform
Shilpika et al. MELA: A visual analytics tool for studying multifidelity hpc system logs
CN114356692A (en) Visual processing method, device and storage medium for application monitoring link
Chen et al. Trace-based intelligent fault diagnosis for microservices with deep learning
CN118860771A (en) Method, device, computer equipment, readable storage medium and program product based on microservice instance number and call chain inspection
CN119359413B (en) E-commerce order analysis and regulation method and system
CN118897784B (en) Interface call log analysis method, device, equipment, medium and product
CN114660530A (en) Multi-system data collaborative electric energy meter fault diagnosis system, method and equipment
CN119544707A (en) Message tracing method, device, computer equipment, readable storage medium and program product
CN118133952A (en) Event influence determining method, device, equipment and storage medium of batch system
CN110825784B (en) Detection method and device for low-efficiency business process
CN114422324B (en) Alarm information processing method and device, electronic equipment and storage medium
CN115914365A (en) Method, device, equipment and medium for determining automatic marketing result
US20230334068A1 (en) Data processing method and apparatus thereof, electronic device, and computer-readable storage medium
CN117057691A (en) Logistics order monitoring method, device, equipment and storage medium
CN120523630A (en) Data running batch processing method, device, equipment and storage medium
CN120336117A (en) Computing service log management method and device for intelligent computing center

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