Electric power data disposal route based on vxworks operating system
Technical field
The present invention relates to the technical field of data processing of electric power data acquisition terminal, specifically refer to a kind of electric power data disposal route based on vxworks operating system.
Background technology
VxWorks operating system is a kind of embedded real-time operating system (RTOS) that U.S. WindRiver company designed and developed in nineteen eighty-three, is the key components of embedded-development environment.Because of its good sustainable development capacity, high performance kernel and friendly User Exploitation environment, in the embedded real-time operating system field, occupy one seat.It is widely used program communicating by letter, in the high-quality precision and sophisticated technology such as military affairs, Aeronautics and Astronautics and the high field of requirement of real-time, as satellite communication, military exercises, trajectory guidance, aircraft navigation etc. with good reliability and remarkable real-time.The electric power data acquisition terminal is also generally used vxworks operating system.
Its main step of electric power data disposal route based on vxworks operating system in prior art is as follows: by reference to the accompanying drawings 1, the user is in initial start-up for after the vxworks operating system of electric power data acquisition, and the user first prestores the electric power data acquisition application program that writes and corresponding application program retrieval and checking routine in the flash storage chip of system hardware.Described electric power data acquisition application program is the application programs of user from edlin, and its title, size and function are all by user's definition of programming voluntarily, and concrete kind is similar to an application programs on present household PC.Described application program retrieval refers to checking routine whether for the application program of retrieving above-mentioned electric power data acquisition application program and retrieve be one section program of user's the application program of writing voluntarily.The retrieval of above-mentioned application program and corresponding application program and checking routine completed the initialization of system after prestoring in the flash storage chip of system hardware, when the user is restarted system again, just can directly call to be pre-stored in intrasystem application program and to carry out electric power data acquisition and computing.When the user starts system again, system first BOOT can be driven and vxworks operating system is loaded in the flash storage chip, and this startup to household PC of the prior art is similar, and loaded with hardware drove before this, then load operation system.After system loads completes, described application program search program is operation automatically, electric power data acquisition application program in retrieval flash storage chip under preset path, after retrieving application program, checking routine is triggered, the application program retrieved is carried out to verification, in checking procedure, three key elements are synchronously carried out, respectively to judge that whether the filename of the application program retrieved is consistent with the filename in default check program, the application program retrieved is carried out to coding checkout (coding commonly used has CRC check code and MD5 check code) by default check code, whether the file size of the application program that judgement retrieves is consistent with the file size in default check program, and (length herein refers to the byte length that file is shared, be the size of file), if have one when not identical with preset value in checking routine in above-mentioned three verification key elements, system is sent warning to the user, and the prompting user does not find correct application program.Otherwise when above-mentioned three verification key elements are all identical with preset value in checking routine, described electric power data acquisition application program will successfully be loaded in vxworks operating system and bring into operation, after the application program operation, the user can arrange according to the code of practice application programs of application program and revise, and application program self also can be stored the data that it collects in operational process simultaneously.Above-mentioned modification belongs to the legal modifications that system is admitted, the program that the user writes can be adjusted automatically to three requirements of legal amended application program, and the initial application program loaded of application program meeting automatic replacement after legal modifications is in order to use next time simultaneously.
Described above be its main step of the electric power data disposal route based on vxworks operating system of the prior art.This method has the following disadvantages when reality is used: this is a kind of very traditional data and file memory mechanism, it just simply gathers and storage data, the data file gathered and the important parameter file of application programs directly call after verification, there is no corresponding automated back-up mechanism after being used to complete, and the size of application file and the sizableness of storage chip, on storage chip, do not have space to be used for Backup Data, if the user will be backed up significant data, can only external storage equipment or increase the capacity of storage chip on hardware.External storage equipment, need could back up manually, and will customize memory device and interface, and cost is high; Same if increase the capacity of the storage chip in system hardware, the flash chip such as a 16M who uses in prior art, increase capacity, need to change into the flash chip of 32M, or two 16M chips arranged side by side are set.It is good that yet the hardware of control system just is equipped with when dispatching from the factory, and the cost that the user transforms voluntarily is large, and the problem of hardware incompatibility may occur.In sum, the electric power data disposal route based on vxworks operating system of the prior art, its backup needs external equipment or conversion hardware with recovery, and its complex operation, cost is high, automaticity is low.In reality; electric power data acquisition application program based on vxworks operating system starts and the interference that often can be subject to clutter in service in system; cause application program to be illegally modified, and said method often there will be backup problem not in time, not high to the protection ratio of program illegal modifications.
Summary of the invention
The technical problem to be solved in the present invention is, provide a kind of simple to operate, cost is low, automaticity is high, the high electric power data disposal route based on vxworks operating system to the protection ratio of program illegal modifications.
For solving the problems of the technologies described above, technical scheme provided by the invention is: a kind of electric power data disposal route based on vxworks operating system, it comprises the steps:
(1) start system by the operator, by the retrieval of the electric power data acquisition application program that writes and corresponding data collection application and flash storage chip that checking routine is prestored into system hardware, search program in the electric power data acquisition application program by above-mentioned and corresponding electric power data acquisition application program, before checking routine and backup control program are prestored into the flash storage chip, first to the search program of above-mentioned application program and corresponding data collection application, checking routine and backup control program compress processing, other the compressible system program prestored on the flash storage chip is compressed to processing simultaneously, after making above-mentioned program deposit the flash storage chip in, also be useful on the redundant space of the data of backup after a above-mentioned compression in chip,
(2) start the system that has completed data pre-storage, system successively BOOT is driven and vxworks operating system is loaded in the flash storage chip, then the packed data in step (1) is unziped in the random access memory of operating system, complete the search program of the electric power data acquisition application program in service data after decompress(ion), search the electric power data acquisition application program under preset path in the flash storage chip, if find application program go to step (3) application programs and carry out verification, if do not find application program, prompting operation person does not find relevant application program,
(3) move three key elements of the application program that the verification simultaneously of default checking routine finds, described three key elements are respectively filename, file size and check code; As long as above-mentioned three key elements have one with checking routine in preset value inconsistent, just to the operator, report to the police, prompting operation person's application checks mistake, can't load; When three above-mentioned key elements are all consistent with the preset value in checking routine, load the application program found; The operator can and analyze electric power data by described application program collection;
(4) backup control program brought into operation in step (1), if the residing timing node of system is consistent with default timing node, system is automatically copied search program, checking routine and the backup control program of current up-to-date electric power data acquisition application program and corresponding electric power data acquisition application program, then after overcompression, stores in the redundant space described in step (1); If the residing timing node of system and default timing node are inconsistent, by default frequency, judge whether current electric power data acquisition application program carries out legal modifications by the operator, if legal modifications is arranged, automatically search program, checking routine and the backup control program of the up-to-date electric power data acquisition application program after legal modifications and corresponding electric power data acquisition application program are copied, then stored into after overcompression in the redundant space described in step (1); If there is no legal modifications, jump to judgement place of timing node;
(5) backed up data in described redundant space after, when the operator again starts system the electric power data acquisition application program that will move is carried out to verification, once the system verification out have in three verification key elements in the current electric power data acquisition application program found one with checking routine in inconsistent, the electric power data acquisition application program that system backs up in will the Automatically invoked redundant space, to after its decompress(ion), be loaded in system, allow the operator operate; If three verification key elements, all by verification, continue to load the current electric power data acquisition application program found.
After adopting above structure, the present invention has following advantage: after taking this method for designing, take full advantage of the redundant space of storage chip, effectively backed up image data, utilized multilayer redundancy detection algorithm, relatively data and the front data of backup after the backup, when system is restarted, carry out data validity and correctness and detect, when the upgrade applications system or arrange while revising Parameter File, significant data is effectively backed up.This algorithm logic clear thinking, algorithm has carried out effective storage to important parameter, has fully guaranteed data correctness and integrality, even when data are destroyed, also can certainly recover correct system data, and system can normally be moved.From economics point, the method does not increase any hardware cost, and the universal method in industry is a newly-increased auxiliary storage chip, carry out extra Backup Data, as adopt the method will cause cost to increase substantially, the series of problems such as the hardware circuit design complexity of also bringing and antijamming capability variation simultaneously.
As improvement, compression described in step (1) is processed and is referred to the ZIP compression algorithm.
As improvement, described in step (3), check code is the CRC check code.
The accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the electric power data disposal route based on vxworks operating system in prior art.
Fig. 2 is the electric power data disposal route that the present invention is based on vxworks operating system schematic flow sheet while using for the first time.
Fig. 3 is that the electric power data disposal route that the present invention is based on vxworks operating system completes the schematic flow sheet under normal operating condition after initialization.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
By reference to the accompanying drawings 2 and accompanying drawing 3, a kind of electric power data disposal route based on vxworks operating system, it comprises the steps:
(1) start system by the operator, by the retrieval of the electric power data acquisition application program that writes and corresponding data collection application and flash storage chip that checking routine is prestored into system hardware, search program in the electric power data acquisition application program by above-mentioned and corresponding electric power data acquisition application program, before checking routine and backup control program are prestored into the flash storage chip, first to the search program of above-mentioned application program and corresponding data collection application, checking routine and backup control program compress processing, other the compressible system program prestored on the flash storage chip is compressed to processing simultaneously, after making above-mentioned program deposit the flash storage chip in, also be useful on the redundant space of the data of backup after a above-mentioned compression in chip,
(2) start the system that has completed data pre-storage, system successively BOOT is driven and vxworks operating system is loaded in the flash storage chip, then the random access memory that the packed data in step (1) is unziped to operating system (is the RAM that we often say, in the present patent application, the flash chip can be understood as the hard disk in household PC, and RAM can be understood as the internal memory in household PC, stored condensing routine is directly to unzip in RAM in use, so can not cause burden to the space in the flash storage chip) in, complete the search program of the electric power data acquisition application program in service data after decompress(ion), search the electric power data acquisition application program under preset path in the flash storage chip, if find application program go to step (3) application programs and carry out verification, if do not find application program, prompting operation person does not find relevant application program,
(3) move three key elements of the application program that the verification simultaneously of default checking routine finds, described three key elements are respectively filename, file size and check code; As long as above-mentioned three key elements have one with checking routine in preset value inconsistent, just to the operator, report to the police, prompting operation person's application checks mistake, can't load; When three above-mentioned key elements are all consistent with the preset value in checking routine, load the application program found; The operator can and analyze electric power data by described application program collection;
(4) backup control program brought into operation in step (1), if the residing timing node of system is consistent with default timing node, system is automatically copied search program, checking routine and the backup control program of current up-to-date electric power data acquisition application program and corresponding electric power data acquisition application program, then after overcompression, stores in the redundant space described in step (1); If the residing timing node of system and default timing node are inconsistent, by default frequency, judge whether current electric power data acquisition application program carries out legal modifications by the operator, if legal modifications is arranged, automatically search program, checking routine and the backup control program of the up-to-date electric power data acquisition application program after legal modifications and corresponding electric power data acquisition application program are copied, then stored into after overcompression in the redundant space described in step (1); If there is no legal modifications, jump to judgement place of timing node;
(5) backed up data in described redundant space after, when the operator again starts system the electric power data acquisition application program that will move is carried out to verification, once the system verification out have in three verification key elements in the current electric power data acquisition application program found one with checking routine in inconsistent, the electric power data acquisition application program that system backs up in will the Automatically invoked redundant space, to after its decompress(ion), be loaded in system, allow the operator operate; If three verification key elements, all by verification, continue to load the current electric power data acquisition application program found.
Compression described in step (1) is processed and is referred to the ZIP compression algorithm.
Described in step (3), check code is the CRC check code.
The present invention in the specific implementation, this Ultrahigh has not only been drawn the advantage of conventional store mechanism, also Promethean application programs based on safety and integrality and the backup testing mechanism of parameter of having proposed, this algorithm has not only guaranteed that program can not cause because of File lose catastrophic destruction, has promoted the disaster tolerance performance of system; Simultaneously, the important parameter that this Ultrahigh arranges for the user is backed up in realtime and is stored.Backup all utilizes the redundant space of flash storage chip with storage, and this redundant space specifically is divided into three parts, and one, the liquid crystal parameters opens up the backup area of 0.125M; Two, application program system is opened up the backup area of 1.5M; Three, parameter is opened up the backup area (described open up refer to by program is compressed obtain unnecessary space) of 0.75M, total redundant space size is 2.345M, due to search program, checking routine and the backup control program of electric power data acquisition application program and corresponding electric power data acquisition application program before depositing in, through overcompression, so above-mentioned redundant space can be used for depositing the compress backup of search program, checking routine and the backup control program of electric power data acquisition application program and corresponding electric power data acquisition application program fully.When system for the first time during the loading application programs system, the CRC in Dui Ge district carries out verification respectively, generate initialized Parameter File and liquid crystal parameter file while upgrading application programs for the first time, simultaneously, detect filename, file size, CRC check code and the file backup mark region of corresponding application programs file, program is carried out algorithm relatively to above-mentioned zone automatically, as all correct as check results, back up corresponding document, and corresponding application file is write to backup area.In like manner, after liquid crystal parameter and systems parameters document setting or changing, also can trigger back mechanism, corresponding file backup is regional to corresponding backup, not only can detect in real time Status of Backups like this, realize backing up in realtime of vital document, fully guarantee the security of system.
Above the present invention and embodiment thereof are described, this description does not have restricted, also one of the embodiments of the present invention just shown in accompanying drawing, and actual structure is not limited to this.If generally speaking those of ordinary skill in the art is enlightened by it, in the situation that do not break away from the invention aim, without the creationary frame mode similar to this technical scheme and the embodiment of designing, all should belong to protection scope of the present invention.