Traffic tracking method and device, electronic equipment and storage medium

By introducing eBPF technology under the unitized architecture, generating and adding traffic tracking identifiers, the correlation of service call request packets is solved, and the problem of low traffic tracking efficiency and accuracy in the existing technology is solved, and more efficient and accurate traffic is achieved track.

CN119420816AActive Publication Date: 2025-02-11E-SURFING DIGITAL LIFE TECH CO LTD

Patent Information

Application Number
CN202411577364.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-11
Estimated Expiration
2044-11-06

AI Technical Summary

Technical Problem

The existing traffic tracking solutions have problems such as code intrusion, not supporting multilingual multi-transmission protocol tracking, and difficulty in cross-threading, resulting in low efficiency and accuracy of traffic tracking.

Method used

By obtaining the service call request data packet, a corresponding traffic tracking identity is generated, and it is added to the data packet, and using this identity to associate the service call information to generate traffic tracking information. Under the unitized architecture, this method introduces eBPF technology to perform kernel layer transmission protocol analysis and application layer protocol analysis to realize cross-thread full-process traffic tracking.

Benefits of technology

It has achieved improved efficiency and accuracy of traffic tracking, solved the problem of difficulty in tracking and cross-threading that does not support multi-language multi-transmission protocols, and improved the comprehensiveness and accuracy of traffic tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420816A_ABST
    Figure CN119420816A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic tracking method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a service calling request data packet; generating a corresponding flow tracking identifier according to the service calling request data packet, and adding the flow tracking identifier into the service calling request data packet; and associating service calling information corresponding to the service calling request data packet by using the traffic tracking identifier, and generating corresponding traffic tracking information. The traffic tracking method and device can realize traffic tracking, solve the problems that multi-language multi-transmission protocol tracking is not supported, and tracking is difficult under the cross-thread condition, improve the traffic tracking efficiency, improve the traffic tracking comprehensiveness and accuracy, and can be widely applied to the technical field of network services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network service technology, and in particular to a traffic tracking method, device, electronic device and storage medium. Background Art

[0002] At present, under the unitized architecture, the existing traffic tracking solutions often adopt the method of recording relevant call link information, service status information and other logs at each end node, using TraceId and SpanId to connect the entire call chain in series, and then collect them through log aggregation analysis or message queues and enter the analysis system node for analysis, and finally obtain the traffic tracking information. The existing traffic tracking solutions have problems such as code intrusion, no support for tracking of multiple languages ​​and multiple transmission protocols, and difficulty in tracking under cross-thread conditions, resulting in low efficiency and accuracy of traffic tracking. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to propose a traffic tracking method, device, electronic device and storage medium, which can realize traffic tracking and improve the efficiency and accuracy of traffic tracking.

[0004] On the one hand, an embodiment of the present application provides a traffic tracking method, the method comprising the following steps:

[0005] Get the service call request data packet;

[0006] Generate a corresponding flow tracking identifier according to the service call request data packet, and add the flow tracking identifier to the service call request data packet;

[0007] The traffic tracking identifier is used to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

[0008] In some embodiments, the method further comprises:

[0009] Performing application layer protocol analysis on the service call request data packet to determine flow detection and analysis data;

[0010] The service call result information is obtained from the traffic detection and analysis data, and it is determined whether a service call abnormality occurs according to the service call result information.

[0011] In some embodiments, generating a corresponding flow tracking identifier according to the service call request data packet and adding the flow tracking identifier to the service call request data packet specifically includes:

[0012] Get the preset traffic tracking identifier format;

[0013] Perform kernel layer transmission protocol analysis on the service call request data packet to determine the corresponding service call request information;

[0014] The corresponding traffic tracking identifier is generated according to the service call request information and the traffic tracking identifier format, and the traffic tracking identifier is added to the service call request data packet.

[0015] In some embodiments, the using of the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate the corresponding traffic tracking information specifically includes:

[0016] Monitor several routing forwarding services corresponding to the service call request data packet;

[0017] For each of the routing forwarding services, performing kernel layer transmission protocol analysis on the service call request data packet to determine current service call request information corresponding to the service call request data packet in the current routing forwarding service;

[0018] The traffic tracking identifier is updated according to the current service call request information and the traffic tracking identifier format, and before executing the current routing forwarding service, the updated traffic tracking identifier is added to the service call request data packet.

[0019] In some embodiments, obtaining service call result information from the traffic detection and analysis data, and determining whether a service call abnormality occurs according to the service call result information specifically includes:

[0020] Get multiple preset service call exception result codes;

[0021] Determine the corresponding service call result code according to the service call result information;

[0022] Determining whether there is a target service call exception result code matching the service call result code from the plurality of service call exception result codes;

[0023] When there is a target service call exception result code that matches the service call result code, the corresponding target service call exception information is determined according to the target service call exception result code.

[0024] In some embodiments, generating the corresponding traffic tracking identifier according to the service call request information and the traffic tracking identifier format, and adding the traffic tracking identifier to the service call request data packet specifically includes:

[0025] Determine the corresponding unit service division information and service call request identification information according to the service call request information, wherein the unit service division information at least includes a current service call request timestamp, a service call unit code and a unit call service domain name, and the service call request identification information at least includes a current service call request sequence number corresponding to the service call request data packet;

[0026] According to the flow tracking identifier format, the unit service division information and the service call request identifier information are used to fill in information and generate the corresponding flow tracking identifier.

[0027] In some embodiments, for each of the routing forwarding services, performing kernel layer transport protocol parsing on the service call request data packet to determine the current service call request information corresponding to the service call request data packet in the current routing forwarding service specifically includes:

[0028] Perform kernel layer transport protocol parsing on the service call request data packet, obtain the previous flow tracking identifier and current time, and determine the current service call unit code and the current unit call service domain name;

[0029] Determine the last service call request sequence number according to the last traffic tracking identifier, and perform self-increment according to the last service call request sequence number to determine the corresponding current service call request sequence number;

[0030] The current time is obtained as a timestamp of a current service call request, and the current service call request information is determined according to the current service call unit code, the current unit call service domain name, the current service call request sequence number and the current service call request timestamp.

[0031] On the other hand, an embodiment of the present application provides a flow tracking device, the device comprising:

[0032] The first module is used to obtain a service call request data packet;

[0033] The second module is used to generate a corresponding flow tracking identifier according to the service call request data packet, and add the flow tracking identifier to the service call request data packet;

[0034] The third module is used to use the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

[0035] On the other hand, an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned traffic tracking method when executing the computer program.

[0036] On the other hand, an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the traffic tracking method described above is implemented.

[0037] The embodiments of the present application include at least the following beneficial effects: The present application provides a flow tracking method, device, electronic device and storage medium, which obtains a service call request data packet, generates a corresponding flow tracking identifier according to the service call request data packet, adds the flow tracking identifier to the service call request data packet, and uses the flow tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding flow tracking information. The present application can realize flow tracking, solve the problems of not supporting tracking of multiple languages ​​and multiple transmission protocols, and difficulty in tracking in cross-thread situations, improve the efficiency of flow tracking, and improve the comprehensiveness and accuracy of flow tracking. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] In order to more clearly illustrate the embodiments of the present invention 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.

[0040] Figure 1 is a flow chart of a traffic tracking method provided by an embodiment of the present application;

[0041] Figure 2 It is a structural diagram of the unitized architecture in an embodiment of the present application;

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

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

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

[0045] Figure 6 is a flowchart of step S302 in an embodiment of the present application;

[0046] Figure 7 is another flow chart of a traffic tracking method provided by an embodiment of the present application;

[0047] Figure 8 is a flowchart of step S602 in an embodiment of the present application;

[0048] Fig. 9 It is a structural schematic diagram of a flow tracking device provided in an embodiment of the present application;

[0049] Fig.10 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0051] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0052] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0054] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0055] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0056] 1) Unitized architecture: Unitized architecture comes from the field of parallel computing and is applied to the field of distributed service design. Unitization refers to the process of transforming a service design to conform to unit characteristics. Each unit satisfies all business operations of a partition.

[0057] 2) Traffic tracing: Traffic tracing generally includes two aspects: call chain tracing and traffic direction tracing. Existing call chain tracing solutions often use TraceId and SpanId to mark the entire link; the traffic direction records relevant node information through service domain names and other methods.

[0058] 3) eBPF (extended Berkeley Packet Filter): It is a virtual machine technology running on the Linux kernel, which can extend the kernel function to realize network data packet monitoring, performance statistics and other functions.

[0059] Under the unitized architecture, the existing microservice traffic tracking solutions often adopt the method of recording relevant call link information, service status information and other logs at each end node, using TraceId and SpanId to connect the entire call chain, and then collect them through log aggregation analysis or message queues, etc., and enter the analysis system node for analysis, and finally obtain the traffic tracking information. Some microservice traffic tracking solutions use bytecode enhancement technology to achieve zero intrusion on business applications, but this solution requires the deployment of agents for tracking services for data collection. In the case of different development languages, agents of corresponding languages ​​need to be written. Specifically, for example, the SkyWalking open source project of the OpenTracing standard needs to deploy java agents in java language projects, and the same is true for other development languages. In addition, there are other microservice traffic tracking solutions that use eBPF technology to match kernel layer data packets according to regular expressions and other methods, and perform traffic detection according to matching results. This solution uses the Linux kernel to complete data packet processing, which has the characteristics of fast, convenient and imperceptible, but because it can only parse the transport layer protocol, it is difficult to associate the previous and next traffic data packets under the demand of traffic tracking, and it is also impossible to obtain enough business data.

[0060] Based on this, the embodiments of the present application propose a traffic tracking method, device, electronic device and storage medium, which can introduce eBPF to implement traffic tracking based on the unitized architecture. Specifically, a traceable unique ID is generated by dividing the unit gateway nodes, and the kernel layer transmission protocol is parsed and distinguished through eBPF code, and the information is passed to the user state for application layer protocol parsing. When processing service call request data packets, especially cross-thread service calls, the unique ID is passed into the service call request data packet by parsing the application layer protocol to associate the data packets, thereby realizing full-process traffic tracking of different protocols.

[0061] Reference Figure 1 , Figure 1 This is an optional flow chart of a traffic tracking method provided in an embodiment of the present application. The method may include but is not limited to steps S101 to S103:

[0062] Step S101, obtaining a service call request data packet;

[0063] Step S102, generating a corresponding flow tracking identifier according to the service call request data packet, and adding the flow tracking identifier to the service call request data packet;

[0064] Step S103: Use the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

[0065] In some embodiments, under a unitized architecture, there are service call units such as a microservice gateway and multiple unit gateway nodes. The unit service division information and service call request identification information corresponding to the service call request data packet are associated with the generation of a unique ID (such as the above-mentioned traffic tracking identifier), and the unique ID is used to implement traffic tracking of the service call request data packet. Optionally, the unique ID is TraceId.

[0066] In some embodiments, reference Figure 2 , Figure 2 It is an optional structural diagram of the unitized architecture in the embodiment of the present application, which includes a microservice gateway, an upstream unit and unit gateway nodes 1 to N. The service call request data packet is obtained from the upstream unit (including various applications, etc.) through the microservice gateway, and then the service call request data packet is processed by the built-in eBPF unit in the microservice gateway, a traffic tracking identifier is generated and traffic detection and analysis data is obtained, and finally the service call request data packet with the traffic tracking identifier is transmitted to the corresponding unit gateway node to perform a service call, and the call link is determined according to the traffic tracking identifier to realize traffic tracking.

[0067] In some embodiments, reference Figure 3 , Figure 3 This is an optional flowchart of step S102 in the embodiment of the present application. Step S102 may include but is not limited to steps S201 to S203:

[0068] Step S201, obtaining a preset flow tracking identification format;

[0069] Step S202, performing kernel layer transport protocol analysis on the service call request data packet to determine the corresponding service call request information;

[0070] Step S203: Generate a corresponding traffic tracking identifier according to the service call request information and the traffic tracking identifier format, and add the traffic tracking identifier into the service call request data packet.

[0071] In some embodiments, the traffic tracking identifier format is: random string + timestamp + service call unit code + unit call service domain name + service call request sequence number. After completing a complete service call according to the service call request data packet, the complete call link is obtained according to the random string sorting in the traffic tracking identifier, and the call time corresponding to the service call request data packet can be determined according to the timestamp. The unit gateway node currently called by the service call request data packet is determined according to the service call unit code. The current call service information of the unit gateway node is determined according to the unit call service domain name. The service call request sequence number is used to confirm that the current service call request data packet is in the order of routing forwarding, thereby achieving the purpose of traffic tracking through traffic tracking identifiers.

[0072] In some embodiments, reference Figure 4 , Figure 4 This is an optional flowchart of step S103 in the embodiment of the present application. Step S103 may include but is not limited to steps S301 to S303:

[0073] Step S301, monitoring service calls request data packets corresponding to a number of routing forwarding services;

[0074] Step S302, for each routing forwarding service, performing kernel layer transmission protocol analysis on the service call request data packet to determine the current service call request information corresponding to the service call request data packet in the current routing forwarding service;

[0075] Step S303, updating the traffic tracking identifier according to the current service call request information and the traffic tracking identifier format, and adding the updated traffic tracking identifier into the service call request data packet before executing the current routing forwarding service.

[0076] In some embodiments, reference Figure 5 , Figure 5 This is an optional flowchart of step S203 in the embodiment of the present application. Step S203 may include but is not limited to steps S401 to S402:

[0077] Step S401, determining corresponding unit service division information and service call request identification information according to the service call request information, wherein the unit service division information at least includes a current service call request timestamp, a service call unit code and a unit call service domain name, and the service call request identification information at least includes a current service call request sequence number corresponding to the service call request data packet;

[0078] Step S402, according to the flow tracking identifier format, using the unit service division information and the service call request identifier information, fill in the information to generate a corresponding flow tracking identifier.

[0079] In some embodiments, reference Figure 6 , Figure 6 This is an optional flowchart of step S302 in the embodiment of the present application. Step S302 may include but is not limited to steps S501 to S503:

[0080] Step S501, performing kernel layer transport protocol analysis on the service call request data packet, obtaining the previous flow tracking identifier and the current time, and determining the current service call unit code and the current unit call service domain name;

[0081] Step S502, determining the last service call request sequence number according to the last traffic tracking identifier, and performing self-increment according to the last service call request sequence number to determine the corresponding current service call request sequence number;

[0082] Step S503, obtaining the current time as the current service call request timestamp, and determining the current service call request information according to the current service call unit code, the current unit call service domain name, the current service call request sequence number and the current service call request timestamp.

[0083] In some embodiments, the service call request data packet is parsed by the eBPF system through the kernel layer transport protocol to determine the current service call request information, and then the traffic tracking identifier corresponding to the current routing forwarding service is updated according to the current service call request information and the traffic tracking identifier format.

[0084] Exemplarily, the kernel layer transport protocol of the service call request data packet is identified through the eBPF system. The service call request data packet can be a TCP packet, a UDP packet or a custom protocol packet, etc. Assuming that the service call request data packet is a TCP packet, the current service call request information corresponding to the TCP packet is output through the eBPF system, including: source port number, destination port number, sequence number, confirmation number, data offset, reservation, control bit: including URG, ACK, PSH, RST, SYN, FIN, etc., used to control the sending and receiving of message segments, window size: 16 bits, used for flow control, check: 16 bits, verifying data integrity and urgent pointer, etc., according to the current service call request information, determine the target unit gateway node that the service call request data packet is about to call and the call service to be executed by the target unit gateway node from multiple unit gateway nodes, and according to the call service to be executed by the target unit gateway node , determine the target unit calling service domain name, determine the target service calling unit code according to the target unit gateway node, obtain the time of current identification completion as the current service calling request timestamp, generate the current random string corresponding to the target unit gateway node through the eBPF system, obtain the most recently generated traffic tracking identifier in the service calling request data packet, determine the previous service calling request sequence number, increment the previous service calling request sequence number, and obtain the current service calling request sequence number. According to the above-mentioned traffic tracking identifier format, use the target unit calling service domain name, the current service calling request timestamp, the target service calling unit code, the current service calling request sequence number and the current random string to update the traffic tracking identifier information, generate a new traffic tracking identifier, add the newly generated traffic tracking identifier to the service calling request data packet, and then pass the service calling request data packet from the kernel layer to the user layer.

[0085] In some embodiments, reference Figure 7 , Figure 7 This is another optional flow chart of a traffic tracing method provided in an embodiment of the present application. The traffic tracing method may also include but is not limited to steps S601 to S602:

[0086] Step S601, performing application layer protocol analysis on the service call request data packet to determine flow detection analysis data;

[0087] Step S602, obtaining service call result information from the traffic detection and analysis data, and determining whether a service call abnormality occurs based on the service call result information.

[0088] In some embodiments, the service call request data packet is parsed at the user layer through the eBPF system. Specifically, the service call data packet is parsed at the application layer protocol to obtain corresponding traffic detection and analysis data. For example, the http protocol, grpc protocol, rpcx protocol, etc. are application layer protocols based on the TCP protocol, and the RTP protocol, QUIC protocol, etc. are application layer protocols based on the UDP protocol. After the eBPF system transfers the TCP packet from the kernel layer to the user layer, for the http protocol corresponding to the TCP packet in the application layer, the eBPF system completes the application layer protocol parsing at the user layer through keyword matching such as the http version number, and then obtains the application protocol packet information including the request method, url, request header, request body, response header, system status code, business result code, response status code, etc., obtains the application protocol packet information as traffic detection and analysis data, and then sends the above-mentioned traffic detection and analysis data to the microservice gateway or the unit gateway node, and cooperates with each other to perform traffic detection and analysis.

[0089] In some embodiments, reference Figure 8 , Figure 8 This is an optional flowchart of step S602 in the embodiment of the present application. Step S602 may include but is not limited to steps S701 to S704:

[0090] Step S701, obtaining multiple preset service call exception result codes;

[0091] Step S702, determining the corresponding service call result code according to the service call result information;

[0092] Step S703, determining whether there is a target service call exception result code that matches the service call result code from the multiple service call exception result codes;

[0093] Step S704: when there is a target service call exception result code that matches the service call result code, determine the corresponding target service call exception information according to the target service call exception result code.

[0094] In some embodiments, traffic detection and analysis is completed through a microservice gateway or a unit network node. Specifically, the response status code in the traffic detection and analysis data and the system response code 404 / 500 / 502 / 504 in the http protocol are analyzed to determine whether there are service response exceptions, etc., and the business result code in the traffic detection and analysis data is analyzed. By distinguishing the result codes for abnormal business situations, multiple service call exception result codes are determined. For example, the service call exception result code corresponding to the database exception is 11021, and the service call exception result code for query failure is 12001, etc., and it is determined from the multiple service call exception result codes whether there is a target service call exception result code corresponding to the business result code. Assuming that the business result code is 11021, which is consistent with the service call exception result code corresponding to the database exception, the service call exception result code corresponding to the database exception is obtained as the target service call exception result code, and then the target service call exception information of the database exception is output, thereby realizing traffic detection and analysis.

[0095] Reference Fig. 9 , Fig. 9 : is an optional structural diagram of a traffic tracking device provided in an embodiment of the present application. The device can be used to implement the above-mentioned traffic tracking method. The device may include:

[0096] The first module is used to obtain a service call request data packet;

[0097] The second module is used to generate a corresponding flow tracking identifier according to the service call request data packet, and add the flow tracking identifier to the service call request data packet;

[0098] The third module is used to use the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

[0099] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0100] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned traffic tracking method when executing the computer program. The electronic device can be any smart terminal including a tablet computer.

[0101] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0102] See also Fig.10 , Fig.10 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0103] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0104] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the traffic tracking method of the embodiment of this application;

[0105] Input / output interface 903, used to implement information input and output;

[0106] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0107] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0108] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0109] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned traffic tracking method is implemented.

[0110] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0111] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0112] The embodiments of the present application provide a flow tracking method, device, electronic device and storage medium, which obtains a service call request data packet, generates a corresponding flow tracking identifier according to the service call request data packet, adds the flow tracking identifier to the service call request data packet, and uses the flow tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding flow tracking information. The embodiments of the present application can realize flow tracking, solve the problems of not supporting the tracking of multiple languages ​​and multiple transmission protocols, and the difficulty of tracking in cross-thread situations, improve the efficiency of flow tracking, and improve the comprehensiveness and accuracy of flow tracking.

[0113] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0114] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0115] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0116] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0117] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0118] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0119] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0122] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0124] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A traffic tracking method, characterized in that: The method comprises the following steps: Get the service call request data packet; Generate a corresponding flow tracking identifier according to the service call request data packet, and add the flow tracking identifier to the service call request data packet; The traffic tracking identifier is used to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

2. The flow tracking method according to claim 1, characterized in that: The method further comprises: Performing application layer protocol analysis on the service call request data packet to determine flow detection and analysis data; The service call result information is obtained from the traffic detection and analysis data, and it is determined whether a service call abnormality occurs according to the service call result information.

3. The flow tracking method according to claim 1, characterized in that: The step of generating a corresponding flow tracking identifier according to the service call request data packet and adding the flow tracking identifier to the service call request data packet specifically includes: Get the preset traffic tracking identifier format; Perform kernel layer transmission protocol analysis on the service call request data packet to determine the corresponding service call request information; The corresponding traffic tracking identifier is generated according to the service call request information and the traffic tracking identifier format, and the traffic tracking identifier is added to the service call request data packet.

4. The flow tracking method according to claim 3, characterized in that: The using the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate the corresponding traffic tracking information specifically includes: Monitor several routing forwarding services corresponding to the service call request data packet; For each of the routing forwarding services, performing kernel layer transmission protocol analysis on the service call request data packet to determine current service call request information corresponding to the service call request data packet in the current routing forwarding service; The traffic tracking identifier is updated according to the current service call request information and the traffic tracking identifier format, and before executing the current routing forwarding service, the updated traffic tracking identifier is added to the service call request data packet.

5. The flow tracking method according to claim 2, characterized in that: The obtaining of service call result information from the traffic detection and analysis data, and determining whether a service call abnormality occurs according to the service call result information, specifically includes: Get multiple preset service call exception result codes; Determine the corresponding service call result code according to the service call result information; Determining whether there is a target service call exception result code matching the service call result code from the plurality of service call exception result codes; When there is a target service call exception result code that matches the service call result code, the corresponding target service call exception information is determined according to the target service call exception result code.

6. The flow tracking method according to claim 3, characterized in that: The step of generating the corresponding traffic tracking identifier according to the service call request information and the traffic tracking identifier format, and adding the traffic tracking identifier to the service call request data packet specifically includes: Determine the corresponding unit service division information and service call request identification information according to the service call request information, wherein the unit service division information at least includes a current service call request timestamp, a service call unit code and a unit call service domain name, and the service call request identification information at least includes a current service call request sequence number corresponding to the service call request data packet; According to the flow tracking identifier format, the unit service division information and the service call request identifier information are used to fill in information and generate the corresponding flow tracking identifier.

7. The flow tracking method according to claim 4, characterized in that: For each of the routing forwarding services, performing kernel layer transmission protocol parsing on the service call request data packet to determine the current service call request information corresponding to the service call request data packet in the current routing forwarding service specifically includes: Perform kernel layer transport protocol parsing on the service call request data packet, obtain the previous flow tracking identifier and current time, and determine the current service call unit code and the current unit call service domain name; Determine the last service call request sequence number according to the last traffic tracking identifier, and perform self-increment according to the last service call request sequence number to determine the corresponding current service call request sequence number; The current time is obtained as a timestamp of a current service call request, and the current service call request information is determined according to the current service call unit code, the current unit call service domain name, the current service call request sequence number and the current service call request timestamp.

8. A flow tracking device, characterized in that: The device comprises: The first module is used to obtain a service call request data packet; The second module is used to generate a corresponding flow tracking identifier according to the service call request data packet, and add the flow tracking identifier to the service call request data packet; The third module is used to use the traffic tracking identifier to associate the service call information corresponding to the service call request data packet to generate corresponding traffic tracking information.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the traffic tracking method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the traffic tracking method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Micro-service link monitoring and tracking method and system

    CN114172949A

  • Link tracking method and system based on Socket communication protocol

    CN115314542A

  • Data tracking method and electronic equipment

    CN115562901A

  • Processing method, device and system for calling link, electronic equipment and storage medium

    CN115567607A

  • Link tracking method, device and system and storage medium

    CN116360931A

Cited By

  • Calling tracking method based on micro-service architecture and related equipment

    CN121012863A