Charging pile data security sharing method and system based on blockchain

By analyzing the misclassification characteristics and common fault characteristics of charging pile data, adjusting the weight of the weak classifier, and building an integrated classifier, the accuracy problem of the AdaBoost algorithm in identifying abnormal charging pile data is solved, and the accuracy of safe sharing of charging pile data is improved. .

CN118152948BActive Publication Date: 2024-09-03HEBEI BITJUKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410565610.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-09
Publication Date
2024-09-03
Estimated Expiration
2044-05-09

AI Technical Summary

Technical Problem

The existing AdaBoost algorithm is difficult to achieve high recognition accuracy when identifying abnormalities in charging pile data, resulting in a reduction in the accuracy of safe sharing of charging pile data.

Method used

By obtaining the charging pile data, perform the first classification to obtain a weak classifier, analyze the characteristics of the misclassified data, calculate the difference recognition of fault categories, obtain the common characteristics of faults through SVD decomposition and KM matching algorithm, adjust the weight of the weak classifier, and construct The final ensemble classifier.

Benefits of technology

It improves the accuracy of classification results of charging pile data, enhances the ability to identify fault data, and ensures the safe sharing of charging pile data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118152948B
    Figure CN118152948B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and specifically to a method and system for secure sharing of charging pile data based on blockchain, including: obtaining a number of charging pile data, performing a first classification on all charging pile data, obtaining a first weak classifier and a classification result of the first weak classifier, and obtaining a first fault category difference recognition and a second fault category difference recognition of the first weak classifier according to the classification result of the first weak classifier and the fault category corresponding to each fault data in all charging pile data, thereby obtaining a final fault category difference recognition of the first weak classifier, and thereby obtaining a charging pile data secure sharing result. The present invention improves the classification result of the charging pile data by adaptively adjusting the weight of each weak classifier, thereby ensuring the secure sharing of the charging pile data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and system for securely sharing charging pile data based on blockchain. Background Art

[0002] The secure sharing of charging pile data can be achieved through the characteristics of immutability, decentralization and distributed storage provided by blockchain technology. Abnormal data will appear in the charging pile data during use. For example, when the charging pile system is attacked or the charging pile fails, the conventional method trains a classifier and uses the classification results as the basis for data security verification to ensure that only legal data is allowed to be shared and exchanged through the blockchain. Among them, the AdaBoost algorithm, as an integrated classifier, is often used to train classifiers in this process, but the anomalies here include charging pile data anomalies caused by system anomalies and data anomalies caused by the failure of the charging pile itself. For different anomalies, the abnormal performance of the data is different, which makes it difficult for the existing AdaBoost algorithm to achieve a high recognition accuracy when identifying normal and abnormal data, thereby reducing the data accuracy of the secure sharing of charging pile data. Summary of the invention

[0003] The present invention provides a charging pile data security sharing method and system based on blockchain to solve the existing problems.

[0004] The blockchain-based charging pile data security sharing method and system of the present invention adopts the following technical solutions:

[0005] An embodiment of the present invention provides a method for securely sharing charging pile data based on blockchain, the method comprising the following steps:

[0006] Acquire a plurality of charging pile data; wherein all charging pile data are divided into a plurality of normal data and a plurality of fault data, and each fault data corresponds to a fault category;

[0007] Performing a first classification on all pieces of charging pile data to obtain a first weak classifier and a classification result of the first weak classifier; wherein the classification result of the first weak classifier is: all pieces of charging pile data are divided into a plurality of first normal data and a plurality of first fault data; according to the classification result of the first weak classifier and the fault category corresponding to each fault data in all pieces of charging pile data, obtaining the first fault category difference recognition of the first weak classifier;

[0008] According to the classification result of the first weak classifier and all the fault data corresponding to each same fault category in all the charging pile data, a first matrix and several second matrices are obtained respectively; according to the difference between the first matrix and each second matrix, the common fault feature corresponding to each second matrix is ​​obtained;

[0009] According to the common fault features corresponding to each second matrix, the second fault category difference recognition of the first weak classifier is obtained;

[0010] Based on the first fault category difference recognition and the second fault category difference recognition of the first weak classifier and the classification result of the first weak classifier, the final fault category difference recognition of the first weak classifier is obtained; based on the final fault category difference recognition of the first weak classifier and the first weak classifier, the charging pile data security sharing result is obtained.

[0011] Furthermore, the first fault category difference recognition of the first weak classifier is obtained according to the classification result of the first weak classifier and the fault category corresponding to each fault data in all the charging pile data, and the specific steps include the following:

[0012] Among all pieces of charging pile data, when any piece of fault data is classified as first normal data in the classification result of the first weak classifier, the any piece of fault data is recorded as misclassified fault data;

[0013] Among the fault categories corresponding to all the misclassified fault data, the number of misclassified fault data corresponding to each same fault category is counted, and the variance of the number of misclassified fault data corresponding to all the same fault categories is recorded as the misclassified fault data category difference feature;

[0014] According to the difference characteristics of the misclassified fault data categories, all the misclassified fault data and the number of different fault categories in the fault categories corresponding to all the fault data, the first fault category difference recognition of the first weak classifier is obtained.

[0015] Furthermore, according to the difference characteristics of the misclassified fault data categories, all the misclassified fault data and the number of different fault categories in the fault categories corresponding to all the fault data, a specific calculation formula corresponding to the first fault category difference recognition of the first weak classifier is obtained as follows:

[0016]

[0017] in, is the first fault category difference recognition of the first weak classifier, is the number of different fault categories in the fault categories corresponding to all misclassified fault data, is the number of different fault categories in the fault categories corresponding to all fault data pieces, To identify the difference in the category of misclassified fault data, is an exponential function with a natural constant as its base.

[0018] Furthermore, according to the classification result of the first weak classifier and all pieces of fault data corresponding to each same fault category in all pieces of charging pile data, a first matrix and several second matrices are obtained respectively, including the following specific steps:

[0019] Among all the charging pile data, when any normal data is classified as the first fault data in the classification result of the first weak classifier, the any normal data is recorded as misclassified normal data;

[0020] Each misclassified normal data is a row of the matrix, and a first matrix is ​​constructed according to all the misclassified normal data;

[0021] According to the construction method of the first matrix, among the fault categories corresponding to all the fault data pieces, all the fault data pieces corresponding to each same fault category are used to construct a second matrix corresponding to each same fault category.

[0022] Furthermore, the method of obtaining the common fault feature corresponding to each second matrix according to the difference between the first matrix and each second matrix includes the following specific steps:

[0023] Perform SVD decomposition on the first matrix to obtain the right singular matrix corresponding to the first matrix;

[0024] A right singular vector is formed according to each column of data in the right singular matrix; each right singular vector is recorded as a first eigenvector;

[0025] According to the method of obtaining the first eigenvector corresponding to the first matrix, a plurality of second eigenvectors corresponding to each second matrix are obtained;

[0026] Each first eigenvector corresponding to the first matrix is ​​a left node, and the Each second eigenvector corresponding to the second matrix is ​​a right node, and the KM matching algorithm is used to match all the first eigenvectors corresponding to the first matrix with the Match all second eigenvectors corresponding to the second matrices to obtain a number of matching pairs and the edge value of each matching pair;

[0027] The matching pairs whose edge values ​​are greater than the preset retention threshold are recorded as the retained matching pairs;

[0028] Keep the first A second eigenvector corresponding to the second matrix is ​​recorded as the retained fault eigenvector;

[0029] Will remove The other second matrices besides the second matrix are denoted as A reference second matrix of a second matrix;

[0030] Obtaining a fault commonality feature of each retained fault feature vector according to each second feature vector corresponding to each reference second matrix;

[0031] The sum of the common fault features of all retained fault feature vectors is recorded as The common fault characteristics corresponding to the second matrix.

[0032] Furthermore, the method of obtaining the fault commonality feature of each retained fault feature vector according to each second feature vector corresponding to each reference second matrix comprises the following specific steps:

[0033] Calculate the The retained fault feature vector and The cosine similarity of each second eigenvector corresponding to the second reference matrix is ​​counted. The retained fault feature vector and The maximum value of the cosine similarities of all the second eigenvectors corresponding to the second reference matrix is ​​selected. When the maximum value is greater than a preset similarity threshold, the first eigenvector corresponding to the maximum value is selected. The second eigenvector corresponding to the reference second matrix is ​​denoted as The relevant feature vectors corresponding to the retained fault feature vectors;

[0034] The first The ratio of the number of all relevant eigenvectors corresponding to the retained fault eigenvector to the number of all reference second matrices is denoted as The common fault features of the fault feature vector are retained.

[0035] Furthermore, the specific calculation formula corresponding to the second fault category difference recognition of the first weak classifier is obtained according to the common fault characteristics corresponding to each second matrix:

[0036]

[0037] in, is the second fault category difference recognition of the first weak classifier, For the The common fault characteristics corresponding to the second matrix are: is the number of the second matrix, is an exponential function with a natural constant as its base.

[0038] Furthermore, the method of obtaining the final fault category difference recognition of the first weak classifier according to the first fault category difference recognition and the second fault category difference recognition of the first weak classifier and the classification result of the first weak classifier includes the following specific steps:

[0039] Among all pieces of charging pile data, when any piece of fault data is classified as first normal data in the classification result of the first weak classifier, the any piece of fault data is recorded as misclassified fault data;

[0040] When any piece of normal data is classified as first fault data in the classification result of the first weak classifier, the any piece of normal data is recorded as misclassified normal data;

[0041] According to the first fault category difference recognition, the second fault category difference recognition and the number of misclassified fault data and misclassified normal data of the first weak classifier, the specific calculation formula corresponding to the final fault category difference recognition of the first weak classifier is obtained as follows:

[0042]

[0043] in, is the final fault category difference recognition of the first weak classifier, is the number of misclassified fault data, is the number of misclassified normal data, is the first fault category difference recognition of the first weak classifier, is the second fault category difference recognition of the first weak classifier.

[0044] Furthermore, the charging pile data security sharing result is obtained based on the final fault category difference recognition of the first weak classifier and the first weak classifier, and the specific steps include the following:

[0045] The final fault category difference recognition of the first weak classifier is recorded as the weight of the first weak classifier;

[0046] According to the weight of the first weak classifier, the AdaBoost algorithm is used to perform a second classification on all charging pile data to obtain the second weak classifier and the classification results of the second weak classifier;

[0047] In the classification result of the second weak classifier, the weight of the second weak classifier is obtained according to the method of obtaining the weight of the first weak classifier;

[0048] According to the weight of the second weak classifier, the AdaBoost algorithm is used to perform a third classification on all charging pile data to obtain the third weak classifier and the classification results of the third weak classifier;

[0049] By analogy, several weak classifiers and the weight of each weak classifier are obtained;

[0050] According to the weights of all weak classifiers and weak classifiers, the final integrated classifier is constructed;

[0051] Acquire several pieces of real-time data of charging piles, use the final integrated classifier to calculate all pieces of real-time data of charging piles, and obtain the classification result of each piece of real-time data of charging piles as normal data or fault data;

[0052] In the classification results of each charging pile real-time data being normal data or fault data, when any charging pile real-time data is normal data, it is determined that any charging pile real-time data can be shared; when any charging pile real-time data is fault data, it is determined that any charging pile real-time data cannot be shared.

[0053] The present invention also proposes a blockchain-based charging pile data security sharing system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned blockchain-based charging pile data security sharing method.

[0054] The beneficial effects of the technical solution of the present invention are:

[0055] In the embodiment of the present invention, a number of charging pile data are obtained, and all the charging pile data are classified for the first time to obtain the first weak classifier and the classification result of the first weak classifier. According to the classification result of the first weak classifier and the fault category corresponding to each fault data in all the charging pile data, the first fault category difference recognition and the second fault category difference recognition of the first weak classifier are obtained. By analyzing the characteristics of the two kinds of misclassified data respectively, the fault category difference recognition of the first weak classifier in the two kinds of misclassified cases is accurately calculated, and the accuracy of the subsequent weight assignment of the weak classifier is guaranteed. Then the final fault category difference recognition of the first weak classifier is obtained, and the charging pile data security sharing result is obtained, thereby giving a greater weight to the weak classifier that can reflect the difference of the fault data, so as to improve the recognition ability of the final integrated classifier to the fault data, so that when different faults occur, the final integrated classifier can better distinguish normal data from abnormal data, improve the generalization recognition ability of the final integrated classifier, and avoid having a high fault recognition ability and accuracy only when certain faults occur. Thus, the present invention improves the classification result of charging pile data by adaptively adjusting the weight of each weak classifier, thereby ensuring the safe sharing of charging pile data. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.

[0057] Figure 1 This is a flowchart of the steps of the charging pile data security sharing method based on blockchain of the present invention;

[0058] Figure 2 The figure is a flow chart for obtaining the charging pile data security sharing result in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] 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 the specific implementation method, structure, features and effects of the charging pile data security sharing method and system based on blockchain 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.

[0060] 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.

[0061] The specific scheme of the charging pile data security sharing method and system based on blockchain provided by the present invention is described in detail below with reference to the accompanying drawings.

[0062] See also Figure 1 , which shows a flowchart of a method for securely sharing charging pile data based on blockchain provided by an embodiment of the present invention, the method comprising the following steps:

[0063] Step S001: Acquire several pieces of charging pile data; wherein all pieces of charging pile data are divided into several pieces of normal data and several pieces of fault data, and each piece of fault data corresponds to a fault category.

[0064] The purpose of this embodiment is to improve the classification effect of the classifier by improving the ability to identify fault categories during the process of the AdaBoost classifier classifying normal data and fault data.

[0065] Therefore, firstly, normal data and various fault data in the historical data of the charging pile are collected as the training data of the classifier, that is, a number of charging pile data are collected. The charging pile data is the historical data that has been known.

[0066] Each piece of charging pile data in this embodiment is: {start time, end time, duration, charged power, user identifier, current maximum value, current minimum value}, each piece of charging pile data has an identifier, in this embodiment, 0 represents normal data, 1 represents fault data, and each piece of fault data corresponds to a fault category, and the fault categories include permanent faults, transient faults, and intermittent faults, which are described as an example. That is, all pieces of charging pile data are divided into a number of normal data and a number of fault data, and each piece of fault data corresponds to a fault category.

[0067] It should be noted that: since the historical data of the charging pile collected is known data, normal and fault data can be distinguished, and these fault data have already occurred, and the actual cause of the fault can be obtained. According to the actual cause, the actual fault category of each misclassified fault data is obtained. AdaBoost (Adaptive Boosting) is an integrated learning method that builds a strong classifier by combining multiple weak classifiers. This is a well-known technology. Its basic idea is to adjust the weight of the sample in each round of training so that the samples misclassified by the weak classifier in the previous round get more attention in the next round, thereby improving the performance of the overall classifier. The final integrated classifier is the weighted sum of all weak classifiers, and the weight of each weak classifier is determined by its performance during the training process. Therefore, this embodiment gives a greater weight to the weak classifier that can reflect the difference in fault data, thereby improving the integrated classifier's ability to identify fault data, so that when different faults occur, the integrated classifier can better distinguish normal data from abnormal data, improve the generalization recognition ability of the integrated classifier, and avoid having a higher fault recognition ability and accuracy only when certain faults occur.

[0068] Step S002: Perform a first classification on all charging pile data to obtain a first weak classifier and a classification result of the first weak classifier; wherein the classification result of the first weak classifier is: all charging pile data are divided into a number of first normal data and a number of first fault data; based on the classification result of the first weak classifier and the fault category corresponding to each fault data in all charging pile data, the first fault category difference recognition of the first weak classifier is obtained.

[0069] This embodiment selects a decision tree as the type of weak classifier. When classifying fault data using the AdaBoost algorithm, the classification result of the first weak classifier can be obtained first, and then the fault category difference of the weak classifier can be obtained based on the classification result.

[0070] Therefore, the AdaBoost algorithm is used to perform the first classification on all charging pile data, and the first weak classifier and the classification result of the first weak classifier are obtained. Among them, the classification result of the first weak classifier is: all charging pile data are divided into a plurality of first normal data and a plurality of first fault data.

[0071] It should be noted that: from the perspective of classification, since the purpose of classification is to distinguish between normal and abnormal, if the fault data is correctly classified, it reflects the difference between the correct and faulty data, but not the difference in the faulty data. Therefore, it is necessary to find the difference of the faulty data from the misclassified data. If the misclassified data belongs to multiple fault categories and the distribution quantity is relatively close, the difference between the correct and faulty data is likely to come from the difference between the common characteristics of different fault categories and the characteristics of the correct data. It is difficult to reflect the difference characteristics of different fault categories. If the correct data is misclassified as faulty data, it is impossible to directly obtain which fault category the correct data is classified into. When the faulty data is classified as normal data, the misclassification rate of each fault category data can be obtained. If the misclassification rates of data of different fault categories are similar, it is likely that the recognition ability of the common characteristics of the faults is not good, that is, the weak classifier learns more common characteristics of the fault data, and learns fewer difference characteristics of different fault categories. Therefore, the weak classifier should be given a smaller weight.

[0072] Among all pieces of charging pile data, when any piece of fault data is classified as first normal data in the classification result of the first weak classifier, the any piece of fault data is recorded as misclassified fault data.

[0073] Thus, several pieces of misclassified fault data are obtained, and at the same time, the fault category to which each piece of misclassified fault data belongs can be obtained.

[0074] Among the fault categories corresponding to all the misclassified fault data, the number of misclassified fault data corresponding to each same fault category is counted, and the variance of the number of misclassified fault data corresponding to all the same fault categories is recorded as the misclassified fault data category difference feature.

[0075] Then, the calculation formula for the first fault category difference recognition of the first weak classifier is calculated as follows:

[0076]

[0077] in, is the first fault category difference recognition of the first weak classifier, It is the number of different fault categories in the fault categories corresponding to all misclassified fault data. is the number of different fault categories in the fault categories corresponding to all fault data pieces, It is the difference feature of misclassified fault data category. is an exponential function with a natural constant as the base. To present the inverse proportional relationship and normalization processing, the implementer can set the inverse proportional function and normalization function according to the actual situation.

[0078] It should be noted that: the fewer the number of fault categories of the misclassified fault data, the greater the difference in the number of misclassified fault data in different fault categories of the misclassified fault data, the better the first weak classifier has the ability to distinguish different fault categories, that is, the greater the recognition of fault category differences. The larger the value is, the more fault category data in the misclassified fault data is misclassified as normal data, and the smaller the difference in the recognition ability of the first weak classifier for different fault categories is, that is, the smaller the recognition of fault category differences is. The smaller it is, that is, the smaller the difference in the number of data of different fault categories is, the better the first weak classifier has the ability to distinguish different fault categories, that is, the greater the fault category difference recognition is, thus, by calculation, from the perspective of fault data being divided into normal data, the first fault category difference recognition of the first weak classifier is calculated. . The larger it is, the more accurate the classification of fault data is, that is, a greater weight is given to the first weak classifier.

[0079] Step S003: According to the classification result of the first weak classifier and all the fault data corresponding to each same fault category in all the charging pile data, a first matrix and several second matrices are obtained respectively; according to the difference between the first matrix and each second matrix, the common fault characteristics corresponding to each second matrix are obtained.

[0080] When normal data is classified as fault data, it may be due to the difference between the common features of the fault and the normal features that the weak classifier has not learned well. In this case, if a certain feature of the normal data that is incorrectly classified is similar to a certain feature of the fault data, and the similar feature belongs to the common feature of different fault data, it is highly likely that the classifier has a weak ability to distinguish between the two features, resulting in a classification error, and thus the fault category difference corresponding to the weak classifier has a small recognition ability, and the classifier is given a small weight.

[0081] Among all pieces of charging pile data, when any piece of normal data is classified as first fault data in the classification result of the first weak classifier, the any piece of normal data is recorded as misclassified normal data.

[0082] Thus, a plurality of misclassified normal data are obtained, each of which is a row of a matrix, and a first matrix is ​​constructed according to all the misclassified normal data.

[0083] It should be noted that: according to the sequence of the collection time of each misclassified normal data, each misclassified normal data is arranged from top to bottom to obtain a first matrix.

[0084] Perform SVD decomposition on the first matrix to obtain a left singular matrix and a right singular matrix corresponding to the first matrix.

[0085] It should be noted that the Chinese name of SVD (Singular Value Decomposition) decomposition is singular value decomposition, which is a matrix decomposition method that can decompose a matrix into the product of three matrices, including a left singular matrix, a right singular matrix and a singular value matrix. This is a well-known technology and the specific method will not be introduced here.

[0086] A left singular vector is formed according to each column of data in the left singular matrix. A right singular vector is formed according to each column of data in the right singular matrix. Thus, several left singular vectors and several right singular vectors are obtained. Each right singular vector is recorded as a first eigenvector.

[0087] It should be noted that the left singular vector represents the change in the column space of the first matrix, and the right singular vector represents the change in the row space of the original matrix, which corresponds to the main pattern or feature of the row of misclassified normal data. Therefore, the right singular vector is retained as the eigenvector, recorded as the first eigenvector, and then multiple first eigenvectors are obtained. The first eigenvector represents the characteristics of the normal data classified as fault data by the first weak classifier.

[0088] Among all the charging pile data, according to the construction method of the first matrix, among the fault categories corresponding to all the fault data, according to all the fault data corresponding to each same fault category, a second matrix corresponding to each same fault category is constructed, thereby obtaining several second matrices.

[0089] According to the method of obtaining the first eigenvector corresponding to the first matrix, a plurality of second eigenvectors corresponding to the second matrix corresponding to each same fault category are obtained.

[0090] First Take the second matrix as an example, and take each first eigenvector corresponding to the first matrix as a left node. Each second eigenvector corresponding to the second matrix is ​​a right node, and the KM matching algorithm is used to match all the first eigenvectors corresponding to the first matrix with the All second eigenvectors corresponding to the second matrices are matched to obtain a number of matching pairs and the edge value of each matching pair.

[0091] It should be noted that the KM (Kuhn-Munkres) matching algorithm, also known as the Hungarian algorithm, is a well-known technology and the specific method is not introduced here. Each matching pair includes a left node and a right node, that is, a first eigenvector corresponding to the first matrix and a right node. A second eigenvector corresponding to a second matrix, the edge value of each matching pair, also known as the weight of each matching pair, is the output feature of the algorithm.

[0092] The preset retention threshold in this embodiment is 0.9, and the preset similarity threshold is 0.8. This is used as an example for description. Other implementations may set them to other values, which are not limited in this embodiment.

[0093] In the first matrix and the Among all the matching pairs corresponding to the second matrix, the matching pairs whose edge values ​​are greater than the preset retention threshold are recorded as the retained matching pairs, thereby obtaining a plurality of retained matching pairs.

[0094] It should be noted that: matching pairs with a margin value greater than 0.9 indicate that the feature exists in both the misclassified normal data and the fault category data. At this time, if the feature vector in the matching pair corresponding to the fault category has a large similarity with a feature vector of other fault categories, it means that the feature belongs to the common feature of different fault data. It is highly likely that the first weak classifier has a weak ability to distinguish between the two features, resulting in a division error. At this time, the fault category difference corresponding to the weak classifier is less recognizable, and the classifier is given a smaller weight.

[0095] In the first matrix and the Among all the retained matching pairs corresponding to the second matrix, the first A second eigenvector corresponding to the second matrix is ​​recorded as the retained fault eigenvector. Thus, several retained fault eigenvectors are obtained.

[0096] Will remove The other second matrices besides the second matrix are denoted as A reference second matrix of a second matrix.

[0097] In the Among all the retained fault feature vectors corresponding to the second matrix, Take the reserved fault feature vector as an example and calculate the The retained fault feature vector and The cosine similarity of each second eigenvector corresponding to the second reference matrix is ​​counted. The retained fault feature vector and The maximum value of the cosine similarities of all the second eigenvectors corresponding to the second reference matrix is ​​selected. When the maximum value is greater than a preset similarity threshold, the first eigenvector corresponding to the maximum value is selected. The second eigenvector corresponding to the reference second matrix is ​​denoted as The relevant feature vectors corresponding to the retained fault feature vectors are

[0098] According to the above method, from The first eigenvector is selected from all the second eigenvectors corresponding to each reference second matrix of the second matrix. The relevant feature vectors corresponding to the retained fault feature vectors are

[0099] It should be noted that calculating the cosine similarity of two feature vectors is a well-known technique, and the specific method is not introduced here. The larger the cosine similarity, the more similar the two feature vectors are. When there are multiple maximum values ​​of the cosine similarities, any maximum value is taken as an example.

[0100] The first The ratio of the number of all relevant eigenvectors corresponding to the retained fault eigenvector to the number of all reference second matrices is denoted as The common fault features of the fault feature vector are retained.

[0101] According to the above method, we get The common fault features of each retained fault feature vector corresponding to the second matrix.

[0102] In the Among all the retained fault feature vectors corresponding to the second matrix, the sum of the common fault features of all the retained fault feature vectors is recorded as The common fault characteristics corresponding to the second matrix.

[0103] According to the above method, based on the first matrix and each second matrix, the common fault feature corresponding to each second matrix is ​​obtained.

[0104] What needs to be explained is: The more related feature vectors the reserved fault feature vector has, the more common features the reserved fault feature vector has in multiple fault types. The larger the fault commonality feature corresponding to the second matrix, the greater the misclassification of normal data and the The fault types corresponding to the second matrix have more and more similar common features, that is, the classification ability of the first weak classifier is poor and should be given a smaller weight.

[0105] Step S004: Obtain the second fault category difference recognition of the first weak classifier according to the common fault features corresponding to each second matrix.

[0106] It can be seen that the calculation formula for the difference recognition of the second fault category of the first weak classifier is as follows:

[0107]

[0108] in, is the second fault category difference recognition of the first weak classifier, For the The common fault characteristics corresponding to the second matrix are: is the number of the second matrix. is an exponential function with a natural constant as the base. To present the inverse proportional relationship and normalization processing, the implementer can set the inverse proportional function and normalization function according to the actual situation.

[0109] What needs to be explained is: The smaller it is, the less common features there are between the misclassified normal data and all fault types, that is, the first weak classifier has better classification ability and should be given a larger weight.

[0110] Step S005: According to the first fault category difference recognition and the second fault category difference recognition of the first weak classifier and the classification result of the first weak classifier, the final fault category difference recognition of the first weak classifier is obtained; according to the final fault category difference recognition of the first weak classifier and the first weak classifier, the charging pile data security sharing result is obtained.

[0111] In the two misclassification situations, the more misclassification situations there are, the worse the discrimination ability of the first weak classifier is in this misclassification situation, and the weight of the fault category difference recognition calculated based on this situation should be smaller.

[0112] It can be seen that the calculation formula for the final fault category difference recognition of the first weak classifier is as follows:

[0113]

[0114] in, is the final fault category difference recognition of the first weak classifier, is the number of misclassified fault data, is the number of misclassified normal data, is the first fault category difference recognition of the first weak classifier, is the second fault category difference recognition of the first weak classifier.

[0115] What needs to be explained is: It is calculated based on the misclassified fault data. It is calculated based on the misclassified normal data. and The larger the value is, the better the first weak classifier is at distinguishing normal data from faulty data, and a larger weight should be given to the first weak classifier. Greater than , it means that the first weak classifier is less effective in distinguishing fault data than normal data, so it should be given Smaller weight is given A larger weight. and The sum of represents the final fault category difference recognition of the first weak classifier.

[0116] The final fault category difference recognition of the first weak classifier is recorded as the weight of the first weak classifier.

[0117] According to the weight of the first weak classifier, the AdaBoost algorithm is used to perform a second classification on all charging pile data to obtain the second weak classifier and the classification results of the second weak classifier.

[0118] In the classification result of the second weak classifier, the weight of the second weak classifier is obtained according to the method of obtaining the weight of the first weak classifier.

[0119] According to the weight of the second weak classifier, the AdaBoost algorithm is used to perform a third classification on all charging pile data to obtain the third weak classifier and the classification results of the third weak classifier.

[0120] By analogy, several weak classifiers and the weight of each weak classifier are obtained. According to all weak classifiers and the weights of weak classifiers, a final integrated classifier is constructed. In addition, the known technology is not specifically described here.

[0121] In the current period of time, a number of pieces of real-time data of charging piles are obtained, wherein the collection method of the real-time data of charging piles is the same as the collection method of the pieces of data of charging piles in the historical data of charging piles.

[0122] The final integrated classifier is used to operate on all charging pile real-time data to obtain the classification result of each charging pile real-time data as normal data or fault data.

[0123] In the classification results of each charging pile real-time data being normal data or fault data, when any charging pile real-time data is normal data, it is determined that the any charging pile real-time data can be shared. When any charging pile real-time data is fault data, it is determined that the any charging pile real-time data cannot be shared. Thus, the safe sharing of charging pile data is completed, so the flow chart for obtaining the safe sharing result of charging pile data is as follows: Figure 2 shown.

[0124] It should be noted that the charging pile data security sharing system should support the secure sharing and transaction of data, allowing different entities to share and exchange data securely, such as charging pile suppliers, energy companies and charging pile users. The use of blockchain technology can track the source and flow of data to ensure the traceability and credibility of data transactions. Use the AdaBoost classifier to classify the charging pile data, for example, the charging pile data is divided into normal data and fault data. Normal data may include normal usage records of charging piles, while fault data includes possible security attacks or abnormal usage, so fault data cannot be shared. The classification results can be used as a basis for data security verification to ensure that only legal data is allowed to be shared and exchanged. In this embodiment, the AdaBoost classifier is used to classify the current real-time data of the charging pile. If it is normal data, the classification result 0 is used as the basis for data security verification, and the data is allowed to be shared and exchanged. Otherwise, it is not allowed. This example is used for description.

[0125] So far, the present invention is completed.

[0126] In summary, in an embodiment of the present invention, a number of charging pile data are obtained, and all charging pile data are classified for the first time to obtain the first weak classifier and the classification result of the first weak classifier. According to the classification result of the first weak classifier and the fault category corresponding to each fault data in all charging pile data, the first fault category difference recognition and the second fault category difference recognition of the first weak classifier are obtained, thereby obtaining the final fault category difference recognition of the first weak classifier, thereby obtaining the charging pile data security sharing result. The present invention improves the classification result of the charging pile data by adaptively adjusting the weight of each weak classifier, thereby ensuring the safe sharing of the charging pile data.

[0127] The present invention also provides a charging pile data security sharing system based on blockchain, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program stored in the memory to implement the steps of the aforementioned charging pile data security sharing method based on blockchain.

[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A charging pile data security sharing method based on blockchain, characterized in that: The method comprises the following steps: Acquire a plurality of charging pile data; wherein all charging pile data are divided into a plurality of normal data and a plurality of fault data, and each fault data corresponds to a fault category; Performing a first classification on all pieces of charging pile data to obtain a first weak classifier and a classification result of the first weak classifier; wherein the classification result of the first weak classifier is: all pieces of charging pile data are divided into a plurality of first normal data and a plurality of first fault data; according to the classification result of the first weak classifier and the fault category corresponding to each fault data in all pieces of charging pile data, obtaining the first fault category difference recognition of the first weak classifier; According to the classification result of the first weak classifier and all the fault data corresponding to each same fault category in all the charging pile data, a first matrix and several second matrices are obtained respectively; according to the difference between the first matrix and each second matrix, the common fault feature corresponding to each second matrix is ​​obtained; According to the common fault features corresponding to each second matrix, the second fault category difference recognition of the first weak classifier is obtained; According to the first fault category difference recognition and the second fault category difference recognition of the first weak classifier and the classification result of the first weak classifier, the final fault category difference recognition of the first weak classifier is obtained; according to the final fault category difference recognition of the first weak classifier and the first weak classifier, the charging pile data security sharing result is obtained; The specific steps of obtaining a first matrix and a plurality of second matrices according to the classification result of the first weak classifier and all pieces of fault data corresponding to each same fault category in all pieces of charging pile data are as follows: Among all the charging pile data, when any normal data is classified as the first fault data in the classification result of the first weak classifier, the any normal data is recorded as misclassified normal data; Each misclassified normal data is a row of the matrix, and a first matrix is ​​constructed according to all the misclassified normal data; According to the construction method of the first matrix, among the fault categories corresponding to all the fault data pieces, all the fault data pieces corresponding to each same fault category are used to construct a second matrix corresponding to each same fault category.

2. According to the blockchain-based charging pile data security sharing method of claim 1, it is characterized in that: The specific steps of obtaining the first fault category difference recognition of the first weak classifier according to the classification result of the first weak classifier and the fault category corresponding to each fault data in all the charging pile data are as follows: Among all pieces of charging pile data, when any piece of fault data is classified as first normal data in the classification result of the first weak classifier, the any piece of fault data is recorded as misclassified fault data; Among the fault categories corresponding to all the misclassified fault data, the number of misclassified fault data corresponding to each same fault category is counted, and the variance of the number of misclassified fault data corresponding to all the same fault categories is recorded as the misclassified fault data category difference feature; According to the difference characteristics of the misclassified fault data categories, all the misclassified fault data and the number of different fault categories in the fault categories corresponding to all the fault data, the first fault category difference recognition of the first weak classifier is obtained.

3. According to the blockchain-based charging pile data security sharing method of claim 2, it is characterized in that: The specific calculation formula corresponding to the first fault category difference recognition of the first weak classifier is obtained according to the difference characteristics of the misclassified fault data categories, all the misclassified fault data and the number of different fault categories in the fault categories corresponding to all the fault data: in, is the first fault category difference recognition of the first weak classifier, is the number of different fault categories in the fault categories corresponding to all misclassified fault data, is the number of different fault categories in the fault categories corresponding to all fault data pieces, To identify the difference in the category of misclassified fault data, is an exponential function with a natural constant as its base.

4. The method for securely sharing charging pile data based on blockchain according to claim 1 is characterized in that: The method of obtaining the common fault characteristics corresponding to each second matrix according to the difference between the first matrix and each second matrix includes the following specific steps: Perform SVD decomposition on the first matrix to obtain the right singular matrix corresponding to the first matrix; A right singular vector is formed according to each column of data in the right singular matrix; each right singular vector is recorded as a first eigenvector; According to the method of obtaining the first eigenvector corresponding to the first matrix, a plurality of second eigenvectors corresponding to each second matrix are obtained; Each first eigenvector corresponding to the first matrix is ​​a left node, and the Each second eigenvector corresponding to the second matrix is ​​a right node, and the KM matching algorithm is used to match all the first eigenvectors corresponding to the first matrix with the Match all second eigenvectors corresponding to the second matrices to obtain a number of matching pairs and the edge value of each matching pair; The matching pairs whose edge values ​​are greater than the preset retention threshold are recorded as the retained matching pairs; Keep the first A second eigenvector corresponding to the second matrix is ​​recorded as the retained fault eigenvector; Will remove The other second matrices besides the second matrix are denoted as A reference second matrix of a second matrix; Obtaining a fault commonality feature of each retained fault feature vector according to each second feature vector corresponding to each reference second matrix; The sum of the common fault features of all retained fault feature vectors is recorded as The common fault characteristics corresponding to the second matrix.

5. The method for securely sharing charging pile data based on blockchain according to claim 4 is characterized in that: The method of obtaining the fault commonality feature of each retained fault feature vector according to each retained fault feature vector and each second feature vector corresponding to each reference second matrix comprises the following specific steps: Calculate the The retained fault feature vector and The cosine similarity of each second eigenvector corresponding to the second reference matrix is ​​counted. The retained fault feature vector and The maximum value of the cosine similarities of all the second eigenvectors corresponding to the second reference matrix is ​​selected. When the maximum value is greater than a preset similarity threshold, the first eigenvector corresponding to the maximum value is selected. The second eigenvector corresponding to the reference second matrix is ​​denoted as The relevant feature vectors corresponding to the retained fault feature vectors; The first The ratio of the number of all relevant eigenvectors corresponding to the retained fault eigenvector to the number of all reference second matrices is denoted as The common fault features of the fault feature vector are retained.

6. The method for securely sharing charging pile data based on blockchain according to claim 1 is characterized in that: The specific calculation formula corresponding to the second fault category difference recognition of the first weak classifier is obtained according to the common fault characteristics corresponding to each second matrix: in, is the second fault category difference recognition of the first weak classifier, For the The common fault characteristics corresponding to the second matrix are: is the number of the second matrix, is an exponential function with a natural constant as its base.

7. The method for securely sharing charging pile data based on blockchain according to claim 1 is characterized in that: The step of obtaining the final fault category difference recognition of the first weak classifier according to the first fault category difference recognition and the second fault category difference recognition of the first weak classifier and the classification result of the first weak classifier includes the following specific steps: Among all pieces of charging pile data, when any piece of fault data is classified as first normal data in the classification result of the first weak classifier, the any piece of fault data is recorded as misclassified fault data; When any piece of normal data is classified as first fault data in the classification result of the first weak classifier, the any piece of normal data is recorded as misclassified normal data; According to the first fault category difference recognition, the second fault category difference recognition and the number of misclassified fault data and misclassified normal data of the first weak classifier, the specific calculation formula corresponding to the final fault category difference recognition of the first weak classifier is obtained as follows: in, is the final fault category difference recognition of the first weak classifier, is the number of misclassified fault data, is the number of misclassified normal data, is the first fault category difference recognition of the first weak classifier, is the second fault category difference recognition of the first weak classifier.

8. The method for securely sharing charging pile data based on blockchain according to claim 1 is characterized in that: The method of obtaining the charging pile data security sharing result based on the final fault category difference recognition of the first weak classifier and the first weak classifier includes the following specific steps: The final fault category difference recognition of the first weak classifier is recorded as the weight of the first weak classifier; According to the weight of the first weak classifier, the AdaBoost algorithm is used to perform a second classification on all charging pile data to obtain the second weak classifier and the classification results of the second weak classifier; In the classification result of the second weak classifier, the weight of the second weak classifier is obtained according to the method of obtaining the weight of the first weak classifier; According to the weight of the second weak classifier, the AdaBoost algorithm is used to perform a third classification on all charging pile data to obtain the third weak classifier and the classification results of the third weak classifier; By analogy, several weak classifiers and the weight of each weak classifier are obtained; According to the weights of all weak classifiers and weak classifiers, the final integrated classifier is constructed; Acquire several pieces of real-time data of charging piles, use the final integrated classifier to calculate all pieces of real-time data of charging piles, and obtain the classification result of each piece of real-time data of charging piles as normal data or fault data; In the classification results of each charging pile real-time data being normal data or fault data, when any charging pile real-time data is normal data, it is determined that any charging pile real-time data can be shared; when any charging pile real-time data is fault data, it is determined that any charging pile real-time data cannot be shared.

9. A charging pile data security sharing system based on blockchain, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the computer program is executed by the processor, the steps of the blockchain-based charging pile data security sharing method as described in any one of claims 1 to 8 are implemented.