CN115292002A - Monitoring data acquisition device, method, terminal and storage medium - Google Patents

Monitoring data acquisition device, method, terminal and storage medium Download PDF

Info

Publication number
CN115292002A
CN115292002A CN202210901373.0A CN202210901373A CN115292002A CN 115292002 A CN115292002 A CN 115292002A CN 202210901373 A CN202210901373 A CN 202210901373A CN 115292002 A CN115292002 A CN 115292002A
Authority
CN
China
Prior art keywords
container
application program
preset application
main container
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210901373.0A
Other languages
Chinese (zh)
Inventor
许永贤
吴冠琳
陈哲平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Kecan Information Technology Co ltd
Kehua Data Co Ltd
Original Assignee
Xiamen Kecan Information Technology Co ltd
Kehua Data Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Kecan Information Technology Co ltd, Kehua Data Co Ltd filed Critical Xiamen Kecan Information Technology Co ltd
Priority to CN202210901373.0A priority Critical patent/CN115292002A/en
Publication of CN115292002A publication Critical patent/CN115292002A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a monitoring data acquisition device, a monitoring data acquisition method, a terminal and a storage medium. The device comprises: at least two virtual containers, and a controller for monitoring the at least two virtual containers; preset application programs for polling and collecting monitoring data of the power equipment are configured in the at least two virtual containers, and the at least two virtual containers comprise a main container and at least one slave container; the preset application program in the main container is in a data acquisition state, and the preset application program in at least one slave container is in a standby state; the controller is used for periodically acquiring heartbeat information of the main container; and if the heartbeat information of the main container is not acquired within the preset time period, cutting off the main container, and selecting one slave container from at least one container as a new main container. The invention can timely switch the preset application program of the slave container to carry out data acquisition when the preset application program of the master container is abnormal, thereby effectively avoiding the problem that monitoring data acquisition is forced to be interrupted due to the abnormal application program.

Description

Monitoring data acquisition device, method, terminal and storage medium
Technical Field
The invention relates to the technical field of electronic digital data processing, in particular to a monitoring data acquisition device, a monitoring data acquisition method, a monitoring data acquisition terminal and a storage medium.
Background
In order to ensure the normal operation of the power transformation and distribution system, an electric power monitoring system is usually configured for the power transformation and distribution system correspondingly to monitor the operation state of the power transformation and distribution system in real time. In practical application, a monitoring device in the Power monitoring System accesses a monitored device such as a UPS (Uninterruptible Power System/Uninterruptible Power Supply) through a serial port of the monitoring device, and performs real-time data acquisition on the monitored device, so as to achieve the purpose of monitoring the operating state of the monitored device.
The monitoring data acquisition method takes the problem that the monitoring data acquisition is forced to be interrupted due to possible abnormity of an application program in the monitoring equipment into consideration. Therefore, there is a need for redundant backup to ensure that the data collection function can be implemented even if an application fails or has an error. In the prior art, there are two main ways to implement the above redundancy backup: one method is pure hardware backup, but the backup method requires the monitored equipment to be provided with a plurality of serial ports, and has certain limitation; the other is application backup, namely, a plurality of applications are operated on the same monitoring host, but the method has the problems of difficult program identification and management confusion.
In summary, the above methods cannot effectively solve the problem that monitoring data acquisition is forced to be interrupted when the application program is abnormal.
Disclosure of Invention
The embodiment of the invention provides a monitoring data acquisition device, a monitoring data acquisition method, a terminal and a storage medium, and aims to solve the problem that monitoring data acquisition is forced to be interrupted when an application program in monitoring equipment is abnormal in the prior art.
In a first aspect, an embodiment of the present invention provides a monitoring data acquisition apparatus, where the apparatus is applied to a power monitoring device, and the apparatus includes at least two virtual containers and a controller for monitoring the at least two virtual containers; preset application programs for polling and collecting monitoring data of the power equipment are configured in the at least two virtual containers, and the at least two virtual containers comprise a main container and at least one slave container; the preset application program in the master container is in a data acquisition state, and the preset application program in the at least one slave container is in a standby state;
wherein the controller is to:
periodically acquiring heartbeat information of the main container;
and if the heartbeat information of the main container is not acquired within a preset time period, cutting off the main container, selecting one slave container from the at least one container as a new main container, and acquiring data by using a preset application program in the new main container.
In a possible implementation manner, the controller is further configured to:
periodically acquiring heartbeat information of the at least one slave container;
and selecting any slave container with normal heartbeat information from the at least one container as a new master container.
In one possible implementation, the controller is further configured to:
if the heartbeat information of the main container is not acquired within a preset time length, cutting off the main container from a data interface of a serial port of the power monitoring equipment;
and connecting the new main container to a data interface of the serial port of the power monitoring equipment, so that the preset application program of the new main container is converted from a standby state to a data acquisition state for data acquisition.
In one possible implementation, the controller is further configured to:
restarting the master container to enable a preset application program of the master container to be normal, and determining the master container as a new slave container; and the preset application program of the new slave container is in a standby state.
In a possible implementation manner, the preset application program of the master container and the preset application program of the slave container share one database, and the database is used for storing the collected power equipment monitoring data.
In one possible implementation, the power device monitoring data includes: presetting an ID code of an application program, presetting the sequence number of each acquisition point corresponding to the application program and acquiring data corresponding to each acquisition point;
the controller, after determining a new master container, is further configured to:
and inquiring the latest acquisition point serial number corresponding to acquired data in each preset application program in the database according to the ID code of the preset application program, determining a polling starting point of each preset application program of the new main container according to the next acquisition point serial number of the preset polling sequence, and controlling each preset application program of the new main container to continuously perform polling acquisition according to the determined polling starting point.
In a possible implementation manner, before querying a latest acquisition point serial number corresponding to acquired data in each preset application program in the database, the controller further determines the number of acquisition points corresponding to the preset application program according to the ID code of the preset application program, and when the number of acquisition points corresponding to the preset application program is less than or equal to a preset value, directly takes an initial polling point of the preset polling sequence as a polling starting point of each preset application program of the new main container.
In a second aspect, an embodiment of the present invention provides a monitoring data acquisition method, where the method includes:
acquiring heartbeat information of the main container;
if the heartbeat information of the main container is not acquired within a preset time period, cutting off the main container, and selecting one slave container from the at least one container as a new main container; and the preset application program in the new main container is in a data acquisition state.
In one possible implementation, the method further includes:
periodically acquiring heartbeat information of the at least one slave container;
and selecting any slave container with normal heartbeat information from the at least one container as a new master container.
In one possible implementation, the method further includes:
if the heartbeat information of the main container is not acquired within a preset time length, cutting off the main container from a data interface of a serial port of the power monitoring equipment;
and connecting the new main container to a data interface of the serial port of the power monitoring equipment, so that the preset application program of the new main container is converted from a standby state to a data acquisition state for data acquisition.
In one possible implementation, the method further includes:
restarting the master container to enable a preset application program of the master container to be normal, and determining the master container as a new slave container; the preset application program of the new slave container is in a standby state.
In a possible implementation manner, the preset application program of the master container and the preset application program of the slave container share one database, and the database is used for storing the collected power equipment monitoring data.
In one possible implementation, the power device monitoring data includes: presetting an ID code of an application program, presetting the sequence number of each acquisition point corresponding to the application program and acquiring data corresponding to each acquisition point;
after determining a new primary container, the method further comprises: and inquiring the latest acquisition point serial number corresponding to the acquired data in each preset application program in the database according to the ID code of the preset application program, determining a polling starting point of each preset application program of the new main container according to the next acquisition point serial number of the preset polling sequence, and controlling each preset application program of the new main container to continuously perform polling acquisition according to the determined polling starting point.
In a possible implementation manner, before querying a latest acquisition point serial number corresponding to acquired data in each preset application program in the database, the method further includes:
and determining the number of the acquisition points corresponding to the preset application program according to the ID code of the preset application program, and directly taking the initial polling point of the preset polling sequence as the polling starting point of each preset application program of the new main container when the number of the acquisition points corresponding to the preset application program is less than or equal to the preset value.
In a third aspect, an embodiment of the present invention provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to any one of the possible implementation manners of the second aspect or the second aspect when executing the computer program.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the method according to the second aspect or any possible implementation manner of the second aspect.
The embodiment of the invention provides a monitoring data acquisition device, a monitoring data acquisition method, a terminal and a storage medium, wherein the monitoring data acquisition device is applied to power monitoring equipment and comprises at least two virtual containers and a controller for monitoring the at least two virtual containers; preset application programs for polling and collecting monitoring data of the power equipment are configured in the at least two virtual containers, and the at least two virtual containers comprise a main container and at least one slave container; the preset application program in the main container is in a data acquisition state, and the preset application program in at least one slave container is in a standby state; wherein the controller is configured to: periodically acquiring heartbeat information of the main container; if the heartbeat information of the main container is not acquired within the preset time, cutting off the main container, and selecting one slave container from at least one container as a new main container; the preset application program in the new main container is in a data acquisition state. So, through set up main container and follow the container respectively on same electric power supervisory equipment, and main container and follow the container and be independent operational environment, mutual noninterference. Meanwhile, the controller is also configured and used for monitoring and switching the master container and the slave container in real time, so that the preset application program of the slave container can be switched in time for data acquisition when the preset application program of the master container is abnormal, and the problem that monitoring data acquisition is forced to be interrupted due to the abnormal application program is effectively avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the embodiments or the prior art description will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings may be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic structural diagram of a monitoring data acquisition device according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a monitoring data acquisition device according to another embodiment of the present invention;
fig. 3 is a flowchart illustrating an implementation of a monitoring data collection method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an implementation of a monitoring data collection method according to another embodiment of the present invention;
fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
For avoiding among the prior art electric power supervisory equipment's monitoring data acquisition to interrupt, mainly there are two kinds of modes: one method is to provide a pure hardware backup of a plurality of power monitoring devices, but the backup method requires that the monitored power devices such as a UPS and the like are correspondingly provided with a plurality of serial ports to be respectively connected with the plurality of power monitoring devices, and because the hardware devices are not supported (the monitored power devices such as the UPS and the like are usually provided with only one serial port), the method has certain limitation and is not suitable for practical application; another method is application backup, that is, multiple identical applications are run on the same monitoring device, but this method is complex to deploy in a Linux environment, and even if the identical applications are run, parameters such as internal package names of the applications need to be set to be different, which results in that when the applications are run at a later stage, it is not beneficial to identify and manage the main program and the backup program, and especially when the types of the applications are many, a restart error is likely to be caused. In addition, when the backup application program is switched, the power monitoring equipment needs to be restarted, so that the time is long, and the switching efficiency is slow. Therefore, the problem that monitoring data collection is forced to be interrupted still cannot be effectively solved in the prior art.
In order to solve the problems in the prior art, embodiments of the present invention provide a monitoring data acquisition device, a monitoring data acquisition method, a terminal, and a storage medium. In order to make the objects, technical solutions and advantages of the present invention more apparent, the following description is made by way of specific embodiments with reference to the accompanying drawings.
Fig. 1 is a schematic structural diagram of a monitoring data acquisition device according to an embodiment of the present invention, which is detailed as follows:
this monitoring data collection system 1 is applied to power monitoring equipment, and this device 1 includes: at least two virtual containers, and a controller 11 for monitoring the at least two virtual containers. At least two virtual containers are respectively provided with a preset application program for polling and collecting monitoring data of the power equipment, and each virtual container comprises a master container 12 and at least one slave container 13. In addition, the preset application program in the master container 12 is in a data collection state, and the preset application program in at least one slave container 13 is in a standby state.
Specifically, the controller 11 is configured to periodically acquire heartbeat information of the main container 12. If the heartbeat information of the main container 12 is not acquired within the preset time period, the main container 12 is cut off, one slave container is selected from at least one slave container 13 to serve as a new main container, and data collection is carried out by using a preset application program in the new main container.
In some embodiments, at least two Docker containers, i.e., the above-described at least two virtual containers, may be built on the same power monitoring device using Docker (application container engine) technology. The main container 12 is connected to a data interface of a serial port of the power monitoring device, and is used for collecting monitoring data.
It will be appreciated that within a container, the applications that serve the same data collection role are unique. In the prior art of application backup, a plurality of applications that perform the same data collection function are configured in a monitoring host.
In some embodiments, the controller 11 may determine whether the preset application program of the main container 12 belongs to a normal operation state by periodically acquiring the heartbeat information of the main container.
It should be noted that the normal operation state may include a data collection state and a standby state. For the main container 12, the normal operating state refers to a data collection state; the normal operating state refers to a standby state for the slave container 13. Because the main container 12 is connected to the data interface of the serial port of the power monitoring device, the preset application program of the main container 12 can perform data acquisition through the serial port of the power monitoring device. Thus, the preset application program of the main container 12 is in a data acquisition state during normal operation; however, the slave container 13 is not connected to the data interface of the serial port of the power monitoring device, so that the preset application program of the slave container 13 cannot perform data acquisition, and the normal running state of the preset application program of the slave container 13 is an idle running state, that is, a standby state.
Illustratively, the heartbeat mechanism may be preset in a preset application program of the main container 12, so that the preset application program of the main container 12 periodically sends heartbeat packets to the controller 11. The controller 11 acquires the heartbeat information of the main container by periodically receiving the heartbeat packet. If the controller 11 acquires the heartbeat information within a preset time length, determining that the preset application program of the main container 12 belongs to a normal operation state; the controller 11 determines that the preset application program of the main container 12 is abnormally operated if the heartbeat information of the main container 12 is not acquired within a preset time period.
It is understood that the preset time length corresponds to a transmission period of the heartbeat packet. For example, the preset application of the main container 12 sends a heartbeat packet every 3 seconds, and accordingly, the preset duration is also set to 3 seconds. The controller 11 determines that the preset application of the main container 12 is abnormally operated if the heartbeat information of the main container 12 is not acquired within 3 seconds.
Optionally, the controller 11 is further configured to cut off the main container when the heartbeat information of the main container is not acquired within the preset time period, and the specific processing may be as follows: if the heartbeat information of the main container is not obtained within the preset time period, the controller 11 cuts off the main container from a data interface of the serial port of the power monitoring equipment.
Specifically, if the heartbeat information of the current main container 12 is not obtained within the preset time period, the controller 11 determines that the preset application program of the current main container 12 runs abnormally. The controller 11 cuts off the current main container 12 from the data interface of the serial port of the power monitoring device, so as to facilitate the subsequent access of a new main container.
Optionally, the controller 11 is further configured to periodically obtain heartbeat information of at least one slave container 13.
Accordingly, when the controller 11 selects one slave container 13 from the at least one slave container 13 as a new master container, the specific processing is as follows:
the controller 11 selects any one of the slave containers 13 for which the heartbeat information is normal as a new master container.
Similarly, the heartbeat mechanism is also preset in at least one preset application of the slave container 13, so that the heartbeat packet is periodically sent to the controller 11 from the preset application of the slave container 13. The controller 11 acquires the heartbeat information of the slave container 13 by periodically receiving the heartbeat packet, thereby determining the running state of the preset application program of the slave container 13.
When the controller 11 determines that the preset application program of the master container 13 is abnormally operated, and cuts off the master container 13, the controller 11 selects any one of the slave containers in a normal operation state from at least one of the slave containers as a new master container.
Further, the controller 11 is further configured to connect the new main container to a data interface of the serial port of the power monitoring device, so that the preset application program of the new main container is converted from the standby state to a data collection state for data collection.
It should be noted that the preset application program of the slave container 13 is actually in the idle running state, i.e., the standby state described above. When the slave container 13 is connected to the data interface of the serial port of the monitoring device and determined as a new master container, the preset application program of the new master container directly performs data acquisition through the serial port of the power monitoring device and converts the data acquisition state into a data acquisition state, so that the problem of monitoring data acquisition interruption is avoided.
Through setting up main container 12 and at least one from container 13 for when the application appears unusually predetermineeing of main container 12, only through the data interface connection state who switches the power monitoring equipment serial ports, can realize predetermineeing the backup switching of application, improved switching efficiency greatly, avoided the problem that monitoring data acquisition interrupted. In addition, the same preset application programs are respectively preset in different containers, so that the same preset application programs are all in independent operation environments, the isolation between the programs is higher, and the program management and the program identification are facilitated.
Optionally, referring to fig. 2, the preset application program of the master container and the preset application program of the slave container share a database, and the database is used for storing the collected power equipment monitoring data.
In practical applications, the data collected by monitoring the power equipment may include various types, for example: voltage, current, temperature, etc. Different classes of data require different pre-set applications for acquisition. Therefore, the same container may contain a plurality of preset applications for acquiring data of different types, and accordingly, each preset application may also correspond to a plurality of acquisition points, and perform polling acquisition on the acquisition points according to a preset polling sequence. For convenience of management, different ID codes may be preset for each preset application, and corresponding serial numbers are preset for each acquisition point in the same preset application according to a preset polling sequence. In this regard, the electrical equipment monitoring data stored in the database correspondingly includes: the method comprises the steps of presetting an ID code of an application program, presetting the corresponding sequence number of each acquisition point in the application program and acquiring data corresponding to each acquisition point.
The monitoring data of the power equipment is stored by sharing one database, so that the situation that the whole historical collected data is lost due to hanging of the running preset application program can be effectively avoided, and the safety of data storage is improved. Meanwhile, the acquired data is correspondingly stored according to the ID code of the preset application program and the serial number of each acquisition point, so that subsequent data management and data query are facilitated.
Optionally, after determining the new main container, and before connecting the new main container to the data interface of the serial port of the power monitoring device, the controller 11 is further configured to:
and inquiring the latest acquisition point serial number corresponding to the acquired data in each preset application program in the database according to the ID code of the preset application program, determining a polling starting point of each preset application program of the new main container according to the next acquisition point serial number of the preset polling sequence, and controlling each preset application program of the new main container to continuously perform polling acquisition according to the determined polling starting point.
Before switching the data interface, the controller 11 queries in advance the latest acquisition point serial number in which the acquisition data is already stored in each preset application program in the database, and determines the acquisition point serial number next to the acquisition point serial number as the polling start point of each preset application program of the new main container.
And after the new main container is connected to the data interface of the serial port of the power monitoring equipment, each preset application program continuously acquires data according to the determined polling starting point.
The controller 11 determines the polling start point of each preset program in the new main container according to the latest acquisition point sequence number in each preset application program in the database, so that the problem of polling timeliness caused by too many acquisition points, namely the problem of data loss caused by incapability of timely polling the terminal acquisition point can be effectively avoided.
Optionally, before the controller 11 queries the latest acquisition point serial number corresponding to the acquired data in each preset application program in the database, the controller 11 is further configured to:
and determining the number of corresponding acquisition points in the preset application program according to the ID code of the preset application program, and when the number of the corresponding acquisition points in the preset application program is less than or equal to the preset value, directly taking the initial polling points in the preset polling sequence as the polling starting points of all the preset application programs of the new main container.
In essence, when the number of corresponding collection points in the preset application is smaller than or equal to the preset value, the time for completing one polling of the preset application is also greatly shortened. Therefore, the controller 11 can directly use the initial polling point of the preset polling sequence as the polling start point of the preset application of the new master container without querying the database.
The preset value can be set by the user according to the acquisition requirement, and the invention is not limited in this respect.
Illustratively, the main container contains 2 preset applications (whose ID codes are 001 and 002, respectively) for collecting voltage data and current data, wherein the preset application 001 corresponds to 5 voltage collection points, the preset application 002 corresponds to 20 current collection points, and the preset value is set to 10. After the controller 11 determines a new main container, the controller 11 only needs to query the preset application program 002 in the database that corresponds to the collected data as the 19 th current collecting point, and use the 20 th current collecting point as the polling starting point of the preset application program 002, and at the same time, determine the 1 st voltage collecting point as the polling starting point of the preset application program 001. After the new main container is connected to the data interface of the serial port of the power monitoring equipment, the preset application program 001 performs polling collection again from the 1 st voltage collection point, and the preset application program 002 continues to perform polling collection from the 20 th current collection point.
Optionally, after the switching is completed, the controller 11 is further configured to restart the master container 12, so that the preset application program of the master container 12 is recovered to be normal, and the master container 12 is determined as a new slave container; the preset application of the new slave container is in a standby state.
After the new master container performs data acquisition, the controller 11 restarts the previous abnormal master container, so that the preset application program of the master container is restored to a normal operation state. At this time, the main container is not connected with the data interface of the serial port of the monitoring device, and data acquisition cannot be performed, so that the preset application program of the main container is in a standby state, and the main container is determined as a new slave container, so that next switching is facilitated.
The embodiment of the invention discloses a monitoring data acquisition device, which comprises: at least two virtual containers, and a controller for monitoring the at least two virtual containers; preset application programs for polling and collecting monitoring data of the power equipment are configured in the at least two virtual containers, and the at least two virtual containers comprise a main container and at least one slave container; the preset application program in the master container is in a data acquisition state, and the preset application program in at least one slave container is in a standby state; wherein the controller is configured to: periodically acquiring heartbeat information of the main container; if the heartbeat information of the main container is not acquired within a preset time period, cutting off the main container, and selecting one slave container from at least one container as a new main container; the preset application program in the new main container is in a data acquisition state.
So, through set up main container and follow the container respectively on same electric power supervisory equipment, and main container and follow the container and be independent operational environment, mutual noninterference. Meanwhile, the configuration controller is used for monitoring and switching the master container and the slave container in real time, so that when the preset application program of the master container is abnormal, the preset application program of the slave container can be switched in time for data acquisition, and the problem that monitoring data acquisition is forced to be interrupted due to the abnormal application program is effectively avoided. Meanwhile, the application program switching is realized by switching the data interface of the serial port of the power monitoring equipment, so that the program switching stability is higher, the power monitoring equipment does not need to be restarted, and the switching efficiency is high. In addition, compared with the existing application program backup scheme, the scheme is more convenient to deploy in a Linux environment, and the same application program does not need to be operated in the same operation environment, so that the problems of complex program identification and disordered program management are solved.
Furthermore, after the new main container is determined, the controller queries the latest acquisition point sequence number corresponding to the acquired data in each preset application program in the database according to the ID code of the preset application program to determine the polling starting point of each preset application program of the new main container, thereby effectively avoiding the problem of polling timeliness.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not limit the implementation process of the embodiments of the present invention in any way.
The following are embodiments of the apparatus of the invention, reference being made to the corresponding method embodiments described above for details which are not described in detail therein.
Fig. 3 shows a flowchart of an implementation of the monitoring data acquisition method provided by the embodiment of the present invention, and for convenience of description, only the relevant parts related to the embodiment of the present invention are shown, which are detailed as follows:
the monitoring data acquisition method is applied to monitoring equipment provided with at least two virtual containers, preset application programs used for polling and acquiring monitoring data of the power equipment are arranged in the at least two virtual containers, the at least two virtual containers comprise a main container and at least one slave container, the preset application program of the main container is in a data acquisition state, and the preset application program of the at least one slave container is in a standby state. The method comprises the following steps:
step 301, periodically obtaining heartbeat information of the main container.
Step 302, if the heartbeat information of the main container is not received within the preset time length, the main container is cut off, one slave container is selected from at least one container to serve as a new main container, and data collection is carried out by using a preset application program in the new main container.
Optionally, in step 302, "if the heartbeat information of the main container is not obtained within the preset time period, the main container is cut off", and the specific processing may be as follows: and if the heartbeat information of the main container is not acquired within the preset time, cutting off the main container from a data interface of the serial port of the power monitoring equipment.
Optionally, referring to fig. 4, before step 302, the method further includes:
in step 303, heartbeat information of at least one slave container is periodically acquired.
Accordingly, the "selecting a slave container from at least one container as a new master container" in step 302 includes:
and selecting any slave container with normal heartbeat information from at least one container as a new master container.
When the preset application program of the main container is determined to be abnormal in operation, after the main container is cut off, any one of the slave containers in the normal operation state is selected from at least one container to serve as a new main container.
Optionally, the "performing data collection by using the preset application program of the new main container" in step 302 may specifically include:
and connecting the new main container to a data interface of the serial port of the monitoring equipment, so that the preset application program of the new main container is converted from a standby state to a data acquisition state for data acquisition.
Through setting up main container and at least one from the container for when the application appears unusually in presetting of main container, only through the data interface connection state of switching supervisory equipment serial ports, can realize presetting the backup switching of application, improved switching efficiency greatly, avoided the problem that control data acquisition interrupted. In addition, the preset application programs are respectively preset in different containers, so that the preset application programs are in independent operation environments, the isolation between the programs is higher, and the program management and the program identification are facilitated.
Optionally, the preset application program of the master container and the preset application program of the slave container share a database, and the database is used for storing the acquired data.
The power equipment monitoring data stored by the database comprises: the method comprises the steps of presetting an ID code of an application program, presetting the corresponding sequence number of each acquisition point in the application program and acquiring data corresponding to each acquisition point.
The collected data are stored by sharing one database, so that the condition that the whole historical collected data is lost due to the fact that the running preset application program is hung can be effectively avoided, and the safety of data storage is improved. Meanwhile, the acquired data is correspondingly stored according to the ID code of the preset application program and the serial number of each acquisition point, so that subsequent data management and data query are facilitated.
Optionally, after determining the new main container, and before connecting the new main container to the data interface of the serial port of the power monitoring device, step 302 further includes:
and inquiring the latest acquisition point serial number corresponding to acquired data in each preset application program in the database according to the ID code of the preset application program, determining a polling starting point of each preset application program of the new main container according to the next acquisition point serial number of the preset polling sequence, and controlling each preset application program of the new main container to continuously perform polling acquisition according to the determined polling starting point.
Optionally, before querying the latest collection point serial number corresponding to the collected data in each preset application program in the database, step 302 further includes:
and determining the number of corresponding acquisition points in the preset application program according to the ID code of the preset application program, and when the number of the corresponding acquisition points in the preset application program is less than or equal to the preset value, directly taking the initial polling points in the preset polling sequence as the polling starting points of all the preset application programs of the new main container.
Optionally, after step 302, the method further includes:
step 304, restarting the master container to enable the preset application program of the master container to be normal, and determining the master container as a new slave container; the preset application of the new slave container is in a standby state.
And after the new main container is subjected to data acquisition, restarting the abnormal main container, so that the preset application program of the main container is recovered to a normal running state. At this time, the master container is not connected to the data interface of the serial port of the monitoring device, and data collection cannot be performed, so that the preset application program of the master container is in a standby state, and the master container is determined as a new slave container, so as to facilitate next switching.
The embodiment of the invention periodically acquires the heartbeat information of the main container; and if the heartbeat information of the main container is not acquired within the preset time length, cutting off the main container, selecting one slave container from at least one container as a new main container, and acquiring data by using a preset application program of the new main container. Therefore, when the preset application program of the main container is abnormal, the preset application program of the slave container can be switched in time to carry out data acquisition, and the problem that monitoring data acquisition is forced to be interrupted due to the abnormal application program is effectively avoided. Meanwhile, the application program switching is realized by switching the data interface of the serial port of the power monitoring equipment, so that the program switching stability is higher, the monitoring equipment does not need to be restarted, and the switching efficiency is high. In addition, compared with the existing application program backup scheme, the scheme is more convenient to deploy in a Linux environment, and the same application program does not need to be operated in the same operation environment, so that the problems of complex program identification and disordered program management are solved.
Furthermore, after the new main container is determined, the latest acquisition point serial numbers corresponding to the acquired data in each preset application program in the database are inquired according to the ID code of the preset application program, so as to determine the polling starting point of each preset application program of the new main container, thereby effectively avoiding the problem of polling timeliness.
Fig. 5 is a schematic diagram of a terminal according to an embodiment of the present invention. As shown in fig. 5, the terminal 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processor 50. The processor 50 executes the computer program 52 to implement the steps of the above embodiments of the monitoring data collecting method, such as steps 301 to 302 shown in fig. 3. Alternatively, the processor 50 implements the functions of the modules/units in the above device embodiments when executing the computer program 52.
Illustratively, the computer program 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 52 in the terminal 5.
The terminal 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal 5 may include, but is not limited to, a processor 50, a memory 51. It will be appreciated by those skilled in the art that fig. 5 is merely an example of a terminal 5 and does not constitute a limitation of the terminal 5, and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal may also include input output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal 5, such as a hard disk or a memory of the terminal 5. The memory 51 may also be an external storage device of the terminal 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the terminal 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal. The memory 51 may also be used to temporarily store data that has been output or is to be output.
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module/unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the method according to the above embodiments may also be implemented by instructing relevant hardware by a computer program, where the computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above embodiments of the monitoring data acquisition method may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A monitoring data acquisition device is applied to power monitoring equipment, and comprises at least two virtual containers and a controller for monitoring the at least two virtual containers; preset application programs for polling and collecting monitoring data of the power equipment are configured in the at least two virtual containers, and the at least two virtual containers comprise a main container and at least one slave container; the preset application program in the main container is in a data acquisition state, and the preset application program in the at least one slave container is in a standby state;
wherein the controller is to:
periodically acquiring heartbeat information of the main container;
and if the heartbeat information of the main container is not acquired within a preset time period, cutting off the main container, selecting one slave container from the at least one container as a new main container, and acquiring data by using a preset application program in the new main container.
2. The monitoring data acquisition device of claim 1, wherein the controller is further configured to:
periodically acquiring heartbeat information of the at least one slave container;
and selecting any slave container with normal heartbeat information from the at least one container as a new master container.
3. The monitoring data acquisition device of claim 1 or 2, wherein the controller is further configured to:
if the heartbeat information of the main container is not acquired within a preset time length, cutting off the main container from a data interface of a serial port of the power monitoring equipment;
and connecting the new main container to a data interface of the serial port of the power monitoring equipment, so that the preset application program of the new main container is converted from a standby state to a data acquisition state for data acquisition.
4. The monitoring data acquisition device of claim 1, wherein the controller is further configured to:
restarting the master container to enable a preset application program of the master container to be normal, and determining the master container as a new slave container; and the preset application program of the new slave container is in a standby state.
5. The monitoring data acquisition device according to claim 1, wherein the preset application program of the master container and the preset application program of the slave container share a database, and the database is used for storing the acquired monitoring data of the electrical equipment.
6. The monitoring data collection device of claim 5, wherein the power equipment monitoring data comprises: presetting an ID code of an application program, presetting corresponding acquisition point serial numbers in the application program and acquiring data corresponding to the acquisition points;
the controller, after determining a new master container, is further configured to:
and inquiring the latest acquisition point serial number corresponding to the acquired data in each preset application program in the database according to the ID code of the preset application program, determining a polling starting point of each preset application program of the new main container according to the next acquisition point serial number of the preset polling sequence, and controlling each preset application program of the new main container to continuously perform polling acquisition according to the determined polling starting point.
7. The monitoring data acquisition device according to claim 6, wherein before querying a latest acquisition point serial number corresponding to acquired data in each preset application program in the database, the controller further determines the number of corresponding acquisition points in the preset application program according to the ID code of the preset application program, and when the number of corresponding acquisition points in the preset application program is less than or equal to a preset value, directly uses the initial polling point in the preset polling sequence as a polling start point of each preset application program of the new main container.
8. A monitoring data acquisition method applied to a monitoring data acquisition apparatus according to any one of claims 1 to 7, the method comprising:
acquiring heartbeat information of the main container;
if the heartbeat information of the main container is not acquired within a preset time period, cutting off the main container, and selecting one slave container from the at least one container as a new main container; and the preset application program in the new main container is in a data acquisition state.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method as claimed in claim 8 above are implemented when the processor executes the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method as set forth in claim 8 above.
CN202210901373.0A 2022-07-28 2022-07-28 Monitoring data acquisition device, method, terminal and storage medium Pending CN115292002A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210901373.0A CN115292002A (en) 2022-07-28 2022-07-28 Monitoring data acquisition device, method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210901373.0A CN115292002A (en) 2022-07-28 2022-07-28 Monitoring data acquisition device, method, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN115292002A true CN115292002A (en) 2022-11-04

Family

ID=83823477

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210901373.0A Pending CN115292002A (en) 2022-07-28 2022-07-28 Monitoring data acquisition device, method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115292002A (en)

Similar Documents

Publication Publication Date Title
CN112685236A (en) Dual-computer mutual backup method and system of data management system
CN107832169B (en) Memory data migration method and device, terminal equipment and storage medium
CN112698989B (en) Dual-computer mutual backup method and system of data acquisition system
CN104485748B (en) A kind of transformer station ups power monitoring system and method
CN111611254A (en) Equipment energy consumption abnormity monitoring method and device, terminal equipment and storage medium
CN114827088A (en) Address assignment system, method, electronic device, storage medium, and program product
CN113645048B (en) Network card switching method and device and field programmable gate array FPGA
CN105677589A (en) Access control method, access control device and access control system
CN113434184A (en) Equipment upgrading method and device, storage medium and electronic device
CN115292002A (en) Monitoring data acquisition device, method, terminal and storage medium
CN111611255B (en) Equipment energy consumption energy-saving management method and device, terminal equipment and storage medium
CN113765690A (en) Cluster switching method, system, device, terminal, server and storage medium
CN113038299A (en) Switch, configuration method, control method and storage medium
CN115599311B (en) Polarity inversion method and apparatus, storage medium, and electronic apparatus
CN105843336B (en) Cabinet and its firmware updating method with more cabinet management modules
CN111162938A (en) Data processing system and method
CN114124803B (en) Device management method and device, electronic device and storage medium
CN114563945A (en) Controller redundancy switching method based on virtualization technology
CN115629936A (en) Method and device for acquiring equipment information and computer readable storage medium
CN115225464A (en) Network switching method, device, equipment and storage medium
CN113849135A (en) Log access method and device and server
CN112187937A (en) Method and device for removing pairing, terminal equipment and storage medium
CN111585794B (en) Communication method, device and system based on acquisition board card and storage medium
CN114969149B (en) Data resource processing method, device and storage medium
CN115086164B (en) Policy issuing method, system, device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination