Packet tracking method and device, computer device and storage medium

By generating and adding message identifiers to the tracking file in the message, the problem of inaccurate tracking of large-scale packet loss in existing technologies is solved, and accurate packet loss detection in complex scenarios is achieved.

CN119561870BActive Publication Date: 2026-02-10CHINA TELECOM CLOUD TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411760829.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2026-02-10
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

Existing packet loss detection methods cannot accurately track packet loss when there is large-scale packet loss and the causes are complex.

Method used

After determining whether the message to be processed has a tracking tag and meeting the conditions of matching the preset service type and encapsulation layer information, a message identifier is generated and added to the tracking file. The tracking file is then displayed to determine the packet loss situation.

Benefits of technology

It enables accurate tracking of packet loss in complex packet loss scenarios, improving the accuracy of packet loss detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561870B_ABST
    Figure CN119561870B_ABST
Patent Text Reader

Abstract

The application relates to a message tracking method and device, computer equipment and a storage medium. The method comprises the following steps: determining whether a to-be-processed message has a tracking mark; in the case that the to-be-processed message has the tracking mark, determining whether the to-be-processed message meets a tracking condition; the tracking condition is met when the to-be-processed message belongs to a preset business type; in the case that the to-be-processed message meets the tracking condition, determining a message identifier of the to-be-processed message; adding the message identifier into a tracking file, and displaying the tracking file; the tracking file is used for determining a packet loss condition of the to-be-processed message. The packet loss condition of the to-be-processed message can be accurately determined through the tracking file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a message tracing method, apparatus, computer device, and storage medium. Background Technology

[0002] Currently, high-performance, low-latency network applications are increasingly using open-source components, and business operations are becoming more complex. During packet forwarding, packets may need to be dropped due to various reasons such as packet parsing errors, user rate limiting, or the lack of a healthy backend.

[0003] Traditional techniques typically use packet loss counting or logging to detect packet loss. While these methods can identify packet loss, they are inaccurate in scenarios with large amounts of packet loss and multiple causes of loss. Summary of the Invention

[0004] Therefore, it is necessary to provide a message tracing method, apparatus, computer equipment, and storage medium that can accurately perform packet loss tracing to address the aforementioned technical problems.

[0005] Firstly, this application provides a message tracing method, including:

[0006] Determine if the message to be processed contains a tracking tag;

[0007] If a message to be processed has a tracking mark, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0008] If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed;

[0009] Add the message identifier to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0010] In one embodiment, the number of messages to be processed is at least one; determining whether a message to be processed has a tracking tag includes:

[0011] For each encapsulation layer of the message to be processed, determine whether there is a tracking marker in the memory buffer under the encapsulation layer;

[0012] If a tracking marker exists in the memory buffer, determine whether the memory buffer meets the tracking conditions. Meeting the tracking conditions also includes that the encapsulation layer information of the encapsulation layer to which the memory buffer belongs matches the preset encapsulation layer information. The preset encapsulation layer information includes at least one of the encapsulation layer's address information, port information, and protocol type.

[0013] If the tracking flag in the memory buffer meets the tracking conditions, determine whether a tracking flag exists for each message to be processed in the memory buffer.

[0014] In one embodiment, determining the message identifier of the message to be processed includes:

[0015] During the forwarding process of the pending message through the forwarding core, the forwarding time of the pending message and the auto-incrementing identifier of the forwarding core are obtained.

[0016] The message identifier of the message to be processed is generated based on the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

[0017] In one embodiment, the trace file includes an identifier trace file; adding a message identifier to the trace file includes:

[0018] Add the message identifier to the identifier tracking file;

[0019] The identification tracking file is used to determine the packet loss time and forwarding core of pending messages.

[0020] In one embodiment, the trace file further includes a function trace file; the method also includes:

[0021] During the forwarding process of the pending message through the forwarding core, determine the calling function triggered by the pending message;

[0022] Determine the call stack information corresponding to the called function;

[0023] Accordingly, message identifiers are added to the trace file, including:

[0024] Add message identifiers and call stack information to the function trace file;

[0025] The function trace file is used to determine the function calls triggered when a packet is lost.

[0026] In one embodiment, the method further includes:

[0027] If a message to be processed does not meet the tracking conditions, delete the tracking mark of the message to be processed.

[0028] If the tracking conditions are not met in the memory buffer, delete the tracking marker in the memory buffer, as well as the tracking markers of all pending messages in the memory buffer.

[0029] Secondly, this application also provides a message tracking device, comprising:

[0030] The tag detection module is used to determine whether a tracking tag exists in the message to be processed;

[0031] The condition matching module is used to determine whether a message to be processed meets the tracking conditions when a tracking mark exists in the message to be processed; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0032] The identifier determination module is used to determine the message identifier of the message to be processed when the message to be processed meets the tracking conditions.

[0033] The file display module is used to add message identifiers to the trace file and display the trace file; the trace file is used to determine the packet loss status of the messages to be processed.

[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0035] Determine if the message to be processed contains a tracking tag;

[0036] If a message to be processed has a tracking mark, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0037] If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed;

[0038] Add the message identifier to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0039] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0040] Determine if the message to be processed contains a tracking tag;

[0041] If a message to be processed has a tracking mark, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0042] If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed;

[0043] Add the message identifier to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0044] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0045] Determine if the message to be processed contains a tracking tag;

[0046] If a message to be processed has a tracking mark, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0047] If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed;

[0048] Add the message identifier to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0049] The aforementioned message tracing method, apparatus, computer equipment, and storage medium determine whether a message to be processed has a tracing mark; if a message to be processed has a tracing mark, determine whether the message to be processed meets tracing conditions; meeting tracing conditions includes the message to be processed belonging to a preset service type; if the message to be processed meets the tracing conditions, determine the message identifier of the message to be processed; add the message identifier to a tracing file and display the tracing file; the tracing file is used to determine the packet loss status of the message to be processed. This embodiment adds the message identifier of the message to be processed to a tracing file for tracing, and accurately determines the packet loss status of the message to be processed through the tracing file. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 This is an application environment diagram of a message tracing method provided in this embodiment;

[0052] Figure 2 This is a flowchart illustrating the first message tracing method provided in this embodiment;

[0053] Figure 3 This is a flowchart illustrating the second message tracing method provided in this embodiment;

[0054] Figure 4 This is a structural block diagram of a message tracking device provided in this embodiment;

[0055] Figure 5 This is an internal structure diagram of the first type of computer device provided in this embodiment;

[0056] Figure 6This is an internal structural diagram of the second type of computer device provided in this embodiment. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0058] The message tracing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The computer device determines whether a message to be processed has a tracking mark; if a tracking mark exists, it determines whether the message meets tracking conditions; meeting tracking conditions includes the message belonging to a preset service type; if the message meets tracking conditions, it determines the message identifier; it adds the message identifier to a tracking file and displays the tracking file; the tracking file is used to determine packet loss of the message. The computer device can be either a terminal or a server. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0059] In one exemplary embodiment, such as Figure 2 As shown, a message tracing method is provided, which can be applied to... Figure 1 The following steps, 201 to 204, are used as an example of computer equipment.

[0060] Step 201: Determine whether the message to be processed has a tracking tag.

[0061] The number of messages to be processed is at least one.

[0062] In one embodiment, the computer device can determine whether a tracking tag exists in each message to be processed.

[0063] In another embodiment, for each encapsulation layer of the message to be processed, it is determined whether there is a tracking mark in the memory buffer under the encapsulation layer; if there is a tracking mark in the memory buffer, it is determined whether the memory buffer meets the tracking conditions; if the tracking mark in the memory buffer meets the tracking conditions, for each message to be processed in the memory buffer, it is determined whether there is a tracking mark in the message to be processed.

[0064] The encapsulation layer can be an inner layer, a generic layer, or an outer layer. Tracing conditions can include preset encapsulation layer information and the fact that the service to be processed belongs to at least one of preset service types. Preset encapsulation layer information includes at least one of the following: address information, port information, and protocol type, such as an Internet Protocol (IP) address. Meeting the tracing conditions also requires that the encapsulation layer information of the memory buffer matches the preset encapsulation layer information.

[0065] Specifically, for each encapsulation layer of the message to be processed, it is determined whether there is a tracking mark in the memory buffer (mbuf) under the encapsulation layer, such as checking before calling rte_pktmbuf_free to actually release mbuf; if there is no tracking mark, it proves that there is no need to track the memory buffer; if there is a tracking mark in the memory buffer, it is determined whether the memory buffer meets the tracking conditions; if the memory buffer does not meet the tracking conditions, the tracking mark in the memory buffer, as well as the tracking marks of all messages to be processed in the memory buffer, are deleted; if the tracking mark in the memory buffer meets the tracking conditions, for each message to be processed in the memory buffer, it is determined whether there is a tracking mark in the message to be processed.

[0066] It should be noted that when the computer device’s tracing capability is enabled, each forwarding core initializes independent tracing conditions and initializes and opens its own tracing file.

[0067] Step 202: If a tracking mark exists in the message to be processed, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type.

[0068] Specifically, when a tracking mark exists on a message to be processed, the computer device determines whether the service type of the service described in the message to be processed meets a preset service type. If it does, the message to be processed is determined to meet the tracking conditions; if it does not, the message to be processed is determined not to meet the tracking conditions, and the tracking mark on the message to be processed is deleted.

[0069] Step 203: If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed.

[0070] In one embodiment, when a message to be processed meets the tracking conditions, the computer device determines the message identifier of the message to be processed based on the file description information of the message to be processed.

[0071] In another embodiment, during the forwarding of a message to be processed through a forwarding core, the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core are obtained; and a message identifier of the message to be processed is generated based on the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

[0072] For example, during the forwarding of a message to be processed through a forwarding core, the forwarding time of the message to be processed (such as a system timestamp accurate to the second) and the auto-incrementing identifier of the forwarding core are obtained. The forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core are concatenated, and the concatenated result is used as the message identifier of the message to be processed. The auto-incrementing identifier ranges from 0 to 999999. When the auto-incrementing identifier exceeds 999999, it is reset to 0 and continues to increment. This auto-incrementing identifier can be used as the microsecond portion of the forwarding time. For example, if the system timestamp of the message to be processed is 1714974588 and the auto-incrementing identifier is 000094, then the message identifier of the message to be processed is determined to be 1714974588.000094.

[0073] Step 204: Add the message identifier to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0074] The trace files include an identifier trace file and a function trace file. The identifier trace file is used to determine the packet loss time and forwarding kernel of the packet to be processed. The function trace file is used to determine the function call triggered when the packet to be processed is lost.

[0075] In one embodiment, a message identifier is added to a trace file, which is then displayed on a computer device to facilitate the determination of packet loss of the message to be processed.

[0076] In another embodiment, a message identifier is added to an identifier tracking file. For example, if the message identifier of the message to be processed is 1714974588.000094, the message identifier is added to the identifier tracking file. This embodiment can accurately track lost messages to be processed through the identifier tracking file.

[0077] The aforementioned message tracing method determines whether a message to be processed has a tracing marker; if a message to be processed has a tracing marker, it determines whether the message to be processed meets tracing conditions; meeting tracing conditions includes the message to be processed belonging to a preset service type; if the message to be processed meets the tracing conditions, it determines the message identifier of the message to be processed; it adds the message identifier to the tracing file and displays the tracing file; the tracing file is used to determine the packet loss status of the message to be processed. This implementation adds the message identifier of the message to be processed to the tracing file for tracing, and accurately determines the packet loss status of the message to be processed through the tracing file.

[0078] In one embodiment, the trace file further includes a function trace file; the method further includes: determining the function call triggered by the message to be processed during the message forwarding process through the forwarding kernel; determining the call stack information of the call stack corresponding to the call function; and adding the message identifier and call stack information to the function trace file.

[0079] Specifically, during the forwarding process of a message to be processed through the forwarding core, the function call triggered by the message is determined, the call stack information of the function being pushed onto the call stack is determined, and the message identifier and call stack information are concatenated. The concatenated result is then added to the function trace file. For example, in the function trace file, the message identifier of the message to be processed is 1714974588.000094, and the content after the message identifier is the function call.

[0080] This embodiment can accurately trace the called function when a packet is lost by using a function tracing file.

[0081] In one exemplary embodiment, such as Figure 3 As shown, a message tracing method is provided, which can be applied to... Figure 1 The following steps are used as an example of computer equipment, including steps 301 to 309:

[0082] Step 301: For each encapsulation layer of the message to be processed, determine whether there is a tracking mark in the memory buffer under the encapsulation layer.

[0083] Step 302: If a tracking mark exists in the memory buffer, determine whether the memory buffer meets the tracking conditions; meeting the tracking conditions also includes that the encapsulation layer information of the encapsulation layer to which the memory buffer belongs matches the preset encapsulation layer information; the preset encapsulation layer information includes at least one of the encapsulation layer's address information, port information, and protocol type.

[0084] Step 303: If the tracking mark in the memory buffer meets the tracking conditions, determine whether there is a tracking mark for each message to be processed in the memory buffer.

[0085] Step 304: If a tracking mark exists in the message to be processed, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes the message to be processed belonging to a preset service type.

[0086] Step 305: If the message to be processed meets the tracking conditions, during the process of forwarding the message to be processed through the forwarding core, obtain the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

[0087] Step 306: Generate the message identifier of the message to be processed based on the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

[0088] Step 307: During the forwarding process of the message to be processed through the forwarding core, determine the calling function triggered by the message to be processed.

[0089] Step 308: Determine the call stack information of the call stack corresponding to the called function.

[0090] Step 309: Add the message identifier to the identifier tracing file, and add the message identifier and call stack information to the function tracing file; the identifier tracing file is used to determine the packet loss time and forwarding kernel of the message to be processed; the function tracing file is used to determine the calling function triggered when the message to be processed is lost.

[0091] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0092] Based on the same inventive concept, this application also provides a message tracing apparatus for implementing the message tracing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more message tracing apparatus embodiments provided below can be found in the limitations of the message tracing method described above, and will not be repeated here.

[0093] In one exemplary embodiment, such as Figure 4As shown, a message tracking device is provided, including: a marker detection module 10, a condition matching module 11, an identifier determination module 12, and a file display module 13, wherein:

[0094] The tag detection module 10 is used to determine whether a tracking tag exists in the message to be processed;

[0095] The condition matching module 11 is used to determine whether the message to be processed meets the tracking conditions when there is a tracking mark in the message to be processed; meeting the tracking conditions includes the message to be processed belonging to a preset service type;

[0096] The identifier determination module 12 is used to determine the message identifier of the message to be processed when the message to be processed meets the tracking conditions;

[0097] The file display module 13 is used to add message identifiers to the trace file and display the trace file; the trace file is used to determine the packet loss status of the message to be processed.

[0098] In one embodiment, the tag detection module 10 is further configured to determine whether a tracking tag exists in the memory buffer under each encapsulation layer of the message to be processed; if a tracking tag exists in the memory buffer, determine whether the memory buffer meets the tracking conditions; meeting the tracking conditions also includes the encapsulation layer information of the encapsulation layer to which the memory buffer belongs matching the preset encapsulation layer information; the preset encapsulation layer information includes at least one of the address information, port information and protocol type of the encapsulation layer; if the tracking tag in the memory buffer meets the tracking conditions, determine whether a tracking tag exists in each message to be processed in the memory buffer.

[0099] In one embodiment, the identifier determination module 12 is further configured to determine the message identifier of the message to be processed, including: obtaining the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core during the process of the message to be processed being forwarded through the forwarding core; and generating the message identifier of the message to be processed based on the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

[0100] In one embodiment, the file display module 13 is further configured to track files including an identification tracking file; adding a message identifier to the tracking file includes: adding the message identifier to the identification tracking file; the identification tracking file is used to determine the packet loss time and forwarding core of the message to be processed.

[0101] In one embodiment, the packet tracing device is further configured to trace a function tracing file; the method further includes: determining the calling function triggered by the packet to be processed during the packet forwarding process through the forwarding kernel; determining the call stack information of the call stack corresponding to the calling function; and correspondingly adding the packet identifier to the tracing file, including: adding the packet identifier and the call stack information to the function tracing file; the function tracing file is used to determine the calling function triggered when the packet to be processed is lost.

[0102] In one embodiment, the message tracking device is further used in a method that includes: deleting the tracking mark of the message to be processed if the message to be processed does not meet the tracking conditions; and deleting the tracking mark of the memory buffer and the tracking marks of all messages to be processed in the memory buffer if the memory buffer does not meet the tracking conditions.

[0103] Each module in the aforementioned message tracking device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0104] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a message tracing method.

[0105] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a message tracing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0106] Those skilled in the art will understand that Figure 5 and Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0107] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0108] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0109] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0110] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0111] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0112] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0113] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A message tracing method, characterized in that, The method includes: For each encapsulation layer of each message to be processed, determine whether a tracking flag exists in the memory buffer under that encapsulation layer; the number of messages to be processed is at least one. If a tracking marker exists in the memory buffer, it is determined whether the memory buffer meets the tracking conditions; the meeting of the tracking conditions also includes the memory buffer's encapsulation layer information matching preset encapsulation layer information; the preset encapsulation layer information includes at least one of the encapsulation layer's address information, port information, and protocol type; If the tracking flag in the memory buffer meets the tracking conditions, for each message to be processed in the memory buffer, determine whether the message to be processed has a tracking flag; If the pending message has a tracking mark, determine whether the pending message meets the tracking conditions; the tracking conditions include that the service to which the pending message belongs belongs to a preset service type; If the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed; The message identifier is added to the trace file, and the trace file is displayed; the trace file is used to determine the packet loss status of the message to be processed.

2. The method according to claim 1, characterized in that, Determining the message identifier of the message to be processed includes: During the forwarding process of the message to be processed through the forwarding core, the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core are obtained. The message identifier of the message to be processed is generated based on the forwarding time of the message to be processed and the auto-incrementing identifier of the forwarding core.

3. The method according to claim 1, characterized in that, The tracking file includes an identifier tracking file; adding the message identifier to the tracking file includes: Add the message identifier to the identifier tracking file; The identification tracking file is used to determine the packet loss time and forwarding core of the message to be processed.

4. The method according to claim 1, characterized in that, The tracing file also includes a function tracing file; the method further includes: During the forwarding process of the message to be processed through the forwarding core, the function to be called triggered by the message to be processed is determined. Determine the call stack information corresponding to the called function; Accordingly, adding the message identifier to the tracking file includes: Add the message identifier and the call stack information to the function tracing file; The function trace file is used to determine the function calls triggered when a packet is lost.

5. The method according to claim 1, characterized in that, The method further includes: If the message to be processed does not meet the tracking conditions, delete the tracking mark of the message to be processed; If the tracking conditions are not met in the memory buffer, the tracking markers in the memory buffer, as well as the tracking markers of all pending messages in the memory buffer, are deleted.

6. The method according to any one of claims 1-5, characterized in that, Determining the message identifier of the message to be processed includes: The message identifier of the message to be processed is determined based on the file description information of the message to be processed.

7. A message tracking device, characterized in that, The device includes: A tag detection module is used to determine whether a tracking tag exists in the memory buffer under each encapsulation layer of each packet to be processed; the number of packets to be processed is at least one; if a tracking tag exists in the memory buffer, it is determined whether the memory buffer meets the tracking conditions; the meeting of the tracking conditions also includes that the encapsulation layer information of the encapsulation layer to which the memory buffer belongs matches preset encapsulation layer information; the preset encapsulation layer information includes at least one of the address information, port information, and protocol type of the encapsulation layer; if the tracking tag in the memory buffer meets the tracking conditions, for each packet to be processed in the memory buffer, it is determined whether the packet to be processed has a tracking tag; The condition matching module is used to determine whether the message to be processed meets the tracking conditions when the message to be processed has a tracking mark; the tracking conditions include that the service to which the message to be processed belongs belongs to a preset service type; The identifier determination module is used to determine the message identifier of the message to be processed when the message to be processed meets the tracking conditions; The file display module is used to add the message identifier to the tracking file and display the tracking file; the tracking file is used to determine the packet loss status of the message to be processed.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • LACP message timeout fault detection method and device and electronic equipment

    CN110784339A