Data processing method and device, equipment, storage medium and program product
By dynamically updating the network equipment monitoring program and adjusting the monitoring logic according to the characteristics of the monitoring data, the problem of the inability of existing technology to adapt to complex network environments is solved, and the security and monitoring effect of network equipment are improved.
Patent Information
- Application Number
- CN202410472774.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2024-09-17
AI Technical Summary
Existing technologies are difficult to adapt to complex and changeable network environments, resulting in the inability to flexibly adjust network equipment monitoring programs and to effectively improve the security and monitoring effects of network equipment.
By receiving monitoring data sent by network equipment, it extracts target data characteristics, determines matching configuration information, dynamically updates monitoring programs, adjusts monitoring logic to adapt to the current network environment, reduces the impact on network equipment performance, and improves monitoring efficiency and comprehensiveness.
It achieves adaptive monitoring of complex and changeable network environments, improves the security and monitoring effects of network equipment, and balances monitoring comprehensiveness and equipment stability.
Smart Images

Figure CN118659893A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment, storage medium and program product. Background Art
[0002] With the development of cloud computing and Internet of Things technologies in the Internet, the network environment of a single host in a data center is becoming more and more complex. For example, data centers use containerized orchestration technology based on Kubernetes (a containerized application used to manage multiple hosts in a cloud platform). Each physical machine node often carries multiple containers, and each container has an independent network address (IP) that changes over time. When performing security monitoring, related technologies usually prepare the monitoring logic of the monitoring program in advance based on a specific network environment, making the monitoring program only applicable to a specific network environment and not applicable to the current complex and changing network environment. Summary of the invention
[0003] Based on this, it is necessary to provide a data processing method, device, equipment, storage medium and program product to address the above technical problems, which can update the program used for monitoring and is suitable for complex and changeable network environments.
[0004] In a first aspect, the present application provides a data processing method. The method comprises:
[0005] Receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device;
[0006] Extracting target data features from the monitoring data, and determining configuration information matching the target data features;
[0007] The first program is updated according to the configuration information, and the network device is monitored through the updated first program.
[0008] In a second aspect, the present application also provides a data processing device. The device comprises:
[0009] A receiving module, used for receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device;
[0010] An extraction module, used to extract target data features from the monitoring data and determine configuration information matching the target data features;
[0011] An updating module is used to update the first program according to the configuration information and monitor the network device through the updated first program.
[0012] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0013] Receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device;
[0014] Extracting target data features from the monitoring data, and determining configuration information matching the target data features;
[0015] The first program is updated according to the configuration information, and the network device is monitored through the updated first program.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0017] Receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device;
[0018] Extracting target data features from the monitoring data, and determining configuration information matching the target data features;
[0019] The first program is updated according to the configuration information, and the network device is monitored through the updated first program.
[0020] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0021] Receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device;
[0022] Extracting target data features from the monitoring data, and determining configuration information matching the target data features;
[0023] The first program is updated according to the configuration information, and the network device is monitored through the updated first program.
[0024] The above-mentioned data processing method, device, equipment, storage medium and program product determine configuration information according to the target data characteristics in the monitoring data of the network device, can understand the network environment in which the network device is located according to the target data characteristics, and determine the configuration information suitable for the current network environment. The first program used for monitoring in the network device is updated according to the configuration information, that is, the first program is dynamically updated according to the network environment, so as to realize the flexible adjustment of the monitoring logic, be suitable for complex and changeable network environments, improve the monitoring effect of the network device, and can greatly improve the security of the network device. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 An application environment diagram of a data processing method in an embodiment;
[0026] Figure 2 is a flow chart of a data processing method in one embodiment;
[0027] Figure 3 A schematic diagram of a flow chart of a step of obtaining configuration information in an embodiment;
[0028] Figure 4 A flowchart of a step of obtaining configuration information in another embodiment;
[0029] Figure 5 A flowchart of a step of obtaining configuration information in another embodiment;
[0030] Figure 6 A schematic diagram of a process for obtaining monitoring data in a network device in one embodiment;
[0031] Figure 7 is a structural block diagram of a data processing device in one embodiment;
[0032] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0033] 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.
[0034] With the development of cloud computing and IoT technologies in the Internet, the network environment of a single host in a data center is becoming increasingly complex. For example, data centers use containerized orchestration technology based on Kubernetes (a containerized application for managing multiple hosts in a cloud platform). Each physical machine node often carries multiple containers, and each container has an independent network address (IP) that changes over time.
[0035] When conducting security monitoring, the relevant technologies usually prepare the monitoring logic of the monitoring program in advance according to the specific network environment, so that the monitoring program can only be applied to the specific network environment. For example, during the life cycle of the monitoring program, fixed network indicators and data types are collected, which cannot be applied to the current complex and changeable network environment.
[0036] In addition, since network devices (such as servers, terminals, routers, gateway devices, etc., which need to communicate with each other) are often in a heterogeneous environment, their computing power and memory capacity vary greatly. In order to comprehensively monitor network devices, current network monitoring tools often set a large number of monitoring indicators. However, running network monitoring tools consumes system computing resources and memory resources. In network devices with very limited computing resources or memory resources, using network monitoring tools that collect a large number of indicators will seriously affect the performance of network devices.
[0037] Based on this, the present application proposes a data processing method, which determines configuration information according to the target data characteristics in the monitoring data of the network device, can understand the network environment in which the network device is located according to the target data characteristics, and determine the configuration information that adapts to the current network environment. The first program used for monitoring in the network device is updated according to the configuration information, that is, the first program is dynamically updated according to the network environment, so as to realize flexible adjustment of the monitoring logic, which is suitable for complex and changeable network environments. By dynamically updating the first program, reasonable monitoring logic can be provided, the monitoring effect of the network device can be improved, and the security of the network device can be greatly improved.
[0038] Moreover, in actual implementation, the configuration information of the present application is configuration information generated based on at least one parameter among the monitoring indicators, defense strategies, and data structure types. Based on this, the network indicators, defense strategies, and data structure types used by the first program during the collection process can be adjusted, which is suitable for complex and changeable network environments and improves the security of network equipment.
[0039] Furthermore, in the present application, the first program is dynamically updated according to the network environment. When the network environment is simple and the computing resources and memory resources of the network device are limited, the monitoring indicators can be reduced by updating the first program, the impact on the performance of the network device can be reduced, and the monitoring efficiency can be improved. When the network environment is complex and the computing resources and memory resources of the network device are sufficient, the monitoring indicators can be increased by updating the first program, making the monitoring more comprehensive. This balances the comprehensiveness of monitoring and the stability of the monitored device.
[0040] In order to better understand a data processing method, apparatus, computer device and storage medium provided in an embodiment of the present application, an application environment applicable to an embodiment of the present application is first described below.
[0041] See also Figure 1 , Figure 1 FIG. 1 shows an application environment diagram of a data processing method provided by an embodiment of the present application. As an implementation mode, the data processing method provided by an embodiment of the present application is applied to an electronic device. The electronic device may be Figure 1 The server 110 shown in the figure can be connected to the network device 120 through a network. The network is used to provide a medium for a communication link between the server 110 and the network device 120. The network can include various connection types, such as a wired communication link, a wireless communication link, etc., which is not limited in the embodiment of the present application.
[0042] It should be understood that Figure 1 The server 110, network and network device 120 are merely illustrative. Any number of servers, networks and terminal devices may be provided as required. For example, the server 110 may be a physical server or a server cluster composed of multiple servers, and the network device 120 may be a computer, a switch, a router, a gateway, a VPN server, a wireless access point (WAP), etc. It is understood that the embodiments of the present application may also allow multiple network devices 120 to access the server 110 at the same time.
[0043] In some embodiments, a separate second program and a first program are provided on the network device 120, wherein the first program is used to collect monitoring data, and the second program is used to load the first program and transmit the monitoring data. The server 110 obtains monitoring data from the network device 120 by accessing the interface of the network device 120, determines configuration information matching the target data characteristics by analyzing the target data characteristics in the monitoring data, updates the first program based on the configuration information, and monitors the network device 120 through the updated first program.
[0044] In one embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 The server 110 in the example is used as an example to illustrate, and the following steps are included:
[0045] Step 202, receiving monitoring data sent by the network device, where the monitoring data is collected by a first program in the network device.
[0046] The network device is a device connected to the network, which can be a computer device, a switch, a router, a server, etc. The network device in this embodiment refers to any monitored network device within the monitoring range. The monitoring data refers to the data recorded by real-time or periodic collection of parameters related to the network device through the first program, and the data can reflect the operating status and performance of the network device.
[0047] In one implementation, a second program and a first program are run in the network device, and the second program sends the monitoring data collected by the first program to the server. By setting up the first program and the second program, monitoring data collection and monitoring data transmission are decoupled, so that the first program only needs to focus on how to collect monitoring data.
[0048] Furthermore, the second program is a program belonging to the control plane, responsible for transmitting and processing control signaling, and has configuration parsing function, first program loading function, and monitoring data transmission function. The first program is a program belonging to the data plane, responsible for transmitting and processing actual data, and has monitoring data collection and monitoring data export functions.
[0049] Optionally, the first program runs in the kernel space of the operating system of the network device, and the second program runs in the user space of the operating system of the network device.
[0050] In one implementation, the first program is an eBPF program running in the kernel space of the operating system of a network device. When an event matching the monitoring logic occurs, the eBPF (Extended Berkeley Packet Filter) program reads data from the network device and transmits the data to the second program running in the user space of the operating system through a map data structure. The second program sends the monitoring data collected by the eBPF program to the server for processing. Among them, the eBPF program transmits monitoring data to the second program through a map data structure. Compared with the method in which the monitoring program switches between user space and kernel space in the related art, the use of the eBPF program can reduce the performance loss caused by switching between user space and kernel space, and improve the operating performance of the network device. In addition, the use of the eBPF program can dynamically load the monitoring logic updated by the server without restarting the network device or the monitoring process, which can improve the efficiency of dynamic updates.
[0051] In one implementation, the network device interacts with the server once every preset time period, so that the monitoring data collected by the first program in each monitoring cycle is sent to the server.
[0052] Optionally, the server receives a file in JSON (JavaScript Object Notation) format from the network device, and parses the file in JSON format to obtain monitoring data.
[0053] Step 204: extract target data features from the monitoring data, and determine configuration information that matches the target data features.
[0054] Among them, the monitoring data includes data corresponding to multiple network indicators, and each network indicator has a predefined corresponding parsing method. For the monitoring data, the server obtains the predefined parsing method and extracts the target data features from the data corresponding to the network indicator. The target data features are used to reflect the inherent laws of the monitoring data under each network indicator. The target data features can be extracted from different angles, such as statistical features, time series features, text features, etc.
[0055] In one implementation, the server analyzes whether the current network device is in an abnormal scenario through target data features, thereby adjusting the monitoring strategy according to the analysis results, and determining the configuration information that matches the monitoring strategy, and the configuration information is used to configure the first program to implement the monitoring logic corresponding to the monitoring strategy. Optionally, there are differences in the judgment features used to analyze each abnormal scenario. For example, the target data features include judgment features A, judgment features B, and judgment features C. When analyzing whether the current network device is in abnormal scenario 1, judgment feature A is used for analysis; when analyzing whether the current device is in abnormal scenario 2, judgment feature B is used for analysis; when analyzing whether the current device is in abnormal scenario 3, judgment feature C is used for analysis. In one implementation, the target data features may conform to multiple abnormal scenarios at the same time, and the server adjusts the monitoring strategy multiple times according to the analysis results.
[0056] In one implementation, if the current network device needs to adjust the monitoring index according to the target data feature analysis, the monitoring index of the first program in the next monitoring cycle is determined, and the configuration information is generated according to the determined monitoring index. For example, if the target data feature is a performance feature of the network device, if the performance feature indicates that the performance of the network device is reduced, the monitoring index of the first program is reduced.
[0057] Optionally, the configuration information is generated according to at least one parameter of a monitoring indicator, a defense strategy, and a type of data structure. The monitoring indicator is used to specify a network indicator used by the first program in a new monitoring cycle, the network indicator is a parameter and indicator used to measure and evaluate the operation of a network device, the defense strategy includes at least one of a packet shielding strategy, an alarm strategy, and a reporting strategy, and the type of data structure refers to the type of storage structure used to store monitoring data, such as an array, a hash, etc.
[0058] Step 206: Update the first program according to the configuration information, and monitor the network device through the updated first program.
[0059] Among them, the method of updating the first program according to the configuration information can be: compiling an eBPF program corresponding to the configuration information. After the first program is updated according to the configuration information, return to step 202, run the new first program on the network device, collect monitoring data through the new monitoring logic, and send it to the server, and the server performs a new round of updates according to steps 202 to 206. In this way, the first program can be dynamically updated according to the network environment, which improves the flexibility and accuracy of network device monitoring.
[0060] Furthermore, a second program and a first program are running in the network device. The second program has a configuration parsing function and a first program loading function. The server sends the updated first program to the network device, and the second program performs configuration parsing and loads the updated first program into the network device. By decoupling the data plane and the control plane, the operation and maintenance personnel only need to focus on the monitoring logic of the first program without having to consider how to inject the monitoring logic into the monitored network device. When it is necessary to switch network indicators or change the monitoring strategy, the server only needs to send the first program to the network device, and the update method is simple.
[0061] In the above data processing method, the monitoring data sent by the network device is received, and the configuration information is determined according to the target data characteristics in the monitoring data of the network device. The network environment in which the network device is located can be understood according to the target data characteristics, and the configuration information adapted to the current network environment can be determined. The first program used for monitoring in the network device is updated according to the configuration information, that is, the first program is dynamically updated according to the network environment, so that the flexible adjustment of the monitoring logic is realized, which is suitable for complex and changeable network environments, improves the monitoring effect of the network device, and can greatly improve the security of the network device.
[0062] In one embodiment, step 206 includes: obtaining a target program that matches the first program in the network device; updating the target program according to the configuration information, and sending the updated target program to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
[0063] The server locally stores the first program corresponding to each network device, namely the target program. The updated first program is pushed to the network device, and the second program in the network device loads the updated first program into the operating system kernel space, and the updated first program continues to collect monitoring data.
[0064] Among them, the first program can be understood as a program belonging to the data plane, running in the kernel space of the network device operating system, responsible for transmitting and processing actual data, and having the functions of monitoring data collection and monitoring data export. The second program can be understood as a program belonging to the control plane, running in the user space of the network device operating system, responsible for transmitting and processing control signaling, and having the functions of configuration parsing, first program loading, and monitoring data transmission.
[0065] In the network monitoring tools of the related art, data processing and control signaling processing are integrated into the same application. If the monitoring program needs to be updated, the user must configure, modify, and redeploy the entire application, which limits flexibility.
[0066] In the above embodiment, by decoupling the data plane and the control plane, the operation and maintenance personnel only need to focus on the monitoring logic of the first program without having to consider how to inject the monitoring logic into the monitored network device. When it is necessary to switch network indicators or change the monitoring strategy, the server only needs to send the first program to the network device. The update method is simple, which improves the monitoring effect of the network device.
[0067] In one embodiment, determining configuration information that matches the target data feature includes: determining whether the network device is in an abnormal scenario based on the target data feature; if the network device is in an abnormal scenario, obtaining configuration information that matches the abnormal scenario.
[0068] Among them, the judgment features and judgment methods of each abnormal scenario are pre-set, and the judgment features refer to the features required to perform abnormal scenario judgment. For each abnormal scenario, the server obtains the judgment features corresponding to the abnormal scenario from the target data features, and uses the judgment method and the judgment features of the abnormal scenario to determine whether the network device is in the abnormal scenario.
[0069] In one implementation, configuration information matching each abnormal scenario is set in advance, the server determines the abnormal scenario in which the network device is located, and obtains configuration information matching the abnormal scenario in which the network device is located from the configuration information set in advance.
[0070] In one implementation, if the network device is in a normal scenario, the server may not update the first program during the current monitoring cycle, so that the first program maintains the original monitoring logic unchanged.
[0071] Optionally, the configuration information is generated according to at least one parameter of a monitoring indicator, a defense strategy, and a type of data structure.
[0072] In the above embodiment, the server has the ability to identify abnormal scenarios. By analyzing the characteristics of the target data, it can quickly determine whether the network device is in an abnormal scenario. According to the configuration information matching the abnormal scenario, the first program used for monitoring in the network device is updated, and the abnormality can be handled in a targeted manner, which helps to restore the normal operation of the network device.
[0073] In one embodiment, Figure 3 As shown, the target data features include the source address, port and timestamp of the network data packet, and the abnormal scenario includes the attack scenario; according to the target data features, determining whether the network device is in an abnormal scenario includes:
[0074] Step 302: Determine M network data packets within a preset time period according to the timestamp.
[0075] Among them, the network data packet is the basic unit of data transmitted in the network. The network data packet of this embodiment is a data packet sent by other devices to the monitored network device. The source address (source IP) refers to the host address that sends the network data packet, the port refers to the starting point of the network data packet transmission, and the timestamp is used to record the time when the network data packet is sent or received. The duration corresponding to the preset time period is a pre-set fixed value. The server can determine the network data packets received by the network device in a shorter time period through the preset time period.
[0076] Optionally, a preset fixed value is used as the size of the preset sliding window, and the preset sliding window slides within the current monitoring cycle of the first program. During the sliding process of the preset sliding window, the time period corresponding to the preset sliding window is used as the preset time period. For each preset time period, the number of network data packets whose timestamps are within the preset time period is recorded as M, where M is an integer greater than or equal to 1.
[0077] Step 304: Determine a first number of network data packets with the same source address and a second number of network data packets with the same port among the M network data packets.
[0078] Specifically, the server analyzes the source addresses of the M network data packets, divides the M network data packets into T groups (T is an integer greater than or equal to 1) according to the source addresses, each group includes at least one network data packet with the same source address, determines the number of network data packets included in each group, and obtains T numbers of network data packets. Optionally, the first number includes T numbers of network data packets. Optionally, the first number is the maximum value of the T numbers of network data packets.
[0079] The server analyzes the ports of the M network data packets, divides the M network data packets into K groups (K is an integer greater than or equal to 1) according to the ports, each group includes at least one network data packet with the same port, determines the number of network data packets included in each group, and obtains the K numbers of network data packets. Optionally, the second number includes the K numbers of network data packets. Optionally, the second number is the maximum value of the K numbers of network data packets.
[0080] Step 306: If the first number is greater than the first threshold and the second number is greater than the second threshold, it is determined that the network device is in an attack scenario.
[0081] Among them, the first threshold and the second threshold are the critical values set in advance to distinguish the amount of data. If the first number is greater than the first threshold and the second number is greater than the second threshold, it indicates that the network device has received a large number of data packets from the same source in a short period of time. At this time, the network device is likely to be attacked by a distributed denial of service (DDOS), and the server determines that the network device is in an attack scenario (first stage). In this way, the server analyzes whether there are a large number of data packets from the same source in a short period of time, thereby determining whether the network device is currently under a DDOS attack.
[0082] Optionally, the first quantity includes T number of network data packets, and the second quantity includes K number of network data packets. If any value among the T number of network data packets is greater than the first threshold and any value among the K number of network data packets is greater than the second threshold, it is determined that the network device is in an attack scenario.
[0083] If the network device is in an abnormal scenario, obtain configuration information that matches the abnormal scenario, including:
[0084] Step 308, if the network device is in an attack scenario, generate configuration information matching the attack scenario according to a preset flag; wherein the preset flag is used to determine the network connection status between the source of the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag.
[0085] The preset flag bit stores information for determining the network connection status. Optionally, the preset flag bit includes a synchronization flag bit and an acknowledgement flag bit of the network data packet. The synchronization flag bit (SYN) and the acknowledgement flag bit (ACK) are data carried by the TCP (Transmission Control Protocol) header. SYN=1 indicates that the network data packet is a connection request message, and ACK=1 indicates that the network data packet is a connection confirmation message.
[0086] It is understandable that if the server detects a large number of network data packets from the same source in a short period of time during this round of monitoring cycle, it is determined that the network device is suspected of being attacked by a distributed denial of service. At this time, the monitoring indicators of the first program are adjusted to further confirm whether the network device has actually been attacked by DDOS. Among them, the initiator of DDOS generally attacks by occupying the network resources of the network device. Specifically, by filling up the connection table of the network device, it affects the establishment of a session between the network device and other devices, and hinders normal users from using the service. In this embodiment, the server configures the preset flag bit as an indicator monitored by the first program in the next round of monitoring cycle, so as to determine the network connection status between the source of the initiator of the network data packet and the network device, and further confirm whether the network device has actually been attacked.
[0087] In the above embodiment, the timestamp, source address and port of the network data packet are used to determine whether the network device is in an attack scenario. After determining that a distributed denial of service attack is suspected to have occurred, the monitoring indicators of the first program are adjusted, which is suitable for complex and changeable network environments. Attack scenario analysis based on monitoring data collected in multiple monitoring cycles can improve the accuracy of distributed denial of service attack judgments. Since the monitoring indicators can be adjusted dynamically, there is no need to monitor all indicators, which effectively saves the computing resources and memory resources of the network device and improves the work efficiency and security of the network device.
[0088] In one embodiment, after step 206, the method further includes:
[0089] Determine the target network data packet collected by the updated first program, the target network data packet is a network data packet from a set address and a set port; determine the parameter value of a preset flag bit of the target network data packet; if the parameter value represents a half-open connection, update the first program again based on the first defense strategy, so that the first program after the update executes the first defense strategy when detecting the target network data packet, and the first defense strategy includes at least one strategy of a data packet shielding strategy, an alarm strategy and a reporting strategy.
[0090] Among them, after step 306, the server uses the source address of the first number of network data packets greater than the first threshold as the set address, and uses the port of the second number of network data packets greater than the second threshold as the set port. In this way, the suspected attack source address and the suspected attack source port are taken as key monitoring objects.
[0091] It is understandable that a half-open connection refers to a state in which the connection has not been fully established and the communicating parties cannot interact. Taking the TCP handshake connection as an example, during the first handshake, the first end (the source of the network data packet) sends a data packet including SYN to the second end (network device) to request to establish a connection. During the second handshake, the second end returns a data packet including SYN and ACK to the first end to confirm the connection request. During the third handshake, the first end sends a data packet including ACK to the second end to confirm the connection, and the connection establishment is now complete. In the process of establishing a TCP connection, after the second end returns a data packet including SYN and ACK, if the confirmation information from the first end is not received, the second end will retransmit the data packet including SYN and ACK. This connection state waiting for confirmation from the first end is a half-open connection. If the first end and the second end are in a half-open connection, a large amount of network resources on the second end will be occupied.
[0092] In this embodiment, during this round of monitoring cycle, the first program collects preset flag bits of network data packets from the set address and the set port, and the preset flag bits include SYN and ACK. If the network data packets received by the network device from the set address and the set port are all SYN=1 data packets, and the network device does not receive the network data packets from the set address and the set port with ACK=1, it is determined that the source of the initiator of the network data packet and the network device are in a half-open connection. At this time, the network device is in an attack scenario (second stage), and the server obtains a pre-set first defense strategy corresponding to the attack scenario, uses the first defense strategy as new configuration information, and performs a new round of adjustments to the first program according to the configuration information.
[0093] The first defense strategy can be a packet shielding strategy, which is used to reject packets sent by attack sources. The attack sources can be distinguished based on the source IP. The set address is used as an identification item of the first defense strategy. During the subsequent operation of the first program, if a network packet from the set address is received, a reception rejection operation is performed, thereby reducing the risk of network attacks.
[0094] The first defense strategy may be an alarm strategy, and if a data packet from an attacker is received, an alarm is issued on the network device. The first defense strategy may be a reporting strategy, and if a data packet from an attacker is received, relevant information is reported to a server.
[0095] In one implementation, the process from identifying DDOS attacks to taking defense strategies is completed by the eBPF program in the operating system kernel space. Therefore, a small amount of computing resources can be used to defend against large-volume DDOS attacks, thereby improving the working efficiency and security of network equipment.
[0096] In the above embodiment, attack scenario analysis is performed based on monitoring data collected in multiple monitoring cycles, which can improve the accuracy of distributed denial of service attack judgment.
[0097] In one embodiment, Figure 4 As shown, the target data features include the host name and source address of the network data packet, and the abnormal scenario includes the hijacking attack scenario; according to the target data features, it is determined whether the network device is in an abnormal scenario, including:
[0098] Step 402, determine P network data packets from the target host name.
[0099] The host name is used to mark the name of a host and is unique in the network. The target host name is any host name carried by the network data packet received by the network device. In the specific implementation, the server determines P network data packets with the same host name (that is, all are target host names) from the network data packets received by the network device.
[0100] Step 404, determining the number of source addresses after deduplication based on the source addresses of the P network data packets.
[0101] The number of source addresses after deduplication refers to the number of different source addresses in P network data packets.
[0102] Step 406: If the number of source addresses is greater than the third threshold, it is determined that the network device is in a hijacking attack scenario.
[0103] The third threshold is a critical value set in advance for distinguishing the amount of data. In a specific implementation, if multiple source addresses imitate the same host name to access the network device, it indicates that the network device is in a hijacking attack scenario.
[0104] If the network device is in an abnormal scenario, obtain configuration information that matches the abnormal scenario, including:
[0105] Step 408, if the network device is in a hijacking attack scenario, generate configuration information matching the hijacking attack scenario according to the second defense strategy, so that when the updated first program detects a network data packet from the target host name, it executes the second defense strategy, and the second defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0106] The server obtains a pre-set second defense strategy corresponding to the hijacking attack scenario, uses the second defense strategy as new configuration information, and updates the first program according to the configuration information.
[0107] The second defense strategy can be a packet shielding strategy, which is used to reject packets sent by the attack source. The attack source can be distinguished based on the host name, and the target host name is used as the identification item of the second defense strategy. During the subsequent operation of the first program, if a network packet from the target host name is received, the reception rejection operation is performed. In this way, the risk of network attacks is reduced.
[0108] The second defense strategy may be an alarm strategy, and if a data packet from the target host name is received, an alarm is issued on the network device. The second defense strategy may be a reporting strategy, and if a data packet from the target host name is received, relevant information is reported to the server.
[0109] In one implementation, the process from identifying hijacking attacks to taking defensive strategies is completed by the eBPF program in the operating system kernel space. Therefore, a small amount of computing resources can be used to defend against large-volume hijacking attacks, thereby improving the working efficiency and security of network equipment.
[0110] In the above embodiment, whether the network device is in a hijacking attack scenario is determined by the host name and source address of the network data packet. When in an abnormal scenario, the defense strategy of the first program is adjusted to improve the security of the network device.
[0111] In one embodiment, Figure 5 As shown, the target data feature includes the number of reads and writes of the data structure by the first program, the data structure is a storage structure of the monitoring data, and the abnormal scenario includes a data structure optimization scenario; according to the target data feature, determining whether the network device is in an abnormal scenario includes:
[0112] Step 502, if the number of reads is greater than the first set number and the number of writes is less than the second set number, or the number of reads is less than the second set number and the number of writes is greater than the first set number, it is determined that the network device is in a data structure optimization scenario; the first set number is greater than the second set number.
[0113] Among them, the first set number of times and the second set number of times are critical values set in advance for distinguishing the number of times, and the first set number of times is greater than the second set number of times. If the number of reads is greater than the first set number of times and the number of writes is less than the second set number of times, it indicates that the first program reads more and writes less. If the number of reads is less than the second set number of times and the number of writes is greater than the first set number of times, it indicates that the first program reads less and writes more. If the first program reads more and writes less or the first program reads less and writes more, it is determined that the abnormal scenario in which the network device is located is a data structure optimization scenario.
[0114] If the network device is in an abnormal scenario, obtain configuration information that matches the abnormal scenario, including:
[0115] Step 504: If the network device is in a data structure optimization scenario, obtain a preset data structure type that matches the data structure optimization scenario.
[0116] Among them, the monitoring data of the network device is obtained by reading the map data structure of the first program. This network structure is provided by the operating system for the first program running in the kernel space to store the collected data. The map data structure can also be accessed by the second program running in the user space, so that the second program can read and export the monitoring data. It can be understood that the first program is an eBPF program running in the kernel space of the operating system of the network device. It transmits data to the outside through the map data structure, without switching between the user space and the kernel space, thereby reducing the performance loss of the network device.
[0117] According to the storage characteristics of the data, the map data structure can be divided into the following types: array, hash, percpu type corresponding to the array (i.e., percpu array) and percpu type corresponding to the hash (i.e., percpuhash). The percpu type means that a map is assigned to each CPU. At the same time, the map key can be specified as a string, integer, or custom data structure during initialization. The query, update, and deletion implementations of different types of map data structures are different, and the running performance is also different. Using different types of map data structures for different scenarios is very important for the operation of eBPF programs.
[0118] In one implementation, an array-type map data structure is used for data that needs to be polled and collected. If the initial data structure type is array, and the first program reads less and writes more (the number of reads is less than the second set number, and the number of writes is greater than the first set number), then the data structure type that matches the data structure optimization scenario is percpuarray; if the initial data structure type is percpu array, and the first program reads more and writes less (the number of reads is greater than the first set number, and the number of writes is less than the second set number), then the data structure type that matches the data structure optimization scenario is array.
[0119] In one implementation, if the initial data structure type is hash, and the first program reads less and writes more (the number of reads is less than the second set number, and the number of writes is greater than the first set number), then the data structure type that matches the data structure optimization scenario is obtained as percpu hash; if the initial data structure type is percpu hash, and the first program reads more and writes less (the number of reads is greater than the first set number, and the number of writes is less than the second set number), then the data structure type that matches the data structure optimization scenario is obtained as hash.
[0120] Step 506, generating configuration information matching the data structure optimization scenario according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
[0121] The determined data structure type is used as configuration information, and the first program is updated according to the configuration information, so that the first program uses the newly configured data structure type to store data during subsequent monitoring.
[0122] In the above embodiment, whether the network device is in a data structure optimization scenario is determined based on the number of reads and writes of the data structure by the first program. After being in the data structure optimization scenario, the data structure type of the monitoring data stored by the first program is adjusted. By selecting an appropriate data structure, the monitoring performance of the network device can be optimized.
[0123] In one embodiment, before step 202, the method further includes: during the initialization process, sending N first programs to the network device; the data structures maintained by each first program and used to store monitoring data are independent of each other.
[0124] Wherein, N is an integer greater than or equal to 1. Multiple first programs set in the same network device maintain corresponding map data structures, and the map data structures maintained by any two first programs are not shared, that is, they are independent of each other, thereby avoiding repeated storage of monitoring data.
[0125] In one implementation, during the initialization process, the second program and N first programs are sent to each monitored network device, and the server sends the second program and the first program to the network device, which facilitates the management and control of the network device.
[0126] Among them, the second program set in the same network device can interact with all the first programs to realize operations such as dynamically compiling the eBPF program and loading it into the kernel, and extracting monitoring data. Setting multiple first programs facilitates monitoring logic switching and backup operations during the operation of the network device. Optionally, by sending multiple first programs to the network device, multiple monitoring logics can be used simultaneously to monitor the network device.
[0127] In the above embodiment, during the initialization process, the server can monitor the network device in real time by sending at least one first program to the network device, so as to dynamically update the first program according to the target data characteristics in the monitoring data, thereby improving the monitoring effect on the network device.
[0128] In one embodiment, the N first programs include a first monitoring program and a second monitoring program; step 202 includes: determining the first monitoring program in the network device that is in a running state; controlling the first monitoring program to exit the running state, and controlling the second monitoring program to enter the running state; receiving monitoring data sent by the network device and obtained from the data structure maintained by the first monitoring program.
[0129] Among them, being in the running state means that the monitoring program has been successfully started on the network device, and the monitoring task is executed according to the set monitoring logic. Since the separation of the control plane and the data plane may cause the control plane to export data while the data plane is writing data, which destroys the consistency of the monitoring data, a snapshot function is provided in this embodiment to switch the running first program when exporting data without re-injecting a new first program, thereby reducing the impact of the exported data on the monitoring data collected by the network device and maintaining the consistency of the monitoring data. Specifically, the server can switch the first program by changing the index of the program in the running state. Among them, the first monitoring program and the second monitoring program both maintain corresponding map data structures, and the map data structures between the two cannot be shared.
[0130] In one implementation, the second program running in the user space obtains monitoring data from the data structure maintained by the first monitoring program, and sends the monitoring data to the server.
[0131] In the above embodiment, the running first program is switched when exporting data, and the monitoring data is obtained from the data structure maintained by the monitoring program that has exited the running state, so that the consistency of the monitoring data can be maintained.
[0132] In one implementation, referring to Figure 6 , Figure 6A process for obtaining monitoring data from network devices is shown. The first program can be understood as a program belonging to the data plane, running in the operating system kernel space, and the second program can be understood as a program belonging to the control plane, running in the operating system user space. Deploy the monitoring server and expose the specified API interface (Application Programming Interface). Users or external modules can interact with the monitoring system (a system consisting of servers and network devices) by accessing the API. During the server initialization process, call the config interface to pass in the configuration file, parse the configuration file and generate the second program, send the second program to the monitored network device for deployment, and form the control plane in the monitored network device.
[0133] The control plane includes a configuration parsing module and a data export module. The configuration parsing module can parse the data plane configuration file in JSON format (refer to Figure 6 The configuration file contains the following information: 1) the direction of the monitored traffic: ingress for inflow and egress for outflow; 2) the network indicators that need to be exported, represented by an array, where each indicator contains a name (name), an eBPF map name, and a brief introduction (help); 3) the network device interface (interface) that executes the eBPF program. After the parsing is completed, the control plane generates the eBPF program based on the information in the configuration file. The generation method can be to replace the placeholder in the template with the map name in the configuration file. Call the push method to push the eBPF program to the monitored network device.
[0134] The control plane in the monitored network device first compiles the eBPF program (in bytecode), and after verification by the compiler, injects the bytecode into the kernel space of the operating system (such as Linux) (refer to Figure 6 Step 3 in the above example) forms a data plane, which monitors network packets and stores the monitoring data in the specified map according to the configuration information (refer to Figure 6 4 in the previous step).
[0135] When a user or server obtains monitoring data, the control plane is responsible for reading the map and exporting the data (refer to Figure 6 Step 5 in the above example) returns the monitoring data to the user or server in JSON format (refer to Figure 6 Step 6 in the above example). The API interface called to obtain monitoring data can be a RESTful (Representational State Transfer) API interface.
[0136] To illustrate the effect of the data processing method in this solution in detail, a most detailed embodiment is described below:
[0137] The server collects monitoring data from network devices. Specifically, the eBPF program running in the kernel space of the network device operating system collects data corresponding to each network indicator, stores it in the map data structure provided by the network device operating system, and the program running in the user space of the network device operating system reads and exports the monitoring data from the map data structure and sends the monitoring data to the server.
[0138] The server extracts the features of the monitoring data, analyzes the features through predefined data analysis strategies, obtains analysis results, and determines whether the monitoring strategy needs to be adjusted. If adjustment is required, configuration information is generated according to the monitoring strategy that needs to be adjusted. The monitoring strategy includes specifying new monitoring indicators, starting defense strategies, adjusting data structure types, etc.
[0139] The server updates the eBPF program in the network device based on the configuration information. Specifically, when the server is initialized, the program belonging to the control plane and the program belonging to the data plane (i.e., the eBPF program) are sent to all network devices that need to be monitored. The monitored network devices run the program belonging to the control plane in the operating system user space and the program belonging to the data plane in the operating system kernel space. When the server updates the eBPF program, the server sends the configuration file to the monitored network device. The program belonging to the control plane running in the user space of the operating system of the monitored network device reads the eBPF source code, parses the network indicators that need to be monitored from the configuration file, compiles the eBPF program and loads it into the kernel space, thereby updating the program used for monitoring.
[0140] During the process of collecting monitoring data, due to the separation of the control plane and the data plane, the control plane may be exporting data while the data plane is writing data, thus destroying the consistency of the monitoring data. Based on this, the server provides a snapshot function. When collecting monitoring data, the server switches the currently running eBPF program to a cloned version. Specifically, two eBPF programs that cannot share the map data structure are injected, and program switching can be achieved by specifying the running eBPF program.
[0141] The server analyzes whether there are a large number of packets from the same source in a short period of time. If so, the monitoring strategy needs to be adjusted. Specifically, the monitoring indicators of the eBPF program are adjusted, and by adding synchronization flags and confirmation flags, it can be confirmed in the next monitoring cycle whether the network device has actually suffered a DDOS attack.
[0142] When the server analyzes whether the network device has actually been attacked by DDOS, it needs to adjust the monitoring strategy. Specifically, the eBPF program is updated based on the preset defense strategy, so that the eBPF program performs packet shielding, alarming or reporting for the network packets from the attacker.
[0143] When analyzing multiple source addresses that imitate the same host name to access the network device, the server determines that the network device has been subjected to a hijacking attack and needs to adjust the monitoring strategy. Specifically, the eBPF program is updated based on the preset defense strategy, so that the eBPF program blocks, alarms or reports network packets from the attacker.
[0144] Among them, when the server analyzes the eBPF program for map data with more reads and less writes or less reads and more writes, it is necessary to adjust the monitoring strategy. Specifically, for data that needs to be polled and collected, use the map data structure of the array type. For the case where the data plane reads more and writes less, using array is better than percpu array (similarly, using hash is better than percpu hash), and for the case where the data plane needs to write data (read less and write more), using percpu array is better than array (similarly, using percpu hash is better than hash).
[0145] Through the above methods, facing DDOS attack scenarios, hijacking attack scenarios, and data structure optimization scenarios, the server can understand the network environment in which the network equipment is located, dynamically update the eBPF program according to the network environment, and realize flexible adjustment of the monitoring logic, which is suitable for complex and changeable network environments. It can handle exceptions in a targeted manner and help restore the normal operation of network equipment. By taking advantage of the fact that the eBPF program does not need to switch between user space and kernel space, the performance loss caused by switching between user space and kernel space is reduced, and the operating performance of network equipment is improved. By taking advantage of the fact that the eBPF program does not need to restart the network equipment or monitoring process, the efficiency of dynamic updates can be improved.
[0146] 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.
[0147] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing 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 the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.
[0148] In one embodiment, Figure 7 As shown, a data processing device is provided, comprising:
[0149] The receiving module 702 is used to receive monitoring data sent by the network device, where the monitoring data is collected by the first program in the network device.
[0150] The extraction module 704 is used to extract target data features from the monitoring data and determine configuration information that matches the target data features.
[0151] The updating module 706 is used to update the first program according to the configuration information and monitor the network device through the updated first program.
[0152] In the above data processing device, the configuration information is determined according to the target data characteristics in the monitoring data of the network device, and the network environment in which the network device is located can be understood according to the target data characteristics, and the configuration information adapted to the current network environment can be determined. The first program for monitoring in the network device is updated according to the configuration information, that is, the first program is dynamically updated according to the network environment, so that the flexible adjustment of the monitoring logic is realized, which is suitable for complex and changeable network environments, improves the monitoring effect of the network device, and can greatly improve the security of the network device.
[0153] In one embodiment, the update module 706 is specifically used to obtain a target program that matches the first program in the network device; update the target program according to the configuration information, and send the updated target program to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
[0154] In one embodiment, the extraction module 704 is specifically used to determine whether the network device is in an abnormal scenario according to the target data characteristics; if the network device is in an abnormal scenario, obtain configuration information matching the abnormal scenario.
[0155] In one embodiment, the target data features include the source address, port and timestamp of the network data packet, and the abnormal scenario includes the attack scenario; the extraction module 704 is specifically used to determine M network data packets within a preset time period based on the timestamp; determine a first number of network data packets with the same source address and a second number of network data packets with the same port among the M network data packets; if the first number is greater than a first threshold and the second number is greater than a second threshold, it is determined that the network device is in an attack scenario; configuration information matching the attack scenario is generated based on a preset flag bit; wherein the preset flag bit is used to determine the network connection status between the source party that initiates the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag bit.
[0156] In one embodiment, the data processing device further includes a secondary update module;
[0157] A secondary update module is used to determine the target network data packet collected by the updated first program, the target network data packet is a network data packet from a set address and a set port; determine the parameter value of the preset flag bit of the target network data packet; if the parameter value represents a half-open connection, the first program is updated again based on the first defense strategy, so that the first program after the update executes the first defense strategy when detecting the target network data packet, and the first defense strategy includes at least one strategy of a data packet shielding strategy, an alarm strategy and a reporting strategy.
[0158] In one embodiment, the target data features include the host name and source address of the network data packet, and the abnormal scenario includes a hijacking attack scenario; the extraction module 704 is specifically used to determine P network data packets from the target host name; based on the source addresses of the P network data packets, the number of source addresses after deduplication is determined; if the number of source addresses is greater than a third threshold, it is determined that the network device is in a hijacking attack scenario; configuration information matching the hijacking attack scenario is generated according to the second defense strategy, so that the updated first program executes the second defense strategy when detecting a network data packet from the target host name, and the second defense strategy includes at least one of a packet shielding strategy, an alarm strategy, and a reporting strategy.
[0159] In one embodiment, the target data features include the number of reads and writes by the first program for a data structure, the data structure is a storage structure of monitoring data, and the abnormal scenarios include data structure optimization scenarios; the extraction module 704 is specifically used to determine that the network device is in a data structure optimization scenario if the number of reads is greater than a first set number and the number of writes is less than a second set number, or the number of reads is less than the second set number and the number of writes is greater than the first set number; the first set number is greater than the second set number; obtaining a preset data structure type that matches the data structure optimization scenario; generating configuration information that matches the data structure optimization scenario according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
[0160] In one embodiment, the data processing device further includes a sending module;
[0161] The sending module is used to send N first programs to the network device during the initialization process; the data structures maintained by each first program and used to store monitoring data are independent of each other.
[0162] In one embodiment, the N first programs include a first monitoring program and a second monitoring program; the receiving module 702 is also used to determine the first monitoring program in the network device that is in a running state; control the first monitoring program to exit the running state, and control the second monitoring program to enter the running state; receive monitoring data sent by the network device and obtained from the data structure maintained by the first monitoring program.
[0163] Each module in the above data processing 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 operations corresponding to each module.
[0164] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. 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 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 through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0165] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0166] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: receiving monitoring data sent by a network device, the monitoring data being collected by a first program in the network device; extracting target data features in the monitoring data, and determining configuration information matching the target data features; updating the first program according to the configuration information, and monitoring the network device through the updated first program.
[0167] In one embodiment, when the processor executes the computer program, it also implements the following steps: obtaining a target program that matches the first program in the network device; updating the target program according to the configuration information, and sending the updated target program to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
[0168] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining whether the network device is in an abnormal scenario based on the target data characteristics; if the network device is in an abnormal scenario, obtaining configuration information matching the abnormal scenario.
[0169] In one embodiment, the processor also implements the following steps when executing the computer program: determining, based on the timestamp, M network data packets within a preset time period; determining, among the M network data packets, a first number of network data packets with the same source address and a second number of network data packets with the same port; if the first number is greater than a first threshold and the second number is greater than a second threshold, determining that the network device is in an attack scenario; generating configuration information matching the attack scenario based on a preset flag bit; wherein the preset flag bit is used to determine the network connection status between the source of the initiator of the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag bit.
[0170] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the target network data packet collected by the updated first program, the target network data packet is a network data packet from a set address and a set port; determining the parameter value of a preset flag bit of the target network data packet; if the parameter value represents a half-open connection, then updating the first program again based on the first defense strategy, so that when the first program after the update is detected, the first defense strategy is executed, and the first defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0171] In one embodiment, the processor also implements the following steps when executing the computer program: determining P network data packets from the target host name; determining the number of deduplicated source addresses based on the source addresses of the P network data packets; if the number of source addresses is greater than a third threshold, determining that the network device is in a hijacking attack scenario; generating configuration information matching the hijacking attack scenario based on the second defense strategy, so that the updated first program executes the second defense strategy when detecting a network data packet from the target host name, the second defense strategy including at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0172] In one embodiment, the processor also implements the following steps when executing the computer program: if the number of reads is greater than the first set number and the number of writes is less than the second set number, or the number of reads is less than the second set number and the number of writes is greater than the first set number, it is determined that the network device is in a data structure optimization scenario; the first set number is greater than the second set number; a preset data structure type matching the data structure optimization scenario is obtained; configuration information matching the data structure optimization scenario is generated according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
[0173] In one embodiment, when executing the computer program, the processor further implements the following steps: during the initialization process, N first programs are sent to the network device; the data structures maintained by each first program and used to store monitoring data are independent of each other.
[0174] In one embodiment, when the processor executes the computer program, it also implements the following steps: determining a first monitoring program in a running state in the network device; controlling the first monitoring program to exit the running state, and controlling the second monitoring program to enter the running state; receiving monitoring data sent by the network device and obtained from a data structure maintained by the first monitoring program.
[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: receiving monitoring data sent by a network device, the monitoring data being collected by a first program in the network device; extracting target data features in the monitoring data, and determining configuration information that matches the target data features; updating the first program according to the configuration information, and monitoring the network device through the updated first program.
[0176] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a target program that matches the first program in the network device; updating the target program according to the configuration information, and sending the updated target program to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
[0177] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining whether the network device is in an abnormal scenario based on the target data characteristics; if the network device is in an abnormal scenario, obtaining configuration information matching the abnormal scenario.
[0178] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the timestamp, M network data packets within a preset time period are determined; among the M network data packets, a first number of network data packets with the same source address and a second number of network data packets with the same port are determined; if the first number is greater than a first threshold value and the second number is greater than a second threshold value, it is determined that the network device is in an attack scenario; configuration information matching the attack scenario is generated based on a preset flag bit; wherein the preset flag bit is used to determine the network connection status between the source of the initiator of the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag bit.
[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the target network data packet collected by the updated first program, the target network data packet is a network data packet from a set address and a set port; determining the parameter value of a preset flag bit of the target network data packet; if the parameter value represents a half-open connection, then updating the first program again based on the first defense strategy, so that the first program after the update executes the first defense strategy when detecting the target network data packet, and the first defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0180] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining P network data packets from the target host name; determining the number of deduplicated source addresses based on the source addresses of the P network data packets; if the number of source addresses is greater than a third threshold, determining that the network device is in a hijacking attack scenario; generating configuration information matching the hijacking attack scenario based on the second defense strategy, so that the updated first program executes the second defense strategy when detecting a network data packet from the target host name, the second defense strategy including at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0181] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the number of reads is greater than the first set number and the number of writes is less than the second set number, or the number of reads is less than the second set number and the number of writes is greater than the first set number, it is determined that the network device is in a data structure optimization scenario; the first set number is greater than the second set number; a preset data structure type matching the data structure optimization scenario is obtained; configuration information matching the data structure optimization scenario is generated according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
[0182] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: during the initialization process, N first programs are sent to the network device; the data structures maintained by each first program and used to store monitoring data are independent of each other.
[0183] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a first monitoring program in a running state in a network device; controlling the first monitoring program to exit the running state, and controlling the second monitoring program to enter the running state; receiving monitoring data sent by the network device and obtained from a data structure maintained by the first monitoring program.
[0184] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: receiving monitoring data sent by a network device, the monitoring data being collected by a first program in the network device; extracting target data features in the monitoring data, and determining configuration information that matches the target data features; updating the first program according to the configuration information, and monitoring the network device through the updated first program.
[0185] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a target program that matches the first program in the network device; updating the target program according to the configuration information, and sending the updated target program to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
[0186] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining whether the network device is in an abnormal scenario based on the target data characteristics; if the network device is in an abnormal scenario, obtaining configuration information matching the abnormal scenario.
[0187] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the timestamp, M network data packets within a preset time period are determined; among the M network data packets, a first number of network data packets with the same source address and a second number of network data packets with the same port are determined; if the first number is greater than a first threshold value and the second number is greater than a second threshold value, it is determined that the network device is in an attack scenario; configuration information matching the attack scenario is generated based on a preset flag bit; wherein the preset flag bit is used to determine the network connection status between the source of the initiator of the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag bit.
[0188] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the target network data packet collected by the updated first program, the target network data packet is a network data packet from a set address and a set port; determining the parameter value of a preset flag bit of the target network data packet; if the parameter value represents a half-open connection, then updating the first program again based on the first defense strategy, so that the first program after the update executes the first defense strategy when detecting the target network data packet, and the first defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0189] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining P network data packets from the target host name; determining the number of deduplicated source addresses based on the source addresses of the P network data packets; if the number of source addresses is greater than a third threshold, determining that the network device is in a hijacking attack scenario; generating configuration information matching the hijacking attack scenario based on the second defense strategy, so that the updated first program executes the second defense strategy when detecting a network data packet from the target host name, the second defense strategy including at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
[0190] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the number of reads is greater than the first set number and the number of writes is less than the second set number, or the number of reads is less than the second set number and the number of writes is greater than the first set number, it is determined that the network device is in a data structure optimization scenario; the first set number is greater than the second set number; a preset data structure type matching the data structure optimization scenario is obtained; configuration information matching the data structure optimization scenario is generated according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
[0191] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: during the initialization process, N first programs are sent to the network device; the data structures maintained by each first program and used to store monitoring data are independent of each other.
[0192] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a first monitoring program in a running state in a network device; controlling the first monitoring program to exit the running state, and controlling the second monitoring program to enter the running state; receiving monitoring data sent by the network device and obtained from a data structure maintained by the first monitoring program.
[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application 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.
[0194] 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.
[0195] 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.
[0196] 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 data processing method, characterized in that: The method comprises: Receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device; Extracting target data features from the monitoring data, and determining configuration information matching the target data features; The first program is updated according to the configuration information, and the network device is monitored through the updated first program.
2. The method according to claim 1, characterized in that The updating of the first program according to the configuration information includes: Acquire a target program that matches the first program in the network device; The target program is updated according to the configuration information, and the updated target program is sent to the network device to instruct the second program in the network device to use the updated target program as the updated first program and load the updated first program.
3. The method according to claim 1, characterized in that The determining of configuration information matching the target data feature includes: Determining whether the network device is in an abnormal scenario according to the target data characteristics; If the network device is in an abnormal scenario, obtain configuration information matching the abnormal scenario.
4. The method according to claim 3, characterized in that The target data feature includes a source address, a port, and a timestamp of a network data packet, and the abnormal scenario includes an attack scenario; and determining whether the network device is in an abnormal scenario according to the target data feature includes: Determine, according to the timestamp, M network data packets within a preset time period; Determine a first number of network data packets with the same source address and a second number of network data packets with the same port among the M network data packets; If the first number is greater than a first threshold value, and the second number is greater than a second threshold value, it is determined that the network device is in an attack scenario; The acquiring of configuration information matching the abnormal scenario includes: Configuration information matching the attack scenario is generated according to a preset flag bit; wherein the preset flag bit is used to determine the network connection status between the source of the network data packet and the network device, and the monitoring indicator of the first program updated according to the configuration information includes the preset flag bit.
5. The method according to claim 4, characterized in that After updating the first program according to the configuration information, the method further includes: Determine a target network data packet collected by the updated first program, wherein the target network data packet is a network data packet from a set address and a set port; Determine a parameter value of a preset flag bit of the target network data packet; If the parameter value represents a half-open connection, the first program is updated again so that the updated first program executes a first defense strategy when detecting a target network data packet, wherein the first defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
6. The method according to claim 3, characterized in that The target data feature includes a host name and a source address of a network data packet, and the abnormal scenario includes a hijacking attack scenario; and determining whether the network device is in an abnormal scenario according to the target data feature includes: Determine P network packets from the target host name; Determine the number of source addresses after deduplication according to the source addresses of the P network data packets; If the number of source addresses is greater than a third threshold, it is determined that the network device is in a hijacking attack scenario; The acquiring of configuration information matching the abnormal scenario includes: Configuration information matching the hijacking attack scenario is generated according to the second defense strategy, so that the updated first program executes the second defense strategy when a network data packet from a target host name is detected. The second defense strategy includes at least one of a data packet shielding strategy, an alarm strategy, and a reporting strategy.
7. The method according to claim 3, characterized in that The target data feature includes the number of times the first program reads and writes a data structure, the data structure is a storage structure of monitoring data, and the abnormal scenario includes a data structure optimization scenario; The determining, according to the target data feature, whether the network device is in an abnormal scenario includes: If the number of reads is greater than a first set number of times and the number of writes is less than a second set number of times, or the number of reads is less than the second set number of times and the number of writes is greater than the first set number of times, it is determined that the network device is in a data structure optimization scenario; the first set number of times is greater than the second set number of times; The acquiring of configuration information matching the abnormal scenario includes: Acquire a preset data structure type that matches the data structure optimization scenario; Configuration information matching the data structure optimization scenario is generated according to the preset data structure type; wherein the first program updated according to the configuration information is used to save the collected monitoring data according to the preset data structure type.
8. The method according to any one of claims 1 to 7, characterized in that Before receiving the monitoring data sent by the network device, the method further includes: During the initialization process, N first programs are sent to the network device; the data structures maintained by each first program and used to store monitoring data are independent of each other.
9. The method according to claim 8, characterized in that The N first programs include a first monitoring program and a second monitoring program; and the receiving monitoring data sent by the network device includes: Determining a first monitoring program in operation in the network device; Controlling the first monitoring program to exit the running state, and controlling the second monitoring program to enter the running state; Receive monitoring data sent by the network device and obtained from the data structure maintained by the first monitoring program.
10. A data processing device, characterized in that: The device comprises: A receiving module, used for receiving monitoring data sent by a network device, wherein the monitoring data is collected by a first program in the network device; An extraction module, used to extract target data features from the monitoring data and determine configuration information matching the target data features; An updating module is used to update the first program according to the configuration information and monitor the network device through the updated first program.
11. 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 9 are implemented.
12. 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 9 are implemented.
13. 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 9 are implemented.
Citation Information
Cited By
Method and system for updating state data of implantable electronic medical device
CN119153058A
