Intelligent self-adaptive locking device and intelligent self-adaptive locking method for metering equipment
By using intelligent adaptive locking devices and methods, and by optimizing the clamping force distribution using motors, sensors, and neural network models, the problems of time-consuming and labor-intensive installation and safety risks of rural metering equipment have been solved, and stable fixing has been achieved in complex environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-10
AI Technical Summary
The installation of metering equipment in rural areas is time-consuming, labor-intensive, and poses safety risks. Traditional binding methods result in uneven distribution of clamping force, unreliable fixation, and difficulty in adapting to complex environments.
The device employs an intelligent adaptive locking mechanism, combined with a motor and sensor feedback system. It dynamically adjusts the clamping force and optimizes the clamping force distribution using a neural network model. Combined with modular design and weather-resistant materials, it enhances the device's environmental adaptability and installation efficiency.
It achieves uniform distribution of clamping force, avoids stress concentration, improves the long-term stability and safety of the device in complex environments, and ensures a fast and safe installation process.
Smart Images

Figure CN121633577A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power equipment, and particularly relates to an intelligent adaptive locking device and an intelligent adaptive locking method for a metering device. BACKGROUND
[0002] Rural metering devices include rural electricity meters and irrigation meters. The rural electricity meter is a general electric energy metering device used in rural resident households, village collective public facilities, small workshops and other scenarios. The rural irrigation meter is a special metering device designed for rural farmland irrigation, water conservancy drainage and other scenarios, and is mainly used for metering the electricity consumption of irrigation power equipment such as water pumps.
[0003] At present, the rural metering device is mainly fixed on the surface of the pole by the work personnel climbing to a specific height of the pole, manually stripping the aluminum core wire to make a binding wire, and fixing the meter box on the surface of the pole by winding and knotting.
[0004] However, the existing installation method is not only time-consuming and labor-intensive, but also has a low installation efficiency and a safety risk of high-altitude operation. SUMMARY
[0005] The intelligent adaptive locking device and the intelligent adaptive locking method for the metering device provided by the embodiments of the present application are used to solve the problem that the current rural metering device is time-consuming and labor-intensive and has a safety risk during installation.
[0006] In a first aspect, the embodiments of the present application provide an intelligent adaptive locking device for a metering device, which comprises:
[0007] A metering device mounting cross arm fixedly connected with a clamping opening, used for installing a metering device;
[0008] The clamping opening is used to be tightened under the drive of an electric machine to fix the metering device mounting cross arm on a pole;
[0009] A wave pattern anti-skid layer is arranged on the inner side of the clamping opening and is in contact with the pole when the clamping opening is fixed on the pole;
[0010] The electric machine is used to drive the clamping opening to be tightened according to the target torque fed back by a controller;
[0011] A strain force sensor is used to monitor the clamping force of the clamping opening in the clamping process in real time and feed back to the controller;
[0012] A three-dimensional force sensor is used to monitor the force distribution of the contact surface between the clamping opening and the pole in the clamping process;
[0013] a controller configured to feed back the target torque to the motor according to the clamping force, the force distribution and a pre-deployed neural network model, so as to adjust the clamp to tighten until the clamp is tightly fitted to the pole.
[0014] In a possible implementation, the corrugated anti-skid layer is covered with a stable insulation layer for insulation between the metering device and the smart adaptive locking device.
[0015] In a possible implementation, the network parameters of the neural network model are obtained by further online adaptive optimization based on online training sample data after offline evolution selection based on offline training sample data.
[0016] In a second aspect, the embodiments of the present application provide a smart adaptive locking method of a metering device, applied to the smart adaptive locking device, and the method comprises:
[0017] monitoring the clamping force of the clamp during clamping and the force distribution of the contact surface between the clamp and the pole in real time;
[0018] determining the target torque of the motor based on the clamping force and the force distribution by using a pre-constructed neural network model;
[0019] feeding back the target torque to the motor, so that the motor adjusts the clamp to tighten until the clamp is tightly fitted to the pole.
[0020] In a possible implementation, the method further comprises:
[0021] obtaining an instantaneous loss function and a fitness function;
[0022] flattening the network parameters of an initial network model into a real value vector as a chromosome of an evolution algorithm;
[0023] performing offline evolution processing on the network parameters by using the evolution algorithm based on the fitness function and the chromosome, and selecting optimal network parameters;
[0024] constructing an online network model based on the optimal network parameters;
[0025] performing online adaptive optimization on the optimal network parameters of the online network model based on the instantaneous loss function, to obtain optimized target network parameters;
[0026] constructing the neural network model based on the target network parameters.
[0027] In a possible implementation, the instantaneous loss function is:
[0028]
[0029] In the above formula, is the instantaneous loss; e(t) is a tracking error, used to represent the difference between the set clamping value of the clamp and the actual clamping value; u(t) is the control output at time t, used to represent the target torque; Δu(t) is the difference between the control output at time t and the control output at time t-1, used to represent the change in the control output; and is a weight coefficient; is a violation indication, used to represent that the target torque exceeds the safety threshold;
[0030] The fitness function is:
[0031]
[0032] In the above formula, Fitness(θ) represents the fitness of the network parameter θ, represents the sum of the instantaneous loss in the entire evaluation period T; Overshoot represents the overshoot of the clamp; SettlingTime represents the settling time required to adjust the clamp to closely fit the electric pole; α represents the penalty coefficient of the overshoot; β represents the penalty coefficient of the settling time.
[0033] In a possible implementation, based on the fitness function and the chromosome, the network parameters of the neural network model are processed offline by using an evolutionary algorithm, and the optimal network parameters are selected, including:
[0034] Based on the chromosome, an initial population is obtained, and the population includes g individuals, each individual being used to represent at least one network parameter, and g being a positive integer;
[0035] Based on the fitness function, the fitness of each individual in the initial population is evaluated;
[0036] Based on the fitness of each individual, a parent pairing set is generated, and the parent pairing set includes at least one parent;
[0037] Each parent in the parent pairing set is subjected to a crossover operation to generate offspring;
[0038] The offspring is subjected to a mutation operation to determine an optimal offspring, and the mutation operation includes polynomial mutation or Gaussian disturbance;
[0039] The optimal offspring is subjected to gradient descent fine-tuning to obtain the optimal network parameters.
[0040] In a possible implementation, the determining the optimal offspring comprises:
[0041] The optimal offspring is determined by screening the offspring through a hybrid local optimization strategy, the hybrid local optimization strategy comprising a global search and a local search, the global search being used to screen the optimal offspring in each offspring, and the local search being used to screen the optimal offspring in each offspring after the offline processing ends.
[0042] In a possible implementation, the online adaptive optimization of the optimal network parameter of the online network model based on the instantaneous loss function comprises:
[0043] An online experience buffer is set, and the online experience buffer is used to store sample data, the sample data comprising a state, control input data and loss data in online running;
[0044] When the number of sample data in the online experience buffer is greater than or equal to a preset number threshold, m pieces of sample data are selected from the sample data, a gradient loss is calculated through the instantaneous loss function, and m is a positive integer;
[0045] According to the gradient loss, the optimal network parameter is updated by using a gradient descent algorithm to obtain an optimized target network parameter.
[0046] In a possible implementation, the online adaptive optimization of the optimal network parameter of the online network model comprises:
[0047] A random disturbance is applied to the optimal network parameter regularly to generate at least one candidate network parameter;
[0048] A first score and a second score are obtained, the first score being used to represent a clamp clamping effect obtained by controlling the motor by the target torque output by the neural network model under the optimal network parameter, and the second score being used to represent a clamp clamping effect obtained by controlling the motor by the target torque output by the neural network model under the candidate network parameter.
[0049] If the second score is greater than the first score, the optimal network parameter is replaced by the candidate network parameter.
[0050] The intelligent adaptive locking device and method for metering equipment provided in this application solve the stress concentration problem caused by uneven clamping force distribution by acquiring sensor data, predicting target torque using a neural network model, and driving the clamps with a drive motor. Furthermore, by combining physical structure design with sensor feedback, the fixation failure problem caused by uneven clamping force distribution in traditional binding methods is fundamentally solved, significantly improving the long-term stability and safety of the intelligent adaptive locking device in complex environments. Attached Figure Description
[0051] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0052] Figure 1 A schematic diagram of the intelligent adaptive locking device for the metering equipment provided in this application;
[0053] Figure 2 This is a schematic diagram of the motor structure provided in an embodiment of this application;
[0054] Figure 3 This is a schematic diagram of the strain sensor structure provided in an embodiment of this application;
[0055] Figure 4 This is a schematic diagram of the structure of the device box provided in the embodiments of this application;
[0056] Figure 5 This is a schematic diagram of the structure of the table mounting crossarm provided in an embodiment of this application;
[0057] Figure 6 This is a schematic diagram of the wave-shaped anti-slip layer structure used in the embodiments of this application;
[0058] Figure 7 This is a schematic diagram of the structure of the robust insulating layer provided in the embodiments of this application;
[0059] Figure 8 A flowchart illustrating the intelligent adaptive locking method for metering equipment provided in this application embodiment;
[0060] Figure 9 This is a flowchart illustrating the offline evolution stage provided in an embodiment of this application.
[0061] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0063] Traditional rural metering equipment installation mainly relies on the following methods: (1) Direct binding method: The pole and meter box are fixed by wrapping iron wire around them and relying on friction to achieve fixation. This method is simple to operate, but long-term vibration can easily cause the iron wire to loosen, resulting in poor fixing effect for heavy equipment, and the metal binding wire is prone to oxidation and corrosion. (2) Through reinforcement method: After pre-drilling holes in the meter box, the iron wire is passed through and tightened to fix it. Although this method can enhance the fixing force, it requires the meter box to be sealed, increasing the risk of moisture and dust entering the equipment, and the operation process is cumbersome. (3) Special clamp fixing method: Prefabricated metal clamps are used to surround the pole and tighten it to provide an installation platform for the meter box. This method has high requirements for pole diameter matching, lacks flexibility for temporary installation, and requires strong professional installation skills, resulting in low implementation efficiency in remote areas. (4) Magnetic adsorption bracket: The meter box is adsorbed by a strong magnetic block array, but it is only suitable for lightweight equipment, and long-term exposure to the sun can easily cause the silicone pad to age and fail. (5) Clamp-type integrated box: This type of box integrates multiple modules by clamping the pole, but it has a complex structure, occupies a large space, and requires professional tools and training for installation, making it unsuitable for rapid deployment. (6) Fall protection rope system: This type of box prevents the meter box from falling off by using ropes and shock absorbers, but it increases the number of components, increases the complexity of installation and maintenance, and cannot solve the fundamental problem of fixing. The above methods generally have the following problems: poor fixing reliability, complex installation, insufficient adaptability, and high maintenance costs, making it difficult to meet the needs of rural power grids for high efficiency, safety, and long-term stability of metering equipment installation.
[0064] To address the aforementioned issues, this application provides an intelligent adaptive locking device and method for metering equipment. This solution combines a motor and sensor feedback system to dynamically adjust the clamping force, ensuring uniform clamping force distribution and adapting to changes in the pole's surface morphology. This solves problems such as stress concentration and unreliable fixing in traditional binding methods. Furthermore, modular design and the application of weather-resistant materials further enhance the device's environmental adaptability, installation efficiency, and long-term stability.
[0065] The intelligent adaptive locking device for metering equipment provided in this application is applicable to pole installation scenarios for metering equipment such as temporary meters and irrigation meters in rural power grids. In complex terrain (such as mountains and hills) and extreme weather conditions (such as strong winds and heavy rain), operators need to quickly and safely fix the equipment to the surface of the pole.
[0066] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0067] Figure 1 A schematic diagram of the intelligent adaptive locking device for the metering equipment provided in this application is shown below. Figure 1 As shown, the intelligent adaptive locking device includes a gauge crossbeam 11, a clamp 12, a corrugated anti-slip layer 13, a motor 14, a strain sensor 15, and a device 16.
[0068] Among them, the device box 16 serves as the core of the control and power supply of the entire device. It integrates a three-dimensional force sensor, a controller, and a power module, which together constitute the control system of the device: the three-dimensional force sensor accurately senses the comprehensive force on the mounting surface, the controller analyzes and directs the motor to move accordingly, and the power module provides stable power to all electronic components, thereby ensuring that the device can automatically and reliably complete the installation and fixation.
[0069] The meter mounting crossarm 11 is fixedly connected to the clamp 12 for installing metering equipment. The metering equipment may include rural electricity meters and irrigation meters.
[0070] Rural electricity meters are general-purpose electricity metering devices used in rural households, village public facilities, and small workshops. Rural irrigation meters are specialized metering devices designed for rural farmland irrigation and drainage, primarily used to measure the electricity consumption of irrigation power equipment such as water pumps and pumps.
[0071] The clamp 12 is used to tighten under the drive of the motor 14 to fix the meter mounting crossarm 11 to the pole.
[0072] The corrugated anti-slip layer 13 is provided on the inner side of the clamp 12 and comes into contact with the pole when the clamp 12 is tightened and fixed to the pole.
[0073] The motor 14 is used to drive the clamp 12 to tighten according to the target torque fed back by the controller.
[0074] For example, Figure 2 This is a schematic diagram of the motor structure provided in the embodiments of this application, such as... Figure 2 As shown, the motor 14, as the driving core of the clamp 12, works in conjunction with the sensor to precisely drive the clamp to tighten or loosen according to the controller's instructions, thereby achieving automatic and intelligent adjustment of the installation tightness. This improves installation efficiency and ensures that the device can be firmly adapted to poles of different specifications, fundamentally solving the problem of traditional binding and fixing being insecure.
[0075] The strain sensor 15 is used to monitor the clamping force of the clamp 12 in real time during the clamping process and feed it back to the controller.
[0076] For example, Figure 3 This is a schematic diagram of the strain sensor structure provided in the embodiments of this application, as shown below. Figure 3 As shown, the strain sensor is used to monitor the clamping force of the device clamp in real time and feed the data back to the controller. Together with the three-dimensional force sensor, it can intelligently adjust the tightness to ensure that the installation is firm and reliable.
[0077] The three-dimensional force sensor in the device box 16 is used to monitor the force distribution on the contact surface between the clamp 12 and the pole during the clamping process. The controller in the device box 16 is used to feed back the target torque to the motor 14 based on the clamping force, force distribution and a pre-deployed neural network model to adjust the clamp 12 to tighten until the clamp 12 is in close contact with the pole.
[0078] For example, Figure 4 This is a schematic diagram of the structure of the device box provided in the embodiments of this application, as shown below. Figure 4 As shown, the device box 16 serves as the core of the control and power supply for the entire device, together forming the control system of the device: the three-dimensional force sensor accurately senses the comprehensive force on the mounting surface, the controller analyzes and directs the motor to move accordingly, and the power module provides stable power to all electronic components, thereby ensuring that the device can automatically and reliably complete the installation and fixation.
[0079] In some embodiments, the neural network model can be trained using both offline and online training sample data.
[0080] The network parameters of the neural network model are obtained by performing offline evolution processing based on offline training sample data, followed by online adaptive optimization using online training sample data.
[0081] The offline training sample data is used in the offline evolution stage. The purpose of offline training is to evolve the optimal network model in the simulation environment and deploy it to the controller.
[0082] Among them, online training sample data is used in the online adaptive training phase. The purpose of the online trainer is to deploy the optimal network model that has been trained offline to the controller, and then install the controller on a real device to continue learning and adaptive training.
[0083] For example, Figure 5 This is a schematic diagram of the structure of the table mounting crossarm provided in the embodiments of this application, as shown below. Figure 5 As shown, the insulated meter mounting crossarm provides a standardized load-bearing platform for the metering equipment, optimizes the mechanical structure to balance the center of gravity, and reduces fixation failures caused by installation misalignment.
[0084] The meter mounting crossarm is designed according to the relevant dimensions of the provided electricity or irrigation meter, and is compatible with a variety of electricity or irrigation meters, so that the meter mounting crossarm can install and fix various models of electricity or irrigation meters.
[0085] For example, Figure 6 This is a schematic diagram of the structure of the wave-shaped anti-slip layer according to an embodiment of this application, as shown below. Figure 6 As shown, the wave-patterned anti-slip layer is a special anti-slip layer with wave patterns. By increasing the contact area and friction coefficient, it ensures that the intelligent adaptive locking device is not easy to fall off or be damaged after installation. Even in extreme weather such as strong winds or thunderstorms, it can ensure installation stability.
[0086] Furthermore, in some embodiments, the outer side of the corrugated anti-slip layer is covered with a robust insulating layer for insulation between the metering device and the intelligent adaptive locking device. For example, Figure 7 This is a schematic diagram of the structure of the stable insulating layer provided in the embodiments of this application, as shown below. Figure 7 As shown, a robust insulation layer designed with special materials provides stable support while isolating conductors, thus avoiding the risk of electric shock. While ensuring insulation effectiveness, the corrugated anti-slip layer can be further reinforced, further enhancing the overall stability of the device.
[0087] The intelligent adaptive locking device for metering equipment provided in this application is mainly aimed at the need for fixing metering equipment such as temporary electricity meters and irrigation meters on utility poles in rural areas, and solves the problems of inconvenient binding, unstable fixing and insufficient insulation when installing electricity meters and irrigation meters on utility poles in rural areas.
[0088] Figure 8 This is a flowchart illustrating the intelligent adaptive locking method for a metering device provided in an embodiment of this application. This method can be applied to the aforementioned intelligent adaptive locking device. Figure 8 As shown, the method may specifically include:
[0089] Step 810: Monitor the clamping force of the clamp during the clamping process in real time, as well as the force distribution on the contact surface between the clamp and the pole;
[0090] Step 820: Based on the clamping force and force distribution, determine the target torque of the motor using a pre-built neural network model;
[0091] Step 830: Feedback the target torque to the motor so that the motor adjustment clamp tightens until the clamp fits tightly against the pole.
[0092] First, the clamping force data of the contact area between the clamp and the pole is collected by the sensor;
[0093] Secondly, the adjustment requirements for the opening and closing angle of the clamp are calculated based on a neural network model, and the clamp is rotated to the target angle by a motor.
[0094] Finally, the clamping force is evenly distributed on the surface of the pole by rotating the clamp.
[0095] For example, in a utility pole installation scenario, the contact area between the clamp and the pole surface is fed back with clamping force data in real time via a strain sensor. The controller calculates the rotation angle of the clamp based on a neural network model, determines the target torque of the motor, and then drives the motor to rotate, adjusting the opening and closing angle of the clamp, ultimately ensuring that the clamping force is evenly distributed across the pole surface. The entire process achieves dynamic optimization of the clamping force through the coordinated action of sensor data acquisition, model calculation, and motor drive.
[0096] The intelligent adaptive locking method provided in this application solves the stress concentration problem caused by uneven clamping force distribution by acquiring sensor data, predicting the target torque using a neural network model, and driving the clamping jaws with a drive motor. Furthermore, by combining physical structure design with sensor feedback, it fundamentally solves the fixation failure problem caused by uneven clamping force distribution in traditional binding methods, significantly improving the long-term stability and safety of the intelligent adaptive locking device in complex environments.
[0097] For example, in strong winds or vibration environments, a uniformly distributed clamping force can effectively disperse external forces, preventing material fatigue or fracture caused by excessive local stress. Furthermore, a dynamic clamping force adjustment mechanism allows the clamp to adapt to the dimensions of different support structures, improving the device's adaptability.
[0098] The following examples illustrate in detail how to construct a neural network model.
[0099] In some embodiments, a neural network model can be constructed using the following steps:
[0100] Step (1) Obtain the instantaneous loss function and fitness function;
[0101] Step (2) flatten the network parameters of the initial network model into real-valued vectors, which serve as the chromosomes of the evolutionary algorithm;
[0102] Step (3) Based on the fitness function and chromosomes, the network parameters are processed offline using an evolutionary algorithm to obtain the optimal network parameters;
[0103] Step (4) Construct an online network model based on the optimal network parameters;
[0104] Step (5) Based on the instantaneous loss function, the optimal network parameters of the online network model are adaptively optimized online to obtain the optimized target network parameters;
[0105] Step (6) Construct a neural network model based on the target network parameters.
[0106] In this embodiment, the above steps can be used to design a neural network model with high tracking accuracy, low energy consumption, good dynamic performance (small overshoot and short settling time) and online adaptive capability.
[0107] High tracking accuracy means that the difference between the set clamping value and the actual clamping value is very small; low energy consumption means that the motor can complete the clamping with minimal output torque; small overshoot means that the overshoot is small when adjusting the clamping tightness; and short settling time means that the time required to adjust the clamp to a tight fit with the pole is short.
[0108] For step (1) above, the fitness function is used to rank individuals (i.e., network parameters of the neural network model) in the offline evolution stage, while reflecting tracking accuracy, energy consumption, overshoot and safety penalty.
[0109] Among them, safety penalty refers to the penalty weight given when the target torque exceeds the safety threshold.
[0110] For example, in some embodiments, the instantaneous loss function (for training and evaluation) can be defined as follows:
[0111]
[0112] In the above formula, e(t) is the instantaneous loss; e(t) is the tracking error, used to characterize the difference between the set clamping value and the actual clamping value of the clamp; u(t) is the control output at time t, used to characterize the target torque; Δu(t) is the difference between the control output at time t and the control output at time t-1, used to characterize the change in the control output. , , and These are the weighting coefficients; This is a violation indication, used to indicate that the target torque exceeds the safety threshold.
[0113] When the safety threshold is exceeded, Returns a positive value (e.g., 1), or 0 otherwise.
[0114] The weighting coefficients mentioned above can take the following values: w e =1.0, w u =0.1, w Δ =0.05, w s =100. w e This represents the weight of the tracking error; a larger value indicates a greater emphasis on tracking accuracy. uThe weight used to control the output size is determined by the degree of energy conservation (reducing the control output). Δ To control the weight of the output change rate, a larger weight indicates a greater desire for smooth control, avoiding frequent and large motor movements. s The purpose of setting a high weight (e.g., 100) for safety violations is to severely punish any safety violations and ensure that the controller operates within safe limits.
[0115] Additionally, define the fitness function over the entire evaluation period T:
[0116]
[0117] In the above formula, Fitness(θ) represents the fitness of the network parameter θ. α represents the sum of instantaneous losses over the entire evaluation period T; Overshoot represents the overshoot of the clamp; SettlingTime represents the settling time required for the clamp to be in close contact with the pole; α represents the penalty coefficient for overshoot; β represents the penalty coefficient for settling time.
[0118] Among them, α and β can be adjusted according to the focus, and Overshoot and SettlingTime can be calculated using common definitions (percentage overshoot and time required to converge to the error threshold).
[0119] In this embodiment, the instantaneous loss function and the fitness function operate at different stages and have different purposes. The instantaneous loss function is used for online training (gradient descent) and evaluation at each time step, while the fitness function is used for offline evolutionary evaluation and ranking of the entire individual (and network parameters).
[0120] In step (2) above, the neural network parameters are flattened into real-valued vectors, which serve as the chromosomes of the evolutionary algorithm. The purpose is to encode the neural network parameters into individuals that the evolutionary algorithm can process.
[0121] For example, for a neural network model, there are two evolutionary options: (1) optimize only the weights; (2) evolve the topology of the neural network model at the same time, such as (the binary encoding of nodes or connections) also evolving through an evolutionary algorithm.
[0122] If only weights are optimized, the following individuals can be configured:
[0123]
[0124] In the above formula, g represents an individual, which is the network parameter of the neural network model, and θ represents a real-valued vector composed of all trainable parameters of the neural network (including weights and biases). Let m represent an m-dimensional real space, where m is the total number of parameters.
[0125] If topology is to evolve simultaneously, hybrid encoding can be used.
[0126] In this embodiment, the evolutionary algorithm refers to encoding the flattened neural network parameter vector as a "chromosome" and iteratively searching for a better solution (i.e., the optimal network parameters) in the population by simulating natural evolutionary processes such as selection, crossover, and mutation.
[0127] For step (3) above, after constructing the chromosome for the evolutionary algorithm, offline evolution is carried out in a high-fidelity simulation environment, using the standard evolutionary cycle of selection-crossover-mutation-elite retention.
[0128] Among them, crossover uses real-valued SBX, and mutation uses polynomial mutation or Gaussian perturbation.
[0129] For steps (4) and (5) above, a neural network model can be constructed based on the optimal network parameters obtained offline, deployed to the controller, and continue to perform adaptive optimization online.
[0130] For example, adaptive optimization methods include the following two: (1) mini-batch gradient fine-tuning; (2) constrained incremental evolution.
[0131] The neural network model construction method provided in this application combines offline and online training. In a safe offline simulation environment, it leverages evolutionary algorithms to find globally optimal solutions in high-dimensional, non-convex, and non-differentiable search spaces, thereby obtaining high-performing neural network parameters. After deploying the offline optimal individual to the real system, online adaptive optimization is performed. Through small-step gradient updates or controlled incremental evolution, the model can adapt to subtle dynamic changes or environmental drift not covered in the simulation, thus improving the accuracy of the neural network model.
[0132] Based on the above embodiments, in some embodiments, Figure 9 This is a flowchart illustrating the offline evolution stage provided in an embodiment of this application, such as... Figure 9 As shown, it includes:
[0133] Step 910: Obtain the initial population based on chromosomes.
[0134] The population consists of g individuals, each of which represents at least one network parameter, where g is a positive integer.
[0135] Step 920: Evaluate the fitness of each individual in the initial population based on the fitness function.
[0136] Step 930: Based on the fitness of each individual, generate a set of parent pairings, which includes at least one parent.
[0137] Step 940: Perform a crossover operation on each parent in the parent pairing set to generate offspring.
[0138] Step 950: Perform mutation operations on the offspring to determine the optimal offspring. Mutation operations include polynomial mutation or Gaussian perturbation.
[0139] Step 960: Fine-tune the optimal offspring using gradient descent to obtain the initial values of the network parameters.
[0140] In this embodiment, the evolutionary algorithm is a population-based global optimization algorithm that mimics the process of natural selection.
[0141] For step 910, the population consists of multiple individuals, each of which is a vector of neural network parameters. The initial population is usually randomly generated, and each parameter takes a random value within a given search space.
[0142] For step 920, for each individual, its parameters are decoded, and the simulation environment is run to collect indicators such as tracking error, control output, overshoot, and settling time. Then, the fitness value is calculated according to the fitness function calculation formula mentioned above.
[0143] A higher fitness value indicates better performance (because the loss is negative).
[0144] For step 930, parent individuals can be selected based on fitness. For example, individuals with higher fitness are more likely to be selected.
[0145] For step 940, the crossover operation can employ simulated binary crossover (SBX). SBX is a commonly used crossover operator in real-valued genetic algorithms. Its core principle is to simulate the statistical properties of binary single-point crossover in the real-number space. SBX can generate offspring that are similar to but also different from their parents, while maintaining diversity in search directions. The SBX formula is as follows:
[0146]
[0147] In the above formula, u is a random number, uniformly distributed in the interval [0, 1], and η c η is the distribution exponent, a non-negative real number that controls the distance between offspring and parents. c The larger the value, the closer the offspring are to the parent; η c The smaller the value, the farther the offspring is from the parent. For example, η... c The value range of Β is [2, 5]. q This is the expansion factor.
[0148] Furthermore, after calculating the expansion factor, the offspring can be determined using the following formula:
[0149]
[0150] In the above formula, C1 and C2 represent two child vectors, and P1 and P2 represent two parent vectors.
[0151] For step 950, the polynomial mutation or additive Gaussian perturbation is as follows:
[0152]
[0153] In the above formula, Indicates the offspring before the mutation. Indicates the offspring after the mutation. This represents a Gaussian distribution with a mean of 0 and a standard deviation of σ.
[0154] After mutation is complete, to prevent the loss of optimal solutions during evolution, the Nelite individuals with the highest fitness are directly retained in each generation to the next generation. This elite retention strategy ensures the convergence of the algorithm.
[0155] After retaining the next generation, the process can continue to repeat steps 910 to 950 until the stopping condition (such as the maximum number of generations or the fitness threshold) is met, thus obtaining the final optimal offspring.
[0156] For step 960 above, k-step gradient fine-tuning is performed on the final optimal individual. This is because the solution obtained by the evolutionary algorithm may be located near a local optimum, but it is not accurate. Therefore, gradient descent methods (such as Adam or SGD) are used to fine-tune the optimal individual to improve tracking accuracy.
[0157] The offline evolution method provided in this application embodiment can obtain high-performance neural network parameters in an offline simulation environment, thereby constructing an accurate online network model. After the online network model is deployed to a real controller, it can improve the controller's control effect on the clamping force of the clamp in the real environment.
[0158] Furthermore, in some embodiments, a hybrid local optimization strategy can be used to further improve the quality of the solution and accelerate convergence. The specific steps are as follows: the offspring are screened using a hybrid local optimization strategy to determine the optimal offspring.
[0159] The hybrid local optimization strategy includes global search and local search. Global search is used to select the best offspring among all offspring in each generation, while local search is used to select the best offspring among all offspring after offline processing is completed.
[0160] In this embodiment, the hybrid local optimization strategy combines the advantages of global search (i.e., evolutionary algorithm) and local search (i.e., gradient descent). (1) Evolutionary algorithm is good at global exploration and avoids getting trapped in local optima, but it has a slow convergence speed and requires a lot of evaluation. (2) Gradient descent is good at local exploration and can quickly find local optimal solutions, but it is sensitive to initial values and is prone to getting trapped in local optima.
[0161] The workflow of the hybrid strategy mainly includes: in the offline evolution stage, after each generation of evolution, a local search is performed on the optimal individual, or after the evolution is completed, a local fine-tuning is performed on the final optimal individual.
[0162] The offline fine-tuning objective function is as follows:
[0163]
[0164] In the above formula, θ represents the network parameters of the neural network model, L(θ) is the offline fine-tuning objective function, T is the total number of time steps, and e(t) is the tracking error.
[0165] In addition, a small number of Adam or SGD updates are performed on the optimal individual in the simulation environment, with the specific gradient direction updates as follows:
[0166]
[0167] In the above formula, η is the learning rate, which can be a relatively small value, such as 0.001. This is for offline fine-tuning of the gradient of the objective function with respect to θ.
[0168] The hybrid local optimization strategy provided in this application uses an evolutionary algorithm for global search and gradient descent for local fine-tuning to improve tracking accuracy. By combining the two, convergence can be accelerated and the fine performance of the solution can be improved.
[0169] The online adaptive phase is described in detail below through some examples. After obtaining the optimal network parameters and constructing the online network model through the offline evolution phase, the network model can continue to be adaptively optimized online in two ways: (1) mini-batch gradient fine-tuning; (2) constrained incremental evolution.
[0170] In some embodiments, for (1) mini-batch gradient fine-tuning, the specific steps are as follows:
[0171] Step 11: Set up the online experience buffer. The online experience buffer is used to store sample data, which includes the online runtime status, control input data, and loss data.
[0172] Step 12: When the number of sample data in the online experience buffer is greater than or equal to the preset number threshold, select m sample data from the sample data and calculate the gradient loss through the instantaneous loss function, where m is a positive integer;
[0173] Step 13: Based on the gradient loss, use the gradient descent algorithm to update the optimal network parameters to obtain the optimized target network parameters.
[0174] In this embodiment, an experience buffer can be maintained. , capacity M.
[0175] Where x represents the online running state, and u represents the control input data. This represents the instantaneous loss. The purpose of setting up an experience buffer is to store data such as the state, control inputs, and loss during online runtime, for subsequent gradient updates or evaluations. When the buffer is full, it can be updated according to the first-in, first-out principle.
[0176] Whenever the buffer accumulates to m samples, based on a small learning rate η online Perform konline step gradient updates on the current parameters:
[0177]
[0178] In the above formula, θ represents the network parameter vector, and η online This represents the learning rate. Where the learning rate η is... online It should be set very small to avoid disrupting the stable strategies learned in the offline phase.
[0179] In this embodiment, for (1) mini-batch gradient fine-tuning, whenever the experience buffer accumulates to a preset number of sample data, a mini-batch (or all m data) is randomly drawn from the buffer to calculate the gradient of the loss function, and then the parameters of the current controller are updated using gradient descent.
[0180] In some embodiments, for (2) constrained incremental evolution, the specific steps are as follows:
[0181] Step 21: Periodically apply random perturbations to the optimal network parameters to generate at least one candidate network parameter;
[0182] Step 22: Obtain the first score and the second score. The first score is used to characterize the clamping effect of the motor controlled by the target torque output by the neural network model under the optimal network parameters; the second score is used to characterize the clamping effect of the motor controlled by the target torque output by the neural network model under the candidate network parameters.
[0183] Step 23: If the second score is greater than the first score, then replace the optimal network parameters with the candidate network parameters.
[0184] In this embodiment, restricted incremental evolution is performed periodically: a perturbation is added to the current θ to generate several candidate {θ′}, which are evaluated on a restricted mode or simulation verifier. If a candidate is significantly better than the current one and passes the safety check, it is replaced.
[0185] In this process, online gradient steps should be small to avoid disrupting the learned stability. Online incremental evolution is only permitted for replacement in the main system under low-risk conditions or when the simulation verifier passes the validation.
[0186] The online adaptive optimization method provided in this application allows the controller to continue learning in a real environment, thereby adapting to factors not considered in the simulation environment, such as model errors, environmental interference, and equipment aging. This continuously improves the controller's accuracy in clamp control.
[0187] In this application, to ensure security, security constraints and rollback mechanisms can also be set. All online updates must be performed under the protection of a security backup and rollback framework to ensure that stable control can be returned at any time (e.g., a backup PID controller).
[0188] The hardware security constraints are as follows:
[0189]
[0190] In the above formula, u(t) is the control output at time t, u min To control the minimum output value, u max This is to control the maximum output value. The hardware safety constraint is used to ensure that the motor commands are within the permissible torque or speed range.
[0191] The rate of change is limited as follows:
[0192]
[0193] The rollback criteria (triggering conditions) are as follows:
[0194] If the cumulative error ∑t∈We2(t)>Ethresh within a short time window W; or the control output variance Var(uW)>Vthresh; or a safety violation event occurs; then switch to the backup PID controller uPID(t) and mark the latest N as "requires review".
[0195] In addition, to avoid introducing unknown risks through online replacement, a candidate verification and replacement strategy phase is set up. Each replacement requires the candidate verification process to pass. The candidate verification process involves generating several candidates N; executing Ntest trials under a simulator or constrained operating conditions, and recording fitness and safety indicators. If a candidate is statistically superior to the current controller, replacement is allowed; otherwise, it is discarded. Each replacement is logged and a snapshot of the candidate is saved for traceability and offline analysis.
[0196] In addition, commonly used convergence criteria and termination conditions in engineering should be provided to stop offline evolution or online adjustment. The offline evolution termination conditions can be selected as follows: reaching the maximum number of generations Gmax; or the optimal fitness < ϵ for consecutive gpatience generations; or the optimal fitness exceeding a preset threshold. The online fine-tuning termination conditions include: the fitness resulting from the most recent k updates < ϵonline; or the cumulative number of updates reaching a limit.
[0197] In addition, for rapid experimentation and optimization, a set of directly usable hyperparameters can be provided for reference. For the offline evolutionary stage: population N=40, generation Gmax=200; crossover rate pc=0.9, mutation rate pm=0.05; Nelite=2. For the hybrid local optimization strategy, perform 100 steps of Adam fine-tuning on the optimal population after every 10 generations. For the online adaptive stage, set the experience buffer M=200, perform 10 steps of fine-tuning every m=50 samples, and η... online =1e−5∼1e−4. For security constraints: u min u max It can be calibrated based on the motor and clamping mechanism; Δumax is determined based on the mechanical response bandwidth. For the candidate verification and replacement strategy phase, each replacement must be performed at least Ntest=10 times, and the average fitness improvement δ≥1%.
[0198] The intelligent adaptive locking method for metering equipment provided in this embodiment can be executed by referring to the operation process of the intelligent adaptive locking described above. The implementation principle and technical effect are similar, and will not be repeated here.
[0199] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0200] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A smart adaptive locking device for a metering apparatus, characterized by, The intelligent adaptive locking device comprises: a metering equipment mounting cross arm fixedly connected with the clamping opening, for mounting the metering equipment; the clamping opening, driven by the motor, is tightened to fix the metering equipment mounting cross arm to the electric pole; a wave pattern anti-skid layer arranged on the inner side of the clamping opening, which is in contact with the electric pole when the clamping opening is fixed to the electric pole; the motor, for driving the clamping opening to tighten according to the target torque fed back by the controller; the strain force sensor, for monitoring the clamping force of the clamping opening in the clamping process in real time and feeding back to the controller; the three-dimensional force sensor, for monitoring the force distribution of the contact surface between the clamping opening and the electric pole in the clamping process; the controller, for feeding back the target torque to the motor to adjust the tightening of the clamping opening according to the clamping force, the force distribution and the pre-deployed neural network model, until the clamping opening is tightly attached to the electric pole.
2. The apparatus of claim 1, wherein, The outer side of the wave pattern anti-skid layer is covered with a stable insulation layer for the insulation between the metering equipment and the intelligent adaptive locking device.
3. The apparatus of claim 1, wherein, The network parameters of the neural network model are obtained by further online adaptive optimization using online training sample data after offline evolutionary selection based on offline training sample data.
4. A smart adaptive lockout method for a metering device, characterized by, The method is applied to the intelligent adaptive locking device of any one of claims 1-3, and the method comprises: monitoring the clamping force of the clamping opening in the clamping process and the force distribution of the contact surface between the clamping opening and the electric pole in real time; determining the target torque of the motor based on the clamping force and the force distribution by using the pre-constructed neural network model; feeding back the target torque to the motor to make the motor adjust the tightening of the clamping opening until the clamping opening is tightly attached to the electric pole.
5. The method of claim 4, wherein, The method further comprises: obtaining an instantaneous loss function and a fitness function; flattening the network parameters of an initial network model into a real value vector as a chromosome of an evolutionary algorithm; performing offline evolutionary processing on the network parameters by using the evolutionary algorithm based on the fitness function and the chromosome to select optimal network parameters; constructing an online network model based on the optimal network parameters; performing online adaptive optimization on the optimal network parameters of the online network model based on the instantaneous loss function to obtain optimized target network parameters; constructing the neural network model based on the target network parameters.
6. The method of claim 5, wherein, The instantaneous loss function is: In the above formula, is the instantaneous loss; e(t) is a tracking error, used to represent the difference between the set clamping value and the actual clamping value of the clamp; u(t) is the control output at time t, used to represent the target torque; Δu(t) is the difference between the control output at time t and the control output at time t-1, used to represent the change in the control output; , , and is a weight coefficient; is a violation indication, used to represent that the target torque exceeds the safety threshold. The fitness function is: In the above equation, Fitness(θ) represents the fitness of the network parameters θ, represents the sum of the instantaneous losses over the entire evaluation period T; Overshoot represents the overshoot of the clamp; SettlingTime represents the settling time required to adjust to the clamp to fit the pole; a represents the penalty coefficient of the overshoot; β represents the penalty coefficient of the settling time.
7. The method of claim 5, wherein, The offline evolutionary processing on the network parameters by using the evolutionary algorithm based on the fitness function and the chromosome to select optimal network parameters comprises: obtaining an initial population based on the chromosome, the population including g individuals, each individual being used to represent at least one network parameter, and g being a positive integer; evaluating the fitness of each individual in the initial population based on the fitness function; generating a parent pairing set including at least one parent based on the fitness of each individual; performing a crossover operation on each parent in the parent pairing set to generate offspring; determining an optimal offspring by performing a mutation operation on the offspring, the mutation operation including polynomial mutation or Gaussian disturbance; The optimal offspring is fine-tuned by gradient descent to obtain the optimal network parameter.
8. The method of claim 7, wherein, The optimal offspring is determined by: The optimal offspring is determined by screening the mutated offspring by a hybrid local optimization strategy, the hybrid local optimization strategy including global search and local search, the global search being used to screen the optimal offspring from each of the mutated offspring, and the local search being used to screen the optimal offspring from each of the offspring after the offline evolution process ends.
9. The method of claim 5, wherein, The optimal network parameter of the online network model is online self-adaptively optimized based on the instantaneous loss function to obtain the optimized target network parameter, including: An online experience buffer is set, the online experience buffer being used to store sample data, the sample data including state, control input data and loss data during online running; When the number of sample data in the online experience buffer is greater than or equal to a preset number threshold, m pieces of sample data are selected from the sample data, a gradient loss is calculated by the instantaneous loss function, and m is a positive integer; According to the gradient loss, the optimal network parameter is updated by a gradient descent algorithm to obtain the optimized target network parameter.
10. The method of claim 9, wherein, The optimal network parameter of the online network model is online self-adaptively optimized, including: Random disturbance is periodically applied to the optimal network parameter to generate at least one candidate network parameter; A first score and a second score are obtained, the first score being used to represent the clamp clamping effect of the motor controlled by the target torque output by the neural network model under the optimal network parameter, and the second score being used to represent the clamp clamping effect of the motor controlled by the target torque output by the neural network model under the candidate network parameter; If the second score is greater than the first score, the optimal network parameter is replaced by the candidate network parameter.