CN113672302A - Router starting method and device, router and storage medium - Google Patents

Router starting method and device, router and storage medium Download PDF

Info

Publication number
CN113672302A
CN113672302A CN202110958591.3A CN202110958591A CN113672302A CN 113672302 A CN113672302 A CN 113672302A CN 202110958591 A CN202110958591 A CN 202110958591A CN 113672302 A CN113672302 A CN 113672302A
Authority
CN
China
Prior art keywords
starting
partition
program
application program
application
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.)
Pending
Application number
CN202110958591.3A
Other languages
Chinese (zh)
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.)
Sichuan Changhong Network Technology Co Ltd
Original Assignee
Sichuan Changhong Network 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 Sichuan Changhong Network Technology Co Ltd filed Critical Sichuan Changhong Network Technology Co Ltd
Priority to CN202110958591.3A priority Critical patent/CN113672302A/en
Publication of CN113672302A publication Critical patent/CN113672302A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/60Router architectures

Abstract

The invention provides a router starting method, which comprises the following steps: loading a bootstrap program in the bootstrap partition to start the system; reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition; if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data; if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition; and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data. A router startup device, a router and a storage medium are also provided.

Description

Router starting method and device, router and storage medium
Technical Field
The present invention relates to the field of router technologies, and in particular, to a router startup method and apparatus, a router, and a storage medium.
Background
The intelligent router is also an intelligent management router, generally has an independent operating system, can be used for installing various applications by a user, automatically controlling the bandwidth, the number of online persons, the browsing of webpages and the online time, and has a powerful USB sharing function, thereby really achieving the intelligent management of networks and equipment.
Compared with a common router, the intelligent router is exposed to more individualized software installation and more software upgrading requirements in the using process. In the process, the program may be lost due to upgrading and power off, or the system may be crashed due to installation of wrong software, and finally, only manual flashing or door/factory repair can be performed, and then the system can be normally started. However, the former requires professional guidance and operation and cannot be popularized, and the latter increases the maintenance cost of the equipment.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a router starting method, a device, a router and a storage medium.
In a first aspect, in an embodiment, the present invention provides a router startup method, including:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
In a second aspect, the present invention provides, in one embodiment, a router activation apparatus, including:
the boot module is used for loading a boot program in the boot partition to start the system;
the reading module is used for reading a first system state, a first application program partition table and first application program configuration information in the first configuration partition;
the starting module is used for loading the first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data when the first system state is normal;
the reading module is further used for reading a second system state, a second application program partition table and second application program configuration information in the second configuration partition when the first system state is abnormal;
the starting module is further used for loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data when the second system state is normal.
In a third aspect, in one embodiment, the present invention provides a router, including a memory and a processor, the memory storing a computer program, the computer program, when executed by the processor, causing the processor to perform the steps of:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
In a fourth aspect, in one embodiment, the present invention provides a storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
According to the router starting method, the router starting device, the router and the storage medium, the two configuration partitions and the two program partitions are arranged to form two starting paths which are backup to each other, when program data needed by one starting path is wrong or lost and cannot be started, the other starting path is automatically switched to, so that the fault tolerance rate of a system is improved, a user is not required to have professional guidance operation, and the maintenance cost of equipment is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
fig. 1 is a flowchart illustrating a router activation method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of restarting and continuing to run a first application according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a router activation apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of the internal structure of a router according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In a first aspect, as shown in fig. 1, in an embodiment, the present invention provides a router startup method, including:
and 102, loading a bootstrap program in the boot partition to start the system.
The partition refers to a storage unit, and thus the boot partition refers to a storage unit storing a boot program. The partitions referred to later refer to storage units, and are not described herein again. Before the embodiment is implemented, partition configuration is further performed on the router, so that a guiding partition, a first configuration partition, a second configuration partition, a first application partition, a second application partition, and a judgment partition are obtained, and specific purposes of the partitions are described in detail in subsequent portions and subsequent embodiments of the embodiment, which is not described herein again.
Step 104, reading the first system state, the first application program partition table and the first application program configuration information in the first configuration partition.
The router system is started, which is essentially to run a corresponding application program in the router, and because two application program partitions are opened, a corresponding first application program partition table needs to be read from a first configuration partition, and the association between the configuration partition and the application program partition is realized through the partition table.
And 106, if the first system state is normal, loading the first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data.
The first configuration partition and the first application partition form a first boot path, the first system state indicates whether the corresponding first boot path is available (mainly for first application data in the first application partition), and the first system state may be obtained from historical data in the last boot process.
And finding the corresponding first application program partition after reading the first application program partition table. The first application data is an initial program, and the first application configuration information stores personalized settings of the user, so that the first application configuration information needs to be configured for the initial program of the first application data during running, so that the running application is expected by the user.
Step 108, if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in the second configuration partition.
And step 110, if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table, and starting the system according to the second application program configuration information and the second application program data.
The second configuration partition and the second application partition form a second boot path, and the execution steps of the second boot path and the first boot path are substantially the same, which is not described herein again.
According to the router starting method, the two configuration partitions and the two program partitions are arranged to form two starting paths which are backup to each other, and when program data needed by one starting path is wrong or lost to cause incapability of starting, the other starting path is automatically switched to, so that the fault tolerance rate of a system is improved, a user is not required to have professional guidance operation, and the maintenance cost of equipment is reduced.
As shown in fig. 2, in an embodiment, after the step of starting the system according to the first application configuration information and the first application data, the method further includes:
step 202, a first judgment program in the loading judgment partition judges the starting result.
The judgment mainly comprises two aspects, one is the judgment of the starting result of the first judgment program, the other is the judgment of the starting result of the system, and the judgment result is written into the first configuration partition.
Step 204, if the system is not successfully started, reading the number of times of successful starting of the first judgment program and the number of times of successful starting of the first system in the first configuration partition.
Step 206, if the difference between the first judgment program starting success frequency and the first system starting success frequency is smaller than the preset threshold, re-entering the step of loading the boot program in the boot partition to perform system starting.
The main reason why the system is not successfully started is that the first application data is wrong or lost, and of course, other reasons may also be possible, such as a processor crash, a clock violation, and the like, so that the first application data needs to be restarted and continuously run. When the system is not successfully started, the corresponding first system starting success frequency is always zero. When the program starting is judged to be unsuccessful, no corresponding output quantity exists no matter whether the system is successfully started or not, so that the default system is not successfully started, and the recording accuracy of the successful starting times of the first system is ensured by combining the successful starting times of the first judging program.
In order to control the restart operation to have a result, a preset threshold needs to be set, and the restart is allowed to continue to operate only when the difference between the number of times of successful start of the first judgment program and the number of times of successful start of the first system is detected to be smaller than the preset threshold, for example, smaller than three times.
In step 208, if the difference between the successful times of the first determination procedure and the successful times of the first system is not less than the preset threshold, it is determined that the first application data is faulty and the first system status is determined to be abnormal.
When the difference between the number of successful times of starting the first judgment program and the number of successful times of starting the first system is not less than the preset threshold value, which indicates that the data of the first application program is wrong or lost, the state of the first system is determined to be abnormal.
By restarting the operation of continuous operation, the problem that the judgment result of the first application program data is influenced due to the fact that the system is not successfully started due to other reasons except the error or loss of the first application program data is avoided, and the compatibility of the system is improved.
In one embodiment, after the step of judging the starting result by the first judging program in the loading judging partition, the method further includes:
and if the system is successfully started, resetting the starting success times of the first judgment program and the starting success times of the first system to zero.
When the system is started successfully, the influence on the next starting is avoided, and the number of times of successful starting of the first judgment program and the number of times of successful starting of the first system need to be reset to zero.
In one embodiment, before the step of starting the system according to the first application configuration information and the first application data, the method further comprises:
setting a watchdog to start timing;
if the difference between the first judgment program starting success frequency and the first system starting success frequency is smaller than the preset threshold, re-entering the boot program in the loading boot partition to start the system, wherein the step comprises the following steps:
and if the difference between the successful starting times of the first judgment program and the first system starting successful times is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system after the watchdog timing reaches a preset time.
Setting a watchdog to start timing before running first application program data, and resetting the timing of the watchdog to zero if the system is successfully started in subsequent judgment; if the system is not started successfully, the reset-to-zero reset is not carried out, so that the watchdog is automatically restarted after the timing reaches the preset time.
The preset time is also used for controlling the restart time interval, so that the performance is prevented from being influenced by quick and frequent restart.
In one embodiment, after the step of starting the system according to the second application configuration information and the second application data, the method further comprises:
loading a second judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the number of successful times of starting a second judgment program in a second configuration partition and the number of successful times of starting the second system;
if the difference between the successful times of starting the second judgment program and the successful times of starting the second system is smaller than the preset threshold value, re-entering the step of starting the system by the bootstrap program in the loading bootstrap partition and determining the state of the first system as abnormal;
and if the difference between the second judgment program starting success frequency and the second system starting success frequency is not less than the preset threshold, judging that the second application program data has errors and determining the second system state as abnormal.
The specific execution steps of the second start path are substantially the same as those of the first start path, and are not described herein again.
In one embodiment, before the step of starting the system according to the second application configuration information and the second application data, the method further comprises:
setting a watchdog to start timing;
if the difference between the second judgment program starting success frequency and the second system starting success frequency is smaller than the preset threshold, re-entering the boot program in the loading boot partition to start the system, wherein the step comprises the following steps:
and if the difference between the successful times of starting the second judgment program and the successful times of starting the second system is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system after the watchdog timing reaches a preset time.
In one embodiment, after the step of determining the starting result by the second determiner in the load determining partition, the method further includes:
and if the system is successfully started, resetting the starting success times of the second judgment program and the starting success times of the second system to zero.
When the system is successfully started, the influence on the next starting is avoided, and the number of times of successful starting of the second judgment program and the number of times of successful starting of the second system need to be reset to zero.
In one embodiment, after the steps of determining that the second application data is in error and determining the second system state as abnormal, the method further comprises:
and recovering the system according to a preset upgrading mode.
When the second system state is also abnormal, it indicates that both the first application data and the second application data are in error or lost, and at this time, the whole system needs to be recovered.
In one embodiment, a router startup method specifically includes:
step 1, a router is powered on and started up, a processor loads a bootstrap program of a bootstrap partition, and a system is started;
step 2, reading the data of the first configuration partition, checking the first system state in the data, executing step 3 if the first system state is normal, and executing step 4 if the first system state is abnormal;
step 3, loading the first application program data in the corresponding first application program partition according to the first application program partition table in the first configuration partition, starting the system according to the first application program configuration information and the first application program data, and executing step 5;
step 4, reading the data of the second configuration partition, exchanging the first application program partition table and the second application program partition table in the memory, starting the system according to the second application program configuration information and the second application program data, and executing step 5;
step 5, starting a first judgment program, and entering step 6;
step 6, reading the starting success times of the first judgment program and the starting success times of the first system in the first configuration partition;
step 7, judging whether the difference between the first judgment program starting success frequency and the first system starting success frequency is larger than a preset threshold value, if so, executing step 10, otherwise, executing step 8;
step 8, before the step of starting the system according to the configuration information of the first application program and the data of the first application program, setting a watchdog to start timing, and executing step 9;
step 9, when the system is successfully started and all functions normally run, resetting the watchdog, and resetting the starting success times of the first judgment program and the starting success times of the first system to zero; and when the system is successfully started and is not successfully started, the watchdog is not reset, and the system is restarted after the timing of the watchdog reaches the preset time.
Step 10, judging that the data of the first application program is in error, reading the starting success times of a second judgment program and the starting success times of a second system in a second configuration partition, and executing step 11;
step 11, judging whether the difference between the second judgment program starting success frequency and the second system starting success frequency is larger than a preset threshold value, if so, executing step 12, otherwise, executing step 13;
and step 12, entering an automatic default upgrading mode to recover the system.
And step 13, determining the first system state as abnormal, and restarting the system.
In a second aspect, as shown in fig. 3, in one embodiment, the present invention provides a router activation apparatus, including:
and a boot module 302, configured to load a boot program in the boot partition to perform system boot.
A reading module 304, configured to read the first system state, the first application partition table, and the first application configuration information in the first configuration partition.
The starting module 306 is configured to, when the first system state is normal, load the first application data in the corresponding first application partition according to the first application partition table, and start the system according to the first application configuration information and the first application data.
The reading module 304 is further configured to read a second system state, a second application partition table, and second application configuration information in the second configuration partition when the first system state is abnormal;
the starting module 306 is further configured to, when the second system status is normal, load second application data in the corresponding second application partition according to the second application partition table, and start the system according to the second application configuration information and the second application data.
According to the router starting device, the two configuration partitions and the two program partitions are arranged to form two starting paths which are backup to each other, when program data needed by one starting path is wrong or lost to cause incapability of starting, the other starting path is automatically switched to, so that the fault tolerance rate of a system is improved, a user is not required to have professional guidance operation, and the maintenance cost of equipment is reduced.
As shown in fig. 3, in an embodiment, the router activation apparatus further includes:
the judging module 308 is configured to load a first judging program in the judging partition to judge the starting result;
the reading module 304 is further configured to, when the system is not successfully started, read the number of times that the first judgment program in the first configuration partition is successfully started and the number of times that the first system is successfully started;
a comparison module 310, configured to re-enter the boot program in the loaded boot partition to perform the system boot when a difference between the first judgment program boot success frequency and the first system boot success frequency is smaller than a preset threshold; and when the difference between the first judgment program starting success frequency and the first system starting success frequency is not less than a preset threshold value, judging that the first application program data has errors and determining the first system state as abnormal.
As shown in fig. 3, in an embodiment, the router activation apparatus further includes:
the reset module 312 is configured to reset the first determining procedure starting success times and the first system starting success times to zero when the system is successfully started.
As shown in fig. 3, in an embodiment, the router activation apparatus further includes:
a timing module 314, configured to set a watchdog to start timing;
the comparison module 310 is specifically configured to, when a difference between the first determination program start success frequency and the first system start success frequency is smaller than a preset threshold, re-enter the boot program in the load boot partition for system start after the watchdog timer reaches a preset time.
In one embodiment, the judging module is further configured to load a second judging program in the judging partition to judge the starting result;
the reading module is further used for reading the starting success times of the second judgment program and the starting success times of the second system in the second configuration partition when the system is not started successfully;
the comparison module is also used for re-entering the boot program in the loading boot partition to carry out the step of starting the system when the difference between the second judgment program starting success frequency and the second system starting success frequency is smaller than a preset threshold value; and when the difference between the second judgment program starting success frequency and the second system starting success frequency is not less than the preset threshold value, judging that the second application program data has errors and determining the second system state as abnormal.
In one embodiment, the reset module is further configured to reset the number of times of successful system startup and the number of times of successful second system startup to zero when the system startup is successful.
As shown in fig. 3, in an embodiment, the router activation apparatus further includes:
and a recovery module 316, configured to perform system recovery according to a preset upgrade mode.
In a third aspect, as shown in fig. 4, in one embodiment, the present invention provides a router, including a memory and a processor, where the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to execute the following steps:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
Through the router, two configuration partitions and two program partitions are arranged to form two mutually backup starting paths, and when program data needed by one starting path is wrong or lost to cause incapability of starting, the other starting path is automatically switched to, so that the fault tolerance rate of the system is improved, a user is not required to have professional guidance operation, and the maintenance cost of equipment is reduced.
In one embodiment, after the step of launching the system in accordance with the first application configuration information and the first application data, the computer program, when executed by the processor, causes the processor to further perform the steps of:
loading a first judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the starting success times of the first judgment program in the first configuration partition and the starting success times of the first system;
if the difference between the successful times of the first judgment program starting and the successful times of the first system starting is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to carry out the step of starting the system;
and if the difference between the successful times of starting the first judgment program and the successful times of starting the first system is not less than the preset threshold value, judging that the data of the first application program is in error and determining the state of the first system as abnormal.
In one embodiment, after the step of determining the boot result by the first determining program in the load determining partition, the computer program when executed by the processor causes the processor to further perform the steps of:
and if the system is successfully started, resetting the starting success times of the first judgment program and the starting success times of the first system to zero.
In one embodiment, prior to the step of launching the system in accordance with the first application configuration information and the first application data, the computer program when executed by the processor causes the processor to further perform the steps of:
setting a watchdog to start timing;
if the difference between the first judgment program starting success frequency and the first system starting success frequency is smaller than the preset threshold, re-entering the boot program in the loading boot partition to start the system, wherein the step comprises the following steps:
and if the difference between the successful starting times of the first judgment program and the first system starting successful times is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system after the watchdog timing reaches a preset time.
In one embodiment, after the step of booting the system in accordance with the second application configuration information and the second application data, the computer program, when executed by the processor, causes the processor to further perform the steps of:
loading a second judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the number of successful times of starting a second judgment program in a second configuration partition and the number of successful times of starting the second system;
if the difference between the successful times of the second judgment program starting and the successful times of the second system starting is smaller than the preset threshold value, re-entering the step of loading the bootstrap program in the bootstrap partition to start the system;
and if the difference between the second judgment program starting success frequency and the second system starting success frequency is not less than the preset threshold, judging that the second application program data has errors and determining the second system state as abnormal.
In one embodiment, after the step of determining the boot result by the second determiner in the load determining partition, the computer program when executed by the processor causes the processor to further perform the steps of:
and if the system is successfully started, resetting the starting success times of the second judgment program and the starting success times of the second system to zero.
In one embodiment, after the steps of determining that the second application data is in error and determining the second system state as abnormal, the computer program when executed by the processor causes the processor to further perform the steps of:
and recovering the system according to a preset upgrading mode.
In a fourth aspect, in one embodiment, the present invention provides a storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in the corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
And the second application program data starts the system according to the second application program configuration information and the second application program data.
Through the storage medium, two configuration partitions and two program partitions are arranged to form two mutually backup starting paths, and when program data needed by one starting path is wrong or lost to cause incapability of starting, the other starting path is automatically switched to, so that the fault tolerance rate of the system is improved, a user is not required to have professional guidance operation, and the maintenance cost of equipment is reduced.
In one embodiment, after the step of launching the system in accordance with the first application configuration information and the first application data, the computer program, when executed by the processor, causes the processor to further perform the steps of:
loading a first judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the starting success times of the first judgment program in the first configuration partition and the starting success times of the first system;
if the difference between the successful times of the first judgment program starting and the successful times of the first system starting is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to carry out the step of starting the system;
and if the difference between the successful times of starting the first judgment program and the successful times of starting the first system is not less than the preset threshold value, judging that the data of the first application program is in error and determining the state of the first system as abnormal.
In one embodiment, after the step of determining the boot result by the first determining program in the load determining partition, the computer program when executed by the processor causes the processor to further perform the steps of:
and if the system is successfully started, resetting the starting success times of the first judgment program and the starting success times of the first system to zero.
In one embodiment, prior to the step of launching the system in accordance with the first application configuration information and the first application data, the computer program when executed by the processor causes the processor to further perform the steps of:
setting a watchdog to start timing;
if the difference between the first judgment program starting success frequency and the first system starting success frequency is smaller than the preset threshold, re-entering the boot program in the loading boot partition to start the system, wherein the step comprises the following steps:
and if the difference between the successful starting times of the first judgment program and the first system starting successful times is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system after the watchdog timing reaches a preset time.
In one embodiment, after the step of booting the system in accordance with the second application configuration information and the second application data, the computer program, when executed by the processor, causes the processor to further perform the steps of:
loading a second judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the number of successful times of starting a second judgment program in a second configuration partition and the number of successful times of starting the second system;
if the difference between the successful times of the second judgment program starting and the successful times of the second system starting is smaller than the preset threshold value, re-entering the step of loading the bootstrap program in the bootstrap partition to start the system;
and if the difference between the second judgment program starting success frequency and the second system starting success frequency is not less than the preset threshold, judging that the second application program data has errors and determining the second system state as abnormal.
In one embodiment, after the step of determining the boot result by the second determiner in the load determining partition, the computer program when executed by the processor causes the processor to further perform the steps of:
and if the system is successfully started, resetting the starting success times of the second judgment program and the starting success times of the second system to zero.
In one embodiment, after the steps of determining that the second application data is in error and determining the second system state as abnormal, the computer program when executed by the processor causes the processor to further perform the steps of:
and recovering the system according to a preset upgrading mode.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, databases, or other media used in embodiments provided herein may include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.

Claims (10)

1. A router activation method, comprising:
loading a bootstrap program in the bootstrap partition to start the system;
reading a first system state, a first application program partition table and first application program configuration information in a first configuration partition;
if the first system state is normal, loading first application program data in a corresponding first application program partition according to the first application program partition table and starting a system according to the first application program configuration information and the first application program data;
if the first system state is abnormal, reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition;
and if the second system state is normal, loading second application program data in a corresponding second application program partition according to the second application program partition table and starting the system according to the second application program configuration information and the second application program data.
2. The router boot method according to claim 1, further comprising, after the step of booting a system according to the first application configuration information and the first application data:
loading a first judgment program in the judgment partition to judge the starting result;
if the system is not successfully started, reading the number of times of successful starting of a first judgment program and the number of times of successful starting of a first system in the first configuration partition;
if the difference between the successful times of the first judgment program starting and the successful times of the first system starting is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to carry out system starting;
and if the difference between the successful times of starting the first judgment program and the successful times of starting the first system is not smaller than the preset threshold value, judging that the data of the first application program is in error and determining the state of the first system as abnormal.
3. The router boot method according to claim 2, after the step of judging the boot result by the first judging program in the load judgment partition, further comprising:
and if the system is successfully started, resetting the starting success times of the first judgment program and the starting success times of the first system to zero.
4. The router boot method according to claim 2, further comprising, before the step of booting the system according to the first application configuration information and the first application data:
setting a watchdog to start timing;
if the difference between the successful times of starting the first judgment program and the successful times of starting the first system is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system, wherein the step comprises the following steps:
and if the difference between the successful starting times of the first judgment program and the first system starting successful times is smaller than a preset threshold value, re-entering the boot program in the loading boot partition to start the system after the watchdog timer reaches a preset time.
5. The router boot method according to claim 2, further comprising, after the step of booting the system according to the second application configuration information and the second application data:
loading a second judgment program in the judgment partition to judge a starting result;
if the system is not successfully started, reading the number of times of successful starting of a second judgment program and the number of times of successful starting of a second system in the second configuration partition;
if the difference between the second judgment program starting success times and the second system starting success times is smaller than the preset threshold value, re-entering the boot program in the loading boot partition to carry out system starting;
and if the difference between the second judgment program starting success frequency and the second system starting success frequency is not less than the preset threshold, judging that the second application program data is in error and determining the second system state as abnormal.
6. The router boot method according to claim 5, further comprising, after the step of loading the second judgment program in the judgment partition to judge the boot result:
and if the system is successfully started, resetting the starting success times of the second judgment program and the starting success times of the second system to zero.
7. The router boot method according to claim 5, further comprising, after the step of determining that the second application data is erroneous and determining the second system state as abnormal:
and recovering the system according to a preset upgrading mode.
8. A router activation apparatus, comprising:
the boot module is used for loading a boot program in the boot partition to start the system;
the reading module is used for reading a first system state, a first application program partition table and first application program configuration information in the first configuration partition;
the starting module is used for loading the first application program data in the corresponding first application program partition according to the first application program partition table and starting the system according to the first application program configuration information and the first application program data when the first system state is normal;
the reading module is further used for reading a second system state, a second application program partition table and second application program configuration information in a second configuration partition when the first system state is abnormal;
the starting module is further configured to, when the second system state is normal, load second application data in a corresponding second application partition according to the second application partition table and start the system according to the second application configuration information and the second application data.
9. A router comprising a memory and a processor, the memory having stored thereon a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the router activation method of any one of claims 1 to 7.
10. A storage medium storing a computer program, wherein the computer program, when executed by a processor, causes the processor to perform the router startup method according to any one of claims 1-7.
CN202110958591.3A 2021-08-20 2021-08-20 Router starting method and device, router and storage medium Pending CN113672302A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110958591.3A CN113672302A (en) 2021-08-20 2021-08-20 Router starting method and device, router and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110958591.3A CN113672302A (en) 2021-08-20 2021-08-20 Router starting method and device, router and storage medium

Publications (1)

Publication Number Publication Date
CN113672302A true CN113672302A (en) 2021-11-19

Family

ID=78544177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110958591.3A Pending CN113672302A (en) 2021-08-20 2021-08-20 Router starting method and device, router and storage medium

Country Status (1)

Country Link
CN (1) CN113672302A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166561A (en) * 2014-07-25 2014-11-26 深圳市江波龙电子有限公司 Electronic device system start method and electronic device
CN109445861A (en) * 2018-10-18 2019-03-08 深圳市网心科技有限公司 System start method, device, computer installation and storage medium
CN110134445A (en) * 2019-04-02 2019-08-16 视联动力信息技术股份有限公司 A kind of switching method and apparatus of operating system
CN110347532A (en) * 2019-07-11 2019-10-18 陕西瑞迅电子信息技术有限公司 Multi-partitioned systems backup method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166561A (en) * 2014-07-25 2014-11-26 深圳市江波龙电子有限公司 Electronic device system start method and electronic device
CN109445861A (en) * 2018-10-18 2019-03-08 深圳市网心科技有限公司 System start method, device, computer installation and storage medium
CN110134445A (en) * 2019-04-02 2019-08-16 视联动力信息技术股份有限公司 A kind of switching method and apparatus of operating system
CN110347532A (en) * 2019-07-11 2019-10-18 陕西瑞迅电子信息技术有限公司 Multi-partitioned systems backup method and device

Similar Documents

Publication Publication Date Title
CN100578461C (en) Backup method and apparatus for bootstrap
CN102298545B (en) System startup boot processing method and device
CN112328358A (en) Dual-system starting method based on virtual machine and storage medium
CN103970564A (en) Automatic repairing and upgrading method of embedded operating system and embedded operating system with automatic repairing and upgrading functions
CN108345464A (en) A kind of the startup method and Android vehicle device of Android system
CN111767172A (en) Self-repairing method for set top box based on watchdog and bootloader
CN111552592A (en) Double-backup starting method and system
CN114047958A (en) Starting method, equipment and medium for baseboard management controller of server
CN116501409B (en) Dual-Flash-based server starting method, computer equipment and storage medium
CN111124760B (en) Uboot-based embedded equipment starting method and apparatus
CN113672302A (en) Router starting method and device, router and storage medium
WO2023103755A1 (en) Terminal starting method, electronic device, and computer-readable storage medium
JP2005284902A (en) Terminal device, control method and control program thereof, host device, control method and control program thereof, and method, system, and program for remote updating
CN115391112A (en) Memory bank testing method, device, equipment and medium based on domestic platform
CN114356658A (en) Processing method of firmware upgrading exception, computer equipment and readable storage medium
CN113849235A (en) Control method and device and electronic equipment
US11768669B2 (en) Installing application program code on a vehicle control system
CN112882757A (en) Embedded system double-partition safe starting method
CN113467805A (en) Firmware rollback method of network equipment and related device
CN108920210B (en) Method, system and related assembly for loading storage control software
CN111190627A (en) System upgrading method and device
CN113805946B (en) Processing method and device for nonvolatile attribute of android system and electronic equipment
CN111078307A (en) Starting method and device of embedded equipment, embedded equipment and storage medium
CN117389598A (en) Configuration update reinforcement method, device, electronic equipment and storage medium
CN115391090A (en) Firmware double-mirror-image self-recovery method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20211119

RJ01 Rejection of invention patent application after publication