Training method of power terminal control model and power terminal control method and system

By compressing and classifying the historical control data of power terminals, optimizing the feedforward neural network using neural networks and the dragonfly algorithm, and generating a power terminal control model, the problems of control errors and low efficiency caused by manual intervention in power terminal interconnection are solved, thus achieving automated and efficient control.

CN120670933APending Publication Date: 2025-09-19GUANGZHOU KETENG INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510659443.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Due to the different states of existing power terminals when interconnected, manual intervention is required to adjust the controller, resulting in large control errors and low efficiency, which makes it difficult to meet the working needs of the power terminals.

Method used

By acquiring the historical control data of the CAN controller, performing data compression and classification processing, using neural networks and classification models to train feedforward neural networks, and introducing dragonfly algorithm optimization, a power terminal control model is generated to reduce manual intervention and improve control accuracy and efficiency.

Benefits of technology

It realizes the automation and high efficiency of power terminal control, reduces manual intervention, and improves the control accuracy and system response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670933A_ABST
    Figure CN120670933A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a training method of a power terminal control model, and a power terminal control method and system, and belongs to the technical field of power terminal interconnection. According to the scheme, historical control data of the CAN controller are obtained; performing data compression processing on the historical control data to obtain historical compressed data; classifying the historical compressed data based on a neural network model and a classification model to obtain a plurality of groups of historical strategy data; and performing model training on the feed-forward neural network according to the plurality of groups of historical strategy data, and introducing a dragonfly algorithm to optimize the feed-forward neural network to obtain a power terminal control model. According to the invention, manual intervention can be reduced, and the accuracy and efficiency of power terminal control are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power terminal interconnection, and in particular to a training method for a power terminal control model, a power terminal control method and a system. Background Art

[0002] With the continuous development of the power industry, the number and types of power terminals are increasing, which puts higher requirements on the interconnection and management of power terminals.

[0003] When current power terminals are interconnected, different power terminals may have different states during operation, requiring staff to adjust controllers to control the power terminals based on the operating data of the power terminals. This method is rather cumbersome and overly dependent on the staff's experience. There may also be large errors, making it difficult to meet the needs of power terminal operations. Summary of the Invention

[0004] The main purpose of the embodiments of the present application is to propose a training method for a power terminal control model, a power terminal control method and a system, aiming to reduce manual intervention and improve the accuracy and efficiency of power terminal control.

[0005] To achieve the above objectives, an embodiment of the present application provides a training method for a power terminal control model, the training method comprising the following steps:

[0006] Acquiring historical control data of the CAN controller, wherein the historical control data includes historical command data and historical power terminal status data;

[0007] Performing data compression processing on the historical control data to obtain historical compressed data;

[0008] Classify the historical compressed data based on a neural network model and a classification model to obtain several groups of historical strategy data, wherein the historical strategy data represents the control command strategies corresponding to the power terminal operating in different states;

[0009] A feedforward neural network is trained based on several groups of historical strategy data, and a dragonfly algorithm is introduced to optimize the feedforward neural network to obtain a power terminal control model.

[0010] In some embodiments, performing data compression processing on the historical control data to obtain historical compressed data includes the following steps:

[0011] Performing statistical analysis on each character in the historical control data to obtain a character frequency table;

[0012] Obtaining a weighted binary tree according to the character frequency table, wherein each leaf node in the binary tree represents a character, and the weight is the occurrence frequency of the character;

[0013] Traversing the binary tree, and obtaining character codes according to the paths of the leaf nodes;

[0014] The characters in the historical control data are replaced according to the character encoding to obtain historical compressed data.

[0015] In some embodiments, the classifying process of the historical compressed data based on the neural network model and the classification model to obtain several groups of historical strategy data includes the following steps:

[0016] Annotating the historical compressed data using a neural network model based on a preset classification standard to obtain historical annotated data;

[0017] Performing classification training on the classification model according to the historical annotation data to obtain a classification result;

[0018] Collecting the erroneous prediction data generated by the classification model during the classification training process and returning it to the neural network model for secondary classification processing to obtain a secondary classification result, wherein the erroneous prediction data is the first classification result whose data label is not equal to the data label of the historical annotated data;

[0019] The primary classification results of the classification model and the secondary classification results of the neural network model are integrated to obtain several groups of historical strategy data.

[0020] In some embodiments, integrating the primary classification results of the classification model and the secondary classification results of the neural network model to obtain several sets of historical strategy data includes the following steps:

[0021] Merging the primary classification result of the classification model and the secondary classification result of the neural network model according to the priority order to obtain a classification result set;

[0022] Cluster analysis is performed on the classification result set to obtain several groups of historical strategy data.

[0023] In some embodiments, the model training of the feedforward neural network according to the plurality of sets of the historical strategy data and the introduction of the dragonfly algorithm to optimize the feedforward neural network to obtain the power terminal control model includes the following steps:

[0024] Obtaining structural parameters of a feedforward neural network and algorithm parameters of a dragonfly algorithm, wherein the structural parameters include the number of network layers and the number of neurons, and the algorithm parameters include the population size, the maximum number of iterations, and behavior weights, wherein the behaviors include collision, pairing, aggregation, predation, and enemy avoidance of individual dragonflies;

[0025] The row vector composed of the weights and thresholds of the feedforward neural network is used as the position of the dragonfly individual;

[0026] Performing model training on the feedforward neural network according to several sets of historical strategy data, calculating the fitness value of the dragonfly individual through the dragonfly network expression, and recording the current optimal solution;

[0027] updating the food position, the natural enemy position and the behavior weight according to the fitness function;

[0028] Calculating the displacement distance generated by the behavior of the dragonfly individual according to the position of the dragonfly individual, the position of the food, and the position of the natural enemy;

[0029] updating the dragonfly population step size according to the displacement distance and the behavior weight generated by the individual dragonfly behavior, and then returning to the step of training the feedforward neural network model according to the plurality of sets of historical strategy data, calculating the fitness value of the individual dragonfly through the dragonfly network expression, and recording the current optimal solution until the current number of iterations is greater than the maximum number of iterations;

[0030] The weights and thresholds corresponding to the current optimal solution are used as the weights and thresholds of the initial connection of the feedforward neural network to obtain a power terminal control model.

[0031] In some embodiments, the dragonfly network expression is:

[0032]

[0033] d i =O + -O i ;

[0034] e i =O - +O i ;

[0035]

[0036] Among them, a i 、b i 、c i d i 、e i are the displacement distances generated by the collision, pairing, clustering, gathering for predation, and avoidance behaviors of the i-th dragonfly, respectively.i and O j Represent the positions of the i-th and j-th dragonfly individuals, Y represents the number of dragonflies adjacent to the i-th dragonfly individual, O + Indicates the location of food, O - Indicates the location of the natural enemy, q, w, e, r, and u represent the weights of dragonfly group behavior, represents the inertia weight, t is the current iteration number, ΔO t+1 Indicates the population update step size of generation t+1.

[0037] In some embodiments, the training method of the power terminal control model further includes the following steps:

[0038] Adjusting all power terminals to the same test state, wherein the test state is any one of the historical power terminal states;

[0039] Determining test command data through the power terminal control model according to the test state;

[0040] Sending test command data to all the power terminals, detecting whether the status of the power terminals changes within a preset time threshold, and counting the number of power terminals that have changed and have not changed to obtain a status change result;

[0041] determining a control error rate according to the state change result;

[0042] Comparing the control error rate with a preset control threshold, and if the control error rate is greater than or equal to the preset control threshold, performing an error assessment to obtain an error analysis result, and retraining the feedforward neural network according to the error analysis result until the control error rate is less than the preset control threshold;

[0043] The feedforward neural network whose control error rate is less than the preset control threshold is determined as a new power terminal control model.

[0044] To achieve the above object, another aspect of the present application provides a power terminal control method, the control method comprising the following steps:

[0045] Obtain online power terminal status data;

[0046] The online power terminal status data is input into the power terminal control model for control prediction to obtain prediction command data.

[0047] To achieve the above objectives, another aspect of the present application provides a training system for a power terminal control model, the training system comprising:

[0048] The first module is used to obtain historical control data of the CAN controller, wherein the historical control data includes historical command data and historical power terminal status data;

[0049] The second module is used to perform data compression processing on the historical control data to obtain historical compressed data;

[0050] A third module is configured to classify the historical compressed data based on a neural network model and a classification model to obtain a plurality of sets of historical strategy data, wherein the historical strategy data represents control command strategies corresponding to different operating states of the power terminal;

[0051] The fourth module is used to perform model training on the feedforward neural network according to several groups of historical strategy data, and introduce the dragonfly algorithm to optimize the feedforward neural network to obtain the power terminal control model.

[0052] To achieve the above objectives, another aspect of the present application provides a power terminal control system, the control system comprising:

[0053] The fifth module is used to obtain online status data of the power terminal;

[0054] A sixth module is configured to input the online status data into a power terminal control model for control prediction to obtain prediction command data;

[0055] The seventh module is used to control the state of the power terminal according to the predicted command data.

[0056] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned training method of the power terminal control model or the power terminal control method when executing the computer program.

[0057] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned training method of the power terminal control model or the power terminal control method.

[0058] The embodiments of the present application include at least the following beneficial effects: The present application provides a training method for a power terminal control model or a power terminal control method and system. The solution obtains historical control data from a CAN controller; compresses the historical control data to obtain historical compressed data; classifies the historical compressed data based on a neural network model and a classification model to obtain several sets of historical strategy data; trains a feedforward neural network based on the several sets of historical strategy data, and introduces a dragonfly algorithm to optimize the feedforward neural network to obtain a power terminal control model. The present application can reduce manual intervention and improve the accuracy and efficiency of power terminal control. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 This is a flow chart of a method for training a power terminal control model provided in an embodiment of the present application;

[0060] Figure 2 is a flow chart of a power terminal control method provided by an embodiment of the present application;

[0061] Figure 3 is a flow chart of a power terminal control method provided by another embodiment of the present application;

[0062] Figure 4 Schematic diagram of the structure of the training system of the power terminal control model provided in the embodiment of the present application;

[0063] Figure 5 This is a schematic diagram of the structure of the power terminal control system provided by an embodiment of the present application;

[0064] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0066] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0067] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.

[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0069] The training method of the power terminal control model or the power terminal control method provided in the embodiment of the present application relates to the field of power terminal interconnection technology. The training method of the power terminal control model or the power terminal control method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the training method of the power terminal control model or the power terminal control method, etc., but is not limited to the above forms.

[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0071] Figure 1 This is an optional flowchart of the training method of the power terminal control model provided in the embodiment of the present application. Figure 1 The training method of the power terminal control model may include but is not limited to steps S101 to S104.

[0072] Step S101 : acquiring historical control data of a CAN controller, wherein the historical control data includes historical command data and historical power terminal status data.

[0073] Step S102: compress the historical control data to obtain historical compressed data.

[0074] Step S103 , classifying and processing the historical compressed data based on the neural network model and the classification model to obtain several groups of historical strategy data, wherein the historical strategy data represent corresponding control command strategies when the power terminal operates in different states.

[0075] Step S104 , performing model training on the feedforward neural network according to several groups of historical strategy data, and introducing the dragonfly algorithm to optimize the feedforward neural network to obtain a power terminal control model.

[0076] In this embodiment, the CAN controller is the core component in communication, and several power terminals are interconnected through the CAN controller. In order to reduce manual intervention and improve control efficiency, this embodiment obtains a power terminal control model through training based on historical control data, which can automatically issue control commands according to the power terminal status.

[0077] Specifically, historical control data of the CAN controller stored in the database is obtained. This historical control data includes historical command data and historical power terminal status data. Historical command data is the control commands issued by the CAN controller to the power terminal, recorded in the database. It is used to adjust the terminal's operating status and reflects historical operational strategies, such as power regulation and switching. Historical power terminal status data is the operating status parameters of the power terminal before and after executing the control commands, reflecting the health and load conditions of the device, such as voltage, current, and temperature.

[0078] By compressing historical control data, historical compressed data is generated. The compressed data is smaller in size, effectively reducing network latency and energy consumption during transmission. This is particularly suitable for resource-constrained power terminals, enabling lightweight design and supporting the access of more power terminals.

[0079] Next, the compressed historical control data is classified based on the neural network model and the classification model, and the historical control data is divided into several groups of historical strategy data.

[0080] For example, the decompressed historical control data is first initially labeled using a neural network model, and the labeled historical control data is used to train a classification model to learn the mapping relationship from the power terminal state to the control command. The power terminal state and its corresponding control command are grouped according to the feature similarity, and several groups of historical strategy data are obtained, wherein the historical strategy data represents the control command strategy corresponding to the power terminal operating in different states.

[0081] After obtaining several sets of historical strategy data, a feedforward neural network consisting of an input layer, a hidden layer, and an output layer is designed. The historical power terminal status data in the historical strategy data is used as input, and the corresponding historical command data is used as the output target. The dragonfly algorithm is used instead of the traditional optimizer to optimize the parameters of the feedforward neural network. The parameters are dynamically adjusted by simulating the behavior of the dragonfly group. When the iteration reaches the preset number of times, the optimal solution is used as the model parameter of the feedforward neural network to obtain the power terminal control model.

[0082] In some embodiments, step S102 may include but is not limited to steps S201 to S204.

[0083] Step S201 : performing statistical analysis on each character in the historical control data to obtain a character frequency table.

[0084] Step S202 : obtaining a weighted binary tree according to the character frequency table, wherein each leaf node in the binary tree represents a character, and the weight is the occurrence frequency of the character.

[0085] Step S203: traverse the binary tree and obtain the character code according to the path of the leaf node.

[0086] Step S204: Replace the characters in the historical control data according to the character encoding to obtain historical compressed data.

[0087] In this embodiment, compressing historical control data helps to reduce data redundancy and improve the efficiency of subsequent model training.

[0088] Specifically, statistical analysis is performed on each character in the historical control data, the frequency of occurrence of each character in the historical control data is calculated, and a character frequency table is created.

[0089] A binary tree is constructed based on the character frequency table. Each leaf node in the binary tree represents a character, with the character frequency serving as the node weight. Each internal node represents a character concatenation. This means adding the frequencies (weights) of two or more characters (or character groups) to generate a new virtual node. This node itself does not correspond to any actual character but is used to assist in constructing the binary tree structure. In the constructed binary tree, high-frequency characters have short paths, enabling quicker location during decoding. Low-frequency characters have long paths, as their low frequency indicates fewer occurrences, resulting in higher overall compression efficiency.

[0090] Next, traverse the binary tree. The path from the root node to each leaf node defines the encoding of the character. Suppose moving left means adding "0" and moving right means adding "1". The path of each leaf node is the encoding of the character.

[0091] For example, assuming that the character A is obtained by moving left once from the root node, the corresponding code of character A is "0"; assuming that the character B is obtained by moving right once and then left once from the root node, the corresponding code of character B is "10"; assuming that the character C is obtained by moving right once, then right once, and then left once from the root node, the corresponding code of character C is "110"; assuming that the character D is obtained by moving right once, then right once, and then right once from the root node, the corresponding code of character D is "111".

[0092] It should be noted that the encoding of any character is not a prefix of other encodings (for example, 10 will not conflict with 110) to ensure decoding uniqueness.

[0093] The generated character encoding is used to replace characters in the original historical control data, and the historical compressed data is further converted into a binary format to obtain compressed historical compressed data.

[0094] Optionally, after step S204 in some embodiments, a compression ratio can be calculated based on the historical control data before and after compression. The compression ratio is used as a post-evaluation indicator to quantify the compression effect and can intuitively reflect the degree of data volume reduction. By adjusting the statistical period of the character frequency (i.e., adjusting the historical period of the historical control data), historical compressed data with different compression ratios can be obtained. By comparing the compression ratios, the compression scheme with the best compression ratio can be selected. The calculation formula for the compression ratio is:

[0095]

[0096] Where γ is the compression ratio, w n is the characteristic vector of historical compressed data, r n is the characteristic vector of historical control data, w is the mean characteristic vector of historical compression data, and r is the mean characteristic vector of historical control data.

[0097] In some embodiments, step S103 may include but is not limited to steps S301 to S304.

[0098] Step S301 : annotating historical compressed data through a neural network model based on a preset classification standard to obtain historical annotated data.

[0099] Step S302: Perform classification training on the classification model based on the historical annotation data to obtain a classification result.

[0100] Step S303 collects the erroneous prediction data generated by the classification model during the classification training process and returns it to the neural network model for secondary classification processing to obtain a secondary classification result, wherein the erroneous prediction data is a primary classification result whose data label is not equal to the data label of the historical annotation data.

[0101] Step S304 , integrating the primary classification results of the classification model and the secondary classification results of the neural network model to obtain several groups of historical strategy data.

[0102] In this embodiment, the preset classification standards of historical compressed data are converted into a prompt engineering basis for the neural network model, providing a clear and unified classification framework for data labeling, and the historical compressed data is labeled using the neural network model, and the labeled historical compressed data is output to obtain historical labeled data.

[0103] Next, the historical annotated data is divided into training set, validation set and test set to support iterative optimization and performance evaluation of the classification model.

[0104] For example, the historically labeled data is divided into a 70% training set, a 15% validation set, and a 15% test set. The training set is used to directly train the classification model, learning the mapping relationship between power terminal status and control commands. The validation set is used to adjust parameters during classification model training to avoid overfitting or underfitting. The test set simulates real-world scenarios to evaluate the final performance of the classification model.

[0105] Specifically, the classification model has a three-layer feedforward network and an implicit regression layer, where the output of the classification model is:

[0106] A k =∑ j [a j (k)×W j A ] (2);

[0107] Where A k is the classification model output, a j (k) is the output of the jth regression neuron, W j A is the connection weight between the jth regression neuron and the input.

[0108] The output formula of the regression layer in the classification model is:

[0109] a j (k)=∫(a' j (k)) (3);

[0110] Where a' j (k) is the input of the jth regression neuron.

[0111] The input formula of the regression layer in the classification model is:

[0112]

[0113] Where B i (k) is the i-th input of the neural network model, C ij is the connection weight between the i-th input and the j-th regression neuron, is the feedback weight of the jth regression neuron.

[0114] Minimize the prediction error by continuously adjusting the model training parameters, including learning rate, batch size, number of training rounds, etc.

[0115] The erroneous predictions generated by the classification model during training are fed back to the neural network model for secondary classification, yielding the secondary classification results. The erroneous predictions are the primary classification results output by the classification model during the validation phase, where the labels are not equal to the historically labeled data. The secondary classification results are the classification results obtained after the erroneous predictions are reclassified by the neural network model. Compared to a one-way, open-loop labeling and classification, this error feedback mechanism drives the neural network model to continuously improve labeling quality, completing a closed-loop self-correction process.

[0116] The primary classification results and misprediction data from the classification model are integrated with the secondary classification results from the neural network model to obtain several sets of historical strategy data. Optionally, if the primary and secondary classification results are inconsistent, the classification results with higher confidence are retained during integration, ultimately obtaining several sets of historical strategy data.

[0117] In some embodiments, step S304 may include but is not limited to steps S401 to S402.

[0118] Step S401: Merge the first classification result of the classification model and the second classification result of the neural network model according to the priority order to obtain a classification result set.

[0119] Step S402: performing cluster analysis on the classification result set to obtain several groups of historical strategy data.

[0120] In this embodiment, the secondary classification result of the neural network model has a higher priority than the primary classification result of the classification model. During the merging process, if there is a conflict between the primary classification result of the classification model and the secondary classification result of the neural network model, the secondary classification result is used to cover the conflicting data in the primary classification result to obtain a classification result set.

[0121] For example, it is assumed that according to the historical power terminal status data "voltage 210V", the primary classification result output by the classification model is to maintain the voltage, and the secondary classification result output by the neural network model is to reduce the voltage. If the primary classification result and the secondary classification result are inconsistent, the secondary classification result will overwrite the primary classification result.

[0122] Furthermore, cluster analysis is performed based on the classification result set, and the data of similar power terminal status are merged into a group. At the same time, the consistency of the commands corresponding to the power terminal status data is checked. If the control commands within the same group are inconsistent, they are further split into finer subgroups, and finally several groups of historical strategy data are obtained. The status range of the operating status of the power terminal in each group of historical strategy data is clear and corresponds to a unique optimal control command strategy.

[0123] It is understandable that if new historical power terminal status data or historical command data is added to the historical control data, it can be incorporated into the existing group or a new group can be generated through the same process as above.

[0124] In some embodiments, step S104 may include but is not limited to steps S501 to S507 .

[0125] Step S501, obtain the structural parameters of the feedforward neural network and the algorithm parameters of the dragonfly algorithm, where the structural parameters include the number of network layers and the number of neurons, the algorithm parameters include the population size, the maximum number of iterations, and the behavior weight, and the behaviors include collision, pairing, aggregation, predation, and avoidance of dragonfly individuals.

[0126] Step S502: The row vector composed of the weights of the feedforward neural network and the threshold arrangement is used as the position of the dragonfly individual.

[0127] Step S503: Perform model training on the feedforward neural network based on several groups of historical strategy data, calculate the fitness value of the dragonfly individual through the dragonfly network expression, and record the current optimal solution.

[0128] Step S504: update the food location, natural enemy location, and behavior weight according to the fitness function.

[0129] Step S505 , calculating the displacement distance generated by the dragonfly individual behavior according to the dragonfly individual's position, the food location, and the natural enemy location.

[0130] Step S506: Update the step size of the dragonfly population based on the displacement distance and behavior weight generated by the individual dragonfly behavior, then return to the model training of the feedforward neural network based on several sets of historical strategy data, calculate the fitness value of the individual dragonfly through the dragonfly network expression, and record the current optimal solution until the current number of iterations is greater than the maximum number of iterations.

[0131] Step S507 : Using the weights and thresholds corresponding to the current optimal solution as the weights and thresholds for the initial connection of the feedforward neural network to obtain a power terminal control model.

[0132] In this example, the structural parameters of the feedforward neural network are first designed, including the number of layers and neurons. Next, the algorithm parameters of the dragonfly algorithm are set, including the population size N, the maximum number of iterations T, and the initial behavior weights. Behaviors include collision, pairing, aggregation, predation, and enemy avoidance of individual dragonflies.

[0133] The row vector (w,θ) composed of the weights w of the feedforward neural network and the threshold θ is used as the position O of the dragonfly individual, and the position of the dragonfly individual is randomly initialized according to the weight and threshold range.

[0134] The feedforward neural network is trained by selecting training sample data. This embodiment trains several groups of historical control data based on the feedforward neural network, calculates the fitness value of individual dragonflies according to the dragonfly network expression, and records the current optimal solution.

[0135] Specifically, the dragonfly network expression is:

[0136]

[0137] d i =O + -O i (8);

[0138] e i =O - +O i (9);

[0139]

[0140] Among them, a i 、b i 、c i d i 、e i are the displacement distances generated by the collision, pairing, clustering, gathering for predation, and avoidance behaviors of the i-th dragonfly, respectively. i and O j Represent the positions of the i-th and j-th dragonfly individuals, Y represents the number of dragonflies adjacent to the i-th dragonfly individual, O + Indicates the location of food, O — Indicates the location of the natural enemy, q, w, e, r, and u represent the weights of dragonfly group behavior, represents the inertia weight, t is the current iteration number, ΔO t+1 Indicates the population update step size of generation t+1.

[0141] Select mean square error as the fitness function and update the food position O + 、Natural enemy location O — Dynamically adjusting the behavioral weights (q, w, e, r, u) through the fitness function can adapt to different power scenarios without manual adjustment.

[0142] According to equations (5) to (9) in the dragonfly network expression, the dragonfly population behaviors a, b, c, d, and e are updated.

[0143] The step size determines the moving distance and direction of the dragonfly in the solution space in each iteration. During the iteration process, some historical step sizes are retained to prevent oscillations caused by sudden changes in direction (such as weight = t + 1, and then return to step S503.

[0144] When the current number of iterations t is greater than the maximum number of iterations T, the weight w and threshold θ corresponding to the optimal solution are used as the initial connection weights and threshold of the feedforward neural network to obtain the power terminal control model.

[0145] In some embodiments, the training method of the power terminal control model may further include but is not limited to steps S601 to S606.

[0146] Step S601: All power terminals are uniformly adjusted to the same test state, wherein the test state is any one of the historical power terminal states.

[0147] Step S602: Determine test command data through the power terminal control model according to the test state.

[0148] Step S603: Send test command data to all power terminals to detect whether the status of the power terminals changes within a preset time threshold, and count the number of power terminals that have changed and have not changed to obtain the status change result.

[0149] Step S604: determining a control error rate according to the state change result.

[0150] In step S605, the control error rate is compared with a preset control threshold. If the control error rate is greater than or equal to the preset control threshold, an error assessment is performed to obtain an error analysis result, and the feedforward neural network is retrained according to the error analysis result until the control error rate is less than the preset control threshold.

[0151] Step S606 : determining the feedforward neural network whose control error rate is less than a preset control threshold as a new power terminal control model.

[0152] In this embodiment, in order to obtain a power terminal control model with higher accuracy, the feedforward neural network is trained and controlled until a power terminal control model with an accuracy greater than a preset control threshold is obtained.

[0153] Specifically, first, all power terminals are manually adjusted to the same test state. The test state may be any one of the historical power terminal states recorded in the historical control data.

[0154] The CAN controller determines the test command data through the power terminal control model according to the acquired test status.

[0155] The CAN controller automatically sends the test command data to all power terminals, detects whether the status of the power terminals has changed within a time threshold, and counts the number of power terminals that have changed and the number of power terminals that have not changed to obtain the status change result.

[0156] The total number of all power terminals is calculated based on the number of power terminals that have changed and the number of power terminals that have not changed in the state change results, and the number of power terminals that have not changed is divided by the total number of all power terminals. The resulting value is recorded as the control error rate.

[0157] The control error rate is compared with the preset control threshold. If the control error rate is greater than or equal to the preset control threshold, it means that the power terminal control model deployed in the CAN controller is inaccurate and an error assessment is required to obtain the error analysis results.

[0158] It's understood that errors that affect model accuracy are often categorized as insufficient data, incorrect labeling, and model defects. For errors caused by insufficient data, the feedforward neural network is retrained by adding additional training data based on the error analysis results. The power terminal control model is updated, and steps S601 through S604 are repeated to verify the control error rate.

[0159] Exemplarily, for a high error rate scenario, historical control data corresponding to the scenario is collected in a targeted manner, and training samples are added to enhance the training data.

[0160] For errors caused by labeling errors, the feedforward neural network is retrained by re-labeling the data or adjusting the classification criteria according to the error analysis results, the power terminal control model is updated and steps S601 to S604 are executed again to verify the control error rate.

[0161] For errors caused by model defects, the feedforward neural network is retrained by adjusting the structure or parameters of the model according to the error analysis results, the power terminal control model is updated and steps S601 to S604 are executed again to verify the control error rate.

[0162] For example, by increasing the number of hidden layer neurons (e.g., from 64 to 128) or modifying the output layer structure (e.g., subdividing the command categories, such as modeling "reducing power by 5%" and "reducing power by 8%" separately)

[0163] When the control error rate is less than the preset control threshold, it indicates that the accuracy of the currently trained power terminal control model is high and meets the control requirements, and the currently trained power terminal control model is used as the new power terminal control model.

[0164] Figure 2This is an optional flowchart of the power terminal control method provided in an embodiment of the present application. Figure 1 The power terminal control method may include but is not limited to steps S701 to S703.

[0165] Step S701: Acquire online status data of the power terminal.

[0166] Step S702: input the online status data into the power terminal control model to perform control prediction and obtain prediction command data.

[0167] Step S703: Control the state of the power terminal according to the predicted command data.

[0168] In this embodiment, multiple power terminals are interconnected through a power terminal control model. The power terminal control model obtains online status data of the power terminal in real time through a CAN controller. The online status data reflects the current status of the power terminal.

[0169] The online status data is input into the power terminal control model for control prediction to obtain the prediction command data for controlling the power terminal to change the state. The prediction command data is aimed at any risk event in the state of the power terminal, and the response to this event is optimized to make the state of the power system the best command.

[0170] Automatically control the status of power terminals where risks are detected based on predicted command data.

[0171] For example, assuming that the voltage of one of the power terminals in the power system is 210V, but its safety voltage threshold is 211V, the power terminal control model can quickly detect that the power terminal is about to reach the threshold by acquiring online status data in real time, and identify the control requirements of the power terminal when it is about to reach the threshold through control prediction, and then obtain a voltage reduction command to control the voltage on the power terminal to drop, so as to avoid failure caused by exceeding the threshold risk.

[0172] The following describes and explains the solution of the embodiment of the present invention in detail with reference to specific application examples.

[0173] Reference Figure 3In the embodiment of the present application, the CAN controller automatically issues control commands according to the status of the power terminal, thereby reducing manual intervention and improving control efficiency. The historical control data is analyzed and classified based on the neural network model and the classification model, which can more accurately identify the control requirements under different states and improve the accuracy of control. The historical control data is compressed and classified, which helps to reduce data redundancy and improve the efficiency of model training. The feedforward neural network model is optimized by the dragonfly network, which can further improve the accuracy and stability of the model, making the CAN controller control model more reliable. Based on the control model with higher accuracy, it can quickly respond to changes in the status of the power terminal, realize real-time control, and improve the response speed and stability of the system. The technical solution adopts a modular design, which is easy to expand and upgrade and can adapt to power terminal interconnection systems of different scales and complexities.

[0174] Specifically, first, several groups of power terminals are interconnected through CAN controllers to form a power terminal interconnection system. The CAN controller is the core component in communication, which is used to send commands to the corresponding power terminals for control according to the status of the power terminals, and the status of several groups of power terminals can also be adjusted manually.

[0175] Next, the control data of the historical CAN controller is retrieved from the database, where the control data includes command data and power terminal status data.

[0176] Compress historical control data and obtain compressed historical control data to provide data support for subsequent processing, while reducing data redundancy and improving model training efficiency.

[0177] The compressed historical control data is classified based on the neural network model and the preset classification model to obtain several groups of historical control data.

[0178] Several groups of historical control data are trained based on a feedforward neural network, and the dragonfly network is introduced for optimization to obtain a CAN controller control model (i.e., a power terminal control model) with higher accuracy.

[0179] Finally, the status information of several groups of power terminals is collected in real time, and based on the status information, a CAN controller control model with high accuracy is used to control the connected power terminals.

[0180] Reference Figure 4 The present application also provides a training system for a power terminal control model, which can implement the above-mentioned training method for the power terminal control model. The system includes:

[0181] The first module is used to obtain historical control data of the CAN controller, wherein the historical control data includes historical command data and historical power terminal status data.

[0182] The second module is used to perform data compression processing on the historical control data to obtain historical compressed data.

[0183] The third module is used to classify and process the historical compressed data based on the neural network model and the classification model to obtain several groups of historical strategy data, wherein the historical strategy data represents the control command strategies corresponding to the power terminal operating in different states.

[0184] The fourth module is used to train the feedforward neural network model based on several sets of historical strategy data, and introduce the dragonfly algorithm to optimize the feedforward neural network to obtain the power terminal control model.

[0185] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0186] Reference Figure 5 The present application also provides a power terminal control system that can implement the above-mentioned power terminal control method. The system includes:

[0187] The fifth module is used to obtain online status data of the power terminal.

[0188] The sixth module is used to input the online status data into the power terminal control model for control prediction to obtain prediction command data.

[0189] The seventh module is used to control the state of the power terminal according to the predicted command data.

[0190] The present application also provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described power terminal control model training method or power terminal control method. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.

[0191] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0192] Reference Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0193] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0194] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the training method of the power terminal control model or the power terminal control method of the embodiments of this application.

[0195] The input / output interface 903 is used to implement information input and output.

[0196] The communication interface 904 is used to realize communication interaction between this device and other devices. Communication can be realized through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0197] The bus 905 transmits information between various components of the device (eg, the processor 901 , the memory 902 , the input / output interface 903 , and the communication interface 904 ).

[0198] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0199] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned training method of the power terminal control model or the power terminal control method.

[0200] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiment, the functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0201] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0202] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0203] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0204] The system embodiment described above is merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0205] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0206] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0207] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A training method for a power terminal control model, characterized in that: The training method of the power terminal control model comprises the following steps: Acquiring historical control data of the CAN controller, wherein the historical control data includes historical command data and historical power terminal status data; Performing data compression processing on the historical control data to obtain historical compressed data; Classify the historical compressed data based on a neural network model and a classification model to obtain several groups of historical strategy data, wherein the historical strategy data represents the control command strategies corresponding to the power terminal operating in different states; A feedforward neural network is trained based on several groups of historical strategy data, and a dragonfly algorithm is introduced to optimize the feedforward neural network to obtain a power terminal control model.

2. The training method of the power terminal control model according to claim 1, characterized in that: The performing data compression processing on the historical control data to obtain historical compressed data includes the following steps: Performing statistical analysis on each character in the historical control data to obtain a character frequency table; Obtaining a weighted binary tree according to the character frequency table, wherein each leaf node in the binary tree represents a character, and the weight is the occurrence frequency of the character; Traversing the binary tree, and obtaining character codes according to the paths of the leaf nodes; The characters in the historical control data are replaced according to the character encoding to obtain historical compressed data.

3. The training method of the power terminal control model according to claim 1, characterized in that: The process of classifying the historical compressed data based on the neural network model and the classification model to obtain several groups of historical strategy data includes the following steps: Annotating the historical compressed data using a neural network model based on a preset classification standard to obtain historical annotated data; Performing classification training on the classification model according to the historical annotation data to obtain a classification result; Collecting the erroneous prediction data generated by the classification model during the classification training process and returning it to the neural network model for secondary classification processing to obtain a secondary classification result, wherein the erroneous prediction data is the first classification result whose data label is not equal to the data label of the historical annotated data; The primary classification results of the classification model and the secondary classification results of the neural network model are integrated to obtain several groups of historical strategy data.

4. The training method of the power terminal control model according to claim 3, characterized in that: The step of integrating the primary classification results of the classification model and the secondary classification results of the neural network model to obtain several sets of historical strategy data includes the following steps: Merging the primary classification result of the classification model and the secondary classification result of the neural network model according to the priority order to obtain a classification result set; Cluster analysis is performed on the classification result set to obtain several groups of historical strategy data.

5. The training method of the power terminal control model according to claim 1, characterized in that: The feedforward neural network is trained based on several sets of historical strategy data, and the dragonfly algorithm is introduced to optimize the feedforward neural network to obtain a power terminal control model, including the following steps: Obtaining structural parameters of a feedforward neural network and algorithm parameters of a dragonfly algorithm, wherein the structural parameters include the number of network layers and the number of neurons, and the algorithm parameters include the population size, the maximum number of iterations, and behavior weights, wherein the behaviors include collision, pairing, aggregation, predation, and enemy avoidance of individual dragonflies; The row vector composed of the weights and thresholds of the feedforward neural network is used as the position of the dragonfly individual; Performing model training on the feedforward neural network according to several sets of historical strategy data, calculating the fitness value of the dragonfly individual through the dragonfly network expression, and recording the current optimal solution; updating the food position, the natural enemy position and the behavior weight according to the fitness function; Calculating the displacement distance generated by the behavior of the dragonfly individual according to the position of the dragonfly individual, the position of the food, and the position of the natural enemy; updating the dragonfly population step size according to the displacement distance and the behavior weight generated by the individual dragonfly behavior, and then returning to the step of training the feedforward neural network model according to the plurality of sets of historical strategy data, calculating the fitness value of the individual dragonfly through the dragonfly network expression, and recording the current optimal solution until the current number of iterations is greater than the maximum number of iterations; The weights and thresholds corresponding to the current optimal solution are used as the weights and thresholds of the initial connection of the feedforward neural network to obtain a power terminal control model.

6. The training method of the power terminal control model according to claim 5, characterized in that: The dragonfly network expression is: d i =O + -O i ; and i =The - +O i ; Among them, a i 、b i 、c i d i 、e i are the displacement distances generated by the collision, pairing, clustering, gathering for predation, and avoidance behaviors of the i-th dragonfly, respectively. i and O j Represent the positions of the i-th and j-th dragonfly individuals, Y represents the number of dragonflies adjacent to the i-th dragonfly individual, O + Indicates the location of food, O - Indicates the location of the natural enemy, q, w, e, r, and u represent the weights of dragonfly group behavior, represents the inertia weight, t is the current iteration number, ΔO t+1 Indicates the population update step size of generation t+1.

7. The method according to claim 5, characterized in that The training method of the power terminal control model further includes the following steps: Adjusting all power terminals to the same test state, wherein the test state is any one of the historical power terminal states; Determining test command data through the power terminal control model according to the test state; Sending test command data to all the power terminals, detecting whether the status of the power terminals changes within a preset time threshold, and counting the number of power terminals that have changed and have not changed to obtain a status change result; determining a control error rate according to the state change result; Comparing the control error rate with a preset control threshold, and if the control error rate is greater than or equal to the preset control threshold, performing an error assessment to obtain an error analysis result, and retraining the feedforward neural network according to the error analysis result until the control error rate is less than the preset control threshold; The feedforward neural network whose control error rate is less than the preset control threshold is determined as a new power terminal control model.

8. A power terminal control method, characterized in that: The power terminal control method comprises the following steps: Obtain online status data of power terminals; Inputting the online state data into the power terminal control model for control prediction to obtain prediction command data; performing state control on the power terminal according to the prediction command data; Wherein, the power terminal control model is determined according to the training method described in any one of claims 1-7.

9. A training system for a power terminal control model, characterized in that: The training system of the power terminal control model includes: The first module is used to obtain historical control data of the CAN controller, wherein the historical control data includes historical command data and historical power terminal status data; The second module is used to perform data compression processing on the historical control data to obtain historical compressed data; A third module is configured to classify the historical compressed data based on a neural network model and a classification model to obtain a plurality of sets of historical strategy data, wherein the historical strategy data represents control command strategies corresponding to different operating states of the power terminal; The fourth module is used to perform model training on the feedforward neural network according to several groups of historical strategy data, and introduce the dragonfly algorithm to optimize the feedforward neural network to obtain the power terminal control model.

10. A power terminal control system, characterized in that: The power terminal control system includes: The fifth module is used to obtain online status data of the power terminal; A sixth module is configured to input the online status data into a power terminal control model for control prediction to obtain prediction command data; The seventh module is used to control the state of the power terminal according to the predicted command data.

Citation Information

Patent Citations

  • Method and system for predicting short-term power load of micro-grid of offshore oilfield group

    CN108197759A

  • Short-term wind field wind speed prediction method and system based on neural network

    CN115983434A