Power station equipment data acquisition method and system
Technical Field
The invention relates to the field of data acquisition, in particular to a method and a system for acquiring data of power station equipment.
Background
In the prior art, a power station equipment list is mainly acquired through an SQLite database, classification is carried out according to IP addresses and ports of the equipment list, and measuring points are established for the classified equipment and used for measuring the state of each equipment.
In the prior art, if the acquired data volume is large, the more devices needing data transmission are needed, the larger the network pressure is, the abnormity of the acquisition industrial personal computer is caused by the I/O pressure of data processing, the industrial personal computer is crashed due to the consumption of a large amount of hardware resources, and the fixed-frequency acquisition cannot reasonably allocate resources to the devices or the measuring points.
Disclosure of Invention
One of the purposes of the invention is to provide a method and a system for acquiring data of power station equipment, wherein the method and the system are used for comparing and verifying measured point data and then uploading the measured point data, if different data exist, the different data are uploaded, and the same data are not processed, so that the efficiency of uploading the data is improved, and the network pressure can be reduced.
One of the purposes of the invention is to provide a method and a system for acquiring data of power station equipment, wherein the method and the system can set hierarchical data acquisition, the data acquisition frequency of different levels is different, the method and the system can be set according to different power station equipment attributes and acquisition requirements, the total acquisition amount of measured point data is reduced, and the storage pressure and the data uploading pressure of the equipment are reduced.
One of the objectives of the present invention is to provide a method and a system for acquiring data of power station equipment, where the method and the system transfer data of the power station equipment to a disk through a Redis database, and upload the data after data comparison, so that the usage amount of the disk can be increased, buffering is provided during data uploading, the configuration number of hardware equipment for data transmission is reduced, and the cost is saved.
One of the purposes of the invention is to provide a method and a system for acquiring data of power station equipment, wherein the method and the system can give consideration to the timeliness of important data acquisition, reduce the total data acquisition amount and reduce the network pressure of data uploading by acquiring data in a grading way and comparing the acquired data with the data acquired last time.
One of the objectives of the present invention is to provide a method and a system for collecting data of a power station device, where the method and the system verify the reported data after reporting the data, so as to ensure the integrity of data uploading.
In order to achieve at least one of the objects of the present invention, the present invention further provides a method for collecting data of power plant equipment, comprising the steps of:
creating at least one SQLite thread according to the equipment information;
storing the equipment and the measuring point configuration information into an SQLite database;
inquiring the equipment information in the SQLite, and classifying according to the IP and the port information;
creating a thread for each type; acquiring measuring point configuration information in a single thread according to the details of each device;
and collecting the measuring point data, comparing the measuring point data with a Redis database, and selecting whether to store the measuring point data and report the measuring point data according to a comparison result.
According to a preferred embodiment of the present invention, the measurement point data includes telemetry data and telemetry data, the collected telemetry data and telemetry data are converted into binary data, the converted binary data is compared with the Redis database, and if different data exist, different data are stored in the Redis database.
According to a preferred embodiment of the invention, after the device is classified by the IP and the port information, a device measuring point list is established, and the device measuring point list is stored in the SQLite database and is used for inquiring device measuring point data.
According to another preferred embodiment of the invention, different acquisition frequencies are preset according to the classification result of the equipment, address information of the measuring points is obtained, and measuring point data are acquired in a grading manner according to the address information and the preset acquisition frequencies.
According to another preferred embodiment of the invention, the measuring point data is directly collected from the register of the corresponding device CPU according to the obtained measuring point address, the measuring point data is stored in the Redis database, the collected measuring point data is compared with historical data of the Redis database, and if different measuring point data exists, different measuring point data is stored in the Redis database.
According to another preferred embodiment of the invention, after the measuring point data of the equipment is collected, whether the measuring point data is abnormal or not is judged, and if the abnormal data exists, the SQLite thread is reestablished.
According to another preferred embodiment of the invention, the connection status information of the SQLite thread is collected, if the SQLite thread is in the disconnected state, the control device sleeps for 3 seconds, and if the disconnection state exceeds 5 times in an hour, the control device sleeps for 1 hour, and then the SQLite thread is reestablished.
According to another preferred embodiment of the invention, the collection frequency of the measuring points is classified according to the measuring point data attributes, and the collected measuring point data is stored in the Redis database as historical data according to the collection frequency.
According to another preferred embodiment of the invention, the measuring point data collected each time is compared with the detection data collected last time, and if the measuring point data collected each time is different from the measuring point data collected last time, the measuring point data collected this time is stored in the Redis database and used for updating the measuring point data in the Redis database, and the updated measuring point data is uploaded to the remote control center.
According to another preferred embodiment of the invention, the detection data acquired last time is compared with the measurement point data acquired last time each time, and if the detection data is the same as the measurement point data acquired last time, the measurement point data in the Redis database is not updated.
According to another preferred embodiment of the invention, the measuring point data updated each time in the Redis database is uploaded to the remote control center through the Kafka cluster according to the detection frequency of the measuring points.
According to another preferred embodiment of the invention, when receiving the updated measure point data in the Redis database, the Kafka cluster checks the updated measure point data, and if abnormal data exists, the SQLite thread is reestablished.
According to another preferred embodiment of the invention, a data transmission channel is established between the device and the Redis database by adopting a modbus protocol.
In order to achieve at least one of the above objects, the present invention further provides a data collecting system for power station equipment, where the data collecting system adopts the above data collecting method for power station equipment, and the method includes:
the SQLite database is used for storing the equipment and the measuring point configuration information and is used as a data basis for the associated storage and acquisition of the equipment and the measuring point configuration information;
the Redis database is used for caching the reporting frequency of the equipment, the equipment measuring point data and the thread abnormal frequency data;
the judging module is used for judging whether the change of the measuring point data and the acquisition are abnormal or not;
and the data transmission module is used for establishing equipment, a database and a data transmission channel between the database and the remote control center so as to upload the acquired measuring point data and the acquired thread abnormal frequency data to the remote control center.
The SQLite database collects measuring point data from equipment, controls the establishment and cancellation of threads, inputs the measuring point data into a Redis database for storage, and the judgment module collects the measuring point data of the equipment, compares the measuring point data collected each time with the measuring point data collected last time, stores the collected measuring point data if the measuring point data are different from each other, and does not store the measuring point data if the measuring point data are the same.
Drawings
FIG. 1 is a schematic flow chart of a method for data acquisition of power plant equipment according to the present invention;
FIG. 2 is a schematic diagram showing a flow of data in a method for data acquisition of power plant equipment according to the present invention;
FIG. 3 is a schematic view of another data flow diagram of a method for data acquisition of power plant equipment;
fig. 4 is a schematic structural diagram of a data acquisition system of power station equipment.
Detailed Description
The following description is presented to disclose the invention so as to enable any person skilled in the art to practice the invention. The preferred embodiments in the following description are given by way of example only, and other obvious variations will occur to those skilled in the art. The underlying principles of the invention, as defined in the following description, may be applied to other embodiments, variations, modifications, equivalents, and other technical solutions without departing from the spirit and scope of the invention.
It is understood that the terms "a" and "an" should be interpreted as meaning that a number of one element or element is one in one embodiment, while a number of other elements is one in another embodiment, and the terms "a" and "an" should not be interpreted as limiting the number.
Referring to fig. 1-3, the power station device data acquisition system includes an SQLite database, a Redis database, a determination module, and a data transmission module, wherein the SQLite database establishes a thread connected to the device for acquiring real-time working data of the device, and stores device and measurement point configuration information for associated storage of the device and the measurement point configuration information as an acquired data basis; the SQLite database also collects the IP and data ports of the equipment, an equipment measuring point list is established according to the IP and data ports of the equipment, measuring point data of the equipment can be directly inquired through the equipment measuring point list, it needs to be stated that the measuring point data is single data, and the system monitors, updates and uploads the single data.
The Redis database collects the measuring point information of the SQLite database through the data transmission module and stores the measuring point information in the Redis database, and the Redis database is also used for caching the reporting frequency and the thread abnormal frequency data of the equipment. Furthermore, the difference between the current measuring point data and the last measuring point data is judged by the judging module, if the measured point data is different after comparison, the different measuring point data is stored in the Redis database, so that the Redis database is updated, it needs to be explained that the Redis database is taken as a high-performance storage database, can support storage modes such as character strings, linked lists, sets and ordered sets, and the Redis database is cached in a memory, periodically writes updated information into a disk, effectively utilizes disk space, can improve timeliness of data transmission while realizing effective storage, and is particularly suitable for data storage and transmission of power station equipment, and the data transmission module adopts a modbus protocol for connecting the equipment and the SQLite database.
It should be noted that the collected measuring point data includes remote signaling data and remote measuring data, the remote signaling data includes but is not limited to the on-off state of the equipment and the protection state of the protection device, the remote measuring data includes but is not limited to the information of voltage, current, load, frequency, etc. and temperature, etc. on the line, wherein the remote signaling data and the remote sensing data are hexadecimal data, please refer to fig. 3 and 4, the collected remote signaling data and remote sensing data are converted into binary data by a data converter, and comparing the converted data with data in a Redis database, if the same data exists, the same collected data is not processed, if different data exist, different data in the binary data are stored in a Redis database, and the Redis database uploads the updated binary data to a remote control center so as to realize remote transmission of remote signaling data and remote measuring data.
Further, please refer to the schematic structural diagram of the acquisition system shown in fig. 4, the acquisition system is disposed on the data transmission layer, and the lower layer is connected to the devices, each device has a corresponding CPU, the CPU has a plurality of registers therein, the plurality of registers are used for storing the measurement point data, in the measurement point data acquisition process, the acquisition address of the measurement point data is obtained, the measurement point data of the corresponding register is extracted according to the acquisition address of the measurement point, and the extracted measurement point data is compared with the Redis database, so that the acquisition speed of the measurement point is high, and the acquisition and uploading of the measurement point data is facilitated in time. The acquisition system comprises a disk, the acquired measuring point data of each device is stored in a local disk, and the updated data in the disk is uploaded to a remote control center, so that the uploaded data volume is reduced, and the network pressure is reduced.
Further, the system collects the collected measuring point data and the equipment attributes in a grading manner, specifically, distributes a collection frequency according to the collected equipment measuring point data attributes, and distributes a collection frequency for the measuring point data of different equipment, preferably, the collection frequency includes but is not limited to: the method comprises the steps of uninterrupted acquisition, 1-time acquisition in 1 minute, 1-time detection in 5 minutes, and 1-time detection in 15 minutes, and classified acquisition is performed according to different data attributes, for example, data are divided into important data, secondary data and general data according to the attributes, wherein the acquisition frequency of the important data can be set to be 1 minute once, the acquisition frequency of the secondary data is set to be 5 minutes once, and the general data can be set to be 15 minutes once, so that the classified acquisition of the data is realized, the acquisition amount of the data is reduced on the whole, and the storage and uploading pressure of the data is reduced.
The judging module is further used for judging whether the thread is abnormal or not, the judging module receives thread information and judges whether the thread is connected or not, if the thread connection is abnormal, the sleep time of the equipment is controlled for more than 3 seconds, and if the thread connection is abnormal for more than 5 times or 5 times within one hour of the equipment, the equipment is controlled to sleep for 1 hour. When the system judges that the thread is an abnormal thread, the thread is reestablished, the connection between the equipment and the SQLite database is reestablished, the stability of receiving the thread data can be effectively improved by establishing the thread in a restarting mode, and it needs to be explained that the reestablished thread can be a single thread or multiple threads, and can be the restarting of the original thread or the distribution of new threads. It is to be understood that the manner of thread rebuild is not a limitation of the present invention.
The judging module is also used for monitoring whether the measured point data is abnormal or not, and detecting whether the measured point data is abnormal or not after comparing the measured point data with historical data stored in a Redis database, wherein the abnormal data is determined according to a local normal numerical range of the measured point data of the equipment, if the measured point data is not in the set normal numerical range, the measured point data is judged to be abnormal, and an SQLite thread is further reestablished. If the data are in the normal data range, uploading the measuring point data in the Redis database to a remote control center through a Kafka cluster.
It is worth mentioning that, because the measuring point data collected by the sensor on the device is telemetering data, the collected measuring point data is further converted into telemetering data, that is, the numerical data is converted into state data, the converted data is compared with the last measuring point data in the Redis database, if the measuring point data is the same, the Redis database is not updated, and if different measuring point data exists, different measuring point data is stored in the Redis database. Further, the Redis database periodically sends updated data to the control center, and after the judgment module collects the measuring point data and judges that the measuring point data is new data, different measuring point data are uploaded to the remote control center through the Kafka cluster, and the remote control center can be a cloud server.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It will be understood by those skilled in the art that the embodiments of the present invention described above and illustrated in the drawings are given by way of example only and not by way of limitation, the objects of the invention having been fully and effectively achieved, the functional and structural principles of the present invention having been shown and described in the embodiments, and that various changes or modifications may be made in the embodiments of the present invention without departing from such principles.