Server asset analysis method and device, equipment and medium
By performing feature extraction and grayscale graph generation on traffic logs, combined with training and fine-tuning of deep learning models, the problem of insufficient learning ability of decision tree models when detecting illegal resource occupation behaviors is solved, and the accuracy and reliability of detection are improved. Suitable for the image field.
Patent Information
- Application Number
- CN202411261184.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-03
AI Technical Summary
When the existing decision tree model detects illegal resource occupation behaviors in the server, it has weak learning ability, resulting in insufficient accuracy and reliability of detection and cannot be applied to the image field.
By cleaning, feature extraction and grayscale graph generation of traffic logs of source domain data sets and target domain data sets, grouping and splicing of preset traffic feature RGB graph generation rules and event graph construction rules to generate target event graphs. And train and fine-tune the initial deep learning model to build a target violation resource occupation behavior detection model.
It improves the accuracy, timeliness and reliability of detection of illegal resource occupation behaviors, expands the scope of detection application, including the image field, and improves user experience.
Smart Images

Figure CN119065938A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of asset analysis, and in particular to a server asset analysis method, device, equipment and medium. Background Art
[0002] In the process of detecting behaviors in the server, operations that deviate from normal user behaviors, such as mining behaviors, are often found. At present, when detecting behaviors that deviate from normal user behaviors, only the feature information corresponding to a single traffic packet is used to train the decision tree model, so as to use the decision tree model to detect illegal resource occupation behaviors. However, the decision tree model has a weak ability to learn data, that is, its ability to autonomously learn illegal resource occupation behaviors in various scenarios is poor, so the accuracy of detection cannot be guaranteed, and the application scope of the decision tree model is limited, and it cannot be applied to the image field.
[0003] As can be seen from the above, how to improve the accuracy of detecting illegal resource occupation behavior is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a server asset analysis method, device, equipment and medium, which can improve the accuracy, timeliness and reliability of detecting illegal resource occupation behaviors while ensuring the accuracy of server asset analysis operations, thereby improving user experience. The specific scheme is as follows:
[0005] In a first aspect, the present application provides a server asset analysis method, comprising:
[0006] After data cleaning is performed on each traffic log in the source domain data set and the target domain data set, feature extraction and grayscale image generation are performed on each cleaned log to obtain a target grayscale image corresponding to each cleaned log;
[0007] The target grayscale images are grouped using a preset traffic feature RGB image generation rule and the IP address information corresponding to each of the target grayscale images, and a corresponding target traffic feature RGB image is determined based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively;
[0008] Based on the preset event graph construction rules, preset hyperparameters, and each of the target traffic feature RGB graphs, corresponding horizontal RGB graph splicing and vertical RGB graph splicing are performed to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively;
[0009] After completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, the trained model is fine-tuned using the second target event graph to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
[0010] Optionally, before performing data cleaning on each traffic log in the source domain data set and the target domain data set, the process further includes:
[0011] Obtaining each traffic log in the source domain dataset and the target domain dataset;
[0012] The source domain data set includes behavior detection and classification data of corresponding non-target illegal resource occupation scenarios, and the target domain data set includes behavior detection and classification data of corresponding target illegal resource occupation scenarios.
[0013] Optionally, the data cleaning of each traffic log in the source domain data set and the target domain data set includes:
[0014] Determine whether the IP address information corresponding to each of the traffic logs is empty, so as to obtain the address determination results corresponding to each of the traffic logs;
[0015] For the address judgment result indicating that the corresponding IP address information is empty, data cleaning is performed on the corresponding traffic log.
[0016] Optionally, the extracting features and generating grayscale images of the obtained cleaned logs to obtain target grayscale images corresponding to the cleaned logs respectively include:
[0017] Extracting the flow characteristic information, time characteristic information and device fingerprint information from each of the cleaned logs respectively, to obtain target characteristic information corresponding to each of the cleaned logs; wherein the flow characteristic information includes IP address information, source port and target port, the time characteristic information includes log start time and log end time, and the device fingerprint information includes device type and asset type;
[0018] A two-dimensional grayscale image is generated based on a preset grayscale image generation rule and the target feature information corresponding to each of the cleaned logs, so as to obtain a target grayscale image corresponding to each of the cleaned logs.
[0019] Optionally, the using a preset traffic feature RGB map generation rule and the IP address information corresponding to each of the target grayscale maps to group each of the target grayscale maps, and determining a corresponding target traffic feature RGB map based on the obtained first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively, includes:
[0020] Based on the IP address information and the image generation time information respectively corresponding to each of the target grayscale images, each of the target grayscale images is grouped to obtain a first grouping result and a second grouping result respectively corresponding to the source domain data set and the target domain data set; wherein the first grouping result and the second grouping result respectively include a plurality of grayscale image combinations; each of the grayscale image combinations includes the corresponding target grayscale image and the corresponding IP address information and the image generation time information;
[0021] Based on a preset merging rule, each of the target grayscale images in each of the plurality of grayscale image combinations is merged to obtain a target flow feature RGB image corresponding to each of the grayscale image combinations.
[0022] Optionally, the construction rule based on the preset event graph, the preset hyperparameters and each of the target traffic feature RGB graphs performs corresponding horizontal RGB graph splicing and vertical RGB graph splicing to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively, including:
[0023] In the process of determining the target event graph corresponding to the target data set, the target traffic feature RGB graph corresponding to the target data set is extracted based on preset hyperparameters to obtain a preset number of RGB graphs to be converted; wherein the target data set is the source domain data set or the target domain data set, and the target event graph corresponding to the target data set is the first target event graph corresponding to the source domain data set or the second target event graph corresponding to the target domain data set;
[0024] Labeling each of the RGB images to be converted respectively, and completing a horizontal splicing operation corresponding to the RGB images to be converted based on a preset horizontal splicing rule and label information corresponding to each of the RGB images to be converted, so as to obtain a corresponding horizontal splicing result;
[0025] Vertical splicing is performed based on the horizontal splicing result and a preset vertical splicing rule to obtain a target event graph corresponding to the target data set.
[0026] Optionally, after completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, fine-tuning the obtained trained model using the second target event graph includes:
[0027] After completing model training corresponding to the pre-built initial deep learning model based on the first target event graph, determining whether a corresponding preset training round condition or a first preset model performance condition is currently met;
[0028] If the conditions are met, the trained model is fine-tuned based on the second target event graph until the preset fine-tuning round conditions or the second preset model performance conditions are met, and the corresponding target violation resource occupation behavior detection model is determined to use the target violation resource occupation behavior detection model to detect whether there are assets in the current server that are performing target violation resource occupation behavior.
[0029] In a second aspect, the present application provides a server asset analysis device, comprising:
[0030] A grayscale image acquisition module is used to perform feature extraction and grayscale image generation on each cleaned log after data cleaning of each traffic log in the source domain data set and the target domain data set, so as to obtain a target grayscale image corresponding to each cleaned log;
[0031] A traffic feature RGB map acquisition module is used to group each of the target grayscale images using a preset traffic feature RGB map generation rule and the IP address information corresponding to each of the target grayscale images, and determine a corresponding target traffic feature RGB map based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set respectively;
[0032] An event graph acquisition module is used to perform corresponding horizontal RGB graph splicing and vertical RGB graph splicing based on preset event graph construction rules, preset hyperparameters and each of the target traffic feature RGB graphs to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively;
[0033] The server asset analysis module is used to use the second target event graph to fine-tune the trained model after completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, so as to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
[0034] In a third aspect, the present application provides an electronic device, including:
[0035] Memory, used to store computer programs;
[0036] The processor is used to execute the computer program to implement the aforementioned server asset analysis method.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned server asset analysis method when executed by a processor.
[0038] As can be seen from the above, before performing server asset analysis, the present application needs to perform data cleaning on each traffic log in the source domain data set and the target domain data set, and then perform feature extraction and grayscale image generation on each cleaned log to obtain a target grayscale image corresponding to each of the cleaned logs; group each of the target grayscale images using a preset traffic feature RGB image generation rule and the IP address information corresponding to each of the target grayscale images, and determine the corresponding target traffic feature RGB image based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set; perform corresponding horizontal RGB image splicing and vertical RGB image splicing based on the preset event graph construction rule, preset hyperparameters and each of the target traffic feature RGB images to obtain a first target event graph and a second target event graph corresponding to the source domain data set and the target domain data set, respectively; after completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, fine-tune the obtained trained model using the second target event graph to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning. That is, in the process of server asset analysis, the present application needs to perform data cleaning, feature extraction, and grayscale image generation operations on each traffic log in the source domain data set and the target domain data set, and determine the target traffic feature RGB map by grouping and splicing the obtained target grayscale map. Then, the target traffic feature RGB map is used to generate an event map, and the first target event map and the second target event map corresponding to the source domain data set and the target domain data set are obtained based on the preset event map construction rules. Finally, the generated event map is used to train and fine-tune the initial deep learning model, so as to perform corresponding server asset analysis operations on the server based on the obtained target illegal resource occupation behavior detection model. In this way, the accuracy, timeliness and reliability of the detection of illegal resource occupation behavior can be improved while ensuring the accuracy of the server asset analysis operation, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0040] Figure 1 A flow chart of a server asset analysis method disclosed in this application;
[0041] Figure 2 A schematic diagram of each training stage when training a ResNet-50 model disclosed in this application;
[0042] Figure 3 A schematic diagram of the accuracy of detection results of different types of models disclosed in this application;
[0043] Figure 4 A schematic diagram of a specific event graph generation process disclosed in this application;
[0044] Figure 5 This is a schematic diagram of the structure of a server asset analysis device disclosed in this application;
[0045] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] In the process of detecting behaviors in the server, operations that deviate from normal user behaviors are often found. At present, when detecting behaviors that deviate from normal user behaviors, only the feature information corresponding to a single traffic packet is used to train the decision tree model to detect illegal resource occupation behaviors. However, the decision tree model has a weak ability to learn data, that is, its ability to autonomously learn illegal resource occupation behaviors in various scenarios is poor, so the accuracy of detection cannot be guaranteed, and the application scope of the decision tree model is limited, and it cannot be applied to the image field. To this end, the present application proposes a server asset analysis method that can improve the accuracy, timeliness and reliability of detection of illegal resource occupation behaviors while ensuring the accuracy of server asset analysis operations, thereby improving user experience.
[0048] See also Figure 1 As shown, an embodiment of the present invention discloses a server asset analysis method, including:
[0049] Step S11, after data cleaning is performed on each traffic log in the source domain data set and the target domain data set, feature extraction and grayscale image generation are performed on each cleaned log to obtain a target grayscale image corresponding to each cleaned log.
[0050] In this embodiment, a server asset analysis method is implemented based on transfer learning. It can be understood that transfer learning refers to accelerating and improving learning performance by transferring the knowledge learned in one task to another related task. The source domain dataset in transfer learning is a task or dataset that has been learned, and the target domain dataset is a new task or dataset to be solved. In an embodiment of the present application, the above-mentioned source domain dataset includes corresponding behavior detection and classification data of non-target illegal resource occupation scenarios, and the target domain dataset includes corresponding behavior detection and classification data of target illegal resource occupation scenarios.
[0051] It should be understood that, in this embodiment, before performing corresponding operations on each flow log in the source domain data set and the target domain data set, the original source domain flow and the target domain flow are divided into multiple communication packets to obtain a corresponding source domain data set and a target domain data set containing a plurality of flow logs. Specifically, before performing data cleaning on each flow log in the source domain data set and the target domain data set, it can also include: obtaining each flow log in the source domain data set and the target domain data set.
[0052] It is understandable that after obtaining each of the traffic logs corresponding to the source domain data set and the target domain data set, it is necessary to perform data cleaning on the above-mentioned traffic logs. During the data cleaning process, the embodiment of the present application uses IP address (Internet Protocol) information to perform data cleaning on each traffic log, that is, to clean the traffic logs in which the source IP address and the target IP address in each traffic log are empty. Specifically, performing data cleaning on each of the traffic logs in the source domain data set and the target domain data set may include: determining whether the IP address information corresponding to each of the traffic logs is empty, so as to obtain the address judgment results corresponding to each of the traffic logs; for the address judgment results indicating that the corresponding IP address information is empty, performing data cleaning on the corresponding traffic log.
[0053] In this embodiment, after obtaining each of the cleaned logs after data cleaning, it is necessary to perform feature extraction operations and grayscale image generation operations on each of the cleaned logs. Specifically, feature extraction and grayscale image generation are performed on each of the cleaned logs to obtain target grayscale images corresponding to each of the cleaned logs. The operations may include: extracting flow feature information, time feature information and device fingerprint information from each of the cleaned logs to obtain target feature information corresponding to each of the cleaned logs; wherein the flow feature information includes IP address information (including source IP address and target IP address), source port, target port, communication protocol and attack chain features, the time feature information includes log start time and log end time, and the device fingerprint information includes device type and asset type; based on a preset grayscale image generation rule and the target feature information corresponding to each of the cleaned logs, a two-dimensional grayscale image is generated to obtain a target grayscale image corresponding to each of the cleaned logs.
[0054] It is understandable that after extracting the flow characteristic information, the time characteristic information and the device fingerprint information in each cleaned log, a two-dimensional grayscale image needs to be generated based on the preset grayscale image generation rules and the target characteristic information corresponding to each of the cleaned logs. In a specific embodiment, the flow characteristic information, the time characteristic information and the device fingerprint information in each of the cleaned logs are 64 bytes of data in total, and the preset grayscale image generation rule is to convert the above 64 bytes of data into a two-dimensional grayscale image of size 8*8, wherein the grayscale value (i.e., pixel value) corresponding to each pixel in the two-dimensional grayscale image represents one byte.
[0055] Step S12, grouping each of the target grayscale images using the preset traffic feature RGB image generation rules and the IP address information corresponding to each of the target grayscale images, and determining the corresponding target traffic feature RGB image based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively.
[0056] In this embodiment, after obtaining each target grayscale image, it is necessary to use the preset flow feature RGB (RedGreen Blue, i.e., red, yellow, and blue) map generation rules are used, and each target grayscale map is grouped based on the IP address information corresponding to each of the target grayscale maps, so as to determine the corresponding target traffic feature RGB map based on the obtained grouping results. Specifically, each target grayscale map is grouped based on the preset traffic feature RGB map generation rules and the IP address information corresponding to each target grayscale map, and the corresponding target traffic feature RGB map is determined based on the first grouping results and the second grouping results corresponding to the source domain data set and the target domain data set, respectively. It can include: based on the IP address information and image generation time information corresponding to each target grayscale map, each target grayscale map is grouped to obtain the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively; wherein the first grouping result and the second grouping result respectively include a plurality of grayscale map combinations; each grayscale map combination includes the corresponding target grayscale map and the corresponding IP address information and the image generation time information; each target grayscale map in each of the plurality of grayscale map combinations is merged based on the preset merging rules to obtain the target traffic feature RGB map corresponding to each grayscale map combination.
[0057] In a specific implementation, each grayscale image combination includes three two-dimensional grayscale images with adjacent generation times and the same IP address information. Afterwards, the three grayscale images are extracted into red, green, and blue channels in chronological order, and merged into a target traffic feature RGB image, that is, in each of the three traffic grayscale images in chronological order, the first image is used as R, the second image is used as G, and the third image is used as B. Finally, the three channels are fused into a target traffic feature RGB image. It can be seen that the target traffic feature RGB image will contain more complex traffic feature information than the grayscale image, and also contain traffic time series information.
[0058] Step S13, based on the preset event graph construction rules, preset hyperparameters and each of the target traffic feature RGB graphs, corresponding horizontal RGB graph splicing and vertical RGB graph splicing are performed to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively.
[0059] Specifically, in this embodiment, after obtaining each of the target traffic feature RGB maps, it is necessary to determine the target event map based on each of the target traffic feature RGB maps. Specifically, based on the preset event map construction rules, preset hyperparameters, and each of the target traffic feature RGB maps, corresponding horizontal RGB map splicing and vertical RGB map splicing are performed to obtain a first target event map and a second target event map corresponding to the source domain data set and the target domain data set, respectively, which may include: in the process of determining the target event map corresponding to the target data set, the target traffic feature RGB map corresponding to the target data set is extracted based on the preset hyperparameters to obtain a preset number of RGB maps to be converted.
[0060] Subsequently, after extracting a preset number of RGB images to be converted, the RGB images to be converted can be numbered in order from small to large according to the generation time sequence. Specifically, in the process of determining the target event graph corresponding to the target data set, after extracting the target traffic feature RGB graph corresponding to the target data set based on the preset hyperparameters to obtain a preset number of RGB images to be converted, it can also include: respectively numbering each RGB image to be converted, and completing the horizontal splicing operation corresponding to the RGB image to be converted based on the preset horizontal splicing rules and the labeling information corresponding to each RGB image to be converted to obtain the corresponding horizontal splicing result; performing vertical splicing based on the horizontal splicing result and the preset vertical splicing rules to obtain the target event graph corresponding to the target data set; wherein the target data set is a source domain data set or a target domain data set, and the target event graph corresponding to the target data set is the first target event graph corresponding to the source domain data set or the second target event graph corresponding to the target domain data set.
[0061] It should be understood that in this embodiment, the preset hyperparameters are the hyperparameters that constitute the event graph. Generally, the hyperparameters need to be optimized so as to select the most suitable ones as the preset hyperparameters, thereby improving the effect of event graph construction. In a specific implementation, if the preset hyperparameter N is 2, each of the target traffic feature RGB images will be converted into a target event graph of size 2*2. The process of generating the target event graph is as follows: according to the preset hyperparameter, that is, the number 2, input 2*2 target traffic feature RGB images, whose subscript serial number is [0, ..., 2*2-1]; first extract the subscript sequence [0, ..., 2-1], a total of 2 RGB images, and splice them horizontally from left to right to form a 1*2 horizontal column with subscript 0, and then continue to extract the subscript sequence [2, ..., 2*2-1], a total of 2 RGB images, and splice them horizontally to form a 1*2 horizontal column with subscript 1, until the subscript sequence [(N-1)*N, ..., N*N-1] is extracted, a total of N RGB images, and splice them horizontally to form a 1*N horizontal column with subscript N-1, and then complete the construction of N RGB horizontal columns with a length of 1*N. Since N=2 at this time, the construction of 2 RGB horizontal columns with a length of 1*2 is completed, thereby obtaining a horizontal splicing result. Then, vertical splicing is performed from top to bottom in the order of horizontal column subscripts, and finally a target event graph of size 2*2 is obtained. It is worth mentioning that the byte size of the final generated event graph is (2*8)*(2*8) bytes, and it not only contains complex traffic feature information, but also contains more temporal relationship information between traffic logs.
[0062] Step S14: After completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, fine-tune the trained model using the second target event graph to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
[0063] In this embodiment, after generating the first target event graph and the second target event graph, the pre-constructed initial deep learning model needs to be trained using the first target event graph and the second target event graph. Specifically, after completing the model training corresponding to the pre-constructed initial deep learning model based on the first target event graph, fine-tuning the obtained trained model using the second target event graph can include: after completing the model training corresponding to the pre-constructed initial deep learning model based on the first target event graph, determining whether the corresponding preset training round condition or the first preset model performance condition is currently met; if so, fine-tuning the obtained trained model based on the second target event graph until the preset fine-tuning round condition or the second preset model performance condition is met, determining the corresponding target violation resource occupation behavior detection model, and using the target violation resource occupation behavior detection model to detect whether there are assets in the current server that are performing target violation resource occupation behavior.
[0064] In a specific implementation, the pre-built initial deep learning model may be a ResNet-50 model (Residual Network with 50 layers, a deep residual network). That is, the present application embodiment may select the ResNet-50 model as the basic model for training and detection reasoning. The structure of the above-mentioned ResNet-50 model is as follows: Figure 2 As shown, Figure 2The first stage is the analysis and processing of the input first target event graph by the model, and the second to fourth stages are the stages of feature learning of the ResNet model. Since the relevant ResNet is a commonly used model in deep learning, its specific structure is not limited here. First, while the first target event graph is input into the ResNet-50 model for training, the training rounds can be counted, or the performance of the first model can be calculated. When the training rounds are greater than the preset training round threshold or when the performance of the first model is greater than the first preset performance threshold, the operation of the ResNet-50 model using the first target event graph for training can be terminated, and the trained ResNet-50 model can be obtained. Subsequently, the second target event graph is input into the trained ResNet-50 model for fine-tuning, and the fine-tuning rounds can be counted, or the performance of the second model can be calculated. When the fine-tuning rounds are greater than the preset fine-tuning round threshold or when the performance of the second model is greater than the second preset performance threshold, the operation of the trained ResNet-50 model using the second target event graph for training can be terminated, and the target illegal resource occupation behavior detection model can be obtained. Among them, the fine-tuning operation is an operation of fine-tuning all model structure layers of the obtained trained model, that is, fine-tuning the feature extraction layer, feature learning layer and classification layer in the ResNet-50 model based on the second target event graph. It can be understood that in this embodiment, in most cases, since the amount of data of the source domain data set is much larger than the target domain data set, the number of the first target event graphs corresponding to the source domain data set is much larger than the number of the second target event graphs corresponding to the target domain data set.
[0065] In this embodiment, after obtaining the target illegal resource occupation behavior detection model, the target illegal resource occupation behavior detection model can be verified and tested using the actual scene traffic data collected in advance to obtain the first test result. That is, the actual scene traffic data collected in advance can be input into the target illegal resource occupation behavior detection model obtained after fine-tuning and the initial ResNet-50 model and the convolutional neural network model (Convolutional Neural Network, CNN) as the control group to obtain the corresponding accuracy test results. Figure 3 As shown, the first test result corresponding to the target illegal resource occupation behavior detection model is 93.5, the second test result corresponding to the initial ResNet-50 model is 88.6, and the third test result corresponding to the convolutional neural network model is 83.1. It can be obtained from the above numerical values that the target illegal resource occupation behavior detection model described in this embodiment has better abnormal behavior detection results.
[0066] Among them, this solution uses accuracy ACC (Accuracy) as the accuracy evaluation indicator of each model. The calculation formula of accuracy ACC is as follows:
[0067] ;
[0068] Among them, TP represents the number of samples that the model predicts as positive samples; TN represents the number of samples that the model predicts as negative samples; FP represents the number of samples that the model predicts as positive samples; FN represents the number of samples that the model predicts as negative samples.
[0069] From the above, it can be seen that in the process of server asset analysis in this application, it is necessary to perform data cleaning, feature extraction and grayscale image generation operations on each traffic log in the source domain data set and the target domain data set, and determine the target traffic feature RGB map by grouping and splicing the obtained target grayscale map. Then, the target traffic feature RGB map is used to generate an event map, and the first target event map and the second target event map corresponding to the source domain data set and the target domain data set are obtained based on the preset event map construction rules. Finally, the generated event map is used to train and fine-tune the initial deep learning model, so as to perform corresponding server asset analysis operations on the server based on the obtained target illegal resource occupation behavior detection model. In this way, the accuracy, timeliness and reliability of the detection of illegal resource occupation behavior can be improved while ensuring the accuracy of the server asset analysis operation, thereby improving the user experience.
[0070] Combine the following Figure 4 The schematic diagram disclosed in the figure specifically illustrates the technical solution of the embodiment of the present application.
[0071] In this embodiment, the event graph generation process consists of six stages. The specific steps are as follows:
[0072] In the first stage, the original source domain traffic data and target domain traffic data need to be divided into traffic logs to obtain the corresponding source domain data set and target domain data set;
[0073] In the second stage, each traffic log is cleaned. That is, the traffic logs with empty source IP addresses and target IP addresses are cleaned to obtain cleaned logs;
[0074] In the third stage, the characteristic information such as traffic characteristics, time characteristics and device fingerprints corresponding to each cleaned log is extracted, where the traffic characteristic information includes IP address information, source port and destination port, the time characteristic information includes log start time and log end time, and the device fingerprint information includes device type and asset type;
[0075] In the fourth stage, a two-dimensional grayscale image is generated based on a preset grayscale image generation rule and target feature information corresponding to each cleaned log, so as to obtain a target grayscale image corresponding to each cleaned log;
[0076] In the fifth stage, each target grayscale image is grouped to obtain a first grouping result and a second grouping result corresponding to the source domain data set and the target domain data set respectively; it is worth mentioning that the first grouping result and the second grouping result respectively include several grayscale image combinations; each grayscale image combination includes a corresponding target grayscale image and corresponding IP address information and image generation time information; then, each target grayscale image in each of the several grayscale image combinations needs to be merged based on a preset merging rule to obtain a target traffic feature RGB image corresponding to each grayscale image combination;
[0077] In the sixth stage, the RGB map with target traffic characteristics is extracted based on preset hyperparameters to obtain a preset number of RGB maps to be converted; it is worth mentioning that the target data set is a source domain data set or a target domain data set, and the target event map corresponding to the target data set is the first target event map corresponding to the source domain data set or the second target event map corresponding to the target domain data set; then, each RGB map to be converted is labeled, and the RGB map to be converted is horizontally spliced to obtain the corresponding horizontal splicing result; finally, the horizontal splicing results are vertically spliced based on the preset vertical splicing rules to obtain the target event map corresponding to the target data set.
[0078] It can be seen that in the process of server asset analysis, the present application needs to perform data cleaning, feature extraction and grayscale image generation operations on each traffic log in the source domain data set and the target domain data set, and determine the target traffic feature RGB map by grouping and splicing the obtained target grayscale map. Then, the target traffic feature RGB map is used to generate an event map, and the first target event map and the second target event map corresponding to the source domain data set and the target domain data set are obtained based on the preset event map construction rules. Finally, the generated event map is used to train and fine-tune the initial deep learning model, so as to perform corresponding server asset analysis operations on the server based on the obtained target illegal resource occupation behavior detection model. In this way, the accuracy, timeliness and reliability of the detection of illegal resource occupation behavior can be improved while ensuring the accuracy of the server asset analysis operation, thereby improving the user experience.
[0079] For details, see Figure 5 As shown, the present application also provides a server asset analysis device, including:
[0080] A grayscale image acquisition module 11 is used to perform feature extraction and grayscale image generation on each cleaned log after data cleaning of each traffic log in the source domain data set and the target domain data set, so as to obtain a target grayscale image corresponding to each cleaned log;
[0081] The traffic feature RGB map acquisition module 12 is used to group each of the target grayscale images using a preset traffic feature RGB map generation rule and the IP address information corresponding to each of the target grayscale images, and determine the corresponding target traffic feature RGB map based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set respectively;
[0082] An event graph acquisition module 13 is used to perform corresponding horizontal RGB graph splicing and vertical RGB graph splicing based on preset event graph construction rules, preset hyperparameters and each of the target traffic feature RGB graphs to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively;
[0083] The server asset analysis module 14 is used to use the second target event graph to fine-tune the trained model after completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, so as to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
[0084] As can be seen from the above, before performing server asset analysis, the embodiment of the present application needs to perform data cleaning, feature extraction, and grayscale image generation operations on each traffic log in the source domain data set and the target domain data set, and determine the target traffic feature RGB map by grouping and splicing the obtained target grayscale map. Then, the target traffic feature RGB map is used to generate an event map, and the first target event map and the second target event map corresponding to the source domain data set and the target domain data set are obtained based on the preset event map construction rules. Finally, the generated event map is used to train and fine-tune the initial deep learning model, so as to perform corresponding server asset analysis operations on the server based on the obtained target illegal resource occupation behavior detection model. In this way, the accuracy, timeliness and reliability of the detection of illegal resource occupation behavior can be improved while ensuring the accuracy of the server asset analysis operation, thereby improving the user experience.
[0085] In some specific implementations, the grayscale image acquisition module 11 may specifically include:
[0086] A traffic log acquisition unit is used to acquire each traffic log in the source domain data set and the target domain data set; wherein the source domain data set includes behavior detection and classification data of corresponding non-target illegal resource occupation scenarios, and the target domain data set includes behavior detection and classification data of corresponding target illegal resource occupation scenarios.
[0087] In some specific implementations, the grayscale image acquisition module 11 may specifically include:
[0088] An address judgment result acquisition unit, used to judge whether the IP address information corresponding to each of the traffic logs is empty, so as to obtain the address judgment results corresponding to each of the traffic logs;
[0089] The data cleaning unit is used to clean the corresponding traffic log according to the address judgment result indicating that the corresponding IP address information is empty.
[0090] In some specific implementations, the grayscale image acquisition module 11 may specifically include:
[0091] A characteristic information acquisition unit, used to extract the flow characteristic information, time characteristic information and device fingerprint information in each of the cleaned logs, so as to obtain target characteristic information corresponding to each of the cleaned logs; wherein the flow characteristic information includes IP address information, source port and target port, the time characteristic information includes log start time and log end time, and the device fingerprint information includes device type and asset type;
[0092] The grayscale image acquisition subunit is used to generate a two-dimensional grayscale image based on a preset grayscale image generation rule and the target feature information corresponding to each of the cleaned logs, so as to obtain a target grayscale image corresponding to each of the cleaned logs.
[0093] In some specific implementations, the traffic feature RGB image acquisition module 12 may specifically include:
[0094] A grouping result acquisition unit, configured to group the target grayscale images based on the IP address information and the image generation time information respectively corresponding to the target grayscale images, so as to obtain a first grouping result and a second grouping result respectively corresponding to the source domain data set and the target domain data set; wherein the first grouping result and the second grouping result respectively include a plurality of grayscale image combinations; each grayscale image combination includes the corresponding target grayscale image and the corresponding IP address information and the image generation time information;
[0095] The traffic feature RGB image acquisition subunit is used to merge each of the target grayscale images in each of the plurality of grayscale image combinations based on a preset merging rule to obtain a target traffic feature RGB image corresponding to each of the grayscale image combinations.
[0096] In some specific implementations, the event graph acquisition module 13 may specifically include:
[0097] The RGB image to be converted acquisition unit is used to extract the target traffic feature RGB image corresponding to the target data set based on preset hyperparameters in the process of determining the target event image corresponding to the target data set, so as to obtain a preset number of RGB images to be converted; wherein the target data set is the source domain data set or the target domain data set, and the target event image corresponding to the target data set is the first target event image corresponding to the source domain data set or the second target event image corresponding to the target domain data set;
[0098] A stitching result acquisition unit, used to label each of the RGB images to be converted, and complete the horizontal stitching operation corresponding to the RGB images to be converted based on a preset horizontal stitching rule and the label information corresponding to each of the RGB images to be converted, so as to obtain a corresponding horizontal stitching result;
[0099] The first event graph acquisition unit is used to perform vertical splicing based on the horizontal splicing result and a preset vertical splicing rule to obtain a target event graph corresponding to the target data set.
[0100] In some specific implementations, the server asset analysis module 14 may specifically include:
[0101] A second event graph acquisition unit is used to determine whether a corresponding preset training round condition or a first preset model performance condition is currently met after completing model training corresponding to the pre-built initial deep learning model based on the first target event graph;
[0102] The illegal resource occupation behavior detection model acquisition unit is used to, if satisfied, fine-tune the obtained trained model based on the second target event graph until the preset fine-tuning round condition or the second preset model performance condition is met, and then determine the corresponding target illegal resource occupation behavior detection model to use the target illegal resource occupation behavior detection model to detect whether there are assets in the current server that are performing the target illegal resource occupation behavior.
[0103] Furthermore, the present application also discloses an electronic device. Figure 6This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the server asset analysis method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0104] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0105] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0106] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the server asset analysis method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0107] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the server asset analysis method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0108] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0109] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0110] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0111] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0112] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A server asset analysis method, characterized in that: include: After data cleaning is performed on each traffic log in the source domain data set and the target domain data set, feature extraction and grayscale image generation are performed on each cleaned log to obtain a target grayscale image corresponding to each cleaned log; The target grayscale images are grouped using a preset traffic feature RGB image generation rule and the IP address information corresponding to each of the target grayscale images, and a corresponding target traffic feature RGB image is determined based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively; Based on the preset event graph construction rules, preset hyperparameters, and each of the target traffic feature RGB graphs, corresponding horizontal RGB graph splicing and vertical RGB graph splicing are performed to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively; After completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, the trained model is fine-tuned using the second target event graph to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
2. The server asset analysis method according to claim 1, characterized in that: Before performing data cleaning on each traffic log in the source domain data set and the target domain data set, the method further includes: Obtaining each traffic log in the source domain dataset and the target domain dataset; The source domain data set includes behavior detection and classification data of corresponding non-target illegal resource occupation scenarios, and the target domain data set includes behavior detection and classification data of corresponding target illegal resource occupation scenarios.
3. The server asset analysis method according to claim 1, characterized in that: The data cleaning of each traffic log in the source domain data set and the target domain data set includes: Determine whether the IP address information corresponding to each of the traffic logs is empty, so as to obtain the address determination results corresponding to each of the traffic logs; For the address judgment result indicating that the corresponding IP address information is empty, data cleaning is performed on the corresponding traffic log.
4. The server asset analysis method according to claim 1, characterized in that: The feature extraction and grayscale image generation of each cleaned log obtained to obtain a target grayscale image corresponding to each cleaned log respectively includes: Extracting the flow characteristic information, time characteristic information and device fingerprint information from each of the cleaned logs respectively, to obtain target characteristic information corresponding to each of the cleaned logs; wherein the flow characteristic information includes IP address information, source port and target port, the time characteristic information includes log start time and log end time, and the device fingerprint information includes device type and asset type; A two-dimensional grayscale image is generated based on a preset grayscale image generation rule and the target feature information corresponding to each of the cleaned logs, so as to obtain a target grayscale image corresponding to each of the cleaned logs.
5. The server asset analysis method according to claim 1, characterized in that: The method of grouping the target grayscale images by using a preset traffic feature RGB image generation rule and the IP address information corresponding to each of the target grayscale images, and determining the corresponding target traffic feature RGB image based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set, respectively, includes: Based on the IP address information and the image generation time information respectively corresponding to each of the target grayscale images, each of the target grayscale images is grouped to obtain a first grouping result and a second grouping result respectively corresponding to the source domain data set and the target domain data set; wherein the first grouping result and the second grouping result respectively include a plurality of grayscale image combinations; each of the grayscale image combinations includes the corresponding target grayscale image and the corresponding IP address information and the image generation time information; Based on a preset merging rule, each of the target grayscale images in each of the plurality of grayscale image combinations is merged to obtain a target flow feature RGB image corresponding to each of the grayscale image combinations.
6. The server asset analysis method according to any one of claims 1 to 5, characterized in that: The method of performing corresponding horizontal RGB image splicing and vertical RGB image splicing based on the preset event graph construction rules, preset hyperparameters and each of the target traffic feature RGB images to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively, includes: In the process of determining the target event graph corresponding to the target data set, the target traffic feature RGB graph corresponding to the target data set is extracted based on preset hyperparameters to obtain a preset number of RGB graphs to be converted; wherein the target data set is the source domain data set or the target domain data set, and the target event graph corresponding to the target data set is the first target event graph corresponding to the source domain data set or the second target event graph corresponding to the target domain data set; Labeling each of the RGB images to be converted respectively, and completing a horizontal splicing operation corresponding to the RGB images to be converted based on a preset horizontal splicing rule and label information corresponding to each of the RGB images to be converted, so as to obtain a corresponding horizontal splicing result; Vertical splicing is performed based on the horizontal splicing result and a preset vertical splicing rule to obtain a target event graph corresponding to the target data set.
7. The server asset analysis method according to claim 1, characterized in that: After completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, fine-tuning the obtained trained model using the second target event graph includes: After completing model training corresponding to the pre-built initial deep learning model based on the first target event graph, determining whether a corresponding preset training round condition or a first preset model performance condition is currently met; If the conditions are met, the trained model is fine-tuned based on the second target event graph until the preset fine-tuning round conditions or the second preset model performance conditions are met, and the corresponding target violation resource occupation behavior detection model is determined to use the target violation resource occupation behavior detection model to detect whether there are assets in the current server that are performing target violation resource occupation behavior.
8. A server asset analysis device, characterized in that: include: A grayscale image acquisition module is used to perform feature extraction and grayscale image generation on each cleaned log after data cleaning of each traffic log in the source domain data set and the target domain data set, so as to obtain a target grayscale image corresponding to each cleaned log; A traffic feature RGB map acquisition module is used to group each of the target grayscale images using a preset traffic feature RGB map generation rule and the IP address information corresponding to each of the target grayscale images, and determine a corresponding target traffic feature RGB map based on the first grouping result and the second grouping result corresponding to the source domain data set and the target domain data set respectively; An event graph acquisition module is used to perform corresponding horizontal RGB graph splicing and vertical RGB graph splicing based on preset event graph construction rules, preset hyperparameters and each of the target traffic feature RGB graphs to obtain a first target event graph and a second target event graph corresponding to the source domain dataset and the target domain dataset, respectively; The server asset analysis module is used to use the second target event graph to fine-tune the trained model after completing the model training corresponding to the pre-built initial deep learning model based on the first target event graph, so as to detect whether there are assets in the current server that are performing target illegal resource occupation behavior based on the target illegal resource occupation behavior detection model obtained after fine-tuning.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the server asset analysis method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the server asset analysis method according to any one of claims 1 to 7 are implemented.
