Service link generation method and device, electronic device, and storage medium

Through the method of generating service links, using traffic information and service information, the intrusiveness and language limitations of the existing distributed tracking system are solved, and non-invasive and cross-language distributed tracking is realized, reducing operation and maintenance costs.

CN115865832BActive Publication Date: 2025-04-01CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211059650.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2025-04-01
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

Existing distributed tracking systems require deployment or modification of business systems in specific locales, resulting in invasive and increased development costs.

Method used

By obtaining traffic information and determining the corresponding service information, determining the service node and its adjacent nodes, generating service links, and realizing distributed tracking without modifying code or changing the class loader.

Benefits of technology

It realizes non-invasive distributed tracking of the business system, which is suitable for all locales, reduces the difficulty and cost of operation and maintenance, and does not affect the normal operation of the business system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865832B_ABST
    Figure CN115865832B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method and device for generating a service link, an electronic device, and a storage medium, the method comprising: obtaining multiple flow information, and determining service information corresponding to the multiple flow information according to the multiple flow information; wherein the service information is information used to characterize the flow direction; according to the service information corresponding to the multiple flow information, determining the service node corresponding to each flow information, and the adjacent service node of the service node corresponding to each flow information; splicing the service node corresponding to each flow information and the adjacent service node to obtain a service link. The technical solution of the embodiment of the present application can realize distributed tracking without intrusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and device for generating a service link, an electronic device, and a computer-readable storage medium. Background Art

[0002] The cloud-native business system contains a large number of nodes, containers, services and other components. It is a new model of product development and operation based on the microservice architecture concept and container technology. The business system under the microservice architecture has the advantages of flexible development and convenient expansion, but it also brings new challenges to operation and maintenance. In the cloud-native business system, due to the black-box nature of the application services in the cloud-native business system, fault location and problem troubleshooting are more difficult than traditional virtual machines. For this reason, Google first proposed the idea of ​​distributed tracing and released the tracing system Dapper. Since then, major companies and open source communities have successively released distributed tracing systems such as Zipkin, Pinpoint, Jaeger, and Skywalking, which have enhanced the observability of business systems under the microservice architecture and reduced the difficulty and cost of operation and maintenance.

[0003] Currently, the tools corresponding to the more mainstream distributed tracing systems mainly adopt two technical routes. One is based on the SDK (Software Development Kit) method. Using this method to implement distributed tracing requires modifying the source code of the business system, which will increase development costs and have a certain impact on the performance of the original business. The other is based on the agent method. This method is mainly aimed at non-compiled languages ​​​​such as Java. It inserts new methods in the class loader during its operation to achieve tracing, but this method can only be deployed in business systems implemented in specific languages, which has certain limitations. Summary of the invention

[0004] To solve the above technical problems, the embodiments of the present application provide a method and device for generating a service link, an electronic device, and a computer-readable storage medium, aiming to solve the technical problems that existing distributed tracking requires a specific language environment or requires modification of the business system.

[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0006] According to one aspect of an embodiment of the present application, a method for generating a service link is provided, including:

[0007] Acquire multiple flow information, and determine service information corresponding to the multiple flow information according to the multiple flow information; wherein the service information is information used to characterize the flow direction of the flow;

[0008] Determine, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information;

[0009] The service nodes and adjacent service nodes corresponding to each flow information are spliced ​​together to obtain a service link.

[0010] According to one aspect of an embodiment of the present application, a device for generating a service link is provided, including:

[0011] An acquisition module is configured to acquire multiple flow information and determine service information corresponding to the multiple flow information according to the multiple flow information; wherein the service information is information used to characterize the flow direction of the flow;

[0012] A determination module, configured to determine, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information;

[0013] The splicing module is configured to splice the service nodes corresponding to each flow information with the adjacent service nodes to obtain a service link.

[0014] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the method for generating a service link as described above.

[0015] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the method for generating a service link as described above.

[0016] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for generating a service link provided in the above-mentioned various optional embodiments.

[0017] In the technical solution provided in the embodiments of the present application, the corresponding service node and the adjacent service node are determined through the service information corresponding to the traffic information, and then the entire complete service link is obtained, thereby realizing distributed tracing. This breaks through the limitation that the distributed tracing tool is invasive to the business system. There is no need to modify the business system, and distributed tracing can be performed on the business system non-invasively. There is no need to insert stubs in the code, and there is no need to modify the class loader when the code is running. At the same time, the method provided in the embodiments of the present application is applicable to all language environments and will not affect the normal operation of the business system during the generation process of the entire service link.

[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0020] Figure 1 It is a structural diagram of a service link generation system involved in this application;

[0021] Figure 2 It is a flow chart of a method for generating a service link involved in the present application;

[0022] Figure 3 is a flowchart of step S220 in an embodiment of the present application;

[0023] Figure 4 is a flowchart of step S310 in an embodiment of the present application;

[0024] Figure 5 is a flowchart of step S420 in an embodiment of the present application;

[0025] Figure 6 is a flowchart of step S310 in another embodiment of the present application;

[0026] Figure 7 is a flowchart of step S610 in an embodiment involved in this application;

[0027] Figure 8 is a flow chart of another method for generating a service link involved in the present application;

[0028] Fig. 9It is a block diagram of a device for generating a service link involved in the present application;

[0029] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0033] It should also be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.

[0034] Microservice architecture is a distributed architecture that divides service units by business. A distributed system often has many service units. Due to the large number of service units and the complexity of the business, it is difficult to locate errors and exceptions. This is mainly reflected in the fact that a request may need to call many services, and the complexity of internal service calls determines that it is difficult to locate errors and exceptions. Therefore, in the microservice architecture, distributed link tracking must be implemented to follow up which services are involved in a request and in what order, so that the steps of each request are clearly visible, so that when a service unit has a problem, it can be quickly located.

[0035] For example, in a microservice system, a request from a user needs to go through multiple services. The request first reaches the front end (such as the front-end interface), then reaches the middleware of the microservice system (such as load balancing, gateway, etc.) through remote calls, and finally reaches the backend service. After a series of business logic calculations, the backend returns the data corresponding to the request to the user. For such a request, it needs to go through multiple services during the process, and the service link can record the data of its request process.

[0036] Microservice architecture divides services by business. An interface exposed to the outside through REST calls may require many services to collaborate to complete the corresponding functions of this interface. If any service in the service link has a problem or the network times out, the interface call will fail. As the business continues to expand, the calls between services will become more and more complicated.

[0037] As mentioned in the background technology, existing distributed tracing tools have certain defects. Therefore, this application provides a new service link generation system. Please refer to Figure 1 , Figure 1 This is a structural diagram of the service link generation system involved in this application. The service link generation system includes a service information extraction module, a link generation module, a threshold calculation module, and an operation and maintenance display module. The modules can communicate with each other through a wired or wireless network. The specific functions of each module are described in detail as follows:

[0038] The service information extraction module uses the service grid to obtain the application layer network traffic, obtain multiple traffic information, and determine the service information corresponding to the multiple traffic information. Specifically, the service grid is an emerging microservice architecture that is used to solve a series of problems such as mutual discovery between services and service traffic management in the multi-language microservice architecture scenario. In the service grid architecture, each business process has an associated sidecar process to proxy the inbound and outbound traffic of the business process. Among them, for a microservice, the traffic accessing the microservice is called inbound traffic, that is, import traffic; the traffic accessing other microservices by the microservice is called outbound traffic, that is, export traffic. All inbound and outbound traffic of the business process will first be proxied by its associated sidecar process and then handed over to the business process for processing. All sidecar processes in the microservice architecture are interconnected to form a grid structure, so it is called a service grid architecture. For example, the inbound traffic of a microservice M will be redirected to the Sidecar process corresponding to microservice M through traffic redirection technology (such as iptables rules), and will be processed by the Sidecar process before being sent to the microservice M; the outbound traffic of a microservice M accessing another microservice N will first be redirected to the Sidecar process corresponding to microservice M, and then processed by the Sidecar process before being sent to another microservice N. Similarly, the inbound traffic of microservice N will be redirected to the Sidecar process corresponding to microservice N, and then processed by the Sidecar process corresponding to microservice N before being sent to microservice N; the outbound traffic of microservice N will also be redirected to the Sidecar process corresponding to microservice N, and then processed by the Sidecar process before being sent to the target business process.

[0039] The link generation module uses the fixed delay of service processing business flow to determine the corresponding service node and adjacent service node through the service information of each flow information, and then splices them to generate a service link.

[0040] The threshold calculation module performs multiple tests on the processing of various services by each service node in the microservice business system, records the business processing delay and calculates the average delay and standard deviation, and generates a business processing time threshold based on the average delay and the standard layer, so that the link generation module can determine the corresponding first target flow and second target flow when generating a service link.

[0041] The operation and maintenance display module is used to display the generated service links in real time, so that operation and maintenance personnel can observe, analyze, and judge the service links.

[0042] The service link generation system provided by the embodiment of the present application realizes the service link generation method through the joint action of various modules, uses the service grid to obtain application layer network traffic, and then uses the characteristic that the service processing business flow delay has a fixedness to match each current service node with the corresponding second target traffic, and then determine the corresponding adjacent next section service node to generate a service link that can be trusted by operation and maintenance. The embodiment of the present application determines the corresponding service node and the adjacent service node through the service information corresponding to the traffic information, and then obtains the entire complete service link, breaking through the limitation that the distributed tracing tool is invasive to the business system, and can perform distributed tracing on the business system non-invasively, without inserting piles in the code, or modifying the class loader when the code is running, using the service grid to collect application layer traffic and import the traffic information into the kernel for calculation and generation of service links, and the whole process will not affect the normal operation of the business system.

[0043] Figure 2 is a flow chart of a method for generating a service link according to an exemplary embodiment. The method can be applied to Figure 1 The service link generation system shown in FIG. Figure 1 The various modules in the generation system of the service link shown are executed together.

[0044] like Figure 2 As shown, in an exemplary embodiment, the method for generating the service link may include steps S210 to S230, which are described in detail as follows:

[0045] Step S210, obtaining multiple flow information, and determining service information corresponding to the multiple flow information according to the multiple flow information; wherein the service information is information used to characterize the flow direction of the flow.

[0046] In the embodiment of the present application, the service grid is used to obtain the application layer network traffic, obtain multiple traffic information, and determine the service information corresponding to each traffic information. The service information indicates the traffic flow direction of each traffic information, that is, it means that the traffic information flows from a certain service node to a certain service node. As mentioned above, each traffic information needs to flow into the Sidecar process for processing, and then the Sidecar process sends the processed traffic information to the corresponding service node. Then, the corresponding source service information and destination service information are determined for each traffic information based on the result of the Sidecar process processing. Therefore, for each traffic information, the corresponding source service information and destination service information are used as the service information of the corresponding traffic information.

[0047] Step S220: Determine, according to the service information corresponding to the plurality of flow information, the service node corresponding to each flow information and the adjacent service node of the service node corresponding to each flow information.

[0048] In the embodiment of the present application, each flow information has corresponding service information. Since the service information has indicated the flow direction of each flow information, the service node corresponding to each flow information and the adjacent service node corresponding to each service node can be determined according to the service information. In the embodiment of the present application, the adjacent service node can be the adjacent previous section service node of the corresponding service node, or it can be the adjacent next section service node of the corresponding service node. The adjacent previous section service node represents that the corresponding flow information is sent from the previous section service node to the current service node. Similarly, the adjacent next section service node represents that the corresponding flow information is sent from the corresponding service node to the next section service node.

[0049] In an exemplary embodiment of the present application, see Figure 3 The service information includes source service information and destination service information, and the multiple flow information includes multiple first flow information and multiple second flow information; in step S220, according to the service information corresponding to the multiple flow information, the service node corresponding to each flow information and the adjacent service node of the service node corresponding to each flow information are determined, including step S310 and step S320, which are described in detail as follows:

[0050] Step S310, determining a current service node according to source service information of each first flow information, and determining a next-node service node adjacent to the current service node according to the current service node and destination service information of each second flow information.

[0051] In the embodiment of the present application, the first flow information is outbound flow information representing the egress flow, the second flow information is inbound flow information representing the ingress flow, and the service information of the first flow information and the second flow information is the corresponding source service information and destination service information.

[0052] The source service information indicates which service node sends the corresponding traffic information. The current service node is determined based on the source service information of the first traffic information. The destination service information indicates that the corresponding traffic information needs to be sent to a specific service node. Therefore, the next adjacent service node of the current service node can be determined based on the current service node and the destination service information of the second traffic information.

[0053] Step S320, takes the adjacent next section service node of the current service node as the current service node, and jumps to execute the step of determining the adjacent next section service node of the current service node based on the current service node and the destination service information of each second traffic information, until the adjacent next section service node of the current service node is not determined based on the current service node and the destination service information of each second traffic information.

[0054] In the embodiment of the present application, after determining a current service node, the next service node adjacent to the current service node is determined, and then the next service node adjacent to the current service node is used as the current service node, and the next service node adjacent to the current service node is jumped to the step of determining the next service node adjacent to the current service node according to the current service node and the destination service information of each second flow information, and further determining the next service node adjacent to the current service node, after multiple cycles, until the next service node adjacent to the current service node is not determined according to the current service node and the destination service information of each second flow information. Specifically, when a new current service node is obtained each time, it is determined whether the source service information of the first flow information is the latest current service node in multiple first flow information, if the source service information of the first flow information is the latest current service node, that is, there is a next service node of the latest current service node, when the source service information of the first flow information does not exist in multiple first flow information as the latest current service node, it is determined that the current service node does not send flow information to other service nodes, that is, the current service node is the end service node of the service link, and a complete service link can be obtained by splicing all determined service nodes.

[0055] In other embodiments, the current service node can be determined by traversing a first flow information in the order of the timestamps of the first flow information, and then the adjacent next section service node of the current service node can be determined based on the current service node and the destination service information of each second flow information; then the current service node can be determined by traversing a first flow information according to the timestamp, and then the adjacent next section service node of the current service node can be determined based on the current service node and the destination service information of each second flow information, and the current service node and the corresponding next section service node can be determined based on all the first flow information, and then spliced ​​accordingly to obtain a service link.

[0056] In an exemplary embodiment of the present application, see Figure 4 In step S310, the current service node is determined according to the source service information of each first flow information, including steps S410 to S430, which are described in detail as follows:

[0057] Step S410: sort each piece of first flow information according to its timestamp to obtain a flow information sequence.

[0058] In the embodiment of the present application, the timestamp of each flow information is recorded, and the first flow information is sorted according to the timestamp of the first flow information to obtain a flow information sequence.

[0059] Step S420: Match the source service information of each first flow information with the destination service information of the plurality of second flow information in sequence according to the flow information sequence.

[0060] In the embodiment of the present application, the sorted first flow information is traversed, and the source service information of each first flow information is matched with the destination service information of the second flow information in sequence according to the order of the timestamps.

[0061] Step S430: If the source service information of the first flow information does not match the destination service information of the plurality of second flow information, an initial service node is determined according to the source service information of the first flow information, and the initial service node is used as the current service node.

[0062] In an embodiment of the present application, when the source service information of a first flow information does not match the destination service information of multiple second flow information, it means that no second flow information is sent to the service node corresponding to the source service information of the first flow information. The service node corresponding to the source service information of the first flow information can be determined as the initial service node of the entire service link. The initial service node is used as the current service node, and the next section service node adjacent to the initial service node is further determined.

[0063] In an exemplary embodiment of the present application, see Figure 5 In step S420, the source service information of each first flow information is matched with the destination service information of multiple second flow information in sequence, including steps S510 to S530, which are described in detail as follows:

[0064] Step S510: acquiring a first preset time period of each first flow information, and determining a first time range corresponding to each first flow information according to the first preset time period and a timestamp of each first flow information.

[0065] In the embodiment of the present application, when matching the source service information of the first flow information with the destination service information of the plurality of second flow information, each first flow information has a corresponding first preset time period, and the first preset time period and the service processing time threshold of the service node corresponding to the source service information of the corresponding first flow information may be different from each other. In other embodiments, the first preset time periods of the respective first flow information may be the same.

[0066] When traversing the first flow information, the corresponding first preset time period is moved forward along the timestamp corresponding to the traversed first flow information, and the corresponding first time range is formed according to the moment obtained by moving forward and the corresponding timestamp. Each first flow information can obtain a corresponding first time range.

[0067] Step S520: determine the second flow information whose timestamp is within the first time range as the first target flow of the corresponding first flow information.

[0068] In the embodiment of the present application, for each traversed first flow information, the second flow information whose timestamp is within the first time range is used as the first target flow corresponding to the first flow information.

[0069] Step S530, detecting whether the source service information of each first flow information matches the destination service information of the corresponding first target flow.

[0070] In the embodiment of the present application, the source service information of each first flow information is matched with the destination service information of the corresponding first target flow. There is no need to match the source service information of each first flow information with the destination service of all second flow information, thereby reducing the amount of calculation for matching. At the same time, the characteristic that the service node has a fixed delay in processing business flows is utilized to determine the corresponding first target flow for each first flow information, and matching in the first target flow can achieve more accurate matching, thereby facilitating the subsequent generation of a reliable service link for operation and maintenance.

[0071] In an exemplary embodiment of the present application, see Figure 6 In step S310, the next section service node adjacent to the current service node is determined according to the current service node and the destination service information of each second flow information, including steps S610 and S620, which are described in detail as follows:

[0072] Step S610: Detect whether the source service information of each second flow information matches the current service node.

[0073] In an embodiment of the present application, the current service node is matched with the source service information of the second traffic information. When matched, it indicates that the second traffic information is sent by the current service node to the corresponding Sidecar process, and then generated by the Sidecar process and sent to the destination service node corresponding to the corresponding destination service information.

[0074] Step S620: If the source service information of the second flow information matches the current service node, determine the next service node adjacent to the current service node according to the destination service information of the second flow information.

[0075] In the embodiment of the present application, when the source service information of the second flow information matches the current service node, the destination service node corresponding to the destination service information of the second flow information can be directly used as the next section service node adjacent to the current service node.

[0076] In an exemplary embodiment of the present application, see Figure 7 In step S610, it is detected whether the source service information of each second flow information matches the current service node, including steps S710 to S730, which are described in detail as follows:

[0077] Step S710: Acquire a second preset time period of the current service node, and determine a second time range of the current service node according to the timestamp of the current service node and the second preset time period.

[0078] In an embodiment of the present application, the second preset time period is the business processing time threshold of the corresponding current service node. The business processing time threshold is to perform multiple tests on the service node in the microservice business system to process various businesses, record the business processing delay of the service node, and calculate the average value and standard deviation of the delay, and then generate the business processing time threshold according to the average value and standard deviation of the delay. The business processing time threshold represents that within this threshold, the service node has completed the business processing under normal circumstances. Similarly, the second preset time period of each current service node may be different. In other embodiments, the second preset time period of each current service node may be the same.

[0079] When matching the current service node with the source service information of each second traffic information, the corresponding second preset time period is moved backward along the timestamp corresponding to the current service node, and a corresponding second time range is formed according to the corresponding timestamp and the moment obtained by moving backward. Each current service node can obtain a corresponding second time range.

[0080] Step S720: Determine the second flow information whose timestamp is within the second time range as the second target flow of the current service node.

[0081] In the embodiment of the present application, at each current time node, the second flow information with a timestamp within the corresponding second time range is determined as the corresponding second target flow. There are some current service nodes that do not have the corresponding second target flow, that is, after the current service node passes the second preset time period, there is no second flow information sent, at this time, the current service node can be identified as the end service node.

[0082] Step S730, detecting whether the current service node matches the source service information of the corresponding second target traffic.

[0083] In an embodiment of the present application, when matching the current service node with the source service information of each second flow information, it is only matched with the corresponding second target flow. There is no need to match the current service node with the source service information of all the second flow information, thereby reducing the amount of calculation for matching. At the same time, the service node is used to process the business flow with a fixed delay. The corresponding first target flow is determined for each first flow information, and the second target flow is matched. This can more accurately match the next adjacent service node of the current service node, thereby facilitating the subsequent generation of a reliable service link for operation and maintenance.

[0084] In an exemplary embodiment of the present application, the service information includes source service information and destination service information; in step S220, according to the service information corresponding to the plurality of flow information, determining the service node corresponding to each flow information and the adjacent service node of the service node corresponding to each flow information includes:

[0085] The service node corresponding to each flow information is determined according to the source service information, and the adjacent service node of the service node corresponding to each flow information is determined according to the destination service information.

[0086] In an embodiment of the present application, the service information of the traffic information can represent that the traffic information is sent by a certain service node and finally arrives at a certain service node. Therefore, the service node corresponding to the corresponding traffic information is determined according to the source service information of the traffic information, and then the adjacent service node is determined according to the destination service information.

[0087] In one embodiment, the multiple flow information includes multiple first flow information and multiple second flow information. The corresponding service nodes and adjacent service nodes can be determined only through the service information of the first flow information or the second flow information, without having to be determined based on all the flow information, which can reduce the amount of calculation to a certain extent.

[0088] Step S230: Connect the service nodes and adjacent service nodes corresponding to each flow information to obtain a service link.

[0089] In an embodiment of the present application, each service node is spliced ​​with the corresponding adjacent service node to form multiple service node pairs, and then the service network deployment position is obtained to generate a complete service link for all service node pairs according to the service grid deployment position.

[0090] In the embodiment of the present application, the corresponding service node and the adjacent service node are determined through the service information corresponding to the traffic information, and then the entire complete service link is obtained, breaking through the limitation of the distributed tracing tool on the business system. Distributed tracing can be performed on the business system non-invasively without inserting stubs in the code or modifying the class loader when the code is running. The service grid is used to collect application layer traffic and import the traffic information into the kernel for calculation and generation of service links. The whole process will not affect the normal operation of the business system.

[0091] In an exemplary embodiment of the present application, see Figure 8 , Figure 8 A method for generating a service link according to an exemplary embodiment is shown, and the method includes steps S810 to S880, which are described in detail as follows:

[0092] Step S810, obtain multiple flow information, and determine the service information corresponding to the multiple flow information based on the multiple flow information; wherein the service information is information used to characterize the flow direction of the flow; the service information includes source service information and destination service information, and the multiple flow information includes multiple first flow information and multiple second flow information.

[0093] In the embodiment of the present application, as before, the service grid is used to obtain application layer network traffic, obtain multiple traffic information, and determine the service information corresponding to each traffic information, wherein the multiple traffic information includes two types of traffic information.

[0094] Step S820: sort each piece of first flow information according to its timestamp to obtain a flow information sequence.

[0095] In the embodiment of the present application, all first flow information are sorted according to timestamps to obtain a flow information sequence, and first flow information with earlier timestamps are sorted in a front position and processed in sequence according to timestamps. During subsequent traversal, if the first flow information has been traversed, it will be deleted from the flow information sequence to avoid subsequent repeated traversal.

[0096] Step S830, according to the flow information sequence, match the source service information of each first flow information with the corresponding first target flow in turn, and determine whether the service node corresponding to the source service information of the first flow information is the initial service node according to the matching result.

[0097] In an embodiment of the present application, each first flow information is traversed in turn according to the flow information sequence. Each first flow information is set with a corresponding first target flow as in steps S510 to S530. Each first flow information is matched with the corresponding first target flow to determine whether it is an initial service node.

[0098] Step S840, if the matching result indicates that the service node corresponding to the source service information of the first traffic information is the initial service node, the initial service node is used as the current service node; if the service node corresponding to the source service information of the first traffic information is not the initial service node, the service node corresponding to the source service information of the first traffic information is used as the current service node.

[0099] In an embodiment of the present application, if the initial service node is determined, the initial service node is used as the current service node. If the service node corresponding to the source service information of the first traffic information is not the initial service node, the service node corresponding to the source service information of the first traffic information is directly used as the current service node.

[0100] Step S850: Match the current service node with the source service information of the corresponding second target traffic.

[0101] In the embodiment of the present application, each current service node is provided with a corresponding second target flow as described in steps S710 to S730, and the current service node is matched with the corresponding second target flow.

[0102] Step S860: If the current service node matches the source service information of the corresponding second target flow, the service node corresponding to the destination service information of the second target flow is used as the next section service node adjacent to the current service node.

[0103] In the embodiment of the present application, if the current service node matches the source service information of the corresponding second target flow, indicating that the second target flow is sent based on the current service node, it can be determined that the service node corresponding to the destination service information of the second target flow is the next section service node adjacent to the current service node. When determining the next section service node adjacent to the current service node, the current service node can match the source service information of multiple second target flows, indicating that the next section service node adjacent to the current service node may include multiple.

[0104] Step S870, concatenate the current service node and the adjacent next section service node, and use the adjacent next section service node as the current service node, and jump to execute the step of matching the current service node with the source service information of the corresponding second target traffic.

[0105] In the embodiment of the present application, the current service node and the adjacent next section service node are spliced, and the adjacent next section service node is used as the current service node. When there are multiple adjacent next section service nodes, multiple adjacent next section service nodes are used as the current service node to further determine the adjacent next section service node. After multiple cycles, all current service nodes and adjacent next section service nodes are spliced ​​to obtain the corresponding service link.

[0106] Step S880: If the current service node does not match the source service information of the corresponding second target traffic, the current service node is determined to be an end service node, and a service link is obtained.

[0107] In an embodiment of the present application, when the current service node does not match the source service information of the corresponding second target traffic, it may be that the current service node does not have the corresponding second target traffic, or the current service node has the corresponding second target traffic, but the service node corresponding to the source service information of the corresponding second target traffic is different from the current service node. In both cases, it can be considered that the current service node does not match the corresponding second target traffic. When the current service node does not match the corresponding second target traffic, the current service node is used as the end service node to obtain the service link.

[0108] In the embodiment of the present application, when a call is made between service nodes, a corresponding application layer data packet will be generated at the application layer. An application layer data packet only contains one communication information between services. The embodiment of the present application uses the characteristic that the service processing business flow delay is fixed to match each current service node with the corresponding second target flow, and then determine the corresponding adjacent next section service node to generate a service link that can be trusted by operation and maintenance. The embodiment of the present application determines the corresponding service node and the adjacent service node through the service information corresponding to the flow information, and then obtains the entire complete service link, breaking through the limitation that the distributed tracing tool is invasive to the business system, and can perform distributed tracing on the business system non-invasively, without inserting piles in the code, or modifying the class loader when the code is running, using the service grid to collect application layer traffic and import the traffic information into the kernel for calculation and generation of service links. The whole process will not affect the normal operation of the business system.

[0109] In an exemplary embodiment of the present application, see Fig. 9 , Fig. 9 A device for generating a service link according to an exemplary embodiment includes:

[0110] The acquisition module 910 is configured to acquire multiple flow information and determine service information corresponding to the multiple flow information according to the multiple flow information; wherein the service information is information used to characterize the flow direction of the flow;

[0111] The determination module 920 is configured to determine, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information;

[0112] The splicing module 930 is configured to splice the service nodes and adjacent service nodes corresponding to each flow information to obtain a service link.

[0113] In an exemplary embodiment of the present application, the service information includes source service information and destination service information, and the plurality of flow information includes a plurality of first flow information and a plurality of second flow information; the determination module 920 includes:

[0114] A first determination submodule is configured to determine a current service node according to source service information of each first flow information, and determine a next-section service node adjacent to the current service node according to the current service node and destination service information of each second flow information;

[0115] The jump submodule is configured to take the adjacent next-section service node of the current service node as the current service node, and jump to execute the step of determining the adjacent next-section service node of the current service node based on the current service node and the destination service information of each second traffic information, until the adjacent next-section service node of the current service node is not determined based on the current service node and the destination service information of each second traffic information.

[0116] In an exemplary embodiment of the present application, the first determining submodule includes:

[0117] A sorting unit, configured to sort each first flow information according to a timestamp of each first flow information to obtain a flow information sequence;

[0118] A matching unit configured to sequentially match source service information of each first flow information with destination service information of multiple second flow information respectively according to the flow information sequence;

[0119] The first determination unit is configured to determine an initial service node according to the source service information of the first flow information and use the initial service node as the current service node if the source service information of the first flow information does not match the destination service information of multiple second flow information.

[0120] In an exemplary embodiment of the present application, the matching unit includes:

[0121] A first acquisition subunit is configured to acquire a first preset time period of each first flow information, and determine a first time range corresponding to each first flow information according to the first preset time period and a timestamp of each first flow information;

[0122] The first determination subunit is configured to determine the second flow information whose timestamp is within the first time range as the first target flow of the corresponding first flow information; and detect whether the source service information of each first flow information matches the destination service information of the corresponding first target flow.

[0123] In an exemplary embodiment of the present application, the first determining submodule includes:

[0124] A detection unit, configured to detect whether the source service information of each second flow information matches the current service node;

[0125] The second determining unit is configured to determine the next-node service node adjacent to the current service node according to the destination service information of the second flow information if the source service information of the second flow information matches the current service node.

[0126] In an exemplary embodiment of the present application, the detection unit includes:

[0127] A second acquisition subunit is configured to acquire a second preset time period of the current service node, and determine a second time range of the current service node according to the timestamp of the current service node and the second preset time period;

[0128] A second determining subunit is configured to determine second flow information with a timestamp within a second time range as a second target flow of the current service node;

[0129] The detection subunit is configured to detect whether the current service node matches the source service information of the corresponding second target traffic.

[0130] In an exemplary embodiment of the present application, the service information includes source service information and destination service information; the determination module 920 includes:

[0131] The second determination submodule is configured to determine the service node corresponding to each flow information according to the source service information, and to determine the adjacent service node of the service node corresponding to each flow information according to the destination service information.

[0132] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module, sub-module, unit and sub-unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0133] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the service link generation method provided in the above-mentioned embodiments.

[0134] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0135] It should be noted that Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0136] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method described in the above embodiment. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002 and the RAM 1003 are connected to each other through the bus 1004. The input / output (I / O) interface 1005 is also connected to the bus 1004.

[0137] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0138] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.

[0139] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0140] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0141] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not constitute limitations on the units themselves in some cases.

[0142] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0143] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in each of the above embodiments.

[0144] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for generating a service link, characterized in that: include: Acquire multiple flow information, and determine service information corresponding to the multiple flow information according to the multiple flow information; wherein the multiple flow information includes multiple first flow information and multiple second flow information, the service information is information used to characterize the flow direction of the flow, and the service information includes source service information and destination service information; Determine, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information; Among them, the step of determining the service node corresponding to each flow information and the adjacent service node of the service node corresponding to each flow information according to the service information corresponding to the multiple flow information includes: determining the current service node according to the source service information of each first flow information, and determining the adjacent next-section service node of the current service node according to the current service node and the destination service information of each second flow information; taking the adjacent next-section service node of the current service node as the current service node, and jumping to execute the step of determining the adjacent next-section service node of the current service node according to the current service node and the destination service information of each second flow information, until the adjacent next-section service node of the current service node is not determined according to the current service node and the destination service information of each second flow information; The service nodes corresponding to each flow information are spliced ​​with the adjacent service nodes to obtain a service link.

2. The method according to claim 1, characterized in that The determining the current service node according to the source service information of each first flow information includes: Sort each piece of first flow information according to the timestamp of each piece of the first flow information to obtain a flow information sequence; According to the flow information sequence, the source service information of each first flow information is matched with the destination service information of the plurality of second flow information in sequence; If the source service information of the first flow information does not match the destination service information of the plurality of second flow information, an initial service node is determined according to the source service information of the first flow information, and the initial service node is used as the current service node.

3. The method according to claim 2, characterized in that The step of sequentially matching the source service information of each first flow information with the destination service information of the plurality of second flow information includes: Acquire a first preset time period of each first flow information, and determine a first time range corresponding to each first flow information according to the first preset time period and timestamp of each first flow information; Determine second flow information with a timestamp within the first time range as the first target flow corresponding to the first flow information; Check whether the source service information of each first flow information matches the destination service information of the corresponding first target flow.

4. The method according to claim 1, characterized in that The step of determining the next section service node adjacent to the current service node according to the current service node and the destination service information of each second flow information includes: Detecting whether source service information of each second flow information matches the current service node; If the source service information of the second flow information matches the current service node, the next service node adjacent to the current service node is determined according to the destination service information of the second flow information.

5. The method according to claim 4, characterized in that The detecting whether the source service information of each second flow information matches the current service node includes: Acquire a second preset time period of the current service node, and determine a second time range of the current service node according to the timestamp of the current service node and the second preset time period; Determine second flow information with a timestamp within the second time range as the second target flow of the current service node; Check whether the current service node matches the source service information of the corresponding second target traffic.

6. The method according to claim 1, characterized in that The determining, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information further includes: A service node corresponding to each flow information is determined according to the source service information, and an adjacent service node of the service node corresponding to each flow information is determined according to the destination service information.

7. A device for generating a service link, characterized in that: include: an acquisition module, configured to acquire a plurality of flow information, and determine service information corresponding to the plurality of flow information according to the plurality of flow information; wherein the plurality of flow information includes a plurality of first flow information and a plurality of second flow information, the service information is information for characterizing the flow direction of the flow, and the service information includes source service information and destination service information; A determination module, configured to determine, according to the service information corresponding to the plurality of flow information, a service node corresponding to each flow information and an adjacent service node of the service node corresponding to each flow information; Among them, the determination module includes a first determination submodule and a jump submodule, the first determination submodule is configured to determine the current service node according to the source service information of each first flow information, and determine the adjacent next-section service node of the current service node according to the current service node and the destination service information of each second flow information; the jump submodule is configured to take the adjacent next-section service node of the current service node as the current service node, and jump to execute the step of determining the adjacent next-section service node of the current service node according to the current service node and the destination service information of each second flow information, until the adjacent next-section service node of the current service node is not determined according to the current service node and the destination service information of each second flow information; The splicing module is configured to splice the service node corresponding to each flow information with the adjacent service node to obtain a service link.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the service link generation method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the service link generation method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Full-link intelligent fault simulation and evaluation defense method in micro-service scene

    CN112491634A

  • Visual monitoring method, system and equipment of data link and medium

    CN114666238A