Instrument demand calculation method and device, computer equipment and storage medium

By setting up general storage tools and dedicated storage tools in electronic power meters, the problem of excessive memory space consumption during demand calculation is solved, and the effect of memory saving and cost reduction is achieved.

CN119940775APending Publication Date: 2025-05-06SHENZHEN STAR INSTR
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411862346.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When calculating demand for existing electronic power meters, memory space consumption is too large, resulting in an increase in MCU cost. Methods to reduce memory consumption usually require frequent modification and debugging, which increases the consumption of R&D and testing resources.

Method used

By setting up general storage tools and dedicated storage tools, the required data are stored separately according to the data type, thereby reducing duplicate redundant data and saving memory resources.

Benefits of technology

On the basis of ensuring the integrity of demand calculations, memory consumption is reduced, material costs are reduced, and R&D and testing resources are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940775A_ABST
    Figure CN119940775A_ABST
Patent Text Reader

Abstract

The invention discloses a demand calculation method and device for an instrument, computer equipment and a storage medium, and the method is characterized in that the method comprises the steps: obtaining a preset demand parameter and a storage tool; on the basis of the demand parameters, demand data of a first demand period in the current demand calculation total period are collected, the demand data are stored in a corresponding storage tool according to data types, and the data types comprise initial rate data and change rate data; on the basis of the storage tool and the demand data correspondingly stored in the storage tool, demand information of the first demand period is obtained through calculation; returning to execute the step of collecting demand data of a second demand period in the current demand calculation total period based on the demand parameters until demand information corresponding to demand periods with the same number as the demand period number is obtained; on the basis of all demand information, demand value information of the current demand calculation total period is obtained through calculation, and on the basis that complete demand calculation of the electric energy meter is achieved, memory consumption is reduced, and the material cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric energy meter demand, and in particular to a meter demand calculation method, device, computer equipment and storage medium. Background Art

[0002] In the current mainstream electronic energy meters, demand is a basic core functional requirement. The demand types are quite complex. According to the corresponding energy type, it can be divided into forward active power, reverse active power, forward reactive power, reverse reactive power, four-quadrant reactive power (4 types), forward apparent power, reverse apparent power, and total active power demand, etc. According to the phase, it can be divided into combined phase demand and split phase demand; according to different time periods, it can be divided into total demand and demand of each rate.

[0003] According to the definition of the demand model in the industry's authoritative standard DLMS Blue Book, certain requirements are also put forward for the number of demand cycles. In general, the design needs to support a maximum of 60 demand cycles. The current common practice in the industry is to open up 60 demand cycle buffers for each detailed demand type to cache the process data of demand calculation. However, for electronic energy meters, the memory space size of the mainstream MCU generally used is 32K / 64K / 80K / 96K, which cannot meet the memory space consumption of the above demand calculation method.

[0004] Based on this, the memory space used is usually reduced by canceling the phase demand, reducing the demand type, or reducing the number of demand cycles according to specific customer needs. However, this requires modification and debugging of this part of the function at each project stage, including back-end testing and verification, which repeatedly consumes R&D and testing resources and is prone to errors. Even if the slip demand calculation function is realized through various reduction methods, the memory consumption of the MCU is still very large. For electric energy meters with more complex functions, MCUs with larger memory resources must be used to meet project requirements, which will inevitably lead to an increase in MCU costs; and electric energy meters are mass-produced products, so they bring great pressure to the company's operating profit indicators. Summary of the invention

[0005] The embodiments of the present invention provide a method, device, computer equipment and storage medium for calculating the demand of an electric energy meter, which reduce memory consumption and material costs on the basis of realizing complete demand calculation of an electric energy meter.

[0006] In a first aspect, the present application provides a method for calculating demand of an instrument, comprising: Obtaining preset demand parameters and storage tools, wherein the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools; Based on the demand parameters, collecting demand data of a first demand period in the current demand calculation total period, and storing the demand data in the corresponding storage tool according to the data type, the data type including initial rate data and change rate data; Based on the storage tool and the corresponding demand data stored in the storage tool, calculating demand information for a first demand period; Returning to execute based on the demand parameter, collecting demand data of the second demand period in the current demand calculation total period, until demand information corresponding to the same number of demand periods as the number of demand periods is obtained; Based on all the demand information, the demand value information of the current demand calculation total period is calculated.

[0007] Optionally, the universal storage tool is used to store initial rate data corresponding to an initial rate number, the dedicated storage tool is used to store variable rate data corresponding to a rate number different from the initial rate number, and one dedicated storage tool corresponds to one rate number.

[0008] Optionally, the collecting demand data of the first demand period in the current demand calculation total period, and storing the demand data in the corresponding storage tool according to the data type, includes: Get the initial rate for the total period of current demand calculation; Collecting and obtaining demand data for a first demand period, and determining a real-time rate based on the demand data; Determine whether a rate change occurs within the first demand period based on the initial rate and the real-time rate, determine the data type of the demand data based on the determination result, and store the demand data in a corresponding storage tool according to the data type of the demand data.

[0009] Optionally, determining a data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data includes: When no rate change occurs within the first demand period, the demand data is determined to be initial rate data, the initial rate data is accumulated and stored in the universal storage tool, and an initial rate number and a first demand period index are identified for the universal storage tool.

[0010] Optionally, determining a data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data includes: When a rate change occurs within the first demand period, determining the demand data before the rate change moment as the initial rate data, accumulating and storing the initial rate data in a universal storage tool, and identifying the initial rate number and the first demand period index for the universal storage tool; Determine the demand data after the rate change moment as the changed rate data, accumulate and store the changed rate data into a dedicated storage tool, and identify the changed rate number and the first demand cycle index for the dedicated storage tool.

[0011] Optionally, determining a data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data includes: When multiple rate changes occur within the first demand cycle, the demand data before the first rate change is determined as the initial rate data, the initial rate data is accumulated and stored in the universal storage tool, and the initial rate number and the first demand cycle index are identified for the universal storage tool Determine the demand data after the first rate change moment as the first change rate data, accumulate and store the first change rate data into a first dedicated storage tool, and identify the change rate number and the first demand period index for the first dedicated storage tool; Determine the demand data after the second rate change moment as the second change rate data, accumulate and store the second change rate data into a second dedicated storage tool, and identify the change rate number and the first demand period index for the second dedicated storage tool; This process is repeated in this way until the demand data corresponding to all different variable rate numbers are stored in the corresponding storage tools, and the rate numbers and first demand cycle indexes corresponding to all the storage tools are obtained.

[0012] Optionally, the calculating and obtaining demand value information of a total demand calculation period includes: When calculating the total demand value, determining the effective demand information of the general storage tool and the dedicated storage tool, accumulating and averaging the effective demand information, and obtaining the total demand value of the total demand calculation period; When calculating the demand value corresponding to each rate number, the effective demand information of the general storage tool and the special storage tool is determined, and the effective demand information in the storage tool corresponding to each rate number is accumulated and averaged to obtain the demand value corresponding to each rate number.

[0013] In a second aspect, the present application provides a demand calculation device for an instrument, characterized in that it includes: An acquisition module, used to acquire preset demand parameters and storage tools, wherein the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools; A collection module, used for collecting demand data of a first demand period in a current demand calculation total period based on the demand parameters, and storing the demand data in the corresponding storage tool according to the data type, wherein the data type includes initial rate data and change rate data; A first calculation module, configured to calculate demand information of a first demand period based on the storage tool and the corresponding demand data stored in the storage tool; A loop module, used for returning to execute based on the demand parameter, collecting the demand data of the second demand period in the current demand calculation total period, until the demand information corresponding to the same number of demand periods as the number of demand periods is obtained; The second calculation module is used to calculate the demand value information of the current demand calculation total period based on all the demand information.

[0014] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned demand calculation method when executing the computer program.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the above-mentioned demand calculation method when executed by a processor.

[0016] The above-mentioned demand calculation method, device, computer equipment and storage medium, by setting up a general storage tool and a special storage tool, store the acquired demand data into the general storage tool and the special storage tool according to the data type, each storage tool stores specific demand data correspondingly, compared with the prior art, reduces some repeated and redundant data, thereby saving memory resources; at the same time, the complete demand data is stored by the general storage tool and the special storage tool, when performing demand calculation, different types of demand value information can be obtained in a targeted manner, on the basis of ensuring the integrity of the demand calculation of the electric energy meter, reducing memory consumption and reducing material costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0018] Figure 1It is a schematic diagram of the overall flow of a demand calculation method in an embodiment of the present invention.

[0019] Figure 2 It is another flow chart of a demand calculation method in an embodiment of the present invention.

[0020] Figure 3 It is a structural schematic diagram of a demand calculation device in an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] It should be understood that the present invention can be implemented in different forms and should not be interpreted as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to make the disclosure thorough and complete and to fully convey the scope of the present invention to those skilled in the art.

[0023] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present invention. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.

[0024] In order to fully understand the present invention, detailed steps will be presented in the following description to illustrate the technical solution proposed by the present invention. The preferred embodiments of the present invention are described in detail below, but in addition to these detailed descriptions, the present invention may also have other implementations.

[0025] like Figure 1 As shown, it is a schematic diagram of the overall flow of a method for calculating the demand of an instrument provided by an embodiment of the present invention. The method for calculating the demand of an instrument provided by this embodiment includes: Step S101, obtaining preset demand parameters and storage tools, the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools.

[0026] In this embodiment, the demand parameters and storage tools can be obtained through the demand calculation operation management information of the last total demand calculation cycle stored in the electric energy meter system, or the default parameters pre-set in the electric energy meter system can be used. Among them, the demand parameters include the demand cycle and the number of demand cycles. The total demand calculation cycle can be calculated through the demand parameters. The total demand calculation cycle = demand cycle * number of demand cycles. For example, if the demand cycle is set to 15 minutes and the number of demand cycles is set to 4, it can be determined that the total demand calculation cycle is 1 hour. Under normal circumstances, the total demand calculation cycle is 1 hour, and in extreme application cases, it will not exceed 1 day.

[0027] In the prior art, the storage tool is generally a unified cache buffer, which is used to cache the process data of the demand calculation. In this embodiment, the storage tool in the electric energy meter system includes a general storage tool and a dedicated storage tool. The general storage tool can be a general buffer, which is used to store the initial rate data corresponding to the initial rate number, and the dedicated storage tool can be a dedicated buffer, which is used to store the change rate data corresponding to the rate number different from the initial rate number, and one dedicated buffer corresponds to one rate number.

[0028] Step S102, based on the demand parameters, collect demand data of the first demand period in the current demand calculation total period, and store the demand data into a corresponding storage tool according to the data type, the data type including initial rate data and change rate data.

[0029] According to the demand cycle and the number of demand cycles in the demand parameters, the electric energy meter system calculates the demand information of each demand cycle in the current total demand calculation cycle starting from the first demand cycle, and after obtaining the demand information of all demand cycles, the demand value of the current total demand calculation cycle can be calculated according to the demand information of all demand cycles. In this embodiment, to calculate the demand information of the demand cycle, it is necessary to first collect the demand data of each demand cycle.

[0030] In mainstream electronic energy meters, demand data includes at least 11 types of data, including forward active power, reverse active power, forward reactive power, reverse reactive power, four-quadrant reactive power (4 types), forward apparent power, reverse apparent power, and total active power demand. In this embodiment, the demand data in each demand cycle is divided into initial rate data and variable rate data according to different rates, wherein the initial rate data refers to determining the initial rate at the beginning of each total demand calculation cycle, and obtaining the demand data at the initial rate as the initial rate data; when the rate in one of the demand cycles changes, a new variable rate is determined, and the demand data at the variable rate is obtained as the variable rate data of the demand cycle.

[0031] For the initial rate data and the variable rate data, the electric energy meter system stores the demand data with the data type of initial rate data in a general storage tool, i.e., a general buffer, and stores the demand data with the data type of variable rate data in a special storage tool, i.e., a special buffer, in each demand cycle.

[0032] It is worth mentioning that the first demand cycle in this embodiment only represents the order of demand cycles in the current demand calculation total cycle, and does not specifically refer to the first demand cycle in the demand calculation total cycle. The first demand cycle may also be the second demand cycle.

[0033] Step S103, based on the storage tool and the corresponding demand data stored in the storage tool, calculate and obtain the demand information of the first demand period.

[0034] After the first demand period ends, the electric energy meter system calculates the demand information of the first demand period according to the demand data stored in the storage tool. In this embodiment, the demand information is the maximum average power consumed by the power system or the user within a specified demand period (for example, 15 minutes, 30 minutes or 1 hour), that is, the maximum average power of the first demand period is calculated according to the demand data stored in the storage tool as the demand information of the first demand period.

[0035] Step S104, returning to execute based on the demand parameters, collecting demand data of the second demand period in the current demand calculation total period, until demand information corresponding to the same number of demand periods as the number of demand periods is obtained.

[0036] The electric energy meter system determines the number of demand cycles in the current demand calculation total cycle according to the demand parameters. If the number of demand cycles of the demand information that has been obtained does not meet the number of demand cycles in the demand parameters, the calculation of the demand information of the next demand cycle continues. In this embodiment, the demand data of the second demand cycle is obtained, and the demand information of the second demand cycle is calculated. The electric energy meter system continues to determine whether the number of demand cycles of the demand information that has been obtained meets the number of demand cycles in the demand parameters. If not, the red demand data of the next demand cycle is continued to be obtained and the demand information is calculated, until the demand information corresponding to the same number of demand cycles as the number of demand cycles in the demand parameters is obtained, and it is deemed that the acquisition of the demand information of the current demand calculation total cycle is completed.

[0037] Step S105: Based on all demand information, the demand value of the current demand calculation total period is calculated.

[0038] After sequentially acquiring the demand information of each demand cycle, the electric energy meter system calculates the demand value of the current demand calculation total cycle according to the demand information. In this embodiment, the demand value information includes the total demand value and the demand value corresponding to each rate number. Different calculation methods can be used for different demand value information.

[0039] In one embodiment, if Figure 2 As shown, when collecting the demand data of the first demand period in the current demand calculation total period and storing the demand data in the corresponding storage tool according to the data type, the following steps are also included: Step S201, obtaining the initial rate of the current demand calculation total period.

[0040] Step S202: collecting and acquiring demand data of a first demand period, and determining a real-time rate based on the demand data.

[0041] For steps S201-S202, the electric energy meter system first obtains the initial rate of the current demand calculation total period, and then calculates the real-time rate of the first demand period based on the demand data obtained in real time in the first demand period, so as to facilitate the subsequent classification of the demand data.

[0042] Step S203, judging whether a rate change occurs in the first demand cycle based on the initial rate and the real-time rate, determining the data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data.

[0043] After obtaining the real-time rate, the electric energy meter system compares the real-time rate with the initial rate to determine whether the real-time rate has changed compared with the initial rate, and takes the time when the real-time rate changes as the rate change time, the demand data before the rate change time as the initial rate data, and the demand data after the rate change time as the changed rate data. The initial rate data is stored in a general buffer, and the changed rate data is stored in a dedicated buffer. Since the time-of-use rate number will not change too much in a day, within any total demand calculation cycle, by storing the initial rate data and the changed rate data separately, the memory consumption can be greatly reduced under the premise of realizing a complete multi-rate sliding demand calculation.

[0044] In one embodiment, when no rate change occurs within the first demand cycle, the electric energy meter system determines that the demand data within the first demand cycle is the initial rate data. At this time, the initial rate data is accumulated and stored in the universal storage tool, and the initial rate number and the corresponding first demand cycle index corresponding to the initial rate data are identified for the universal storage tool, so as to quickly determine the data source of the universal storage tool through the initial rate number and the first demand cycle index.

[0045] In one embodiment, when a rate change occurs within the first demand cycle, the electric energy meter system determines that the demand data before the rate change is the initial demand data, accumulates the initial rate data and stores it in a universal storage tool, and at the same time identifies the initial rate number and the corresponding first demand cycle index corresponding to the initial rate data for the universal storage tool, so as to quickly determine the data source of the universal storage tool through the initial rate number and the first demand cycle index.

[0046] The electric energy meter system determines that the demand data after the rate change moment is the changed rate data, accumulates and stores the changed rate data in a dedicated storage tool, and at the same time identifies the changed rate number and the corresponding first demand cycle index corresponding to the changed rate data for the dedicated storage tool, so as to quickly determine the data source of the general storage tool through the changed rate number and the first demand cycle index.

[0047] In one embodiment, when multiple rate changes occur within the first demand cycle, the electric energy meter system uses the demand data before the first rate change as the initial rate data, accumulates the initial rate data and stores it in a universal storage tool, and simultaneously identifies the initial rate number and the corresponding first demand cycle index corresponding to the initial rate data for the universal storage tool, so as to quickly determine the data source of the universal storage tool through the initial rate number and the first demand cycle index.

[0048] The electric energy meter system determines that the demand data after the first rate change moment is the first change rate data, stores the first rate change data in the first special storage tool, and identifies the change rate number and the first demand cycle index corresponding to the first rate change data for the first special storage tool, so as to quickly determine the data source of the general storage tool through the first change rate number and the first demand cycle index.

[0049] The electric energy meter system determines that the demand data after the second rate change moment is the second change rate data, stores the second change rate data in the second special storage tool, and identifies the change rate number and the first demand cycle index corresponding to the second change rate data for the second special storage tool, so as to quickly determine the data source of the general storage tool through the second change rate number and the first demand cycle index.

[0050] In one embodiment, if the storage tools (general buffer and dedicated buffer) obtained in the previous demand calculation cycle cannot meet the rate change requirements in the current demand calculation cycle, the electric energy meter system calls a new dedicated storage tool (dedicated buffer) to store the change rate data of the current demand calculation cycle.

[0051] In one embodiment, when calculating the demand value information of the current demand calculation total period, the calculation method is determined according to the required demand value type, as follows: When calculating the total demand value of the total demand calculation period, the electric energy meter system determines the effective demand information in the general storage tool and the special storage tool. The effective demand information is the average power corresponding to the demand data in each storage tool. All effective demand information is accumulated and averaged to obtain the total demand value of the total demand calculation period.

[0052] When calculating the demand value corresponding to each rate number in the total demand calculation cycle, the electric energy meter system determines the effective demand information of the general storage tool and the special storage tool, that is, the average power corresponding to the demand data stored in each storage tool, and accumulates and averages the effective demand information in a storage tool corresponding to a rate number to obtain the demand value corresponding to each rate number.

[0053] In actual use, one specific implementation of this embodiment can be carried out according to the following contents, including: When the electric energy meter system performs demand calculation for the total demand calculation cycle, it first imports the demand calculation operation management information of the previous total demand calculation cycle, and determines the demand parameters (demand cycle and number of demand cycles) according to the demand calculation operation management information. If the reading fails, the default demand parameters are used. Then the demand calculation second task is performed, which is the demand data collection task and demand information calculation task for each demand cycle.

[0054] When the electric energy meter system is collecting demand data, it determines whether the rate has changed by judging whether the number of external windows of the system is 0 and whether the sliding buffer (storage tool, including general buffer and special buffer) is enabled. The external window is enabled when the rate changes, and is used to separately calculate the power load during the rate change. If the number of external windows is 0, it means that there has been no rate change in the current demand cycle, or the system does not need to calculate the demand separately for the rate change. The sliding buffer is usually used to store and accumulate power load data at a specific rate in order to calculate the demand. The activation of the sliding buffer indicates that the system has started to accumulate power load data in a new demand cycle; the non-activation of the sliding buffer indicates that the system has not yet started to accumulate data in a new demand cycle, or the current cycle has ended, but the new cycle has not yet started.

[0055] Furthermore, first determine whether the number of external windows is 0. If the number of external windows is 0, it means that the rate has not changed. Then read the instantaneous power of the current demand period, and continue to determine whether there is an external window enabled. If not, the collected demand data is accumulated and stored in a common buffer (reducing the possibility of data loss); if so, it is determined that a rate change has occurred, and the collected demand data is accumulated and stored in a dedicated buffer, and is marked accordingly (rate number and demand period index).

[0056] If the external window is not 0, that is, there is an external window, get the current rate number, and then determine whether the storage tool is to be started: If it is in the waiting state, the current rate number and the demand cycle index are identified for the storage tool corresponding to the current sliding window according to the current rate number, and then the instantaneous power is read to determine whether the external window is enabled. If it is not enabled, it means that the rate has not changed. At this time, the instantaneous power can be accumulated in the general buffer for storage; if it is enabled, it means that the rate has changed, and the instantaneous power is accumulated in the dedicated buffer corresponding to the external window for storage; If it is in the startup state, determine whether the current rate number and the rate number of the corresponding current sliding window (corresponding to the current storage tool) are the same. If they are the same, directly store them in the storage buffer corresponding to the current sliding window. If they are different, determine whether there is an applicable external window. If the existing external windows are not applicable, enable a new additional window, that is, enable the corresponding new dedicated buffer, and then read the instantaneous power to determine whether the new additional window (new dedicated buffer) is enabled. If it is enabled, the instantaneous power is accumulated and stored in the new additional window. If it is not enabled, the instantaneous power is accumulated and stored in the general buffer.

[0057] At this point, the collection of demand data for the demand cycle has been completed. At this time, it is determined whether the current time is the end time point of a demand cycle. If so, the demand information (i.e., the maximum average power) is obtained based on the collected demand data. If the demand information at this time is greater than the existing demand information, the demand information is replaced until the meter is powered off, indicating that the current total demand calculation cycle has ended. At this time, the demand calculation operation management information of the current total demand calculation cycle is saved, including the general buffer, special buffer and demand parameters, for synchronization when the demand calculation task is restarted next time the power is turned on.

[0058] The embodiment of the present application sets up a general storage tool and a special storage tool to store the acquired demand data in the general storage tool and the special storage tool according to the data type. Each storage tool stores specific demand data. Compared with the prior art, some repeated and redundant data are reduced, thereby saving memory resources. At the same time, complete demand data is stored by the general storage tool and the special storage tool. When performing demand calculation, different types of demand value information can be obtained in a targeted manner. On the basis of ensuring the integrity of the demand calculation of the electric energy meter, memory consumption is reduced and material costs are reduced.

[0059] like Figure 3 As shown, it is a schematic diagram of the overall flow of a demand calculation device for an instrument provided in an embodiment of the present invention. A demand calculation device provided in this embodiment includes: An acquisition module, used to acquire preset demand parameters and storage tools, the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools; A collection module, for collecting demand data of a first demand period in a current demand calculation total period based on demand parameters, and storing the demand data in a corresponding storage tool according to a data type, wherein the data type includes initial rate data and change rate data; A first calculation module, configured to calculate demand information of a first demand period based on the storage tool and the corresponding demand data stored in the storage tool; A loop module, used for returning to execute based on the demand parameter, collecting the demand data of the second demand period in the current demand calculation total period, until the demand information corresponding to the same number of demand periods as the number of demand periods is obtained; The second calculation module is used to calculate the demand value information of the current demand calculation total period based on all demand information.

[0060] The specific implementation of a demand calculation device disclosed in an embodiment of the present application is the same as the specific implementation of a demand calculation method disclosed in the above embodiment, and will not be repeated here.

[0061] An embodiment of the present application further discloses a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the computer program, a demand calculation method in the above embodiment is adopted.

[0062] The computer device may be a desktop computer, a laptop computer, a cloud server or other computer device, and the computer device includes but is not limited to a processor and a memory. For example, the computer device may also include an input and output device, a network access device, and a bus.

[0063] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0064] Among them, the memory can be an internal storage unit of a computer device, such as a hard disk or memory of a computer device, or an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the computer device, and the memory can also be a combination of an internal storage unit and an external storage device of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.

[0065] Among them, through this computer device, the demand calculation method in the above embodiment is stored in the memory of the computer device, and is loaded and executed on the processor of the computer device, which is convenient for use.

[0066] The embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the demand calculation method in the above embodiment is adopted.

[0067] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.

[0068] Among them, through this computer-readable storage medium, the demand calculation method in the above embodiment is stored in the computer-readable storage medium, and is loaded and executed on the processor to facilitate the storage and application of the above demand calculation method.

[0069] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for calculating the demand of an instrument, characterized in that: include: Obtaining preset demand parameters and storage tools, wherein the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools; Based on the demand parameters, collecting demand data of a first demand period in the current demand calculation total period, and storing the demand data in the corresponding storage tool according to the data type, the data type including initial rate data and change rate data; Based on the storage tool and the corresponding demand data stored in the storage tool, calculating demand information for a first demand period; Returning to execute based on the demand parameter, collecting demand data of the second demand period in the current demand calculation total period, until demand information corresponding to the same number of demand periods as the number of demand periods is obtained; Based on all the demand information, the demand value information of the current demand calculation total period is calculated.

2. The demand calculation method according to claim 1, characterized in that: The universal storage tool is used to store initial rate data corresponding to the initial rate number, and the dedicated storage tool is used to store variable rate data corresponding to a rate number different from the initial rate number, and one dedicated storage tool corresponds to one rate number.

3. The demand calculation method according to claim 2, characterized in that: The collecting demand data of the first demand period in the total demand calculation period of the current demand, and storing the demand data in the corresponding storage tool according to the data type, comprises: Get the initial rate for the total period of current demand calculation; Collecting and obtaining demand data for a first demand period, and determining a real-time rate based on the demand data; Determine whether a rate change occurs within the first demand period based on the initial rate and the real-time rate, determine the data type of the demand data based on the determination result, and store the demand data in a corresponding storage tool according to the data type of the demand data.

4. The demand calculation method according to claim 3, characterized in that: Determining the data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data, includes: When no rate change occurs within the first demand period, the demand data is determined to be initial rate data, the initial rate data is accumulated and stored in the universal storage tool, and an initial rate number and a first demand period index are identified for the universal storage tool.

5. The demand calculation method according to claim 4, characterized in that: Determining the data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data, includes: When a rate change occurs within the first demand period, determining the demand data before the rate change moment as the initial rate data, accumulating and storing the initial rate data in a universal storage tool, and identifying the initial rate number and the first demand period index for the universal storage tool; Determine the demand data after the rate change moment as the changed rate data, accumulate and store the changed rate data into a dedicated storage tool, and identify the changed rate number and the first demand cycle index for the dedicated storage tool.

6. The demand calculation method according to claim 4, characterized in that: Determining the data type of the demand data based on the judgment result, and storing the demand data in a corresponding storage tool according to the data type of the demand data, includes: When multiple rate changes occur within the first demand cycle, the demand data before the first rate change is determined as the initial rate data, the initial rate data is accumulated and stored in the universal storage tool, and the initial rate number and the first demand cycle index are identified for the universal storage tool Determine the demand data after the first rate change moment as the first change rate data, accumulate and store the first change rate data into a first dedicated storage tool, and identify the change rate number and the first demand period index for the first dedicated storage tool; Determine the demand data after the second rate change moment as the second change rate data, accumulate and store the second change rate data into a second dedicated storage tool, and identify the change rate number and the first demand period index for the second dedicated storage tool; This process is repeated in this way until the demand data corresponding to all different variable rate numbers are stored in the corresponding storage tools, and the rate numbers and first demand cycle indexes corresponding to all the storage tools are obtained.

7. The demand calculation method according to any one of claims 1 to 6, characterized in that: The calculation obtains the demand value information of the total demand calculation period, including: When calculating the total demand value, determining the effective demand information of the general storage tool and the dedicated storage tool, accumulating and averaging the effective demand information, and obtaining the total demand value of the total demand calculation period; When calculating the demand value corresponding to each rate number, the effective demand information of the general storage tool and the special storage tool is determined, and the effective demand information in the storage tool corresponding to each rate number is accumulated and averaged to obtain the demand value corresponding to each rate number.

8. A demand calculation device for an instrument, characterized in that: include: An acquisition module, used to acquire preset demand parameters and storage tools, wherein the demand parameters include demand cycles and demand cycle numbers, and the storage tools include general storage tools and special storage tools; A collection module, used for collecting demand data of a first demand period in a current demand calculation total period based on the demand parameters, and storing the demand data in the corresponding storage tool according to the data type, wherein the data type includes initial rate data and change rate data; A first calculation module, configured to calculate demand information of a first demand period based on the storage tool and the corresponding demand data stored in the storage tool; A loop module, used for returning to execute based on the demand parameter, collecting demand data of the second demand period in the current demand calculation total period, until demand information corresponding to the same number of demand periods as the number of demand periods is obtained; The second calculation module is used to calculate the demand value information of the current demand calculation total period based on all the demand information.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the demand calculation method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the demand calculation method according to any one of claims 1 to 7 are implemented.