CN106648014B - Server protection method and device based on internet access perception - Google Patents
Server protection method and device based on internet access perception Download PDFInfo
- Publication number
- CN106648014B CN106648014B CN201610813615.5A CN201610813615A CN106648014B CN 106648014 B CN106648014 B CN 106648014B CN 201610813615 A CN201610813615 A CN 201610813615A CN 106648014 B CN106648014 B CN 106648014B
- Authority
- CN
- China
- Prior art keywords
- server
- power
- state
- network port
- internet access
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000008447 perception Effects 0.000 title claims abstract description 17
- 230000005540 biological transmission Effects 0.000 abstract description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000008358 core component Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/30—Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations
- G06F1/305—Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations in the event of power-supply fluctuations
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
The invention provides a server protection method and a device based on internet access perception, wherein the method comprises the following steps: (1) after the server is powered on, detecting whether a network port of the server is in a power-down state; (2) and when the state of the network port of the server is detected to be a power-down state, the server is switched to an emergency working state. The technical scheme provided by the invention is that whether the server is switched to the emergency working state or not is judged by detecting the network port of the server, and the server can directly acquire power failure information because the device for detecting the power failure of the network port of the server is arranged on the server, so that the link of data transmission is saved, and the cost of power failure protection of the server is saved.
Description
Technical Field
The invention relates to the technical field of server power failure protection, in particular to a server protection method and device based on internet access perception.
Background
The server is a core component for processing and storing data in the data center, the reliability of the operation of the server is very important, and especially when the power supply is in a problem, how to protect the user data from being lost is a very critical problem. At present, the problem is mainly solved by adding a UPS (uninterrupted power supply) to the front end of the server, namely an uninterrupted power supply system.
In a power supply system with a UPS, mains supply is firstly connected into the UPS, then the UPS transmits power to the server, and when the mains supply is abnormal, the UPS switches the power supply system of the server to a standby power supply state. However, the electric quantity of the UPS storage battery is limited, and the server can only be maintained to work for a period of time after the mains supply is powered off, and when the electric quantity of the UPS storage battery is exhausted, the server still has a possibility of losing important data due to abnormal shutdown of the power failure, which brings huge loss to users.
The patent with publication number CN101895414A discloses a method for power down protection of a server power down protection system, which is to set a power down detection device on a UPS, when detecting that a mains supply is powered down, the UPS sends power down information to the server through an RS232 interface, and the server switches to an emergency working state after receiving the power down information, that is, a working state for data storage and emergency task processing is performed, thereby realizing power down protection of the server. The device for detecting power failure is arranged on the UPS, so that the UPS and the server need to be provided with communication connection for the server to know the power failure information, and the cost of the server power failure protection system is increased.
Disclosure of Invention
The invention provides a server protection method and device based on internet access perception, which are used for solving the problem of cost increase caused by the fact that a communication connection is required to be arranged between a UPS and a server.
A server protection method based on internet access perception comprises the following steps:
(1) after the server is powered on, detecting whether the network port of the server is continuously in a power-down state;
(2) and when the state of the network port of the server is detected to be a continuous power-down state, the server is switched to an emergency working state.
Further, the method for judging that the server network port is in the continuous power-down state comprises the following steps:
(1) when the state of the server network port is detected to be changed into a power-off state, a first timer starts to time;
(2) and when the timing of the first timer reaches a preset first time threshold, judging that the network port of the server is in a continuous power-down state.
Further, the server protection method based on internet access perception further comprises the step of switching the server to an emergency working state when the instability of mains supply is detected.
Further, the method for judging the instability of the mains supply comprises the following steps:
(1) starting a first timer and a second counter after the server is powered on;
(2) when the state of the server network port is detected to be a power-off state, a first timer starts to time;
(3) before the timing of the first timer reaches a preset first time threshold, when the network port of the server is changed from a power-off state to a power-on state, the count value of the second counter is increased by 1;
(4) and when the count value of the second counter reaches a preset second digital threshold value, the mains supply is judged to be unstable.
A server protection device based on internet access perception comprises the following modules:
the module detects whether the physical network port of the server is continuously in a power-down state after the server is powered on;
and when the state of the network port of the server is detected to be a continuous power-down state, the server is switched to the module in the emergency working state.
Further, the module for judging the power failure state of the server network port comprises the following units:
a unit for starting timing by a first timer when detecting that the state of the server network port is changed into a power-off state;
and when the timing of the first timer reaches a preset first time threshold, the server network port is judged to be in a power-down state continuously.
Further, the server protection device based on internet access perception further comprises a module for switching the server to an emergency working state when detecting that the mains supply is unstable.
Further, the module for judging the instability of the mains supply comprises the following units:
after the server is powered on, starting a first timer and a second counter;
a unit for starting timing by a first timer when detecting that the state of the server network port is a power-off state;
a unit for adding 1 to the count value of the second counter when the server network port is changed from the power-off state to the power-on state before the timing of the first timer reaches a preset first time threshold;
and when the count value of the second counter reaches a preset second digital threshold value, the unit is judged to be an unstable unit powered by the commercial power.
The technical scheme provided by the invention is that whether the server is switched to the emergency working state is judged by detecting the physical network port state of the server, and the server can directly acquire power failure information because the device for detecting the power failure of the network port of the server is arranged on the server, so that the link of data transmission is saved, and the aim of saving cost can be fulfilled.
The first timer is used for providing a basis for judging the continuous power failure of the server network port, and when the server network port is powered off for a short time due to some reason, the judgment of the power failure of the server network port cannot be influenced, so that the reliability of the judgment of the power supply of the server is ensured.
The first timer and the second counter are used for providing a judgment basis for judging whether the commercial power is stable or not. When the mains supply is unstable, the UPS switches the power supply of the server to the standby power supply, and at this time, the operating state of the server needs to be switched. The purpose of using the first timer and the second counter is to realize that the server can be switched to an emergency working state when the mains supply is unstable, and further guarantee the reliability of judging the power supply of the server.
Drawings
FIG. 1 is a schematic diagram of a server for power protection via a UPS;
FIG. 2 is a flow chart of a server protection method based on Internet access awareness;
fig. 3 is a flowchart of a method for detecting instability of the mains supply.
Detailed Description
Fig. 1 shows a schematic diagram of a server performing power protection through a UPS, where a commercial power is connected to the server through the UPS, and when the commercial power fails, the UPS may use a backup power supply to supply power to the server. The server is also provided with a network port connected with network equipment, and the network equipment directly obtains the power from the commercial power without obtaining the power through the UPS. When the mains supply is powered off or the voltage is unstable, the UPS can temporarily switch the power supply of the server to the standby power supply, and the power supply of the network equipment is not protected by the UPS, so that the network equipment can be powered off when the mains supply is powered off, and the power failure of the network interface of the server connected with the network equipment is caused.
Whether the network port of the server is powered down or not can be obtained through the following steps:
(1) running a network port information checking command on a server, and outputting a checked result to a physical file;
(2) analyzing the obtained physical file, and extracting the power-on/power-off state information of the server network port;
(3) and comparing the extracted current power-on/power-off state information of the server with the last extracted power-on/power-off state information, and if the information is different, changing the power-on/power-off state of the network port of the server.
Based on the principle, the invention provides a server protection method and device based on internet access perception, which judges whether a power supply source of a server is a standby power supply or not by detecting whether the internet access is in a power-on state or a power-off state. When the power supply of the server is a standby power supply, the server is switched to an emergency working state, namely a working state for storing data and processing emergency data, so that the server is protected. The present invention will be described in detail with reference to the accompanying drawings.
The method comprises the following steps:
the invention provides a server protection method based on internet access perception, which comprises the following steps:
(1) after the server is powered on, detecting whether all the network ports of the server are in a continuous power-down state;
(2) and when the state of the network port of the server is detected to be a continuous power-down state, the server is switched to an emergency working state.
Compared with the prior art that the commercial power failure detection device is arranged on the UPS, the invention judges whether the server is switched to the emergency working state or not by detecting the power failure state of the server network port, the device for detecting the power failure of the server network port is arranged on the server, and the server can directly obtain the power failure information, thereby saving the link of data transmission and achieving the purpose of saving cost.
The flow chart of the method for detecting whether the server network port is in the power-down state is shown in fig. 2, and the method comprises the following steps:
(1) after the server is powered on, detecting a network port of the server; when detecting that all network ports of the server are in a power-off state, starting timing by a first timer;
(2) before the first time timer reaches a preset first time threshold value, when the state of any one of the network ports is detected to be changed into a power-on state, resetting the first timer;
(3) judging whether the timing of the first timer reaches a preset first time threshold value, and judging that the server network port is in a continuous power-down state when the timing of the first timer reaches the first time threshold value;
(4) when the network port of the server is in a continuous power-down state, the mains supply is powered down, and a power supply of the server is a standby power supply; at the moment, the server is switched to an emergency working state, the emergency task is processed, the data are stored, and meanwhile, the first timer is reset.
In this embodiment, the first timer is used to provide a basis for determining that the server network port is powered off continuously, so as to avoid erroneous determination, for example, when the server network port is in a power-off state temporarily due to some reason, if the first timer is not set, an error of power-off of the server network port is made, and stability of server operation is affected. As another embodiment, when the performance of the server port is very stable, the first timer may not be set, and when the server port is in a power-down state, the power-down of the server port is directly determined.
Because when the mains supply is unstable, the power supply of the server is also switched to the standby power supply, and when the mains supply is unstable, the server also needs to be switched to an emergency working state. Therefore, the present invention further provides a method for determining instability of mains supply, wherein a flowchart is shown in fig. 3, and the method comprises the following steps:
(1) starting a second counter of the first timer after the server is powered on;
(2) before the timing of the first timer reaches a preset first time threshold, when the network port of the server is changed from a power-off state to a power-on state, the count value of the second counter is increased by 1;
(3) when the timing of the first timer reaches a preset first time threshold value, the value of the second counter is cleared;
(4) when the count value of the second counter reaches a preset second digital threshold value, the commercial power supply is judged to be unstable, at the moment, the server is switched to an emergency working state, the emergency task is processed, the data are stored, and meanwhile, the second counter is reset.
In this embodiment, the first timer and the second counter are used to provide a basis for determining the instability of the mains supply. If the judgment on the stability of the mains supply is not set, because the power supply of the server is the standby power supply when the mains supply is unstable, under the condition that the mains supply is unstable for a long time, the server still loses data when the electric energy of the standby power supply is exhausted, and the loss is brought to users. Therefore, the scheme of the invention is more perfect by arranging the step of judging the stability of the mains supply.
Device embodiment
A server protection device based on internet access perception comprises the following modules:
the module is used for detecting whether the network port of the server is in a power-down state or not after the server is powered on;
and when the state of the network port of the server is detected to be a power-down state, the server is switched to the module in the emergency working state.
The server protection device based on internet access awareness provided by this embodiment is actually a software framework for implementing the above method embodiments, wherein the module is a software module, and may be located on a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, or other media capable of storing data.
The present invention has been described in relation to particular embodiments thereof, but the invention is not limited to the described embodiments. In the thought given by the present invention, the technical means in the above embodiments are changed, replaced, modified in a manner that is easily imaginable to those skilled in the art, and the functions are basically the same as the corresponding technical means in the present invention, and the purpose of the invention is basically the same, so that the technical scheme formed by fine tuning the above embodiments still falls into the protection scope of the present invention.
Claims (8)
1. A server protection method based on internet access perception is characterized by comprising the following steps:
(1) after the server is powered on, detecting whether the network port of the server is continuously in a power-down state;
(2) when the state of the network port of the server is detected to be a continuous power-down state, the server is switched to an emergency working state;
whether the network port of the server is powered down is obtained through the following steps:
1) running a network port information checking command on a server, and outputting a checked result to a physical file;
2) analyzing the obtained physical file, and extracting the power-on/power-off state information of the server network port;
3) and comparing the extracted current power-on/power-off state information of the server with the last extracted power-on/power-off state information, and if the information is different, changing the power-on/power-off state of the network port of the server.
2. The server protection method based on internet access perception according to claim 1, wherein the method for judging that the server internet access is in a continuous power-down state comprises the following steps:
(1) when the state of the server network port is detected to be changed into a power-off state, a first timer starts to time;
(2) and when the timing of the first timer reaches a preset first time threshold, judging that the network port of the server is in a continuous power-down state.
3. The method for protecting a server based on internet access awareness according to claim 1, further comprising a step of switching the server to an emergency operation state when the instability of the mains power supply is detected.
4. The server protection method based on internet access perception according to claim 3, wherein the method for detecting mains supply instability comprises the following steps:
(1) starting a first timer and a second counter after the server is powered on;
(2) when the state of the server network port is detected to be a power-off state, a first timer starts to time;
(3) before the timing of the first timer reaches a preset first time threshold, when the network port of the server is changed from a power-off state to a power-on state, the count value of the second counter is increased by 1;
(4) and when the count value of the second counter reaches a preset second digital threshold value, the mains supply is judged to be unstable.
5. A server protection device based on internet access perception is characterized by comprising the following modules:
the module detects whether the physical network port of the server is continuously in a power-down state after the server is powered on;
when the state of the server network port is detected to be a continuous power-down state, the server is switched to a module in an emergency working state;
whether the network port of the server is powered down is obtained through the following steps:
1) running a network port information checking command on a server, and outputting a checked result to a physical file;
2) analyzing the obtained physical file, and extracting the power-on/power-off state information of the server network port;
3) and comparing the extracted current power-on/power-off state information of the server with the last extracted power-on/power-off state information, and if the information is different, changing the power-on/power-off state of the network port of the server.
6. The device for protecting the server based on the internet access awareness according to claim 5, wherein the module for determining the power-down status of the internet access of the server comprises:
a unit for starting timing by a first timer when detecting that the state of the server network port is changed into a power-off state;
and when the timing of the first timer reaches a preset first time threshold, the server network port is judged to be in a power-down state continuously.
7. The device for protecting a server based on internet access awareness according to claim 5, further comprising a module for switching the server to an emergency operation state when the instability of the mains power supply is detected.
8. The server protection device based on internet access perception according to claim 7, wherein the module for detecting the instability of the mains supply comprises the following units:
after the server is powered on, starting a first timer and a second counter;
a unit for starting timing by a first timer when detecting that the state of the server network port is a power-off state;
a unit for adding 1 to the count value of the second counter when the server network port is changed from the power-off state to the power-on state before the timing of the first timer reaches a preset first time threshold;
and when the count value of the second counter reaches a preset second digital threshold value, the unit is judged to be an unstable unit powered by the commercial power.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610813615.5A CN106648014B (en) | 2016-09-09 | 2016-09-09 | Server protection method and device based on internet access perception |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610813615.5A CN106648014B (en) | 2016-09-09 | 2016-09-09 | Server protection method and device based on internet access perception |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106648014A CN106648014A (en) | 2017-05-10 |
CN106648014B true CN106648014B (en) | 2020-01-03 |
Family
ID=58852020
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610813615.5A Active CN106648014B (en) | 2016-09-09 | 2016-09-09 | Server protection method and device based on internet access perception |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106648014B (en) |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8018349B1 (en) * | 2009-04-29 | 2011-09-13 | Cisco Technology, Inc. | Detecting an inline power shutoff failure |
CN101655733A (en) * | 2009-09-08 | 2010-02-24 | 中山冠虹电子有限公司 | Method and device for collocating uninterruptible power supply to enable computer to safely hibernate during power cut |
CN101841232B (en) * | 2010-03-02 | 2013-01-30 | 北京星网锐捷网络技术有限公司 | Redundancy backup processing method and redundancy backup control circuit of capacitor |
CN101895414A (en) * | 2010-06-24 | 2010-11-24 | 苏州飞鱼星电子技术有限公司 | System and method for power off protection of server |
CN103780411A (en) * | 2012-10-19 | 2014-05-07 | 任子行网络技术股份有限公司 | Power-down protection system and method for network auditing device |
CN203720832U (en) * | 2013-10-21 | 2014-07-16 | 云海创想信息技术(北京)有限公司 | Server with backup power supply device |
CN204362075U (en) * | 2014-11-25 | 2015-05-27 | 中国移动通信集团海南有限公司 | A kind of power loss detection means |
CN205263744U (en) * | 2015-12-10 | 2016-05-25 | 夏立堃 | Server power down protection system |
-
2016
- 2016-09-09 CN CN201610813615.5A patent/CN106648014B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106648014A (en) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10135098B2 (en) | Method and system for dynamically adjusting battery undervoltage protection | |
CN102882267B (en) | Power supply device, electronic equipment and power supply method | |
US10491033B2 (en) | Method for hot-plugging, control device for hot-plugging, method and device for voltage balance | |
US20140136866A1 (en) | Rack and power control method thereof | |
CN106814324B (en) | Method and device for monitoring the operating state of a battery pack | |
CN101867468A (en) | Hot reboot processing method for power over Ethernet switch and power over Ethernet switch | |
CN104238714A (en) | Method for protecting computer systems after outage of uninterrupted power supply (UPS) | |
CN104391559A (en) | Control method and control system of standby power supply | |
WO2016035481A1 (en) | Power conditioner | |
US20180278042A1 (en) | Fall-off Protection and Reverse-connection Protection System and Method for Connecting Clamp of Automobile Starting Power Supply | |
EP3240233A1 (en) | Power fail safeguard method, device and system thereof | |
CN109412819A (en) | Method and device for warning device power down | |
CN106648014B (en) | Server protection method and device based on internet access perception | |
CN103427403A (en) | Electronic equipment protection method and electronic equipment | |
CN110488205B (en) | Fault recognition device | |
CN207232883U (en) | A kind of server hard disk back plane continued power device | |
CN104680087A (en) | Blade server hot plugging control circuit and device | |
KR101319578B1 (en) | Ip base power providing system with automatic recovery function | |
CN105573459B (en) | Electronic device and signal processing method | |
CN111969711A (en) | Whole cabinet power supply stable switching method, system, terminal and storage medium | |
JP2011186596A (en) | Current monitoring safety system, method for operating the same, and portable equipment | |
CN110932379A (en) | Redundant power management system and method | |
WO2024093035A1 (en) | Master-slave linkage capacity expansion method and apparatus for mobile battery | |
JP6073670B2 (en) | Wireless communication device, power supply switching method | |
CN111123139A (en) | Power supply guarantee system, early warning device and guarantee and early warning method of optical line terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |