Method and device for calculating analog quantity small-average value and electronic equipment

文档序号:1952019 发布日期:2021-12-10 浏览:12次 中文

阅读说明:本技术 一种模拟量小时均值的计算方法、装置及电子设备 (Method and device for calculating analog quantity small-average value and electronic equipment ) 是由 王志超 于 2021-08-18 设计创作,主要内容包括:本申请实施例提供了一种模拟量小时均值的计算方法、装置及电子设备,在第一时刻点达到采集周期的起始时刻点时,触发采集指令。响应采集指令,采集模拟量。在第二时刻点达到采集周期的结束时刻点时,触发停止指令。响应停止指令,停止采集模拟量。采集周期为一小时,采集周期包括多个扫描周期。累加采集周期内所有扫描周期下采集的模拟量,得到第一累加值。计算第一累加值与采集周期内扫描周期的第一累加数量的比值,为模拟量的小时均值。因此,能够以一小时内多次采集的模拟量求取平均值作为模拟量的小时均值,小时均值更具有代表性,误差较小。(The embodiment of the application provides a method and a device for calculating an analog small average value and electronic equipment, and an acquisition instruction is triggered when a first time point reaches an initial time point of an acquisition cycle. And responding to the acquisition instruction to acquire the analog quantity. And triggering a stop instruction when the second time point reaches the end time point of the acquisition period. And stopping collecting the analog quantity in response to the stop instruction. The acquisition period is one hour and includes a plurality of scan periods. And accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value. And calculating the ratio of the first accumulated value to the first accumulated quantity of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity. Therefore, the average value of the analog quantities acquired multiple times within one hour can be used as the hour average value of the analog quantities, and the hour average value is more representative and has smaller error.)

1. A method for calculating an analog quantity hour average value is characterized by comprising the following steps:

triggering an acquisition instruction when the first time point reaches the initial time point of the acquisition cycle;

responding to the acquisition instruction, and acquiring analog quantity;

triggering a stop instruction when a second time point reaches the end time point of the acquisition period;

responding to the stopping instruction, and stopping collecting the analog quantity; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods;

accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value;

and calculating the ratio of the first accumulated value to the first accumulated number of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity.

2. The method of claim 1, wherein after said collecting analog quantities in response to said collecting instructions, the method further comprises:

and eliminating unqualified analog quantity, wherein the scanning period corresponding to the unqualified analog quantity does not carry out frequency accumulation.

3. The method of claim 1, wherein after said collecting analog quantities in response to said collecting instructions, the method further comprises:

acquiring the reset operation of a user on a reset button;

determining a third time point corresponding to the reset operation and a second accumulated number of scanning periods in a time interval from the initial time point to the third time point;

accumulating the analog quantity between the starting time point and the third time point to obtain a second accumulated value;

and calculating the ratio of the second accumulated value to the second accumulated quantity to be the average value of the analog quantity required by the user.

4. The method of claim 1, wherein the start time point and the end time point are both integer time points.

5. The method of claim 1, wherein the first time point and the second time point are both GPS time, and the GPS time is automatically calibrated by GPS.

6. An analog hourly mean value calculation apparatus, comprising:

the first trigger module is used for triggering the acquisition instruction when the first time point reaches the initial time point of the acquisition cycle;

the first response module is used for responding to the acquisition instruction and acquiring the analog quantity;

the second trigger module is used for triggering a stop instruction when a second time point reaches the end time point of the acquisition cycle;

the second response module is used for responding to the stop instruction and stopping collecting the analog quantity; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods;

the first accumulation module is used for accumulating the analog quantity acquired in all scanning periods in the acquisition period to obtain a first accumulated value;

and the first calculating module is used for calculating the ratio of the first accumulated value to the first accumulated number of the scanning period in the acquisition period, and the ratio is the hour average value of the analog quantity.

7. The analog hourly mean value computing apparatus of claim 6, further comprising:

and the eliminating module is used for eliminating unqualified analog quantity, and the scanning period corresponding to the unqualified analog quantity does not carry out frequency accumulation.

8. The analog hourly mean value computing apparatus of claim 6, further comprising:

the acquisition module is used for acquiring the reset operation of a user on the reset button;

a determining module, configured to determine a third time point corresponding to the reset operation and a second accumulated number of scanning cycles in a time interval from the starting time point to the third time point;

the second accumulation module is used for accumulating the analog quantity between the starting time point and the third time point to obtain a second accumulated value;

and the second calculation module is used for calculating the ratio of the second accumulated value to the second accumulated quantity, and the ratio is the analog quantity average value required by the user.

9. An electronic device comprising a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete mutual communication through a bus; the memory is used for storing a computer program; the processor is used for executing the program stored in the memory to realize the steps of the analog quantity hour average value calculation method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of calculating an analog quantity hourly mean value according to any one of claims 1 to 5.

Technical Field

The application relates to the thermal field of thermal power plants, in particular to a method and a device for calculating an analog quantity small-average value and electronic equipment.

Background

In the power generation process of the thermal power plant, the real-time parameters of the analog quantity are not representative for the evaluation of the thermal power plant, so that the average value of the analog quantity in the power generation process of the thermal power plant is often required to be calculated.

Under some scenes, the analog quantity comprises flow, temperature, pressure and the like, and evaluation by calculating the hour mean value of the analog quantity in the power generation process of the thermal power plant has good representativeness and persuasion. And when the hour average value of the analog quantity is calculated, the numerical value of the analog quantity accumulated for a plurality of hours is adopted, and then the numerical value is compared with the accumulated hour number to obtain the hour average value of the analog quantity, wherein the error of the hour average value of the analog quantity is large.

Disclosure of Invention

The embodiment of the application aims to provide a method and a device for calculating an analog quantity hour mean value and electronic equipment, so as to solve the problem that the error of the analog quantity hour mean value is large.

In order to solve the above technical problem, the embodiment of the present application is implemented as follows:

in a first aspect, an embodiment of the present application provides a method for calculating an analog quantity hourly mean value, including:

triggering an acquisition instruction when the first time point reaches the initial time point of the acquisition cycle; responding to the acquisition instruction, and acquiring analog quantity; triggering a stop instruction when the second time point reaches the end time point of the acquisition period; responding to the stopping instruction, and stopping collecting the analog quantity; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods; accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value; and calculating the ratio of the first accumulated value to the first accumulated number of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity.

In a second aspect, an embodiment of the present application provides an apparatus for calculating an analog hourly mean value, including:

the first trigger module is used for triggering the acquisition instruction when the first time point reaches the initial time point of the acquisition cycle; the first response module is used for responding to the acquisition instruction and acquiring the analog quantity; the second trigger module is used for triggering a stop instruction when the second time point reaches the end time point of the acquisition cycle; the second response module is used for responding to the stop instruction and stopping collecting the analog quantity; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods; the first accumulation module is used for accumulating the analog quantity acquired in all scanning periods in the acquisition period to obtain a first accumulated value; and the first calculating module is used for calculating the ratio of the first accumulated value to the first accumulated number of the scanning period in the acquisition period, and the ratio is the hour average value of the analog quantity.

In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete mutual communication through a bus; the memory is used for storing a computer program; the processor is configured to execute the program stored in the memory, and implement the method steps for calculating the analog small-average value according to the first aspect.

In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method steps for calculating the analog quantity hour-average value according to the first aspect.

According to the technical scheme provided by the embodiment of the application, the acquisition instruction is triggered when the first time point reaches the initial time point of the acquisition cycle. And responding to the acquisition instruction to acquire the analog quantity. And triggering a stop instruction when the second time point reaches the end time point of the acquisition period. And stopping collecting the analog quantity in response to the stop instruction. The acquisition period is one hour and includes a plurality of scan periods. And accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value. And calculating the ratio of the first accumulated value to the first accumulated quantity of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity. Therefore, the average value of the analog quantities acquired multiple times within one hour can be used as the hour average value of the analog quantities, and the hour average value is more representative and has smaller error.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.

Fig. 1A is a first flowchart of a method for calculating an analog hourly mean value according to an embodiment of the present disclosure;

fig. 1B is a schematic structural diagram of automatic reset provided in the embodiment of the present application;

FIG. 2 is a second flowchart illustrating a method for calculating an analog hourly mean value according to an embodiment of the present disclosure;

FIG. 3 is a third flowchart illustrating a method for calculating an analog hourly mean value according to an embodiment of the present disclosure;

FIG. 4 is a flowchart illustrating a method for calculating an analog hourly mean value according to an embodiment of the present disclosure;

FIG. 5 is a block diagram of an apparatus for calculating an analog hourly mean value according to an embodiment of the present disclosure;

fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.

Detailed Description

The embodiment of the application provides a method and a device for calculating an hour mean value of an analog quantity and electronic equipment, and reduces the error of the hour mean value of the analog quantity.

In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

Under some scenes, the analog quantity comprises flow, temperature, pressure and the like, and evaluation by calculating the hour mean value of the analog quantity in the power generation process of the thermal power plant has good representativeness and persuasion. When the hour average value of the analog quantity is calculated, the value of the analog quantity accumulated for a plurality of hours is adopted, and then the value is compared with the accumulated hour number to obtain the hour average value of the analog quantity, and when the accumulation reaches the required hour number, manual reset is needed, certain delay exists, and the error of the hour average value of the analog quantity is large.

For example, as shown in fig. 1A, an implementation subject of the method for calculating an analog quantity hour mean value may be a server, where the server may be an independent server or a server cluster composed of a plurality of servers, and the server may be a server capable of calculating the analog quantity hour mean value.

The method for calculating the analog quantity hour average value specifically comprises the following steps of S101 to S105:

in S101, when the first time point reaches the start time point of the acquisition cycle, an acquisition instruction is triggered, and an analog quantity is acquired in response to the acquisition instruction.

Specifically, the analog quantities of the thermal power plant include, but are not limited to: temperature, pressure, flow, and humidity, among others. The acquisition period is a time period for acquiring the analog quantity, the acquisition period has a starting time point and an ending time point, and the analog quantity is acquired in at least one scanning period in a time interval between the starting time point and the ending time point. And according to the time sequence, when the first time point is consistent with the initial time point of the acquisition period, starting to acquire the analog quantity.

In S103, when the second time point reaches the end time point of the acquisition cycle, triggering a stop instruction; stopping collecting the analog quantity in response to the stop instruction; the acquisition period is one hour and includes a plurality of scan periods.

Specifically, the acquisition period is set to one hour, and the analog quantity is acquired a plurality of times in a plurality of scanning periods in one hour.

In S104, the analog quantities acquired in all scanning periods in the acquisition period are accumulated to obtain a first accumulated value.

Specifically, a plurality of analog quantities collected within one hour are accumulated to obtain a first accumulated value. For example, in one hour, there are 5 scanning periods, 5 analog quantities are acquired in total in 5 scanning periods, and the 5 acquired analog quantities are accumulated to obtain a first accumulated value.

In S105, a ratio of the first accumulated value to the first accumulated number of scanning periods in the acquisition period is calculated as an hour average of the analog quantity.

Specifically, the analog quantities collected within one hour are accumulated to obtain a first accumulated value. For example, in an hour, there are 5 scanning periods, 5 analog quantities are acquired in total in 5 scanning periods, and the 5 acquired analog quantities are accumulated to obtain an accumulated value of the analog quantities in the acquisition period. The accumulated value was then compared to 5 to obtain an hourly mean value of the analog over 1 hour. Compared with the mode of obtaining the hour average value of the analog quantity by using the numerical value of the analog quantity accumulated for a plurality of hours and comparing the numerical value with the accumulated hour number, the error of the hour average value of the analog quantity is small and more representative.

Further, in the embodiment of the present application, triggering the acquisition instruction and the stop instruction are performed automatically, and specifically, the acquisition instruction and the stop instruction may be automatically reset at a timing according to the GPS time of the DCS control system. The automatic reset logic provided in the embodiment of the present application is described by taking an example where the starting time point is 2021.4.9 day zero and the ending time point is 2021.4.9 day 1. As shown in fig. 1B, the RTC is an automatic timing chip for reading the real-time of the DCS control system, i.e. the GPS automatic timing time of the DCS control system. The TIMERJUDGE module is a time judging module, the TV end is used for setting the reset time (the initial time point and the end time point), DV1 is an output pin, SDT is an output pin of RTC, and I1 is an input pin of the TIMERJUDGE module. It is divided into JUDGE-01 and JUDGE-02.

The JUDGE-01 is used to set a starting time point, and if the starting time point can be set to 2021.4.9 days zero, the reset is delayed for 1 second in order to ensure that the adjustment point calling data is a mean value, and the reset is set to 2021-4-9-0:0:1(DT01 ═ DT #2021-4-9-0:0: 1). Judge-02 is used to set the end time point, which may be set to 2021.4.9 day 1, and to ensure that the adjustment point calls for a mean value, the reset is delayed by 1 second, which may be set to 2021-4-9-1:0:1(DT01 ═ DT #2021-4-9-1:0: 1).

And when the GPS time read by the RTC in JUDGE-01 or JUDGE-02 is consistent with the set integral point reset time of the TV end, automatic reset is carried out.

It should be noted that the set integral point reset time of the TV end may also be other integral point time, and the embodiment of the present application is not limited herein.

In a possible implementation manner, the starting time point and the ending time point are both whole-point times, and the acquisition period includes 12 acquisition periods. Specifically, the starting time point and the ending time point are set as the integral point time, so that the accuracy of the small average value of the analog quantity can be further improved. When the acquisition period is set, 0 point to 1 point, 2 points to 3 points, 4 points to 5 points, and so on for 12 acquisition periods.

In one possible implementation, when there are multiple acquisition cycles, the analog hourly mean value of each acquisition cycle may be further averaged, thereby further improving the accuracy of the analog hourly mean value. For example, when there are 3 acquisition cycles, the analog quantity hour average values of the 3 acquisition cycles are respectively obtained, then the analog quantity hour average values of the 3 acquisition cycles are superposed and then compared with 3, so that the analog quantity hour average value is further obtained, and the precision of the analog quantity hour average value is further improved.

According to the technical scheme provided by the embodiment of the application, the acquisition instruction is triggered when the first time point reaches the initial time point of the acquisition cycle. And responding to the acquisition instruction to acquire the analog quantity. And triggering a stop instruction when the second time point reaches the end time point of the acquisition period. And stopping collecting the analog quantity in response to the stop instruction. The acquisition period is one hour and includes a plurality of scan periods. And accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value. And calculating the ratio of the first accumulated value to the first accumulated quantity of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity. Therefore, the average value of the analog quantities acquired multiple times within one hour can be used as the hour average value of the analog quantities, and the hour average value is more representative and has smaller error.

For example, as shown in fig. 2, an execution subject of the method may be a server, where the server may be an independent server or a server cluster composed of a plurality of servers, and the server may be a server capable of performing analog quantity hour-mean calculation.

The method for calculating the analog small-average value may specifically include the following steps S201 to S205:

in S201, when the first time point reaches the initial time point of the acquisition cycle, triggering an acquisition instruction; and responding to the acquisition instruction to acquire the analog quantity.

Specifically, the analog quantities of the thermal power plant include, but are not limited to: temperature, pressure, flow, and humidity, among others.

In S202, the unqualified analog quantities are eliminated, and the number of times of accumulation is not performed in the scanning cycle corresponding to the unqualified analog quantities.

Specifically, the analog quantities such as temperature, pressure, humidity, and flow rate all have normal range sections in the scenario of the thermal power plant, and the analog quantities are not qualified when the values thereof exceed the corresponding normal range sections. The unqualified analog quantity is eliminated, so that the accuracy of the hour average value is avoided being influenced, and the times of scanning periods corresponding to the unqualified analog quantity are not accumulated. For example, in an acquisition period of one hour, 5 times of analog quantity are acquired in total, if the analog quantity acquired for the second time is not qualified, the analog quantity acquired for the second time is rejected, and the scanning periods of the analog quantity acquired for the second time are not accumulated. I.e. the hourly mean of the analog over the acquisition period is the ratio of the sum of the 4 analog values to 4.

In S203, when the second time point reaches the end time point of the acquisition cycle, triggering a stop instruction; stopping collecting the analog quantity in response to the stop instruction; the acquisition period is one hour and includes a plurality of scan periods.

In S204, the analog quantities acquired in all scanning periods in the acquisition period are accumulated to obtain a first accumulated value.

In S205, a ratio of the first accumulated value to the first accumulated number of scan cycles in the acquisition period is calculated as an hour average of the analog quantity.

It is to be noted that S201, S203, and S205 have the same or similar implementations as those of S101 to S105, which can be referred to each other, and are not described herein again.

According to the technical scheme provided by the embodiment of the application, the average value of the analog quantity acquired for multiple times within one hour can be used as the hour average value of the analog quantity, the hour average value of the analog quantity is more representative, and the error is smaller. In addition, unqualified data are removed, and the accuracy of the hour average value of the analog quantity is further improved.

For example, as shown in fig. 3, an execution subject of the method may be a server, where the server may be an independent server or a server cluster composed of a plurality of servers, and the server may be a server capable of performing analog quantity hour-mean calculation.

The method for calculating the analog small-average value may specifically include the following steps S301 to S306:

in S301, when the first time point reaches the start time point of the acquisition cycle, an acquisition instruction is triggered; and responding to the acquisition instruction to acquire the analog quantity.

In S303, when the second time point reaches the end time point of the acquisition cycle, triggering a stop instruction; stopping collecting the analog quantity in response to the stop instruction; the acquisition period is one hour and includes a plurality of scan periods.

In S304, the analog quantities acquired in all scanning periods in the acquisition period are accumulated to obtain a first accumulated value.

In S305, a ratio of the first accumulated value to the first accumulated number of scan cycles within the acquisition period is calculated as an hourly average of the analog quantity.

It is to be noted that S301, S303 and S305 have the same or similar implementations as those of S101 to S105, which can be referred to each other, and the embodiments of the present application are not described herein again.

In S306, a reset operation of the reset button by the user is acquired; determining a third time point corresponding to the reset operation and a second accumulated number of scanning periods in a time interval from the initial time point to the third time point; accumulating the analog quantity between the initial time point and the third time point to obtain a second accumulated value; and calculating the ratio of the second accumulated value to the second accumulated quantity to be the average value of the analog quantity required by the user.

Specifically, the user may count the analog quantity for any period of time by pressing the reset button from the time when the analog quantity starts to be collected to the time when the analog quantity ends. The ratio of the analog quantity of the period of time to the number of scanning periods of the period of time is the average value of the analog quantity required by the user.

According to the technical scheme disclosed by the embodiment of the application, the average value of the analog quantity acquired for multiple times within one hour can be used as the hour average value of the analog quantity, the hour average value of the analog quantity is more representative, and the error is smaller. In addition, the user can count the analog quantity of any period of time which needs to be counted by the user by pressing the reset button, and the user experience is high.

The method for calculating the average value of the analog quantity hours provided by the embodiment of the present application is further described with reference to fig. 4, as shown in fig. 4, the first selection module SEL 1 is used for screening the analog quantity and removing the analog quantity that is not qualified, specifically, when the analog quantity is qualified, SEL 1 outputs the numerical value of the analog quantity, and when the analog quantity is not qualified, SEL 1 outputs 0. The second selection module SEL 2 is used for counting the number of the scanning periods of the valid analog quantity, wherein when the analog quantity is unqualified, the scanning periods of the unqualified analog quantity are not counted, namely SEL 2 outputs 0, and when the analog quantity is qualified, the scanning periods of the qualified analog quantity are counted, namely SEL 2 outputs 1.

Furthermore, HSACCUM is an accumulation module, ACCUM 01 accumulates qualified analog quantity, and ACCUM 02 accumulates the number of scanning periods of qualified analog quantity. The I1 pin of the ACCUM 01 is connected with the output end of the SEL 1, the RS pin is a reset pin, the I1 pin of the ACCUM 02 is connected with the output end of the SEL 2, and the RS pin is a reset pin. The AV pin of ACCUM 02 is connected to the EQ module and a third selection module SEL 3. For the EQ module, if the output of the ACCUM 02 is 0, the SEL3 selects output 1, when the output of the ACCUM 02 is the accumulation times of the normal scanning period, the SEL3 outputs the accumulation times of the scanning period to the DIV module, and the DIV module compares the accumulation value of the qualified analog quantity with the number of the scanning period to obtain the hour average value of the analog quantity.

Further, for the RS pin (reset pin), an automatic reset or a manual reset mode may be selected, the automatic reset may select a reset rule shown in fig. 1B to calculate the analog quantity hour average value, specifically refer to the description of the above embodiment, which is not limited herein, and during the manual reset, the user presses the reset button to perform the reset.

According to the technical scheme disclosed by the embodiment of the application, the average value of the analog quantity acquired for multiple times within one hour can be used as the hour average value of the analog quantity, the hour average value of the analog quantity is more representative, and the error is smaller. In addition, the user can count the analog quantity of any period of time which needs to be counted by the user by pressing the reset button, and the user experience is high. In addition, unqualified data are removed, and the accuracy of the hour average value of the analog quantity is further improved.

Based on the same technical concept, the embodiment of the present application further provides an apparatus for calculating an analog small average value, fig. 5 is a schematic diagram illustrating a block composition of the apparatus for calculating an analog small average value provided in the embodiment of the present application, the apparatus for calculating an analog small average value is used to perform the method for calculating an analog small average value described in fig. 1 to fig. 3, and as shown in fig. 5, the apparatus for calculating an analog small average value includes: a first trigger module 501, a first response module 502, a second trigger module 503, a second response module 504, a first accumulation module 505, and a first calculation module 506.

A first triggering module 501, configured to trigger an acquisition instruction when a first time point reaches an initial time point of an acquisition cycle; a first response module 502, configured to respond to the acquisition instruction and acquire the analog quantity; a second triggering module 503, configured to trigger a stop instruction when the second time point reaches the end time point of the acquisition cycle; a second response module 504, configured to respond to the stop instruction and stop collecting the analog quantity; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods; a first accumulation module 505, configured to accumulate analog quantities acquired in all scanning periods in an acquisition period to obtain a first accumulated value; the first calculating module 506 is configured to calculate a ratio of the first accumulated value to the first accumulated number of the scanning periods in the acquisition period, where the ratio is an hour average of the analog quantity.

According to the technical scheme provided by the embodiment of the application, the average value of the analog quantity acquired for multiple times within one hour can be used as the hour average value of the analog quantity, the hour average value is more representative, and the error is smaller.

In one possible implementation manner, the method further includes:

and the rejecting module (not shown in the figure) is used for rejecting unqualified analog quantities, and the times of accumulation of scanning periods corresponding to the unqualified analog quantities are not performed.

In one possible implementation manner, the method further includes:

an acquiring module (not shown in the figure) for acquiring the reset operation of the reset button by the user; a determining module (not shown in the figure) for determining a third time point corresponding to the reset operation and a second accumulated number of the scanning periods in a time interval from the starting time point to the third time point; a second accumulation module (not shown in the figure) for accumulating the analog quantity from the starting time point to the third time point to obtain a second accumulated value; and a second calculating module (not shown in the figure) for calculating a ratio of the second accumulated value to the second accumulated number, which is an analog quantity average value required by the user.

The device for calculating the small average analog quantity provided in the embodiment of the application can realize each process in the embodiment corresponding to the method for calculating the small average analog quantity, and is not repeated here for avoiding repetition.

It should be noted that the apparatus for calculating an analog small average value provided in the embodiment of the present application and the method for calculating an analog small average value provided in the embodiment of the present application are based on the same application concept, so that for specific implementation of the embodiment, reference may be made to implementation of the method for calculating an analog small average value, and repeated details are not repeated.

Based on the same technical concept, the embodiment of the present application further provides an electronic device for executing the method for calculating an analog small mean value, and fig. 6 is a schematic structural diagram of an electronic device implementing the embodiments of the present application, as shown in fig. 6. Electronic devices may vary widely in configuration or performance and may include one or more processors 601 and memory 602, where one or more stored applications or data may be stored in memory 602. Wherein the memory 602 may be transient or persistent storage. The application program stored in memory 602 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for the electronic device.

Still further, the processor 601 may be arranged in communication with the memory 602 to execute a series of computer-executable instructions in the memory 602 on the electronic device. The electronic device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input-output interfaces 605, one or more keyboards 606.

Specifically, in this embodiment, the electronic device includes a processor, a communication interface, a memory, and a communication bus; the processor, the communication interface and the memory complete mutual communication through a bus; a memory for storing a computer program; a processor for executing the program stored in the memory, implementing the following method steps:

triggering an acquisition instruction when the first time point reaches the initial time point of the acquisition cycle; responding to an acquisition instruction, and acquiring analog quantity; triggering a stop instruction when the second time point reaches the end time point of the acquisition period; stopping collecting the analog quantity in response to the stop instruction; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods; accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value; and calculating the ratio of the first accumulated value to the first accumulated quantity of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity.

According to the technical scheme provided by the embodiment of the application, the average value of the analog quantity acquired for multiple times within one hour can be used as the hour average value of the analog quantity, the hour average value is more representative, and the error is smaller.

The embodiment also provides a computer-readable storage medium, in which a computer program is stored, and when executed by a processor, the computer program implements the following steps:

triggering an acquisition instruction when the first time point reaches the initial time point of the acquisition cycle; responding to an acquisition instruction, and acquiring analog quantity; triggering a stop instruction when the second time point reaches the end time point of the acquisition period; stopping collecting the analog quantity in response to the stop instruction; the acquisition period is one hour, and the acquisition period comprises a plurality of scanning periods; accumulating the analog quantities acquired in all scanning periods in the acquisition period to obtain a first accumulated value; and calculating the ratio of the first accumulated value to the first accumulated quantity of the scanning period in the acquisition period, wherein the ratio is the hour average value of the analog quantity.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

In a typical configuration, an electronic device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:计算机可读取存储介质、调度主机命令的方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类