Protocol dynamic adaptation method for stock power Internet of Things terminal
By standardizing and training the communication message data of existing power IoT terminals, and combining edge deployment and federated learning, the problem of low management efficiency of existing power IoT terminal devices is solved, and high-precision automated protocol identification and management are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-27
Smart Images

Figure CN121750754A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power internet of things and information communication computer technology, and particularly relates to a protocol dynamic adaptation method for inventory power internet of things terminals. BACKGROUND
[0002] With the development of new technologies such as mobile Internet and artificial intelligence, power consumption terminal devices are more diversified, and various state monitoring devices and sensors are widely used. Consumers have higher and higher demands for power services and quality, which also puts forward higher requirements for the power operation service quality of power grid management and operation personnel. The smart power internet of things system adopts a smart internet of things architecture of "cloud management edge terminal", accesses a power distribution automation system, a power consumption information collection system, an internet of things management platform and an edge analysis terminal, and provides great convenience for power grid management personnel with its dynamic flexible sensing, real-time communication, intelligent control and information security and reliability. However, with the increase of intelligent inventory power internet of things terminal devices, the protocols between devices are different, and even part of the device protocols are unknown, which causes the task quantity of power grid management and operation personnel to increase day by day. At the same time, the protocol diversification of different access device manufacturers and the low degree of automatic identification of edge devices to terminals lead to higher labor cost and low management efficiency.
[0003] CN112217805A discloses a power distribution internet of things multi-mode protocol adaptation method, trains multiple lightweight deep neural network models through multiple protocol frame data, realizes adaptation and classification of different protocols, and has certain advantages in improving terminal communication capability. However, this method needs to train multiple models for different protocol types, which leads to high model management and maintenance cost. In addition, the description of key processes such as data set construction, feature extraction and preprocessing is brief, and it is difficult to guarantee the integrity and generalization ability of model training. At the same time, it mainly faces the protocol adaptation function, and does not deeply consider the reasoning adaptation and device registration management mechanism of inventory devices and unknown protocols, so the scalability and intelligent level in the complex power distribution internet of things environment are still limited.
[0004] CN119249224A discloses a power grid protocol identification method and device based on a knowledge graph, a computer device, a readable storage medium and a program product, extracts features from historical power grid flow data, establishes a protocol identification model and a protocol field identification model in combination with message header data, and optimizes the identification result based on a knowledge graph, and has strong data structuring processing capability. However, the focus of this method is to adjust the protocol category label prediction value based on the knowledge graph, and the core is the modeling and reasoning of protocol knowledge, and the coverage of protocol adaptation and device management is insufficient. Especially in the adaptation of inventory devices, the rapid identification of unknown protocols and the dynamic update of device information, this scheme does not involve them. SUMMARY
[0005] In view of the problems of the prior art in protocol identification and adaptation, the present application is proposed.
[0006] Therefore, the problem to be solved by the present application is how to combine model reasoning and device management mechanism to effectively improve the compatibility and communication intelligence level of power terminals.
[0007] To solve the above technical problems, the present application provides the following technical solutions:
[0008] In a first aspect, the present application provides a protocol dynamic adaptation method for inventory power IoT terminals, which includes collecting communication message data based on the interaction process of edge-side devices and inventory power IoT terminals and generating a standardized message data set in combination with a protocol mode analysis method; performing preprocessing based on the standardized message data set and performing feature extraction to form a feature set suitable for model training; constructing a protocol identification model according to the feature set and realizing online incremental training and self-adaptive modeling of newly added unknown protocols through a dynamic updating mechanism; deploying the protocol identification model to the edge side to perform reasoning and identification on real-time collected terminal communication message data, and if the identification result is not in the local registry, triggering a federal learning update process to realize protocol dynamic adaptation and continuous analysis of inventory power IoT terminals.
[0009] As a preferred scheme of the protocol dynamic adaptation method for inventory power IoT terminals, the generation of the standardized message data set includes collecting communication message data based on the interaction process of edge-side devices and inventory power IoT terminals, analyzing the communication message data using a protocol mode analysis method, and generating a standardized message data set; the standardized message data set is stored in pcap format, with each line being a communication message data content and each column being a communication message data segment, and the communication message data segment is in hexadecimal format.
[0010] As a preferred scheme of the protocol dynamic adaptation method for inventory power IoT terminals, the standardized message data set is preprocessed to form a feature set; the preprocessing includes hexadecimal to decimal conversion, data length padding, normalization, outlier processing and data scaling of the communication message data; the normalization adopts a zero-mean normalization method.
[0011] As a preferred scheme of the protocol dynamic adaptation method for inventory power IoT terminals, the feature extraction includes: decentralizing the communication message data and calculating a covariance matrix; performing eigenvalue decomposition on the covariance matrix, arranging the eigenvalues from large to small, and taking the first g columns to form a new feature matrix; projecting the communication message data to the coordinate system corresponding to the feature matrix to obtain the reduced feature data and form an effective feature set.
[0012] As a preferred solution of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the application, wherein: the protocol identification model comprises: protocol identification model training according to the effective feature set, model training adopts kmeans clustering, decision tree, density-based spatial clustering method or convolutional neural network; the data set is divided into training set and test set according to the proportion of 8:2, and the K-fold cross-validation method is adopted to select the model, and the protocol identification model is output.
[0013] As a preferred solution of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the application, wherein: the K-fold cross-validation comprises: 1) dividing the training data set into K parts; 2) in each verification process, taking K-1 parts of data as the training set and 1 part of data as the verification set, and recording the performance index; 3) repeating step 2 until all K parts are verified; 4) calculating the mean and standard deviation of all verification results; 5) selecting the model corresponding to the optimal performance index as the protocol identification model.
[0014] As a preferred solution of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the application, wherein: the training result of the protocol identification model is evaluated based on accuracy, precision and recall; the evaluation adopts confusion matrix calculation; the confusion matrix comprises true class TP, false negative class FN, false positive class FP and true negative class TN.
[0015] As a preferred solution of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the application, wherein: the updated protocol identification model is deployed on the edge side, and the real-time collected terminal pass message data is inferred and identified; when the identification result is not in the local identification register, the federal learning update process is triggered, the device information is written into the local identification register and the protocol is parsed.
[0016] In the second aspect, the application provides a computer device, comprising a memory and a processor, and the memory stores a computer program, wherein: the computer program instructions are executed by the processor to realize the steps of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the first aspect of the application.
[0017] In the third aspect, the application provides a computer readable storage medium, which stores a computer program, wherein: the computer program instructions are executed by the processor to realize the steps of the protocol dynamic adaptation method for the inventory-oriented power Internet of Things terminal of the first aspect of the application.
[0018] The application has the advantages that: the application can automatically identify the device protocol type with high accuracy in the case that the specific protocol of the connected intelligent inventory power IOT terminal device is unknown, and provides great convenience for power grid management personnel; the application establishes the protocol identification model based on the existing intelligent IOT architecture of "cloud management edge terminal", and has the characteristics of high accuracy and miniaturization, can be flexibly used in cloud, management, edge multi-directional deployment according to management needs, reduces the data transmission cost, and improves the identification efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0020] Figure 1 The flow chart of the protocol dynamic adaptation method for inventory power IOT terminal.
[0021] Figure 2 The structural schematic diagram of the protocol dynamic adaptation method for inventory power IOT terminal.
[0022] Figure 3 The schematic diagram of the 16-bit original standardized message data set.
[0023] Figure 4 The design structure schematic diagram of the inventory power IOT terminal classification adaptation model.
[0024] Figure 5 The schematic diagram of the 5-fold cross-validation method in the embodiment. DETAILED DESCRIPTION
[0025] In order to make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the specific embodiments of the application will be described in detail below with reference to the drawings of the specification.
[0026] In the following description, many specific details are set forth in order to provide a thorough understanding of the application, but the application can also be implemented in other ways different from the description, and those skilled in the art can make similar generalizations without departing from the connotation of the application, therefore the application is not limited to the specific embodiments disclosed below.
[0027] Secondly, the "one embodiment" or "embodiment" referred to herein means that the specific features, structures or characteristics can be included in at least one implementation of the application. In this specification, "in one embodiment" does not mean the same embodiment, nor is it an independent or alternative embodiment that excludes other embodiments.
[0028] As described in the above background, with the increase of intelligent inventory power IOT terminal devices, different devices may correspond to different communication protocol types, resulting in more and more difficulty in managing inventory power IOT terminals, and the task of grid management and operation and maintenance personnel increases day by day. The current scheme is more based on manual annotation and testing to realize the management and operation and maintenance of different inventory power IOT terminals, and the automation degree is low, which increases the labor cost and reduces the management efficiency.
[0029] The application is based on the analysis of edge side and power IOT device communication message data, and completes the identification and classification of the application layer protocol of the device under the condition that the device is unknown. First, the host computer or the edge side device is connected and interacted with the inventory power IOT terminal device (including but not limited to smart meter, inverter and smart switch, etc.), the communication data in the interaction process is extracted, and the inventory power IOT terminal flow pcap type communication message data set is constructed and analyzed based on the protocol mode analysis method. Secondly, the data preprocessing is carried out on the flow data, and the preprocessed data and input features are obtained. Then, the classification model of the inventory power IOT terminal protocol is obtained by training the classification model based on the classical machine learning or deep learning method. Further, the obtained inventory power IOT terminal protocol identification and classification model is laid out on the edge side device, and the model is analyzed by analyzing the current network data, and the terminal is identified and adapted. Finally, the terminal adaptation is completed, the current inventory power IOT terminal data is analyzed, the dynamic information and the database are uploaded, the data reporting is finally completed, and the display and presentation are carried out in the node platform. The application combines machine learning and communication technology, effectively completes the adaptation of the power IOT terminal communication protocol, and provides a new method for solving the automatic operation and maintenance technical problems of the inventory power IOT terminal.
[0030] Figure 1 and Figure 2 respectively, the flowchart and structural schematic diagram of the protocol dynamic adaptation method for inventory power IOT terminal according to the embodiment of the application. As shown in Figure 1 and Figure 2 shown, in the protocol dynamic adaptation method for inventory power IOT terminal, it includes:
[0031] Step 1: based on the interaction process of the edge side device and the inventory power IOT terminal, the communication message data is collected and the standardized message data set is generated combined with the protocol mode analysis method.
[0032] First, the host computer or the edge side device is connected and interacted with the intelligent inventory power IOT terminal device (including but not limited to smart meter, inverter and smart switch, etc.), and the communication data in the interaction process is extracted.
[0033] Due to the problems of data complexity, irregularity, diversification and the like of the inventory power IOT terminal flow communication message data, in the construction of the data set, passive bypass listening is adopted, that is, under the premise of not affecting the operation of the existing network business, the flow collection equipment is deployed at the key network nodes (terminal aggregation points) to capture and save the passing terminal communication flow as pcap format, so as to ensure that the collected data truly reflects the running characteristics of the existing network. The operation and maintenance personnel construct the message data set of the inventory power IOT terminal flow pcap type based on bypass listening and protocol mode analysis and the like and analyze it.
[0034] As shown in the formula (I), each row is the main content of each communication message data, and the field slicing rule in the embodiment of the application is based on fixed byte division: the original message is sequentially divided according to byte order, each 1 byte is taken as 1 field unit, each field unit corresponds to 1 feature column, to form a message feature matrix, which is used for subsequent model training and protocol classification processing. They are all in hexadecimal format. Each column is a data segment of the corresponding message, and they are all in hexadecimal format. Figure 3
[0035] Step 2: based on the standardized message data set, pre-processing is performed, and feature extraction is performed to form a feature set suitable for model training. In the embodiment of the application, the features are composed of byte sequences obtained by message processing, each byte is mapped to a feature column, and the byte order is consistent with the original message. At the same time, according to the general characteristics of industry communication protocols, a plurality of statistical features can be extracted. Different protocols have significant differences in specific byte positions (such as message header, length field, control code position, etc.) and numerical distribution, for example, some protocols use the fixed starting symbol 0x68, while other protocols use 0x53; the length field position is different, etc. The value difference of different columns in the feature vector corresponding to these patterns can effectively distinguish the protocol categories, so a feature selection algorithm is used for feature selection.
[0036] According to the feature set, a protocol recognition model is constructed, and online incremental training and adaptive modeling of new unknown protocols are realized through a dynamic updating mechanism.
[0037] The design structure diagram of the inventory power IOT terminal classification adaptive model is shown in the following formula (II). Figure 4
[0038] Step 2.1: data pre-processing.
[0039] Among them, the data pre-processing includes normalization, padding, outlier processing and data scaling and the like.
[0040] Specifically, by analyzing the communication message data, the hexadecimal payload application data is extracted, and the communication message data is converted from hexadecimal to decimal data.
[0041] In view of the communication message data length difference problem caused by different protocol functions or different protocol types, data preprocessing is performed by combining communication message data length padding, data normalization, abnormal value processing and data scaling, so as to reduce the influence of data quality factors such as data noise, abnormal values, repeated data and missing data on the accuracy of the inventory power IOT terminal device protocol identification and classification algorithm.
[0042] Obtain at least 5000 pieces of communication message data of different intelligent inventory power IOT terminal device protocols (including but not limited to 698 protocol, 645 protocol, modbus protocol, etc.).
[0043] Among them, considering that there are significant differences in communication message data, in order to ensure the same feature scale, the present application uses zero mean normalization method including but not limited to, maps the features to the same dimensional space, and the normalization calculation is as follows:
[0044]
[0045] Among them, μ is the average value of the communication message data sample features corresponding to each protocol type, σ represents the standard deviation of the communication message data, x is the value of each column of each communication message data in the communication message data set, and x * is the standardized value.
[0046] Step 2.2: Feature extraction is performed by multidimensional scaling analysis or linear discriminant analysis method.
[0047] Specifically, for the preprocessed communication message data, methods including but not limited to linear discriminant analysis, multidimensional scaling analysis or principal component analysis are used to extract features based on inventory power IOT terminal flow feature analysis under the guidance of business experience, so as to construct an effective feature set that can be used for inventory power IOT terminal protocol identification and classification model.
[0048] For example, the preprocessed data of the present application is an m*n dimensional matrix, and the following is done:
[0049] X = [x1, x2, …, xn] m ] T , wherein each x i is an n-dimensional row vector in X, and m is the number of samples.
[0050] First, the communication message data is decentralized:
[0051]
[0052] The covariance matrix of the decentralized communication message data is obtained:
[0053]
[0054] Finally, the covariance matrix C is decomposed into eigenvalues, and a characteristic matrix is obtained (arranged in descending order of eigenvalues), and the first g columns form a new matrix P n×g P is regarded as a coordinate system, that is, each column vector of P is a coordinate axis of the new coordinate system.
[0055] Preferably, the selection process of g includes: first, calculate the sum of all eigenvalues, then select the first g eigenvalues and add them up to obtain the proportion of the sum, and set a threshold (such as 85%, 90%, 95%, etc.) in the code segment to determine the value of g.
[0056] The original communication message data is projected into the new coordinate system to obtain the dimensionality-reduced preprocessed data, which is:
[0057]
[0058] In terms of feature selection, the prior knowledge is summarized and the data is analyzed to obtain the relevant rules required for feature extraction.
[0059] Further, on the basis of the dimensionality-reduced preprocessed data, a protocol feature sparse mapping matrix is constructed, the typical field position is mapped to a sparse vector, and the projection residual of each communication message in the sparse space and the dimensionality-reduced feature space is calculated. If the residual exceeds the preset threshold, the message is marked as a "potential unknown protocol" and enters the online incremental training process in advance, thereby improving the timeliness and stability of protocol dynamic adaptation.
[0060] Specifically, by constructing a feature sparse coding matrix, the typical field positions (such as start symbol, length field, control code) of different protocols are mapped to a fixed sparse vector space;
[0061] For each message, the projection in the sparse vector space is calculated.
[0062] At the same time, the residual measure between the corresponding projection and the dimensionality-reduced feature is calculated, and the formula is as follows:
[0063] R(x) = ‖P(x) - S(x)‖2
[0064] Where R(x) is the residual measure, indicating the deviation of the message from the typical protocol mode; P(x) is the projection of the message in the dimensionality-reduced feature space; S(x) is the projection of the message in the sparse coding vector space.
[0065] If R(x) exceeds the preset threshold, it is marked as a potential unknown protocol and triggers the online incremental training process in advance, without waiting until the deployment and operation phase.
[0066] It needs to be explained that the prior art only triggers the federated learning update when the protocol not in the registry is found in the deployment stage, and after the addition of the residual metric in the present application, the potential new protocol can be found in advance in the model training stage, reducing the cost of frequent triggering after deployment, which is equivalent to advancing the early perception of unknown protocols by one step, improving the adaptive ability and convergence efficiency of the system.
[0067] Step 2.3: Model training.
[0068] The model training is performed using methods including but not limited to classical machine learning methods such as kmeans, decision tree or Density-Based Spatial Clustering of Applications with Noise (DBSCAN), or deep learning methods such as Convolutional Neural Networks (CNN).
[0069] Among them, the training data set is divided into training set and test set according to 8:2.
[0070] Further, the K-fold cross-validation method is used for model selection, and the output of the best model in all training models is selected as the final protocol recognition model or the average of all model results is selected as the final model output.
[0071] Among them, the K-fold cross-validation process is divided into the following steps:
[0072] 1) Divide the data set into training data set and test data set;
[0073] 2) Split the training data set into K parts; among the K-folds samples, K-1 parts are used for training and 1 part is used for verification, and the performance index of each model is recorded; wherein K is a constant;
[0074] 3) Repeat step 2 until all K-folds samples are verified;
[0075] 4) Calculate the mean and standard deviation of the model performance index of the K models in step 2; (modified)
[0076] Through K-fold cross-validation, the accuracy, precision and recall and other performance indicators are calculated among the K models obtained in step 2, and these indicators are used as the basis for model evaluation and optimization.
[0077] 5) Repeat steps 2 to 5 for different hyperparameter values;
[0078] 6) Finally, select the model hyperparameters that produce the optimal score mean and standard value, and save the model weight file (.joblib), training timestamp, training set distribution statistics, etc. for subsequent model use;
[0079] 7) Calculate the evaluation model performance on the test data set.
[0080] For example, the density-based spatial clustering method (Density-Based Spatial Clustering of Applications with Noise, DBSCAN) is used for model training in the embodiments of the present application.
[0081] Among them, the data set is divided into training set and test set according to 8:2.
[0082] Further, the 5-fold cross-validation method is used for model selection, as shown in Figure 5 The best model output is selected from all training models for protocol identification model, that is, the training data set is divided into 5 parts; among the 5-folds samples, 4 parts are used for training and 1 part is used for verification, and the performance of each model is recorded; the above K-fold cross-validation process is performed, and the model performance is finally calculated on the test data set.
[0083] Step 2.4: Evaluate the model training results using accuracy, precision, and recall indicators.
[0084] Step 2.4.1: As shown in Table 1 and Table 2:
[0085] Table 1 Test Validation Confusion Matrix
[0086]
[0087] Table 2 Evaluation Index Table
[0088]
[0089] Among them, TP represents the true class, that is, the true class of the sample is positive, and the model recognition result is also positive, FN represents the false negative class, that is, the true class of the sample is positive, but the model identifies it as negative, FP is the false positive class, the true class of the sample is negative, but the model identifies it as positive, and TN represents the true negative class, that is, the true class of the sample is negative, and the model identifies it as negative.
[0090] Based on the above index results, compare the performance of each fold model (step 4 in step 2.3), select the model with the best comprehensive performance, record the evaluation information of the final optimal model, and enter step 2.5 deployment, and finally build the identification model algorithm.
[0091] Step 2.4.2: After the model is deployed, the global model and the local fine-tuned model are used to make predictions for the same communication message, respectively, to obtain two types of prediction distributions, and the distribution difference between the two is calculated. If the consistency measure exceeds the threshold, it is determined that the message has potential abnormalities or protocol ambiguity, thereby triggering a lightweight local retraining or reporting mechanism to ensure the adaptability and robustness of the model in different regional nodes.
[0092] Preferably, after the model is deployed to each regional node, the consistency of the local model results obtained by training different nodes is compared:
[0093] First, each regional node uses the global model and the local fine-tuned model to make predictions simultaneously after receiving the message, obtaining two types of prediction probability distributions; the distribution difference between the two is calculated using symmetric KL divergence or Wasserstein distance. If the consistency measure exceeds the difference threshold, it indicates that the global and local cognitive differences on the message are large, thereby triggering a lightweight local retraining or abnormal protocol reporting, avoiding direct dependence on a single model and improving recognition stability.
[0094] It should be noted that the present application adds self-checking capability during the deployment stage through consistency measurement, which can reduce the risk of error recognition spreading in the field and provides a lightweight real-time adaptive mechanism.
[0095] Step 2.5: The federated learning model update module is used to update the protocol identification model online. For different access inventory device protocols, it is determined whether the protocol identification result is in the existing protocol identification model. If so, proceed to the next step, if not, aggregate and extract features from the current device protocol data, and perform online training, dynamic modeling and identification based on existing data features.
[0096] Step 3: The protocol identification model is deployed to the edge side to perform inference and identification on real-time collected inventory power Internet of Things terminal communication message data. If the identification result is not in the local registry, the federated learning update process is triggered to achieve dynamic adaptation and continuous analysis of the inventory power Internet of Things terminal protocol.
[0097] Specifically, the inventory power Internet of Things terminal data features are obtained and used as inputs to the protocol identification model for protocol classification. The classification results are [category 1, category 2, category 3, …, category h], corresponding to protocol numbers [698, 645, modbus-1, …, modbus-h], respectively. Finally, the protocol type of the identified data corresponding device is given, where h is the number of categories and is a dynamic value.
[0098] Illustratively, the protocol classification specifically includes the following operation steps:
[0099] A1, establish a sample set D={x1, x2, x3, …, x s}, set neighborhood parameters eps, MinPts, wherein eps refers to sample distance, and MinPts refers to the minimum number of samples of the class;
[0100] A2, initialize the kernel space
[0101] A3, select a sample x in the sample set D i , and iteratively calculate the distance between other samples (taking x j as an example) in the sample set D and x i as follows:
[0102]
[0103] wherein k represents the kth feature, s represents the total number of features, and the samples with a distance less than eps are classified into a class C1 together with the sample x i .
[0104] A4, calculate the number of samples in the class C1, and if the number of samples is not less than MinPts, then C1 is put into the initialized kernel space Ω, the complement of the sample set D and the class C1 is calculated, and the sample set D generated before is covered and replaced, and step A3 is repeated;
[0105] A5, if the number of samples is less than MinPts, then other samples are iteratively calculated, and step A3 is repeated until all samples are iteratively calculated or the number of samples in the sample set D is less than MinPts.
[0106] A6, obtain the protocol classification results of C1, C2, …, Cs.
[0107] Further, it is judged whether the protocol recognition type is in the model library, if yes, the next step is entered, otherwise the federal learning model update module is used to update the existing power internet of things terminal protocol recognition model online.
[0108] It should be noted that because new untrained data appears, the trained model needs to be updated, so that the new model can identify the newly appearing message.
[0109] Further, it is judged whether the protocol is in the local identity registry:
[0110] The local identity registry contains a protocol identification hash table, as shown in the following table:
[0111] Table 3 local identity registry
[0112] Serial number Protocol number Protocol content 1 698 Protocol 698 2 645 Protocol 645 3 modbus-1 modbus-1 protocol … … … h modbus-h modbus-h protocol
[0113] By identifying the obtained protocol number, whether the corresponding protocol content is in the local identity registry is found according to the above table. If yes, the protocol data is parsed, the public or controlled data is uploaded to the database, and is presented according to the demand, facilitating the operation and maintenance personnel to manage; if no, the equipment information is added to the identity resolution enterprise node platform, and is updated in the identity registry.
[0114] It can be seen that, based on data length padding, data normalization, outlier processing, multi-dimensional scaling analysis method or principal component analysis method, an effective feature set for inventory power IOT terminal protocol identification and classification model is constructed, a data preprocessing and feature extraction scheme for inventory power IOT terminal diversified complex data is proposed, which can provide basis for feature extraction and modeling of inventory power IOT terminal protocol data after preprocessing; and based on interpretable classic machine learning and data-driven method, an edge deployment inventory power IOT terminal protocol identification and classification scheme is proposed, realizing automatic identification and management of inventory power IOT terminal by edge device, and creating favorable conditions for subsequent identification, protocol analysis, presentation and device management of massive inventory power IOT terminal devices and their access protocols; for the identification problem of inventory power IOT terminal, a dynamic adaptation process is proposed, which can identify unknown devices or protocols, and present or update device information based on device registration.
[0115] The embodiment also provides a computer device suitable for the protocol dynamic adaptation method for inventory power IOT terminal, including a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to realize the protocol dynamic adaptation method for inventory power IOT terminal proposed in the above embodiment.
[0116] The computer device can be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, operator network, NFC (near field communication) or other technologies. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device. In addition, the input device can be an external keyboard, touchpad or mouse, etc.
[0117] The embodiment also provides a storage medium, which stores a computer program, and the computer program is executed by a processor to implement the protocol dynamic adaptation method for the smart inventory power IOT terminal.
[0118] To sum up, the application can automatically identify the device protocol type with high accuracy in the case that the specific protocol of the accessed smart inventory power IOT terminal device is unknown, and provides great convenience for power grid management personnel. The application relies on the existing "cloud management edge end" smart IOT architecture, and the protocol identification model has the characteristics of high precision and miniaturization, can be flexibly used in multi-directional deployment of cloud, management and edge according to management needs, reduces the data transmission cost, and improves the identification efficiency.
[0119] It should be noted that the above embodiments are only used to illustrate the technical solutions of the application rather than limit the application. Although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced equivalently without departing from the spirit and scope of the application, and all should be covered in the scope of the claims of the application.
Claims
1. A method for dynamic protocol adaptation for existing power IoT terminals, characterized in that: include: Based on the interaction process between edge devices and existing power IoT terminals, communication message data is collected and a standardized message dataset is generated by combining protocol mode parsing methods. Preprocessing and feature extraction are performed based on the standardized message dataset to form a feature set suitable for model training. A protocol identification model is constructed based on the feature set, and online incremental training and adaptive modeling of newly added unknown protocols are realized through a dynamic update mechanism. The protocol identification model is deployed to the edge to perform inference and identification on the communication message data of existing power IoT terminals collected in real time. If the identification result is not in the local registry, the federated learning update process is triggered to realize the dynamic adaptation and continuous parsing of the protocol of existing power IoT terminals.
2. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 1, characterized in that: The generated standardized message dataset includes: Based on the interaction process between edge devices and existing power IoT terminals, communication message data is collected, and the communication message data is parsed using a protocol mode parsing method to generate a standardized message dataset. The standardized message dataset is stored in pcap format, with each row containing one communication message data content and each column containing a communication message data segment in hexadecimal format.
3. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 2, characterized in that: The standardized message dataset is preprocessed to form a feature set; The preprocessing includes hexadecimal to decimal conversion of communication message data, data length padding, normalization, outlier handling, and data scaling. The normalization method used is zero-mean normalization.
4. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 3, characterized in that: The feature extraction includes: Decentralize the communication message data and calculate the covariance matrix; The covariance matrix is decomposed into eigenvalues, and the eigenvalues are arranged in descending order. The first g columns are used to form a new eigenma matrix. The communication message data is projected onto the coordinate system corresponding to the feature matrix to obtain the dimensionality-reduced feature data, forming an effective feature set.
5. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 4, characterized in that: The constructed protocol identification model includes: The protocol recognition model is trained based on the effective feature set. The model training uses k-means clustering, decision tree, density-based spatial clustering method or convolutional neural network. The dataset was divided into training and testing sets in an 8:2 ratio, and the K-fold cross-validation method was used to select the model, outputting the protocol recognition model.
6. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 5, characterized in that: The K-fold cross-validation includes: 1) Divide the training dataset into K parts; 2) In each validation process, K-1 sets of data are used as the training set and 1 set of data is used as the validation set, and performance metrics are recorded. 3) Repeat step 2 until all K copies have been verified; 4) Calculate the mean and standard deviation of all validation results; 5) Select the model corresponding to the optimal performance index as the protocol identification model.
7. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 6, characterized in that: The training results of the protocol recognition model are evaluated based on accuracy, precision, and recall. The evaluation was calculated using a confusion matrix; The confusion matrix includes true negative class (TP), false negative class (FN), false positive class (FP), and true negative class (TN).
8. The protocol dynamic adaptation method for existing power IoT terminals as described in claim 7, characterized in that: The updated protocol recognition model is deployed on the edge to perform inference and recognition on the real-time collected communication message data of existing power IoT terminals. When the recognition result is not in the local identifier registry, the federated learning update process is triggered to write the device information into the local identifier registry and perform protocol parsing.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, it implements the steps of the protocol dynamic adaptation method for existing power IoT terminals as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the steps of the protocol dynamic adaptation method for existing power IoT terminals as described in any one of claims 1 to 8.