Message tracking method and device, computer equipment and storage medium
By generating and tracking packet identification in network applications, the problem of difficulty in accurately tracking packet loss packets in the prior art is solved, and efficient packet loss analysis in complex network scenarios is achieved.
Patent Information
- Application Number
- CN202411760829.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-12-03
AI Technical Summary
In the high-performance and low-latency network applications, it is difficult to accurately track packet loss packets, especially in scenarios where packet loss volume is large and reasons are numerous.
By determining whether there is a trace flag for pending messages, and when specific conditions are met, a message identifier is generated and added to the trace file to accurately track packet loss.
It realizes accurate tracking of packet loss packets in complex network applications, improving the accuracy and efficiency of packet loss analysis.
Smart Images

Figure CN119561870A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a message tracing method, apparatus, computer equipment and storage medium. Background Art
[0002] Currently, more and more high-performance, low-latency network applications use open source components, and current businesses are becoming more and more complex. When forwarding messages, messages may need to be discarded due to various reasons such as message parsing errors, user speed limits, and no healthy backend.
[0003] In traditional technologies, packet loss counting or log recording is usually used to detect whether there is packet loss. Although this method can determine the packet loss situation, it cannot accurately track packet loss in scenarios where the amount of packet loss is large and there are many reasons for packet loss. Summary of the invention
[0004] Based on this, it is necessary to provide a message tracking method, device, computer equipment and storage medium that can accurately track packet loss in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a message tracing method, comprising:
[0006] Determine whether a tracking mark exists in the message to be processed;
[0007] In the case where the message to be processed has a tracking mark, determining whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type;
[0008] When the message to be processed meets the tracking condition, determine the message identifier of the message to be processed;
[0009] Adds message identifiers to a trace file and displays the trace file; the trace file is used to determine the packet loss of the message to be processed.
[0010] In one embodiment, the number of the to-be-processed message is at least one; and determining whether the to-be-processed message has a tracking mark includes:
[0011] For each encapsulation layer of the message to be processed, determining whether there is a tracking mark in the memory buffer under the encapsulation layer;
[0012] In the case where there is a tracking mark in the memory buffer, determining whether the memory buffer satisfies the tracking condition; the tracking condition 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 address information, port information and protocol type of the encapsulation layer;
[0013] When the tracking mark of the memory buffer satisfies the tracking condition, for each to-be-processed message in the memory buffer, it is determined whether the to-be-processed message has a tracking mark.
[0014] In one embodiment, determining a message identifier of a message to be processed includes:
[0015] In the process of forwarding the message to be processed by the forwarding core, the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core are obtained;
[0016] A message identifier of the message to be processed is generated according to the forwarding time of the message to be processed and the self-increment identifier of the forwarding core.
[0017] In one embodiment, the tracking file includes an identification tracking file; adding the message identification to the tracking file includes:
[0018] Add the message ID to the ID tracking file;
[0019] The identification tracking file is used to determine the packet loss time and forwarding core of the message to be processed.
[0020] In one embodiment, the trace file further includes a function trace file; and the method further includes:
[0021] In the process of forwarding the message to be processed by the forwarding core, determining the calling function triggered by the message to be processed;
[0022] Determine the call stack information of the call stack corresponding to the calling function;
[0023] Accordingly, the message identifier is added to the trace file, including:
[0024] Add the message identifier and call stack information to the function trace file;
[0025] The function tracking file is used to determine the calling function triggered when the packet to be processed is lost.
[0026] In one embodiment, the method further comprises:
[0027] When the message to be processed does not meet the tracking condition, the tracking mark of the message to be processed is deleted;
[0028] When the memory buffer does not meet the tracking condition, the tracking mark of the memory buffer and the tracking marks of all pending messages in the memory buffer are deleted.
[0029] In a second aspect, the present application also provides a message tracking device, including:
[0030] A tag detection module, used to determine whether a message to be processed has a tracking tag;
[0031] A condition matching module, used for determining whether the message to be processed meets the tracking condition when there is a tracking mark in the message to be processed; the tracking condition is met including that the business to which the message to be processed belongs belongs to a preset business type;
[0032] An identification determination module, used to determine the message identification of the message to be processed when the message to be processed meets the tracking condition;
[0033] 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 situation of the message to be processed.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] Determine whether a tracking mark exists in the message to be processed;
[0036] In the case where the message to be processed has a tracking mark, determining whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type;
[0037] When the message to be processed meets the tracking condition, determine the message identifier of the message to be processed;
[0038] Adds message identifiers to a trace file and displays the trace file; the trace file is used to determine the packet loss of the message to be processed.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0040] Determine whether a tracking mark exists in the message to be processed;
[0041] In the case where the message to be processed has a tracking mark, determining whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type;
[0042] When the message to be processed meets the tracking condition, determine the message identifier of the message to be processed;
[0043] Adds message identifiers to a trace file and displays the trace file; the trace file is used to determine the packet loss of the message to be processed.
[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0045] Determine whether a tracking mark exists in the message to be processed;
[0046] In the case where the message to be processed has a tracking mark, determining whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type;
[0047] When the message to be processed meets the tracking condition, determine the message identifier of the message to be processed;
[0048] Adds message identifiers to a trace file and displays the trace file; the trace file is used to determine the packet loss of the message to be processed.
[0049] The above-mentioned message tracking method, device, computer equipment and storage medium determine whether there is a tracking mark for the message to be processed; if there is a tracking mark for the message to be processed, determine whether the message to be processed meets the tracking conditions; meeting the tracking conditions includes that the business to which the message to be processed belongs belongs to a preset business type; if the message to be processed meets the tracking conditions, determine the message identifier of the message to be processed; add the message identifier to the tracking file, and display the tracking file; the tracking file is used to determine the packet loss of the message to be processed. This implementation adds the message identifier of the message to be processed to the tracking file for tracking, and accurately determines the packet loss of the message to be processed through the tracking file. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] FIG1 is an application environment diagram of a message tracing method provided by this embodiment;
[0052] FIG2 is a schematic diagram of a flow chart of a first message tracing method provided in this embodiment;
[0053] FIG3 is a schematic diagram of a flow chart of a second message tracing method provided in this embodiment;
[0054] FIG4 is a structural block diagram of a message tracking device provided in this embodiment;
[0055] FIG5 is an internal structure diagram of a first computer device provided in this embodiment;
[0056] FIG6 is a diagram showing the internal structure of a second type of computer device provided in this embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The message tracking method provided in the embodiment of the present application can be applied to the application environment shown in FIG. 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The computer device determines whether there is a tracking mark for the message to be processed; if there is a tracking mark for the message to be processed, it determines whether the message to be processed meets the tracking condition; the tracking condition is met, including that the business to which the message to be processed belongs belongs to a preset business type; if the message to be processed meets the tracking condition, the message identifier of the message to be processed is determined; the message identifier is added to the tracking file, and the tracking file is displayed; the tracking file is used to determine the packet loss of the message to be processed. Among them, the computer device can be both a terminal and a server. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0059] In an exemplary embodiment, as shown in FIG2 , a message tracing method is provided, which is described by taking the method applied to the computer device in FIG1 as an example, and includes the following steps 201 to 204. Among them:
[0060] Step 201, determining whether a message to be processed has a tracking mark.
[0061] The number of messages to be processed is at least one.
[0062] In one embodiment, the computer device may determine whether a tracking flag 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 condition; if the tracking mark of the memory buffer meets the tracking condition, for each message to be processed in the memory buffer, it is determined whether there is a tracking mark for the message to be processed.
[0064] The encapsulation layer may be an inner layer, a middle layer, an outer layer, etc. The tracking condition may include preset encapsulation layer information and the service to which the message to be processed belongs to at least one of preset service types. The preset encapsulation layer information includes at least one of the address information, port information and protocol type of the encapsulation layer, such as an Internet Protocol (IP) address. Meeting the tracking condition also includes that the encapsulation layer information of the encapsulation layer to which the memory buffer belongs matches the preset encapsulation layer information.
[0065] Specifically, for each encapsulation layer of the message to be processed, determine whether there is a tracking mark in the memory buffer (mbuf) under the encapsulation layer, such as detecting before calling rte_pktmbuf_free to actually release the mbuf; if there is no tracking mark, it proves that there is no need to track the memory buffer; when there is a tracking mark in the memory buffer, determine whether the memory buffer meets the tracking condition; when the memory buffer does not meet the tracking condition, delete the tracking mark of the memory buffer and the tracking marks of all messages to be processed in the memory buffer; when the tracking mark of the memory buffer meets the tracking condition, for each message to be processed in the memory buffer, determine whether there is a tracking mark for the message to be processed.
[0066] It should be noted that when the tracing capability of the computer device is enabled, each forwarding core initializes independent tracing conditions, and initializes and opens its own tracing file.
[0067] Step 202: if the message to be processed has a tracking mark, determine whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type.
[0068] Specifically, when the message to be processed has a tracking mark, the computer device determines whether the service type of the service described in the message to be processed meets the preset service type. If yes, it is determined that the message to be processed meets the tracking condition; if not, it is determined that the message to be processed does not meet the tracking condition; and the tracking mark of the message to be processed is deleted.
[0069] Step 203: When the message to be processed meets the tracking condition, determine the message identifier of the message to be processed.
[0070] In one of the embodiments, when the message to be processed meets the tracking condition, the computer device determines the message identifier of the message to be processed according to the file description information of the message to be processed.
[0071] In another embodiment, during the process of forwarding the message to be processed through the forwarding core, the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core are obtained; and the message identifier of the message to be processed is generated according to the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core.
[0072] Exemplarily, in the process of forwarding the message to be processed through the forwarding core, the forwarding time of the message to be processed (such as a system timestamp accurate to seconds) and the self-incrementing identifier of the forwarding core are obtained; splicing is performed according to the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core, and the splicing result is used as the message identifier of the message to be processed. Among them, the self-incrementing identifier ranges from 0 to 999999. When the self-incrementing identifier exceeds 999999, it is reset to 0 and continues to increment. The self-incrementing identifier can be used as the microsecond part of the forwarding time. For example, the system timestamp of the message to be processed is 1714974588, and the self-incrementing identifier is 000094. Therefore, the message identifier of the message to be processed is determined to be 1714974588.000094.
[0073] Step 204, adding the message identifier to the tracking file and displaying the tracking file; the tracking file is used to determine the packet loss situation of the message to be processed.
[0074] The tracking file includes an identification tracking file and a function tracking file. The identification tracking file is used to determine the packet loss time and forwarding core of the message to be processed. The function tracking file is used to determine the calling function triggered when the message to be processed is lost.
[0075] In one of the embodiments, the message identifier is added to a tracking file, and the tracking file is displayed in a computer device, so that the packet loss situation of the message to be processed can be determined through the tracking file.
[0076] In another embodiment, the message identifier is added to the 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 the lost message to be processed through the identifier tracking file.
[0077] The above message tracking method determines whether there is a tracking mark for the message to be processed; if there is a tracking mark for the message to be processed, determines whether the message to be processed meets the tracking conditions; the tracking conditions include that the business to which the message to be processed belongs belongs to a preset business type; if the message to be processed meets the tracking conditions, determines the message identifier of the message to be processed; adds the message identifier to the tracking file, and displays the tracking file; the tracking file is used to determine the packet loss of the message to be processed. This implementation adds the message identifier of the message to be processed to the tracking file for tracking, and accurately determines the packet loss of the message to be processed through the tracking file.
[0078] In one embodiment, the tracing file also includes a function tracing file; the method also includes: in the process of forwarding the message to be processed through the forwarding core, determining the calling function triggered by the message to be processed; determining the call stack information of the call stack corresponding to the calling function; adding the message identifier and the call stack information to the function tracing file.
[0079] Specifically, in the process of forwarding the message to be processed by the forwarding core, the calling function triggered by the message to be processed is determined, the calling function is pushed into the calling stack information, and the message identifier and the calling stack information are spliced, and the splicing result is added to the function tracking file. For example, in the function tracking file, the message identifier of the message to be processed is 1714974588.000094, and the content after the message identifier is the calling function.
[0080] This embodiment can accurately track the calling function called when the to-be-processed message is lost through the function tracking file.
[0081] In an exemplary embodiment, as shown in FIG. 3 , a message tracing method is provided, which is described by taking the method applied to the computer device in FIG. 1 as an example, and includes the following steps 301 to 309, wherein:
[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, when there is a tracking mark in the memory buffer, determine whether the memory buffer satisfies the tracking condition; satisfying the tracking condition 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 address information, port information and protocol type of the encapsulation layer.
[0084] Step 303: When the tracking mark of the memory buffer satisfies the tracking condition, for each message to be processed in the memory buffer, it is determined whether there is a tracking mark for the message to be processed.
[0085] Step 304: if the message to be processed has a tracking mark, determine whether the message to be processed meets the tracking condition; meeting the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type.
[0086] Step 305 , when the message to be processed meets the tracking condition, in the process of forwarding the message to be processed by the forwarding core, the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core are obtained.
[0087] Step 306: Generate a message identifier of the message to be processed according to the forwarding time of the message to be processed and the self-increment identifier of the forwarding core.
[0088] Step 307: in the process of forwarding the message to be processed by the forwarding core, determining 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 calling function.
[0090] Step 309, add the message identifier to the identifier tracking file, and add the message identifier and call stack information to the function tracking file; the identifier tracking file is used to determine the packet loss time and forwarding core of the message to be processed; the function tracking 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 various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0092] Based on the same inventive concept, the embodiment of the present application also provides a message tracking device for implementing the message tracking method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more message tracking device embodiments provided below can refer to the limitations on the message tracking method above, and will not be repeated here.
[0093] In an exemplary embodiment, as shown in FIG4 , a message tracking device is provided, comprising: a tag detection module 10, a condition matching module 11, an identification determination module 12 and a file display module 13, wherein:
[0094] A tag detection module 10, used to determine whether a message to be processed has a tracking tag;
[0095] The condition matching module 11 is used to determine whether the message to be processed meets the tracking condition when there is a tracking mark in the message to be processed; the tracking condition is met including that the service to which the message to be processed belongs belongs to a preset service type;
[0096] An identification determination module 12, configured to determine a message identification of the message to be processed when the message to be processed meets the tracking condition;
[0097] The file display module 13 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 situation of the message to be processed.
[0098] In one embodiment, the tag detection module 10 is also used to determine, for each encapsulation layer of the message to be processed, whether there is a tracking tag in the memory buffer under the encapsulation layer; when there is a tracking tag in the memory buffer, determine whether the memory buffer meets the tracking condition; meeting the tracking condition 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 address information, port information and protocol type of the encapsulation layer; when the tracking tag of the memory buffer meets the tracking condition, determine, for each message to be processed in the memory buffer, whether there is a tracking tag for the message to be processed.
[0099] In one embodiment, the identification determination module 12 is also used to determine the message identification of the message to be processed, including: in the process of forwarding the message to be processed through the forwarding core, obtaining the forwarding time of the message to be processed and the self-incrementing identification of the forwarding core; generating the message identification of the message to be processed according to the forwarding time of the message to be processed and the self-incrementing identification of the forwarding core.
[0100] In one embodiment, the file display module 13 is also used to track files including identification tracking files; adding the message identification to the tracking file includes: adding the message identification 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 message tracking device is also used for tracking files including function tracking files; the method also includes: in the process of forwarding the message to be processed by the forwarding core, determining the calling function triggered by the message to be processed; determining the call stack information of the call stack corresponding to the calling function; accordingly, adding the message identifier to the tracking file, including: adding the message identifier and the call stack information to the function tracking file; the function tracking file is used to determine the calling function triggered when the message to be processed is lost.
[0102] In one embodiment, the message tracking device is also used in a method which further includes: when the message to be processed does not meet the tracking conditions, deleting the tracking mark of the message to be processed; when the memory buffer does not meet the tracking conditions, deleting the tracking mark of the memory buffer and the tracking marks of all the messages to be processed in the memory buffer.
[0103] Each module in the above-mentioned message tracking device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0104] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message tracking method is implemented.
[0105] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a message tracking method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0106] Those skilled in the art will understand that the structures shown in FIGS. 5 and 6 are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than those shown in the figures, or combine certain components, or have a different arrangement of components.
[0107] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0108] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0109] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0110] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0112] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A message tracing method, characterized in that: The method comprises: Determine whether a tracking mark exists in the message to be processed; In the case where the message to be processed has a tracking mark, determining whether the message to be processed meets a tracking condition; the tracking condition includes that the service to which the message to be processed belongs belongs to a preset service type; When the message to be processed meets the tracking condition, determining the message identifier of the message to be processed; The message identifier is added to a tracking file, and the tracking file is displayed; the tracking file is used to determine the packet loss situation of the message to be processed.
2. The method according to claim 1, characterized in that in, The number of the to-be-processed messages is at least one; and determining whether the to-be-processed message has a tracking mark includes: For each encapsulation layer of the message to be processed, determining whether there is a tracking mark in the memory buffer under the encapsulation layer; In the case where there is a tracking mark in the memory buffer, determining whether the memory buffer satisfies a tracking condition; the satisfying the tracking condition also includes that 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 address information, port information and protocol type of the encapsulation layer; In the case where the tracking mark of the memory buffer satisfies the tracking condition, for each to-be-processed message in the memory buffer, it is determined whether the to-be-processed message has a tracking mark.
3. The method according to claim 1, characterized in that The determining of the message identifier of the message to be processed includes: In the process of forwarding the message to be processed by the forwarding core, obtaining the forwarding time of the message to be processed and the self-incrementing identifier of the forwarding core; A message identifier of the message to be processed is generated according to the forwarding time of the message to be processed and the self-increment identifier of the forwarding core.
4. The method according to claim 1, characterized in that: The tracking file includes an identification tracking file; the adding the message identification to the tracking file includes: Adding the message identifier to an identifier tracking file; The identification tracking file is used to determine the packet loss time and forwarding core of the message to be processed.
5. The method according to claim 1, characterized in that The tracking file also includes a function tracking file; the method also includes: In the process of forwarding the message to be processed by the forwarding core, determining a calling function triggered by the message to be processed; Determine call stack information of a call stack corresponding to the calling function; Accordingly, the step of adding the message identifier to the tracking file includes: Adding the message identifier and the call stack information to a function tracking file; The function tracking file is used to determine the calling function triggered when the packet to be processed is lost.
6. The method according to claim 2, characterized in that The method further comprises: If the message to be processed does not meet the tracking condition, deleting the tracking mark of the message to be processed; When the memory buffer does not satisfy the tracking condition, the tracking mark of the memory buffer and the tracking marks of all to-be-processed messages in the memory buffer are deleted.
7. A message tracking device, characterized in that: The device comprises: A tag detection module, used to determine whether a message to be processed has a tracking tag; A condition matching module, used for determining whether the message to be processed satisfies a tracing condition when the message to be processed has a tracing mark; the tracing condition includes that the service to which the message to be processed belongs belongs to a preset service type; An identification determination module, used to determine the message identification of the message to be processed when the message to be processed meets the tracking condition; 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 situation of the message to be processed.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method and device for tracking core network side application plane and application plane tracking system
CN103475529A
Network element-based network flow monitoring system and method
CN110417612A
LACP message timeout fault detection method and device and electronic equipment
CN110784339A
Message processing method and device, server and storage medium
CN112350890A
Log tracking method and device, equipment and storage medium
CN114253792A