CN106843192B - The system start method and device of controller - Google Patents

The system start method and device of controller Download PDF

Info

Publication number
CN106843192B
CN106843192B CN201611261641.8A CN201611261641A CN106843192B CN 106843192 B CN106843192 B CN 106843192B CN 201611261641 A CN201611261641 A CN 201611261641A CN 106843192 B CN106843192 B CN 106843192B
Authority
CN
China
Prior art keywords
file system
operating system
data
identifying code
file
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
Application number
CN201611261641.8A
Other languages
Chinese (zh)
Other versions
CN106843192A (en
Inventor
马亮
谢华峰
卫乾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kunlun Digital Technology Co ltd
China National Petroleum Corp
BGP Inc
Original Assignee
BGP Inc
CNPC Beijing Richfit Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by BGP Inc, CNPC Beijing Richfit Information Technology Co Ltd filed Critical BGP Inc
Priority to CN201611261641.8A priority Critical patent/CN106843192B/en
Publication of CN106843192A publication Critical patent/CN106843192A/en
Application granted granted Critical
Publication of CN106843192B publication Critical patent/CN106843192B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0259Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the response to fault detection
    • G05B23/0286Modifications to the monitored process, e.g. stopping operation or adapting control
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of method and devices of the system of controller starting, belong to production of hydrocarbons automation field.This method comprises: obtaining the first storage address and the second storage address from the environmental variance of storage when detecting system enabled instruction;Based on the first storage address, the data of the first operating system are obtained, and are based on the second storage address, obtain the data of the first file system;Based on the data of the first operating system, the first operating system is verified, based on the data of the first file system, the first file system is verified;When the first operating system and the first file system verify successfully, start the first operating system and the first file system.The embodiment of the present invention is by verifying the first operating system and the first file system, to can determine that the first operating system and the first file system can normally start when verifying successfully, and then guarantees the stable operation of controller.

Description

The system start method and device of controller
Technical field
The present invention relates to production of hydrocarbons automation field, in particular to the system start method and dress of a kind of controller It sets.
Background technique
With the fast development of production of hydrocarbons automatic control technology, during production of hydrocarbons of today, people can lead to It crosses controller to control the motor of production scene, and signal acquisition is carried out to each equipment of production scene, thus real The remote measurement and control at existing production of hydrocarbons scene.The system for managing and controlling resource is usually mounted in controller, including The operating system run substantially for guaranteeing controller, and for managing and the file system of storage file information, passes through and is The normal starting of system, it is ensured that the stable operation of controller, and then realize the remote measurement and control function of controller.
Usually when controller activation system, if the mould in the storage device of controller for storage system starting information Bad block occurs for block, then when will lead to controller activation system can not calling system starting information, so that system be made not open normally It is dynamic, therefore, a kind of method is needed, the system of controller can be made normally to start.
Summary of the invention
Module in storage device in order to solve controller for storage system starting information occurs caused by bad block The problem of controller system can not normally start, the embodiment of the invention provides a kind of system start method of controller and dresses It sets.The technical solution is as follows:
On the one hand, a kind of system start method of controller is provided, which comprises
When detecting system enabled instruction, the first storage address and the second storage ground are obtained from the environmental variance of storage Location, first storage address are the storage address of data needed for start-up operation system, and second storage address is starting text The storage address of data needed for part system;
Based on first storage address, the data of the first operating system are obtained, and are based on second storage address, Obtain the data of the first file system;
Based on the data of first operating system, first operating system is verified, based on first text The data of part system verify first file system;
When first operating system and first file system verify successfully, start first operating system With first file system.
Optionally, the data based on first operating system, verify first operating system, are based on The data of first file system verify first file system, comprising:
The first default identifying code and the second default identifying code are obtained, the first default identifying code is to first operation The pre-set identifying code of system, the second default identifying code are to the pre-set identifying code of the first file system;
Integrality calculating is carried out to the data of first operating system, the first calculating identifying code is obtained, to described first The data of file system carry out integrality calculating, obtain the second calculating identifying code;
The first calculating identifying code is compared with the described first default identifying code, and described second is calculated and is tested Card code is compared with the described second default identifying code;
When described first calculate identifying code it is consistent with the described first default identifying code when, determine first operating system school Test success, when described second calculate identifying code it is consistent with the described second default identifying code when, determine first file system school Test success.
Optionally, the data based on first operating system, verify first operating system, are based on The data of first file system, after being verified to first file system, further includes:
When first operating system verifies failure and first operating system is not mirror image operation system, the is obtained The data of two operating systems, second operating system are to carry out mirror image to first operating system to obtain;Based on described The data of two operating systems verify second operating system;When second operating system verify it is successfully and described When first file system is verified successfully, start second operating system and first file system;Alternatively,
When first file system verifies failure and first file system is not mirror file system, the is obtained The data of two file system, second file system are to carry out mirror image to first file system to obtain;Based on described The data of two file system verify second file system;When first operating system verify it is successfully and described When second file system is verified successfully, start first operating system and second file system.
Optionally, the data based on first operating system, verify first operating system, are based on The data of first file system, after being verified to first file system, further includes:
When first operating system and first file system verify failure, first operating system is judged Whether it is mirror image operation system, and judges whether first file system is mirror file system;
When first operating system is not mirror image operation system, the data of the second operating system are obtained, based on described The data of second operating system verify second operating system;
When first file system is not mirror file system, the data of the second file system are obtained, based on described The data of second file system verify second file system;
When second operating system and second file system verify successfully, start second operating system With second file system.
Optionally, the method also includes:
When first operating system verifies failure and second operating system verifies successfully, by the environmental variance In include first storage address replace with start second operating system needed for data storage address;
When first file system verifies failure and second file system verifies successfully, by the environmental variance In include second storage address replace with start second file system needed for data storage address.
On the other hand, a kind of system starting device of controller is provided, described device includes:
First obtains module, for obtaining first from the environmental variance of storage and depositing when detecting system enabled instruction Address and the second storage address are stored up, first storage address is the storage address of data needed for start-up operation system, described the Two storage address are the storage address of data needed for startup file system;
Second obtains module, for being based on first storage address, obtains the data of the first operating system, and be based on Second storage address obtains the data of the first file system;
Correction verification module verifies first operating system, base for the data based on first operating system In the data of first file system, first file system is verified;
First starting module, for opening when first operating system and first file system verify successfully Move first operating system and first file system.
Optionally, the correction verification module includes:
Acquiring unit is used to obtain the first default identifying code and the second default identifying code, the first default identifying code is To the pre-set identifying code of the first operating system, the second default identifying code is preparatory to first file system The identifying code of setting;
Computing unit carries out integrality calculating for the data to first operating system, obtains the first calculating verifying Code carries out integrality calculating to the data of first file system, obtains the second calculating identifying code;
Comparison unit is compared for calculating identifying code for described first with the described first default identifying code, and will The second calculating identifying code is compared with the described second default identifying code;
Determination unit, for when described first calculate identifying code it is consistent with the described first default identifying code when, described in determination First operating system verify successfully, when described second calculate identifying code it is consistent with the described second default identifying code when, described in determination First file system verifies successfully.
Optionally, described device further include:
Second starting module, for working as, first operating system verification fails and first operating system is not mirror image When operating system, the data of the second operating system are obtained, second operating system is to carry out mirror to first operating system As obtaining;Based on the data of second operating system, second operating system is verified;When second operation system When system verifies successfully and first file system is verified successfully, start second operating system and first file system System;Alternatively,
Third starting module, for working as, first file system verification fails and first file system is not mirror image When file system, the data of the second file system are obtained, second file system is to carry out mirror to first file system As obtaining;Based on the data of second file system, second file system is verified;When first operation system When system verifies successfully and second file system is verified successfully, start first operating system and second file system System.
Optionally, described device further include:
Judgment module is used to verify when failing when first operating system and first file system, judges institute State whether the first operating system is mirror image operation system, and judges whether first file system is mirror file system;
Third obtains module, for when first operating system is not mirror image operation system, obtaining the second operation system The data of system verify second operating system based on the data of second operating system;
4th obtains module, for obtaining the second file system when first file system is not mirror file system The data of system verify second file system based on the data of second file system;
4th starting module, for opening when second operating system and second file system verify successfully Move second operating system and second file system.
Optionally, described device further include:
First replacement module, for working as, first operating system verification fails and second operating system verifies successfully When, data needed for first storage address for including in the environmental variance is replaced with starting second operating system Storage address;
Second replacement module, for working as, first file system verification fails and second file system verifies successfully When, data needed for second storage address for including in the environmental variance is replaced with starting second file system Storage address.
Technical solution provided in an embodiment of the present invention has the benefit that in embodiments of the present invention, works as controller When detecting system enabled instruction, the first storage address and the second storage address can be obtained from the environmental variance of storage, It is the storage address of data needed for the storage address and startup file system of data needed for obtaining start-up operation system, then base In the first storage address, the data of the first operating system are obtained, and are based on the second storage address, obtain the first file system Data, and then the first operating system and the first file system can be verified, when the first operating system and the first file system When system is verified successfully, illustrate that bad block does not occur for the first operating system and the memory module of the first file system, thus first Operating system and the first file system can normally start, and then guarantee the stable operation of controller.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of flow chart of the system start method of controller provided in an embodiment of the present invention;
Fig. 2A is the flow chart of the system start method of another controller provided in an embodiment of the present invention;
Fig. 2 B is a kind of subregion schematic diagram of controller storage device provided in an embodiment of the present invention;
Fig. 3 A is a kind of block diagram of the system starting device of controller provided in an embodiment of the present invention;
Fig. 3 B is the block diagram of correction verification module provided in an embodiment of the present invention;
Fig. 3 C is the block diagram of the system starting device of another controller provided in an embodiment of the present invention;
Fig. 3 D is the block diagram of the system starting device of the third controller provided in an embodiment of the present invention;
Fig. 3 E is the block diagram of the system starting device of the 4th kind of controller provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The embodiment of the invention provides a kind of system start methods of controller, referring to Fig. 1, this method comprises:
Step 101: when detecting system enabled instruction, the first storage address and are obtained from the environmental variance of storage Two storage address, the first storage address are the storage address of data needed for start-up operation system, and the second storage address is starting text The storage address of data needed for part system.
Step 102: it is based on the first storage address, obtains the data of the first operating system, and be based on the second storage address, Obtain the data of the first file system.
Step 103: the data based on the first operating system verify the first operating system, are based on the first file system The data of system verify the first file system.
Step 104: when the first operating system and the first file system verify successfully, starting the first operating system and the One file system.
It in embodiments of the present invention, can be from the environmental variance of storage when controller detects system enabled instruction The first storage address and the second storage address are obtained, that is to say the storage address and starting of data needed for obtaining start-up operation system The storage address of data needed for file system is then based on the first storage address, obtains the data of the first operating system, Yi Jiji In the second storage address, obtain the data of the first file system, so can to the first operating system and the first file system into Row verification illustrates the first operating system and the first file system when the first operating system and the first file system verify successfully Bad block does not occur for the memory module of system, so that the first operating system and the first file system can normally start, and then guarantees The stable operation of controller.
Optionally, the data based on the first operating system, verify the first operating system, are based on the first file system Data, the first file system is verified, comprising:
The first default identifying code and the second default identifying code are obtained, the first default identifying code is preparatory to the first operating system The identifying code of setting, the second default identifying code are to the pre-set identifying code of the first file system;
Integrality calculating is carried out to the data of the first operating system, the first calculating identifying code is obtained, to the first file system Data carry out integrality calculating, obtain the second calculating identifying code;
First calculating identifying code is compared with the first default identifying code, and calculates identifying code and second in advance for second If identifying code compares;
When first calculate identifying code it is consistent with the first default identifying code when, determine that the first operating system verifies successfully, when the Two calculate identifying codes it is consistent with the second default identifying code when, determine that the first file system verifies successfully.
Optionally, the data based on the first operating system, verify the first operating system, are based on the first file system Data, after being verified to the first file system, further includes:
When the first operating system verifies failure and the first operating system is not mirror image operation system, the second operation system is obtained The data of system, the second operating system are to carry out mirror image to the first operating system to obtain;Based on the data of the second operating system, to Two operating systems are verified;When the second operating system verifies successfully and the first file system verifies successfully, the second behaviour of starting Make system and the first file system;Alternatively,
When the first file system verifies failure and the first file system is not mirror file system, the second file system is obtained The data of system, the second file system are to carry out mirror image to the first file system to obtain;Based on the data of the second file system, to Two file system are verified;When the first operating system verifies successfully and the second file system verifies successfully, the first behaviour of starting Make system and the second file system.
Optionally, the data based on the first operating system, verify the first operating system, are based on the first file system Data, after being verified to the first file system, further includes:
When the first operating system and the first file system verify failure, judge whether the first operating system is mirror image behaviour Make system, and judges whether the first file system is mirror file system;
When the first operating system is not mirror image operation system, the data of the second operating system are obtained, based on the second operation The data of system verify the second operating system;
When the first file system is not mirror file system, the data of the second file system are obtained, are based on the second file The data of system verify the second file system;
When the second operating system and the second file system verify successfully, start the second operating system and the second file system System.
Optionally, this method further include:
When the first operating system verify failure and the second operating system verify successfully when, will include in environmental variance first The storage address of data needed for storage address replaces with the second operating system of starting;
When the first file system verify failure and the second file system verify successfully when, will include in environmental variance second The storage address of data needed for storage address replaces with the second file system of starting.
All the above alternatives, can form the alternative embodiment of the disclosure according to any combination, and the present invention is real It applies example and this is no longer repeated one by one.
The embodiment of the invention provides a kind of system start method of controller, A referring to fig. 2, this method comprises:
Step 201: when detecting system enabled instruction, the first storage address and are obtained from the environmental variance of storage Two storage address, the first storage address are the storage address of data needed for start-up operation system, and the second storage address is starting text The storage address of data needed for part system.
It should be noted that the environmental variance includes the multiple parameters of the system running environment of controller, such as system number According to storage address, using installation path etc., therefore, can be from the ring of storage when controller detects system enabled instruction The first storage address and the second storage address are obtained in the variable of border.
In addition, the system enabled instruction is used to start the operating system and file system of controller, and system starting refers to Enabling can be triggered by user by the switch button of push-button controller.
Furthermore controller can be run institute in advance by terminal connected to the controller by the staff of production of hydrocarbons The program, the operating system current to controller that need carry out mirror image operation system, the file current to controller that mirror image obtains System carries out the storages such as the obtained mirror file system of mirror image in the controller, when controller factory included operating system and When file system breaks down and can not normally start, controller can be made just by mirror image operation system and mirror file system Often starting.Certainly, in practical applications, when controller is connect with the terminal of staff before being initiated, work people Member can also trigger the operation of interruption system starting after opening controller and starting switch, to pass through the end of connection controller End manually selects starting controller factory included operating system and file system or mirror image operation system and image file System.When the operation of interruption system starting is not detected in preset duration, controller will be automatically according in environmental variance First storage address and the second storage address start-up operation system and file system.
In addition, in practical applications, staff can carry out subregion to the storage device of controller, and controller is gone out File system and mirror file system included when included operating system, mirror image operation system, factory are respectively stored in when factory The different zones of storage device, thus the region where the data of the operating system and file system included when controller factory When bad block occurs, controller can be by mirror image operation system and mirror file system, to start controller.
For example, staff can be with when the storage device of controller is NAND Flash (NAND type flash memory) Subregion is carried out to NAND Flash, division result is as shown in Figure 2 B, wherein the size of first area can be 256KB (K word Section), it include that the embodiment of the present invention is provided for storing BPS (Board Support Package, board suppot package), in the BPS System start method corresponding to program, the size of second area can be 128KB, be used for storage environment variable, third area The size in domain can be 2MB (Mbytes), the operating system data included for storage control factory, the size of the fourth region It can be 2MB, be used for memory image operating system data, the size in the 5th region can be 10MB, go out for storage control The included file system data of factory, the size in the 6th region can be 10MB, be used for memory image file system data, remaining empty Between be District 7 domain, for storing application and application data etc. other data.In practical applications, the storage device of controller can NAND Flash is thought, it is of course also possible to for other storage devices such as NOR Flash (NOR type flash memories).
Each starting for controller, what the operating system and file system and last time that this starts when controller started When operating system and inconsistent file system, there are failures for the operating system and file system that illustrate last time starting, control at this time The storage address of data needed for the first storage address for including in environmental variance can be replaced with this start-up operation system by device, will The storage address of data needed for the second storage address for including in environmental variance replaces with this startup file system that is to say The corresponding operating system of one storage address is controller the last operating system that can normally start before current time, The corresponding file system of second storage address is controller the last file system that can normally start before current time System, when so as to so that controller starting next time, can directly deposit the corresponding operating system of the first storage address and second The corresponding file system in storage address is verified, without to having determined that there are the operating system of failure and file system before It is verified, to save the starting time of controller, improves the starting efficiency of controller.
Each starting for controller, since the operating system of controller starting can be the operation system carried when factory System, or mirror image operation system, therefore the corresponding data of the first storage address can be the behaviour carried when starting factory Data needed for making system, or data needed for starting mirror image operation system, similarly, due to the text of controller starting Part system file system included when can be to dispatch from the factory, or mirror file system, therefore second storage address is corresponding Data file system included when can be for starting factory needed for data, or needed for starting mirror file system Data.
Step 202: it is based on the first storage address, obtains the data of the first operating system, and be based on the second storage address, Obtain the data of the first file system.
As the storage address that the first storage address is data needed for start-up operation system, correspondingly, the first operation system The data of system are data needed for start-up operation system, similarly, since the second storage address is data needed for startup file system Storage address, correspondingly, the data of first file system are data needed for startup file system.
Step 203: obtaining the first default identifying code and the second default identifying code, which is to grasp to first Make the pre-set identifying code of system, which is to the pre-set identifying code of the first file system.
Wherein, controller can obtain the first default identifying code from data needed for start-up operation system, from startup file The second default identifying code is obtained in data needed for system, which is the operation that can normally start to controller System data obtains and is stored in local identifying code after carrying out integrality calculating, which is to controller energy Enough file system datas normally started obtain after carrying out integrality calculating and are stored in local identifying code.
It should be noted that in practical applications, it can to the integrality calculating of operating system data and file system data To pass through MD5 (Message Digest Algorithm 5, message digest algorithm the 5th edition), SHA (Secure Hash Algorithm, Secure Hash Algorithm) etc. integral algorithms realize, the default identifying code of first obtained and the second default identifying code It all can be a character string.
Step 204: integrality calculating being carried out to the data of the first operating system, the first calculating identifying code is obtained, to first The data of file system carry out integrality calculating, obtain the second calculating identifying code.
Controller carries out integrality calculating to the data of the first operating system by the integral algorithm of storage, available First calculates identifying code, carries out integrality calculating to the data of the first file system, available second calculates identifying code.
Step 205: the first calculating identifying code being compared with the first default identifying code, and calculates identifying code for second It is compared with the second default identifying code.
If the data of current first operating system have integrality, tested by the first calculating that integrality is calculated It is consistent with the first default identifying code to demonstrate,prove code, if the data of current first operating system do not have integrality, passes through integrality First be calculated calculates identifying code and the first default identifying code is inconsistent.Similarly, if current first file system Data have integrality, then the second calculating identifying code being calculated by integrality is consistent with the second default identifying code, if The data of current first file system do not have integrality, then the second calculating identifying code and second being calculated by integrality Default identifying code is inconsistent.
Step 206: when first calculate identifying code it is consistent with the first default identifying code when, determine the first operating system verify at Function, when second calculate identifying code it is consistent with the second default identifying code when, determine that the first file system verifies successfully.
When first calculates identifying code and the first default identifying code is inconsistent, determine that the verification of the first operating system fails, when Second when calculating identifying code and inconsistent the second default identifying code, determines that the verification of the first file system fails.
So far, controller can realize the data based on the first operating system with through the above steps 203 to step 206, right First operating system is verified, based on the data of the first file system, the process that the first file system is verified.
Step 207: when the first operating system and the first file system verify successfully, starting the first operating system and the One file system.
When the first operating system verifies successfully, it can determine that the first operating system can normally start, when the first file When system check success, it can determine that the first file system can normally start, so that controller can star the first operation system System and the first file system, and then stable operation.
Further, after verifying to the first operating system and the first file system, controller be can also be performed Either step in following step (1), step (2) and step (3), comprising:
Step (1): when the first operating system verifies failure and the first operating system is not mirror image operation system, the is obtained The data of two operating systems, the second operating system are to carry out mirror image to the first operating system to obtain;Based on the second operating system Data verify the second operating system;When the second operating system verifies successfully and the first file system verifies successfully, open Dynamic second operating system and the first file system.
When the first operating system verifies failure and the first operating system is not mirror image operation system, it that is to say that controller goes out When the included operating system of factory breaks down, the second operating system namely mirror image operation system can star, to start control Device.Before starting mirror image operation system, also need to verify mirror image operation system, when mirror image operation system check at When function, illustrate that mirror image operation system can normally start.
In addition, that is to say that controller goes out when the first operating system verifies failure and the second operating system also verifies failure When the included operating system of factory and mirror image operation system break down, controller can carry out alarm sounds, for example make alarm The flashing of LED (Light Emitting Diode, light emitting diode) lamp, display alarm sounds window etc., and then staff exists Controller can be overhauled after viewing alarm sounds.
Furthermore when the first operating system verifies failure and the first operating system is mirror image operation system, illustrate controller The included operating system of factory is verified before current time to be had there are failure, and the first storage address has been replaced by The storage address of data needed for starting mirror image operation system, and the operating system and mirror image operation for dispatching from the factory included in current controller System breaks down, even if file system is normal, controller also can not normally start, therefore controller can be warned directly Report prompt.
Step (2): when the first file system verifies failure and the first file system is not mirror file system, the is obtained The data of two file system, the second file system are to carry out mirror image to the first file system to obtain;Based on the second file system Data verify the second file system;When the first operating system verifies successfully and the second file system verifies successfully, open Dynamic first operating system and the second file system.
When the first file system verifies failure and the first file system is not mirror file system, it that is to say that controller goes out When the included file system of factory breaks down, the second file system namely mirror file system can star, to start control Device.Before starting mirror file system, also need to verify mirror file system, when mirror file system verification at When function, illustrate that mirror file system can normally start.
In addition, that is to say that controller goes out when the first file system verifies failure and the second file system also verifies failure When the included file system of factory and mirror file system break down, controller can carry out alarm sounds, for example make alarm The flashing of LED (Light Emitting Diode, light emitting diode) lamp, display alarm sounds window etc., and then staff exists Controller can be overhauled after viewing alarm sounds.
Furthermore when the first file system verifies failure and the first file system is mirror file system, illustrate controller The included file system of factory is verified before current time to be had there are failure, and the second storage address has been replaced by The storage address of data needed for starting mirror file system, and the file system and image file for dispatching from the factory included in current controller System breaks down, even if operating system is normal, controller also can not normally start, therefore controller can be warned directly Report prompt.
Step (3): when the first operating system and the first file system verify failure, whether judge the first operating system For mirror image operation system, and judge whether the first file system is mirror file system;When the first operating system is not mirror image When operating system, the data for obtaining the second operating system carry out school to the second operating system based on the data of the second operating system It tests;When the first file system is not mirror file system, the data of the second file system are obtained, based on the second file system Data verify the second file system;When the second operating system and the second file system verify successfully, starting second Operating system and the second file system.
When the first operating system and the first file system verify failure, need to judge whether the first operating system is mirror Whether picture operating system and the first file system are mirror file system, when the first operating system is not mirror image operation system And first file system when not being mirror file system, illustrate that controller factory included operating system and file system occur Failure, later when to the second operating system and the second file system namely mirror image operation system and mirror file system verification at When function, mirror image operation system and mirror file system can star, so that controller be made normally to start.
In addition, illustrating to produce in current controller when verifying failure to the second operating system and the second file system There is failure in included operating system and file system and mirror image operation system and mirror file system, at this time controller Alarm sounds can be carried out, and then staff can overhaul controller after viewing alarm sounds.
Furthermore when the first operating system is mirror image operation system, and the first file system is mirror file system, explanation The included operating system of controller factory and file system is verified before current time has there are failure, and first deposits The storage address of data needed for storage address has been replaced by starting mirror image operation system, the second storage address have been replaced by starting The storage address of data needed for mirror file system, and the file system for dispatching from the factory included in current controller and image file system System and mirror image operation system and mirror file system break down, and controller can directly carry out alarm sounds at this time.
In addition, following step can also be performed after controller execution above-mentioned steps (1), step (2) and step (3) (4) and at least one of step (5).
Step (4): it when the first operating system verifies failure and the second operating system verifies successfully, will be wrapped in environmental variance The storage address of data needed for the first storage address included replaces with the second operating system of starting.
Step (5): it when the first file system verifies failure and the second file system verifies successfully, will be wrapped in environmental variance The storage address of data needed for the second storage address included replaces with the second file system of starting.
By executing at least one of above-mentioned steps (4) and step (5), controller can be corresponding by the first storage address Operating system replace with this operating system that can normally start, or the corresponding file system of the second storage address is replaced It is changed to this file system that can normally start, thus when starting controller next time, it can be directly to replaced operation System or file system are verified, to save the starting time of controller, improve the starting efficiency of controller.
It in embodiments of the present invention, can be from the environmental variance of storage when controller detects system enabled instruction The first storage address and the second storage address are obtained, that is to say the storage address and starting of data needed for obtaining start-up operation system The storage address of data needed for file system is then based on the first storage address, obtains the data of the first operating system, Yi Jiji In the second storage address, obtain the data of the first file system, so can to the first operating system and the first file system into Row verification illustrates the first operating system and the first file system when the first operating system and the first file system verify successfully Bad block does not occur for the memory module of system, so that the first operating system and the first file system can normally start, and then guarantees The stable operation of controller.
Referring to Fig. 3 A, the embodiment of the invention provides a kind of system starting device 300 of controller, which includes: One, which obtains module 301, second, obtains module 302, correction verification module 303 and the first starting module 304.
First obtains module 301, for obtaining first from the environmental variance of storage when detecting system enabled instruction Storage address and the second storage address, the first storage address are the storage address of data needed for start-up operation system, the second storage Address is the storage address of data needed for startup file system;
Second obtains module 302, for being based on the first storage address, obtains the data of the first operating system, and be based on Second storage address obtains the data of the first file system;
Correction verification module 303 verifies the first operating system for the data based on the first operating system, based on the The data of one file system verify the first file system;
First starting module 304, for starting first when the first operating system and the first file system verifys successfully Operating system and the first file system.
Optionally, referring to Fig. 3 B, correction verification module 303 includes:
Acquiring unit 3031 is used to obtain the first default identifying code and the second default identifying code, the first default identifying code is To the pre-set identifying code of the first operating system, the second default identifying code is to the pre-set verifying of the first file system Code;
Computing unit 3032 carries out integrality calculating for the data to the first operating system, obtains the first calculating verifying Code carries out integrality calculating to the data of the first file system, obtains the second calculating identifying code;
Comparison unit 3033, for comparing with the first default identifying code the first calculating identifying code, and by second Identifying code is calculated to compare with the second default identifying code;
Determination unit 3034, for when first calculate identifying code it is consistent with the first default identifying code when, determine the first operation System check success, when second calculate identifying code it is consistent with the second default identifying code when, determine that the first file system verifies successfully.
Optionally, referring to Fig. 3 C, the device further include:
Second starting module 305, for working as, the verification of the first operating system fails and the first operating system is not mirror image operation When system, the data of the second operating system are obtained, the second operating system is to carry out mirror image to the first operating system to obtain;Based on The data of two operating systems verify the second operating system;When the second operating system verifies successfully and the first file system When verifying successfully, start the second operating system and the first file system;Alternatively,
Third starting module 306, for working as, the verification of the first file system fails and the first file system is not image file When system, the data of the second file system are obtained, the second file system is to carry out mirror image to the first file system to obtain;Based on The data of two file system verify the second file system;When the first operating system verifies successfully and the second file system When verifying successfully, start the first operating system and the second file system.
Optionally, referring to Fig. 3 D, the device further include:
Judgment module 307 is used to verify when failing when the first operating system and the first file system, judges the first operation Whether system is mirror image operation system, and judges whether the first file system is mirror file system;
Third obtains module 308, for obtaining the second operating system when the first operating system is not mirror image operation system Data the second operating system is verified based on the data of the second operating system;
4th obtains module 309, for obtaining the second file system when the first file system is not mirror file system Data the second file system is verified based on the data of the second file system;
4th starting module 310, for starting second when the second operating system and the second file system verifys successfully Operating system and the second file system.
Optionally, referring to Fig. 3 E, the device further include:
First replacement module 311 is used for when the first operating system verifies failure and the second operating system verifies successfully, will The storage address of data needed for the first storage address for including in environmental variance replaces with the second operating system of starting;
Second replacement module 312 is used for when the first file system verifies failure and the second file system verifies successfully, will The storage address of data needed for the second storage address for including in environmental variance replaces with the second file system of starting.
In conclusion in embodiments of the present invention, it, can be from the ring of storage when controller detects system enabled instruction The first storage address and the second storage address are obtained in the variable of border, with that is to say the storage of data needed for obtaining start-up operation system The storage address of data needed for location and startup file system is then based on the first storage address, obtains the number of the first operating system According to, and it is based on the second storage address, the data of the first file system are obtained, and then can be to the first operating system and the first text Part system is verified, and when the first operating system and the first file system verify successfully, illustrates the first operating system and Bad block does not occur for the memory module of one file system, so that the first operating system and the first file system can normally start, And then guarantee the stable operation of controller.
It should be understood that system of the system starting device of controller provided by the above embodiment in starting controller When, only the example of the division of the above functional modules, in practical application, it can according to need and divide above-mentioned function With being completed by different functional modules, i.e., the internal structure of equipment is divided into different functional modules, to complete above description All or part of function.In addition, the system starting device of controller provided by the above embodiment and the system of controller open Dynamic embodiment of the method belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (8)

1. a kind of system start method of controller, which is characterized in that the described method includes:
When detecting system enabled instruction, the first storage address and the second storage address are obtained from the environmental variance of storage, First storage address is the storage address of data needed for start-up operation system, and second storage address is startup file system The storage address of data needed for uniting;
Based on first storage address, the data of the first operating system are obtained, and are based on second storage address, are obtained The data of first file system;
Based on the data of first operating system, first operating system is verified, is based on first file system The data of system verify first file system;When first operating system and first file system school When testing successfully, start first operating system and first file system;
When first operating system verifies failure and first operating system is not mirror image operation system, the second behaviour is obtained Make the data of system, second operating system is to carry out mirror image to first operating system to obtain;Based on second behaviour The data for making system verify second operating system;When second operating system verifies successfully and described first When file system is verified successfully, start second operating system and first file system;Alternatively,
When first file system verifies failure and first file system is not mirror file system, the second text is obtained The data of part system, second file system are to carry out mirror image to first file system to obtain;Based on second text The data of part system verify second file system;When first operating system verifies successfully and described second When file system is verified successfully, start first operating system and second file system.
2. the method as described in claim 1, which is characterized in that the data based on first operating system, to described First operating system is verified, and based on the data of first file system, is verified to first file system, packet It includes:
The first default identifying code and the second default identifying code are obtained, the first default identifying code is to first operating system Pre-set identifying code, the second default identifying code are to the pre-set identifying code of the first file system;
Integrality calculating is carried out to the data of first operating system, the first calculating identifying code is obtained, to first file The data of system carry out integrality calculating, obtain the second calculating identifying code;
The first calculating identifying code is compared with the described first default identifying code, and calculates identifying code for described second It is compared with the described second default identifying code;
When described first calculate identifying code it is consistent with the described first default identifying code when, determine first operating system verify at Function, when described second calculate identifying code it is consistent with the described second default identifying code when, determine first file system verify at Function.
3. the method as described in claim 1, which is characterized in that the data based on first operating system, to described First operating system is verified, and based on the data of first file system, carries out verifying it to first file system Afterwards, further includes:
When first operating system and first file system verify failure, whether first operating system is judged For mirror image operation system, and judge whether first file system is mirror file system;
When first operating system is not mirror image operation system, the data of the second operating system are obtained, are based on described second The data of operating system verify second operating system;
When first file system is not mirror file system, the data of the second file system are obtained, are based on described second The data of file system verify second file system;
When second operating system and second file system verify successfully, start second operating system and institute State the second file system.
4. method a method according to any one of claims 1-3, which is characterized in that the method also includes:
When first operating system verifies failure and second operating system verifies successfully, will be wrapped in the environmental variance The storage address of data needed for first storage address included replaces with starting second operating system;
When first file system verifies failure and second file system verifies successfully, will be wrapped in the environmental variance The storage address of data needed for second storage address included replaces with starting second file system.
5. a kind of system starting device of controller, which is characterized in that described device includes:
First obtains module, for when detecting system enabled instruction, obtaining the first storage ground from the environmental variance of storage Location and the second storage address, first storage address are the storage address of data needed for start-up operation system, and described second deposits Store up the storage address that address is data needed for startup file system;
Second obtains module, for being based on first storage address, obtains the data of the first operating system, and based on described Second storage address obtains the data of the first file system;
Correction verification module verifies first operating system for the data based on first operating system, is based on institute The data for stating the first file system verify first file system;
First starting module, for when first operating system and first file system verifys successfully, starting institute State the first operating system and first file system;
Second starting module, for working as, first operating system verification fails and first operating system is not mirror image operation When system, the data of the second operating system are obtained, second operating system is to carry out mirror image to first operating system to obtain It arrives;Based on the data of second operating system, second operating system is verified;When second operating system school It tests successfully and when first file system is verified successfully, starts second operating system and first file system;Or Person,
Third starting module, for working as, first file system verification fails and first file system is not image file When system, the data of the second file system are obtained, second file system is to carry out mirror image to first file system to obtain It arrives;Based on the data of second file system, second file system is verified;When first operating system school It tests successfully and when second file system is verified successfully, starts first operating system and second file system.
6. device as claimed in claim 5, which is characterized in that the correction verification module includes:
Acquiring unit, for obtaining the first default identifying code and the second default identifying code, the first default identifying code is to institute The pre-set identifying code of the first operating system is stated, the second default identifying code is to preset to first file system Identifying code;
Computing unit carries out integrality calculating for the data to first operating system, obtains the first calculating identifying code, right The data of first file system carry out integrality calculating, obtain the second calculating identifying code;
Comparison unit is compared for calculating identifying code for described first with the described first default identifying code, and will be described Second calculating identifying code is compared with the described second default identifying code;
Determination unit, for when described first calculate identifying code it is consistent with the described first default identifying code when, determine described first Operating system verify successfully, when described second calculate identifying code it is consistent with the described second default identifying code when, determine described first File system verifies successfully.
7. device as claimed in claim 5, which is characterized in that described device further include:
Judgment module, for when first operating system and first file system verifys unsuccessfully, judging described the Whether one operating system is mirror image operation system, and judges whether first file system is mirror file system;
Third obtains module, for obtaining the second operating system when first operating system is not mirror image operation system Data verify second operating system based on the data of second operating system;
4th obtains module, for obtaining the second file system when first file system is not mirror file system Data verify second file system based on the data of second file system;
4th starting module, for when second operating system and second file system verifys successfully, starting institute State the second operating system and second file system.
8. the device as described in claim 5-7 is any, which is characterized in that described device further include:
First replacement module is used for when first operating system verifies failure and second operating system verifies successfully, Data needed for first storage address for including in the environmental variance is replaced with starting second operating system are deposited Store up address;
Second replacement module is used for when first file system verifies failure and second file system verifies successfully, Data needed for second storage address for including in the environmental variance is replaced with starting second file system are deposited Store up address.
CN201611261641.8A 2016-12-30 2016-12-30 The system start method and device of controller Active CN106843192B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611261641.8A CN106843192B (en) 2016-12-30 2016-12-30 The system start method and device of controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611261641.8A CN106843192B (en) 2016-12-30 2016-12-30 The system start method and device of controller

Publications (2)

Publication Number Publication Date
CN106843192A CN106843192A (en) 2017-06-13
CN106843192B true CN106843192B (en) 2018-12-28

Family

ID=59114204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611261641.8A Active CN106843192B (en) 2016-12-30 2016-12-30 The system start method and device of controller

Country Status (1)

Country Link
CN (1) CN106843192B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110780942A (en) 2019-09-29 2020-02-11 华为技术有限公司 System starting method and device, node equipment and computer readable storage medium
CN110764486B (en) * 2019-09-30 2020-09-29 华人运通(江苏)技术有限公司 Method and device for operating vehicle-mounted controller, vehicle-mounted controller and storage medium
CN111177752B (en) * 2019-12-20 2023-02-10 全球能源互联网研究院有限公司 Credible file storage method, device and equipment based on static measurement
CN113535479A (en) * 2021-07-15 2021-10-22 广西电网有限责任公司电力科学研究院 Digital mirror image overhauling method based on timeline
CN113656078A (en) * 2021-07-28 2021-11-16 北京车和家信息技术有限公司 Equipment starting method and device, storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673211A (en) * 2009-10-19 2010-03-17 中兴通讯股份有限公司 Embedded equipment and starting method thereof
US8402269B2 (en) * 2004-02-24 2013-03-19 Softcamp Co., Ltd. System and method for controlling exit of saved data from security zone
CN103955158A (en) * 2014-04-15 2014-07-30 中国石油集团东方地球物理勘探有限责任公司 Remote telemetry terminal controller and system start method
CN104063477A (en) * 2014-06-30 2014-09-24 广东威创视讯科技股份有限公司 Processing method and processing device for startup abnormalities of embedded system
CN105975864A (en) * 2016-04-29 2016-09-28 北京小米移动软件有限公司 Operation system starting method and device, and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8402269B2 (en) * 2004-02-24 2013-03-19 Softcamp Co., Ltd. System and method for controlling exit of saved data from security zone
CN101673211A (en) * 2009-10-19 2010-03-17 中兴通讯股份有限公司 Embedded equipment and starting method thereof
CN103955158A (en) * 2014-04-15 2014-07-30 中国石油集团东方地球物理勘探有限责任公司 Remote telemetry terminal controller and system start method
CN104063477A (en) * 2014-06-30 2014-09-24 广东威创视讯科技股份有限公司 Processing method and processing device for startup abnormalities of embedded system
CN105975864A (en) * 2016-04-29 2016-09-28 北京小米移动软件有限公司 Operation system starting method and device, and terminal

Also Published As

Publication number Publication date
CN106843192A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
CN106843192B (en) The system start method and device of controller
CN104133709B (en) The upgrade method and device of embedded system
CN103377094A (en) Abnormity monitoring method and abnormity monitoring device
EP2950285A1 (en) Automatic configuration of a replacement camera
CN104065526B (en) A kind of method and apparatus of server failure alarm
CN103428333B (en) Mobile terminal, server and errors repair method
CN110704166A (en) Service operation method and device and server
CN106528097A (en) Version synchronization method for two pieces of BIOS (Basic Input/ Output System) firmware, and electronic equipment
CN113726553A (en) Node fault recovery method and device, electronic equipment and readable storage medium
CN102681874A (en) Method and device for ensuring normal running of software
CN105721203A (en) Upgrade processing method and device
CN105389228A (en) Data partition repairing method and system
CN108121612A (en) A kind of collapse processing method and system based on linux kernel router
CN108804257B (en) Terminal state detection method and device, terminal and storage medium
CN109032320A (en) Battery back unit test method and relevant device
CN110502408A (en) A kind of display methods, device, equipment and the medium of storage system indicator light
CN110858074B (en) Abnormity prompting method, system, equipment and storage medium
CN106201787A (en) Terminal control method and device
CN102646063A (en) Method and device for downloading software of mobile terminal
CN114327968A (en) Method and device for realizing early warning of server hardware fault telephone with universal interface
CN110633179A (en) Method and device for checking physical lamp of case
CN106648947B (en) A kind of method and apparatus of test multi-controller storage equipment
CN106095623A (en) Terminal control method and device
CN110752950A (en) Update detection method and device for cloud resource pool and terminal equipment
CN110469955A (en) Failure detecting method, device and the readable storage medium storing program for executing of air conditioner

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
CP03 Change of name, title or address

Address after: Room 1501, Gehua building, No.1 Qinglong Hutong, Dongcheng District, Beijing

Patentee after: Kunlun Digital Technology Co.,Ltd.

Patentee after: BGP INC., CHINA NATIONAL PETROLEUM Corp.

Address before: 1501, Gehua building, 1 Qinglong Hutong, Dongcheng District, Beijing

Patentee before: RICHFIT INFORMATION TECHNOLOGY Co.,Ltd.

Patentee before: BGP INC., CHINA NATIONAL PETROLEUM Corp.

CP03 Change of name, title or address
TR01 Transfer of patent right

Effective date of registration: 20220325

Address after: Room 1501, Gehua building, No.1 Qinglong Hutong, Dongcheng District, Beijing

Patentee after: Kunlun Digital Technology Co.,Ltd.

Patentee after: CHINA NATIONAL PETROLEUM Corp.

Address before: Room 1501, Gehua building, No.1 Qinglong Hutong, Dongcheng District, Beijing

Patentee before: Kunlun Digital Technology Co.,Ltd.

Patentee before: BGP INC., CHINA NATIONAL PETROLEUM Corp.

TR01 Transfer of patent right