CN112532543A - Switch control method, device, equipment and computer readable storage medium - Google Patents

Switch control method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN112532543A
CN112532543A CN202011346928.7A CN202011346928A CN112532543A CN 112532543 A CN112532543 A CN 112532543A CN 202011346928 A CN202011346928 A CN 202011346928A CN 112532543 A CN112532543 A CN 112532543A
Authority
CN
China
Prior art keywords
state
switch
chip
working state
information
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
CN202011346928.7A
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.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry 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 Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN202011346928.7A priority Critical patent/CN112532543A/en
Publication of CN112532543A publication Critical patent/CN112532543A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/10Current supply arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/253Routing or path finding in a switch fabric using establishment or release of connections between ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q1/00Details of selecting apparatus or arrangements
    • H04Q1/02Constructional details
    • H04Q1/10Exchange station construction

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Sources (AREA)

Abstract

The invention discloses a switch control method, which comprises the following steps: acquiring state switching information of a target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start. The switch control method provided by the invention greatly reduces the power consumption and saves the energy. The invention also discloses a control device, equipment and a storage medium of the switch, and the control device, the equipment and the storage medium have corresponding technical effects.

Description

Switch control method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for controlling a switch.
Background
With the rapid development of data center services, a plurality of large data centers are established by each large internet manufacturer. Cloud computing technology has enabled dynamic scheduling of data center resources. The switch in the data center that there are more in the idle stage of business is in standby state, and the main switching chip of switch is in the on-state under the standby state, no matter whether the switch has data exchange, and the main switching chip all is in operating condition, and the main power consumption of switching chip on-state is great, causes more energy waste.
In summary, how to effectively solve the problem that the power consumption of the main switch chip is large and more energy is wasted when the switch is in the standby state is a problem that needs to be solved urgently by those skilled in the art at present.
Disclosure of Invention
The invention aims to provide a switch control method, which greatly reduces the power consumption and saves the energy; another object of the present invention is to provide an exchange control apparatus, an apparatus and a computer-readable storage medium.
In order to solve the technical problems, the invention provides the following technical scheme:
a switch control method comprising:
acquiring state switching information of a target switch;
judging whether the state switching information is switched from a non-working state to a working state;
and if so, controlling a main switching chip in the target switch to start.
In a specific embodiment of the present invention, acquiring the state switching information of the target switch includes:
monitoring each network port of the target switch to obtain port state information corresponding to each network port;
judging whether the state switching information is switched from a non-working state to a working state or not, comprising the following steps:
and judging whether the number of the port state information in the normal working state is converted from less than two to more than or equal to two.
In a specific embodiment of the present invention, monitoring each network port of the target switch includes:
monitoring each network port of the target switch through an I2C link.
In a specific embodiment of the present invention, controlling the start of a main switch chip in the target switch includes:
and sending a power-on control instruction to the CPLD logic chip so that the CPLD logic chip controls the power-on of the main exchange chip.
In a specific embodiment of the present invention, after the CPLD logic chip controls the main switch chip to power on, the method further includes:
loading a pre-stored main exchange chip control program;
and carrying out configuration operation on the main switching chip by utilizing the main switching chip control program.
In a specific embodiment of the present invention, sending a power-on control instruction to a CPLD logic chip includes:
and sending the power-on control instruction to the CPLD logic chip through an I2C link.
A switch control apparatus comprising:
the information acquisition module is used for acquiring the state switching information of the target switch;
the judging module is used for judging whether the state switching information is switched from a non-working state to a working state;
and the chip starting module is used for controlling the starting of a main exchange chip in the target exchange when the state switching information is determined to be switched from the non-working state to the working state.
In a specific embodiment of the present invention, the information obtaining module is specifically a module that monitors each network port of the target switch to obtain port status information corresponding to each network port;
the determining module is specifically configured to determine whether the number of the port state information in the normal operating state is changed from less than two to greater than or equal to two.
A switch control device comprising:
a memory for storing a computer program;
a processor for implementing the steps of the switch control method as described above when executing the computer program.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the switch control method as described above.
The switch control method provided by the invention obtains the state switching information of the target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start. By capturing the state switching information of the target switch, when the state switching information is determined to be switched from the non-working state to the working state, the main switching chip in the target switch is controlled to be started. Therefore, when the target switch is in a non-working state without data exchange, the main switching chip is in a power-off state, so that the power consumption is greatly reduced, and the energy is saved.
Correspondingly, the invention also provides a switch control device, equipment and a computer readable storage medium corresponding to the switch control method, which have the technical effects and are not described herein again.
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.
FIG. 1 is a flow chart of an implementation of a method for controlling a switch according to an embodiment of the present invention;
fig. 2 is a flowchart of another implementation of a switch control method according to an embodiment of the present invention;
fig. 3 is a block diagram of a switch control apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of a switch control device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. 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.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart of an implementation of a method for controlling a switch according to an embodiment of the present invention, where the method may include the following steps:
s101: and acquiring the state switching information of the target switch.
And monitoring the state of the target switch, and acquiring the state switching information of the target switch when the state switching of the target switch is monitored. The state switching information includes switching from a non-operating state in which there is no data exchange to an operating state in which there is a data exchange operation, and switching from an operating state in which there is a data exchange operation to a non-operating state in which there is no data exchange.
The target switch is any switch to be controlled.
S102: and judging whether the state switching information is switched from the non-working state to the working state, if so, executing step S103, and if not, executing step S104.
After the state switching information of the target switch is acquired, whether the state switching information is switched from a non-working state to a working state is judged, if yes, the main switching chip needs to be started to enter the working state, step S103 is executed, if not, the generated state switching information is switched from the working state in which data exchange operation is performed to the non-working state in which data exchange does not exist, the main switching chip does not need to work, and step S104 is executed.
S103: and controlling the main exchange chip in the target exchange to start.
And when the state switching information is determined to be switched from the non-working state to the working state, controlling the main switching chip in the target switch to start, so that the main switching chip is switched from the power-off state to the power-on working state.
S104: and controlling the main exchange chip in the target exchange to stop.
When the state switching information is determined to be switched from the working state of data exchange operation to the non-working state without data exchange, the main exchange chip in the target switch is controlled to stop, so that unnecessary energy consumption is avoided. The main switching system is controlled to be powered on or powered off according to the state switching information of the target switch, so that power consumption is greatly reduced, and energy is saved.
The switch control method provided by the invention obtains the state switching information of the target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start. By capturing the state switching information of the target switch, when the state switching information is determined to be switched from the non-working state to the working state, the main switching chip in the target switch is controlled to be started. Therefore, when the target switch is in a non-working state without data exchange, the main switching chip is in a power-off state, so that the power consumption is greatly reduced, and the energy is saved.
It should be noted that, based on the first embodiment, the embodiment of the present invention further provides a corresponding improvement scheme. In the following embodiments, steps that are the same as or correspond to those in the first embodiment may be referred to each other, and corresponding advantageous effects may also be referred to each other, which are not described in detail in the following modified embodiments.
Example two:
referring to fig. 2, fig. 2 is a flowchart of another implementation of a switch control method in an embodiment of the present invention, where the method may include the following steps:
s201: and monitoring each network port of the target switch through the I2C link to obtain port state information corresponding to each network port.
The switch system monitors each network port of the target switch through the I2C link, connects the I2C links of all the network ports to the I2C of the CPU side, and obtains port state information corresponding to each network port. That is, when a cable or optical module is inserted into a network port of a target switch, an interrupt is triggered to be fed back to the switch system through the I2C link.
S202: and judging whether the number of the ports in the normal working state is converted from less than two to more than or equal to two, if not, executing the step S203, and if so, executing the step S204.
After port state information corresponding to each network port is obtained through monitoring, whether the number of the ports in the normal working state in the port state information is converted from less than two to more than or equal to two is judged, if not, the target switch is possibly in a non-working state, a normal working state or a process of converting from the normal working state to the non-working state; if yes, the target switch switches from the non-operating state in which data exchange does not exist to the operating state in which data exchange operation is performed, and step S204 is executed.
S203: and when the number of the ports in the normal working state is converted from more than or equal to two to less than two in the state information of each port, controlling the main switching chip in the target switch to stop.
After the number of the normal working states in the port state information is determined not to be converted from less than two to more than or equal to two, when the number of the normal working states in the port state information is converted from more than or equal to two to less than two, the process that the target switch is converted from the normal working state to the non-working state is indicated, and the main switch chip in the target switch is controlled to stop. Otherwise, no processing is required.
S204: and sending a power-on control instruction to the CPLD logic chip through the I2C link so that the CPLD logic chip controls the power-on of the main exchange chip.
And when the number of the ports in the normal working state is determined to be converted from less than two to more than or equal to two, sending a power-on control instruction to the CPLD logic chip through the I2C link, and controlling the power-on of the main exchange chip by the CPLD logic chip according to the received power-on control instruction.
S205: and loading a pre-stored main exchange chip control program.
And before the power of the main exchange chip is cut off each time, the control program of the main exchange chip is stored. And after the CPLD logic chip controls the main exchange chip to be powered on, loading a pre-stored main exchange chip control program.
S206: and carrying out configuration operation on the main exchange chip by using a main exchange chip control program.
After the main exchange chip control program is loaded, the main exchange chip control program is used for carrying out configuration operation on the main exchange chip. Therefore, the main exchange chip is restored to the configuration before power failure, and corresponding data exchange work is carried out by using the main exchange chip. The main switching chip is not powered on when the target switch is in the default power-on state, and the main switching chip is powered on in a delayed mode according to the state switching information of the target switch, so that power consumption is greatly reduced, and energy is saved.
The present embodiment is different from the first embodiment corresponding to the technical solution claimed in independent claim 1, and the technical solutions claimed in the dependent claims 2 to 6 are added, and of course, according to different practical situations and requirements, the technical solutions claimed in the dependent claims can be flexibly combined on the basis of not affecting the completeness of the solutions, so as to better meet the requirements of different use scenarios.
The present invention also provides a switch control apparatus corresponding to the above method embodiment, and the switch control apparatus described below and the switch control method described above may be referred to in correspondence with each other.
Referring to fig. 3, fig. 3 is a block diagram of an apparatus for controlling an exchange according to an embodiment of the present invention, where the apparatus may include:
an information obtaining module 31, configured to obtain state switching information of a target switch;
a judging module 32, configured to judge whether the state switching information is switched from a non-operating state to an operating state;
and a chip starting module 33, configured to control a main switch chip in the target switch to start when it is determined that the state switching information is switched from the non-operating state to the operating state.
The switch control device provided by the invention acquires the state switching information of a target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start. By capturing the state switching information of the target switch, when the state switching information is determined to be switched from the non-working state to the working state, the main switching chip in the target switch is controlled to be started. Therefore, when the target switch is in a non-working state without data exchange, the main switching chip is in a power-off state, so that the power consumption is greatly reduced, and the energy is saved.
In a specific embodiment of the present invention, the information obtaining module 31 is specifically a module that monitors each network port of the target switch to obtain port status information corresponding to each network port;
the determining module 32 is specifically a module that determines whether the number of the ports in the state information in the normal operating state is changed from less than two to more than or equal to two.
In an embodiment of the present invention, the information obtaining module 31 is specifically a module that monitors each network port of the target switch through an I2C link.
In a specific embodiment of the present invention, the chip start module 33 is specifically a module that sends a power-on control instruction to the CPLD logic chip, so that the CPLD logic chip controls the power-on of the main switch chip.
In one embodiment of the present invention, the apparatus may further include:
the program loading module is used for loading a pre-stored main exchange chip control program after the CPLD logic chip controls the main exchange chip to be electrified;
and the configuration module is used for configuring the main switching chip by utilizing the main switching chip control program.
In a specific embodiment of the present invention, the chip starting module 33 includes a command sending submodule, which is specifically a module that sends a power-on control command to the CPLD logic chip through an I2C link.
In correspondence with the above method embodiment, referring to fig. 4, fig. 4 is a schematic diagram of a switch control device provided by the present invention, which may include:
a memory 41 for storing a computer program;
the processor 42, when executing the computer program stored in the memory 41, may implement the following steps:
acquiring state switching information of a target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start.
For the introduction of the device provided by the present invention, please refer to the above method embodiment, which is not described herein again.
Corresponding to the above method embodiment, the present invention further provides a computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the steps of:
acquiring state switching information of a target switch; judging whether the state switching information is switched from a non-working state to a working state; and if so, controlling a main exchange chip in the target exchange to start.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method.
The principle and the implementation of the present invention are explained in the present application by using specific examples, and the above description of the embodiments is only used to help understanding the technical solution and the core idea of the present invention. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A switch control method, comprising:
acquiring state switching information of a target switch;
judging whether the state switching information is switched from a non-working state to a working state;
and if so, controlling a main switching chip in the target switch to start.
2. The switch control method according to claim 1, wherein obtaining the state switching information of the target switch comprises:
monitoring each network port of the target switch to obtain port state information corresponding to each network port;
judging whether the state switching information is switched from a non-working state to a working state or not, comprising the following steps:
and judging whether the number of the port state information in the normal working state is converted from less than two to more than or equal to two.
3. The switch control method according to claim 2, wherein monitoring each network port of the target switch comprises:
monitoring each network port of the target switch through an I2C link.
4. The switch control method according to any one of claims 1 to 3, wherein controlling a master switching chip in the target switch to start comprises:
and sending a power-on control instruction to the CPLD logic chip so that the CPLD logic chip controls the power-on of the main exchange chip.
5. The switch control method according to claim 4, further comprising, after the CPLD logic chip controls the main switch chip to power up:
loading a pre-stored main exchange chip control program;
and carrying out configuration operation on the main switching chip by utilizing the main switching chip control program.
6. The switch control method according to claim 4, wherein sending a power-on control instruction to the CPLD logic chip includes:
and sending the power-on control instruction to the CPLD logic chip through an I2C link.
7. A switch control apparatus, comprising:
the information acquisition module is used for acquiring the state switching information of the target switch;
the judging module is used for judging whether the state switching information is switched from a non-working state to a working state;
and the chip starting module is used for controlling the starting of a main exchange chip in the target exchange when the state switching information is determined to be switched from the non-working state to the working state.
8. The switch control device according to claim 7, wherein the information obtaining module is specifically a module that monitors each network port of the target switch to obtain port status information corresponding to each network port;
the determining module is specifically configured to determine whether the number of the port state information in the normal operating state is changed from less than two to greater than or equal to two.
9. A switch control apparatus, characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the switch control method according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which, when being executed by a processor, implements the steps of the switch control method according to any one of claims 1 to 6.
CN202011346928.7A 2020-11-26 2020-11-26 Switch control method, device, equipment and computer readable storage medium Pending CN112532543A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011346928.7A CN112532543A (en) 2020-11-26 2020-11-26 Switch control method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011346928.7A CN112532543A (en) 2020-11-26 2020-11-26 Switch control method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112532543A true CN112532543A (en) 2021-03-19

Family

ID=74993631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011346928.7A Pending CN112532543A (en) 2020-11-26 2020-11-26 Switch control method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112532543A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023165419A1 (en) * 2022-03-01 2023-09-07 华为技术有限公司 Method and apparatus for controlling sleep of network device, and network device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102725997A (en) * 2011-12-09 2012-10-10 华为技术有限公司 Method and device for realizing low power consumption of data switching equipment, and data switching equipment
CN202634467U (en) * 2012-06-15 2012-12-26 上海斐讯数据通信技术有限公司 Network switch
CN106301803A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 A kind of chip power supply control method, device and communication equipment
US20170149693A1 (en) * 2015-11-25 2017-05-25 Fujitsu Limited Computer-readable recording medium, switch controlling apparatus, and method of controlling a switch
CN111786912A (en) * 2020-05-18 2020-10-16 深圳震有科技股份有限公司 Switch port mode switching method, switch and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102725997A (en) * 2011-12-09 2012-10-10 华为技术有限公司 Method and device for realizing low power consumption of data switching equipment, and data switching equipment
CN202634467U (en) * 2012-06-15 2012-12-26 上海斐讯数据通信技术有限公司 Network switch
CN106301803A (en) * 2015-06-12 2017-01-04 中兴通讯股份有限公司 A kind of chip power supply control method, device and communication equipment
US20170149693A1 (en) * 2015-11-25 2017-05-25 Fujitsu Limited Computer-readable recording medium, switch controlling apparatus, and method of controlling a switch
CN111786912A (en) * 2020-05-18 2020-10-16 深圳震有科技股份有限公司 Switch port mode switching method, switch and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023165419A1 (en) * 2022-03-01 2023-09-07 华为技术有限公司 Method and apparatus for controlling sleep of network device, and network device and storage medium

Similar Documents

Publication Publication Date Title
US9532359B2 (en) Resource allocation method and device
CN111277399B (en) Control method, system, medium and electronic device for PDCCH monitoring
CN102346779B (en) Distributed file system and master control node backup method
US10194397B2 (en) Power supply control method and wireless terminal
CN113746821B (en) Intelligent device control method and device, storage medium and electronic device
CN111148052B (en) State determination method, system, medium, and electronic device
CN108959139A (en) A kind of CPLD pin multiplexing method and device
CN112532543A (en) Switch control method, device, equipment and computer readable storage medium
CN101482829A (en) Cluster system, processing equipment and its redundancy method
CN103324554A (en) Standby system device, a control method, and a program thereof
CN116700468A (en) Server power supply design scheme capable of meeting independent power supply of DPU card
CN102204165A (en) Method for controlling backup device, primary device and backup device
CN111309132B (en) Method for multi-gear power supply redundancy of server
CN102083049A (en) Startup and shutdown system and switching method thereof
KR20150104435A (en) Method of performing transition of operation mode for a routing processor
CN116107817A (en) Redundant working method and system for double computing modules of VPX server
CN112153119B (en) Control equipment, method and system
CN110119111B (en) Communication method and device, storage medium, and electronic device
JPH09247194A (en) Lan control system
CN110096366B (en) Configuration method and device of heterogeneous memory system and server
US9710052B2 (en) Dynamic energy savings for digital signal processor modules using plural energy savings states
CN100472443C (en) Method and system for quick start-up for computer
CN113190183B (en) Storage cluster device and equipment mounting method
CN117544584B (en) Control method, device, switch and medium based on double CPU architecture
CN112994918B (en) Equipment management method and device

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: 20210319