Automatic detection method of software data security based on artificial intelligence
Through the automatic detection method of software data security based on artificial intelligence, using the clustering technology of abnormal possible values, score values and quantile judgment values, the problem of inaccurate detection caused by unreasonable division of software data is solved, and the accuracy of software data is achieved. Accuracy of anomaly detection and information transfer.
Patent Information
- Application Number
- CN202410264969.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-03-08
AI Technical Summary
Due to different data types and frequencies in software data anomaly detection, existing methods lead to unreasonable division of software data and are unable to accurately detect anomalies in software data, affecting the accuracy of information transmission.
The software data security automatic detection method based on artificial intelligence is used to obtain the possible abnormal values, abnormal score values and quantile judgment values of the software data, and perform clustering to improve the accuracy and efficiency of detection. Specific steps include obtaining abnormal possible values of software data, calculating abnormal score values, clustering through hierarchical clustering and k-means algorithm, and adjusting the quantile line position in the boxplot algorithm.
It achieves accurate anomaly detection of software data, improves the correctness and accuracy of information, and ensures the security of software data and the reliability of transmission.
Smart Images

Figure CN118133281B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to an automatic software data security detection method based on artificial intelligence. Background Art
[0002] Software plays an important role in various fields. There are various potential security risks in the software system, such as abnormalities in the software data itself, malicious code injection, etc., which can easily lead to damage and errors in information resources and cause losses to users. Therefore, it is necessary to detect the security of software data, obtain abnormal software data in the software data, and ensure the accuracy of transmitted information.
[0003] Among the existing methods, the most commonly used one is to detect anomalies in software data through the box plot algorithm. The box plot algorithm provides key information about the location, dispersion and outliers of the software data, and can determine the distribution and anomalies of the software data. However, in actual situations, the data types and frequencies of software data are different, and the distribution of software data of different data types may be relatively scattered. At the same time, different anomaly reasons lead to different anomalies in software data. Therefore, when detecting anomalies in software data, it is easy to fail to accurately detect anomalies in software data due to unreasonable division of software data, thereby failing to ensure the accuracy of transmitted information. Summary of the invention
[0004] In order to solve the technical problem that the software data cannot be accurately detected due to unreasonable division of software data, the purpose of the present invention is to provide a software data security automatic detection method based on artificial intelligence. The technical solution adopted is as follows:
[0005] The present invention proposes an artificial intelligence-based automatic software data security detection method, which includes the following steps:
[0006] Obtaining each software data of a marked data type within a preset time period;
[0007] Divide the continuous and adjacent software data of the same data type into a data sequence, and obtain the possible abnormal value of each software data according to the duration of the data sequence and the number of software data, the time interval between each software data and the next adjacent software data, and the number of responses of each software data;
[0008] Obtain an abnormal score value for each software data according to the abnormal possible value of each software data, the distance between each software data and other software data of the same data type within the preset time period and the number of existing data sequences, and the difference in the number of responses between each software data and each neighborhood software data in the preset neighborhood;
[0009] Clustering the software data according to the abnormal score value to obtain at least two initial clustering clusters; obtaining a quantile judgment value of each initial clustering cluster according to the characteristic difference of the abnormal score value of each initial clustering cluster and the software data contained in the preset time period, and the difference of the abnormal score value between each initial clustering cluster and other initial clustering clusters;
[0010] The initial clusters are clustered according to the quantile judgment values to obtain a preset number of second clusters.
[0011] Furthermore, the method for obtaining the possible abnormal value is:
[0012] For any software data, the data sequence where the software data is located is taken as the target data sequence;
[0013] The time corresponding to the first software data in the target data sequence is taken as the first target time;
[0014] The time corresponding to the last software data in the target data sequence is taken as the second target time;
[0015] Obtaining the difference between the second target time and the first target time as the duration of the target data sequence;
[0016] Obtaining a ratio of the amount of all software data in a preset time period to the amount of software data in a target data sequence as a characteristic amplification value of the target data sequence;
[0017] The time interval between the corresponding time of the software data and the next adjacent software data is used as the first time interval;
[0018] The possible abnormal value of the software data is obtained according to the ratio of the number of responses of the software data to the first time interval, the duration of the target data sequence and the feature amplification value.
[0019] Furthermore, the calculation formula of the abnormal possibility value is:
[0020]
[0021] In the formula, q i is the possible abnormal value of the i-th software data; t i,d is the second target time; t i,0 is the first target time; N is the number of all software data in the preset time period; n i is the number of software data in the target data sequence where the i-th software data is located; m i is the number of responses to the i-th software data; t i is the time corresponding to the i-th software data; t i+1is the time corresponding to the (i+1)th software data; α is the first preset constant, which is greater than 0; norm is the normalization function; (t i,d -t i,0 ) is the duration of the target data sequence where the i-th software data is located; t i+1 -t i is the first time interval; is the feature amplification value of the target data sequence where the i-th software data is located.
[0022] Furthermore, the method for obtaining the abnormal score value is:
[0023] For any software data, the Euclidean distance between the software data and other software data of the same data type within the preset time period is taken as the first distance;
[0024] taking the number of data sequences existing between the software data and other software data of the same data type within the preset time period as the first number;
[0025] According to the first distance and the first quantity, a second characteristic value between the software data and other software data of the same data type is obtained; wherein the first distance and the first quantity are both positively correlated with the second characteristic value;
[0026] Constructing a preset neighborhood of the software data, and obtaining a difference in the number of responses between the software data and each corresponding neighborhood software data as a first response difference;
[0027] An abnormality score value of the software data is obtained according to the first response difference, the first quantity and the second characteristic value, and the abnormality possibility value of the software data.
[0028] Furthermore, the calculation formula of the abnormal score value is:
[0029]
[0030] In the formula, γ i is the abnormal score of the i-th software data; K is the total number of neighborhood software data in the preset neighborhood of the i-th software data; m i is the number of responses to the i-th software data; m i+k is the number of responses to the (i+k)th software data; q i is the possible abnormal value of the i-th software data; J is the total number of software data of the same data type as the i-th software data within the preset time period; d i,j is the first distance between the i-th software data and the j-th software data of the same data type within the preset time period; i,jis the first number between the i-th software data and the j-th software data of the same data type within the preset time period; β is a second preset constant, which is greater than 0; s i is the variance of the first quantity; || is the absolute value function; norm is the normalization function.
[0031] Furthermore, the method for obtaining the percentile judgment value is:
[0032] The quantile judgment value of each initial clustering cluster is obtained according to the median difference of the abnormal score values of the software data contained in each initial clustering cluster and the preset time period, and the mean difference of the abnormal score values of each initial clustering cluster and other initial clustering clusters.
[0033] Furthermore, the calculation formula of the percentile judgment value is:
[0034]
[0035] In the formula, g l is the quantile judgment value of the lth initial cluster; γ l,z is the median of the anomaly score value in the lth initial cluster; γ z is the median of the anomaly score values contained in the preset time period; A is the total number of initial clusters; is the mean of the anomaly scores within the lth initial cluster; is the mean of the anomaly scores within the ath initial cluster; exp is an exponential function with the natural constant e as the base; || is the absolute value function.
[0036] Furthermore, the method of clustering the initial clusters according to the quantile judgment values to obtain a preset number of second clusters is:
[0037] According to the quantile judgment value of each initial clustering cluster, the initial clustering clusters are clustered by using the k-means clustering algorithm to obtain a preset number of second clustering clusters.
[0038] Furthermore, the method of clustering the software data according to the abnormal score value to obtain at least two initial clusters is:
[0039] According to the abnormal score value of each software data, each software data is clustered by a hierarchical clustering algorithm to obtain at least two initial clusters.
[0040] Furthermore, the method of dividing the continuous and adjacent software data of the same data type into a data sequence is:
[0041] Sort the software data within the preset time period in chronological order to obtain a complete sequence;
[0042] Continuously adjacent software data of the same data type in a complete sequence are divided into a data sequence; wherein, when a certain software data in the complete sequence is not of the same data type as the two software data before and after it, the software data is a data sequence.
[0043] The present invention has the following beneficial effects:
[0044] Continuous and adjacent software data of the same data type are divided into a data sequence to facilitate the subsequent accurate analysis of the abnormality of each software data, and then the abnormality possible value of each software data is obtained according to the duration of the data sequence in which each software data is located and the number of software data, the time interval between each software data and the next adjacent software data, and the number of responses of each software data, and the abnormality score value of each software data is obtained to preliminarily determine the abnormality of each software data. In order to accurately obtain the abnormality of each software data, the software data is accurately divided, and further according to the abnormality possible value of each software data, the distance between each software data and other software data of the same data type within a preset time period and the number of existing data sequences, and the difference in the number of responses between each software data and each neighboring software data in a preset neighborhood, the abnormality score value of each software data is obtained to accurately determine the abnormality of each software data. The degree of abnormality is determined, and then the software data is clustered according to the abnormal score value to obtain initial clustering clusters, thereby improving the efficiency of dividing the software data. Further, according to the characteristic difference of the abnormal score value of each initial clustering cluster and the software data contained in the preset time period, and the difference of the abnormal score value between each initial clustering cluster and other initial clustering clusters, the quantile judgment value of each initial clustering cluster is obtained, and the distribution of the software data of each initial clustering cluster is preliminarily determined. In order to uniformly and accurately divide the software data, the initial clustering clusters are clustered according to the quantile judgment value to obtain a preset number of second clustering clusters, and the software data is accurately divided in order to improve the accuracy of identifying abnormal software data; and then according to the distribution of the quantile judgment value in each second clustering cluster, the position of each quantile line in the box plot algorithm is accurately determined, and the software data is accurately detected for abnormality, thereby ensuring the correctness and accuracy of the information. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of an artificial intelligence-based automatic software data security detection method provided by an embodiment of the present invention;
[0047] Figure 2 An image of a finalized box plot provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of an artificial intelligence-based software data security automatic detection method proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0049] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0050] The following is a detailed description of a specific solution of an artificial intelligence-based automatic software data security detection method provided by the present invention in conjunction with the accompanying drawings.
[0051] A specific scenario of an embodiment of the present invention: there is software data of at least one hour of software running in the server log, and the embodiment of the present invention uses a box plot algorithm to perform anomaly detection on the software data.
[0052] The purpose of the embodiment of the present invention is: software data has its own abnormal conditions and abnormal conditions caused by network attacks. The two abnormal conditions lead to different abnormalities in the output of software data. At the same time, the distribution of software data corresponding to different data types is also different. In order to accurately detect abnormalities in software data and accurately distinguish software data with different abnormal conditions, the embodiment of the present invention analyzes the number of responses to software data, obtains the abnormality score value of each software data, and then clusters the software data, analyzes the abnormality score value in each cluster cluster, reasonably divides the software data, and then accurately detects abnormalities in the software data.
[0053] See also Figure 1 , which shows a flow chart of an artificial intelligence-based software data security automatic detection method provided by an embodiment of the present invention, the method comprising the following steps:
[0054] Step S1: Acquire each software data of a marked data type within a preset time period.
[0055] Specifically, the software will access the server network during operation, and transmit the software data received and sent in real time to the server for processing. Therefore, by accessing the server log, the software data during the software operation process can be obtained. For the sake of clear explanation, the embodiment of the present invention sets the preset time period to one hour, and analyzes the software data within one hour as an example. The implementer can set the size of the preset time period according to the actual situation, which is not limited here. Among them, the data type of each software data is automatically marked in the server log. For example, the first software data is marked as login, and the fifth software data is marked as edit and other data types. At the same time, the server log is used to obtain the number of times each software data is accessed simultaneously at the corresponding time, that is, the number of responses for each software data.
[0056] Step S2: Divide the continuous and adjacent software data of the same data type into a data sequence, and obtain the possible abnormal value of each software data according to the duration and number of software data in the data sequence, the time interval between each software data and the next adjacent software data, and the number of responses of each software data.
[0057] Specifically, when a network attack bypasses the firewall of the processor to attack and access the software, the generated software data will also be recorded in the server log. Among them, the anomalies generated by the software itself and the anomalies generated by the network attack are different. The anomalies generated by the software itself usually have a certain regularity, that is, the amount of data is small, and there will not be a large fluctuation in the number of responses in a short period of time, maintaining the stable operation of the server and preventing the server from crashing due to the increase in the number of instantaneous responses. The anomalies generated by network attacks will suddenly increase the number of responses of software data in a short period of time, and the data types generated will be diverse, which is convenient for obtaining more information in a short period of time. Therefore, in order to analyze the anomalies of each software data, first sort the software data within the preset time period in chronological order to obtain a complete sequence; divide the software data of the same data type that are consecutively adjacent in the complete sequence into a data sequence; wherein, when a software data in the complete sequence is not the same data type as the two adjacent software data before and after, the software data is a data sequence. For example, assuming that the data type distribution of each software data in the complete sequence is: A1, A2, A3, A4, B5, A6, A7, A8, C9, C 10Among them, A, B, and C represent three data types respectively, and the subscripts 1, 2, ... 10 represent the first software data, the second software data ... the tenth software data. One software data corresponds to only one A, one B, or one C; the software data of the same data type adjacent to A1 is A2, and the software data of the same data type adjacent to A1 are A2, A3, and A4. Therefore, the first data sequence is A1, A2, A3, and A4; the second data sequence is B5; the third data sequence is A6, A7, and A8; the fourth data sequence is C9, C 10 . So far, each data sequence within the preset time period is obtained. When the duration of a data sequence is shorter, it means that the software data in the data sequence is more likely to be abnormal software data caused by a network attack, because the network attack occurs in a short time. When there are fewer software data in a data sequence, it means that the software data in the data sequence is more likely to be abnormal software data, because for normal software data, the number of software data in the corresponding data sequence is relatively fixed. The greater the number of responses of a certain software data becomes, the more likely the software data is to be abnormal software data caused by a network attack. Therefore, according to the duration of the data sequence in which each software data is located and the number of software data, the time interval between each software data and the next adjacent software data, and the number of responses of each software data, the abnormal possible value of each software data is obtained.
[0058] Preferably, the method for obtaining the possible abnormal value is as follows: for any software data, the data sequence in which the software data is located is taken as the target data sequence; the moment corresponding to the first software data in the target data sequence is taken as the first target moment; the moment corresponding to the last software data in the target data sequence is taken as the second target moment; the difference between the second target moment and the first target moment is obtained as the duration of the target data sequence, wherein the smaller the duration of the target data sequence is, the more likely the software data is generated in a short time, and the more likely the software data is abnormal software data. The ratio of the number of all software data in a preset time period to the number of software data in the target data sequence is obtained as the characteristic amplification value of the target data sequence, wherein the larger the characteristic amplification value is, the less the number of software data in the target data sequence is, the more likely the target data sequence is generated by a network attack, and the more likely the software data is abnormal. The time interval between the corresponding moment of the software data and the next adjacent software data is taken as the first time interval, and the duration of the continuous existence of the software data is determined to prepare for obtaining the degree of change in the number of responses of the software data. Therefore, based on the ratio of the number of responses of the software data to the first time interval, the duration of the target data sequence and the feature amplification value, the abnormal possibility value of the software data is obtained. The larger the abnormal possibility value, the more abnormal the software data is.
[0059] As an example, taking the i-th software data as an example, the calculation formula for obtaining the abnormal possible value of the i-th software data is:
[0060]
[0061] In the formula, q i is the possible abnormal value of the i-th software data; t i,d is the second target time; t i,0 is the first target time; N is the number of all software data in the preset time period; n i is the number of software data in the target data sequence where the i-th software data is located; m i is the number of responses to the i-th software data; t i is the time corresponding to the i-th software data; t i+1 is the time corresponding to the (i+1)th software data; α is the first preset constant, which is greater than 0; norm is the normalization function; (t i,d -t i,0 ) is the duration of the target data sequence where the i-th software data is located; t i+1 -t i is the first time interval; is the feature amplification value of the target data sequence where the i-th software data is located.
[0062] In the embodiment of the present invention, α is set to 0.1 to avoid the denominator being 0. The implementer may set the value of α according to actual conditions, which is not limited here.
[0063] It should be noted that (t i,d -t i,0 ) is smaller, indicating that the duration of the target data sequence where the i-th software data is located is shorter, the target data sequence where the i-th software data is located is more likely to be caused by a network attack, and the i-th software data is more likely to be abnormal software data. The larger the q i The larger the n i The smaller it is, the less software data there is in the target data sequence where the i-th software data is located, the more likely the software data in the target data sequence where the i-th software data is located is to be abnormal, and the more likely the i-th software data is to be abnormal software data. The larger the q i The larger the first time interval t i+1 -t i The smaller the m i The larger the value is, the greater the number of times the i-th software data is accessed in a short period of time. The larger it is, the more likely the i-th software data is to be abnormal software data. The larger the q iThe larger the value, the larger the i The larger the , the more likely the i-th software data is abnormal software data.
[0064] According to the method for obtaining the abnormal possible value of the i-th software data, the abnormal possible value of each software data is obtained. Wherein, the last software data in the preset time period does not have the next adjacent software data, and therefore, the last software data in the preset time period is not analyzed.
[0065] Step S3: Obtain an abnormal score value for each software data according to the possible abnormal value of each software data, the distance between each software data and other software data of the same data type within the preset time period and the number of existing data sequences, and the difference in the number of responses between each software data and each neighborhood software data in a preset neighborhood.
[0066] Specifically, in order to accurately detect anomalies in software data, an embodiment of the present invention represents the software data within a preset time period in a two-dimensional coordinate axis according to the time sequence, and obtains the Euclidean distance between each software data and each software data of the same data type. Because normal software data has a certain regularity in time series, and abnormal software data is random and has a short time interval, therefore, when the Euclidean distance between a certain software data and the software data of the same data type within the preset time period is smaller, it means that the time interval between the software data and the software data of the same data type within the preset time period is shorter, and the degree of abnormality of the software data is greater. In the process of normal access, there will be multiple data types for software data, and the instructions executed within the preset time period are not single. Therefore, there will be multiple data types for software data within the preset time period, that is, the number of data sequences between each software data and other software data of the same data type within the preset time period is multiple and relatively stable; while abnormal access may carry out a large number of attacks on a certain data type of software data in a short period of time, resulting in a single data type, that is, the number of data sequences between each software data and other software data of the same data type within the preset time period is smaller; therefore, in order to accurately analyze the abnormality of each software data, the number of data sequences between each software data and other software data of the same data type within the preset time period is obtained. When the number of data sequences between a certain software data and other software data of the same data type within the preset time period is smaller, it means that the abnormality of the software data is greater. In order to further analyze the abnormality of each software data, the difference in the number of responses between each software data and each neighborhood software data in the preset neighborhood is obtained. When the difference in the number of responses is greater, it means that the abnormality of the corresponding software data is greater. Therefore, the abnormal score value of each software data is obtained according to the possible abnormal value of each software data, the distance between each software data and other software data of the same data type within a preset time period and the number of existing data sequences, and the difference in the number of responses between each software data and each neighborhood software data in a preset neighborhood.
[0067] Preferably, the method for obtaining the abnormal score value is: for any software data, the Euclidean distance between the software data and other software data of the same data type within a preset time period is used as the first distance, wherein the smaller the first distance is, the smaller the time interval between the software data and the corresponding software data of the same data type within the preset time period is, and the greater the degree of abnormality of the software data is. The number of data sequences between the software data and other software data of the same data type within the preset time period is used as the first quantity, wherein the first quantity includes the data sequences where the software data and other software data of the same data type within the preset time period are located. The smaller the first quantity is, the greater the degree of abnormality of the software data is. Then, based on the first distance and the first quantity, the second characteristic value between the software data and other software data of the same data type within the preset time period is obtained, wherein the first distance and the first quantity are both positively correlated with the second characteristic value. The smaller the second characteristic value is, the greater the degree of abnormality of the software data is. A preset neighborhood of the software data is constructed, and the difference in the number of responses between the software data and each corresponding neighborhood software data is obtained as a first response difference, wherein the larger the first response difference is, the larger the difference in the number of responses between the software data and the corresponding neighborhood software data is, and the more likely the software data is to be abnormal. Then, according to the mean of the first response difference, the variance of the first quantity and the second eigenvalue, and the possible abnormality value of the software data, the abnormality score value of the software data is obtained.
[0068] As an example, taking the i-th software data in step S2 as an example, the embodiment of the present invention extends the i-th software data backward by 10 software data in the order of time series as the preset neighborhood of the i-th software data. The implementer can set the size of the preset neighborhood of the i-th software data according to the actual situation, which is not limited here. Therefore, the i-th software data corresponds to 10 neighborhood software data. It should be noted that when the i-th software data extends backward by less than 10 software data in the order of time series, at this time, all software data after the i-th software data in time series are used as the neighborhood software data of the i-th software data. Among them, the calculation formula for obtaining the abnormal score value of the i-th software data is:
[0069]
[0070] In the formula, γ i is the abnormal score value of the i-th software data; K is the total number of neighborhood software data in the preset neighborhood of the i-th software data, which is 10 in the embodiment of the present invention; m i is the number of responses to the i-th software data; m i+k is the number of responses to the (i+k)th software data; q iis the possible abnormal value of the i-th software data; J is the total number of software data of the same data type as the i-th software data within the preset time period; d i,j is the first distance between the i-th software data and the j-th software data of the same data type within a preset time period; i,j is the first number between the i-th software data and the j-th software data of the same data type within a preset time period; β is a second preset constant, which is greater than 0; s i is the variance of the first quantity; || is the absolute value function; norm is the normalization function; |m i -m i+k | is the first response difference; (d i,j +β)×(x i,j +β) is the second eigenvalue.
[0071] In the embodiment of the present invention, β is set to 0.01 to avoid the denominator being 0. The implementer may set the value of β according to the actual situation, which is not limited here.
[0072] It should be noted that the first response difference |m i -m i+k |The bigger, The larger the value, the greater the difference in the number of responses between the i-th software data and the neighboring software data, and the greater the abnormality of the i-th software data. i The larger the q i The larger the value, the greater the abnormality of the i-th software data may be. i The larger the i,j The smaller the x i,j The smaller the second eigenvalue (d i,j +β)×(x i,j +β) is smaller, indicating that the abnormality of the i-th software data is greater. The smaller it is, the more accurately it can determine the abnormality of the i-th software data; the changes in normal software data have certain rules, the changes in the first quantity are stable, and s i The larger the value is, the greater the fluctuation of the first quantity is, and the greater the abnormality of the i-th software data is; therefore, The larger the value, the greater the abnormality of the i-th software data. i Therefore, γ i The larger it is, the greater the abnormality of the i-th software data.
[0073] According to the method for obtaining the abnormal score value of the i-th software data, the abnormal score value of each software data is obtained. As can be seen from step S2, the last software data in the preset time period is not analyzed, so the abnormal score value of the last software data in the preset time period is not obtained.
[0074] Step S4: Cluster the software data according to the abnormal score value to obtain at least two initial clustering clusters; obtain the quantile judgment value of each initial clustering cluster according to the characteristic difference of the abnormal score value of each initial clustering cluster and the software data contained in the preset time period, and the difference of the abnormal score value between each initial clustering cluster and other initial clustering clusters.
[0075] Specifically, the abnormality score value of each software data represents the abnormality degree of the corresponding software data. Therefore, the software data is divided according to the abnormality score value of each software data. In order to accurately divide the software data, the embodiment of the present invention clusters each software data according to the abnormality score value of each software data through a hierarchical clustering algorithm to obtain at least two initial clustering clusters. The embodiment of the present invention sets the number of clustering iterations in the hierarchical clustering algorithm to 2. The implementer can set the size of the number of clustering iterations in the hierarchical clustering algorithm according to actual conditions, which is not limited here. Among them, the hierarchical clustering algorithm is a well-known technology and will not be described in detail. Each initial clustering cluster is analyzed to obtain the quantile judgment value of each initial clustering cluster, so as to prepare for a more accurate division of the software data in the future.
[0076] Preferably, the method for obtaining the quantile judgment value is: obtaining the median of the abnormal score values of all software data within a preset time period as the overall median; obtaining the median of the abnormal score values of all software data in each initial clustering cluster as the local median of the corresponding initial clustering cluster; obtaining the difference between the overall median and each local median as the position difference; when the position difference is closer to 0, the abnormal score value of the software data in the initial clustering cluster corresponding to the local median is closer to the overall median, and when the mean difference between the abnormal score values in a certain initial clustering cluster and other initial clustering clusters is greater, it means that the abnormal degree of the software data in the initial clustering cluster is greater, the abnormal score value of the software data in the initial clustering cluster is farther away from the overall median, the software data in the initial clustering cluster should be distributed to both ends, and the degree of abnormality is greater. Therefore, according to the median difference of the abnormal score values of the software data contained in each initial clustering cluster and the preset time period, and the mean difference of the abnormal score values of each initial clustering cluster and other initial clustering clusters, the quantile judgment value of each initial clustering cluster is obtained. Among them, the larger the quantile judgment value is, the farther the abnormal score value of the software data in the corresponding initial cluster is from the overall median.
[0077] As an example, taking the lth initial cluster as an example, the calculation formula for obtaining the quantile judgment value of the lth initial cluster is:
[0078]
[0079] In the formula, g l is the quantile judgment value of the lth initial cluster; γ l,zis the median of the anomaly score value in the lth initial cluster; γ z is the median of the anomaly score values contained in the preset time period; A is the total number of initial clusters; is the mean of the anomaly scores within the lth initial cluster; is the mean of the anomaly scores in the ath initial cluster; exp is an exponential function with the natural constant e as the base; || is the absolute value function; (γ l,z -γ z ) is the position difference.
[0080] It should be noted that the position difference (γ l,z -γ z ) is closer to 0, indicating that the abnormal score of the software data in the lth initial cluster is closer to γ z , the more the abnormal score value of the software data in the lth initial cluster is close to the overall median, exp(|γ l,z -γ z )-1|) is smaller, g l The smaller; The smaller it is, the smaller the difference between the anomaly score value in the lth initial cluster and the anomaly score value in the ath initial cluster is, and the more likely it is that the anomaly in the lth initial cluster and the ath initial cluster is caused by the same reason. The smaller it is, the smaller the difference between the anomaly score value in the lth initial cluster and the anomaly score value in each other initial cluster is, which indirectly indicates that the anomaly degree of the software data in the lth initial cluster is smaller, and the anomaly score value of the software data in the lth initial cluster is closer to the overall median. l The smaller it is; therefore, g l The smaller it is, the closer the abnormal score value of the software data in the lth initial cluster is to the overall median, and the more concentrated the software data in the lth initial cluster is.
[0081] According to the method for obtaining the quantile judgment value of the lth initial clustering cluster, the quantile judgment value of each initial clustering cluster is obtained.
[0082] Step S5: clustering the initial clusters according to the quantile judgment values to obtain a preset number of second clusters.
[0083] Specifically, the situations in which software data generates abnormalities in the embodiments of the present invention are different, mainly including abnormalities of the software data itself and abnormalities caused by network attacks on the software data. In order to distinguish the causes of abnormal software data, the present invention implements the construction of the quartiles of the box plot by adding two new quantiles, so that the abnormal software data is distributed in different data ranges, that is, different quantiles, and then distinguishes the causes of abnormal software data, and accurately detects abnormal software data. Because the number of initial clustering clusters is uncertain, and there are certain differences in the abnormal score values in each initial clustering cluster, the quantile judgment value of each initial clustering cluster is different. In order to uniformly determine the position of each quantile line in the box plot algorithm and perform abnormal detection on the software data, the embodiment of the present invention clusters the initial clustering clusters according to the quantile judgment value of each initial clustering cluster, through the k-means clustering algorithm, to obtain a preset number of second clustering clusters. It is known that two new quantiles have been added, so the embodiment of the present invention sets the K value in the k-means clustering algorithm to 5, that is, the preset number is also 5, that is, 5 second clustering clusters are obtained. A second clustering cluster corresponds to a software data distribution range, so there are 5 quantile parts in the adjusted box plot. Among them, the k-means clustering algorithm is a well-known technology and will not be repeated. The quantile judgment value in the obtained second clustering cluster is analyzed, and then the position of each quantile line in the box plot algorithm is determined. Preferably, the method for determining the position of each quantile line in the box plot algorithm is: obtain the mean of the quantile judgment value in each second clustering cluster as the overall eigenvalue corresponding to the second clustering cluster, and determine the quantile area corresponding to each second clustering cluster according to the size of the overall eigenvalue, because the quantile line corresponding values in the box plot algorithm increase from bottom to top in sequence, therefore, the second clustering clusters are arranged in order from small to large according to the overall eigenvalue, and a second clustering cluster sequence is obtained; the second clustering clusters in the second clustering cluster sequence correspond to each quantile area from bottom to top in sequence. In order to determine the position range of each quantile, that is, the position of each quantile line, the embodiment of the present invention uses the minimum quantile judgment value in the first second clustering cluster in the second clustering cluster sequence as the corresponding value of the lower edge of the box plot; the average of the maximum quantile judgment value in each second clustering cluster in the second clustering cluster sequence and the minimum quantile judgment value in the next adjacent second clustering cluster are used as the corresponding values of each quantile line from bottom to top except the lower edge; the maximum quantile judgment value in the last second clustering cluster in the second clustering cluster sequence is used as the corresponding value of the upper edge of the box plot; according to the corresponding value of the lower edge, the corresponding value of each quantile line and the corresponding value of the upper edge, the position of each quantile line in the box plot algorithm is determined, as shown in FIG. Figure 2 As shown, min g1 The minimum quantile judgment value in the first second cluster in the second cluster sequence; max g1 The maximum quantile judgment value in the first second cluster in the second cluster sequence; min g2is the minimum quantile judgment value of the second cluster in the second cluster sequence; max g2 is the maximum quantile judgment value in the second cluster in the second cluster sequence; min g3 The smallest quantile judgment value in the third second cluster in the second cluster sequence; max g3 The maximum quantile judgment value in the third second cluster in the second cluster sequence; min g4 The minimum quantile judgment value in the fourth second cluster in the second cluster sequence; max g4 is the maximum quantile judgment value in the fourth second cluster in the second cluster sequence; min g5 The minimum quantile judgment value in the fifth second cluster in the second cluster sequence; max g5 It is the maximum quantile judgment value in the fifth second cluster in the second cluster sequence.
[0084] By adjusting the position of each quantile line, each software data within a preset time period is detected for abnormalities according to the box plot algorithm, and abnormal software data caused by different reasons within the preset time period is obtained, thereby determining the accuracy and security of the software data. The embodiment of the present invention can obtain different distributions of software data in the box plot by adding quantile lines in the box plot. Different distribution positions in the box plot result in different abnormal reasons, thereby accurately analyzing the abnormal reasons in the software data and accurately detecting abnormal software data.
[0085] So far, the present invention is completed.
[0086] In summary, the embodiment of the present invention obtains the software data and the number of responses to the software data within a preset time period, obtains the abnormal score value of the software data according to the distribution of software data of the same data type and the change in the number of responses to the software data, clusters the software data, and obtains an initial clustering cluster; according to the difference between the initial clustering clusters and the characteristic difference of the abnormal score value between the initial clustering cluster and the preset time period, obtains the quantile judgment value, clusters the initial clustering cluster, and obtains a second clustering cluster. The present invention obtains the abnormal score value of the software data, performs clustering, and then accurately divides the software data, accurately determines the position of each quantile line in the box plot algorithm, and accurately detects abnormalities in the software data.
[0087] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0088] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. An automatic detection method for software data security based on artificial intelligence, It is characterized in that The method comprises the following steps: Obtaining each software data of a marked data type within a preset time period; Divide the continuous and adjacent software data of the same data type into a data sequence, and obtain the possible abnormal value of each software data according to the duration of the data sequence and the number of software data, the time interval between each software data and the next adjacent software data, and the number of responses of each software data; Obtain an abnormal score value for each software data according to the abnormal possible value of each software data, the distance between each software data and other software data of the same data type within the preset time period and the number of existing data sequences, and the difference in the number of responses between each software data and each neighborhood software data in the preset neighborhood; Clustering the software data according to the abnormal score value to obtain at least two initial clustering clusters; obtaining a quantile judgment value of each initial clustering cluster according to the characteristic difference of the abnormal score value of each initial clustering cluster and the software data contained in the preset time period, and the difference of the abnormal score value between each initial clustering cluster and other initial clustering clusters; Clustering the initial clusters according to the quantile judgment values to obtain a preset number of second clusters; The method for obtaining the possible abnormal value is: For any software data, the data sequence where the software data is located is taken as the target data sequence; The time corresponding to the first software data in the target data sequence is taken as the first target time; The time corresponding to the last software data in the target data sequence is taken as the second target time; Obtaining the difference between the second target time and the first target time as the duration of the target data sequence; Obtaining a ratio of the amount of all software data within a preset time period to the amount of software data in the target data sequence as a characteristic amplification value of the target data sequence; The time interval between the corresponding time of the software data and the next adjacent software data is used as the first time interval; Obtaining a possible abnormal value of the software data according to a ratio of the number of responses of the software data to the first time interval, a duration of the target data sequence, and a feature amplification value; The calculation formula of the abnormal possibility value is: In the formula, q i is the possible abnormal value of the i-th software data; t i,d is the second target time; t i,0 is the first target time; N is the number of all software data in the preset time period; n i is the number of software data in the target data sequence where the i-th software data is located; m i is the number of responses to the i-th software data; t i is the time corresponding to the i-th software data; t i+1 is the time corresponding to the (i+1)th software data; α is the first preset constant, which is greater than 0; norm is the normalization function; (t i,d -t i,0 ) is the duration of the target data sequence where the i-th software data is located; t i+1 -t i is the first time interval; is the feature amplification value of the target data sequence where the i-th software data is located; The method for obtaining the abnormal score value is: For any software data, the Euclidean distance between the software data and other software data of the same data type within the preset time period is taken as the first distance; taking the number of data sequences existing between the software data and other software data of the same data type within the preset time period as the first number; According to the first distance and the first quantity, a second characteristic value between the software data and other software data of the same data type is obtained; wherein the first distance and the first quantity are both positively correlated with the second characteristic value; Constructing a preset neighborhood of the software data, and obtaining a difference in the number of responses between the software data and each corresponding neighborhood software data as a first response difference; Obtaining an abnormality score value of the software data according to the first response difference, the first quantity and the second feature value, and an abnormality possible value of the software data; The calculation formula of the abnormal score value is: In the formula, γ i is the abnormal score of the i-th software data; K is the total number of neighborhood software data in the preset neighborhood of the i-th software data; m i is the number of responses to the i-th software data; m i+k is the number of responses to the (i+k)th software data; q i is the possible abnormal value of the i-th software data; J is the total number of software data of the same data type as the i-th software data within the preset time period; d i,j is the first distance between the i-th software data and the j-th software data of the same data type within the preset time period; i,j is the first number between the i-th software data and the j-th software data of the same data type within the preset time period; β is a second preset constant, which is greater than 0; s i is the variance of the first quantity; || is the absolute value function; norm is the normalization function.
2. The method for automatically detecting software data security based on artificial intelligence as claimed in claim 1, It is characterized in that The method for obtaining the quantile judgment value is: The quantile judgment value of each initial clustering cluster is obtained according to the median difference of the abnormal score values of the software data contained in each initial clustering cluster and the preset time period, and the mean difference of the abnormal score values of each initial clustering cluster and other initial clustering clusters.
3. The method for automatically detecting software data security based on artificial intelligence as claimed in claim 2, It is characterized in that The calculation formula of the quantile judgment value is: In the formula, g l is the quantile judgment value of the lth initial cluster; γ l,z is the median of the anomaly score value in the lth initial cluster; γ z is the median of the anomaly score values contained in the preset time period; A is the total number of initial clusters; is the mean of the anomaly scores within the lth initial cluster; is the mean of the anomaly scores within the ath initial cluster; exp is an exponential function with the natural constant e as the base; || is the absolute value function.
4. The method for automatically detecting software data security based on artificial intelligence as claimed in claim 1, It is characterized in that The method of clustering the initial clusters according to the quantile judgment values to obtain a preset number of second clusters is: According to the quantile judgment value of each initial clustering cluster, the initial clustering clusters are clustered by using the k-means clustering algorithm to obtain a preset number of second clustering clusters.
5. The method for automatically detecting software data security based on artificial intelligence as claimed in claim 1, It is characterized in that The method of clustering the software data according to the abnormal score value to obtain at least two initial clusters is: According to the abnormal score value of each software data, each software data is clustered by a hierarchical clustering algorithm to obtain at least two initial clusters.
6. The method for automatically detecting software data security based on artificial intelligence as claimed in claim 1, It is characterized in that The method for dividing the continuous and adjacent software data of the same data type into a data sequence is: Sort the software data within the preset time period in chronological order to obtain a complete sequence; Divide the software data of the same data type that are continuously adjacent in the complete sequence into a data sequence; Among them, when a certain software data in the complete sequence is not of the same data type as the two adjacent software data before and after it, the software data is a data sequence.
