Machine learning-based read-only data change monitoring method and terminal
By converting binary data into image files in image format and performing machine learning image classification, the problem of the inability to monitor changes in binary data streams in real time in existing technologies is solved. This enables real-time monitoring and accurate analysis of read-only data, making it suitable for data change monitoring in critical business systems.
Patent Information
- Application Number
- CN202211360665.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing machine learning techniques struggle to monitor binary data streams, which have a wider range of everyday applications, in real time, especially when data changes cannot be detected promptly without altering the original system architecture.
Binary data is converted into image files in image format. Data changes are monitored using machine learning image classification technology. Data features are extracted and analyzed using specific training sets and classifiers to achieve the monitoring of changes to read-only data.
It enables real-time monitoring of read-only data, allowing for timely detection of data changes without requiring modifications to the existing system. Simply providing read-only permissions reduces system memory usage and improves the accuracy and efficiency of monitoring.
Smart Images

Figure CN115757443B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer science and artificial intelligence, and in particular to a method and terminal for monitoring read-only data changes based on machine learning. Background Technology
[0002] Currently, most machine learning analysis techniques are applied to images with real meaning, such as face recognition, object recognition, and image spam filtering (that is, all images can be directly interpreted by humans, such as landscape photos, facial photos, and object photos). They are unable to detect changes in binary data streams, which have a wider range of applications in daily life. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a read-only data change monitoring method and terminal based on machine learning, so as to realize the monitoring of binary data streams with a wider range of daily applications, and to monitor data changes in a timely manner with only read-only permissions.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] A machine learning-based method for monitoring changes in read-only data includes the following steps:
[0006] S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format;
[0007] S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed.
[0008] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0009] A read-only data change monitoring terminal based on machine learning includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0010] S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format;
[0011] S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed.
[0012] The beneficial effects of this invention are as follows: This invention provides a read-only data change monitoring method and terminal based on machine learning. By converting the binary format of the read-only data that needs to be monitored for changes into an image format, and then performing machine learning image classification on the resulting image file, the computer learns to distinguish different images with changed data through a specific training set combination. When a changed data stream is detected in the image file, it can notify other systems, thus achieving timely monitoring of read-only data changes. At the same time, this method does not require any modification to the original system and does not touch the internal business system. It only requires providing read-only permissions for the data source or corresponding view of the business system. Attached Figure Description
[0013] Figure 1 This is an overall flowchart of a machine learning-based read-only data change monitoring method according to an embodiment of the present invention;
[0014] Figure 2 This is a specific process for converting binary data into image files in a machine learning-based read-only data change monitoring method according to an embodiment of the present invention.
[0015] Figure 3 This is a diagram illustrating the image filtering structure for key data changes based on machine learning in a machine learning-based read-only data change monitoring method according to an embodiment of the present invention.
[0016] Figure 4 This is a flowchart illustrating the implementation of tag voting in a machine learning-based read-only data change monitoring method according to an embodiment of the present invention.
[0017] Figure 5 This is a schematic diagram of the structure of a read-only data change monitoring terminal based on machine learning according to an embodiment of the present invention;
[0018] Label Explanation:
[0019] 1. A read-only data change monitoring terminal based on machine learning; 2. Memory; 3. Processor. Detailed Implementation
[0020] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0021] Please refer to Figures 1 to 4 A machine learning-based method for monitoring read-only data changes includes the following steps:
[0022] S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format;
[0023] S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed.
[0024] As can be seen from the above description, the beneficial effects of the present invention are as follows: by converting the binary format of read-only data that needs to be monitored for changes into an image format, and then performing machine learning image classification on the resulting image file, the computer learns to distinguish different images with changed data through a specific training set combination. When a changed data stream is detected in the image file, it can notify other systems, thus enabling timely monitoring of changes to read-only data. At the same time, this method does not require any modification to the original system and does not touch the internal workings of the business system. It only requires providing read-only permissions for the data source or corresponding view of the business system.
[0025] Further, step S1 specifically includes:
[0026] S11. Obtain a read-only data packet and export the read-only data packet into binary format to obtain binary data;
[0027] S12. Obtain the data length of the binary data and determine whether the data length exceeds the default length. If it does not exceed the default length, draw an image canvas of (128*128) pixels; otherwise, draw an image canvas of [128*((data length / 128)+1)] pixels, where " / " indicates rounding down, and the default length is (128*128) bytes.
[0028] S13. Color the image canvas. Take the pixel grid in one corner of the image canvas as the origin (0,0) and (128, (the data length / 128)+1)) as the end point. Select three bytes of the binary data in sequence and use them as RGB data respectively. Start from the origin of the image canvas and render each pixel grid on the image canvas in sequence. If the last three bytes of data are less than three bits, pad them with 0. If there are still unrendered pixel grids on the image canvas when the bytes of the binary data have been used up, these unrendered pixel grids are also padded with 0.
[0029] S14. Save the rendered image canvas and output it as an image file in image format.
[0030] As described above, by converting read-only binary data into image files, it is possible to train the image classification based on machine learning to monitor changes in the data stream, enabling real-time monitoring of changes in binary data streams with larger scopes for everyday applications.
[0031] Furthermore, the image format is BMP format.
[0032] As described above, using BMP format as the image format after converting binary scripts into image files facilitates subsequent image feature extraction while effectively reducing system memory usage.
[0033] Further, step S2 specifically includes:
[0034] S21. Convert the binary data with key features and irrelevant features into the image files according to step S1, and denot them as the key data image set and the irrelevant data image set respectively. Generate the training set and the test set according to the key data image set and the irrelevant data image set respectively.
[0035] Wherein, X% of the key data image set and X% of the irrelevant data image set are taken to generate the training set, and Y% of the key data image set and Y% of the irrelevant data image set are taken to generate the test set, X% + Y% = 100%;
[0036] S22. Analyze the features of the image files in the training set, extract the color features, texture features and shape features of the images, and obtain image features and classifiers suitable for image classification through experimental comparison;
[0037] S23. Conduct a performance evaluation experiment on the test set using the image features and the classifier;
[0038] S24. After the performance evaluation is completed, the image features are input into the classifier to obtain each classification result. The classification results are then labeled and projected onto the screen. The key data images are determined based on the voting results to obtain the image files that have undergone data changes.
[0039] Furthermore, the image features are HSV color histogram features and texture features;
[0040] The classifiers are K-NN classifiers and ensemble learning classifiers.
[0041] As described above, by training images converted from binary data streams containing key and irrelevant features to obtain suitable image features and classifiers through training, and then using a test set for performance evaluation, the most suitable HSV color histogram features, texture features, K-NN classifier, and ensemble learning classifier are finally determined. This effectively improves classification accuracy, recall, and overall performance, thereby enhancing the accuracy of detecting image files with key data changes.
[0042] Please refer to Figure 5A machine learning-based read-only data change monitoring terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps:
[0043] S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format;
[0044] S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed.
[0045] As can be seen from the above description, the beneficial effects of the present invention are as follows: Based on the same technical concept, a machine learning-based read-only data change monitoring terminal is provided. By converting the binary format of the read-only data that needs to be monitored for changes into an image format, and then performing machine learning image classification on the resulting image file, the computer learns to distinguish different images with changed data through a specific training set combination. When a changed data stream is detected in the image file, it can notify other systems, thus realizing timely monitoring of read-only data changes. At the same time, this method does not require any modification to the original system and does not touch the internal business system. It only requires providing read-only permissions for the data source or corresponding view of the business system.
[0046] Further, step S1 specifically includes:
[0047] S11. Obtain a read-only data packet and export the read-only data packet into binary format to obtain binary data;
[0048] S12. Obtain the data length of the binary data and determine whether the data length exceeds the default length. If it does not exceed the default length, draw an image canvas of (128*128) pixels; otherwise, draw an image canvas of [128*((data length / 128)+1)] pixels, where " / " indicates rounding down, and the default length is (128*128) bytes.
[0049] S13. Color the image canvas. Take the pixel grid in one corner of the image canvas as the origin (0,0) and (128, (the data length / 128)+1)) as the end point. Select three bytes of the binary data in sequence and use them as RGB data respectively. Start from the origin of the image canvas and render each pixel grid on the image canvas in sequence. If the last three bytes of data are less than three bits, pad them with 0. If there are still unrendered pixel grids on the image canvas when the bytes of the binary data have been used up, these unrendered pixel grids are also padded with 0.
[0050] S14. Save the rendered image canvas and output it as an image file in image format.
[0051] As described above, by converting read-only binary data into image files, it is possible to train the image classification based on machine learning to monitor changes in the data stream, enabling real-time monitoring of changes in binary data streams with larger scopes for everyday applications.
[0052] Furthermore, the image format is BMP format.
[0053] As described above, using BMP format as the image format after converting binary scripts into image files facilitates subsequent image feature extraction while effectively reducing system memory usage.
[0054] Further, step S2 specifically includes:
[0055] S21. Convert the binary data with key features and irrelevant features into the image files according to step S1, and denot them as the key data image set and the irrelevant data image set respectively. Generate the training set and the test set according to the key data image set and the irrelevant data image set respectively.
[0056] Wherein, X% of the key data image set and X% of the irrelevant data image set are taken to generate the training set, and Y% of the key data image set and Y% of the irrelevant data image set are taken to generate the test set, X% + Y% = 100%;
[0057] S22. Analyze the features of the image files in the training set, extract the color features, texture features and shape features of the images, and obtain image features and classifiers suitable for image classification through experimental comparison;
[0058] S23. Conduct a performance evaluation experiment on the test set using the image features and the classifier;
[0059] S24. After the performance evaluation is completed, the image features are input into the classifier to obtain each classification result. The classification results are then labeled and projected onto the screen. The key data images are determined based on the voting results to obtain the image files that have undergone data changes.
[0060] Furthermore, the image features are HSV color histogram features and texture features;
[0061] The classifiers are K-NN classifiers and ensemble learning classifiers.
[0062] As described above, by training images converted from binary data streams containing key and irrelevant features to obtain suitable image features and classifiers through training, and then using a test set for performance evaluation, the most suitable HSV color histogram features, texture features, K-NN classifier, and ensemble learning classifier are finally determined. This effectively improves classification accuracy, recall, and overall performance, thereby enhancing the accuracy of detecting image files with key data changes.
[0063] The present invention provides a read-only data change monitoring method and terminal based on machine learning, which is mainly used in the real-time monitoring of binary data streams that have been changed in critical business systems. The following is a detailed description with reference to the embodiments.
[0064] Please refer to Figure 1 and Figure 2 Embodiment 1 of the present invention is as follows:
[0065] In a well-designed business system, data change issues are unlikely to occur. For example, in a hospital information system, when medical information data changes, the reasons usually fall into the following categories:
[0066] (A) There was an oversight in the modification of the business system program. The revision of historical data did not follow the principle of "red ink reversal", but directly modified the historical data;
[0067] (B) Unauthorized alteration refers to the modification of historical data without authorization;
[0068] (C) Directive modification refers to modifying historical data under the authorization of the unit.
[0069] Situations A and B described above must be prevented. However, once these two situations occur, there is no proactive notification or record of the change information. Without some kind of proactive mechanism, it is difficult for external parties to detect the problem in a timely manner. Often, it is only discovered when discrepancies are found in historical reports within the business system, or when data in the business system and external systems under the same circumstances do not match. Once discovered, finding the changed records and restoring the data is very costly.
[0070] Situation C) is acceptable. If this occurs, the external system should be notified proactively to make the corresponding changes.
[0071] This embodiment proposes a read-only data change monitoring method based on machine learning for the data change scenarios A and B described above. Figure 1 As shown, the steps include:
[0072] S1. Obtain the binary data of the read-only data packet, draw the image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format.
[0073] S2. Perform machine learning image classification on the image files to obtain the image files that have undergone data changes.
[0074] In this embodiment, the binary format of the read-only data that needs to be monitored for changes is converted into an image format to obtain an image file. Then, machine learning image classification is performed. Through a specific training set combination, the computer learns the technology to distinguish different images with changed data. When a changed data stream is detected in the image file, it can notify other systems, thus realizing timely monitoring of changes to read-only data. At the same time, this method does not require any modification to the original system and does not touch the internal business system. It only requires providing read-only permissions for the data source or corresponding view of the business system.
[0075] In this embodiment, a specific process for converting binary data into an image file is provided as follows: Figure 2 As shown, in this embodiment, step S1 specifically includes the following steps:
[0076] S11. Obtain the read-only data packet and export the read-only data packet as binary format to obtain binary data;
[0077] S12. Obtain the data length of the binary data and determine whether the data length exceeds the default length. If it does not exceed the default length, draw an image canvas of (128*128) pixels; otherwise, draw an image canvas of [128*((data length / 128)+1)] pixels, where " / " means rounding down and the default length is (128*128) bytes.
[0078] S13. Color the image canvas. Take the pixel grid in one corner of the image canvas as the origin (0,0) and (128, (data length / 128)+1)) as the end point. Select three bytes of binary data in sequence and use them as RGB data respectively. Start from the origin of the image canvas and render each pixel grid on the image canvas in sequence. If the last three bytes of data are less than three bits, pad them with 0. If there are still unrendered pixels on the image canvas when the bytes of binary data have been used up, pad these unrendered pixels with 0.
[0079] S14. Save the rendered image canvas and output it as an image file in BMP format.
[0080] This involves converting read-only binary data into image files to enable subsequent training for monitoring changes in the data stream using machine learning-based image classification. This allows for real-time monitoring of changes in binary data streams with larger scopes in daily applications. Furthermore, using BMP format as the image format after converting the binary script into image files facilitates subsequent image feature extraction while effectively reducing system memory usage.
[0081] Please refer to Figure 3 and Figure 4 Embodiment two of the present invention is as follows:
[0082] A machine learning-based method for monitoring read-only data changes, based on the first embodiment described above, in this embodiment, as follows: Figure 3 As shown, step S2 specifically includes the following steps:
[0083] S21. Convert the binary data with key features and irrelevant features into image files according to step S1, and denot them as key data image set and irrelevant data image set respectively. Generate training set and test set according to key data image set and irrelevant data image set respectively.
[0084] The training set is generated by taking X% of the key data image set and X% of the irrelevant data image set, and the test set is generated by taking Y% of the key data image set and Y% of the irrelevant data image set, with X% + Y% = 100%.
[0085] S22. Analyze the features of the image files in the training set, extract the color features, texture features, and shape features of the images, and obtain image features and classifiers suitable for image classification through experimental comparison, so as to classify key data and irrelevant data. This includes the following sub-steps:
[0086] S22a. Analyze the HSV color histogram and color moments of the image's color features, texture features, and shape features through experiments, and extract relevant feature values. The HSV color histogram includes H (hue) channel color histogram information, S (saturation) channel color histogram information, and V (brightness) channel color histogram information.
[0087] Step S22a includes the following sub-steps:
[0088] S22a.1. Divide the color space to obtain information from several sub-intervals. This information is the bin (binary dataset) of the histogram. The values in the bin are feature statistics calculated from the color data of the image.
[0089] Create a histogram and convert it into a one-dimensional color histogram to generate a one-dimensional vector.
[0090] Specifically, the division of the color space is as follows:
[0091] The color space is quantized by counting the number of pixels of each color in each bin to obtain a color histogram. Then, the values of the V, H, and S channels in the color histogram are quantized, i.e., the channel data is divided equally. When building the histogram, the image's saturation information, i.e., the S channel value, is not used; only the H and V channels are selected for information statistics. Specifically, this includes the following sub-steps:
[0092] S22a.1.1. Divide the data of H channel and V channel into levels respectively. This level division is equivalent to creating a histogram of H channel and V channel within a given interval.
[0093] The data in the H and V channels are relatively dispersed, with H channel values ranging from 0 to 360 and V channel values ranging from 0 to 1.
[0094] S22a.1.2. Merge the histograms obtained in step S22a.1.1 to obtain a one-dimensional color histogram color representation.
[0095] Color moments are a lightweight and computationally fast way to represent color distribution. To express image information using color moments, you only need to calculate 9 components. Color moments are applicable to both HSV and RGB channels because both channels contain 3 color components. For each component, you only need to calculate 3 low-order moments: the first moment is the average value of the image pixels, the second moment is the variance of the image pixels, and the third moment is the skewness of the image pixels. This provides a more comprehensive representation of the color distribution of the image.
[0096] S22b. Extract the texture features of the image. This involves first converting the color image file to a grayscale image, then compressing the grayscale image, calculating the gray-level co-occurrence matrix, and calculating the average and standard deviation of the four quantities corresponding to the gray-level co-occurrence matrix: energy, entropy, moment of inertia, and correlation values. This allows the texture features of the image to be expressed using 8-dimensional data. Specifically, this includes the following sub-steps:
[0097] S22b.1 First, use the general method to convert the color image file into a grayscale image (here, the shifted average method is used, that is, the RGB color values are multiplied by R by 76, G by 151, and B by 28 respectively, then shifted to the right by 8 bits, and the last 8 bits of binary value are taken as the grayscale value. Then, the original RGB numbers are replaced with the grayscale value, and the image becomes a grayscale image).
[0098] Then, a statistical method is used to extract the gray-level co-occurrence matrix of the texture features of the data image, specifically:
[0099] Establish gray-level co-occurrence matrices for the image in the horizontal, vertical, diagonal, and anti-diagonal directions, with angles of 0°, 45°, 90°, and 135°. The gray-level value of a pixel (x, y) and an offset pixel (x+a, y+b) in the data image is (i, j). The point (x, y) moves across the data image to obtain different (i, j) values. The gray-level level L is 256, and there are L2 combinations of i and j. Count the number of occurrences of each (i, j) value, and then normalize them to the probability Pij. The resulting inverse [Pij]L×L is the gray-level co-occurrence matrix.
[0100] S22b.2 Next, the grayscale image in step SSSb.1 is processed. The grayscale value range of the image is [0, 255]. The value of this range is divided into 16 levels to obtain the compressed grayscale image. The image also has four grayscale co-occurrence matrices with a distance of 1 and angles of 0°, 45°, 90° and 135° respectively.
[0101] S22b.3. Then, normalize the four gray-level co-occurrence matrices described above to generate normalized gray-level co-occurrence matrices. Then, calculate the energy, entropy, moment of inertia, and correlation coefficient corresponding to the normalized gray-level co-occurrence matrix. Then, calculate the average value and standard deviation of the above four quantities. A total of 8 dimensions of data are used to express the texture characteristics of the compressed image.
[0102] S22c. Extract the overall contour features of a specific target and the region features of the email image from the data image according to the shape invariant moment method. Use HU invariant moments to generate the shape features of the data image and extract the shape features. The specific steps include the following:
[0103] S22c.1 Define the data image representation function as f(x,y);
[0104] S22c.2, Define the central moment of the standard moments of the data image;
[0105] S22c.3 Finally, construct the HU invariant moments based on the normalized central moments of the second and third orders, calculate the 7 invariant moments for each data image, and then concatenate the 7 invariant moments into a one-dimensional vector to obtain the shape features of the data image.
[0106] S23. Performance evaluation experiments are conducted on the test set using image features and classifiers. In this embodiment, after selecting suitable image features and classifiers for image classification through experimental comparison, HSV color histogram features and texture features with high classification accuracy and recall are selected. Then, image files containing key data and irrelevant data are classified using a K-NN classifier and an ensemble learning classifier. Specifically, this includes the following sub-steps:
[0107] S23a. Input color features, texture features, and shape features into the K-NN algorithm, Naive Bayes algorithm, ensemble learning algorithm, discriminant analysis algorithm, SVM algorithm, and random forest algorithm respectively to conduct six sets of experiments. The algorithm with the best stability in the experimental results is used to classify the data image.
[0108] In six sets of experiments, the accuracy and recall of color moments, HSV color histograms, texture features, and shape features in key data change classification were tested. A longitudinal analysis and comparison of the six sets of experiments were also conducted. Based on the experimental results, it was found that, in terms of image features, HSV color histogram features and texture features performed best and were most stable. Through longitudinal comparison, it was found that, in terms of classifiers, K-NN classifiers and ensemble learning classifiers performed best and were most stable. Based on these conclusions, HSV color histograms and texture features were adopted as the main image features, and K-NN classifiers and ensemble learning classifiers were adopted as the main classifiers. Finally, it was concluded that the two most suitable image features for key data change monitoring are HSV color histograms and texture features, and the two classifiers with the best classification performance are K-NN classifiers and ensemble learning classifiers.
[0109] The ensemble learning classifier is trained on the training set using multiple individual classifiers. These independently trained classifiers are iteratively combined until the best-performing classifier is obtained. The classifier selection process involves the following sub-steps:
[0110] S23a.1. Assign certain weights to the classification data of each individual classifier;
[0111] S23a.2. Run each individual classifier on the training set to obtain the classification accuracy of each individual classifier under the current structure;
[0112] S23a.3 Adjust the weights by increasing the weights of samples that were correctly classified in the previous test and decreasing the weights of samples that were misclassified in the previous test.
[0113] S23a.4. Repeat the above three steps until the difference in accuracy between the two classifications converges to the expected value.
[0114] S23b. Through three sets of experiments, the average classification accuracy of HSV color histograms with dimensions of 16, 32, and 64 was further determined when applied to various classifiers. The results showed that the average classification accuracy of each classifier was the highest when the HSV color histogram dimension was 16. Therefore, the dimension of the HSV color histogram feature used for classification was determined to be 16.
[0115] S23c. Through three sets of experiments, the average classification accuracy of the K-NN classifier when the HSV color histogram dimensions are 16, 32 and 64, with K values of 3, 5, 7 and 9, was further determined. The results showed that the classification accuracy was highest when K=5.
[0116] S23d. Finally, when using texture features, the average classification accuracy of the K-NN classifier was determined when K values were 3, 5, 7 and 9. The results also showed that the classification accuracy was highest when K=5.
[0117] Based on the experimental results above, the image features suitable for image classification are 16-dimensional HSV color histogram features and texture features. The classifiers suitable for image classification are the K-NN classifier with K=5 and the ensemble learning classifier.
[0118] S23e: Input the HSV color histogram features and texture features of the email images into a K-NN classifier based on rough set attribute reduction, respectively, to obtain two classification results. Then, input the HSV color histogram features and texture features into an ensemble classifier, again to obtain two classification results, for a total of four classification results. Experiments are conducted on the test set using a classification label voting method to verify the experimental results and evaluate their performance. Ultimately, the goal is to improve the accuracy, recall, and overall performance F-score for effectively filtering key data image changes. Specifically, this includes the following sub-steps:
[0119] S23e.1 Validate on the test set and evaluate the performance of the K-NN classifier and ensemble learning classifier, mainly based on accuracy, recall and overall performance F-score.
[0120] The average accuracy metric is calculated using formula (1):
[0121]
[0122] Among them, Precision is the accuracy rate, which reflects the ability of the critical data image change monitoring system to filter critical data changes. A represents the number of critical data changes that are correctly classified, and B indicates the number of irrelevant data changes that are misjudged as critical data changes.
[0123] The recall rate evaluation index is calculated using formula (2):
[0124]
[0125] Here, Recall is the recall rate, which reflects the monitoring system's ability to detect critical data changes. A indicates the number of critical data changes that are correctly classified, and C indicates the number of irrelevant data changes that are misclassified as critical data changes.
[0126] The false positive rate evaluation index is calculated using formula (3):
[0127]
[0128] Here, FailureRate is the false positive rate, which indicates the probability of classifying irrelevant data changes as critical data changes. A represents the number of critical data changes that are correctly classified, and B represents the number of irrelevant data changes that are misclassified as critical data changes.
[0129] The comprehensive performance F-value evaluation index is calculated using formula (4):
[0130]
[0131] Among them, the F-value is a comprehensive balancing indicator between recall and precision, which reflects the overall effect of data changes; β is a parameter commonly used by those skilled in the art to balance the importance of precision and recall, and is generally set to 1; when β = 1, the F-value is called the F1 value, which is the harmonic mean of precision and recall.
[0132] S24. After the performance evaluation is completed, the image features are input into the classifier to obtain the classification results. The classification results are then labeled and projected onto the screen. The key data images are determined based on the voting results to obtain the image files of the data changes.
[0133] In this embodiment, as Figure 4 As shown, the HSV color histogram features are classified into three categories using a K-NN classifier: category 1, texture features are classified into three categories using a K-NN classifier: category 2, HSV color histogram features are classified into three categories using an ensemble learning classifier: category 3, and texture features are classified into three categories using an ensemble learning classifier: category 4. Then, a label voting is performed on each category result. If the number of results indicating a key data change is greater than 2, the data image is finally identified as a key data image, i.e., read-only data that has detected a change in data flow.
[0134] In this embodiment, suitable image features and classifiers are obtained by training images converted from binary data streams with key and irrelevant features on a training set. Then, the performance is evaluated using a test set to finally determine the most suitable HSV color histogram features, texture features, K-NN classifier, and ensemble learning classifier. This effectively improves classification accuracy, recall, and overall performance, thereby improving the accuracy of detected image files with key data changes.
[0135] Please refer to Figure 5 Embodiment five of the present invention is as follows:
[0136] A machine learning-based read-only data change monitoring terminal, such as Figure 5As shown, it includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in Embodiment 1 or Embodiment 2 described above.
[0137] In summary, the machine learning-based read-only data change monitoring method and terminal provided by this invention can monitor system changes within a business system without requiring any modifications to the original system or touching the internal workings of the business system. It only requires providing read-only permissions to the business system's data source or corresponding view; it does not impact the performance of the business system; it can operate at night, performing optimized data detection calculations within a certain time difference strategy and reporting abnormal data; it implements proactive data source detection within a certain range, reducing the data change escape rate to one per thousand; it enhances the rigor of business data processing in the business system, preventing destructive defects introduced by secondary development; and it can also serve as an auxiliary component of data integration platforms, business collaboration platforms, and read data platforms to monitor data source stability and ensure the accuracy of platform data.
[0138] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for monitoring read-only data changes based on machine learning, characterized in that, Including the following steps: S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format: S11. Obtain a read-only data packet and export the read-only data packet into binary format to obtain binary data; S12. Obtain the data length of the binary data and determine whether the data length exceeds the default length. If it does not exceed the default length, draw an image canvas of (128*128) pixels; otherwise, draw an image canvas of [128*((data length / 128)+1)] pixels, where " / " indicates rounding down, and the default length is (128*128) bytes. S13. Color the image canvas. Take the pixel grid in one corner of the image canvas as the origin (0,0) and (128, (the data length / 128)+1)) as the end point. Select three bytes of the binary data in sequence and use them as RGB data respectively. Start from the origin of the image canvas and render each pixel grid on the image canvas in sequence. If the last three bytes of data are less than three bits, pad them with 0. If there are still unrendered pixel grids on the image canvas when the bytes of the binary data have been used up, these unrendered pixel grids are also padded with 0. S14. Save the rendered image canvas and output it as an image file in image format; S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed: S21. Convert the binary data with key features and irrelevant features into the image files according to step S1, and denot them as the key data image set and the irrelevant data image set respectively. Generate the training set and the test set according to the key data image set and the irrelevant data image set respectively. Specifically, a training set is generated by taking X% of the key data image set and X% of the irrelevant data image set, and a test set is generated by taking Y% of the key data image set and Y% of the irrelevant data image set, where X% + Y% = 100%; S22. Analyze the features of the image files in the training set, extract the color features, texture features and shape features of the images, and obtain image features and classifiers suitable for image classification through experimental comparison; S23. Conduct a performance evaluation experiment on the test set using the image features and the classifier; S24. After the performance evaluation is completed, the image features are input into the classifier to obtain each classification result. The classification results are then used to vote on the labels. Based on the voting results, the key data images are determined to obtain the image files that have undergone data changes.
2. The method for monitoring read-only data changes based on machine learning according to claim 1, characterized in that, The image format is BMP.
3. The method for monitoring read-only data changes based on machine learning according to claim 1, characterized in that, The image features are HSV color histogram features and texture features; The classifiers are K-NN classifiers and ensemble learning classifiers.
4. A read-only data change monitoring terminal based on machine learning, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following steps: S1. Obtain the binary data of the read-only data packet, draw an image canvas according to the data length of the binary data, and render the binary data sequentially onto each pixel of the image canvas to obtain an image file in image format: S11. Obtain a read-only data packet and export the read-only data packet into binary format to obtain binary data; S12. Obtain the data length of the binary data and determine whether the data length exceeds the default length. If it does not exceed the default length, draw an image canvas of (128*128) pixels; otherwise, draw an image canvas of [128*((data length / 128)+1)] pixels, where " / " indicates rounding down, and the default length is (128*128) bytes. S13. Color the image canvas. Take the pixel grid in one corner of the image canvas as the origin (0,0) and (128, (the data length / 128)+1)) as the end point. Select three bytes of the binary data in sequence and use them as RGB data respectively. Start from the origin of the image canvas and render each pixel grid on the image canvas in sequence. If the last three bytes of data are less than three bits, pad them with 0. If there are still unrendered pixel grids on the image canvas when the bytes of the binary data have been used up, these unrendered pixel grids are also padded with 0. S14. Save the rendered image canvas and output it as an image file in image format; S2. Perform machine learning image classification on the image file to obtain the image file whose data has changed: S21. Convert the binary data with key features and irrelevant features into the image files according to step S1, and denot them as the key data image set and the irrelevant data image set respectively. Generate the training set and the test set according to the key data image set and the irrelevant data image set respectively. Specifically, a training set is generated by taking X% of the key data image set and X% of the irrelevant data image set, and a test set is generated by taking Y% of the key data image set and Y% of the irrelevant data image set, where X% + Y% = 100%; S22. Analyze the features of the image files in the training set, extract the color features, texture features and shape features of the images, and obtain image features and classifiers suitable for image classification through experimental comparison; S23. Conduct a performance evaluation experiment on the test set using the image features and the classifier; S24. After the performance evaluation is completed, the image features are input into the classifier to obtain each classification result. The classification results are then used to vote on the labels. Based on the voting results, the key data images are determined to obtain the image files that have undergone data changes.
5. A machine learning-based read-only data change monitoring terminal according to claim 4, characterized in that, The image format is BMP.
6. A read-only data change monitoring terminal based on machine learning according to claim 4, characterized in that, The image features are HSV color histogram features and texture features; The classifiers are K-NN classifiers and ensemble learning classifiers.
Citation Information
Patent Citations
Two-dimensional cinematic medical imaging in color based on deep learning
CN107862726A
Image junk mail filtering method based on machine learning
CN109347719A