CN113568767B - Data writing file verification method suitable for intelligent power utilization terminal - Google Patents
Data writing file verification method suitable for intelligent power utilization terminal Download PDFInfo
- Publication number
- CN113568767B CN113568767B CN202110732420.9A CN202110732420A CN113568767B CN 113568767 B CN113568767 B CN 113568767B CN 202110732420 A CN202110732420 A CN 202110732420A CN 113568767 B CN113568767 B CN 113568767B
- Authority
- CN
- China
- Prior art keywords
- data
- written
- file
- size
- executing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title abstract description 14
- 238000012795 verification Methods 0.000 title abstract description 7
- 238000001514 detection method Methods 0.000 description 5
- 230000003203 everyday effect Effects 0.000 description 2
- 230000009191 jumping Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/006—Identification
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a data writing file verification method suitable for an intelligent power utilization terminal, which comprises the following steps of S1, calculating whether a storage position P in a file corresponding to the data writing terminal to be written is in an address range of the file which can be written, if not, executing S2, and if so, executing S3; s2, exiting judgment, and generating an alarm; s3, executing subsequent write operation judgment. The method improves the stability of the terminal system.
Description
Technical Field
The invention relates to the field of intelligent power utilization terminals, in particular to a data writing file verification method suitable for an intelligent power utilization terminal.
Background
Along with the wide application of intelligent power utilization terminals, the requirements of people on the stability of the terminals are higher and higher, and meanwhile, the requirements on the problem searching capability of the terminals and the error correction capability of the terminals are higher and higher.
However, the current file writing operation cannot be found in time when errors occur after the file is written into the terminal, and the problem is found after a long time due to the fact that the terminal lacks a self-checking mechanism, so that the working efficiency of the terminal is affected.
Disclosure of Invention
In view of the above problems, the present invention aims to ensure the correctness of the file writing operation by judging the file, so as to improve the stability and the working efficiency of the terminal.
In order to achieve the above purpose, the technical scheme of the invention is as follows: a data writing file verification method suitable for an intelligent power utilization terminal is characterized in that: the method may include the steps of,
S1, calculating whether a storage position P in a file corresponding to a data writing terminal to be written is in an address range of the file which can be written, if not, executing S2, and if so, executing S3;
s2, exiting judgment, and generating an alarm;
S3, executing subsequent write operation judgment.
Further, the subsequent judgment of the writing operation 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 performing corresponding operation;
And S33, if not, directly comparing the size of the data to be written with the file, and performing subsequent operation.
Further, the performing the corresponding operation in step S32 specifically includes performing step S2 when it is determined that the size L1 of the data stored in the previous location is different from the size L of the data to be written.
Further, the performing the corresponding operation in step S32 specifically further includes correctly writing the data to be written into the file 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 the subsequent operation in step S33 specifically includes skipping to execute S2 when the size L of the data to be written exceeds the size L0 of the file.
Further, the performing the subsequent operation in step S33 specifically further includes, when the size L of the data to be written is not greater than the size L0 of the file, continuing to perform the judgment between the data to be written and the data size fixed by the program.
Further, the step of continuing to perform 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 data size L to be written is consistent with the data size fixed by the program.
Further, the step of continuing to perform the judgment between the data to be written and the data size fixed by the program further includes performing step S2 when the size L of the data to be written is inconsistent with the data size fixed by the program.
Further, the method further comprises, 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, executing S1, and otherwise, directly executing S1.
Further, the method further comprises the step 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 step S2 is performed in a jumping mode.
Compared with the prior art, the invention has the advantages that:
By judging whether the position where the data is to be written 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 into the file, an error problem detection mechanism can be preposed, and the problem is prevented in advance by automatic verification of the terminal, so that the problems of unstable terminal system and low working efficiency caused by the problem of re-exposure after the data is written are prevented, and the overall performance of the terminal is improved.
Drawings
FIG. 1 is a flow chart of a method of verifying a data write file for an intelligent power terminal according to the method of the present application.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
The data write file verification method for an intelligent power consumption terminal of the present application as shown in fig. 1, the method comprising,
S1, calculating whether a storage position P in a file corresponding to a data writing terminal to be written is in an address range of the file which can be written, if not, executing S2, and if so, executing S3;
s2, exiting judgment, and generating an alarm;
S3, executing subsequent write operation judgment.
By judging whether the corresponding storage position, namely the index, in the file to be written with the data is in the correct range, the first layer detection protection of the data writing file operation is realized, the problem that the data is exposed after being written is effectively prevented, the unstable terminal system and the low working efficiency are caused, 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 a person skilled in the art, and is not developed in detail here.
Specifically, the subsequent judgment of the writing operation 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 performing corresponding operation;
and S33, if not, directly comparing the size of the data to be written with that of the file, and performing subsequent operation.
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, so that the data writing accuracy is further improved.
The corresponding operation in step S32 specifically includes, when it is determined that the size L1 of the data stored in the previous position 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 equal to the size L of the data to be written, the data to be written is correctly written into the file.
The step S33 of performing the subsequent operation specifically includes exiting the judgment when the size L of the data to be written exceeds the size L0 of the file, generating an alarm, and otherwise, continuing to perform the judgment between the data to be written and the data size fixed by the program.
That is, when the size L of the data to be written is consistent with the data size 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 data size fixed by the program, the judgment is exited, and an alarm is generated. Therefore, through layer-by-layer detection, the correctness of the data writing file is ensured, 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 further comprises the steps that after the data to be written are correctly written into the file, the terminal also checks whether the file is correct every day, and when the file is detected to be correct, the operation is not performed, otherwise, the judgment is exited, and an alarm is generated.
Meanwhile, the application also comprises, 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 misoperation of the data and being capable of automatic calibration, 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: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the invention, the scope of which is defined by the claims and their equivalents.
Claims (7)
1. A data writing file verification method suitable for an intelligent power utilization terminal is characterized in that: the method may include the steps of,
S1, calculating whether a storage position P in a file corresponding to a data writing terminal to be written is in an address range of the file which can be written, if not, executing S2, and if so, executing S3;
s2, exiting judgment, and generating an alarm;
s3, executing subsequent write operation judgment;
the subsequent judgment of the writing operation 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 performing corresponding operation;
The performing the corresponding operation in step S32 specifically further includes, when it is determined that the size L1 of the data stored in the previous position is equal to the size L of the data to be written, correctly writing the data to be written into the file;
S33, if not, directly comparing the size of the data to be written with the file, and performing subsequent operation;
The performing the subsequent operation in step S33 specifically further includes, when the size L of the data to be written is not greater than the size L0 of the file, continuing to perform the judgment between the data to be written and the data size fixed by the program.
2. The data write file verification method applicable to an intelligent power consumption terminal according to claim 1, wherein:
The performing the corresponding operation in step S32 specifically includes performing step S2 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.
3. The data write file verification method applicable to an intelligent power consumption terminal according to claim 1, wherein:
the performing the subsequent operation in step S33 specifically includes performing step S2 when the size L of the data to be written exceeds the size L0 of the file.
4. The data write file verification method applicable to an intelligent power consumption terminal according to claim 1, wherein:
the step of continuing to execute the judgment between the data to be written and the data size fixed by the program comprises the step of correctly writing the data to be written into the file when the data size L to be written is consistent with the data size fixed by the program.
5. The data write file verification method applicable to an intelligent power consumption terminal according to claim 1, wherein:
The step of continuing to execute the judgment between the data to be written and the data size fixed by the program further comprises the step of jumping to execute S2 when the size L of the data to be written is inconsistent with the data size fixed by the program.
6. The data write file verification method applicable to an intelligent power consumption terminal according to claim 1, wherein: the method further comprises prior to step S1,
And S01, judging whether the file exists or not, if not, creating the file according to the size specified by the program, executing S1, and otherwise, directly executing S1.
7. The data write file verification method applicable to the intelligent power utilization terminal according to claim 4, wherein:
The method further comprises the steps that after the data to be written are written into the file correctly, the terminal checks whether the file is correct every day, and when the file is correct, the terminal does not operate, and otherwise, the step S2 is executed in a jumping mode.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110732420.9A CN113568767B (en) | 2021-06-30 | 2021-06-30 | Data writing file verification method suitable for intelligent power utilization terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110732420.9A CN113568767B (en) | 2021-06-30 | 2021-06-30 | Data writing file verification method suitable for intelligent power utilization terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113568767A CN113568767A (en) | 2021-10-29 |
CN113568767B true CN113568767B (en) | 2024-04-30 |
Family
ID=78163126
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110732420.9A Active CN113568767B (en) | 2021-06-30 | 2021-06-30 | Data writing file verification method suitable for intelligent power utilization terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113568767B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7069594B1 (en) * | 2001-06-15 | 2006-06-27 | Mcafee, Inc. | File system level integrity verification and validation |
CN104063254A (en) * | 2014-07-14 | 2014-09-24 | 威胜集团有限公司 | Online upgrading method for electric energy meter |
CN105787392A (en) * | 2016-02-29 | 2016-07-20 | 珠海市魅族科技有限公司 | Data reading and writing control method and control device |
CN106527958A (en) * | 2015-09-09 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Data writing and obtaining methods and devices used for distributed storage system |
CN106527969A (en) * | 2016-09-21 | 2017-03-22 | 中国科学院地质与地球物理研究所 | NandFlash memory read-write method capable of guaranteeing service life balance |
CN108763479A (en) * | 2018-05-29 | 2018-11-06 | 宁波三星医疗电气股份有限公司 | File management method based on terminal document system |
CN111984605A (en) * | 2020-07-14 | 2020-11-24 | 浙江大华技术股份有限公司 | Small file management method, electronic equipment and storage device |
CN112235422A (en) * | 2020-12-11 | 2021-01-15 | 浙江大华技术股份有限公司 | Data processing method and device, computer readable storage medium and electronic device |
-
2021
- 2021-06-30 CN CN202110732420.9A patent/CN113568767B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7069594B1 (en) * | 2001-06-15 | 2006-06-27 | Mcafee, Inc. | File system level integrity verification and validation |
CN104063254A (en) * | 2014-07-14 | 2014-09-24 | 威胜集团有限公司 | Online upgrading method for electric energy meter |
CN106527958A (en) * | 2015-09-09 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Data writing and obtaining methods and devices used for distributed storage system |
CN105787392A (en) * | 2016-02-29 | 2016-07-20 | 珠海市魅族科技有限公司 | Data reading and writing control method and control device |
CN106527969A (en) * | 2016-09-21 | 2017-03-22 | 中国科学院地质与地球物理研究所 | NandFlash memory read-write method capable of guaranteeing service life balance |
CN108763479A (en) * | 2018-05-29 | 2018-11-06 | 宁波三星医疗电气股份有限公司 | File management method based on terminal document system |
CN111984605A (en) * | 2020-07-14 | 2020-11-24 | 浙江大华技术股份有限公司 | Small file management method, electronic equipment and storage device |
CN112235422A (en) * | 2020-12-11 | 2021-01-15 | 浙江大华技术股份有限公司 | Data processing method and device, computer readable storage medium and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN113568767A (en) | 2021-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112817527B (en) | Power-down data storage method, singlechip and computer-readable storage medium | |
KR102015719B1 (en) | Method for protecting configuration data from a data bus transceiver, data bus transceiver and data bus system | |
CN106021002B (en) | Data reading and writing method and device for embedded equipment | |
CN106910528B (en) | Optimization method and device for data inspection of solid state disk | |
CN103077095B (en) | Error correction method and device for stored data and computer system | |
US20190391886A1 (en) | Technologies for limiting performance variation in a storage device | |
CN102904685B (en) | A kind of processing method of hardware table item check errors and device | |
CN105893166A (en) | Method and device for processing memory errors | |
CN110543281A (en) | Storage compression implementation method, device, equipment and storage medium | |
CN112596672A (en) | Storage processing method and device of main control chip, processor and electronic equipment | |
CN113568767B (en) | Data writing file verification method suitable for intelligent power utilization terminal | |
CN110704686B (en) | Quality detection method and device for semi-structured data, storage medium and equipment | |
CN108647119A (en) | The startup method, apparatus and equipment of linux system | |
CN108196975B (en) | Data verification method and device based on multiple checksums and storage medium | |
CN112181830B (en) | Memory leak detection method, device, terminal and medium | |
CN113759790A (en) | System optimization method and device for unmanned equipment | |
CN110647507B (en) | A file system write state determination method, device, electronic device and medium | |
CN105335244A (en) | Application program recovery method | |
CN115167761A (en) | Intelligent water affair terminal data protection method and system | |
CN116909659A (en) | Execution method, device, equipment and storage medium of blockchain intelligent contract | |
CN115904230A (en) | Data verification method, system and device | |
CN111858136A (en) | Method and system for detecting abnormal data of solid state disk, electronic device and storage medium | |
CN109299018B (en) | Method and device for reading historical data in Flash memory | |
CN112527363A (en) | Software package version updating method, device, system, equipment and medium | |
CN112908390A (en) | Data storage method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |