Full-stack full-link application topology awareness method and device, equipment and storage medium

Through the eBPF collector, the system calls and dynamic instrumentation of network spans are performed in the cloud native environment, and metadata is obtained and associated, solving the poor access efficiency and adaptability problems of topology-aware and full-link tracking schemes in the prior art. , achieving non-invasiveness and high scalability of full-link tracking.

CN118900239APending Publication Date: 2024-11-05CHINA MERCHANTS BANK
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411184408.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

The existing topology awareness and full-link tracking solutions have problems such as poor access efficiency, blind spots in tracking, strong invasiveness and poor adaptability, especially in multi-tech stack and multi-deployment architecture environments. Link tracking.

Method used

The system call span and network span marking processing methods based on the eBPF collector are adopted to obtain system metadata and network metadata through dynamic instrumentation, and correlate it to build system call and network transmission links to realize full-link tracking.

Benefits of technology

The developers do not need to manually bury points or access the link tracking SDK, which blocks the difference in the technology stack and deployment architecture, improves universality and scalability, reduces the blind spots of link tracking, and realizes full-link tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900239A_ABST
    Figure CN118900239A_ABST
Patent Text Reader

Abstract

The invention discloses a full-stack full-link application topology awareness method, device and equipment and a storage medium, relates to the technical field of computers, and discloses a full-stack full-link application topology awareness method, which comprises the following steps: marking a system call span and a network span based on an eBPF collector, obtaining a plurality of first system metadata of the first application, a plurality of second system metadata of the second application and a plurality of first network metadata; associating a plurality of system call spans of the first application according to the first system metadata to obtain a first system call tracking link, and similarly, obtaining a second system call tracking link of the second application; and associating a plurality of network spans according to the second network metadata to obtain a data packet transmission tracking link. Through the above mode, the universality is improved, the access burden of developers is reduced, blind spots in link tracking are reduced, full-link tracking is realized, and the method has high expansibility.
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 full-stack, full-link application topology perception method, device, equipment and storage medium. Background Art

[0002] In the cloud-native era, application construction, deployment, and runtime infrastructure have undergone tremendous changes: microservice-based technical architecture, diversified technology stacks, containerized operating environments, short lifecycles of running instances, and an increase in the types of network topology nodes. These characteristics have brought great challenges to application topology perception and full-link tracking. At present, there are many technical solutions and software systems in the industry to solve the above problems. The mainstream ones are mainly the following two: 1. Manual coding by developers, including using SDKs; 2. Service mesh frameworks: such as Envoy, Istio, Linkerd, etc. However, both of these mainstream solutions have some drawbacks: the first solution is invasive to business code, requiring developers to repeatedly insert code and manually access, and needs to adapt to multiple language stacks, with low access efficiency and difficulty in subsequent upgrades and maintenance; the second solution avoids invasive code insertion and tracking, but it also has some shortcomings. First, the solution only supports the K8S technology stack. If there are applications on non-K8S platforms in the service topology, the tracking link will be interrupted, resulting in incomplete link tracking. Secondly, the solution mainly focuses on application layer tracking and lacks link tracking capabilities at the kernel layer and network layer. It is not a true full-stack link tracking solution with no tracking points.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide a full-stack, full-link application topology perception method, device, equipment and storage medium, aiming to solve the technical problems of poor access efficiency, blind spots in tracking, strong intrusiveness and poor adaptability in the prior art topology perception and full-link tracking solutions.

[0005] To achieve the above objectives, the present application proposes a full-stack full-link application topology perception method, the method comprising:

[0006] When receiving a link tracing request from an application, the system call span and the network span are marked based on the eBPF collector to obtain a plurality of first system metadata of the first application, a plurality of second system metadata of the second application, and a plurality of first network metadata;

[0007] Correlating multiple system call spans of the first application according to each first system metadata to obtain a first system call tracing link of the first application, and correlating multiple system call spans of the second application according to each second system metadata to obtain a second system call tracing link of the second application;

[0008] A plurality of network spans are associated with each second network metadata to obtain a data packet transmission tracking link.

[0009] In one embodiment, the step of performing marking processing on the system call span and the network span based on the eBPF collector to obtain a plurality of first system metadata of the first application, a plurality of second system metadata of the second application, and a plurality of first network metadata includes:

[0010] Dynamically instrument the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application;

[0011] Dynamically instrument the target system call of the second application based on the eBPF collector to obtain multiple system metadata of the second application;

[0012] Based on the eBPF collector, a network span of a network layer data packet is marked to obtain a plurality of first network metadata.

[0013] In one embodiment, the step of dynamically instrumenting the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application includes:

[0014] Determine multiple insertion points based on the eBPF collector, and determine the locations of multiple insertion points according to the types of each insertion point;

[0015] Dynamically instrument the target system call of the first application according to the position of each instrumentation point, and obtain call information of each system call span;

[0016] System metadata of each system call span in the first application is obtained according to the call information of each system call span.

[0017] In one embodiment, the step of obtaining the system metadata of each system call span in the first application according to the call information of each system call span includes:

[0018] Determine the system call time, the CPU index number, the process identifier of the user state process, the thread identifier of the kernel thread and the transport layer five-tuple of each system call span according to the call information of each system call span;

[0019] Determine a system call identifier for each system call span according to the system call time and the CPU index number of each system call span;

[0020] Determine the process thread identifier of each system call span according to the process identifier and the thread identifier of each system call span;

[0021] Determine a network flow identifier of each system call span according to the transport layer five-tuple of each system call span;

[0022] System metadata of each system call span in the first application is obtained according to the network flow identifier of each system call span, the process thread identifier of each system call span, and the system call identifier of each system call span.

[0023] In one embodiment, the step of determining the transport layer quintuple of each system call span according to the call information of each system call span includes:

[0024] Determine the source end address, source end port, target end address, target end port and address data packet of each system call span according to the call information of each system call span;

[0025] Determine the transport layer protocol of each system call span according to the address data packet of each system call span;

[0026] The transport layer quintuple of each system call span is determined according to the source end address, source end port, target end address, target end port and transport layer protocol of each system call span.

[0027] In one embodiment, the step of performing labeling processing on the network span of the network layer data packet based on the eBPF collector to obtain a plurality of first network metadata includes:

[0028] Based on the eBPF collector, the fragmentation information of each network layer data packet on the transmission path is obtained;

[0029] Perform consistency detection of each network layer data packet according to the fragmentation information of each network layer data packet;

[0030] When the consistency detection result of the data packets of each network layer is a preset result, first network metadata of multiple network spans is generated according to the packet header information.

[0031] In one embodiment, the step of associating multiple system call spans of the first application according to the first system metadata to obtain the first system call tracing link of the first application includes:

[0032] Associating multiple system call spans of the first application according to the process thread identifier and the network flow identifier in each first system metadata, to obtain thread association relationships and network flow association relationships of the multiple system call spans of the first application;

[0033] Sort each system call span according to its call occurrence time and construct a time series;

[0034] The thread association relationship, the network flow association relationship and the time series of each system call span are connected in series to obtain a first system call tracing link of the first application.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a full-stack full-link application topology perception device, which includes: a processing module, which is used to perform marking processing of system call span and network span based on the eBPF collector when receiving a link tracking request of an application, and obtain multiple first system metadata of a first application, multiple second system metadata of a second application, and multiple first network metadata;

[0036] an association module, configured to associate multiple system call spans of a first application according to each first system metadata to obtain a first system call tracing link of the first application, and to associate multiple system call spans of a second application according to each second system metadata to obtain a second system call tracing link of the second application;

[0037] The association module is further used to associate multiple network spans according to each second network metadata to obtain a data packet transmission tracking link.

[0038] In addition, to achieve the above-mentioned objectives, the present application also proposes a full-stack, full-link application topology awareness device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the full-stack, full-link application topology awareness method described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the full-stack and full-link application topology perception method described above are implemented.

[0040] The present application provides a full-stack, full-link application topology perception method. When receiving a link tracking request from an application, the present application performs labeling processing on the system call span and the network span based on the eBPF collector to obtain multiple first system metadata of the first application, multiple second system metadata of the second application, and multiple first network metadata; associates multiple system call spans of the first application according to each first system metadata to obtain a first system call tracking link of the first application, and associates multiple system call spans of the second application according to each second system metadata to obtain a second system call tracking link of the second application; associates multiple network spans according to each second network metadata to obtain a data packet transmission tracking link. Through the above method, based on the underlying kernel function plugging technology, the differences in the technology stack and deployment architecture are shielded, and the universality is improved. There is no need for application developers to manually embed points or access the link tracking SDK. There is no intrusion on the business code, which reduces the burden on developers to access, and reduces the blind spots in link tracking, realizing full-link tracking, and having high scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A flowchart of the first embodiment of the full-stack full-link application topology perception method of the present application is provided;

[0044] Figure 2 A schematic diagram of the insertion points and network flow path logic of the full-stack full-link application topology awareness method provided in Example 1 of the present application;

[0045] Figure 3 A schematic diagram of service-to-service link tracing based on TCP packets for the full-stack full-link application topology awareness method provided in Example 1 of the present application;

[0046] Figure 4 A flowchart of the second embodiment of the full-stack full-link application topology perception method of this application is provided;

[0047] Figure 5 A schematic diagram of the insertion point information of the full-stack full-link application topology perception method provided in the second embodiment of the present application;

[0048] Figure 6 A schematic diagram of the intermediate data structure of the system call span association process of the full-stack full-link application topology awareness method provided in Example 2 of the present application;

[0049] Figure 7 A schematic diagram of the IP and port acquisition process of the full-stack full-link application topology awareness method provided in Example 2 of the present application;

[0050] Figure 8 A schematic diagram of the intermediate data structure of the network span association process of the full-stack full-link application topology awareness method provided in Example 2 of the present application;

[0051] Fig. 9 This is a schematic diagram of the module structure of a full-stack, full-link application topology perception device according to an embodiment of the present application;

[0052] Fig.10 This is a schematic diagram of the device structure of the hardware operating environment involved in the full-stack full-link application topology perception method in the embodiment of the present application.

[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0056] The main solution of the embodiment of the present application is: when receiving a link tracing request from an application, the system call span and the network span are marked based on the eBPF collector to obtain multiple first system metadata of the first application, multiple second system metadata of the second application, and multiple first network metadata; the multiple system call spans of the first application are associated according to each first system metadata to obtain the first system call tracing link of the first application, and the multiple system call spans of the second application are associated according to each second system metadata to obtain the second system call tracing link of the second application; the multiple network spans are associated according to each second network metadata to obtain a data packet transmission tracing link.

[0057] In the cloud-native era, the application construction, deployment and runtime infrastructure have undergone earth-shaking changes: the technology architecture is microservice-oriented, the technology stack is diversified, the operating environment is containerized, the life cycle of the running instance is short, and the types of network topology nodes have increased. These characteristics have brought great challenges to application topology perception and full-link tracking. At present, there are many technical solutions and software systems in the industry to solve the above problems. The mainstream ones are mainly the following two: 1. Developers manually insert code, including with the help of SDK; 2. Service mesh framework: such as Envoy, Istio, Linkerd, etc. However, these two mainstream solutions have some disadvantages: the first solution is invasive to the business code, requiring developers to repeatedly insert code manually and manually access, and need to adapt to multiple language stacks, with low access efficiency and difficulty in subsequent upgrades and maintenance; the second solution avoids invasive insertion and tracking, but it also has some shortcomings. First, this solution only supports the K8S technology stack. If there are applications on non-K8S platforms in the service topology, it will cause the tracking link to be interrupted, resulting in incomplete tracking of the link. Secondly, this solution mainly focuses on application layer tracking, lacks the link tracking capabilities of the kernel layer and network layer, and is not a true full-stack link tracking solution without tracking points. Therefore, the existing topology awareness and full-link tracking solutions have the problems of poor access efficiency, tracking blind spots, high intrusiveness, and poor adaptability to multiple technology stacks and multiple deployment architectures.

[0058] This application shields the differences in technology stacks and deployment architectures through the underlying kernel function instrumentation technology, improves universality, and does not require application developers to manually place points or access link tracking SDKs. It is completely non-invasive to business codes, reducing the access burden on developers and blind spots in link tracking, achieving full-link tracking and having high scalability.

[0059] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a full-stack full-link application topology perception device, etc. The following takes a full-stack full-link application topology perception device as an example to illustrate this embodiment and the following embodiments.

[0060] Based on this, the embodiment of the present application provides a full-stack full-link application topology perception method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the full-stack, full-link application topology awareness method of the present application.

[0061] In this embodiment, the full-stack full-link application topology perception method includes steps S10 to S30:

[0062] Step S10, when receiving the link tracking request of the application, the system call span and the network span are marked based on the eBPF collector to obtain multiple first system metadata of the first application, multiple second system metadata of the second application and multiple first network metadata.

[0063] It should be noted that the eBPF collector is a monitoring tool based on the eBPF (Extended Berkeley Packet Filter) technology. Its main function is to intercept and process various events at the kernel level, and report the processing results to the user space application, so as to achieve real-time monitoring and analysis of the system status. The system call span (i.e., the system call span) refers to the time span from initiating a system call to completing the system call. The network span (i.e., the network span) refers to the time span from sending a network request to receiving a response. The first application refers to the request sender, and the second application refers to the request responder.

[0064] It can be understood that when the first application sends a request to the second application, if a link tracking request of the application is received, the system call span and the network span are marked based on the eBPF collector to obtain multiple first system metadata in the first application, multiple second system metadata of the second application, and multiple first network metadata. One system call span corresponds to one system metadata, and one network span corresponds to one network metadata. In this embodiment, the first system metadata and the second system metadata respectively include the network flow identifier (i.e., flow_id) of the system call span, the process thread identifier (i.e., thread_id) of each system call span, and the system call identifier (i.e., syscall_id) of each system call span. The first network metadata includes but is not limited to the flow_id of each network span, the sending sequence number seq / receiving sequence number ack number, and the timestamp, etc.

[0065] In the specific implementation, when the first application sends a request to the second application, if a link tracing request from the application is received, the system call span based on the eBPF collector is specifically as follows: Based on the eBPF collector, the general read / write system call is dynamically instrumented. For each application, in the instrumentation program, each system call span generates a unique syscall_id, and then saves its mapping relationship with the user thread thread_id, interface url, and kernel socket connection (five-tuple, also known as flow_id).

[0066] It should be noted that the network call span based on the eBPF collector is as follows: for the same network packet, when passing through the Pod virtual network card, the container node virtual network card and the physical machine physical network card, if the PDU (Protocol Data Unit) is not fragmented, then the send sequence number seq / receive sequence number ack in the tcp (Transmission Control Protocol) / udp (User Datagram Protocol) packet header remains unchanged, and the abstract flow_id is also unchanged; if there is NAT (Network Address Translation) conversion, the flow_id needs to be uniformly processed into an abstract flow_id, for example, the internal ip and port are uniformly used, so that the abstract flow_id is unchanged.

[0067] Step S20, associate multiple system call spans of the first application according to each first system metadata to obtain a first system call tracing link of the first application, and associate multiple system call spans of the second application according to each second system metadata to obtain a second system call tracing link of the second application.

[0068] It should be noted that, according to the same flow_id and thread_id in each first system metadata, multiple system call spans in the first application can be associated, so as to obtain the first system call tracing link corresponding to the system call span in the first application. At the same time, according to the same flow_id and thread_id in each second system metadata, multiple system call spans in the second application can be associated, so as to obtain the second system call tracing link corresponding to the system call span in the second application.

[0069] For example Figure 2 As shown in the figure, from the observation point Y of the Apod network card and the observation point Z of the A container node network card, the seq numbers of flow1 and flow2 are the same. Based on this feature, the two flows can be associated. Similarly, flow5 and flow6 can be associated. From the application observation point X, the two system calls of A application write and read can be associated using the thread number, with flow1.threadId = flow12.threadId. Similarly, flow6 and flow7 can be associated.

[0070] In a feasible implementation manner, step S20 may include steps A11 to A13:

[0071] Step A11, associating multiple system call spans of the first application according to the process thread identifier and the network flow identifier in each first system metadata, to obtain thread association relations and network flow association relations of the multiple system call spans of the first application.

[0072] Step A12, sorting each system call span according to the call occurrence time of each system call span to construct a time series.

[0073] Step A13, concatenating the thread association relationship, the network flow association relationship and the time sequence of each system call span to obtain a first system call tracing link of the first application.

[0074] It should be noted that the process thread identifier refers to the user-state thread thread_id. The thread_id in the system metadata of each system call span is used to associate the system call spans belonging to the same thread, thereby obtaining the thread association relationship of multiple system call spans of the first application; the flow_id in the system metadata of each system call span is used to associate the system call spans belonging to the same thread, thereby obtaining the network flow association relationship of multiple system call spans of the first application.

[0075] It is understandable that the system call spans are sorted according to the call occurrence time of each system call span to construct a time series. The sorted system call spans are connected in series according to the thread association relationship and the network flow association relationship to construct the first system call tracking link of the system call span in the first application. When the link is constructed, the constructed system call link needs to be verified to ensure that there are no omissions or erroneous associations. When necessary, the link is optimized, such as merging or separating spans, to more accurately reflect the actual execution of the application.

[0076] Step S30: associate multiple network spans according to the second network metadata to obtain a data packet transmission tracking link.

[0077] It should be noted that, according to the same flow_id in each second network metadata, multiple network spans can be associated, and the seq / ack number in the socket header can be used to associate the network spans on the Pod, container node, and physical machine to obtain the packet transmission tracking link corresponding to the network layer packet. Figure 2 As shown in the figure, 2 and 11, 3 and 10, 4 and 9, 5 and 8 are paired send / recive flows, and the flow_id is the same for each pair. Therefore, flow_id is used as the association condition. The four flows 8, 9, 10, and 11 can be associated.

[0078] It can be understood that, through the method of this embodiment, the link tracking between services can be performed, such as Figure 3 As shown, from the four-layer flow log, for the same request, the TCP packet sent by service A and the TCP packet received by service B are the same, and the SEQ sequence number of the TCP packet is also the same. Based on this feature, the link association between service A and service B can be achieved. The SEQ field of TCP occupies 32 bits in the TCP packet header. When the number of TCP packets is large, there is a possibility of duplication. Therefore, when associating and aggregating, time slicing is introduced as a condition. In this embodiment, the time threshold can also be set to the timeout time of the service. When the time difference between socketA and socketB is greater than the timeout time of the service, it can be considered that it is not the same trace, and aggregation and association are not performed at this time. At this point, the association of all links is completed, and the links are subsequently sorted to generate a full-link tracing flame graph.

[0079] This embodiment provides a full-stack, full-link application topology perception method. This embodiment obtains multiple first system metadata of the first application, multiple second system metadata of the second application, and multiple first network metadata by marking the system call span and network span based on the eBPF collector when receiving the link tracking request of the application; associates the multiple system call spans of the first application according to each first system metadata to obtain the first system call tracking link of the first application, and associates the multiple system call spans of the second application according to each second system metadata to obtain the second system call tracking link of the second application; associates multiple network spans according to each second network metadata to obtain the data packet transmission tracking link. Through the above method, based on the underlying kernel function instrumentation technology, the differences in technology stack and deployment architecture are shielded, and the universality is improved. There is no need for application developers to manually bury points or access the link tracking SDK. There is no intrusion to the business code, which reduces the access burden of developers, reduces the blind spots in link tracking, realizes full-link tracking, and has high scalability.

[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S10, the full-stack full-link application topology perception method also includes steps S11 to S13:

[0081] Step S11, when receiving the link tracing request of the application, dynamically instrument the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application.

[0082] It should be noted that the target system call refers to a system call for general read / write, and may also be other system calls, which is not limited in this embodiment. When the first application sends a request to the second application, if a link tracing request of the application is received, the system call span based on the eBPF collector is specifically as follows: based on the eBPF collector, the general read / write system call is dynamically instrumented, thereby obtaining the system metadata corresponding to multiple system call spans in the first application.

[0083] In a feasible implementation manner, step S11 may further include steps B11 to B13:

[0084] Step B11, determining multiple insertion points based on the eBPF collector, and determining multiple insertion point positions according to the type of each insertion point.

[0085] Step B12: dynamically instrument the target system call of the first application according to the position of each instrumentation point, and obtain the call information of each system call span.

[0086] Step B13, obtaining system metadata of each system call span in the first application according to the call information of each system call span.

[0087] It should be noted that multiple insertion points are determined according to the eBPF collector, and different types of insertion points correspond to different insertion point locations. The insertion points involved in dynamic insertion are as follows: Figure 5 As shown. The target system call of the first application is dynamically instrumented according to the insertion point position of each insertion point, and the call information of the system call span is obtained. In this embodiment, the call information includes but is not limited to the system call time, CPU index number, user state process PID (process identifier), kernel thread ID and transport layer five-tuple information.

[0088] It can be understood that based on the call information of each system call span, the system metadata corresponding to multiple system call spans in the first application can be obtained. In the stub program, each system call span generates a unique syscall_id, and then saves its mapping relationship with the user thread thread_id, interface url, and kernel socket connection (five-tuple, also called flow_id). The intermediate data structures involved are as follows: Figure 6 shown.

[0089] In a feasible implementation manner, step B13 may further include steps C11 to C15:

[0090] Step C11, determining the system call time, CPU index, user state process identifier, kernel thread identifier and transport layer quintuple of each system call span according to the call information of each system call span.

[0091] Step C12, determining the system call identifier of each system call span according to the system call time and the CPU index number of each system call span.

[0092] It should be noted that, during the startup phase, the link initial sequence number syscall_id_0 (u64 type) can be generated for each CPU based on the system call time and the central processing unit index number (i.e., the CPU index number) of each system call span. The upper 8 bits are the CPU index number (the number of CPUs in the host machine should be <256), and the lower 56 bits are the microsecond value corresponding to the system time. Subsequent requests apply for syscall_id from the CPU where they are located, and increment syscall_id_0 by +1, which ensures that syscall_id is globally unique on a single service, thereby obtaining the system call identifier syscall_id of each system call span, which is used to identify the unique ID of the system call.

[0093] Step C13, determining the process thread identifier of each system call span according to the process identifier and thread identifier of each system call span.

[0094] It should be noted that in the stub program, the u64 value composed of the process identifier of the user-mode process (i.e., user-mode process PID) and the thread identifier of the kernel thread (i.e., kernel thread ID) of each system call span obtained by the bpf_get_current_pid_tgid auxiliary function is used as the process thread identifier thread_id of each system call span, which is used to identify the thread and process information of each system call.

[0095] Step C14: The transport layer quintuple of each system call span determines the network flow identifier of each system call span.

[0096] It should be noted that the network flow identifier flow_id of each system call span is determined according to the transport layer quintuple of each system call span, which is used to identify a network flow Flow, that is, a TCP connection.

[0097] Step C15, obtaining system metadata of each system call span in the first application according to the network flow identifier of each system call span, the process thread identifier of each system call span, and the system call identifier of each system call span.

[0098] It should be noted that, in the first application, the system metadata of each system call span includes but is not limited to the network flow identifier flow_id of each system call span, the process thread identifier thread_id of each system call span, and the system call identifier syscall_id of each system call span.

[0099] In a feasible implementation manner, step C11 may further include steps D11 to D13:

[0100] Step D11, determining the source end address, source end port, target end address, target end port and address data packet of each system call span according to the call information of each system call span.

[0101] Step D12, determining the transport layer protocol of each system call span according to the address data packet of each system call span.

[0102] Step D13, determining the transport layer quintuple of each system call span according to the source end address, source end port, target end address, target end port and transport layer protocol of each system call span.

[0103] It should be noted that the source address (i.e., source IP), source port, target address (i.e., target IP), target port, and address data packet (i.e., IP data packet) of each system call span are determined based on the call information of each system call span. The source / destination IP and port are obtained by intercepting the Socket related structure, such as kprobe / tcp_set_state, as shown in Figure 7 As shown in the figure, the transport layer protocol of each system call span can be obtained according to the Protocol header field in the IP data packet, for example, TCP is 6 and UDP is 17.

[0104] Step S12: dynamically instrument the target system call of the second application based on the eBPF collector to obtain multiple system metadata of the second application.

[0105] It should be noted that when the first application sends a request to the second application, if a link tracing request from the application is received, the system call span based on the eBPF collector is specifically as follows: based on the eBPF collector, the general read / write system call is dynamically inserted to obtain the system metadata corresponding to multiple system call spans in the second application.

[0106] Step S13: Based on the eBPF collector, the network span of the network layer data packet is marked to obtain multiple first network metadata.

[0107] It should be noted that the network call span based on the eBPF collector is specifically as follows: for the same network layer data packet, when passing through the Pod virtual network card, the container node virtual network card and the physical machine physical network card, if the PDU (Protocol Data Unit) is not fragmented, then the send sequence number seq / receive sequence number ack in the tcp (Transmission Control Protocol) / udp (User Datagram Protocol) packet header is unchanged, and the abstract flow_id is also unchanged; if there is a NAT (Network Address Translation) conversion, the flow_id needs to be uniformly processed into an abstract flow_id, for example, the internal ip and port are uniformly used, so that the abstract flow_id is unchanged. In this embodiment, one network span corresponds to one network metadata, so that the network metadata of multiple network spans can be obtained. Based on the above characteristics, the seq / ack number in the socket header can be used to associate the network spans on the Pod, container node, and physical machine. The intermediate data structures involved are such as Figure 8 shown.

[0108] In a feasible implementation manner, step S13 may further include steps E11 to E13:

[0109] Step E11, based on the eBPF collector, obtain the fragmentation information of each network layer data packet on the transmission path.

[0110] Step E12, performing consistency detection on each network layer data packet according to the fragmentation information of each network layer data packet.

[0111] Step E13, when the consistency detection result of each network layer data packet is a preset result, generating first network metadata of multiple network spans according to the packet header information.

[0112] It should be noted that the eBPF collector can capture network layer packets from the network interface in real time and the corresponding fragmentation information when it passes through the Pod virtual network card, the container node virtual network card and the physical network card of the physical machine. The fragmentation information contains the fragmentation flag of the network layer packet.

[0113] It is understandable that the consistency check of each network layer data packet is performed according to the fragmentation information of each network layer data packet to ensure that the captured network layer data packet is complete and not fragmented. When the consistency check result of each network layer data packet is a preset result, it means that the network layer data packet is not fragmented. At this time, the first network metadata of multiple network spans can be generated according to the header information of each network layer data packet.

[0114] This embodiment provides a full-stack, full-link application topology perception method. This embodiment dynamically inserts the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application; dynamically inserts the target system call of the second application based on the eBPF collector to obtain multiple system metadata of the second application; and marks the network span of the network layer data packet based on the eBPF collector to obtain multiple first network metadata. In the above manner, multiple system metadata of the first application, multiple system metadata of the second application, and multiple first network metadata can be accurately obtained.

[0115] Exemplarily, in order to help understand the implementation process of the full-stack full-link application topology awareness method obtained by combining this embodiment with the above-mentioned embodiment 1, specifically:

[0116] The method of this embodiment deploys eBpf collectors on all virtual machines in the cloud platform cluster, collects network layer kernel indicators, parses socket five-tuples and combines k8s and cluster metadata information to mark data packets, and identifies the data packet sending and receiving side applications and sending and receiving side container nodes; parses socket data information, and marks data packets according to the characteristics of the l7 layer protocol (http, redis communication, http2.0, dns, kafaka protocol) to distinguish the data packet application layer protocol type; uses the socket seq number to associate the data packets of the container node, and finally obtains the application topology covering the application layer, infrastructure (container nodes, physical machines, load balancing), and middleware. It has the following advantages: 1. Non-intrusive collection and access capabilities: There is no need for application developers to manually bury points or access link tracking SDKs, which is completely non-intrusive to business codes, reducing the access burden on developers. 2. Universality of multiple technology stacks and deployment architectures: This solution completes link tracking and association at the kernel layer and network layer, and can adapt to various development languages ​​and RPC frameworks, reducing the complexity of adapting multi-language technology stacks; in addition, from the deployment architecture, the method of this embodiment can adapt to applications on the K8S platform, and can also adapt to applications deployed on virtual machines and physical machines. 3. Full-link tracking capability: Existing distributed link tracking is mainly concentrated at the application layer. The method of this embodiment adds tracking of system call spans and network spans, reduces tracking blind spots, and realizes tracking and association of physical network elements such as DNS nodes, container nodes, and middleware, broadening the vision and depth of distributed link tracking. 4. High scalability: Based on the above design principles and solutions, as long as the Agent deployment is completed on nodes such as F5 and load balancers, no development is required, and link tracking coverage of basic network nodes can be achieved, achieving true full-link tracking.

[0117] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the full-stack, full-link application topology awareness method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0118] This application also provides a full-stack full-link application topology perception device, please refer to Fig. 9 , the full-stack full-link application topology perception device includes:

[0119] The processing module 10 is used to perform marking processing on the system call span and the network span based on the eBPF collector when receiving a link tracking request from an application, so as to obtain multiple first system metadata of the first application, multiple second system metadata of the second application, and multiple first network metadata.

[0120] The association module 20 is used to associate multiple system call spans of the first application according to each first system metadata to obtain a first system call tracing link of the first application, and to associate multiple system call spans of the second application according to each second system metadata to obtain a second system call tracing link of the second application.

[0121] The association module 20 is further used to associate multiple network spans according to each second network metadata to obtain a data packet transmission tracking link.

[0122] Optionally, the processing module 10 is further used for:

[0123] Based on the eBPF collector, the target system call of the first application is dynamically instrumented to obtain multiple system metadata of the first application; based on the eBPF collector, the target system call of the second application is dynamically instrumented to obtain multiple system metadata of the second application; based on the eBPF collector, the network span of the network layer data packet is marked to obtain multiple first network metadata.

[0124] Optionally, the processing module 10 is further used for:

[0125] Based on the eBPF collector, multiple insertion points are determined, and the positions of the multiple insertion points are determined according to the type of each insertion point; the target system call of the first application is dynamically inserted according to the insertion point position of each insertion point, and the call information of each system call span is obtained; according to the call information of each system call span, the system metadata of each system call span in the first application is obtained.

[0126] Optionally, the processing module 10 is further used for:

[0127] Determine the system call time, central processing unit index number, process identifier of the user-mode process, thread identifier of the kernel thread and transport layer five-tuple of each system call span according to the call information of each system call span; determine the system call identifier of each system call span according to the system call time and central processing unit index number of each system call span; determine the process thread identifier of each system call span according to the process identifier and thread identifier of each system call span; determine the network flow identifier of each system call span according to the transport layer five-tuple of each system call span; obtain the system metadata of each system call span in the first application according to the network flow identifier of each system call span, the process thread identifier of each system call span and the system call identifier of each system call span.

[0128] Optionally, the processing module 10 is further used for:

[0129] Determine the source address, source port, target address, target port and address data packet of each system call span according to the call information of each system call span; determine the transport layer protocol of each system call span according to the address data packet of each system call span; determine the transport layer quintuple of each system call span according to the source address, source port, target address, target port and transport layer protocol of each system call span.

[0130] Optionally, the processing module 10 is further used for:

[0131] Based on the eBPF collector, the fragmentation information of each network layer data packet on the transmission path is obtained; the consistency of each network layer data packet is checked according to the fragmentation information of each network layer data packet; when the consistency check result of each network layer data packet is a preset result, the first network metadata of multiple network spans is generated according to the packet header information.

[0132] Optionally, the association module 20 is further configured to:

[0133] The multiple system call spans of the first application are associated according to the process thread identifiers and network flow identifiers in the metadata of each first system, and the thread association relationship and network flow association relationship of the multiple system call spans of the first application are obtained; the system call spans are sorted according to the call occurrence time of each system call span to construct a time series; the thread association relationship, network flow association relationship and the time series of each system call span are connected in series to obtain the first system call tracing link of the first application.

[0134] The full-stack, full-link application topology perception device provided by the present application adopts the full-stack, full-link application topology perception method in the above-mentioned embodiment, which can solve the technical problems of poor access efficiency, blind spots in tracking, strong invasiveness and poor adaptability of topology perception and full-link tracking solutions in the prior art. Compared with the prior art, the beneficial effects of the full-stack, full-link application topology perception device provided by the present application are the same as the beneficial effects of the full-stack, full-link application topology perception method provided by the above-mentioned embodiment, and the other technical features of the full-stack, full-link application topology perception device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0135] The present application provides a full-stack, full-link application topology awareness device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the full-stack, full-link application topology awareness method in the above-mentioned embodiment one.

[0136] Reference below Fig.10, which shows a schematic diagram of the structure of a full-stack, full-link application topology perception device suitable for implementing the embodiment of the present application. The full-stack, full-link application topology perception device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The full-stack, full-link application topology-aware device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present application.

[0137] like Fig.10 As shown, the full-stack full-link application topology awareness device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the full-stack full-link application topology awareness device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the full-stack, full-link application topology-aware device to communicate wirelessly or wired with other devices to exchange data. Although a full-stack, full-link application topology-aware device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or provided alternatively.

[0138] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code 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 device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0139] The full-stack, full-link application topology perception device provided by the present application adopts the full-stack, full-link application topology perception method in the above-mentioned embodiment, which can solve the technical problems of poor access efficiency, blind spots in tracking, strong invasiveness and poor adaptability of topology perception and full-link tracking solutions in the prior art. Compared with the prior art, the beneficial effects of the full-stack, full-link application topology perception device provided by the present application are the same as the beneficial effects of the full-stack, full-link application topology perception method provided by the above-mentioned embodiment, and the other technical features in the full-stack, full-link application topology perception device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0140] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0142] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the full-stack, full-link application topology awareness method in the above-mentioned embodiment.

[0143] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may 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 or 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 this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0144] The above-mentioned computer-readable storage medium may be included in the full-stack, full-link application topology awareness device; or it may exist independently without being assembled into the full-stack, full-link application topology awareness device.

[0145] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the full-stack full-link application topology awareness device, the full-stack full-link application topology awareness device: when receiving the link tracking request of the application, based on the eBPF collector, performs marking processing on the system call span and the network span to obtain multiple first system metadata of the first application, multiple second system metadata of the second application, and multiple first network metadata; associates the multiple system call spans of the first application according to each first system metadata to obtain the first system call tracking link of the first application, and associates the multiple system call spans of the second application according to each second system metadata to obtain the second system call tracking link of the second application; associates multiple network spans according to each second network metadata to obtain a data packet transmission tracking link.

[0146] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart 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.

[0148] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0149] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned full-stack full-link application topology perception method, which can solve the technical problems of poor access efficiency, blind spots in tracking, strong invasiveness, and poor adaptability in the topology perception and full-link tracking solutions in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the full-stack full-link application topology perception method provided in the above-mentioned embodiments, which will not be repeated here.

[0150] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the full-stack and full-link application topology awareness method as described above.

[0151] The computer program product provided by this application can solve the technical problems of poor access efficiency, blind spots in tracking, strong invasiveness and poor adaptability in the prior art topology perception and full-link tracking solutions. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the full-stack full-link application topology perception method provided by the above embodiment, which will not be repeated here.

[0152] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A full-stack full-link application topology perception method, characterized in that: The full-stack full-link application topology perception method includes: When receiving a link tracing request from an application, the system call span and the network span are marked based on the eBPF collector to obtain a plurality of first system metadata of the first application, a plurality of second system metadata of the second application, and a plurality of first network metadata; Correlating multiple system call spans of the first application according to each first system metadata to obtain a first system call tracing link of the first application, and correlating multiple system call spans of the second application according to each second system metadata to obtain a second system call tracing link of the second application; A plurality of network spans are associated with each second network metadata to obtain a data packet transmission tracking link.

2. The method according to claim 1, characterized in that The step of performing labeling processing on the system call span and the network span based on the eBPF collector to obtain a plurality of first system metadata of the first application, a plurality of second system metadata of the second application, and a plurality of first network metadata comprises: Dynamically instrument the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application; Dynamically instrument the target system call of the second application based on the eBPF collector to obtain multiple system metadata of the second application; Based on the eBPF collector, a network span of a network layer data packet is marked to obtain a plurality of first network metadata.

3. The method according to claim 2, characterized in that The step of dynamically instrumenting the target system call of the first application based on the eBPF collector to obtain multiple system metadata of the first application includes: Determine multiple insertion points based on the eBPF collector, and determine the locations of multiple insertion points according to the types of each insertion point; Dynamically instrument the target system call of the first application according to the position of each instrumentation point, and obtain call information of each system call span; System metadata of each system call span in the first application is obtained according to the call information of each system call span.

4. The method according to claim 3, characterized in that The step of obtaining the system metadata of each system call span in the first application according to the call information of each system call span comprises: Determine the system call time, the CPU index number, the process identifier of the user state process, the thread identifier of the kernel thread and the transport layer five-tuple of each system call span according to the call information of each system call span; Determine a system call identifier for each system call span according to the system call time and the CPU index number of each system call span; Determine the process thread identifier of each system call span according to the process identifier and the thread identifier of each system call span; Determine a network flow identifier of each system call span according to the transport layer five-tuple of each system call span; System metadata of each system call span in the first application is obtained according to the network flow identifier of each system call span, the process thread identifier of each system call span, and the system call identifier of each system call span.

5. The method according to claim 4, characterized in that The step of determining the transport layer quintuple of each system call span according to the call information of each system call span comprises: Determine the source end address, source end port, target end address, target end port and address data packet of each system call span according to the call information of each system call span; Determine the transport layer protocol of each system call span according to the address data packet of each system call span; The transport layer quintuple of each system call span is determined according to the source end address, source end port, target end address, target end port and transport layer protocol of each system call span.

6. The method according to claim 2, characterized in that The step of performing labeling processing on the network span of the network layer data packet based on the eBPF collector to obtain a plurality of first network metadata comprises: Based on the eBPF collector, the fragmentation information of each network layer data packet on the transmission path is obtained; Perform consistency detection of each network layer data packet according to the fragmentation information of each network layer data packet; When the consistency detection result of the data packets of each network layer is a preset result, first network metadata of multiple network spans is generated according to the packet header information.

7. The method according to any one of claims 1 to 6, characterized in that The step of associating multiple system call spans of the first application according to the first system metadata to obtain the first system call tracing link of the first application includes: Associating multiple system call spans of the first application according to the process thread identifier and the network flow identifier in each first system metadata, to obtain thread association relationships and network flow association relationships of the multiple system call spans of the first application; Sort each system call span according to its call occurrence time and construct a time series; The thread association relationship, the network flow association relationship and the time series of each system call span are connected in series to obtain a first system call tracing link of the first application.

8. A full-stack full-link application topology perception device, characterized in that: The full-stack full-link application topology perception device includes: A processing module, configured to, upon receiving a link tracing request from an application, perform labeling processing on a system call span and a network span based on an eBPF collector, and obtain a plurality of first system metadata of a first application, a plurality of second system metadata of a second application, and a plurality of first network metadata; an association module, configured to associate multiple system call spans of a first application according to each first system metadata to obtain a first system call tracing link of the first application, and to associate multiple system call spans of a second application according to each second system metadata to obtain a second system call tracing link of the second application; The association module is further used to associate multiple network spans according to each second network metadata to obtain a data packet transmission tracking link.

9. A full-stack, full-link application topology awareness device, characterized in that: The full-stack, full-link application topology awareness device includes: a memory, a processor, and a full-stack, full-link application topology awareness program stored in the memory and executable on the processor, wherein the full-stack, full-link application topology awareness program is configured to implement a full-stack, full-link application topology awareness method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores a full-stack, full-link application topology awareness program, which, when executed by the processor, implements the full-stack, full-link application topology awareness method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Service end-to-end monitoring method and system based on eBPF

    CN119652743A

  • Full-stack observability method of unified platform

    CN120448227A