Anti-interference processing method and device for instantaneous quantity of measuring instrument
Through the initialization and difference sorting methods, the instantaneous quantity of the measuring instrument is updated cycleically, solving the sampling offset problem of the measuring instrument under static electricity and surge interference, and improving sampling accuracy and data accuracy.
Patent Information
- Application Number
- CN202510336044.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-03-21
AI Technical Summary
During operation, measurement instruments are susceptible to interference such as static electricity and surges, resulting in the offset of the instantaneous sampling value, and the anti-interference method of the prior art is not effective.
By initializing the instantaneous amount of the measuring instrument, multiple instantaneous amounts are obtained in a loop, the absolute value of the difference is calculated and the order is sorted, and the average value of the first M minimum difference values is taken as the updated instantaneous amount until the preset cycle termination condition is met.
The sampling accuracy of the instantaneous meter measurement instrument is improved, the influence of interference such as static electricity and surge is avoided, and the accuracy of data is enhanced.
Smart Images

Figure CN119845308B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of measuring instruments, and particularly to an anti-interference processing method and device for instantaneous quantities of measuring instruments. Background Art
[0002] This section aims to provide background or context for the embodiments of the present invention described in the claims. The descriptions herein are not admitted to be prior art merely by virtue of being included in this section.
[0003] Measuring instruments such as measuring terminals and concentrators are all equipped with instantaneous quantity functions, including voltage, current, power, temperature, etc. Since these instantaneous quantity sensors are prone to being interfered by static electricity, surges, etc. during operation, resulting in sudden changes in the sampled values, the traditional method is to take the average of the samples, or to remove the maximum and minimum values before taking the average. In the case of a large number of interference values, the value of the instantaneous quantity is still likely to deviate, resulting in a display error. Summary of the Invention
[0004] Embodiments of the present invention provide an anti-interference processing method for instantaneous quantities of measuring instruments to improve the sampling accuracy of the instantaneous quantity values of measuring instruments. The method includes:
[0005] Initialize the instantaneous quantity of the measuring instrument to obtain an initial instantaneous quantity;
[0006] Taking the initial instantaneous quantity as the initial value, loop to perform the operation of obtaining the optimal anti-interference instantaneous quantity, and the following operations are performed in each loop period:
[0007] Obtain the instantaneous quantity of the current period;
[0008] According to the refresh period of the instantaneous quantity, connect to read N instantaneous quantities, where N is a positive integer greater than or equal to 10;
[0009] For each instantaneous quantity, calculate the absolute value of the difference between the instantaneous quantity and the instantaneous quantity of the previous period to obtain N absolute values of differences;
[0010] Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence:
[0011] In the sorted difference sequence, take the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2;
[0012] Take the average of the M original data taken out to obtain an updated instantaneous quantity;
[0013] When the preset loop termination condition is not satisfied, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next period to perform the next period loop operation until the updated instantaneous quantity corresponding to the period when the preset loop termination condition is satisfied is used as the optimal anti-interference instantaneous quantity.
[0014] An embodiment of the present invention further provides an anti-interference processing device for instantaneous quantities of a measuring instrument, which is used to improve the sampling accuracy of the instantaneous quantity value of the measuring instrument. The device includes:
[0015] An initialization unit, configured to initialize the instantaneous quantity of the measuring instrument to obtain an initial instantaneous quantity;
[0016] A loop update unit, configured to use the initial instantaneous quantity as an initial value and loop to execute an operation to obtain an optimal anti-interference instantaneous quantity. The following operations are performed in each loop period:
[0017] Obtain the instantaneous quantity of the measuring instrument in the current period;
[0018] According to the refresh period of the instantaneous quantity measuring instrument, connect to read N instantaneous quantities, where N is a positive integer greater than or equal to 10;
[0019] For each instantaneous quantity, calculate the absolute value of the difference between the instantaneous quantity and the instantaneous quantity in the previous period to obtain N absolute values of differences;
[0020] Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence:
[0021] In the sorted difference sequence, take the first M original data corresponding to the M smallest differences, where M is a positive integer less than N and greater than or equal to 2;
[0022] Take the average of the M original data taken out to obtain an updated instantaneous quantity;
[0023] An optimal anti-interference instantaneous quantity determination unit, configured to, when the preset loop termination condition is not satisfied, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next period to perform the next period loop operation until the updated instantaneous quantity corresponding to the period when the preset loop termination condition is satisfied is used as the optimal anti-interference instantaneous quantity.
[0024] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above anti-interference method for the instantaneous quantity of the measuring instrument is implemented.
[0025] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above anti-interference method for the instantaneous quantity of the measuring instrument is implemented.
[0026] An embodiment of the present invention further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the above anti-interference method for the instantaneous quantity of the measuring instrument is implemented.
[0027] Compared with the prior art in which, in order to avoid the instantaneous quantity sensor being easily interfered by static electricity, surges, etc. during operation, resulting in mutations in the sampling value, anti-interference methods such as taking the average of the samples or removing the maximum and minimum values before taking the average are adopted, and the value of the instantaneous quantity is still prone to deviation. The anti-interference processing solution for the instantaneous quantity of the measuring instrument provided by the embodiments of the present invention includes: initializing the instantaneous quantity of the measuring instrument to obtain the initial instantaneous quantity; taking the initial instantaneous quantity as the initial value, and cyclically executing the operation of obtaining the optimal anti-interference instantaneous quantity. Each cycle period performs the following operations: obtaining the instantaneous quantity of the current period; according to the refresh period of the instantaneous quantity, continuously reading N instantaneous quantities, where N is a positive integer greater than or equal to 10; for each instantaneous quantity, calculating the absolute value of the difference between the instantaneous quantity and the instantaneous quantity of the previous period to obtain N absolute values of differences; sorting the N absolute values of differences from smallest to largest to generate a sorted difference sequence; in the sorted difference sequence, taking the M original data corresponding to the M smallest differences, where M is a positive integer less than N and greater than or equal to 2; taking the average of the M original data taken out to obtain the updated instantaneous quantity; when the preset loop termination condition is not satisfied, using the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next period to perform the next period loop operation until the updated instantaneous quantity corresponding to the period when the preset loop termination condition is satisfied is used as the optimal anti-interference instantaneous quantity, which can avoid the interference of static electricity, surges, etc. that the instantaneous quantity measuring instrument is easily subjected to during operation and improve the sampling accuracy of the instantaneous quantity value of the measuring instrument. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:
[0029] Figure 1 is a schematic flowchart of the anti-interference processing method for the instantaneous quantity of the measuring instrument in the embodiments of the present invention;
[0030] Figure 2 is a schematic flowchart of the anti-interference processing method for the instantaneous quantity of the measuring instrument in another embodiment of the present invention;
[0031] Figure 3 is a schematic flowchart of the anti-interference processing method for the instantaneous quantity of the measuring instrument in yet another embodiment of the present invention;
[0032] Figure 4 is a schematic flowchart of the anti-interference processing method for the instantaneous quantity of the measuring instrument in yet another embodiment of the present invention;
[0033] Figure 5 It is a schematic structural diagram of an anti-interference processing device for the instantaneous quantity of a measuring instrument in an embodiment of the present invention;
[0034] Figure 6 It is a schematic structural diagram of a computer device according to an embodiment of the present invention. Specific embodiments
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0036] In the technical solution of this application, the acquisition, storage, use, processing, etc. of data all comply with the relevant regulations of national laws and regulations.
[0037] Figure 1 It is a schematic flowchart of an anti-interference processing method for the instantaneous quantity of a measuring instrument in an embodiment of the present invention. As Figure 1 shown, the method includes the following steps:
[0038] Step 101: Initialize the instantaneous quantity of the measuring instrument to obtain the initial instantaneous quantity;
[0039] Step 102: Using the initial instantaneous quantity as the initial value, repeatedly execute the operation of obtaining the optimal anti-interference instantaneous quantity. Each cycle period performs the following operations:
[0040] Step 1021: Obtain the instantaneous quantity of the current period;
[0041] Step 1022: According to the refresh period of the instantaneous quantity, connect to read N instantaneous quantities, where N is a positive integer greater than or equal to 10;
[0042] Step 1023: For each instantaneous quantity, calculate the absolute value of the difference between the instantaneous quantity and the instantaneous quantity of the previous period to obtain N absolute values of differences;
[0043] Step 1024: Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence;
[0044] Step 1025: In the sorted difference sequence, take the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2;
[0045] Step 1026: Take the average of the M original data taken out to obtain the updated instantaneous quantity;
[0046] Step 103: When the preset loop termination condition is not met, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next cycle for the next cycle of loop operation until the updated instantaneous quantity corresponding to the cycle when the preset loop termination condition is met is used as the optimal anti-interference instantaneous quantity.
[0047] As can be seen from Figure 1 it, the anti-interference processing method for the instantaneous quantity of the measuring instrument provided by the embodiment of the present invention works as follows: Initialize the instantaneous quantity of the measuring instrument to obtain the initial instantaneous quantity; Use the initial instantaneous quantity as the initial value and loop to perform the operation of obtaining the optimal anti-interference instantaneous quantity. The following operations are performed in each loop cycle: Obtain the instantaneous quantity of the measuring instrument in the current cycle; According to the refresh period of the instantaneous quantity, connect and read N instantaneous quantities, where N is a positive integer greater than or equal to 10; For each instantaneous quantity, calculate the absolute value of the difference between this instantaneous quantity and the instantaneous quantity in the previous cycle to obtain N absolute values of differences; Sort the N absolute values of differences from small to large to generate a sorted difference sequence; In the sorted difference sequence, take the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2; Take the average of the M original data taken out to obtain the updated instantaneous quantity; When the preset loop termination condition is not met, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next cycle for the next cycle of loop operation until the updated instantaneous quantity corresponding to the cycle when the preset loop termination condition is met is used as the optimal anti-interference instantaneous quantity.
[0048] Compared with the prior art in which, in order to avoid the sampling value from mutating due to interference such as static electricity and surges that the instantaneous quantity sensor is prone to during operation, the anti-interference method of taking the average of samples or removing the maximum and minimum values before taking the average is adopted, and the value of the instantaneous quantity is still prone to deviation, the anti-interference processing method for the instantaneous quantity of the measuring instrument provided by the embodiment of the present invention can avoid the interference such as static electricity and surges that the instantaneous quantity measuring instrument is prone to during operation and improve the sampling accuracy of the instantaneous quantity value of the measuring instrument. The following is a detailed introduction to the anti-interference processing method for the instantaneous quantity of the measuring instrument.
[0049] The embodiment of the present invention provides an anti-interference processing method for the instantaneous quantity of a measuring instrument. The method first initializes an instantaneous quantity and then continuously reads multiple instantaneous quantity data. Then, calculate the absolute value of the difference between each read data and the initial instantaneous quantity, and sort these differences. And select several data with the smallest differences among them, and calculate their average value as the new instantaneous quantity. This algorithm utilizes the inherent law of the change of the instantaneous quantity in a short time, improves the anti-interference ability of the instantaneous value, and improves the accuracy of the data. The following is a detailed introduction.
[0050] In one embodiment, in the above step 101, the types of the instantaneous quantity may include: voltage, current, power, and temperature.
[0051] In specific implementation, the types of the above instantaneous quantities may further include: humidity, power, etc.
[0052] In the above step 102, step 102 is a process of cyclic optimization: taking the initial instantaneous quantity as the initial value, cyclically performing the operation of obtaining the optimal anti-interference instantaneous quantity, and the following operations are performed in each cycle period:
[0053] Step 1021: Obtain the instantaneous quantity of the measuring instrument in the current period; for example, if it is the first period, then the instantaneous quantity of the measuring instrument in the current period is the above initial instantaneous quantity;
[0054] Step 1022: Connect and read N instantaneous quantities according to the refresh period of the instantaneous quantity, where N is a positive integer greater than or equal to 10;
[0055] Step 1023: For each instantaneous quantity, calculate the absolute value of the difference between the instantaneous quantity and the instantaneous quantity in the previous period, and obtain N absolute values of differences;
[0056] Step 1024: Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence;
[0057] Step 1025: In the sorted difference sequence, take the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2;
[0058] Step 1026: Take the average of the M original data taken out to obtain the updated instantaneous quantity.
[0059] In one embodiment, in the above step 103, the preset loop termination condition is to satisfy the preset number of loop periods.
[0060] In specific implementation, the preset loop termination condition may also be that the value of the updated instantaneous quantity is within the preset condition threshold range.
[0061] In one embodiment, as Figure 2 shown, the above anti-interference processing method for the instantaneous quantity of the measuring instrument may further include step 104: adjusting N and M according to the intensity of interference suffered by the instantaneous quantity during operation to achieve the optimal anti-interference effect.
[0062] In specific implementation, adjusting N and M according to the intensity of interference suffered by the instantaneous quantity during operation can further improve the accuracy of the optimal anti-interference instantaneous quantity, and thus achieve the optimal anti-interference effect.
[0063] In one embodiment, N and M are adjusted according to the intensity of the interference received by the instantaneous quantity during operation to achieve the optimal anti-interference effect, including: adjusting N and M according to an optimization adjustment model, where the optimization adjustment model is pre-trained and generated based on the relationship samples between the interference intensity data and the N and M values.
[0064] Specifically, the marked interference intensity data and the N and M value sample data can be used to pre-train and generate an optimization adjustment model. After the model is generated, the optimization adjustment model is used to predict and determine the N and M values. The input of the optimization adjustment model can be the current interference intensity data, and the output of the optimization adjustment model can be the N and M values. Adjusting the N and M values according to the optimization adjustment model can improve the prediction accuracy and efficiency of the N and M values, and further improve the accuracy and efficiency of the optimal anti-interference instantaneous quantity.
[0065] In one embodiment, as Figure 3 shown, the above anti-interference processing method for the instantaneous quantity of the measuring instrument may further include step 105: optimizing and adjusting the refresh period of the instantaneous quantity of the measuring instrument after a preset time period.
[0066] Specifically, optimizing and adjusting the refresh period of the instantaneous quantity of the measuring instrument after a preset time period can further improve the accuracy of the optimal anti-interference instantaneous quantity, and thus achieve the optimal anti-interference effect.
[0067] To facilitate understanding of how the present invention is implemented, the following is Figure 4 illustrated by an example.
[0068] The operation flow of the anti-interference processing method for the instantaneous quantity provided by the embodiment of the present invention is as Figure 4 shown:
[0069] 1. Initialize the instantaneous quantity f init, that is, the above step 101,
[0070] 2. Connect and read N instantaneous quantities according to the refresh period of the sensor (such as voltage) f 1, f 2,..., fN . The minimum value of N is 10;
[0071] 3. For each instantaneous quantity fn ( n = 1, 2,..., N ), calculate the absolute value of the difference between it and the initial instantaneous quantity f init: Δ xn = ∣ fn − f init∣, generating N differences: Δ x 1, Δ x2, …, Δ xN;
[0072] 4. For N the difference Δ xn perform a sorting from small to large to generate a sorted difference sequence: Δ y 1, Δ y 2, …, Δ yN;
[0073] 5. In the sorted difference sequence Δ y take out the M smallest fn, Take the first M(M < N) smallest differences corresponding to the original data fm;
[0074] 6. For the selected M original data fm take the average to obtain the updated instantaneous quantity f new;
[0075] The above steps 2 to 6 are the above step 102.
[0076] 7. Update f init to f new, jump to the second step, continue the next round of data reading and processing until the optimal instantaneous quantity is found, that is, the above step 103;
[0077] 8. Algorithmically, N and M can be adjusted according to the strength of the interference to achieve the optimal anti - interference effect, that is, the above step 104.
[0078] In summary, the beneficial technical effects of the anti - interference processing method for the instantaneous quantity of the measuring instrument provided by the embodiments of the present invention are as follows: This method utilizes the change of the instantaneous quantity in a short time, can avoid the interference such as static electricity and surges that the instantaneous quantity is prone to during operation, improves the anti - interference ability of the instantaneous value, and improves the sampling accuracy of the instantaneous quantity value of the measuring instrument.
[0079] Embodiments of the present invention also provide an anti - interference processing device for the instantaneous quantity of a measuring instrument, as described in the following embodiments. Since the principle of this device for solving problems is similar to that of the anti - interference processing method for the instantaneous quantity of a measuring instrument, the implementation of this device can refer to the implementation of the anti - interference processing method for the instantaneous quantity of a measuring instrument, and the repeated parts will not be elaborated.
[0080] Figure 5 is a schematic structural diagram of the anti - interference processing device for the instantaneous quantity of a measuring instrument in the embodiments of the present invention. As Figure 5 shown, the device includes:
[0081] An initialization unit 01, configured to initialize the instantaneous quantity of the measuring instrument to obtain an initial instantaneous quantity;
[0082] A cyclic update unit 02, which is used to take the initial instantaneous quantity as the initial value and cyclically execute the operation of obtaining the optimal anti-interference instantaneous quantity. The following operations are performed in each cycle period:
[0083] Obtain the instantaneous quantity of the measuring instrument in the current period;
[0084] According to the refresh period of the instantaneous quantity, connect and read N instantaneous quantities, where N is a positive integer greater than or equal to 10;
[0085] For each instantaneous quantity, calculate the absolute value of the difference between the instantaneous quantity and the instantaneous quantity in the previous period to obtain N absolute values of differences;
[0086] Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence;
[0087] In the sorted difference sequence, take the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2;
[0088] Take the average of the M original data taken out to obtain the updated instantaneous quantity;
[0089] An optimal anti-interference instantaneous quantity determination unit 103, which is used to, when the preset loop termination condition is not satisfied, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next period to perform the next period loop operation until the updated instantaneous quantity corresponding to the period when the preset loop termination condition is satisfied is used as the optimal anti-interference instantaneous quantity.
[0090] In one embodiment, the anti-interference processing device for the instantaneous quantity of the measuring instrument may further include: a first optimization and adjustment unit, which is used to adjust N and M according to the intensity of interference received by the instantaneous quantity measuring instrument during operation to achieve the optimal anti-interference effect.
[0091] In one embodiment, the first optimization and adjustment unit is specifically used to: adjust N and M according to an optimization and adjustment model, and the optimization and adjustment model is pre-trained and generated in advance according to the relationship samples between the intensity data of interference and the values of N and M.
[0092] In one embodiment, the types of the instantaneous quantity include: voltage, current, power, and temperature.
[0093] In one embodiment, the preset loop termination condition is to meet the preset number of loop periods.
[0094] In one embodiment, in one embodiment, the anti-interference processing device for the instantaneous quantity of the measuring instrument may further include a second optimization and adjustment unit, which is used to: optimize and adjust the refresh period of the instantaneous quantity of the measuring instrument after a preset time period.
[0095] Based on the foregoing inventive concept, as Figure 6 shown, the present invention further provides a computer device 500, including a memory 510, a processor 520, and a computer program 530 stored on the memory 510 and executable on the processor 520. When the processor 520 executes the computer program 530, the foregoing fund information processing method is implemented.
[0096] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the anti-interference processing method for the instantaneous quantity of the measuring instrument described above is implemented.
[0097] An embodiment of the present invention further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the anti-interference processing method for the instantaneous quantity of the measuring instrument described above is implemented.
[0098] Compared with the prior art in which, in order to avoid the instantaneous quantity sensor being easily interfered by static electricity, surges, etc. during operation, resulting in sudden changes in the sampling value, an anti-interference method of taking the average of samples or removing the maximum and minimum values before taking the average is adopted, and the value of the instantaneous quantity is still prone to deviation. The anti-interference processing solution for the instantaneous quantity of the measuring instrument provided by the embodiment of the present invention includes: initializing the instantaneous quantity of the measuring instrument to obtain an initial instantaneous quantity; using the initial instantaneous quantity as an initial value, and circularly executing the operation of obtaining the optimal anti-interference instantaneous quantity. Each cycle period performs the following operations: obtaining the instantaneous quantity of the measuring instrument in the current period; connecting and reading N instantaneous quantities according to the refresh period of the instantaneous quantity, where N is a positive integer greater than or equal to 10; for each instantaneous quantity, calculating the absolute value of the difference between the instantaneous quantity and the instantaneous quantity in the previous period to obtain N absolute values of differences; sorting the N absolute values of differences from smallest to largest to generate a sorted difference sequence; in the sorted difference sequence, taking the M original data corresponding to the M smallest differences, where M is a positive integer less than N and greater than or equal to 2; taking the average of the M original data taken out to obtain an updated instantaneous quantity; when the preset cycle termination condition is not satisfied, using the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next period for the next period of circular operation until the updated instantaneous quantity corresponding to the period when the preset cycle termination condition is satisfied is used as the optimal anti-interference instantaneous quantity, which can avoid the interference of static electricity, surges, etc. that the instantaneous quantity is easily subjected to during operation and improve the sampling accuracy of the instantaneous quantity value of the measuring instrument.
[0099] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0100] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0101] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0103] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for anti-interference processing of instantaneous quantities of a measuring instrument, characterized in that, including: Initialize the instantaneous quantity of the measuring instrument to obtain the initial instantaneous quantity; Taking the initial instantaneous quantity as the initial value, repeatedly execute the operation of obtaining the optimal anti-interference instantaneous quantity. The following operations are performed in each cycle: Obtain the instantaneous quantity of the measuring instrument in the current cycle; According to the refresh cycle of the instantaneous quantity, continuously read N instantaneous quantities, where N is a positive integer greater than or equal to 10; For each instantaneous quantity, calculate the absolute value of the difference between this instantaneous quantity and the instantaneous quantity in the previous cycle, obtaining N absolute values of differences; Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence; In the sorted difference sequence, select the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2; Take the average of the M original data selected to obtain the updated instantaneous quantity; When the preset loop termination condition is not met, use the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next cycle to perform the next cycle operation until the updated instantaneous quantity corresponding to the cycle when the preset loop termination condition is met is used as the optimal anti-interference instantaneous quantity; Adjust N and M according to the intensity of interference suffered by the instantaneous quantity during operation to achieve the optimal anti-interference effect; Adjust N and M according to the intensity of interference suffered by the instantaneous quantity during operation to achieve the optimal anti-interference effect, including: adjusting N and M according to the optimization adjustment model, and the optimization adjustment model is pre-trained and generated according to the relationship samples between the intensity data of interference and the values of N and M; The preset loop termination condition is to meet the preset number of loop cycles; The preset loop termination condition can also be that the value of the updated instantaneous quantity is within the preset condition threshold range.
2. The method according to claim 1, wherein, The types of the instantaneous quantity include: voltage, current, power, and temperature.
3. The method according to claim 1, characterized in that It also includes: After a preset time period, optimize and adjust the refresh cycle of the instantaneous quantity of the measuring instrument.
4. An anti-interference processing device for instantaneous quantities of a measuring instrument, characterized in that, including: An initialization unit for initializing the instantaneous quantity of the measuring instrument to obtain the initial instantaneous quantity; A loop update unit for taking the initial instantaneous quantity as the initial value and repeatedly executing the operation of obtaining the optimal anti-interference instantaneous quantity. The following operations are performed in each cycle: Obtain the instantaneous quantity of the measuring instrument in the current cycle; According to the refresh cycle of the instantaneous quantity, continuously read N instantaneous quantities, where N is a positive integer greater than or equal to 10; For each instantaneous quantity, calculate the absolute value of the difference between this instantaneous quantity and the instantaneous quantity in the previous cycle, obtaining N absolute values of differences; Sort the N absolute values of differences from smallest to largest to generate a sorted difference sequence; In the sorted difference sequence, select the M original data corresponding to the first M smallest differences, where M is a positive integer less than N and greater than or equal to 2; Take the average of the M original data selected to obtain the updated instantaneous quantity; An optimal anti-interference instantaneous quantity determination unit for, when the preset loop termination condition is not met, using the updated instantaneous quantity as the instantaneous quantity of the measuring instrument in the next cycle to perform the next cycle operation until the updated instantaneous quantity corresponding to the cycle when the preset loop termination condition is met is used as the optimal anti-interference instantaneous quantity; Adjust N and M according to the intensity of interference suffered by the instantaneous quantity during operation to achieve the optimal anti-interference effect; Adjust N and M according to the intensity of interference suffered by the instantaneous quantity during operation to achieve the optimal anti-interference effect, including: adjusting N and M according to the optimization adjustment model, and the optimization adjustment model is pre-trained and generated in advance according to the relationship samples between the interference intensity data and the values of N and M; The preset loop termination condition is to meet the preset number of loop periods.
5. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 3.
7. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Lithium battery energy storage adaptive high-precision electric quantity metering method and system and storage medium
CN114325429A
Method and system for improving output stability of instrument and readable storage medium
CN117804504A