CN105939259B - Control method, device and the router of router - Google Patents

Control method, device and the router of router Download PDF

Info

Publication number
CN105939259B
CN105939259B CN201610506380.5A CN201610506380A CN105939259B CN 105939259 B CN105939259 B CN 105939259B CN 201610506380 A CN201610506380 A CN 201610506380A CN 105939259 B CN105939259 B CN 105939259B
Authority
CN
China
Prior art keywords
main control
program
main
router
installation package
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
CN201610506380.5A
Other languages
Chinese (zh)
Other versions
CN105939259A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201610506380.5A priority Critical patent/CN105939259B/en
Publication of CN105939259A publication Critical patent/CN105939259A/en
Application granted granted Critical
Publication of CN105939259B publication Critical patent/CN105939259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/42Centralised routing
    • 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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed routing
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of control method of router, device and routers, this method comprises: detecting in the router whether be inserted into main control card after the master control borad in the router powers on;If it is detected that being inserted into main control card in the router, then after receiving the distributed main program load instruction that the main control card is sent, load the first distributed main program of the master control borad, the distribution main program load instruction is sent after the main control card loads the second distributed main program of the main control card;If it is detected that being not inserted into main control card in the router, the centralized main program of the master control borad is loaded;The service card for including to the router powers on, to complete the router startup.The program realizes the diversification of router purposes, also can satisfy this diversified demand of user.

Description

Router control method and device and router
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for controlling a router, and a router.
Background
Routers have experienced rapid growth in recent years, from traditional centralized routers to improved centralized routers to pluggable distributed routers.
According to the current control method of the router, any type of router can only be used as a set type of router after the program in the router is set. For example, for the improved centralized router shown in fig. 1, the service card is inserted and pulled, and the scalability is high, but when the program on the main control board in the router is set as the centralized main program, the router can only be used as the centralized router, and even if the pluggable service card is replaced by the main control card, the router cannot be used as the distributed router.
As can be seen from the above, the control method of the router at present can only control one router to be used as a router of only one setting type, and cannot flexibly control one router to be used as a centralized router or a distributed router as required, which results in a single router usage, and if a user has diverse needs for one router (for example, sometimes needs to be used as a centralized router, sometimes needs to be used as a distributed router), the control method of the router cannot meet the diverse needs of the user.
Disclosure of Invention
The embodiment of the invention provides a control method and device of a router and the router, which are used for solving the problems that the existing control method of the router causes single use of the router and cannot meet diversified requirements of users.
According to an embodiment of the present invention, there is provided a method for controlling a router, including:
and after the main control board in the router is powered on, detecting whether a main control card is inserted into the router or not.
If the main control card is inserted into the router, loading a first distributed main program of the main control board after receiving a distributed main program loading instruction sent by the main control card, wherein the distributed main program loading instruction is sent after the main control card loads a second distributed main program of the main control card; and if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board.
And powering on a service card included in the router to complete the starting of the router.
Specifically, loading the first distributed main program of the main control board specifically includes:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board.
And loading a first distributed main program of the main control board.
Specifically, loading the centralized main program of the main control board specifically includes:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board.
And loading the centralized main program of the main control board.
Optionally, the method further includes:
before loading the first distributed main program of the main control board, receiving an upgraded program installation package sent by the main control card, and replacing the stored program installation package with the upgraded program installation package. Or,
and after the first distributed main program of the main control board is loaded, receiving an upgraded program installation package sent by the main control card, replacing the stored program installation package with the upgraded program installation package, and restarting the router.
According to an embodiment of the present invention, there is also provided a method for controlling a router, including:
after a main control card in the router is powered on, loading a second distributed main program of the main control card; and the number of the first and second groups,
and sending a distributed main program loading instruction to a main control board in the router so that the main control board loads a first distributed main program of the main control board.
Specifically, loading the second distributed main program of the main control card specifically includes:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card.
And loading a second distributed main program of the main control card.
Optionally, the method further includes:
after receiving an upgraded program installation package, determining whether the upgraded program installation package is the same as the stored program installation package;
and if the upgraded program installation package is different from the stored program installation package, sending the upgraded program installation package to the main control board so that the main control board replaces the stored program installation package with the upgraded program installation package.
According to an embodiment of the present invention, there is also provided a control apparatus for a router, including:
the detection module is used for detecting whether a master control card is inserted into the router or not after a master control board in the router is powered on;
the router comprises a loading module, a first module and a second module, wherein the loading module is used for loading a first distributed main program of a main control board after receiving a distributed main program loading instruction sent by a main control card if the main control card is inserted into the router, and the distributed main program loading instruction is sent after the main control card loads a second distributed main program of the main control card; and if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board.
And the power-on module is used for powering on a service card included in the router so as to finish the starting of the router.
Specifically, the loading module is configured to load a first distributed main program of the main control board, and is specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board.
And loading a first distributed main program of the main control board.
Specifically, the loading module is configured to load the centralized main program of the main control board, and is specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board.
And loading the centralized main program of the main control board.
Optionally, the system further includes an upgrade module, configured to:
before loading a first distributed main program of the main control board, receiving an upgraded program installation package sent by the main control card, and replacing the stored program installation package with the upgraded program installation package; or,
and after the first distributed main program of the main control board is loaded, receiving an upgraded program installation package sent by the main control card, replacing the stored program installation package with the upgraded program installation package, and restarting the router.
According to an embodiment of the present invention, there is also provided a control apparatus for a router, including:
the loading module is used for loading a second distributed main program of the main control card after the main control card in the router is powered on; and the number of the first and second groups,
the first sending module is used for sending a distributed main program loading instruction to a main control board in the router so that the main control board loads a first distributed main program of the main control board.
Specifically, the loading module is configured to load a second distributed main program of the main control card, and is specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card.
And loading a second distributed main program of the main control card.
Optionally, the method further includes:
and the determining module is used for determining whether the upgraded program installation package is the same as the stored program installation package after receiving the upgraded program installation package.
And the second sending module is used for sending the upgraded program installation package to the main control board if the upgraded program installation package is different from the stored program installation package, so that the main control board replaces the stored program installation package with the upgraded program installation package.
According to an embodiment of the present invention, there is also provided a router including the control device of the router.
The invention has the following beneficial effects:
the embodiment of the invention provides a method and a device for controlling a router and the router, wherein after a main control board in the router is powered on, whether a main control card is inserted into the router is detected; if the main control card is inserted into the router, loading a first distributed main program of the main control board after receiving a distributed main program loading instruction sent by the main control card, wherein the distributed main program loading instruction is sent after the main control card loads a second distributed main program of the main control card; if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board; and powering on a service card included in the router to complete the starting of the router. In the scheme, when the main control board detects that the main control card is inserted into the router, the main control board loads the first distributed main program, the router serves as a distributed router at the moment, when the main control board detects that the main control card is not inserted into the router, the main control board loads the centralized main program, the router serves as a centralized router at the moment, and therefore the router can serve as the distributed router or the centralized router according to actual needs, diversification of the purposes of the router is achieved, and if a user has diversified requirements for one router (for example, the user sometimes needs to serve as the centralized router and sometimes needs to serve as the distributed router), the control method of the router can also meet the diversified requirements of the user.
Drawings
Fig. 1 is a schematic diagram of an improved router in the prior art.
Fig. 2 is a flowchart of a method for controlling a router with a main control board as an execution main body according to an embodiment of the present invention.
Fig. 3 is a flowchart of S21 in the embodiment of the present invention.
Fig. 4 is a flowchart of S22 in the embodiment of the present invention.
Fig. 5 is a schematic structural diagram of a program installation package in the embodiment of the present invention.
Fig. 6 is a flowchart of S23 in the embodiment of the present invention.
Fig. 7 is a flowchart of S24 in the embodiment of the present invention.
Fig. 8 is a flowchart of a method for controlling a router with a main control card as an execution main body according to an embodiment of the present invention.
Fig. 9 is a flowchart of S81 in the embodiment of the present invention.
Fig. 10 is a schematic structural diagram of a control device of a router corresponding to fig. 2 in an embodiment of the present invention.
Fig. 11 is a schematic structural diagram of a control device of a router corresponding to fig. 8 in an embodiment of the present invention.
Detailed Description
Aiming at the problem that the existing control method of the router causes a single usage of the router and cannot meet the diversified demands of users, the embodiment of the present invention provides a control method of the router, an execution main body of the method may be a main control board in the router shown in fig. 1, and a flow is shown in fig. 2, and the execution steps are as follows:
s20: and powering on a main control board in the router.
S21: detecting whether a main control card is inserted into the router, and if detecting that the main control card is inserted into the router, executing S22; if it is detected that the master card is not inserted into the router, S23 is executed.
In the router shown in fig. 1, the main control board has the same hardware characteristics for the centralized main program and the distributed main program, and the card slot connected to the card slot adapter board 1 may be a service card, may also be a main control card, and may also not be inserted with any card. When a main control card is inserted into a card slot connected with the card slot adapter plate 1, namely the main control card is inserted into a router, the router is used as a distributed router; when a service card is inserted into the card slot connected to the card slot adapter board 1 or no card is inserted into the card slot, that is, when no master card is inserted into the router, the router is used as a centralized router. Therefore, after the router is started, the main control board in the router is powered on, the main control board firstly needs to detect whether the main control card is inserted into the router, and then determines the type of the router according to the detection result, thereby further determining the main program to be loaded.
S22: after receiving the distributed main program loading instruction sent by the main control card, the first distributed main program of the main control board is loaded, and S24 is executed.
If the main control card is inserted into the router, the first distributed main program can be loaded after a distributed main program loading instruction sent by the main control card is received, and the distributed main program loading instruction is sent after the main control card loads the second distributed main program. Because the first distributed main program is loaded on the main control board and the second distributed main program is loaded on the main control card, the router can be used as a distributed router at the moment.
S23: the centralized main program of the main control board is loaded, and S24 is executed.
If the master control card is not inserted into the router, the master control board can directly load the centralized main program, and the router can be used as a centralized router.
S24: and powering on a service card included in the router to complete the starting of the router.
Usually, the router includes at least one service card, and after the main control board finishes loading the required program, all the service cards included in the router may be powered on, thereby completing services such as starting the router, forwarding a message by the router, and the like.
In the scheme, when the main control board detects that the main control card is inserted into the router, the main control board loads the first distributed main program, the router serves as a distributed router, when the main control board detects that the main control card is not inserted into the router, the main control board loads the centralized main program, the router serves as a centralized router, and therefore the router can serve as the distributed router or the centralized router according to actual needs, and the purposes of the router are diversified.
Each step in the above-described control method of the router is described in detail below.
Specifically, the implementation process of detecting whether the master card is inserted into the router in S21, as shown in fig. 3, includes:
s211: the process begins.
S212: judging whether the state bit of the main control card is set, if so, executing S213; if the status bit of the host card is not set, go to step S214.
S213: and detecting the insertion of the master control card in the router.
S214: and detecting that the master control card is not inserted into the router.
There are many methods for detecting whether a master control card is inserted into a router, and the router shown in fig. 1 is taken as an example to illustrate, the master control board may determine according to whether a set master control card status bit of a Complex Programmable Logic Device (CPLD) is set, and if the set master control card status bit is set, it indicates that the master control card is inserted into the router; if the status bit of the master control card is not set, it indicates that the master control card is not inserted into the router. The main control board can judge whether the main control card is inserted into the router or not through the steps S211-S214, and the method is simple, effective and high in accuracy.
Specifically, the implementation process of the first distributed main program loaded on the main control board in S22 is shown in fig. 4, and includes:
s221: and acquiring the header information of the stored program installation package.
The main control board usually stores a program installation package, and the program installation package in the prior art only contains one program, not a distributed main program, but a centralized main program, so that the router can only be used as a distributed router or a centralized router. The header information of the stored program installation package may have a plurality of setting manners, and the composition structure of the program installation package in the embodiment of the present invention is shown in fig. 5, where each program installation package has the header information, and the header information stores the centralized main program of the main control board, the second distributed main program and the second distributed loader of the main control card, the first distributed main program and the first distributed loader of the main control board, and others (e.g., a web-Programmable Gate Array (FPGA) upgrade package, a compression format of the program installation package, etc.). The program installation package in the embodiment of the invention comprises the distributed main program and the centralized main program, so that the main control board can select the programs as required, and the router can be used as a distributed router or a centralized router as required.
S222: and searching the compression format of the stored program installation package from the packet header information.
S223: and decompressing the stored program installation package according to the compression format.
S224: and acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board.
Each installation item in the stored program installation package may be stored according to a set rule, and when the set rule is different, the method for acquiring the sub installation item corresponding to the identification information of the main control board and the main program identification is also different, and the stored program installation package shown in fig. 5 is described below. As shown in fig. 5, the respective installation items of the stored programs are arranged from left to right, the centralized main program of the main control board is used as a main installation item, and the second distributed main program and the second distributed loader of the main control card, and the first distributed main program and the first distributed loader of the main control board are used as sub installation items. Because the identification information and the main program identification of the main control board are also stored in the centralized main program of the main control board, in the step, the identification information and the main program identification of the main control board can be searched from the sub installation items, if the identification information and the main program identification of the main control board are searched, the corresponding sub installation items can be obtained, and the first distributed main program of the main control board is obtained.
The identification information of the main control board may be set according to actual needs, for example, may be set as a hardware identifier, a code, and the like of the main control board.
S225: and loading a first distributed main program of the main control board.
After the first distributed main program is obtained, the main control board can load the first distributed main program, so that the router can be used as a distributed router.
The loading of the first distributed main program on the main control board can be realized through steps S221-S225.
Specifically, the implementation process of the centralized main program for loading the main control board in S23 is shown in fig. 6, and includes:
s231: and acquiring the header information of the stored program installation package.
S232: and searching the compression format of the stored program installation package from the packet header information.
S233: and decompressing the stored program installation package according to the compression format.
S234: and acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board.
Each installation item in the stored program installation package may be stored according to a set rule, and when the set rule is different, the method for obtaining the main installation item corresponding to the identification information of the main control board and the main program identification is also different, and the stored program installation package shown in fig. 5 is described below. As shown in fig. 5, the respective installation items of the stored programs are arranged from left to right, the centralized main program of the main control board is used as a main installation item, and the second distributed main program and the second distributed loader of the main control card, and the first distributed main program and the first distributed loader of the main control board are used as sub installation items. Because the sub-installation items corresponding to the distributed main program of the main control board are arranged behind the main installation item corresponding to the centralized main program of the main control board, in the step, the identification information and the main program identification of the main control board can be searched from the main installation item, if the identification information and the main program identification of the main control board are searched, the corresponding main installation item can be obtained, and the centralized main program of the main control board is obtained.
S235: and loading the centralized main program of the main control board.
Except for S234, the process of loading the centralized main program of the main control board is the same as the process of loading the first distributed main program of the main control board, and is not described herein again.
Whether the router is used as a centralized router or a distributed router, later upgrade maintenance is very important. When the master control card is not inserted into the router, namely the router is used as a centralized router, the upgrading method of the program installation package is the same as that of the prior art, and the upgraded program installation package is sent to the master control board for upgrading through an Ethernet management port of the master control board or an external memory; when the master control card is inserted into the router, that is, when the router is used as a distributed router, the step of updating is different when the time of receiving the updated program installation package is different, and the following description will take two cases of receiving the updated program installation package before and after loading the first distributed main program of the master control board in S22 as an example.
In the first case, before the first distributed main program of the main control board is loaded, the upgraded program installation package sent by the main control card is received, and the upgraded program installation package is used for replacing the stored program installation package.
Under the condition, because the main control board does not load the first distributed main program yet, the received upgraded program installation package sent by the main control card can be directly replaced by the stored program installation package, and when the first distributed main program of the main control board is subsequently loaded, the first distributed main program in the upgraded program installation package can be directly loaded, so that equipment upgrading can be directly completed.
In the second case, after the first distributed main program of the main control board is loaded, the upgraded program installation package sent by the main control card is received, the upgraded program installation package is used for replacing the stored program installation package, and the router is restarted.
In this case, since the main control board has already loaded the first distributed main program, and at this time, the upgraded program installation package sent by the main control card is received, the router needs to be restarted, so that the control method of the router is executed again, and it is ensured that the first distributed main program after being upgraded is loaded by the main control board, thereby completing the equipment upgrade.
Specifically, the implementation process of powering on the service card included in the router in S24 is shown in fig. 7, and includes:
s241: each card slot of the router is scanned one by one.
S242: a card slot into which a service card is inserted is determined.
S243: and powering on the service card in the determined card slot.
The router usually includes a plurality of card slots, and the main control board can scan each card slot of the router one by one when determining the service card included in the router, determine the card slot into which the service card is inserted, and finally power on the service card in the determined card slot, thereby realizing power on of all the service cards included in the router.
Based on the same inventive concept, an embodiment of the present invention provides a method for controlling a router, where an execution main body of the method is a main control card in the router shown in fig. 1, and a flow is shown in fig. 8, where the execution steps are as follows:
s81: and after the main control card in the router is powered on, loading a second distributed main program of the main control card.
After the router inserted with the main control card is started, the main control card in the router is powered on at the same time, and after the main control card is powered on, the second distributed main program of the main control card is loaded.
S82: and sending a distributed main program loading instruction to a main control board in the router so that the main control board loads a first distributed main program of the main control board.
When the connection mode of the main control card and the main control board is different, the distributed main program loading instruction is also different, for example, when the main control card and the main control board are connected through a Peripheral Component Interconnect Express (PCIE) bus, the main control card may send the distributed main program loading instruction to the main control board through the PCIE.
In the scheme, when the main control board detects that the main control card is inserted into the router, the main control board loads the first distributed main program, the router serves as a distributed router, when the main control board detects that the main control card is not inserted into the router, the main control board loads the centralized main program, the router serves as a centralized router, and therefore the router can serve as the distributed router or the centralized router according to actual needs, and the purposes of the router are diversified.
Each step in the above-described control method of the router is described in detail below.
Specifically, the implementation process of the second distributed main program of the main control card loaded in S81, as shown in fig. 9, includes:
s811: and acquiring the header information of the stored program installation package.
S812: and searching the compression format of the stored program installation package from the packet header information.
S813: and decompressing the stored program installation package according to the compression format.
S814: and acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card.
S815: and loading a second distributed main program of the main control card.
The process of loading the second distributed main program of the main control card is the same as the process of loading the first distributed main program of the main control board, and the detailed description is omitted here.
Whether the router is used as a centralized router or a distributed router, later upgrade maintenance is very important. When the master control card is not inserted into the router, namely the router is used as a centralized router, the upgrading method of the program installation package is the same as that of the prior art, and the upgraded program installation package is sent to the master control board for upgrading through an Ethernet management port of the master control board or an external memory; when a master control card is inserted into a router, that is, when the router is used as a distributed router, the master control card usually first receives an upgraded program installation package, and determines whether the master control card needs to be sent to a master control board for device upgrade, which specifically includes: after receiving the upgraded program installation package, determining whether the upgraded program installation package is the same as the stored program installation package; and if the upgraded program installation package is different from the stored program installation package, sending the upgraded program installation package to the main control board so that the main control board replaces the stored program installation package with the upgraded program installation package.
The master control card determines whether the upgraded program installation package is the same as the stored program installation package or not by judging whether the version information of the upgraded program installation package is the same as the version information of the stored program installation package or not, if the upgraded program installation package is the same as the version information of the stored program installation package, the upgraded program installation package is the same as the stored program installation package, and if the upgraded program installation package is different from the version information of the stored program installation package, the upgraded program installation package is different from the stored program installation package.
Based on the same inventive concept, an embodiment of the present invention provides a control apparatus for a router, which may be disposed in the router, and corresponds to the control method for the router shown in fig. 2, where the structure of the apparatus is shown in fig. 10, and the apparatus includes:
the detecting module 101 is configured to detect whether a main control card is inserted into a router after a main control board in the router is powered on.
The loading module 102 is configured to, if it is detected that the master control card is inserted into the router, load a first distributed main program of the master control board after receiving a distributed main program loading instruction sent by the master control card, where the distributed main program loading instruction is sent after the master control card loads a second distributed main program of the master control card; and if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board.
And a power-on module 103, configured to power on a service card included in the router to complete router startup.
In the scheme, when the main control board detects that the main control card is inserted into the router, the main control board loads the first distributed main program, the router serves as a distributed router, when the main control board detects that the main control card is not inserted into the router, the main control board loads the centralized main program, the router serves as a centralized router, and therefore the router can serve as the distributed router or the centralized router according to actual needs, and the purposes of the router are diversified.
Specifically, the detecting module 101 is configured to detect whether a master card is inserted into the router, and specifically configured to:
and judging whether the state bit of the main control card is set.
If the state bit of the master control card is set, detecting that the master control card is inserted into the router;
and if the state bit of the main control card is not set, detecting that the main control card is not inserted into the router.
Specifically, the loading module 102 is configured to load a first distributed main program of the main control board, and is specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board.
And loading a first distributed main program of the main control board.
Specifically, the loading module 102 is configured to load a centralized main program of the main control board, and is specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board.
And loading the centralized main program of the main control board.
Optionally, the system further includes an upgrade module, configured to:
before loading the first distributed main program of the main control board, receiving an upgraded program installation package sent by the main control card, and replacing the stored program installation package with the upgraded program installation package. Or,
and after the first distributed main program of the main control board is loaded, receiving an upgraded program installation package sent by the main control card, replacing the stored program installation package with the upgraded program installation package, and restarting the router.
Specifically, the power-on module 103 is configured to power on a service card included in the router, and specifically configured to:
each card slot of the router is scanned one by one.
A card slot into which a service card is inserted is determined.
And powering on the service card in the determined card slot.
Based on the same inventive concept, an embodiment of the present invention provides a control apparatus for a router, which may be disposed in the router, and corresponds to the control method for the router shown in fig. 8, where the apparatus is configured as shown in fig. 11, and includes:
and the loading module 111 is configured to load the second distributed main program of the main control card after the main control card in the router is powered on. And the number of the first and second groups,
the first sending module 112 is configured to send a distributed main program loading instruction to a main control board in the router, so that the main control board loads a first distributed main program of the main control board.
In the scheme, when the main control board detects that the main control card is inserted into the router, the main control board loads the first distributed main program, the router serves as a distributed router, when the main control board detects that the main control card is not inserted into the router, the main control board loads the centralized main program, the router serves as a centralized router, and therefore the router can serve as the distributed router or the centralized router according to actual needs, and the purposes of the router are diversified.
Specifically, the loading module 111 is configured to load a second distributed main program of the main control card, and specifically configured to:
and acquiring the header information of the stored program installation package.
And searching the compression format of the stored program installation package from the packet header information.
And decompressing the stored program installation package according to the compression format.
And acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card.
And loading a second distributed main program of the main control card.
Optionally, the method further includes:
and the determining module is used for determining whether the upgraded program installation package is the same as the stored program installation package after receiving the upgraded program installation package.
And the second sending module is used for sending the upgraded program installation package to the main control board if the upgraded program installation package is different from the stored program installation package, so that the main control board replaces the stored program installation package with the upgraded program installation package.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While alternative embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following appended claims be interpreted as including alternative embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.

Claims (13)

1. A method for controlling a router, comprising:
after a main control board in the router is powered on, detecting whether a main control card is inserted into the router or not;
if the main control card is inserted into the router, loading a first distributed main program of the main control board after receiving a distributed main program loading instruction sent by the main control card, wherein the distributed main program loading instruction is sent after the main control card loads a second distributed main program of the main control card; if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board;
and powering on a service card included in the router to complete the starting of the router.
2. The method of claim 1, wherein loading the first distributed main program of the main control board specifically comprises:
acquiring packet header information of a stored program installation package;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board;
and loading a first distributed main program of the main control board.
3. The method of claim 1, wherein loading the centralized main program of the main control board specifically comprises:
acquiring packet header information of a stored program installation package;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board;
and loading the centralized main program of the main control board.
4. The method of claim 2 or 3, further comprising:
before loading a first distributed main program of the main control board, receiving an upgraded program installation package sent by the main control card, and replacing the stored program installation package with the upgraded program installation package; or,
and after the first distributed main program of the main control board is loaded, receiving an upgraded program installation package sent by the main control card, replacing the stored program installation package with the upgraded program installation package, and restarting the router.
5. A method for controlling a router, comprising:
after a main control card in the router is powered on, loading a second distributed main program of the main control card; and the number of the first and second groups,
sending a distributed main program loading instruction to a main control board in the router so that the main control board loads a first distributed main program of the main control board;
the loading of the second distributed main program of the main control card specifically includes:
acquiring packet header information of a program installation package stored in the main control board, wherein the packet header information stores a centralized main program of the main control board, a second distributed main program of the main control card and a first distributed main program of the main control board;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card;
and loading a second distributed main program of the main control card.
6. The method of claim 5, further comprising:
after receiving an upgraded program installation package, determining whether the upgraded program installation package is the same as the stored program installation package;
and if the upgraded program installation package is different from the stored program installation package, sending the upgraded program installation package to the main control board so that the main control board replaces the stored program installation package with the upgraded program installation package.
7. A control apparatus of a router, comprising:
the detection module is used for detecting whether a master control card is inserted into the router or not after a master control board in the router is powered on;
the router comprises a loading module, a first module and a second module, wherein the loading module is used for loading a first distributed main program of a main control board after receiving a distributed main program loading instruction sent by a main control card if the main control card is inserted into the router, and the distributed main program loading instruction is sent after the main control card loads a second distributed main program of the main control card; if the router is detected not to be inserted with the main control card, loading the centralized main program of the main control board;
and the power-on module is used for powering on a service card included in the router so as to finish the starting of the router.
8. The apparatus of claim 7, wherein the loading module is configured to load a first distributed main program of the main control board, and is specifically configured to:
acquiring packet header information of a stored program installation package;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring sub-installation items corresponding to the identification information of the main control board and the main program identification from the decompressed stored program installation package to obtain a first distributed main program of the main control board;
and loading a first distributed main program of the main control board.
9. The apparatus of claim 7, wherein the loading module is configured to load the centralized main program of the main control board, and is specifically configured to:
acquiring packet header information of a stored program installation package;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring a main installation item corresponding to the identification information of the main control board from the decompressed stored program installation package to obtain a centralized main program of the main control board;
and loading the centralized main program of the main control board.
10. The apparatus of claim 8 or 9, further comprising an upgrade module to:
before loading a first distributed main program of the main control board, receiving an upgraded program installation package sent by the main control card, and replacing the stored program installation package with the upgraded program installation package; or,
and after the first distributed main program of the main control board is loaded, receiving an upgraded program installation package sent by the main control card, replacing the stored program installation package with the upgraded program installation package, and restarting the router.
11. A control apparatus of a router, comprising:
the loading module is used for loading a second distributed main program of the main control card after the main control card in the router is powered on; and the number of the first and second groups,
the first sending module is used for sending a distributed main program loading instruction to a main control board in the router so that the main control board loads a first distributed main program of the main control board;
the loading module is configured to load a second distributed main program of the main control card, and is specifically configured to:
acquiring packet header information of a program installation package stored in the main control board, wherein the packet header information stores a centralized main program of the main control board, a second distributed main program of the main control card and a first distributed main program of the main control board;
searching the compression format of the stored program installation package from the packet header information;
decompressing the stored program installation package according to the compression format;
acquiring sub-installation items corresponding to the identification information of the main control card and the main program identification from the decompressed stored program installation package to obtain a second distributed main program of the main control card;
and loading a second distributed main program of the main control card.
12. The apparatus of claim 11, further comprising:
the determining module is used for determining whether the upgraded program installation package is the same as the stored program installation package after receiving the upgraded program installation package;
and the second sending module is used for sending the upgraded program installation package to the main control board if the upgraded program installation package is different from the stored program installation package, so that the main control board replaces the stored program installation package with the upgraded program installation package.
13. A router, characterized by comprising control means of a router according to any of claims 7-10; or,
control means comprising a router according to any of claims 7-10 and a router according to claim 11 or 12.
CN201610506380.5A 2016-07-01 2016-07-01 Control method, device and the router of router Active CN105939259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610506380.5A CN105939259B (en) 2016-07-01 2016-07-01 Control method, device and the router of router

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610506380.5A CN105939259B (en) 2016-07-01 2016-07-01 Control method, device and the router of router

Publications (2)

Publication Number Publication Date
CN105939259A CN105939259A (en) 2016-09-14
CN105939259B true CN105939259B (en) 2019-08-20

Family

ID=56873190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610506380.5A Active CN105939259B (en) 2016-07-01 2016-07-01 Control method, device and the router of router

Country Status (1)

Country Link
CN (1) CN105939259B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111343087B (en) * 2020-02-26 2022-02-01 深圳市风云实业有限公司 Reusable multipurpose distributed router system and implementation method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1217790A1 (en) * 2000-12-22 2002-06-26 Abb Research Ltd. Method for the actualisation of routing tables
CN101267351A (en) * 2008-05-13 2008-09-17 杭州华三通信技术有限公司 Realization method, system and device for online software upgrade based on application architecture
CN101329682A (en) * 2008-07-22 2008-12-24 华北电力大学 Method for integrating distribution type isomerization information resource
CN103188157A (en) * 2011-12-28 2013-07-03 迈普通信技术股份有限公司 Router equipment
CN103327127A (en) * 2013-07-16 2013-09-25 迈普通信技术股份有限公司 Drive operation method and device in distributed-type system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1217790A1 (en) * 2000-12-22 2002-06-26 Abb Research Ltd. Method for the actualisation of routing tables
CN101267351A (en) * 2008-05-13 2008-09-17 杭州华三通信技术有限公司 Realization method, system and device for online software upgrade based on application architecture
CN101329682A (en) * 2008-07-22 2008-12-24 华北电力大学 Method for integrating distribution type isomerization information resource
CN103188157A (en) * 2011-12-28 2013-07-03 迈普通信技术股份有限公司 Router equipment
CN103327127A (en) * 2013-07-16 2013-09-25 迈普通信技术股份有限公司 Drive operation method and device in distributed-type system

Also Published As

Publication number Publication date
CN105939259A (en) 2016-09-14

Similar Documents

Publication Publication Date Title
CN110032382A (en) A kind of vehicle electronic control unit upgrade method, system and terminal device
US9098374B2 (en) Version control for software configurable aircraft systems
CN110083374B (en) Upgrade rollback method, system and terminal equipment
CN110730090B (en) Batch updating method, device, medium and electronic equipment for agent terminals in cloud environment
CN106648781B (en) Method and system for upgrading remote firmware of communication equipment
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
CN109857423A (en) Program version update method, device, server and readable storage medium storing program for executing
CN110535776B (en) Gateway current limiting method, device, gateway, system and storage medium
CN112398673A (en) Upgrading method, communication equipment and computer readable storage medium
CN110865819B (en) OS installation method, server and system
CN112394957A (en) Server upgrading method and device, server and storage medium
CN114201197A (en) Firmware upgrading method and device, electronic equipment and readable storage medium
CN109327499B (en) Service interface management method and device, storage medium and terminal
CN105939259B (en) Control method, device and the router of router
CN101388792A (en) Single board plug-and-use processing method, device and telecommunication system
CN111984287A (en) Equipment upgrading method and system
CN109032673A (en) Automatically reply the method and computer system of basic input output system image shelves
CN110244982B (en) Data recovery method and device
CN112579247A (en) Method and device for determining task state
CN116132974A (en) Method, apparatus and storage medium for over-the-air in a multi-node device network
CN110768811A (en) Method, device and system for updating YANG model file library
CN103914339A (en) Server management system and server management method
CN111221556B (en) Remote upgrade RSU mirror image method and system
CN114416132A (en) Equipment upgrading method, device, equipment and storage medium
CN106445623B (en) System component starting method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant