Electric energy meter detection system and method based on fusion ant colony algorithmTechnical Field
The invention relates to the technical field of electric energy metering detection, in particular to an electric energy meter detection system and method based on a fusion ant colony algorithm.
Background
The electric energy meter is an important metering device for carrying out electric quantity settlement between a power supply enterprise and a power consumption client, and the metering accuracy of the electric energy meter is directly related to the economic benefits of the power supply enterprise and the power consumption client. When the electric energy meter is checked, an electric energy meter checking device or an electric energy meter checking assembly line is usually adopted, the electric energy meter checking assembly line realizes a series of functions of automatically taking the meter from an outlet of an electric energy meter warehouse, automatically transmitting, automatically opening a screw to open a meter cover, inserting a card according to a programming switch, sending the meter to each detection station and positioning, automatically wiring, checking appearance, performing pressure resistance test, checking functions and errors, automatically disconnecting, transmitting, labeling, screwing, sealing the meter, boxing, and then sending the meter back to an interface of the electric energy meter warehouse by a connection transmission system, the whole process is free of manual operation, the operation is automatically completed according to time sequence, and various types of data can be generated in the processes. In the conventional technology, when a plurality of types of detection data are output, for a user, the optimal target information is difficult to find by a plurality of types of data information, the optimal data information is difficult to find between the same type of data and between different types of data, and the conventional technology is often used for searching by a computer, so that the conventional retrieval technology is not only low in efficiency, but also easy to make mistakes, and difficult to realize the query and application of the data. With the continuous development of electric energy meter verification technology, the demand is more and more vigorous, and therefore, the development and research of an intelligent electric energy meter verification system are imperative.
Disclosure of Invention
Aiming at the defects of the prior art, the invention discloses an electric energy meter detection system and method based on a fusion ant colony algorithm.
The invention adopts the following technical scheme:
an electric energy meter detection system based on a fusion ant colony algorithm, wherein the system comprises:
the electric energy meter calibrating device and the electric energy meter calibrating assembly line or the portable electric energy meter calibrating device are also internally provided with sensors for sensing the environmental information of the electric energy meter, and the sensors sense and transmit various data information of the electric energy meter; the sensors at least comprise a photoelectric sensor, an infrared sensor, a speed sensor, an acceleration sensor, a GIS sensor, a vibration sensor, a ripple wave sensor, a temperature and humidity sensor, an angle sensor, a magnetic field sensor, a rotating speed sensor, an RFID label, GPS equipment, a ray radiation sensor, a heat-sensitive sensor or an energy consumption sensor;
the communication layer is internally provided with a wired communication module or a wireless communication module and is used for receiving and transmitting the data information of the electric energy meter sensed by the detection layer; the wired communication module at least comprises an RS485 communication module or an RS232 communication module, and the wireless communication module at least comprises a TCP/IP network system, a ZigBee wireless network, a GPRS communication module, CDMA wireless communication, a cloud communication module or a Bluetooth communication module; the communication unit also comprises a physical layer, a data link layer, a network layer, a transmission layer, a session layer, a presentation layer and an application layer; wherein the TCP/IP network system at least comprises a network card, a network cable, a hub, a repeater or a modem, and the data link layer at least comprises a network bridge or a switch; the network layer comprises at least a router; the communication layer also comprises a plurality of communication protocols, and the communication protocols at least comprise TCP/IP, UDP, IPSec, MODBUS/TCP, OPC, proprietary protocols, PROFIBUS-DP, MPI, PPI, S7, FX series programming port and serial port protocols, Q series serial port 4C protocols, Ethernet 3E protocols, CC-LINK, A series or ohm dragon HostLink protocols, so as to realize the communication requirements of different electric energy meter interfaces or communication equipment;
the data analysis layer is internally provided with a computer management system or a cloud server and is used for receiving and processing the electric energy meter data information transmitted by the detection layer; the computer management system or the cloud server is provided with a big data management platform, the big data management platform is provided with an infrastructure layer, an information storage layer, an information calculation layer and an information interaction layer, and the infrastructure layer is internally provided with a permission management module, a resource management module, a service management module, a resource addressing module, a data interface module, an information receiving module, an information selection module, an information integration module or an information fusion module; a distributed architecture management module is arranged in the information storage layer, and at least an exception handling module, a data exchange module, a log processing module, a data browsing module, a content retrieval module and a permission authentication module are arranged in the distributed architecture management module; the information computing layer is provided with a data analysis and mining tool library, and the data analysis and mining tool library is at least provided with a text mining module, a statistical analysis module, a data computing module, an algorithm model module, a text indexing module, a semantic indexing module and an auxiliary indexing module; the information interaction layer is provided with an application program module, and the application program module is at least provided with a network setting module, a server and a platform, a storage system, a service and application module, an information system interface, safety equipment, a virtual environment module and a machine room environment information module; the improved ant colony algorithm module is arranged in the data analysis and mining tool library and is integrated with a classification model;
the upper monitoring layer is internally provided with a computer component, a database integrated in the computer component, a monitoring unit and a remote information communication module so as to store, use or transmit data processed by the detection layer; wherein:
the output on detection layer with the input on communication layer is connected, the output on communication layer with the input on data analysis layer is connected, the output on data analysis layer with the input on upper monitoring layer is connected.
The invention also adopts the following technical scheme:
a method for detecting an electric energy meter based on a fusion ant colony algorithm, wherein the method comprises the following steps:
(1) data acquisition: the method comprises the steps that data information measured by the electric energy meter is obtained through a detection layer, wherein the data information comprises electric energy meter parameter information and electric energy meter surrounding environment data information, the electric energy meter parameter information comprises electric energy meter output current, voltage, power factors, ripples or phase sequences, and the electric energy meter surrounding environment data information comprises electric energy meter detection environment voltage, current, harmonic waves, vibration, magnetic fields, electromagnetic interference, temperature, humidity, voltage unbalance, current unbalance, flicker, power factors, power grid clutter interference or load power;
(2) data transmission: transmitting data information detected from the detection layer through the communication layer;
(3) data processing and analysis: the improved ant colony algorithm model fused with the classification algorithm model is used for dividing the attributes of different data types, the ant colony algorithm model is used for searching the optimal values of the data in different data categories among different classification attributes and in the same data attribute, so that a user can quickly find out target data from different databases, the time for searching the data is reduced,
(4) and data monitoring, namely receiving data information output by the data analysis layer through the upper monitoring layer, and realizing remote sharing and application of data.
Further, the improved ant colony algorithm model is as follows: and accessing the ant colony algorithm model in the classification algorithm model, accessing the classification algorithm model in the ant colony algorithm model, accessing the classification algorithm model at the output end of the ant colony algorithm model, or accessing the ant colony algorithm model at the output end of the classification algorithm model.
Further, the classification algorithm model is the K-Means algorithm, the decision tree or the FCM clustering algorithm
Further, the calculation process of the K-Means algorithm is as follows:
(1) selecting k objects from a plurality of electric energy meter detection data sets as initial clustering centers, wherein the electric energy meter detection output data sets are as follows:
X={xm|m=1,2,...,M};
assuming there are d different classification attributes for a data set, then there is A1,A2,...,AdDifferent dimensions, then different data samples x of the electric energy meteri=(xi1,xi2,...,xid)、xj=(xj1,xj2,...,xjd) Is a sample xi、xjCorresponding to d different classification attributes A1,A2,...,AdThe specific value of (a);
(2) calculating the distance from each clustering object to the clustering center to divide the classification attribute, xiAnd xjThe similarity between them is calculated by a distance formula, xiAnd xjThe smaller the distance between, the sample xiAnd xjThe more similar, xiAnd xjThe greater the distance between, sample xiAnd xjThe farther apart the phase difference; the distance formula is:
(3) calculating each clustering center again, taking the sample mean value in each cluster as a new clustering center through repeated calculation, and repeating the step (2);
(4) and (4) stopping the calculation when the cluster center is not changed any more or the maximum iteration number is reached, otherwise, repeating the steps (2) and (3).
Further, the clustering performance evaluation formula of the K-Means algorithm is a square error sum criterion function, and the function is as follows:
wherein p is the output data set X of the electric energy meteriAn arbitrary value of (1), miFor different cluster centers, E is a function of the sum of squared errors criterion, where mi≥5。
Further, the decision tree algorithm includes training of a classifier, selection of a root node, and selection of a child node.
Further, the FCM clustering algorithm is a fuzzy C-means clustering FCM algorithm.
Further, the ant colony algorithm model construction method comprises the following steps:
(1) initializing; initializing the acquired data information of the electric energy meter, and setting y (t) as y (t) ═ y of the initialized total group y (t) of the selected big data of the electric energy meter
maxEnabling the big data asset information detected and output by the electric energy meter to serve as ant elements, initializing all elements of an ant element matrix to be 0 initially, and then randomly selecting the initial positions of the ant elements; wherein an information factor is sought
Elicitor beta ∈ [ beta ]
min,β
max](ii) a Finding pheromone concentration volatilization factor
(2) Randomly placing m ant elements at N positions, and setting the cycle times of the ant elements for searching paths as NcAccording to Nc+1 sequence is cycled; in performing a data update, the following formula exists:
(3) setting the index number k of the ant element taboo list as 1, and circulating through k + 1;
(4) calculating the probability of the ant selecting the position j according to a state transition probability formula of the following formula; then there are:
the Node is a set of positions which are directly connected with the position i and through which ant elements do not pass;
(5) selecting a position with the maximum state transition probability, moving ant elements to the position with the maximum state transition probability, and recording the position into a taboo table;
(6) judging, if all the positions in the set are visited, making k less than m, wherein m is the number of the positions, executing a cycle operation through k +1, and if all the positions in the set are not visited, updating the information amount on each path;
(7) checking a termination condition, checking whether the termination condition is met, wherein the termination condition is that the probability of the ant selecting the position j is more than 83%, and if the termination condition is met, performing further operation;
(8) judging whether a new group is formed, if the termination condition is that the probability of the ant selecting the position j is less than 83%, forming the new group, and updating the pheromone matrix again, wherein the updating method is to recalculate the minimum data matrix D;
(9) and judging whether a termination genetic condition is met, and outputting a calculation result if the termination genetic condition is that the probability of the ant selecting the position j is more than 85% when the termination genetic condition is met.
Further, the ant colony algorithm updates the pheromone matrix more than 3 times.
Further, the relevance correction formula for updating the pheromone matrix by the ant colony algorithm is as follows:
rij(t+n)=ρrij(t)+Δrij (7)
in the formula (9), ρ is a data information residual coefficient, 1- ρ is a volatilization degree of the ant seeking pheromone in a time interval within (t, t + n), and 1- ρ is used for restraining the ant seeking pheromone in a seeking path, so that the quantity of the ant seeking pheromone can not be limited.
Has the positive and beneficial effects that:
the classification algorithm model is adopted to realize classification of various data types, and electric energy meter verification data, parameter data and electric energy meter detection data sensed by a plurality of sensors are classified according to certain attributes, so that users can quickly classify the electric energy meter data, disordered data are ordered, the data processing precision is high, and the data management capability is improved.
The invention also designs an architecture system of the product networking, which can monitor the acquisition capability and the application capability of the underlying data in real time in a remote, online manner, so that the management and the monitoring of the verification of the electric energy meter can be realized without a user visiting the site;
according to the invention, through an improved ant colony algorithm, the optimal search of the electric energy meter among the classified electric energy meter data, the classified electric energy meter data or the classified electric energy meter data and the classification attributes is realized, so that a user can quickly find out the optimal value of the target data from various data, an important technical guarantee is provided for improving the verification efficiency of the electric energy meter, and the verification efficiency and the data management capability of the electric energy meter are greatly improved.
Drawings
Fig. 1 is a schematic structural diagram of an electric energy meter detection system based on a fusion ant colony algorithm according to the invention;
FIG. 2 is a schematic diagram of a big data management platform in the electric energy meter detection system based on the ant colony fusion algorithm;
FIG. 3 is a schematic structural diagram of an improved ant colony algorithm in the method for detecting an electric energy meter based on a fusion ant colony algorithm according to the present invention;
fig. 4 is another schematic diagram of an improved ant colony algorithm in the electric energy meter detection method based on the fusion ant colony algorithm according to the present invention;
FIG. 5 is a schematic diagram of another architecture of an improved ant colony algorithm in the method for detecting an electric energy meter based on a fusion ant colony algorithm according to the present invention;
fig. 6 is a flow diagram of a fuzzy C-means clustering FCM algorithm in the electric energy meter detection method based on the ant colony fusion algorithm.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1 System
As shown in fig. 1 and fig. 2, an electric energy meter detection system based on a fusogenic ant colony algorithm, wherein the system includes:
the electric energy meter calibrating device and the electric energy meter calibrating assembly line or the portable electric energy meter calibrating device are also internally provided with sensors for sensing the environmental information of the electric energy meter, and the sensors sense and transmit various data information of the electric energy meter; the sensors at least comprise a photoelectric sensor, an infrared sensor, a speed sensor, an acceleration sensor, a GIS sensor, a vibration sensor, a ripple wave sensor, a temperature and humidity sensor, an angle sensor, a magnetic field sensor, a rotating speed sensor, an RFID label, GPS equipment, a ray radiation sensor, a heat-sensitive sensor or an energy consumption sensor;
the communication layer is internally provided with a wired communication module or a wireless communication module and is used for receiving and transmitting the data information of the electric energy meter sensed by the detection layer; the wired communication module at least comprises an RS485 communication module or an RS232 communication module, and the wireless communication module at least comprises a TCP/IP network system, a ZigBee wireless network, a GPRS communication module, CDMA wireless communication, a cloud communication module or a Bluetooth communication module; the communication unit also comprises a physical layer, a data link layer, a network layer, a transmission layer, a session layer, a presentation layer and an application layer; wherein the TCP/IP network system at least comprises a network card, a network cable, a hub, a repeater or a modem, and the data link layer at least comprises a network bridge or a switch; the network layer comprises at least a router; the communication layer also comprises a plurality of communication protocols, and the communication protocols at least comprise TCP/IP, UDP, IPSec, MODBUS/TCP, OPC, proprietary protocols, PROFIBUS-DP, MPI, PPI, S7, FX series programming port and serial port protocols, Q series serial port 4C protocols, Ethernet 3E protocols, CC-LINK, A series or ohm dragon HostLink protocols, so as to realize the communication requirements of different electric energy meter interfaces or communication equipment;
the data analysis layer is internally provided with a computer management system or a cloud server and is used for receiving and processing the electric energy meter data information transmitted by the detection layer; the computer management system or the cloud server is provided with a big data management platform, the big data management platform is provided with an infrastructure layer, an information storage layer, an information calculation layer and an information interaction layer, and the infrastructure layer is internally provided with a permission management module, a resource management module, a service management module, a resource addressing module, a data interface module, an information receiving module, an information selection module, an information integration module or an information fusion module; a distributed architecture management module is arranged in the information storage layer, and at least an exception handling module, a data exchange module, a log processing module, a data browsing module, a content retrieval module and a permission authentication module are arranged in the distributed architecture management module; the information computing layer is provided with a data analysis and mining tool library, and the data analysis and mining tool library is at least provided with a text mining module, a statistical analysis module, a data computing module, an algorithm model module, a text indexing module, a semantic indexing module and an auxiliary indexing module; the information interaction layer is provided with an application program module, and the application program module is at least provided with a network setting module, a server and a platform, a storage system, a service and application module, an information system interface, safety equipment, a virtual environment module and a machine room environment information module; the improved ant colony algorithm module is arranged in the data analysis and mining tool library and is integrated with a classification model;
the upper monitoring layer is internally provided with a computer component, a database integrated in the computer component, a monitoring unit and a remote information communication module so as to store, use or transmit data processed by the detection layer; wherein:
the output on detection layer with the input on communication layer is connected, the output on communication layer with the input on data analysis layer is connected, the output on data analysis layer with the input on upper monitoring layer is connected.
EXAMPLE 2 method
A method for detecting an electric energy meter based on a fusion ant colony algorithm, wherein the method comprises the following steps:
(1) data acquisition: the method comprises the steps that data information measured by the electric energy meter is obtained through a detection layer, wherein the data information comprises electric energy meter parameter information and electric energy meter surrounding environment data information, the electric energy meter parameter information comprises electric energy meter output current, voltage, power factors, ripples or phase sequences, and the electric energy meter surrounding environment data information comprises electric energy meter detection environment voltage, current, harmonic waves, vibration, magnetic fields, electromagnetic interference, temperature, humidity, voltage unbalance, current unbalance, flicker, power factors, power grid clutter interference or load power;
(2) data transmission: transmitting data information detected from the detection layer through the communication layer;
(3) data processing and analysis: the improved ant colony algorithm model fused with the classification algorithm model is used for dividing the attributes of different data types, the ant colony algorithm model is used for searching the optimal values of the data in different data categories among different classification attributes and in the same data attribute, so that a user can quickly find out target data from different databases, the time for searching the data is reduced,
(4) and data monitoring, namely receiving data information output by the data analysis layer through the upper monitoring layer, and realizing remote sharing and application of data.
In the above embodiment, as shown in fig. 3 to fig. 5, the improved ant colony algorithm model is: and accessing the ant colony algorithm model in the classification algorithm model, accessing the classification algorithm model in the ant colony algorithm model, accessing the classification algorithm model at the output end of the ant colony algorithm model, or accessing the ant colony algorithm model at the output end of the classification algorithm model. In this way, the optimum value search of different types of data is realized.
In the above embodiment, the classification algorithm model is the K-Means algorithm, the decision tree, or the FCM clustering algorithm, and in the above embodiment, the calculation process of the K-Means algorithm is as follows:
(1) selecting k objects from a plurality of electric energy meter detection data sets as initial clustering centers, wherein the electric energy meter detection output data sets are as follows:
X={xm|m=1,2,...,M};
assuming there are d different classification attributes for a data set, then there is A1,A2,...,AdIn different dimensions, then
Different data samples x of electric energy meteri=(xi1,xi2,...,xid)、xj=(xj1,xj2,...,xjd) Is a sample xi、xjCorresponding to d different classification attributes A1,A2,...,AdThe specific value of (a);
(2) calculating the distance from each clustering object to the clustering center to divide the classification attribute, xiAnd xjThe similarity between them is calculated by a distance formula, xiAnd xjThe smaller the distance between, the sample xiAnd xjThe more similar, xiAnd xjThe greater the distance between, sample xiAnd xjThe farther apart the phase difference; the distance formula is:
(3) calculating each clustering center again, taking the sample mean value in each cluster as a new clustering center through repeated calculation, and repeating the step (2);
(4) and (4) stopping the calculation when the cluster center is not changed any more or the maximum iteration number is reached, otherwise, repeating the steps (2) and (3).
In the above embodiment, the clustering performance evaluation formula of the K-Means algorithm is a square error sum criterion function, where the function is:
wherein p is the output data set X of the electric energy meteriAn arbitrary value of (1), miFor different cluster centers, E is a function of the sum of squared errors criterion, where mi≥5。
In the above embodiment, the decision tree algorithm includes training of a classifier, selection of a root node, and selection of a child node, where the decision tree algorithm is constructed by screening different types of electric energy meter data information from a database, and then performing data training, where in the data training, a data sample D is first selected, and assuming that K categories are selected from the data sample, the sample D is selectedThe probability that a point belongs to the k-th class is set to pkThen the kini index of the probability distribution is defined as:
then for data sample D, then there are:
then C iskIf the data sample is a kth class data sample in the data sample D, the kini index of the data sample D is:
wherein D1And D2Is a part divided by the feature A in the data set D, and then the feature with the minimum Gini index is selected
And the corresponding segmentation points are used as the optimal characteristics and the optimal segmentation points,
then determining a root node: selecting a root node of the decision tree according to the kini index calculated by the formula (5), and selecting the attribute with the larger kini index as the root node;
and then determining leaf nodes: selecting leaf nodes of the decision tree according to the calculated kini indexes, and selecting the leaf nodes with smaller kini indexes; then, continuously and repeatedly applying the formula (5) to calculate, and stopping calculating if the number of samples in the node is less than a preset threshold value or the Gini index of the sample set is less than the preset threshold value, then not calculating the classification attribute; constructing a data model through the determined root node and leaf node, and constructing a decision tree according to the data model; the constructed decision tree is in a tree structure, and the user target value is finally output. In this way it is possible to output data results quickly according to different properties,
in the above embodiment, the FCM clustering algorithm is a fuzzy C-means clustering FCM algorithm. As shown in fig. 6, the fuzzy C-means clustering FCM algorithm includes the following steps:
(1) initializing, namely, initializing the selected data, so that the calculated data has high precision;
(2) the centroid is calculated, the calculation method evaluates by a weighted average,
wherein m is the number of clusters of the cluster; i. j is a class designation; u. ofijRepresents a sample xiMembership belonging to class j, i denotes the ith sample, and x is a sample with d-dimensional features. c. CjIs the center of the j cluster, also having d dimension, | | x | can be any metric that represents distance.
(3) Updating membership matrix
Fuzzy c is a constant iterative calculation of membership uijAnd cluster center cjUntil the optimal value is achieved. The calculation formula is as follows:
wherein the termination condition of the iteration is as follows:
where k is the number of iteration steps and is the error threshold, in a particular embodiment 0 < 3, more preferably
Further, the ant colony algorithm model construction method comprises the following steps:
(1) initializing; initializing the acquired data information of the electric energy meterThe selected initialization total group y (t) of the big data of the electric energy meter is set as y (t) ═ y
maxEnabling the big data asset information detected and output by the electric energy meter to serve as ant elements, initializing all elements of an ant element matrix to be 0 initially, and then randomly selecting the initial positions of the ant elements; wherein an information factor is sought
Elicitor beta ∈ [ beta ]
min,β
max](ii) a Finding pheromone concentration volatilization factor
(2) Randomly placing m ant elements at N positions, and setting the cycle times of the ant elements for searching paths as NcAccording to Nc+1 sequence is cycled; in performing a data update, the following formula exists:
(3) setting the index number k of the ant element taboo list as 1, and circulating through k + 1;
(4) calculating the probability of the ant selecting the position j according to a state transition probability formula of the following formula; then there are:
the Node is a set of positions which are directly connected with the position i and through which ant elements do not pass;
(5) selecting a position with the maximum state transition probability, moving ant elements to the position with the maximum state transition probability, and recording the position into a taboo table;
(6) judging, if all the positions in the set are visited, making k less than m, wherein m is the number of the positions, executing a cycle operation through k +1, and if all the positions in the set are not visited, updating the information amount on each path;
(7) checking a termination condition, checking whether the termination condition is met, wherein the termination condition is that the probability of the ant selecting the position j is more than 83%, and if the termination condition is met, performing further operation;
(8) judging whether a new group is formed, if the termination condition is that the probability of the ant selecting the position j is less than 83%, forming the new group, and updating the pheromone matrix again, wherein the updating method is to recalculate the minimum data matrix D;
(9) and judging whether a termination genetic condition is met, and outputting a calculation result if the termination genetic condition is that the probability of the ant selecting the position j is more than 85% when the termination genetic condition is met.
Further, the ant colony algorithm updates the pheromone matrix more than 3 times.
Further, the relevance correction formula for updating the pheromone matrix by the ant colony algorithm is as follows:
rij(t+n)=ρrij(t)+Δrij (14)
in the formula (16), ρ is a data information residual coefficient, 1- ρ is a volatilization degree of the ant seeking pheromone in a time interval within (t, t + n), and 1- ρ is used for restraining the ant seeking pheromone in a seeking path, so that the quantity of the ant seeking pheromone can not be limited.
Although specific embodiments of the present invention have been described above, it will be understood by those skilled in the art that these specific embodiments are merely illustrative and that various omissions, substitutions and changes in the form of the detail of the methods and systems described above may be made by those skilled in the art without departing from the spirit and scope of the invention. For example, it is within the scope of the present invention to combine the steps of the above-described methods to perform substantially the same function in substantially the same way to achieve substantially the same result. Accordingly, the scope of the invention is to be limited only by the following claims.