Data monitoring method, device, computer equipment and storage medium

By using hook programs and IPv6 segment transmission rules in network data transmission, obtaining the transmission configuration information of the target message and processing the preset action code and behavior code, the problems of low efficiency and poor programmability of network packet capture technology are solved, and flexible data packet monitoring is achieved.

CN116647504BActive Publication Date: 2025-09-09GUANGZHOU LIZHI NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310483012.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2025-09-09
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing network packet capture technology is inefficient and lacks programmability, making it impossible to accurately monitor and process traffic at specific nodes.

Method used

The transmission configuration information of the target message is obtained through a preset hook program, the transmission rule is determined using the IPv6 address and segment transmission rule, and the preset action code and behavior code are obtained to achieve flexible processing of the target message.

Benefits of technology

It realizes the compilation of multiple-purpose behaviors of data packets, directly intervenes in the data protocol layer, realizes flexible monitoring of nodes in the entire link, and improves the efficiency and programmability of network data monitoring and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116647504B_ABST
    Figure CN116647504B_ABST
Patent Text Reader

Abstract

The present invention relates to a data monitoring method, apparatus, computer equipment, and storage medium, comprising: obtaining the IP address and transmission path node information of a target message through a preset hook program, determining the transmission rule of the target message; if the transmission rule is a preset transmission rule, obtaining the next transmission node number and the number of transmission path nodes of the target message; if the next transmission node number of the target message and the number of transmission path nodes meet a preset threshold, obtaining a preset debugging verification code, a preset action code, and a preset behavior code in the IPv6 address header of the last segment of the segmented transmission of the target message; and processing the target message according to the preset action code and the behavior instruction corresponding to the preset behavior code. By adding the preset behavior code and the preset action code to the IPv6 address, the purpose of directly intervening in the data protocol layer is achieved, solving the problem of low efficiency and lack of programmability in network data monitoring and processing caused by current network packet capture technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of computer networks, and in particular to a data monitoring method, apparatus, computer equipment, and storage medium. Background Art

[0002] Using packet capture to monitor and process network data has always been an indispensable part of data transmission networks. Currently, network data capture tools such as TCPDUMP (dump the traffic on a network, a packet analysis tool that intercepts data packets on the network according to user definitions) or central management tasks assigned to each link node are used to capture packets for monitoring programs.

[0003] However, the network packet capture methods used above are generally cumbersome and inefficient in implementation, and lack programmability, and cannot achieve customized requirements such as accurate traffic monitoring and processing operability of specific nodes.

[0004] Therefore, it is necessary to establish a mechanism to solve the problems of low efficiency and lack of programmability in network data monitoring and processing generated by current network packet capture technology. Summary of the Invention

[0005] The embodiments of the present invention provide a data monitoring method, apparatus, computer equipment and storage medium to solve the problems of low efficiency and lack of programmability in network data monitoring and processing generated by current network packet capture technology.

[0006] In a first aspect, an embodiment of the present invention provides a data monitoring method, the method comprising:

[0007] Acquire transmission configuration information of the target message through a preset hook program; the transmission configuration information includes at least the IP address of the target message and the transmission path node information of the target message;

[0008] Determining a transmission rule for the target message according to the IP address of the target message and the transmission path node information;

[0009] If the transmission rule of the target message belongs to the preset transmission rule, obtaining the next transmission node number and the number of transmission path nodes of the target message; the preset transmission rule is an IPv6 segment transmission rule combining IPv6 address and segment transmission;

[0010] If the next transmission node number of the target message and the number of nodes in the transmission path meet the preset threshold, obtaining the IPv6 address of the last segment of the segmented transmission of the target message;

[0011] If the IPv6 header of the last segmented IPv6 address includes a preset debugging verification code, obtaining a preset action code and a preset behavior code in the IPv6 header; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction;

[0012] The target message is processed according to the preset action code and the preset behavior code.

[0013] In a second aspect, an embodiment of the present invention further provides a data monitoring device, the device comprising:

[0014] A transmission configuration information acquisition module, configured to acquire the transmission configuration information of the target message through a preset hook program; the transmission configuration information includes at least the IP address of the target message and the transmission path node information of the target message;

[0015] A target message transmission rule determination module, configured to determine the target message transmission rule based on the target message's IP address and the transmission path node information;

[0016] a transmission information acquisition module, configured to obtain the next transmission node number and the number of transmission path nodes of the target message if the transmission rule of the target message belongs to a preset transmission rule; the preset transmission rule is an IPv6 segmented transmission rule combining an IPv6 address and segmented transmission;

[0017] A segment address acquisition module, configured to acquire the IPv6 address of the last segment of the segmented transmission of the target message if the next transmission node number of the target message and the number of nodes in the transmission path meet a preset threshold;

[0018] a preset instruction acquisition module, configured to acquire a preset action code and a preset behavior code in the IPv6 header if the IPv6 header of the last segmented IPv6 address contains a preset debugging verification code; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction;

[0019] A processing module is used to process the target message according to the preset action code and the preset behavior code.

[0020] In a third aspect, an embodiment of the present invention further provides a computer device, comprising:

[0021] one or more processors;

[0022] a memory for storing one or more programs,

[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the data monitoring method as described in any one of the first aspects.

[0024] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data monitoring method as described in any one of the first aspects is implemented.

[0025] In this embodiment, the transmission configuration information of the target message is obtained through a preset hook program; and the transmission rule of the target message is determined based on the IP address and transmission path node information of the target message in the transmission configuration information; if the transmission rule belongs to the preset transmission rule, the next transmission node number of the target message and the number of transmission path nodes are obtained; wherein, the preset transmission rule is the IPv6 segmented transmission rule SRv6 that combines the IPv6 address and segmented transmission; if the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold, the IPv6 address of the last segment of the segmented transmission of the target message is obtained and the preset debugging verification code, preset action code and preset behavior code contained in its IPv6 header are obtained; the target message is processed according to the behavior instructions corresponding to the preset action code and the preset behavior code. By reserving 16 bytes of the IPv6 address, it is possible to compile data packets for multiple purposes, that is, to add preset behavior codes and preset action codes. Compared with the ordinary packet capture method, it is possible to directly intervene in the data protocol layer and use the preset hook program XDP (eXpress DataPath) to achieve the purpose of flexible monitoring of all link nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flowchart of a data monitoring method provided in Example 1 of the present invention;

[0027] Figure 2 This is an example diagram of the transmission protocol format provided in Example 1 of the present invention;

[0028] Figure 3 This is an example diagram of debug mode address encoding provided by the first embodiment of the present invention;

[0029] Figure 4 This is an example diagram of the XDP program processing flow of a node provided in the first embodiment of the present invention;

[0030] Figure 5 A schematic structural diagram of a data monitoring device provided in Embodiment 2 of the present invention;

[0031] Figure 6 A schematic diagram of the structure of a computer device provided in Example 3 of the present invention. DETAILED DESCRIPTION

[0032] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0033] Example 1

[0034] Figure 1 This is a flow chart of a data monitoring method provided in Example 1 of the present invention. The method can be performed by a data monitoring device. The data monitoring device can be implemented by software and / or hardware and can be configured in a computer device, such as a server, workstation, personal computer, etc. The method specifically includes the following steps:

[0035] Step 101: Acquire transmission configuration information of a target message through a preset hook program; the transmission configuration information at least includes the IP address of the target message and transmission path node information of the target message.

[0036] In the embodiment of the present invention, in order to view and analyze network requests and detect network data, network data packet capture is the most common method, among which pre-setting a hook program on a network transmission node to realize packet capture is also a common method.

[0037] Among them, XDP (eXpress Data Path) is a high-performance, programmable network packet processing framework in the Linux kernel. It is essentially a hook program in the Linux kernel network subsystem (Linux Kernel Network Subsystem), which can dynamically mount the general execution engine eBPF program logic, enabling the system kernel to perform targeted high-speed processing on data packets when they reach the network card driver layer.

[0038] The transmission configuration information of the target message is obtained through a preset hook program, namely the XDP program, that is, the transmission configuration information including the IP address of the target message and the transmission path node information.

[0039] Step 102: Determine a transmission rule for the target message according to the IP address of the target message and the transmission path node information.

[0040] In an embodiment of the present invention, the XDP program is mounted on a segment routing (SR) transmission node to obtain the target message in transmission. The SR transmission method is to cut the message forwarding path into different segments and insert segment information into the message at the starting point of the path. The intermediate nodes only need to forward the message according to the segment information carried in the message. Such a path segment is called a "Segment" and is identified by a SID (Segment Identifier).

[0041] Specifically, an IPv6 packet consists of a standard IPv6 header, 0 to n extension headers, and a payload. The packet's transmission rules can be determined by analyzing the standard and extension headers in the target packet's IPv6 address, as well as the transmission path node information of the payload, known as the packet's transmission list.

[0042] Step 103: If the transmission rule of the target message belongs to the preset transmission rule, obtain the next transmission node number and the number of transmission path nodes of the target message; the preset transmission rule is an IPv6 segment transmission rule combining IPv6 address and segment transmission.

[0043] In the embodiment of the present invention, the transmission configuration information content of the SRv6 message adopts the SR transmission mode combined with the IPv6 coding structure to compile the message header. In order to implement Segment Routing IPv6 (SRv6) based on the IPv6 forwarding plane, a new IPv6 extension header is added, called the Segment Routing Header (SRH). This extension header specifies an IPv6 explicit path and stores the IPv6 Segment List information. Its function is the same as the Segment List in SR MPLS. Figure 2 As shown in the figure, the extended header SHR of the SRv6 packet contains the NextHeader type of the packet header that follows the SRH, the index FirstSegmen of the first element in the segment list, the length HdrLength of the SRH header, the RoutingType type of the routing header, the number of intermediate nodes SegLeft that should still be visited before reaching the destination node, some Flags of the data packet, the Tag that identifies the data packets in the same group, and the SegList.

[0044] Among them, the SRH extension header in the IP address can be obtained through the IP address of the message, so that the transmission rule of the message can be determined to be the IPv6 segmented transmission rule that combines the IPv6 address and segmented transmission. In this way, the next transmission node number of the target message and the number of transmission path nodes can be further obtained.

[0045] Step 104: If the next transmission node number of the target message and the number of nodes in the transmission path meet a preset threshold, obtain the IPv6 address of the last segment of the segmented transmission of the target message.

[0046] In the embodiment of the present invention, Figure 2 As shown, in the SRv6 header, the FirstSegment field is usually used to record the number of the next-hop device of the device where Srv6 is constructed, that is, the next transmission node number of the target message. The XDP program of the node through which the data packet flows can also obtain the number of addresses by parsing the HDR Length in the SRv6 header, that is, the number of transmission path nodes. By comparison, it can be determined whether the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold. If so, the IPv6 address of the last segment of the target message segment transmission is obtained.

[0047] Optionally, step 104 may include:

[0048] Sub-step 1041: If the next transmission node number of the target message is equal to the difference between one-half of the number of transmission path nodes and two, then the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold.

[0049] Specifically, the next transmission node number of the target message is [address length – 1]. The number of addresses in SRv6 is always greater than 1. The last address is used for control instructions, that is, to modify FirstSegment = number of addresses – 1 – 1. The XDP program of the node through which the data packet flows parses the HDR Length in the SRv6 header to obtain the number of addresses (HDRLength / 2). If the comparison results in [FirstSegment! = HDRLength / 2–1], it means that the current data packet has enabled debug mode, and the XDP program will read the last address for parsing.

[0050] Step 105: If the IPv6 header of the last segmented IPv6 address contains a preset debugging verification code, obtain the preset action code and preset behavior code in the IPv6 header; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction.

[0051] In the embodiment of the present invention, after obtaining the IPv6 address of the last segment of the target message segment transmission, the preset debugging verification code therein is obtained, that is, Figure 2 As shown in the figure, the SRv6 packet with debug mode turned on has one more address than the normal packet, and only the HdrLength value 2 is changed to 4, while the other contents are the same.

[0052] It is understandable that in actual applications, the adjustment of the message header parameters does not affect the normal transmission of the message.

[0053] Specifically, if Figure 3 The debug mode address encoding is shown in the figure. The first two bytes are the verification code fixed to FAFE, indicating that the debug mode is enabled in this message. This code is the preset debug verification code. The next two bytes are the preset action code, followed by the preset behavior code.

[0054] In actual applications, the character numbers corresponding to the preset action codes form a corresponding relationship with the preset action instructions, that is, if the preset action code is 1, it indicates normal processing, and if the preset action code is 2, it indicates discarding the message, etc.; similarly, the character numbers of the preset behavior codes also have a preset corresponding relationship with the corresponding behavior operations.

[0055] Step 106: Process the target message according to the preset action code and the preset behavior code.

[0056] In the embodiment of the present invention, after the preset action code and the preset behavior code are acquired, the message is processed according to the correspondence between the preset action code and the preset behavior code and the preset action and the preset behavior.

[0057] Specifically, if Figure 3 The following figure shows the encoding of the debug mode address. The first two bytes are the verification code (fixed as FAFE). The next two bytes are the action code, which instructs the passing host to take additional actions, such as discarding the packet or processing normally. The following is the behavior code, which indicates the debug mode action, such as logging. All machines receiving this packet must report the complete packet, including the data content of the packet. The last 8 bytes are the UUID, which is used to match the initiator when reporting.

[0058] It can be understood that the setting method and encoding type of the preset behavior code and the preset action code, the correspondence method with the preset behavior and action, and the type and quantity of the preset behavior and preset action are set by relevant technical personnel based on actual application, and the embodiments of the present invention do not limit this.

[0059] Optionally, in another embodiment of the present invention, the method further includes:

[0060] Step A1: If the transmission rule of the target message does not belong to the preset transmission rule, obtain the preset debugging instruction in the preset hook program; the preset debugging instruction at least includes the preset debugging verification code, the preset action code and the preset behavior code.

[0061] In an embodiment of the present invention, after obtaining the IP address and transmission path node information of the target message, it is confirmed that the target message does not use the IPv6 encoding format, which means that the target message does not belong to the preset transmission rule. At this time, the preset debugging instructions stored in the target message are further obtained. The preset debugging instructions include a FAFE verification code, a preset action code, and a preset behavior code.

[0062] Step A2: According to the preset debugging instruction, the preset debugging verification code, the preset action code and the preset behavior code are added to the IP address header of the target message to generate a new target message to be forwarded.

[0063] In an embodiment of the present invention, according to the content in the preset debugging instruction, the target message needs to be modified by the XDP program mounted on the node, that is, the FAFE verification code contained in the debugging instruction, as well as the preset action code and the preset behavior code are added to the header of the target message, and a new header is formed in the IPv6 message encoding format to generate a new target message to be forwarded, thereby realizing the monitoring and processing of the message data.

[0064] Step A3: Acquire the IP address of the next target node of the target message according to the transmission path node information of the target message.

[0065] In the embodiment of the present invention, the IP address of the next-order target node in the transmission path of the target message is obtained.

[0066] Step A4: Send the target message to be forwarded to the next target node according to the IP address of the next target node.

[0067] In the embodiment of the present invention, the newly generated target message to be transmitted is sent to the next target node according to the IP address of the next target node.

[0068] Optionally, in another embodiment of the present invention, the method further includes:

[0069] Step A5: If the preset debugging instruction in the preset hook program fails to be obtained, the IP address of the next target node of the target message is obtained according to the transmission path node information of the target message.

[0070] In an embodiment of the present invention, if the target message is neither in IPv6 format encoding nor in SR transmission mode, and the message content does not contain a preset debugging instruction, the IP address of the next-order target node in the transmission path of the target message is directly obtained.

[0071] Step A6: Send the target message to the next target node according to the IP address of the next target node.

[0072] In the embodiment of the present invention, the target message is sent to the next target node according to the IP address of the next target node.

[0073] Optionally, in another embodiment of the present invention, the method further includes:

[0074] Step B1: If the next transmission node number of the target message and the number of nodes in the transmission path do not meet a preset threshold, obtain the IP address of the next target node of the target message based on the transmission path node information of the target message.

[0075] In this embodiment of the present invention, the next transmission node number of the target message, that is, [address length – 1], the number of addresses in SRv6 is always greater than 1, where the last address is used for control instructions, that is, FirstSegment is modified to address number – 1 – 1. The XDP program of the node through which the data packet flows obtains the address number (HDRLength / 2) by parsing the HDR Length in the SRv6 header. If the condition of [FirstSegment! = HDRLength / 2–1] is not met through comparison, it means that the next transmission node number of the target message and the number of nodes in the transmission path do not meet the preset threshold, and then the IP address of the next target node of the target message is obtained.

[0076] Step B2: Send the target message to the next target node according to the IP address of the next target node.

[0077] In the embodiment of the present invention, the target message is sent to the next target node according to the IP address of the next target node.

[0078] Optionally, in another embodiment of the present invention, the method further includes:

[0079] Step C1: If the IPv6 header of the last segmented IPv6 address does not include a preset debugging verification code, then obtaining the IP address of the next target node of the target message according to the transmission path node information of the target message.

[0080] In an embodiment of the present invention, if the IPv6 header of the last segmented IPv6 address does not contain a preset debugging verification code, that is, the last segmented transmitted data packet does not contain a header starting with FAFE, then the IP address of the next target node of the target message is obtained.

[0081] Step C2: Send the target message to the next target node according to the IP address of the next target node.

[0082] In the embodiment of the present invention, the target message is sent to the next target node according to the IP address of the next target node.

[0083] by Figure 4 Take this as an example to illustrate the target message processing flow through the node's XDP program:

[0084] First, when the target packet passes through a node, the target packet's header information is used to determine whether it is an SRv6 packet. That is, whether the target packet's header contains an SRv6 header (the XDP program uses an IPv6 address as a control instruction set). If not, the target packet is forwarded directly to the next node. Otherwise, the next-hop device number (i.e., [address length – 1]) of the target packet's SRv6 header is obtained. In this scheme, the number of SRv6 addresses is always greater than 1, and the last address is used for control instructions, that is, FirstSegment is modified to = Number of Addresses – 1 – 1. The XDP program of the node through which the data packet flows parses the HDR Length in the SRv6 header to obtain the number of addresses (HDRLength / 2). If the comparison results in [FirstSegment! = HDRLength / 2 – 1], it means that the current packet has enabled debugging mode, and the XDP program reads the last address for parsing.

[0085] Secondly, when parsing the last segment address, if the segment address does not contain the FAFE verification code, it means that the modulation mode is not turned on for this message, so the message is sent directly to the next node. Otherwise, it means that the debugging instruction is turned on for this message, and the message header contains a preset action code and a preset behavior code. The preset action code and the preset behavior code are obtained, and the message is processed according to the predefined logic of the preset action code and the preset behavior code.

[0086] Finally, the method in the embodiment of the present invention is based on XDP multiplexing SRv6 protocol to implement a debugging and tracing method. The 16-byte IPv6 address placeholder can be used to implement behavioral compilation for various purposes. The characteristics of XDP are used to directly modify SRv6, which is compatible with non-XDP machines without affecting network interoperability. Each debugging packet has a unique ID, which can accurately detect the specific packet that needs to be checked.

[0087] In this embodiment, the transmission configuration information of the target message is obtained through a preset hook program; and the transmission rule of the target message is determined based on the IP address and transmission path node information of the target message in the transmission configuration information; if the transmission rule belongs to the preset transmission rule, the next transmission node number of the target message and the number of transmission path nodes are obtained; wherein, the preset transmission rule is the IPv6 segmented transmission rule SRv6 that combines the IPv6 address and segmented transmission; if the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold, the IPv6 address of the last segment of the segmented transmission of the target message is obtained and the preset debugging verification code, preset action code and preset behavior code contained in its IPv6 header are obtained; the target message is processed according to the behavior instructions corresponding to the preset action code and the preset behavior code. By reserving the 16 bytes of the IPv6 address, it is possible to compile data packets for multiple purposes, namely, adding preset behavior codes and preset action codes. Compared with the ordinary packet capture method, it can directly intervene in the data protocol layer and use the preset hook program fast data path XDP (eXpress Data Path) to achieve the purpose of flexible monitoring of all link nodes, solving the problems of inefficient network data monitoring and processing and lack of programmability caused by current network packet capture technology.

[0088] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0089] Example 2

[0090] Figure 5 This is a structural block diagram of a data monitoring device provided in the second embodiment of the present invention. The device may specifically include the following modules:

[0091] The transmission configuration information acquisition module 201 is used to obtain the transmission configuration information of the target message through a preset hook program; the transmission configuration information at least includes the IP address of the target message and the transmission path node information of the target message;

[0092] The target message transmission rule determination module 202 is used to determine the target message transmission rule according to the IP address of the target message and the transmission path node information;

[0093] a transmission information acquisition module 203 configured to acquire the next transmission node number and the number of transmission path nodes of the target message if the transmission rule of the target message belongs to a preset transmission rule; the preset transmission rule is an IPv6 segmented transmission rule combining an IPv6 address and segmented transmission;

[0094] The segment address acquisition module 204 is configured to acquire the IPv6 address of the last segment of the segmented transmission of the target message if the next transmission node number of the target message and the number of nodes in the transmission path meet a preset threshold;

[0095] A preset instruction acquisition module 205 is configured to acquire a preset action code and a preset behavior code in the IPv6 header if the IPv6 header of the last segmented IPv6 address contains a preset debugging verification code; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction;

[0096] The processing module 206 is configured to process the target message according to the preset action code and the preset behavior code.

[0097] Preferably, in another embodiment of the present invention, it may include:

[0098] a preset debugging instruction acquisition module, configured to acquire a preset debugging instruction in the preset hook program if the transmission rule of the target message does not conform to the preset transmission rule; the preset debugging instruction at least includes the preset debugging verification code, the preset action code, and the preset behavior code;

[0099] A new message generation module is configured to add the preset debugging verification code, the preset action code, and the preset behavior code to the IP address header of the target message according to the preset debugging instruction, so as to generate a new target message to be forwarded;

[0100] A first forwarding address acquisition module, configured to acquire an IP address of a next target node of the target message according to the transmission path node information of the target message;

[0101] The first sending module is used to send the target message to be forwarded to the next target node according to the IP address of the next target node.

[0102] Preferably, in another embodiment of the present invention, it may include:

[0103] a second forwarding address acquisition module, configured to acquire an IP address of a next target node of the target message according to the transmission path node information of the target message if the acquisition of the preset debugging instruction in the preset hook program fails;

[0104] The second sending module is configured to send the target message to the next target node according to the IP address of the next target node.

[0105] Preferably, in another embodiment of the present invention, the segment address acquisition module 204 may also be used to:

[0106] If the next transmission node number of the target message is equal to the difference between one-half of the number of transmission path nodes and two, the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold.

[0107] Preferably, in another embodiment of the present invention, it may further include:

[0108] a third forwarding address acquisition module, configured to acquire the IP address of the next target node of the target message according to the transmission path node information of the target message if the next transmission node number of the target message and the number of nodes in the transmission path do not meet a preset threshold;

[0109] The third sending module is configured to send the target message to the next target node according to the IP address of the next target node.

[0110] Preferably, in another embodiment of the present invention, it may further include:

[0111] a fourth forwarding address acquisition module, configured to acquire, if the IPv6 header of the last segmented IPv6 address does not include a preset debugging verification code, an IP address of a next target node of the target message according to the transmission path node information of the target message;

[0112] The fourth sending module is used to send the target message to the next target node according to the IP address of the next target node.

[0113] The data monitoring device provided in the embodiment of the present invention can execute the data monitoring method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0114] Example 3

[0115] Figure 6 A schematic diagram of the structure of a computer device provided in Example 3 of the present invention. Figure 6 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0116] like Figure 6As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0117] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0118] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0119] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive"). Although Figure 6 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0120] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.

[0121] The computer device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication can occur via an input / output (I / O) interface 22. Furthermore, the computer device 12 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0122] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the data monitoring method provided in the embodiment of the present invention.

[0123] Example 4

[0124] Embodiment 4 of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned data monitoring method are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0125] Among them, computer-readable storage media can include, for example, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0126] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A data monitoring method, characterized in that: The method comprises: Acquiring transmission configuration information of the target message through a preset hook program; the transmission configuration information includes at least the IP address of the target message and the transmission path node information of the target message; Determining a transmission rule for the target message according to the IP address of the target message and the transmission path node information; If the transmission rule of the target message belongs to the preset transmission rule, obtaining the next transmission node number and the number of transmission path nodes of the target message; the preset transmission rule is an IPv6 segment transmission rule combining IPv6 address and segment transmission; If the next transmission node number of the target message and the number of nodes in the transmission path meet the preset threshold, obtaining the IPv6 address of the last segment of the segmented transmission of the target message; If the IPv6 header of the last segmented IPv6 address includes a preset debugging verification code, obtaining a preset action code and a preset behavior code in the IPv6 header; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction; Processing the target message according to the preset action code and the preset behavior code; If the transmission rule of the target message does not belong to the preset transmission rule, obtaining a preset debugging instruction in the preset hook program; the preset debugging instruction at least includes the preset debugging verification code, the preset action code and the preset behavior code; According to the preset debugging instruction, the preset debugging verification code, the preset action code and the preset behavior code are added to the IP address header of the target message to generate a new target message to be forwarded; Acquire the IP address of the next target node of the target message according to the transmission path node information of the target message; Sending the target message to be forwarded to the next target node according to the IP address of the next target node; If the next transmission node number of the target message and the number of nodes in the transmission path do not meet the preset threshold, obtaining the IP address of the next target node of the target message according to the node information of the transmission path of the target message; Sending the target message to the next target node according to the IP address of the next target node; If the IPv6 header of the IPv6 address of the last segment does not include a preset debugging verification code, acquiring the IP address of the next target node of the target message according to the transmission path node information of the target message; The target message is sent to the next target node according to the IP address of the next target node.

2. The method according to claim 1, characterized in that Also includes: If obtaining the preset debugging instruction in the preset hook program fails, obtaining the IP address of the next target node of the target message according to the transmission path node information of the target message; The target message is sent to the next target node according to the IP address of the next target node.

3. The method according to claim 1, characterized in that If the next transmission node number of the target message and the number of nodes in the transmission path meet a preset threshold, the method includes: If the next transmission node number of the target message is equal to the difference between one-half of the number of transmission path nodes and two, the next transmission node number of the target message and the number of transmission path nodes meet the preset threshold.

4. A data monitoring device, characterized in that: The device comprises: A transmission configuration information acquisition module, configured to acquire the transmission configuration information of the target message through a preset hook program; the transmission configuration information includes at least the IP address of the target message and the transmission path node information of the target message; A target message transmission rule determination module, configured to determine the target message transmission rule based on the target message's IP address and the transmission path node information; a transmission information acquisition module, configured to obtain the next transmission node number and the number of transmission path nodes of the target message if the transmission rule of the target message belongs to a preset transmission rule; the preset transmission rule is an IPv6 segmented transmission rule combining an IPv6 address and segmented transmission; A segment address acquisition module, configured to acquire the IPv6 address of the last segment of the segmented transmission of the target message if the next transmission node number of the target message and the number of nodes in the transmission path meet a preset threshold; a preset instruction acquisition module, configured to acquire a preset action code and a preset behavior code in the IPv6 header if the IPv6 header of the last segmented IPv6 address contains a preset debugging verification code; the preset action code includes a correspondence between a preset action number and a preset action instruction, and the preset behavior code includes a correspondence between a preset behavior number and a preset behavior instruction; a processing module, configured to process the target message according to the preset action code and the preset behavior code; a preset debugging instruction acquisition module, configured to acquire a preset debugging instruction in the preset hook program if the transmission rule of the target message does not conform to the preset transmission rule; the preset debugging instruction at least includes the preset debugging verification code, the preset action code, and the preset behavior code; A new message generation module is configured to add the preset debugging verification code, the preset action code, and the preset behavior code to the IP address header of the target message according to the preset debugging instruction, so as to generate a new target message to be forwarded; A first forwarding address acquisition module, configured to acquire an IP address of a next target node of the target message according to the transmission path node information of the target message; A first sending module, configured to send the target message to be forwarded to the next target node according to the IP address of the next target node; a third forwarding address acquisition module, configured to acquire the IP address of the next target node of the target message according to the transmission path node information of the target message if the next transmission node number of the target message and the number of nodes in the transmission path do not meet a preset threshold; A third sending module is used to send the target message to the next target node according to the IP address of the next target node; a fourth forwarding address acquisition module, configured to acquire, if the IPv6 header of the last segmented IPv6 address does not include a preset debugging verification code, an IP address of a next target node of the target message according to the transmission path node information of the target message; The fourth sending module is used to send the target message to the next target node according to the IP address of the next target node.

5. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data monitoring method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data monitoring method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Data processing method and device based on SRv6 protocol, equipment and medium

    CN115277530A

  • Network fault recovery method, device and system, electronic equipment and storage medium

    CN115484204A