Example 1:
fig. 1 shows a flowchart of an implementation of a data polling method according to an embodiment of the present invention, and for convenience of description, only the relevant portions of the embodiment of the present invention are shown, and the following details are described below:
s101: sending a polling instruction set to monitored equipment according to a first polling period, wherein the polling instruction set is used for indicating the monitored equipment to return data corresponding to each measuring point group, and the data comprises at least one group of analog data; the polling instruction set comprises at least one analog polling instruction; each analog polling instruction corresponds to an analog polling period.
The execution subject of this embodiment may include a monitoring server or a monitoring terminal, and the following explanation takes the monitoring terminal as an example. The monitored equipment may include, but is not limited to, UPSs (uninterruptible power supplies), energy storage devices, and other equipment that generates analog quantities.
In this embodiment, when data polling is performed on the monitored equipment for the first time, the terminal equipment sends a polling instruction set to the monitored equipment according to a fixed first polling period, where the polling instruction set includes at least one analog polling instruction and at least one state polling instruction, and each analog polling instruction carries an identification number of a corresponding group of analog measurement points, and is used to query analog data of the group of analog measurement points in the monitored equipment; each state quantity polling instruction carries the identification number of a corresponding group of state measurement points and is used for inquiring the state data of a group of state measurement points in the monitored equipment. The measuring point group of the analog quantity comprises at least one measuring point, and each measuring point detects one analog quantity; a state quantity measuring point group includes at least one measuring point, and each measuring point detects a state quantity. And there is a correlation between each measurement point in one analog quantity measurement point group, for example, the measurement points queried by the same analog quantity polling command are all output voltage related measurement points of the device.
Illustratively, the polling instruction set comprises four analog quantity polling instructions and one strip state quantity polling instruction, wherein one analog quantity polling instruction corresponds to the inquiry of analog data of ten measuring points, and one strip state quantity polling instruction corresponds to the inquiry of state data of ten measuring points. Then the simulation data for forty stations and the status data for ten stations are queried for each first polling cycle.
In this embodiment, the analog data may include, but is not limited to, analog quantities such as voltage, current, power, and the like, and the status data may include, but is not limited to, states such as switch status, normal, abnormal, and alarm.
S102: and acquiring the simulation data of the measuring point group corresponding to each analog quantity polling instruction sent by the monitored equipment.
S103: and updating the analog polling period corresponding to the first analog polling instruction according to the analog data of the measuring point group corresponding to the first analog polling instruction, wherein the first analog polling instruction is any one analog polling instruction.
In this embodiment, since there is a correlation between a set of measurement points, the data change thereof usually has a similar rule, and therefore, the average value of the analog data change amounts of two analog polling periods before and after each measurement point in a set of measurement points can be taken to determine whether to update the analog polling period corresponding to the analog data.
Specifically, at the beginning of data polling, the analog polling period and the state polling period are the same as the first polling period, if the change amplitude of the analog data of the first analog polling instruction in the current analog polling period and the previously acquired analog data is within the preset amplitude range, the analog polling period of the analog polling instruction is kept unchanged, and if the change amplitude of the analog data of the analog polling instruction is smaller than the minimum value of the preset amplitude range, the analog polling period corresponding to the analog polling instruction is prolonged, so that the terminal device acquires less analog data of the test point group corresponding to the analog polling instruction, thereby reducing the acquisition of unnecessary data and improving the data polling efficiency. If the variation amplitude of the analog data corresponding to the analog quantity polling instruction is larger than the maximum value of the preset amplitude range, the analog data corresponding to the analog quantity polling instruction is changed faster, so that the analog quantity polling period of the test point group corresponding to the first analog quantity polling instruction can be shortened, and the timely effectiveness of data polling is ensured.
According to the embodiments, by the scheme, each analog polling period can be dynamically adjusted according to the test point analog data corresponding to each analog polling instruction, so that the timeliness of data polling is improved.
In an embodiment, as shown in fig. 2, fig. 2 shows a specific implementation flow of S103 in fig. 1, which includes:
s201: taking the difference value between the simulation data of the first measuring point corresponding to the first analog quantity polling instruction in the current analog quantity polling period and the simulation data of the previous analog quantity polling period as a first difference value, wherein the first measuring point is any measuring point in the measuring point group corresponding to the first analog quantity polling instruction;
s202: averaging first difference values of all measuring points corresponding to the first analog quantity polling instruction to obtain a first difference value average value;
s203: and if the first difference average value is smaller than a first preset difference threshold value, prolonging the analog quantity polling period corresponding to the first analog quantity polling instruction.
S204: and if the first difference average value is larger than a second preset difference threshold value, shortening the analog quantity polling period corresponding to the first analog quantity polling instruction.
In this embodiment, the specific implementation flow of S202 in fig. 2 includes:
and if the first difference average value is smaller than a first preset difference threshold value, updating the next analog polling period of the first analog polling instruction to be a multiple of the analog polling period.
In this embodiment, after determining that the first difference average value is smaller than the first preset difference threshold, the next analog polling period corresponding to the first analog polling command may be updated to be a multiple of the initial analog polling period. In the next analog polling period, if the first difference value is detected to be greater than or equal to a first preset difference threshold value and smaller than a second preset difference threshold value, adjusting the next analog polling period corresponding to the first analog polling instruction back to the initial analog polling period.
For example, it is assumed that when the first difference value is smaller than the first preset difference threshold, the next analog polling cycle of the first analog polling instruction is updated to be 2 times of the current analog polling cycle, that is, the query of the corresponding station group of the next analog polling instruction is skipped. If the query time corresponding to each analog quantity polling instruction and each state quantity polling instruction is 5 seconds, the total polling time required by the four analog quantity polling instructions and the 1 state quantity polling instruction is 25 seconds, and when the next polling period skips the polling of a point corresponding to the first analog quantity polling instruction, the polling time of the next polling period can be shortened to 20 seconds.
In an embodiment, as shown in fig. 3, fig. 3 shows another specific implementation flow of S103 in fig. 1, which includes:
s301: inputting simulation data and historical simulation data corresponding to the test point group corresponding to the first analog quantity polling instruction in the current analog quantity polling period into a preset learning model, and outputting prediction simulation data of the test point group corresponding to the first analog quantity polling instruction in the next analog quantity polling period;
s302: and updating the analog quantity polling period of the first analog quantity polling instruction according to the predicted analog data corresponding to the measuring point group corresponding to the first analog quantity polling instruction in the next analog quantity polling period and the analog data corresponding to the current analog quantity polling period.
In this embodiment, historical simulation data may also be acquired as training samples to train the preset learning model. After the preset learning model is trained, the monitoring terminal can determine the predicted analog data of the test point group corresponding to the first data polling instruction in the next analog polling period according to the analog data and the historical analog data corresponding to the first data polling instruction in the current polling period, so that the next analog polling period of the first data polling instruction is updated according to the analog data of the current analog polling period and the predicted analog data of the next analog polling period.
In one embodiment, as shown in fig. 4, fig. 4 shows a specific implementation flow of S302 in fig. 3, and the process thereof is detailed as follows:
s401: taking the difference value between the predicted analog data of the first measuring point corresponding to the first analog polling instruction in the next analog polling period and the analog data corresponding to the current analog polling period as a second difference value; the first measuring point is any measuring point in the measuring point group corresponding to the first analog quantity polling instruction;
s402: averaging second difference values of the measuring points corresponding to the first analog quantity polling instruction to obtain a second difference value average value;
s403: and if the second difference average value is smaller than a first preset difference threshold value, prolonging the analog quantity polling period corresponding to the first analog quantity polling instruction.
Specifically, after determining that the second difference average value is smaller than the first preset difference threshold, the next analog polling cycle corresponding to the first analog polling command may be updated to be a multiple of the initial analog polling cycle.
Furthermore, in the next analog polling period, if it is detected that the second difference average value is greater than the first preset difference threshold and less than the second preset difference threshold, the next analog polling period corresponding to the first analog polling command is updated to the initial analog polling period.
In one embodiment, another specific implementation flow of S103 in fig. 1 includes:
counting the number of the test points of the simulation data in the test point group corresponding to the first analog polling instruction within a preset data range in the current analog polling period, and if the number is larger than the preset number, prolonging the analog polling period corresponding to the first analog polling instruction.
In this embodiment, the preset data range may be set as a range of data of the station during normal operation, and when the simulation data is within the normal range, the polling period of the analog quantity of the corresponding station may be appropriately extended. And because a group of measuring points corresponds to an analog quantity polling instruction, counting the number of the measuring points of which the data is in the normal range in the measuring point group, and prolonging the analog quantity polling period corresponding to the first analog quantity polling instruction when the counted number is greater than the preset number.
In one embodiment, the polling command further includes a state quantity polling command, the data further includes at least one set of state data, and step S101 in fig. 1 further includes: and sending a state quantity polling instruction to the monitored equipment according to a first polling period so as to enable the monitored equipment to return state data of the corresponding station group.
In this embodiment, the status quantity represents the status of a certain measuring point of the monitored equipment, including but not limited to on-off status, normal, abnormal, alarm, and the like.
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 its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
As shown in fig. 5, a data polling apparatus 100 according to an embodiment of the present invention is configured to execute the method steps in the embodiment corresponding to fig. 1, and includes:
a polling instruction sending module 110, configured to send a polling instruction set to the monitored equipment according to a first polling period, where the polling instruction set is used to instruct the monitored equipment to return data corresponding to each measurement point group, where the data includes at least one group of analog data; the polling instruction set comprises at least one analog polling instruction; each analog quantity polling instruction corresponds to an analog quantity polling period;
the analog data acquisition module 120 is configured to acquire analog data of the measurement point group corresponding to each analog quantity polling instruction sent by the monitored equipment;
and the analog polling cycle updating module 130 is configured to update the analog polling cycle corresponding to the first analog polling instruction according to the analog data of the measurement point group corresponding to the first analog polling instruction, where the first analog polling instruction is any analog polling instruction.
In an embodiment of the present invention, the analog polling period updating module 130 further includes:
a first difference value calculating unit, configured to use a difference value between simulated data of a current analog polling period and simulated data of a previous analog polling period at a first test point corresponding to the first analog polling instruction as a first difference value, where the first test point is any one test point in a test point group corresponding to the first analog polling instruction;
the first difference average value calculating unit is used for averaging the first differences of the measuring points corresponding to the first analog quantity polling instruction to obtain a first difference average value;
the first period updating unit is used for prolonging the analog quantity polling period corresponding to the first analog quantity polling instruction if the first difference average value is smaller than a first preset difference threshold value;
and the second period updating unit is used for shortening the analog quantity polling period corresponding to the first analog quantity polling command if the first difference average value is greater than a second preset difference threshold value.
In one embodiment, the first period updating unit includes: and if the first difference average value is smaller than a first preset difference threshold value, updating the next analog polling period of the first analog polling instruction to be a multiple of the analog polling period.
In one embodiment, the analog polling period updating module 130 further includes:
the prediction simulation data acquisition unit is used for inputting simulation data corresponding to the test point group corresponding to the first analog quantity polling instruction in a current analog quantity polling period and historical simulation data into a preset learning model and outputting prediction simulation data of the test point group corresponding to the first analog quantity polling instruction in a next analog quantity polling period;
and the third period updating unit is used for updating the analog polling period of the first analog polling instruction according to the predicted analog data corresponding to the test point group corresponding to the first analog polling instruction in the next analog polling period and the analog data corresponding to the current analog polling period.
In one embodiment of the present invention, the third periodic updating unit further includes:
the second difference value calculating subunit is configured to use a difference value between predicted analog data of the first measurement point corresponding to the first analog polling instruction in the next analog polling period and analog data corresponding to the current analog polling period as a second difference value; the first measuring point is any measuring point in the measuring point group corresponding to the first analog quantity polling instruction;
the second difference average value operator unit is used for averaging second differences of all measuring points corresponding to the first analog quantity polling instruction to obtain a second difference average value;
and the third period updating subunit is configured to, if the second difference average value is smaller than a first preset difference threshold, extend the analog polling period corresponding to the first analog polling instruction.
In an embodiment, the analog polling period updating module 130 further includes counting the number of the test points of the simulated data in the test point group corresponding to the first analog polling instruction in a preset data range in the current analog polling period, and if the number is greater than a preset number, extending the analog polling period corresponding to the first analog polling instruction.
In one embodiment of the invention, the polling command further comprises a state quantity polling command, and the data further comprises at least one set of state data. The polling instruction transmission module 110 further includes: and sending a state quantity polling instruction to the monitored equipment according to a first polling period so as to enable the monitored equipment to return state data of the corresponding station group.
In one embodiment, the data polling device 100 further includes other functional modules/units for implementing the method steps in the embodiments of embodiment 1.
Fig. 6 is a schematic diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 600 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps in the above-described embodiments of the reactive power closed-loop control method for the single-phase grid-connected inverter, such as S101 to S103 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 110 to 130 shown in fig. 5.
The computer program 62 may be divided into one or more modules/units that are stored in the memory 61 and executed by the processor 60 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 process of the computer program 62 in the terminal device 600.
The terminal device 600 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 600 and does not constitute a limitation of terminal device 600 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf 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 61 may be an internal storage unit of the terminal device 600, such as a hard disk or a memory of the terminal device 600. The memory 61 may also be an external storage device of the terminal device 600, 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, which are provided on the terminal device 600. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 600. The memory 61 is used for storing the computer program and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned 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 implementation. 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 device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device 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 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 modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments 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 content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by 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 will 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 substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.