CN117768310A - Service topology generation method and device, electronic equipment and storage medium - Google Patents

Service topology generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117768310A
CN117768310A CN202311799021.XA CN202311799021A CN117768310A CN 117768310 A CN117768310 A CN 117768310A CN 202311799021 A CN202311799021 A CN 202311799021A CN 117768310 A CN117768310 A CN 117768310A
Authority
CN
China
Prior art keywords
service
target
service node
index data
node
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
CN202311799021.XA
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.)
Big Data Center Of State Grid Corp Of China
State Grid Corp of China SGCC
Beihang University
State Grid Jiangsu Electric Power Co Ltd
Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
Big Data Center Of State Grid Corp Of China
State Grid Corp of China SGCC
Beihang University
State Grid Jiangsu Electric Power Co Ltd
Nanjing Power Supply Co of State Grid Jiangsu Electric Power 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 Big Data Center Of State Grid Corp Of China, State Grid Corp of China SGCC, Beihang University, State Grid Jiangsu Electric Power Co Ltd, Nanjing Power Supply Co of State Grid Jiangsu Electric Power Co Ltd filed Critical Big Data Center Of State Grid Corp Of China
Priority to CN202311799021.XA priority Critical patent/CN117768310A/en
Publication of CN117768310A publication Critical patent/CN117768310A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The invention discloses a service topology generation method, a device, electronic equipment and a storage medium. The method comprises the following steps: under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated; the method comprises the steps of extracting keywords from index data sets corresponding to a plurality of service nodes, and determining the mapping relation between each service node and a corresponding host machine and the calling relation among the service nodes; and generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among each service node, and visually displaying the service topological graph. According to the technical scheme, the method for extracting the keywords from the index data sets of the plurality of service nodes to be monitored can help operation and maintenance personnel to timely acquire service topology when the faults occur under the condition that the faults occur, and further help the operation and maintenance personnel to determine the reasons of the service faults as soon as possible so as to realize timely treatment of the faults.

Description

Service topology generation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of micro-service operation and maintenance, in particular to a service topology generation method, a device, electronic equipment and a storage medium.
Background
In recent years, micro-service architecture has become increasingly popular in software development. The function of each sub-service is often clear following the design principle of the micro-service architecture, and because the complexity of a single service is low, a developer only needs to concentrate on realizing and testing the function of a certain service. Furthermore, since each micro-service represents a separate business module, they can be delivered and updated independently according to their own schedule, and service developers can have great autonomy. The micro-service framework brings many excellent designs from the architecture, but also has many challenges.
In the process of micro service development and popularization, more and more services are run on the micro service platform, and compared with the traditional single application, the operation and maintenance of the micro service items are more difficult. Because of the diversity and the dynamics of the services in the micro-service architecture, the calling relationship among the services frequently changes, when one of the services fails, other related services are often affected, and operation and maintenance personnel cannot quickly determine the cause of the service failure in a complex architecture.
Disclosure of Invention
The invention provides a service topology generation method, a device, electronic equipment and a storage medium, which can help operation and maintenance personnel to acquire the service topology in time when a fault occurs, and further help the operation and maintenance personnel to determine the cause of the service fault as soon as possible so as to realize the timely treatment of the fault.
In a first aspect, an embodiment of the present invention provides a service topology generating method, including:
under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated;
the method comprises the steps of extracting keywords from index data sets corresponding to a plurality of service nodes, and determining the mapping relation between each service node and a corresponding host machine and the calling relation among the service nodes;
and generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among each service node, and visually displaying the service topological graph.
Further, by extracting keywords from index data sets corresponding to a plurality of service nodes, determining a mapping relationship between each service node and a corresponding host and a calling relationship between each service node, including:
determining a service name and an index data subset corresponding to each service node related to the index data set in the index data set based on the service name keyword, wherein the index data set comprises all the index data subsets;
for a target service node, determining a mapping relation between the target service node and a corresponding host in a target index data subset corresponding to the target service node based on an instance keyword and a host key, wherein the target service node is any service node related to the index data set;
For a target service node, determining a calling relation related to the target service node in a target index data subset corresponding to the target service node based on a target service keyword and a source service keyword;
and integrating the calling relations related to the service nodes based on the service names of the service nodes to obtain the calling relations among the service nodes.
Further, determining, based on the instance key and the host key, a mapping relationship between the target service node and the corresponding host in the target index data subset corresponding to the target service node, includes:
determining one or more target examples corresponding to the target service node and example data subsets corresponding to the target examples in the target index data subsets based on the example keywords, wherein the target index data subsets comprise the example data subsets;
for any target instance, determining a host machine deployed by the any target instance in an instance data subset corresponding to the any target instance based on the host machine key;
and determining the service name of the target service node and the name of the host deployed by each target instance as the mapping relation between the target service node and the corresponding host.
Further, the calling relation related to the target service node comprises a target service node corresponding to the target service node serving as a source service call and a source service node corresponding to the target service node serving as a target service call.
Further, generating a service topology graph based on the mapping relationship between each service node and the corresponding host and the calling relationship between each service node includes:
taking a time stamp generated by faults as an index, determining a plurality of calling chains based on calling relations among the service nodes, wherein each calling chain comprises two service nodes with calling relations and an edge representing the calling relations;
and generating a service topological graph based on the determined mapping relation between each service node and the corresponding host machine by combining the plurality of call links.
Further, after the service topology map is visually displayed, the method further includes:
in response to a first selection operation of a target node in the service topology, one or more call chains in which the target node is located are highlighted.
Further, after the service topology map is visually displayed, the method further includes:
in response to a second selection operation of a target edge in the service topology, highlighting the target edge and a service node linked to the target edge.
In a second aspect, an embodiment of the present invention provides a service topology generating apparatus, including:
the acquisition module is used for acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform communicate under the condition of fault occurrence;
the keyword extraction module is used for extracting keywords from index data sets corresponding to the plurality of service nodes and determining the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes;
and the generating module is used for generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes and visually displaying the service topological graph.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a method as described in the first aspect.
The embodiment of the invention provides a service topology generation method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated; the method comprises the steps of extracting keywords from index data sets corresponding to a plurality of service nodes, and determining the mapping relation between each service node and a corresponding host machine and the calling relation among the service nodes; and generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among each service node, and visually displaying the service topological graph. According to the technical scheme, the method for extracting the keywords from the index data sets of the plurality of service nodes to be monitored can help operation and maintenance personnel to timely acquire service topology when the faults occur under the condition that the faults occur, and further help the operation and maintenance personnel to determine the reasons of the service faults as soon as possible so as to realize timely treatment of the faults.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a service topology generation method according to a first embodiment of the present invention;
fig. 2 is a flowchart of a service topology generation method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a service topology generating apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a service topology generation method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like herein are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It will be appreciated that before using the technical solutions disclosed in the embodiments of the present invention, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to relevant legal regulations.
It can be understood that, in the technical scheme, the acquisition, storage, use, processing and the like of the index data set generated when the plurality of service nodes to be monitored communicate are all authorized by the user and accord with the relevant regulations of the law and regulation, and the method can be only used for generating the service topology map for use.
Example 1
Fig. 1 is a flowchart of a service topology generation method according to a first embodiment of the present invention, where the present embodiment is applicable to a case of generating a service topology map, the method may be performed by a service topology generation apparatus, and the apparatus may be implemented in the form of software and/or hardware and integrated in an electronic device. Further, the electronic device includes, but is not limited to: computers, notebook computers, servers, etc.
As shown in fig. 1, the method includes:
and S110, under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform communicate.
The plurality of service nodes to be monitored on the micro-service platform can be a plurality of service nodes included in a certain naming space on the micro-service platform, and the number of the service nodes is not limited. The index data set generated when the plurality of service nodes communicate may be a set of data generated when the plurality of service nodes communicate, such as may include, but not limited to, request requests received and sent by the plurality of service nodes, transmission control protocol (Transmission Control Protocol, TCP) related data packets, and the like.
The method for acquiring the index data set is not limited, for example, the index data set of a plurality of service nodes included in a certain naming space on the micro-service platform can be acquired in real time through an open source tool for service monitoring and index acquisition. The open source tool for service monitoring and index collection is not limited.
In one embodiment, after the index data set generated when the plurality of service nodes communicate is collected, data in the index data set may be further preprocessed, for example, format normalization, missing value processing, and the like, which are not limited herein.
S120, extracting keywords from index data sets corresponding to the plurality of service nodes, and determining the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes.
The manner of extracting the keywords from the index data sets corresponding to the plurality of service nodes is not limited, for example, the keyword extraction may be performed in the index data sets based on one or more keywords through a keyword extraction model. The model structure of the keyword extraction model is not limited as long as keyword extraction can be achieved.
Specifically, the service name corresponding to each service node involved in the index data set may be extracted from the index data set based on the service name keyword "service", and at the same time, the index data subset corresponding to each service node may be determined. The index data subset corresponding to any service node may be a set of data generated when the service node communicates, and the index data subset corresponding to each service node may form an index data set.
For a target service node, a set of one or more instances corresponding to the target service node may be determined in a target index data subset corresponding to the target service node based on an instance key "instance". Further, the host to which each of the one or more instances is deployed may be determined by a host key "hostname". The mapping relationship between the target service node and the corresponding host may be a relationship indicating one or more hosts corresponding to the target service node, and then the service name of the target service node may be corresponding to the name of the host deployed by each determined instance, so as to determine the mapping relationship between the target service node and the corresponding host. The target service node is any service node related to the index data set.
For the target service node, the call relation related to the target service node may be determined in the target index data subset corresponding to the target service node based on the destination service keyword "destination_work load" and the source service keyword "source_work load". The calling relation related to the target service node comprises a target service node serving as a source service to call a corresponding target service node and the target service node serving as a target service to be called by the corresponding source service node. After determining the calling relations related to the service nodes, integrating all the determined calling relations through the service names of the service nodes, and removing repeated parts to obtain the calling relations among the service nodes.
S130, generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes, and visually displaying the service topological graph.
A service topology graph can be understood as a graph that describes the relationships between individual services in a micro-service architecture. Multiple call chains may be included in the service topology, each call chain may include two service nodes that have a call relationship and an edge that represents the call relationship. The call chain may be determined by a call relationship between service nodes under a timestamp when the fault occurs, for example, for the target service node in step S120, the target service node serving as a source service may be regarded as one call chain where the target service node is located, and the target service node serving as a destination service is called by the corresponding source service node and may be regarded as another call chain where the target service node is located. And when a plurality of call chains exist in the service topological graph, one or more hosts corresponding to each service node can be visually displayed on the corresponding service node in the service topological graph.
The manner in which the service topology is generated and visually displayed is not limited. If so, determining multiple call chains and one or more hosts corresponding to the service nodes in the call chains based on the mapping relation between the service nodes and the corresponding hosts and the call relation between the service nodes, and generating and displaying the service topology graph in a visualized manner by using a tool for realizing the visual display. The means for realizing the visual display is not limited.
The embodiment of the invention provides a service topology generation method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated; the method comprises the steps of extracting keywords from index data sets corresponding to a plurality of service nodes, and determining the mapping relation between each service node and a corresponding host machine and the calling relation among the service nodes; and generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among each service node, and visually displaying the service topological graph. According to the technical scheme, the method for extracting the keywords from the index data sets of the plurality of service nodes to be monitored can help operation and maintenance personnel to timely acquire service topology when the faults occur under the condition that the faults occur, and further help the operation and maintenance personnel to determine the reasons of the service faults as soon as possible so as to realize timely treatment of the faults.
Example two
Fig. 2 is a flowchart of a service topology generating method according to a second embodiment of the present invention, where, based on the first embodiment, keyword extraction is performed on index data sets corresponding to a plurality of service nodes, so as to determine a mapping relationship between each service node and a corresponding host and further refine a call relationship between each service node; and generating further refinement of the service topology graph based on the mapping relation between each service node and the corresponding host machine and the calling relation between each service node.
As shown in fig. 2, the method includes:
and S110, under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform communicate.
S121, determining service names and index data subsets corresponding to each service node related to the index data set in the index data set based on the service name keywords, wherein the index data set comprises all the index data subsets.
Based on the service name keyword "service", a service name corresponding to each service node involved in the index data set may be extracted from the index data set, and at the same time, an index data subset corresponding to each service node may be determined. The index data subset corresponding to any service node may be a set of data generated when the service node communicates, and the index data subset corresponding to each service node may form an index data set.
S122, for a target service node, determining a mapping relation between the target service node and a corresponding host in a target index data subset corresponding to the target service node based on an instance keyword and a host key, wherein the target service node is any service node related to the index data set.
The process of determining the mapping relationship between the target service node and the corresponding host machine may include: one or more target examples corresponding to the target service node are determined in the target index data subset corresponding to the target service node through the example keywords, and then the host machine deployed by each target example is determined through the host machine keywords, wherein the host machine corresponding to the target service node is the host machine deployed by each target example.
In one embodiment, determining, based on the instance key and the host key, a mapping relationship between the target service node and the corresponding host in the target index data subset corresponding to the target service node includes:
determining one or more target examples corresponding to the target service node and example data subsets corresponding to the target examples in the target index data subsets based on the example keywords, wherein the target index data subsets comprise the example data subsets;
for any target instance, determining a host machine deployed by the any target instance in an instance data subset corresponding to the any target instance based on the host machine key;
and determining the service name of the target service node and the name of the host deployed by each target instance as the mapping relation between the target service node and the corresponding host.
One or more target instances corresponding to the target service node can be determined in the target index data subset based on the instance key word instance, and the instance data subset corresponding to each target instance can be determined. The instance data subset corresponding to any target instance can be a set of data generated when the target instance communicates, and the instance data subset corresponding to each target instance can form the target index data subset.
Traversing the instance data subsets corresponding to the target instances, and for any target instance, determining one or more hosts deployed by the target instance from the instance data subsets corresponding to the target instance through a host keyword 'hostname'.
Based on the steps, one or more hosts deployed by each target instance corresponding to the target service node can be determined, the service name of the target service node corresponds to the determined name of the host deployed by each target instance, and the mapping relationship between the target service node and the corresponding host is determined.
S123, for a target service node, determining a calling relation related to the target service node in a target index data subset corresponding to the target service node based on a target service keyword and a source service keyword.
In one embodiment, the call relation related to the target service node includes that the target service node is called as a source service and the target service node is called as a destination service by the corresponding source service node.
For a target service node, determining the target service node as first calling information called by the target service in a target index data subset corresponding to the target service node based on a target service keyword 'destination_work load', and determining a source service node calling the target service node in the first calling information through a source service keyword 'source_work load'.
For the target service node, based on a source service keyword 'source_work load', determining the target service node as second call information for initiating call of source service in a target index data subset corresponding to the target service node, and determining a target service node called by the target service node in the second call information through a target service keyword 'destination_work load'.
S124, integrating the calling relations related to the service nodes based on the service names of the service nodes to obtain the calling relations among the service nodes.
After determining the calling relations related to the service nodes, integrating all the determined calling relations through the service names of the service nodes, and removing repeated parts to obtain the calling relations among the service nodes.
The extraction of the keywords in the above steps may include the following steps:
text preprocessing: the log text data is preprocessed, which includes removing unwanted text portions such as punctuation, numbers, extraneous text, etc. The log text data may be data included in the index data set, which is not limited herein.
The following operations are performed using regular expressions or a text processing library:
the numbers are removed: the numbers in the text are removed using regular expressions.
Removing punctuation: punctuation marks, such as commas, periods, etc., in the text are removed.
Removing irrelevant text: text that is not relevant to keyword extraction, such as date, time stamp, etc., is removed.
Text segmentation: each log text is split into words or lexical units. The following operations are performed using spaces or other separators: text is split into words, and the text is split into word lists using spaces as separators.
Keyword positioning: for each piece of log text, the location of the keyword is located. Traversing the text and looking up the location of each keyword. The following is performed for each keyword: searching keyword positions in the text: the keywords in the keyword list are used to find their location in the text. The keywords in the keyword list may be keywords "service", "instance", "hostname", "destination_work load" and "source_work load" related to the above steps.
Extracting keyword information: for each keyword, corresponding information is extracted according to the position of the keyword. The following operations are performed:
finding the keyword position: the location of the keyword in the text is found.
Extracting information: the information is looked up starting from the keyword location until the next keyword is encountered or the text ends. This portion of information is typically located in the text paragraph following the keyword.
Organization information: the extracted information is organized into a corresponding data structure, such as a dictionary or text variable. And respectively extracting information such as service names, names of target instances, names of hosts, names of destination service nodes, names of source service nodes and the like.
Outputting a result: text data including keyword information is output based on the extracted information. The extracted information may be organized into structured data or saved as text files for further analysis and processing.
S131, taking a time stamp generated by faults as an index, and determining a plurality of call chains based on call relations among the service nodes, wherein each call chain comprises two service nodes with call relations and an edge representing the call relations.
S132, generating a service topological graph based on the determined mapping relation between each service node and the corresponding host machine by combining the plurality of call links, and visually displaying the service topological graph.
The call chain can be determined by the call relationship among the service nodes under the time stamp when the fault occurs. For the target service node, the target service node serving as the source service calls the corresponding target service node to be regarded as one call chain where the target service node is located, and the target service node serving as the target service is called by the corresponding source service node to be regarded as the other call chain where the target service node is located.
The determined plurality of call chains may be visually displayed in the form of a service topology by means of a tool implementing the visual display. Meanwhile, one or more hosts corresponding to each service node can be visually displayed on the corresponding service node in the service topology graph.
In one embodiment, after visually displaying the service topology, the method further comprises:
in response to a first selection operation of a target node in the service topology, one or more call chains in which the target node is located are highlighted.
The first selection operation may be an operation of selecting the target node in the visually displayed service topology, such as a click operation on the target node. The target node may be any service node in the service topology.
When a target node is selected, a node which has no direct calling relation with the node and an edge which is not connected to the node in the service topological graph can improve the transparency of the node, so that neighbor nodes which are directly related to the node and calling relations of the neighbor nodes are highlighted, namely one or more calling chains where the target node is located are highlighted.
In one embodiment, after visually displaying the service topology graph, the method further comprises:
in response to a second selection operation of a target edge in the service topology, highlighting the target edge and a service node linked to the target edge.
The second selection operation may be an operation of selecting the target edge in the visually displayed service topology, such as a click operation on the target edge. The target edge may be an edge in any call chain in the service topology.
When the target edge is selected, other edges and nodes except for the two nodes connected with the edge improve the transparency of the edge and the nodes, so that the user can conveniently check, namely, the service node of the target edge and the target edge link is highlighted.
In one embodiment, the call chains in the visually displayed service topology are dynamic and can be scaled. In addition, the color and size of the service node and the host in the service topology graph can be differentiated, and the connection line between the service node and the host indicates the physical machine deployed by the service node.
The technical scheme of the embodiment of the invention solves the problems that service call topology is difficult to acquire and the like caused by the fact that the number of services is numerous and the types of services are different in the micro-service platform, and improves the operation and maintenance efficiency by timely acquiring and visually displaying the service topology in fault.
Example III
Fig. 3 is a schematic structural diagram of a service topology generating device according to a third embodiment of the present invention, where the present embodiment is applicable to a case of generating a service topology, as shown in fig. 3, the specific structure of the device includes:
the acquiring module 31 is configured to acquire an index data set generated when a plurality of service nodes to be monitored on the micro service platform communicate in the case of a fault;
The keyword extraction module 32 is configured to determine a mapping relationship between each service node and a corresponding host and a calling relationship between each service node by extracting keywords from index data sets corresponding to a plurality of service nodes;
and the generating module 33 is configured to generate a service topology map based on the mapping relationship between each service node and the corresponding host and the calling relationship between each service node, and visually display the service topology map.
According to the service topology generation device provided by the embodiment, the index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated is acquired through the acquisition module under the condition that a fault occurs; the method comprises the steps that keyword extraction is carried out on index data sets corresponding to a plurality of service nodes through a keyword extraction module, and the mapping relation between each service node and a corresponding host machine and the calling relation among each service node are determined; and generating a service topological graph and visually displaying the service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation between each service node by the generating module. According to the technical scheme, the method for extracting the keywords from the index data sets of the plurality of service nodes to be monitored can help operation and maintenance personnel to timely acquire service topology when the faults occur under the condition that the faults occur, and further help the operation and maintenance personnel to determine the reasons of the service faults as soon as possible so as to realize timely treatment of the faults.
Further, the keyword extraction module 32 is specifically configured to:
determining a service name and an index data subset corresponding to each service node related to the index data set in the index data set based on the service name keyword, wherein the index data set comprises all the index data subsets;
for a target service node, determining a mapping relation between the target service node and a corresponding host in a target index data subset corresponding to the target service node based on an instance keyword and a host key, wherein the target service node is any service node related to the index data set;
for a target service node, determining a calling relation related to the target service node in a target index data subset corresponding to the target service node based on a target service keyword and a source service keyword;
and integrating the calling relations related to the service nodes based on the service names of the service nodes to obtain the calling relations among the service nodes.
Further, the keyword extraction module 32 is specifically configured to:
determining one or more target examples corresponding to the target service node and example data subsets corresponding to the target examples in the target index data subsets based on the example keywords, wherein the target index data subsets comprise the example data subsets;
For any target instance, determining a host machine deployed by the any target instance in an instance data subset corresponding to the any target instance based on the host machine key;
and determining the service name of the target service node and the name of the host deployed by each target instance as the mapping relation between the target service node and the corresponding host.
Further, the calling relation related to the target service node comprises a target service node corresponding to the target service node serving as a source service call and a source service node corresponding to the target service node serving as a target service call.
Further, the generating module 33 is specifically configured to:
taking a time stamp generated by faults as an index, determining a plurality of calling chains based on calling relations among the service nodes, wherein each calling chain comprises two service nodes with calling relations and an edge representing the calling relations;
and generating a service topological graph based on the determined mapping relation between each service node and the corresponding host machine by combining the plurality of call links.
Further, the device further comprises:
and the first display module is used for responding to the first selection operation of the target node in the service topological graph after the service topological graph is visually displayed, and highlighting one or more call chains where the target node is located.
Further, the device further comprises:
and the second display module is used for responding to a second selection operation on the target edge in the service topological graph after the service topological graph is visually displayed, and highlighting the target edge and the service node linked with the target edge.
The service topology generation device provided by the embodiment of the invention can execute the service topology generation method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device implementing a service topology generation method according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the service topology generation method.
In some embodiments, the service topology generation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the service topology generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the service topology generation method in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A service topology generation method, comprising:
under the condition of fault occurrence, acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform are communicated;
the method comprises the steps of extracting keywords from index data sets corresponding to a plurality of service nodes, and determining the mapping relation between each service node and a corresponding host machine and the calling relation among the service nodes;
and generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among each service node, and visually displaying the service topological graph.
2. The method of claim 1, wherein determining the mapping relationship between each service node and the corresponding host and the calling relationship between each service node by extracting keywords from index data sets corresponding to a plurality of service nodes, comprises:
determining a service name and an index data subset corresponding to each service node related to the index data set in the index data set based on the service name keyword, wherein the index data set comprises all the index data subsets;
for a target service node, determining a mapping relation between the target service node and a corresponding host in a target index data subset corresponding to the target service node based on an instance keyword and a host key, wherein the target service node is any service node related to the index data set;
for a target service node, determining a calling relation related to the target service node in a target index data subset corresponding to the target service node based on a target service keyword and a source service keyword;
and integrating the calling relations related to the service nodes based on the service names of the service nodes to obtain the calling relations among the service nodes.
3. The method of claim 2, wherein determining the mapping relationship between the target service node and the corresponding host in the target index data subset corresponding to the target service node based on the instance key and the host key comprises:
determining one or more target examples corresponding to the target service node and example data subsets corresponding to the target examples in the target index data subsets based on the example keywords, wherein the target index data subsets comprise the example data subsets;
for any target instance, determining a host machine deployed by the any target instance in an instance data subset corresponding to the any target instance based on the host machine key;
and determining the service name of the target service node and the name of the host deployed by each target instance as the mapping relation between the target service node and the corresponding host.
4. The method of claim 2, wherein the call relationship associated with the target service node includes the target service node being called as a source service corresponding to the destination service node and the target service node being called as a destination service by the corresponding source service node.
5. The method of claim 1, wherein generating a service topology map based on the mapping relationship of each service node to the corresponding host and the calling relationship between each service node comprises:
taking a time stamp generated by faults as an index, determining a plurality of calling chains based on calling relations among the service nodes, wherein each calling chain comprises two service nodes with calling relations and an edge representing the calling relations;
and generating a service topological graph based on the determined mapping relation between each service node and the corresponding host machine by combining the plurality of call links.
6. The method of claim 5, further comprising, after visually displaying the service topology,:
in response to a first selection operation of a target node in the service topology, one or more call chains in which the target node is located are highlighted.
7. The method of claim 5, further comprising, after visually displaying the service topology,:
in response to a second selection operation of a target edge in the service topology, highlighting the target edge and a service node linked to the target edge.
8. A service topology generation apparatus, comprising:
The acquisition module is used for acquiring an index data set generated when a plurality of service nodes to be monitored on the micro-service platform communicate under the condition of fault occurrence;
the keyword extraction module is used for extracting keywords from index data sets corresponding to the plurality of service nodes and determining the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes;
and the generating module is used for generating a service topological graph based on the mapping relation between each service node and the corresponding host machine and the calling relation among the service nodes and visually displaying the service topological graph.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202311799021.XA 2023-12-25 2023-12-25 Service topology generation method and device, electronic equipment and storage medium Pending CN117768310A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311799021.XA CN117768310A (en) 2023-12-25 2023-12-25 Service topology generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311799021.XA CN117768310A (en) 2023-12-25 2023-12-25 Service topology generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117768310A true CN117768310A (en) 2024-03-26

Family

ID=90317890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311799021.XA Pending CN117768310A (en) 2023-12-25 2023-12-25 Service topology generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117768310A (en)

Similar Documents

Publication Publication Date Title
CN110351150B (en) Fault source determination method and device, electronic equipment and readable storage medium
CN109902105B (en) Data query system, method, device and storage medium for micro-service architecture
CN113836314B (en) Knowledge graph construction method, device, equipment and storage medium
CN114021156A (en) Method, device and equipment for organizing vulnerability automatic aggregation and storage medium
CN104657437A (en) Monitoring method and monitoring device for promotion status data
CN113656252B (en) Fault positioning method, device, electronic equipment and storage medium
US20220129418A1 (en) Method for determining blood relationship of data, electronic device and storage medium
CN115687406A (en) Sampling method, device and equipment of call chain data and storage medium
CN117768310A (en) Service topology generation method and device, electronic equipment and storage medium
CN115455091A (en) Data generation method and device, electronic equipment and storage medium
CN115344495A (en) Data analysis method and device for batch task test, computer equipment and medium
CN112070487B (en) AI-based RPA flow generation method, apparatus, device and medium
CN111694686B (en) Processing method and device for abnormal service, electronic equipment and storage medium
CN114756301A (en) Log processing method, device and system
CN113963186A (en) Training method of target detection model, target detection method and related device
CN113032581B (en) Method and device for updating product list
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
US11797388B1 (en) Systems and methods for lossless network restoration and syncing
US20240012833A1 (en) Systems and methods for seamlessly updating and optimizing a digital system
CN117574168A (en) Information report generation method and device
CN117033057A (en) Fault root cause positioning method, device, equipment and medium based on call chain data
CN117251167A (en) Software bill of materials construction method, device, equipment and medium
CN117499148A (en) Network access control method, device, equipment and storage medium
CN114896418A (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN117216398A (en) Enterprise recommendation method, device, equipment and medium

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