Data writing file verification method suitable for intelligent power consumption terminal

文档序号:168556 发布日期:2021-10-29 浏览:17次 中文

阅读说明:本技术 适用于智能用电终端的数据写文件校验方法 (Data writing file verification method suitable for intelligent power consumption terminal ) 是由 张聪聪 邬科科 冯丹荣 于 2021-06-30 设计创作,主要内容包括:本发明涉及一种适用于智能用电终端的数据写文件校验方法,所述方法包括,S1、计算待写入的数据写入终端对应的文件中的存储位置P是否在所述文件的可供写入的地址范围内,若否,执行S2,若是,执行S3;S2、退出判断,产生告警;S3、执行后续的写操作判断。该方法提高了终端系统稳定性。(The invention relates to a data writing file checking method suitable for an intelligent power utilization terminal, which comprises the steps of S1, calculating whether a storage position P in a file corresponding to a data writing terminal to be written is in a writable address range of the file, if not, executing S2, and if so, executing S3; s2, quitting judgment and generating an alarm; and S3, executing subsequent write operation judgment. The method improves the stability of the terminal system.)

1. A data writing file verification method suitable for an intelligent power consumption terminal is characterized by comprising the following steps: the method comprises the following steps of,

s1, calculating whether the storage position P in the file corresponding to the data writing terminal to be written is in the address range of the file available for writing, if not, executing S2, and if so, executing S3;

s2, quitting judgment and generating an alarm;

and S3, executing subsequent write operation judgment.

2. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 1, wherein: the subsequent write operation judgment in S3 specifically includes,

s31, judging whether the last position of the storage position P exists or not, if so, executing S32, and if not, executing S33;

s32, comparing the size between the data stored in the last position and the data to be written, and performing corresponding operation;

and S33, if not, directly comparing the size of the data to be written with the size of the file, and performing subsequent operation.

3. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 2, wherein:

the performing of the corresponding operation in step S32 specifically includes, when it is determined that the size L1 of the data stored in the previous location is not equal to the size L of the data to be written, jumping to perform S2.

4. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 2, wherein:

the performing the corresponding operation in step S32 specifically includes writing the data to be written into the file correctly when it is determined that the size L1 of the data stored in the previous location is equal to the size L of the data to be written.

5. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 2, wherein:

the performing of the subsequent operation in the step S33 specifically includes jumping to perform S2 when the size L of the data to be written exceeds the size L0 of the file.

6. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 2, wherein:

the performing of the subsequent operation in step S33 specifically includes continuing to perform the determination between the data to be written and the data size fixed by the program when the size L of the data to be written is not greater than the size L0 of the file.

7. The data writing file verification method suitable for the intelligent power consumption terminal, according to claim 6, is characterized in that:

and the continuously executing the judgment between the data to be written and the data size fixed by the program comprises correctly writing the data to be written into the file when the size L of the data to be written is consistent with the data size fixed by the program.

8. The data writing file verification method suitable for the intelligent power consumption terminal, according to claim 6, is characterized in that:

the continuing of the determination between the data size to be written and the data size fixed by the program further includes jumping to S2 when the size L of the data to be written is not consistent with the data size fixed by the program.

9. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 1, wherein: the method further comprises before step S1,

s01, judging whether the file exists or not, if not, creating the file according to the size specified by the program, and executing S1, otherwise, directly executing S1.

10. The data writing file verification method suitable for the intelligent power consumption terminal as claimed in claim 7, wherein:

the method further comprises that after the data to be written is correctly written into the file, the terminal checks whether the file is correct every day, and when the file is correct, the terminal does not operate, otherwise, the terminal jumps to execute S2.

Technical Field

The invention relates to the field of intelligent power terminals, in particular to a data write file verification method suitable for an intelligent power terminal.

Background

Along with the wide application of the intelligent power utilization terminal, people have higher and higher requirements on the stability of the terminal, and meanwhile, have higher and higher requirements on the problem searching capability of the terminal and the error correction capability of the terminal.

However, after the current file writing operation is performed on the terminal, the terminal cannot find the file in time when an error occurs, and the problem is found only after a long time due to the lack of a self-checking mechanism of the terminal, which affects the working efficiency of the terminal.

Disclosure of Invention

In view of the above problems, an object of the present invention is to provide a data write file verification method suitable for an intelligent power consumption terminal, which can improve the stability and the working efficiency of the terminal by determining a file to ensure the correctness of a file write operation.

In order to achieve the purpose, the technical scheme of the invention is as follows: a data writing file verification method suitable for an intelligent power consumption terminal is characterized by comprising the following steps: the method comprises the following steps of,

s1, calculating whether the storage position P in the file corresponding to the data writing terminal to be written is in the address range of the file available for writing, if not, executing S2, and if so, executing S3;

s2, quitting judgment and generating an alarm;

and S3, executing subsequent write operation judgment.

Further, the determination of the subsequent write operation in S3 specifically includes,

s31, judging whether the last position of the storage position P exists or not, if so, executing S32, and if not, executing S33;

s32, comparing the size between the data stored in the last position and the data to be written, and performing corresponding operation;

and S33, if not, directly comparing the size of the data to be written with the size of the file, and performing subsequent operation.

Further, the performing corresponding operation in step S32 specifically includes, when it is determined that the size L1 of the data stored in the previous location is not equal to the size L of the data to be written, jumping to perform S2.

Further, the performing the corresponding operation in step S32 specifically includes writing the data to be written into the file correctly when it is determined that the size L1 of the data stored in the previous location is equal to the size L of the data to be written.

Further, the performing subsequent operations in step S33 specifically includes jumping to perform S2 when the size L of the data to be written exceeds the size L0 of the file.

Further, the performing of the subsequent operation in step S33 specifically includes continuing to perform the determination between the data to be written and the data size fixed by the program when the size L of the data to be written is not larger than the size L0 of the file.

Further, the continuously executing the judgment between the data to be written and the data size fixed by the program includes correctly writing the data to be written into the file when the size L of the data to be written is consistent with the data size fixed by the program.

Further, the continuing to perform the determination between the data to be written and the data size fixed by the program further includes jumping to perform S2 when the size L of the data to be written is not consistent with the data size fixed by the program.

Further, the method further comprises, before step S1,

s01, judging whether the file exists or not, if not, creating the file according to the size specified by the program, and executing S1, otherwise, directly executing S1.

Further, the method further includes, after the data to be written is correctly written into the file, the terminal checking whether the file is correct every day, and when correct, not operating, otherwise, jumping to execute S2.

Compared with the prior art, the invention has the advantages that:

by judging whether the position to be written in the data accords with the normal address range of the file, the size between the data and the file and the like before the data is written in the file, an error problem detection mechanism can be preposed, the problem can be prevented in advance through automatic verification of the terminal, the problems that a terminal system is unstable and the working efficiency is low due to the fact that the data is exposed after being written in are prevented, and the overall performance of the terminal is improved.

Drawings

Fig. 1 is a flowchart of a data write file inspection method suitable for an intelligent power consumption terminal according to the method of the present application.

Detailed Description

Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.

The data write file verification method applicable to the intelligent power consumption terminal of the present application as shown in fig. 1 includes,

s1, calculating whether the storage position P in the file corresponding to the data writing terminal to be written is in the address range of the file available for writing, if not, executing S2, and if so, executing S3;

s2, quitting judgment and generating an alarm;

and S3, executing subsequent write operation judgment.

By judging whether the corresponding storage position of the data to be written in the file, namely the index, is in a correct range, the first-layer detection protection of the data writing file operation is realized, the problems that the data is exposed after being written in and the terminal system is unstable and the working efficiency is low are effectively prevented, and the self-checking function and the overall performance of the system are improved.

It should be mentioned that the storage location P is calculated from the current time of the terminal, which is a common technical knowledge for those skilled in the art and is not described in detail here.

Specifically, the subsequent write operation judgment in S3 specifically includes,

s31, judging whether the last position of the storage position P exists, if so, executing S32, and if not, executing S33;

s32, comparing the size between the data stored in the last position and the data to be written, and carrying out corresponding operation;

and S33, if not, directly comparing the size of the data to be written with the size of the file, and performing subsequent operation.

And judging whether the last position of the storage position P exists or not, comparing and judging the size between the data stored in the last position and the data to be written, and setting a second-layer data problem self-checking guarantee mechanism, thereby further improving the correctness of data writing.

The corresponding operation in step S32 specifically includes, when it is determined that the size L1 of the data stored in the previous location is not equal to the size L of the data to be written, exiting the determination, and generating an alarm; and when the size L1 of the data stored in the last position is judged to be equal to the size L of the data to be written, the data to be written is correctly written into the file.

The subsequent operation in step S33 specifically includes exiting the determination and generating an alarm when the size L of the data to be written exceeds the size L0 of the file, and otherwise, continuing to perform the determination between the size of the data to be written and the size of the data fixed by the program.

That is, when the size L of the data to be written is consistent with the size of the data fixed by the program, the data to be written is correctly written into the file, and when the size L of the data to be written is inconsistent with the size of the data fixed by the program, the judgment is exited, and an alarm is generated. Therefore, the correctness of data writing in the file is ensured through layer-by-layer detection, and the stability and the working efficiency of the terminal system are improved.

In order to further ensure the stability of the system function, the method also comprises that after the data to be written is correctly written into the file, the terminal also checks whether the file is correct every day, when the file is detected to be correct, the operation is not carried out, otherwise, the judgment is quitted, and an alarm is generated.

Meanwhile, the present application further includes, before step S1,

and S01, judging whether the file exists or not, if not, creating the file according to the size specified by the program, and executing S1, otherwise, directly executing S1, thereby realizing the automatic detection and calculation function of the terminal through a layer-by-layer detection mechanism, being efficient and direct, having an identification mechanism for the misoperation of data, being capable of automatically calibrating, and enabling the system to be more stable.

While embodiments of the invention have been shown and described, it will be understood by those skilled in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种能源控制器容器状态监控方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!