But a kind of FLASH data programming method based on verification under the TCP modeTechnical field
What the present invention relates to is the FLASH data programming method that a kind of intelligent substation protection measure and control device adds verification; what be specifically related to is a kind of based on TCP(Transmission Control Protocol; transmission control protocol) but the FLASH data programming method of verification under the mode belongs to power system automatic field.
Background technology
Intelligent substation and intelligent assembly intelligent substation are to be formed by advanced, reliable, energy-saving and environmental protection, integrated device combination; take the express network communications platform as Information Transmission System; automatically finish the basic functions such as information acquisition, measurement, control, protection, metering and monitoring, and can support as required the transformer station of the senior application functions such as electrical network is controlled in real time automatically, intelligence adjusting, on-line analysis decision-making, collaborative interaction.And intelligent substation protection measure and control device uses high-performance embedded multi-core CPU to become mainstream configuration, generally moves LINUX operating system, in order to satisfy the needs of replacing program, need to carry out programming to device FLASH.
But the time that the at present burning of FLASH itself needs has increased by one times; The BMC of simultaneously present main flow adopts the microprocessor of ARM9 kernel mostly, in the process of debug, mostly adopt and download bootloader to SPI FLASH by JTAG, this mode at first will be written to bootloader among the SDRAM by JTAG, then in SDRAM, start bootloader, then download firmware by the tftp instrument of bootloader, and then write among the SPI FLASH, the time that at first this mode needs is long, besides for some ARM chip, also needing to send out some configuration script orders by JTAG could download to bootloader among the sdram, so that development difficulty strengthens; And producing easily protection measure and control device FLASH data programming error code problem, writing speed is slow, and is improper for the batch production stage.
Summary of the invention
For the deficiency that exists on the prior art; but the object of the invention provides a kind of FLASH data programming method based on verification under the TCP mode; can finish the quick programming of low-voltage variation measure and control device implementation data and checking data to operation LINUX operating system; solved protection measure and control device FLASH data programming error code problem, the data programming that makes is reliable.
To achieve these goals, the present invention realizes by the following technical solutions:
But a kind of FLASH data programming method based on verification under the TCP mode comprises the following steps:
(1) is connected with target FLASH module creation;
(2) import file and calculation document size and CRC check code, then download;
(3) judge whether successfully connect with target FLASH module; If successful then enter step (4); If unsuccessful, then return error code, close connection;
(4) to target FLASH module the transmission of data, judge then whether the transmission of data finishes, the transmission of data finishes rear resolution data and calculates CRC check;
CRC when (5) CRC check is with the importing file relatively judges whether data check passes through; If pass through, then to the FLASH writing in files, be about to CRC check and write FLASH by data; Otherwise return error code, close connection;
(6) read FLASH data that write and recomputate CRC check, the CRC when importing file relatively judges again whether data check passes through again, guarantees whether the data that write are correct;
If pass through, then return correct code, close connection;
If do not pass through, then return error code, close connection.
The present invention compares the beneficial effect that has with other FLASH programming methods:
The present invention by with the protection measure and control device be that the FLASH module is connected; data packing and calculation check that will programming; data are imported into protection measure and control device internal memory, at last data and check are write FLASH, and will write data reading and the calculation check of FLASH; the no write de-lay of finishing the device data has solved protection measure and control device FLASH data programming error code problem; the data programming that makes is reliable, but it has verification, and speed is fast; reliably, the advantage such as accurate.
Description of drawings
Describe the present invention in detail below in conjunction with the drawings and specific embodiments;
Fig. 1 is process flow diagram of the present invention.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with embodiment, further set forth the present invention.
The present invention forms software flow to realize that intelligent substation protection measure and control device adds the quick programming of FLASH data of verification; but it is based on the FLASH data programming method of verification under the TCP mode; finished the quick programming of low-voltage variation measure and control device implementation data and checking data to operation LINUX operating system, the whole step of the method is as follows:
(1) is connected with target FLASH module creation;
(2) import file and calculate the CRC check code;
(3) the file subpackage is sent in the object module;
(4) with Data Analysis and the CRC when calculating CRC check and importing file relatively;
(5) data of verification being passed through write FLASH;
(6) will write the data reading of FLASH and recomputate CRC check and guarantee that the data that write are correct.
Referring to Fig. 1, present embodiment is the better implementation result of the present invention of setting forth, but these detailed concrete steps based on the FLASH data programming method of verification under the TCP mode are as follows:
(1) incipient stage, is connected with target FLASH module creation;
(2) import file and calculation document size and CRC check code, then download;
(3) judge whether successfully connect with target FLASH module; If successful then enter step (4); If unsuccessful, then return error code, close connection;
(4) to target FLASH module the transmission of data, judge then whether the transmission of data finishes, the transmission of data finishes rear resolution data and calculates CRC check;
CRC when (5) CRC check is with the importing file relatively judges whether data check passes through; If pass through, then to the FLASH writing in files, be about to CRC check and write FLASH by data; Otherwise return error code, close connection;
(6) read FLASH data that write and recomputate CRC check, the CRC when importing file relatively judges again whether data check passes through again, guarantees whether the data that write are correct;
If pass through, then return correct code, close connection;
If do not pass through, then return error code, close connection.
By above-described embodiment, present embodiment can be finished the quick programming of low-voltage variation measure and control device implementation data and the checking data to operation LINUX operating system, has solved protection measure and control device FLASH data programming error code problem, and the data programming that makes is reliable.
Based on above-mentioned; the present invention is by being that the FLASH module is connected with the protection measure and control device, and data packing and calculation check that will programming import data into protection measure and control device internal memory; at last data and check are write FLASH; and will write data reading and the calculation check of FLASH, and the no write de-lay of finishing the device data has solved protection measure and control device FLASH data programming error code problem, and the data programming that makes is reliable; but it has verification; the advantages such as speed is fast, and is reliable, accurate.
More than show and described ultimate principle of the present invention and principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in above-described embodiment and the instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.