CN113014435B - Link detection method, link detection device, electronic equipment and storage medium - Google Patents

Link detection method, link detection device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113014435B
CN113014435B CN202110274684.4A CN202110274684A CN113014435B CN 113014435 B CN113014435 B CN 113014435B CN 202110274684 A CN202110274684 A CN 202110274684A CN 113014435 B CN113014435 B CN 113014435B
Authority
CN
China
Prior art keywords
micro
service
communication
communication link
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.)
Active
Application number
CN202110274684.4A
Other languages
Chinese (zh)
Other versions
CN113014435A (en
Inventor
陈飞
夏健莲
帅春兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Miluoxing Technology Group Co ltd
Original Assignee
Hangzhou Miluoxing Technology Group 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 Hangzhou Miluoxing Technology Group Co ltd filed Critical Hangzhou Miluoxing Technology Group Co ltd
Priority to CN202110274684.4A priority Critical patent/CN113014435B/en
Publication of CN113014435A publication Critical patent/CN113014435A/en
Application granted granted Critical
Publication of CN113014435B publication Critical patent/CN113014435B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/22Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks comprising specially adapted graphical user interfaces [GUI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a link detection method, a link detection device, electronic equipment and a storage medium, and relates to the technical field of micro-services. The method can be applied to a detection node in a micro-service system, the micro-service system comprises the detection node and at least one service node, and at least one micro-service is deployed on each service node, wherein the micro-service is configured to communicate through a preset network communication protocol, so that the detection node can monitor and acquire communication data among a plurality of micro-services through each service node during each communication among the plurality of micro-services, and determine communication link information among the plurality of micro-services according to the communication data among the plurality of micro-services; the communication link diagram is generated according to the communication link information among the micro services, the whole micro service system can be monitored through the communication link diagram, the characteristics of simple design and strong applicability are achieved, and the maintenance cost can be effectively reduced.

Description

Link detection method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of micro service technologies, and in particular, to a link detection method and apparatus, an electronic device, and a storage medium.
Background
The micro-service system can be constructed based on a micro-service architecture, the micro-service architecture aims to realize the decoupling of a solution scheme by decomposing functions into discrete services, a large-scale single application program and service can be divided into a plurality of micro-services or even tens of micro-services, so that a service level agreement is met, and the purpose of monitoring the whole micro-service system can be achieved by performing link detection on each micro-service in the micro-service system.
The existing link probing method is mainly a Software Development Kit (SDK) intrusive probing method, i.e. the SDK is used to invade services developed by different programming languages.
It can be seen that the existing link detection method is complex, and if all the microservices need to be detected, each microservices needs to be integrated with an SDK, and when the microservices are subsequently upgraded, each SDK needs to be upgraded, so that the maintenance cost is high.
Disclosure of Invention
An object of the present application is to provide a link detection method, an apparatus, an electronic device, and a storage medium, which can reduce the link detection cost.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, the present invention provides a link probing method applied to a probe node in a micro service system, where the micro service system includes the probe node and at least one service node, each service node deploys at least one micro service, and the micro service is configured to communicate via a preset network communication protocol, where the method includes:
monitoring and acquiring communication data among a plurality of micro services through each service node;
determining communication link information between a plurality of the micro services according to communication data between the plurality of the micro services, wherein the communication link information comprises at least one of the following items: communication time, communication times and communication data packet size;
and generating a communication link diagram according to the communication link information among the micro services.
In an optional embodiment, after the monitoring and acquiring, by the service node, communication data between a plurality of the microservices, the method further includes:
determining a service node to which each micro service belongs according to communication data among the plurality of micro services;
correspondingly, the generating a communication link map according to the communication link information among the plurality of microservices comprises:
and generating a communication link graph between each service node according to the communication link information among the plurality of micro services and the service node to which each micro service belongs.
In an optional embodiment, after the monitoring and acquiring, by the service node, communication data between a plurality of the microservices, the method further includes:
determining a port number of each source-end micro service through each service node based on communication data among the plurality of micro services, and determining a program corresponding to each source-end micro service according to the source port number of each source-end micro service;
correspondingly, the generating a communication link map according to the communication link information among the micro services comprises:
and determining a communication link diagram among the programs according to the communication link information among the micro services, the program corresponding to each source end micro service and the program corresponding to each destination end micro service.
In an optional embodiment, the generating a communication link map according to communication link information between a plurality of the micro services includes:
and determining a communication link graph between the service node and each program according to communication link information among the micro services, the service node to which each micro service belongs, and the program corresponding to each source micro service or the program corresponding to each destination micro service.
In an optional embodiment, after the generating a communication link map according to the communication link information between the multiple microservices, the method further includes:
and if the communication link information corresponding to any one micro service is determined to meet the preset condition according to the communication link map, sending alarm information to the terminal equipment.
In an alternative embodiment, the communication link map comprises: the communication time distribution map, after generating a communication link map according to the communication link information between the plurality of microservices, further includes:
acquiring the communication bandwidth of each service node according to the communication time distribution map;
and determining each service node to perform capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
In an optional embodiment, a micro service information table is stored in advance on the probe node, where the micro service information table includes at least one of the following: the method comprises the following steps of (1) identifying a micro service, identifying a service node to which the micro service belongs, identifying a micro service version number and a port number of the micro service;
the generating a communication link map according to the communication link information among the micro services comprises:
and generating a communication link diagram according to the communication link information among the micro services and the micro service information table.
In a second aspect, the present invention provides a link probing apparatus applied to a probe node in a micro service system, where the micro service system includes the probe node and at least one service node, each service node is deployed with at least one micro service, and the micro service is configured to communicate via a preset network communication protocol, and the link probing apparatus includes:
the acquisition module is used for monitoring and acquiring communication data among the plurality of micro services through each service node;
a determining module, configured to determine communication link information between a plurality of the microservices according to communication data between the plurality of microservices, where the communication link information includes at least one of: communication time, communication times and communication data packet size;
and the generating module is used for generating a communication link diagram according to the communication link information among the micro services.
In an optional embodiment, the obtaining module is further configured to determine, according to communication data between a plurality of the micro services, a service node to which each of the micro services belongs;
the generating module is specifically configured to generate a communication link map between the service nodes according to communication link information between the multiple micro services and the service node to which each micro service belongs.
In an optional implementation manner, the obtaining module is further configured to determine, by each service node, a port number of each source-end micro service based on communication data among a plurality of micro services, and determine, according to a source port number of each source-end micro service, a program corresponding to each source-end micro service;
the generating module is specifically configured to determine a communication link diagram between the programs according to communication link information between the multiple micro services, a program corresponding to each source micro service, and a program corresponding to each destination micro service.
In an optional embodiment, the generating module is specifically configured to determine, according to communication link information between multiple micro services, a service node to which each micro service belongs, and a program corresponding to each source micro service or a program corresponding to each destination micro service, a communication link diagram between the service node and each program.
In an optional embodiment, the link probing apparatus further includes: and the sending module is used for sending alarm information to the terminal equipment if the communication link information corresponding to any one micro service is determined to accord with the preset condition according to the communication link map.
In an alternative embodiment, the communication link map comprises: the generating module is further configured to obtain a communication bandwidth of each service node according to the communication time distribution map;
and determining each service node to perform capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
In an optional embodiment, the probe node stores a micro service information table in advance, where the micro service information table includes at least one of the following items: the method comprises the following steps of (1) identifying a micro service, identifying a service node to which the micro service belongs, identifying a micro service version number and a port number of the micro service; the generating module is specifically configured to generate a communication link map according to communication link information between the multiple micro services and the micro service information table.
In a third aspect, the present invention provides an electronic device comprising: the link probing method comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when an electronic device runs, the processor and the storage medium communicate through the bus, and the processor executes the machine-readable instructions to execute the steps of the link probing method according to any one of the preceding embodiments.
In a fourth aspect, the present invention provides a computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to perform the steps of the link probing method according to any of the previous embodiments.
The beneficial effect of this application is:
the link detection method, the link detection device, the electronic device and the storage medium provided by the embodiment of the application can be applied to a detection node in a micro service system, the micro service system comprises the detection node and at least one service node, at least one micro service is deployed on each service node, and the micro service is configured to communicate through a preset network communication protocol, and the method comprises the following steps: monitoring and acquiring communication data among a plurality of micro services through each service node; determining communication link information among the micro services according to communication data among the micro services; according to the method, the communication link diagram is generated according to the communication link information among the micro services, due to the fact that the micro services are configured to communicate through the preset network communication protocol, each time the micro services communicate, the detection nodes can monitor and obtain communication data among the micro services through the service nodes, the communication link diagram can be generated based on the communication data, the whole micro service system can be monitored through the communication link diagram, and compared with the existing intrusive detection method, the link detection method provided by the method does not need to be upgraded, has the advantages of being simple in design and high in applicability, and can effectively reduce maintenance cost.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart of a link detection method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another link detection method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another link detection method according to an embodiment of the present application;
fig. 4 is a schematic diagram of a communication link diagram provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of another communication link diagram provided by an embodiment of the present application;
fig. 6 is a schematic flowchart of another link detection method according to an embodiment of the present application;
fig. 7 is a flowchart illustrating another link detection method according to an embodiment of the present application;
fig. 8 is a schematic diagram illustrating a communication time distribution diagram according to an embodiment of the present application;
fig. 9 is a schematic flowchart of another link detection method according to an embodiment of the present application;
fig. 10 is a functional block diagram of a link detection apparatus according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures.
Before introducing the present application, in order to better understand the present application, a micro service system is first described, the micro service system may be constructed based on a micro service architecture, a large single application and service may be split into several or even tens of micro services based on the micro service architecture, so as to satisfy a service level agreement, the application micro service architecture may construct an application as an independent component, and each application process may be operated as a service, each service may be referred to as a micro service. Micro-services can communicate with each other through well-defined interfaces using a lightweight API, which is built around business functions, and each micro-service can perform one function. For example, the micro service a may correspond to a registration function for verifying whether a mobile phone number is registered, and the micro service B may correspond to an effective detection function for detecting whether the mobile phone number is effective, so that it can be seen that since they operate independently, each service can be updated, deployed, and expanded to meet the requirement for a specific function of an application program, reduce the coupling of a micro service system, and provide more flexible service support.
Based on the above description, it can be understood that the purpose of monitoring the whole micro service system can be achieved by performing link detection on each micro service in the micro service system. The existing link detection method is mainly a Software Development Kit (SDK) intrusive detection method, that is, an SDK is used to intrude services developed by different programming languages, where intrusion can be understood as integrating a certain service into the SDK when the service is needed, the SDK is a generic name, and in a Java language environment, the SDK is a jar package, and in a nodjs environment, the SDK is an NPM package.
It can be seen that, when the existing link detection method is used to detect a plurality of micro services in a micro service system, if all the micro services are to be detected, each micro service is integrated with one SDK, and if the micro services are to be subsequently updated, each SDK needs to be updated together, so that the existing link detection method has the problem of high maintenance cost.
In view of this, embodiments of the present application provide a link probing method, which can effectively reduce the link probing cost.
Fig. 1 is a schematic flowchart of a link probing method according to an embodiment of the present disclosure, where the link probing method may be applied to a probe node in a micro service system, where the micro service system includes the probe node and at least one service node, each service node is deployed with at least one micro service, and the micro service is configured to communicate through a preset network communication protocol, and optionally, the probe node and the service node may be servers, processors, and the like, for example, the probe node and the service node may be Linux servers, but are not limited thereto. As shown in fig. 1, the link probing method may include:
s101, monitoring and acquiring communication data among a plurality of micro services through each service node.
Optionally, the predetermined network communication Protocol may be a Transmission Control Protocol/Internet Protocol (TCP/IP), and the microservices are configured to communicate through the predetermined network communication Protocol, and in some embodiments, the microservices may communicate with each other through a User Datagram Protocol (UDP), a Transmission Control Protocol (TCP), or the like.
For a service node, at least one micro service may be deployed on each service node, and it can be understood that when a plurality of micro services are deployed on each service node, any micro service on a current service node may communicate with any micro service on the current service node or other service nodes, and for the current service node, the current service node may monitor and acquire communication data between any deployed micro service and any micro service on the current service node or other service nodes.
Optionally, the obtained communication data may be different according to different preset network communication protocols, for example, when the preset network communication protocol is a TCP protocol, the obtained communication data may include dst (Destination), src (Source), body (information body), and other information, where the dst mainly includes a Destination address dst _ addr and a Destination port number dst _ port, and the src mainly includes a Source address src _ addr and a Source port number src _ port, and a flow direction of data in the micro service system and a flow volume of the data may be analyzed according to the communication data.
Based on the above description, for the probe node, the probe node may monitor and acquire communication data between multiple micro services through each service node.
It should be noted that, the function specifically implemented by each micro service is not limited in this application, that is, the link detection method provided in the embodiment of the present application may be applied to any scenario, and may include but is not limited to: a shopping scenario, a transaction scenario, a social scenario, a travel scenario, etc.; in addition, the present application also does not limit the programming language corresponding to each microservice, and may include but is not limited to: c language, C + + language, JAVA language, python language, linux language, PHP language, etc.
S102, determining communication link information among the micro services according to communication data among the micro services, wherein the communication link information comprises at least one of the following items: communication time, communication times and communication data packet size.
The communication time may include specific communication time, communication duration, and the like of both communication parties; the number of communications may indicate the number of communications per unit time (e.g., 1 hour) between the two parties; the communication packet size may indicate the size of a packet transmitted each time two communicating parties communicate.
After obtaining the communication data between the multiple microservices, the communication link information between the multiple microservices may be determined according to the communication data, and of course, the communication link information is not limited to the above description, for example, the communication link information may also include the identifiers of both communication parties, and may include but is not limited to: the micro service identifier, the identifier of the service node to which the micro service belongs, the port number of the micro service, and the like are not limited herein, and different communication link information can be obtained according to the actual application scenario.
S103, generating a communication link diagram according to the communication link information among the micro services.
Based on the obtained communication link information between the multiple micro services, a communication link map may be generated according to the communication link information, and optionally, the communication link map may be a communication link map between service nodes, a communication link map between source programs corresponding to the micro services, or a communication link map between a service node and a source program corresponding to the micro services. It can be understood that, by obtaining the communication link diagram of the micro service system, how data is circulated in the micro service system and the size of the circulation flow can be clearly known according to the communication link diagram, so as to monitor the micro service system.
Optionally, the communication link diagram may include a communication thermodynamic diagram, and the communication thermodynamic diagram may characterize a communication relationship between two communication parties in the micro service system, so that a specific communication state of the micro service system may be reflected through the communication thermodynamic diagram, and monitoring of the entire micro service system is achieved. Alternatively, the communication thermodynamic diagram may be displayed by a line graph, a bar graph, a pie graph, a grid graph, a mesh graph, etc., which is not limited herein and may be different according to the actual application scenario. Based on the above description, it can be seen that, in the link detection method provided in the embodiment of the present application, when the function corresponding to the micro service changes, communication data between multiple micro services can still be monitored and obtained through each service node, that is, no upgrade is needed, and the link detection method can be applied to any scene, and has the characteristics of simple specific design and strong applicability.
To sum up, the link probing method provided in the embodiment of the present application may be applied to a probe node in a micro service system, where the micro service system includes the probe node and at least one service node, each service node deploys at least one micro service, and the micro service is configured to communicate through a preset network communication protocol, and the method includes: monitoring and acquiring communication data among a plurality of micro services through each service node; determining communication link information between the plurality of microservices according to the communication data between the plurality of microservices, wherein the communication link information comprises at least one of the following items: communication time, communication times and communication data packet size; according to the communication link information among the micro services, a communication link diagram is generated, by applying the embodiment of the application, as the micro services are configured to communicate through a preset network communication protocol, each time the micro services communicate, the detection node can monitor and acquire communication data among the micro services through each service node, and based on the communication data, the communication link diagram can be generated.
Fig. 2 is a schematic flowchart of another link probing method according to an embodiment of the present application. Optionally, as shown in fig. 2, after the monitoring and obtaining, by the service node, communication data between multiple microservices further includes:
s201, determining a service node to which each micro service belongs according to communication data among the plurality of micro services.
Accordingly, the generating a communication link map according to the communication link information among the plurality of microservices may include:
s202, generating a communication link graph among the service nodes according to the communication link information among the micro services and the service node to which each micro service belongs.
In some embodiments, specifically, during the generation, after communication data between a plurality of micro services is acquired, according to the communication data between the plurality of micro services, the communication data may be analyzed to determine an identifier of a service node to which each micro service belongs, and then, according to communication link information between the plurality of micro services and the identifier of the service node to which each micro service belongs, the communication link map between each service node may be generated, and optionally, the identifier of the service node may be an address identifier of the service node, but is not limited thereto.
It can be understood that the communication situation between the service nodes can be known through the communication link graph between the service nodes, for example, which service nodes communicate frequently, which service nodes communicate for a longer time, and which service nodes communicate with each other for a larger amount of data, so that the micro service system can be monitored from the perspective of the service nodes.
Fig. 3 is a flowchart illustrating another link probing method according to an embodiment of the present application. In order to meet the requirements in different application scenarios, in some embodiments, the following method may also be used to obtain a communication link diagram between source programs, specifically, as follows, and optionally, as shown in fig. 3, after the above monitoring and obtaining communication data between multiple micro services by a service node, the method further includes:
s301, based on communication data among a plurality of micro services, determining a source port number of each source end micro service through each service node, and determining a program corresponding to each source end micro service according to the source port number of each source end micro service.
In some embodiments, if the micro services are configured to communicate through UDP or TCP protocols, when the multiple micro services communicate with each other, the two communicating parties may be a source end and a destination end, respectively, as described above with reference to the description of the communication data, it can be understood that, after the service node monitors and obtains the communication data between the multiple micro services, for the destination-end micro service, a destination port number of the destination-end micro service is fixed, that is, the probe node may determine a destination port number of each destination-end micro service based on the communication data between the multiple micro services, and determine a program corresponding to each destination-end micro service according to the destination port number of each destination-end micro service.
For the source end micro-service, the source port number is not fixed, so that the source port number of each source end micro-service can be determined through each service node based on communication data among a plurality of micro-services, and a program corresponding to each source end micro-service is determined according to the source port number of each source end micro-service, so that the program corresponding to each destination end micro-service and the program corresponding to each source end micro-service can be obtained.
Accordingly, the generating a communication link map according to the communication link information among the plurality of microservices may include:
s303, determining a communication link diagram among the programs according to the communication link information among the micro services, the program corresponding to each source end micro service and the program corresponding to each destination end micro service.
Based on the implementation, after the program corresponding to each destination-side micro service and the program corresponding to each source-side micro service are determined, a communication link diagram between the programs can be determined according to the communication link information among the plurality of micro services, the program corresponding to each source-side micro service and the program corresponding to each destination-side micro service, so that the micro service system can be monitored from the program perspective.
Alternatively, the communication link diagram between the programs may be a mesh communication diagram, but is not limited thereto.
Fig. 4 is a schematic view of a communication link diagram provided in an embodiment of the present application, and fig. 5 is a schematic view of another communication link diagram provided in an embodiment of the present application, where as shown in fig. 4, a, B, C, D, E, F, and G respectively represent programs corresponding to different micro services, and optionally, the micro services a, B, C, D, E, F, and G may belong to the same service node, or may belong to different service nodes, which is not limited herein. The direction of the arrow indicates the destination-side micro service, and it can be seen from the figure that the destination-side micro services B, C, D, E, F, and G are respectively accessed for the source-side micro service a, that is, by applying the embodiment of the present application, the communication link diagram of the micro service system can be clearly obtained, and how the communication data flows can be known through the communication link diagram, so that the micro service system can be comprehensively monitored.
Optionally, as shown in fig. 5, the communication link diagram may also be represented in a communication thermodynamic diagram manner, where a horizontal axis represents a source-end microservice, a vertical axis represents a destination-end microservice corresponding to each source-end microservice, a communication state between the destination-end microservice and the source-end microservice is represented by a communication band, and if a total communication time between the destination-end microservice and the source-end microservice is longer, a corresponding communication band is longer; the more the communication times in the unit time period are, the more densely the corresponding communication band is filled; the larger the total communication data packet, the wider the communication band corresponding to the total communication data packet. The source-side micro service is taken as a to be described, as can be seen from fig. 5, the source-side micro service a is respectively in communication with the destination-side micro services B, C, D, E, F, and G, where a total communication time between the source-side micro service a and the destination-side micro service E is shortest, a total communication time with the destination-side micro service F is longest, a number of communications with the destination-side micro service C in a unit time period is minimum, a number of communications with the destination-side micro service F in a unit time period is maximum, a total communication data packet with the destination-side micro service B is minimum, and a total communication data packet with the destination-side micro service G is maximum, and it can be seen that the generated communication link diagram can reflect communication conditions between programs from multiple angles, so that the micro service system performs monitoring based on a preset monitoring index, and it should be described that the communication link diagram is not limited to that shown in the above embodiments.
In some embodiments, the following method may also be used to obtain a communication link map between the service node and each program, where the following is specifically included, and optionally, the generating a communication link map according to communication link information between multiple micro services may include:
and determining a communication link diagram between the service node and each program according to the communication link information among the micro services, the service node to which each micro service belongs, the program corresponding to each source micro service or the program corresponding to each destination micro service.
The specific type of the communication link diagram between the service node and each program is not limited in the present application, and the communication link diagram may be a communication link diagram between a source service node and a program corresponding to each destination-side micro service, or may be a communication link diagram between a destination service node and a program corresponding to each source-side micro service, which may be different according to an actual application scenario.
Fig. 6 is a flowchart illustrating another link probing method according to an embodiment of the present application. Optionally, as shown in fig. 6, after the generating the communication link map according to the communication link information between the multiple microservices, the method further includes:
s401, if the communication link information corresponding to any micro service is determined to meet the preset conditions according to the communication link diagram, warning information is sent to the terminal equipment.
Based on the obtained communication link diagram, if it is determined that the communication link information corresponding to any micro service in the communication link diagram meets a preset condition, the warning information may be sent to the terminal device, optionally, the preset condition may be a preset threshold corresponding to communication time, communication frequency, and a size of a communication data packet, for example, if it is determined that the communication frequency of any micro service in a preset time period is greater than the preset threshold of communication frequency, the warning information may be sent to the terminal device; or, a combination of two preset thresholds may be used, for example, if it is determined that the communication time of any micro service in a preset time period is greater than the preset communication time threshold and the communication time is greater than the preset communication time threshold, the warning information may be sent to the terminal device, which may be different according to the actual application scenario.
Optionally, the warning information may be sent in a short message, a message, an email, and the like, and the terminal device may include but is not limited to: a mobile phone, a tablet computer, a smart watch, etc., which are not limited herein.
Fig. 7 is a flowchart illustrating another link probing method according to an embodiment of the present application. Optionally, the communication link map comprises: as shown in fig. 7, after the generating the communication link map according to the communication link information between the plurality of microservices, the communication time distribution map may further include:
and S501, monitoring and acquiring the communication bandwidth of each service node according to the communication time distribution map.
A communication time distribution diagram, that is, a traffic time distribution diagram, as shown in fig. 8, is a schematic diagram of a communication time distribution diagram provided in the present application, as shown in fig. 8, a horizontal axis may represent communication time, and a vertical axis may represent communication traffic corresponding to each communication time, it can be understood that a communication bandwidth required by each service node may be predicted in advance through the communication time distribution diagram, so as to predict in advance whether each service node needs to perform capacity expansion or capacity reduction operation, so that service processing efficiency may be ensured. Of course, the present application does not limit the specific type of the communication time distribution map, and the communication time distribution map may be a communication time distribution map of a service node, or may be a communication time distribution map of a single micro service.
For each service node, the probe node may monitor and obtain the communication bandwidth of each service node according to the communication time distribution map, optionally, specifically, during the monitoring, the probe node may perform the monitoring in a polling manner, and the application does not limit a specific monitoring manner herein.
S502, determining that each service node performs capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
Optionally, the preset bandwidth threshold may include α and β, where β is greater than α, based on the communication bandwidth of each service node obtained through monitoring, the communication bandwidth of each service node may be compared with the sizes of α and β, respectively, if it is determined that the communication bandwidth of the service node within a preset time period (for example, 3 hours and 6 hours) is smaller than the preset bandwidth threshold α, it may be determined that the communication bandwidth currently required by the service node is smaller, the service node may be capacity-reduced, and if it is determined that the communication bandwidth of the service node within the preset time period is greater than the preset bandwidth threshold β, it is determined that the communication bandwidth currently required by the service node is larger, the service node may be capacity-expanded. Optionally, after determining that each service node performs the expansion or reduction operation, the probe node may send an expansion or reduction instruction to each service node, and after each service node receives the expansion or reduction instruction, the probe node may perform a corresponding operation.
Optionally, the probe node may store a micro service information table in advance, where the micro service information table includes at least one of the following: the micro service identifier, the identifier of the service node to which the micro service belongs, the version number of the micro service and the port number of the micro service. The micro service identifier may be used to uniquely distinguish the micro service, and optionally may be named according to a specific function implemented by the micro service, the service node identifier to which the micro service belongs may be an address of a service node, the version number of the micro service may be used to indicate a version of a program corresponding to the micro service, and the port number of the micro service may be used to indicate a program corresponding to the micro service.
Fig. 9 is a flowchart of another link probing method according to an embodiment of the present application. Optionally, as shown in fig. 9, the generating a communication link map according to communication link information between a plurality of micro services may include:
s601, generating a communication link diagram according to the communication link information among the micro services and the micro service information table.
It can be understood that, if the probe node stores the micro service information table in advance, the micro service information table may be queried in a table lookup manner according to the communication link information between the plurality of micro services to generate the communication link map.
For example, the micro service information table pre-stored on the probe node includes: optionally, after the probe node monitors and acquires communication data among a plurality of micro services through each service node, according to the communication data, the micro service identifiers of both communication parties can be determined, according to the micro service identifiers, a micro service information table can be queried to acquire the service node identifiers of the micro services of both communication parties and the port numbers of the micro services, and then a communication link diagram can be generated according to the query result. Based on the above description, it can be understood that, since the source port number of the source microservice is not fixed, the communication link diagram may optionally include: the communication link diagram between the service nodes, the communication link diagram between the source end service node and the program corresponding to the destination end micro service, and the communication link diagram between the destination end service node and the program corresponding to the source end micro service, and the communication link diagram between the programs may be obtained by referring to the foregoing description, which is not described herein again.
Fig. 10 is a functional module schematic diagram of a link probing apparatus according to an embodiment of the present application, where the link probing apparatus may be applied to a probe node in a micro service system, where the micro service system includes the probe node and at least one service node, each service node is deployed with at least one micro service, and the micro service is configured to communicate through a preset network communication protocol, and the basic principle and the resulting technical effect of the apparatus are the same as those of the corresponding method embodiment described above, and for brief description, reference may be made to corresponding contents in the method embodiment in this embodiment. As shown in fig. 10, the link probing apparatus 100 includes:
an obtaining module 110, configured to monitor and obtain communication data between a plurality of the micro services through each of the service nodes;
a determining module 120, configured to determine, according to communication data between a plurality of the micro services, communication link information between the plurality of micro services, where the communication link information includes at least one of: communication time, communication times and communication data packet size;
a generating module 130, configured to generate a communication link map according to communication link information between multiple micro services.
In an optional embodiment, the obtaining module 110 is further configured to determine, according to communication data between multiple micro services, a service node to which each micro service belongs; the generating module is specifically configured to generate a communication link map between the service nodes according to communication link information between the multiple micro services and the service node to which each micro service belongs.
In an optional embodiment, the obtaining module 110 is further configured to determine, by each service node, a port number of each source-end micro service based on communication data among a plurality of micro services, and determine, according to a source port number of each source-end micro service, a program corresponding to each source-end micro service; the generating module 130 is specifically configured to determine a communication link map between the programs according to the communication link information between the multiple micro services, the program corresponding to each source-side micro service, and the program corresponding to each destination-side micro service.
In an optional embodiment, the generating module 130 is specifically configured to determine a communication link map between the service node and each program according to communication link information between multiple micro services, a service node to which each micro service belongs, and a program corresponding to each source-side micro service or a program corresponding to each destination-side micro service.
In an optional embodiment, the link probing apparatus further includes: and the sending module is used for sending alarm information to the terminal equipment if the communication link information corresponding to any one micro service is determined to accord with the preset condition according to the communication link map.
In an alternative embodiment, the communication link map comprises: the generating module 130 is further configured to obtain a communication bandwidth of each service node according to the communication time distribution map; and determining each service node to carry out capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
In an optional embodiment, the probe node stores a micro service information table in advance, where the micro service information table includes at least one of the following items: the method comprises the following steps of (1) identifying a micro service, identifying a service node to which the micro service belongs, the version number of the micro service and the port number of the micro service; the generating module 130 is specifically configured to generate a communication link map according to the communication link information between the multiple micro services and the micro service information table.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device may be integrated in a terminal device or a chip of the terminal device, and the terminal may be a computing device with an image processing function. As shown in fig. 11, the electronic device may include: a processor 210, a storage medium 220, and a bus 230, wherein the storage medium 220 stores machine-readable instructions executable by the processor 210, and when the electronic device is operated, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above-mentioned method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the steps of the above method embodiments. The specific implementation and technical effects are similar, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer-readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. A link detection method is applied to a probe node in a micro service system, the micro service system comprises the probe node and at least one service node, each service node is deployed with at least one micro service, and the micro service is configured to communicate through a preset network communication protocol, and the method comprises the following steps:
monitoring and acquiring communication data among a plurality of micro services through each service node;
determining communication link information between a plurality of the micro services according to communication data between the plurality of the micro services, wherein the communication link information comprises at least one of the following items: communication time, communication times and communication data packet size;
generating a communication link map according to communication link information among the micro services;
the communication link map includes: the communication time distribution map, after generating a communication link map according to the communication link information between the plurality of microservices, further includes:
acquiring the communication bandwidth of each service node according to the communication time distribution map;
and determining each service node to perform capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
2. The method of claim 1, wherein after the monitoring and obtaining, by the service node, communication data between a plurality of the microservices, further comprising:
determining a service node to which each micro service belongs according to communication data among the plurality of micro services;
correspondingly, the generating a communication link map according to the communication link information among the plurality of microservices comprises:
and generating a communication link graph between each service node according to the communication link information among the plurality of micro services and the service node to which each micro service belongs.
3. The method of claim 2, wherein after the monitoring and obtaining, by the service node, communication data between the plurality of microservices, further comprising:
determining a port number of each source end micro-service through each service node based on communication data among a plurality of micro-services, and determining a program corresponding to each source end micro-service according to the source port number of each source end micro-service;
correspondingly, the generating a communication link map according to the communication link information among the plurality of microservices comprises:
and determining a communication link diagram among the programs according to the communication link information among the micro services, the program corresponding to each source end micro service and the program corresponding to each destination end micro service.
4. The method of claim 3, wherein generating a communication link map based on communication link information between the plurality of microservices comprises:
and determining a communication link graph between the service node and each program according to communication link information among the micro services, the service node to which each micro service belongs, and the program corresponding to each source micro service or the program corresponding to each destination micro service.
5. The method of claim 1, wherein after generating the communication link map according to the communication link information between the plurality of microservices, the method further comprises:
and if the communication link information corresponding to any one micro service is determined to meet the preset condition according to the communication link map, sending alarm information to the terminal equipment.
6. The method according to any one of claims 1 to 5, wherein the probe node stores a micro service information table in advance, and the micro service information table comprises at least one of the following items: the method comprises the following steps of (1) identifying a micro service, identifying a service node to which the micro service belongs, the version number of the micro service and the port number of the micro service;
the generating a communication link map according to the communication link information among the micro services comprises:
and generating a communication link diagram according to the communication link information among the micro services and the micro service information table.
7. A link detection device applied to a probe node in a micro service system, the micro service system including the probe node and at least one service node, at least one micro service being deployed on each service node, the micro service being configured to communicate via a preset network communication protocol, the link detection device comprising:
the acquisition module is used for monitoring and acquiring communication data among the plurality of micro services through each service node;
a determining module, configured to determine communication link information between the multiple microservices according to communication data between the multiple microservices, where the communication link information includes at least one of: communication time, communication times and communication data packet size;
the generating module is used for generating a communication link diagram according to the communication link information among the micro services;
the communication link map includes: the generating module is further configured to obtain a communication bandwidth of each service node according to the communication time distribution map; and determining each service node to perform capacity expansion or capacity reduction operation according to the communication bandwidth of each service node and a preset bandwidth threshold.
8. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the link probing method according to any one of claims 1-6.
9. A computer-readable storage medium, having stored thereon a computer program for performing, when being executed by a processor, the steps of the link probing method according to any of the claims 1-6.
CN202110274684.4A 2021-03-15 2021-03-15 Link detection method, link detection device, electronic equipment and storage medium Active CN113014435B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110274684.4A CN113014435B (en) 2021-03-15 2021-03-15 Link detection method, link detection device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110274684.4A CN113014435B (en) 2021-03-15 2021-03-15 Link detection method, link detection device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113014435A CN113014435A (en) 2021-06-22
CN113014435B true CN113014435B (en) 2022-10-11

Family

ID=76406940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110274684.4A Active CN113014435B (en) 2021-03-15 2021-03-15 Link detection method, link detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113014435B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115865832A (en) * 2022-08-30 2023-03-28 中国电信股份有限公司 Service link generation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108322351A (en) * 2018-03-05 2018-07-24 北京奇艺世纪科技有限公司 Generate method and apparatus, fault determination method and the device of topological diagram
CN109923847A (en) * 2018-08-29 2019-06-21 华为技术有限公司 Call discovery method, apparatus, equipment and the storage medium of link
CN111813418A (en) * 2020-06-30 2020-10-23 平安国际智慧城市科技股份有限公司 Distributed link tracking method, device, computer equipment and storage medium
WO2020228534A1 (en) * 2019-05-14 2020-11-19 华为技术有限公司 Micro-service component-based database system and related method
CN112235162A (en) * 2020-10-14 2021-01-15 北京嘀嘀无限科技发展有限公司 Service-based monitoring method and device, electronic equipment and storage medium
CN112287183A (en) * 2020-10-30 2021-01-29 北京字节跳动网络技术有限公司 Link topology graph display method and device and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577670A (en) * 2008-05-07 2009-11-11 华为技术有限公司 Method, device and system for bandwidth allocation
CN111817890B (en) * 2020-07-07 2023-04-18 国家电网有限公司 Data synchronization processing method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108322351A (en) * 2018-03-05 2018-07-24 北京奇艺世纪科技有限公司 Generate method and apparatus, fault determination method and the device of topological diagram
CN109923847A (en) * 2018-08-29 2019-06-21 华为技术有限公司 Call discovery method, apparatus, equipment and the storage medium of link
WO2020228534A1 (en) * 2019-05-14 2020-11-19 华为技术有限公司 Micro-service component-based database system and related method
CN111813418A (en) * 2020-06-30 2020-10-23 平安国际智慧城市科技股份有限公司 Distributed link tracking method, device, computer equipment and storage medium
CN112235162A (en) * 2020-10-14 2021-01-15 北京嘀嘀无限科技发展有限公司 Service-based monitoring method and device, electronic equipment and storage medium
CN112287183A (en) * 2020-10-30 2021-01-29 北京字节跳动网络技术有限公司 Link topology graph display method and device and computer storage medium

Also Published As

Publication number Publication date
CN113014435A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN107967143B (en) Method, device and system for acquiring update indication information of source code of client application program
CN108900388B (en) Method, apparatus, and medium for monitoring network quality
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
US20180316594A1 (en) Dynamic update of virtual network topology
CN112311617A (en) Configured data monitoring and alarming method and system
CN111818136A (en) Data processing method and device, electronic equipment and computer readable medium
CN109639782A (en) Message sends platform, method
CN107968805B (en) Event notification method and server
CN112583797B (en) Multi-protocol data processing method, device, equipment and computer readable storage medium
CN109254914A (en) Software development kit test method, system, computer installation and readable storage medium storing program for executing
CN113014435B (en) Link detection method, link detection device, electronic equipment and storage medium
CN114090366A (en) Method, device and system for monitoring data
US9577900B1 (en) Application centric network experience monitoring
CN104581806A (en) Method and terminal for monitoring service system
CN103457748A (en) Data transmission method, system and device
US10616081B2 (en) Application aware cluster monitoring
CN109495319B (en) Method, device and equipment for determining fault information of CDN node
CN111385150A (en) Method and device for acquiring information
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN109905486A (en) A kind of application program identification methods of exhibiting and device
CN107404410B (en) Method and device for constructing virtual network function platform in cloud environment
CN109286532A (en) The management method and device of warning information in cloud computing system
CN109560949A (en) A kind of data processing method and management server, business device
CN116260747A (en) Monitoring method and device of terminal test equipment and electronic equipment
CN109104446A (en) A kind of message order-preserving method, network node and storage 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
GR01 Patent grant
GR01 Patent grant