Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The structural representation of the power supply circuits that Fig. 2 provides for one embodiment of the invention.As shown in Figure 2, the power supply circuits of the present embodiment comprise: adapter 10, motherboard circuit 20 and voltage detecting circuit 30.
Wherein, the input of adapter 10 is connected with ac power output, and the output of adapter 10 is connected with motherboard circuit 20.Adapter 10, for processing and export direct current to power to motherboard circuit 20 to the alternating voltage of input.
Wherein, adapter 10 is processed to the alternating voltage of input the alternating voltage mainly referring to input and is carried out rectification, and alternating current is become to galvanic process.The output of adapter 10 is connected with motherboard circuit 20 and refers to that specifically the output of adapter 10 is connected with the electric power management circuit on motherboard circuit 20, for powering to motherboard circuit 20 under the control of electric power management circuit.
The input of voltage detecting circuit 30 is connected with ac power output, and the first output of voltage detecting circuit 30 is connected with motherboard circuit 20, and the second output of voltage detecting circuit 30 is connected with adapter 10.Voltage detecting circuit 30, for the alternating voltage of input is sampled, calculate alternating voltage according to alternating voltage sampled value, alternating voltage is offered to motherboard circuit 20, and receive the out code that motherboard circuit 20 sends, pass through the second output control adapter 10 of voltage detecting circuit 30 according to out code, so that adapter 10 stops powering to motherboard circuit 20.Wherein, the first output of voltage detecting circuit 30 mainly refers to the communication interface that voltage detecting circuit 30 and motherboard circuit 20 communicate, for example, the first output can be serial line interface, can be for example UART Universal Asynchronous Receiver Transmitter (the Universal Asynchronous Receiver/Transmitter of 2 lines, UART) Serial Peripheral Interface (SPI) of interface or 3 lines (Serial Peripheral Interface, SPI).The second output of voltage detecting circuit 30 is actually a control interface that opens and closes its direct current output for controlling adapter 10, for example, can be input and output (Input/Output, I/O) interface.Wherein, the second output of voltage detecting circuit 30 specifically can, by being connected with the output enable end of adapter 10, be turn-offed level or be enabled level the control that realizes the output to adapter 10 by the output enable end output to adapter 10.Motherboard circuit 20, compare for alternating voltage that voltage detecting circuit 30 is provided and default early warning higher limit or default early warning lower limit, in the time that alternating voltage is greater than early warning higher limit or is less than early warning lower limit, preserve current data, and export out code by the first output of voltage detecting circuit 30 to voltage detecting circuit 30, control adapter 10 and close its direct current and export to stop to power to motherboard circuit 20 to control voltage detecting circuit 30.
Wherein, current data mainly refers to all data that CPU processes, moves, receives and dispatches, preserves, such as data of document, wireless receiving and the transmission of personal information, transmission etc.
Wherein, early warning higher limit and early warning lower limit set in advance in the memory space of motherboard circuit 20, for example, can be arranged in the flash memory (Flash) of motherboard circuit 20.Voltage range that early warning higher limit and early warning lower limit can be supported according to the fan-out capability of actual AC power and motherboard circuit 20 etc. is carried out adaptability configuration.Illustrate, for the weak AC power of fan-out capability, early warning higher limit and early warning lower limit can be set to respectively 320VAC and 90VAC, and for the stronger AC power of fan-out capability, early warning higher limit and early warning lower limit can be set to respectively 400VAC and 90VAC.
If alternating voltage sampled value is greater than early warning higher limit, illustrate that alternating current fluctuates, the fluctuation tendency of alternating voltage is for increasing, if and alternating voltage has increased to and uses this alternating voltage just likely to damage motherboard circuit 20 in the power supply of interior whole system for motherboard circuit 20, if motherboard circuit 20 is damaged, thereby mean that motherboard circuit 20 can unexpected power-off or cut work generation loss of data.Therefore, in the time judging alternating voltage sampled value and be greater than this situation of early warning higher limit, first motherboard circuit 20 preserves current data to prevent loss of data, then control adapter 10 by voltage detecting circuit 30 and close its direct current output, power to motherboard circuit 20 stopping, and then prevent that motherboard circuit 20 is damaged.
If alternating voltage sampled value is less than early warning lower limit, illustrate that alternating current fluctuates, the fluctuation tendency of alternating voltage is for reducing, if thereby and alternating voltage be reduced to and continue to use this alternating current likely to make motherboard circuit 20 cause loss of data because of the work of undertension cut in interior whole system power supply for motherboard circuit 20.Therefore, in the time judging alternating voltage sampled value and be less than this situation of early warning lower limit, first motherboard circuit 20 preserves current data to prevent loss of data, then control adapter 10 by voltage detecting circuit 30 and close its direct current output, with the rush of current that prevents from being caused by unexpected power-off, motherboard circuit 20 is caused to damage.
In this explanation, motherboard circuit 20 described in various embodiments of the present invention mainly refers to the CPU (Central Processing Unit, CPU) on motherboard circuit 20.
In this explanation, the ac power output described in various embodiments of the present invention mainly refers to while using civil power or industrial electrical network power supply, the output of civil power or industrial electrical network.For the ease of diagram, in the accompanying drawing providing in various embodiments of the present invention, all represent ac power output with word " AC input ".
The power supply circuits of the present embodiment have increased voltage detecting circuit, by voltage detecting circuit, the alternating current of ac power output output is sampled, calculate current alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and close its output by power sense circuit control adapter and stop powering to motherboard circuit, to prevent that unexpected power-off from causing damage to motherboard circuit.
The structural representation of the power supply circuits that Fig. 3 A provides for another embodiment of the present invention.The present embodiment is based on realization embodiment illustrated in fig. 2.As shown in Figure 3A, the power supply circuits of the present embodiment also comprise: adapter 10, motherboard circuit 20 and voltage detecting circuit 30.
In the present embodiment, motherboard circuit 20 is except having the function of middle description embodiment illustrated in fig. 2, motherboard circuit 20 also there is following functions: when can also be used for being not more than at alternating voltage (being less than or equal to) early warning higher limit and be not less than (being more than or equal to) early warning lower limit, alternating voltage and default normal range (NR) higher limit or default normal range (NR) lower limit are compared, be greater than normal range (NR) higher limit at alternating voltage, be that alternating voltage is when being greater than normal range (NR) higher limit and being not more than early warning higher limit, or be less than normal range (NR) lower limit at alternating voltage, be that alternating voltage is when being less than normal range (NR) lower limit and being not less than early warning lower limit, preserve current data, and report the unsettled information of alternating voltage to administrative center.Wherein, motherboard circuit 20 can report the unsettled information of alternating voltage to administrative center by radio frequency (Radio Frequency, the RF) circuit on it.
Further, in order to prevent that unexpected power-off from causing damage to motherboard circuit 20, motherboard circuit 20 can also be greater than normal range (NR) higher limit and be not more than early warning higher limit at alternating voltage, or in the time that alternating voltage is less than normal range (NR) lower limit but is not less than early warning lower limit, send out code to voltage detecting circuit 30, control adapter 10 and close the output of its direct current to control voltage detecting circuit 30, power to motherboard circuit 20 stopping.
Wherein, normal range (NR) higher limit and normal range (NR) lower limit set in advance in the memory space of motherboard circuit 20, for example, can be arranged in the Flash of motherboard circuit 20.Voltage range that normal range (NR) higher limit and normal range (NR) lower limit can be supported according to the fan-out capability of actual AC power and motherboard circuit 20 etc. is carried out adaptability configuration.Illustrate, normal range (NR) higher limit and normal range (NR) lower limit can be set to respectively 260VAC and 180VAC.
If alternating voltage is greater than normal range (NR) higher limit, illustrate that alternating voltage fluctuates, the fluctuation tendency of alternating voltage is for increasing, in order to prevent causing the damaged suddenly power-off of motherboard circuit 20 to cause loss of data because alternating voltage increases, first motherboard circuit 20 preserves current data to prevent loss of data judging after alternating voltage is greater than normal range (NR) higher limit.Further, unsettled supply current situation is reported administrative center by motherboard circuit 20, reports the unsettled information of alternating voltage to administrative center, so that administrative center records this information.Follow-up, administrative staff or staff or user etc. can carry out inspection operation according to the information of record.Further, motherboard circuit 20 can also send out code to voltage detecting circuit 30, stops powering to motherboard circuit 20 so that voltage detecting circuit 30 is controlled adapter 10.Fig. 3 B provides a kind of schematic diagram of electric voltage over press fluctuation.In Fig. 3 B, normal range (NR) higher limit is set to 260VAC, and early warning higher limit is 400VAC.
If alternating voltage is less than normal range (NR) lower limit, illustrate that alternating voltage fluctuates, the fluctuation tendency of alternating voltage is for reducing, in order to prevent causing loss of data because alternating voltage reduces to cause motherboard circuit 20 because of undertension (suddenly power-off), first motherboard circuit 20 preserves current data to prevent loss of data judging after alternating voltage is less than normal range (NR) lower limit.Further, unsettled supply power voltage situation is reported administrative center by motherboard circuit 20, reports the unsettled information of alternating voltage to administrative center, so that administrative center records this information.Follow-up, administrative staff or staff or user etc. can carry out inspection operation according to the information of record.Further, motherboard circuit 20 can also send out code to voltage detecting circuit 30, stops powering to motherboard circuit 20 so that voltage detecting circuit 30 is controlled adapter 10.Fig. 3 C provides a kind of schematic diagram of under-voltage fluctuation.In Fig. 3 C, normal range (NR) lower limit is set to 180VAC, and early warning lower limit is 90VAC.
The difference of motherboard circuit 20 is looked and difference by the administrative center of the present embodiment.For example, motherboard circuit 20 can be household electric appliances, such as, motherboard circuit in refrigerator, washing machine etc., and administrative center can be the watch-dog for the each household electric appliances of responsible monitoring family that family arranges, for example personal computer.Again for example, motherboard circuit 20 can be the motherboard circuit in server, and administrative center can be the service centre (service centre) that each server is monitored, managed.Again for example, motherboard circuit 20 can be the motherboard circuit in the power network Central Shanxi Plain, the service centre of administrative center in can this community, electric power gateway place.
Further, the fluctuation of alternating voltage is more common, especially near normal range (NR), fluctuates.Judge that in order to improve alternating voltage is outside normal range (NR), while there is fluctuation within early warning range, whether can cause the accuracy of motherboard circuit 20 unexpected power-off, motherboard circuit 20 in the present embodiment is greater than normal range (NR) higher limit and is not more than the situation of early warning higher limit at alternating voltage, or in the situation that alternating voltage is less than normal range (NR) lower limit and is not less than early warning lower limit, further by judging whether time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit reaches the time of appointment, if reach the fixed time, illustrate that this fluctuation probably causes the unexpected power-off of motherboard circuit 20, therefore motherboard circuit 20 need to be preserved current data, and report the unsettled information of alternating voltage to administrative center.As shown in Figure 3 B, after alternating voltage exceedes 260VAC30s, motherboard circuit 20 just can be carried out preservation current data, and reports the operation of the unsettled information of alternating voltage to administrative center.As shown in Figure 3 C, after alternating voltage is less than 180VAC30s, motherboard circuit 20 just can be carried out preservation current data, and reports the operation of the unsettled information of alternating voltage to administrative center.Wherein, the fixed time that alternating voltage is greater than normal range (NR) higher limit and alternating voltage are less than fixed time of normal range (NR) lower limit can be identical, can be not identical yet, and for showing that difference is designated as respectively the first fixed time and the second fixed time.Wherein, the first fixed time and the second fixed time can be pre-configured in motherboard circuit 20, for example, can be arranged in the Flash of motherboard circuit 20.Wherein, the first fixed time and the second fixed time can be 30 seconds, 1 minute etc., but are not limited to this.
That is to say, in the situation that alternating voltage is not more than early warning higher limit and is not less than early warning lower limit, motherboard circuit 20 specifically can be for being greater than normal range (NR) higher limit at alternating voltage, and continue to be greater than after the first fixed time of normal range (NR) higher limit, or be less than normal range (NR) lower limit at alternating voltage, and continue to be less than after the second fixed time of normal range (NR) lower limit, just carry out and preserve current data, and report the operation of the unsettled information of alternating voltage, the wasting of resources causing to reduce erroneous judgement to administrative center.
Wherein, motherboard circuit 20 can be saved in current data in the Flash of motherboard circuit 20, but is not limited to this.
Further, as shown in Figure 2, the voltage detecting circuit 30 of the present embodiment comprises: alternating current sampling circuit 301, ac-dc converter circuit 302 and control unit 303.Wherein, control unit 303 can be micro-control unit (Micro Control Unit, MCU), but is not limited to this.
The input of alternating current sampling circuit 301 is connected with ac power output, and the output of alternating current sampling circuit 301 is connected with the input (V+ as shown in Figure 3A and V-) of control unit 303.Alternating current sampling circuit 301, for the alternating voltage of input is sampled, and offers control unit 303 by alternating voltage sampled value.Wherein, the input of alternating current sampling circuit 301 is the input of voltage detecting circuit 30.
The input of ac-dc converter circuit 302 is connected with ac power output, and the output of ac-dc converter circuit 302 is connected with control unit 303, and concrete is to be connected with the power input (VCC as shown in Figure 3A) of control unit 303.Ac-dc converter circuit 302, for the alternating voltage of input is converted to direct current, and exports to control unit 303, to power to control unit 303.
First output (Tx as shown in Figure 3A and Rx) of control unit 303 is the first output of voltage detecting circuit 30, and second output (I/O as shown in Figure 3A) of control unit 303 is the second output of voltage detecting circuit 30.The first output of control unit 303 is connected with motherboard circuit 20, and the second output of control unit 303 is connected with adapter 10.Control unit 303, for calculating alternating voltage according to alternating voltage sampled value, then by the first output of control unit 303, alternating voltage is offered to motherboard circuit 20, and receive the out code that motherboard circuit 20 sends, pass through the second output control adapter 10 of control unit 303 according to out code, so that adapter 10 stops powering to motherboard circuit 20.Concrete, control unit 303 can turn-off level to the output enable end output of adapter 10 by one I/O interface, controls adapter 10 and can not export.In addition, the control unit 303 of the present embodiment can also be after the alternating voltage of ac power output output recovers normally, reopen its output by the output output enable level control adapter 10 that enables to adapter 10, again power to motherboard circuit 20.Now, motherboard circuit 20 also can recover normal work.
In the present embodiment, the alternating voltage that control unit 303 can directly the alternating voltage sampled value providing according to interchange Acquisition Circuit 301 be provided offers motherboard circuit 20, control unit 303 does not need alternating voltage to carry out extra process like this, and its processing load is lighter.
In addition, the alternating voltage that control unit 303 can also the alternating voltage sampled value providing according to alternating current sampling circuit 301 be provided and default normal range (NR) higher limit or default normal range (NR) lower limit compare, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, by the first output of control unit 303, alternating voltage is offered to main website circuit 20.Be that control unit 303 only offers motherboard circuit 20 by fluctuation to the alternating voltage outside normal range (NR), control unit 303 is by screening alternating voltage, can reduce the handled data volume of motherboard circuit 20, be conducive to alleviate the processing load of motherboard circuit 20.For the alternating voltage within normal range (NR), control unit 303 can be abandoned, and does not offer motherboard circuit 20.
Further, control unit 303 can also, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, send a warning message to motherboard circuit 20.Control unit 303 is by sending a warning message and can point out motherboard circuit 20 to do further processing to this alternating voltage to motherboard circuit 20, be conducive to improve the promptness that motherboard circuit 20 is processed this alternating voltage, can further reduce the probability that loss of data occurs.
Wherein, normal range (NR) higher limit and normal range (NR) lower limit also can be pre-configured in the memory space of control unit 303, for example, can be configured in the Flash of control unit 303.Normal range (NR) higher limit pre-configured on control unit 303 is identical with normal range (NR) lower limit with normal range (NR) higher limit pre-configured on motherboard circuit 20 with normal range (NR) lower limit, no longer carefully states at this.
Further, the motherboard circuit 20 of the present embodiment is except alternating voltage and/or warning information that reception control unit 303 sends in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, motherboard circuit 20 can also be at alternating voltage within normal range (NR), be that alternating voltage is when being not more than normal range (NR) higher limit and being not less than normal range (NR) lower limit, send sampled value by the first output of control unit 303 to control unit 303 and obtain instruction, to obtain alternating voltage sampled value.Correspondingly, the sampled value that control unit 303 can also send by its first output reception motherboard circuit 20 is obtained instruction, and obtains instruction according to sampled value, sends alternating voltage by the first output of control unit 303 to motherboard circuit 20.
In this explanation, the alternating voltage sampled value that alternating current sampling circuit 301 offers control unit 303 is real time data, and the alternating voltage that control unit 303 offers motherboard circuit 20 is also real time data.
Further, as shown in Figure 3A, the adapter 10 of the present embodiment mainly comprises elementary 101 and secondary 102 two parts.Wherein, elementary 101 are mainly connected with ac power output, for receiving the alternating voltage of input.Secondary 102 are connected with elementary 101.Preferably, adapter 10 can adopt common Switching Power Supply to realize, and realizes cost lower.
Due to control unit 303 in elementary 101 1 sides, and main circuit board 20 is in secondary 102 1 sides, noise jamming between the two etc. are comparatively serious.In order to address this problem, the first output of control unit 303 can be connected with motherboard circuit 20 by photoelectric coupled circuit, realizes signal transmission and noise isolation between control unit 303 and motherboard circuit 20, as shown in Figure 3A.
Further, as shown in Figure 3A, the power supply circuits of the present embodiment can also comprise: overvoltage crowbar 40.The input of overvoltage crowbar 40 is connected with ac power output, and the output of overvoltage crowbar 40 is connected with the input of adapter 10 and the input of alternating current sampling circuit 301 respectively.Namely, ac power output is connected with the primary adapter 101 of adapter 10 and the input of alternating current sampling circuit 301 respectively by overvoltage crowbar 40.
Based on the existence of overvoltage crowbar 40, for example, in the time that alternating voltage too high, is more much larger than early warning higher limit, overvoltage crowbar 40 can blocking-up high pressure with protection motherboard circuit 20 and voltage detecting circuit 30.Now, motherboard circuit 20 and voltage detecting circuit 30 all can quit work.In addition, in the time that ac power output has a power failure suddenly, voltage detecting circuit 30 and motherboard circuit 20 also all can quit work.Now, motherboard circuit 20 power-off suddenly and have little time to preserve current data because voltage detecting circuit 30 also quits work.In order to prevent that, in this extreme case generation loss of data, the power supply circuits of the present embodiment also comprise stand-by power supply circuit 50 (as shown in dotted portion in Fig. 3 A).Stand-by power supply circuit 50 is mainly used in, after overvoltage crowbar 40 is blocked the output of ac power output or in the time that AC power has a power failure suddenly, powering to motherboard circuit 20, so that motherboard circuit 20 can be preserved current data.
Concerning stand-by power supply circuit 50, it is not worked at ordinary times, but can bring in charging by the output of adapter 10.Based on this, the input of stand-by power supply circuit 50 is connected with adapter 10, for charging, as shown in Figure 3A.In this explanation, the stand-by power supply circuit 50 of the present embodiment can also be non-charge power supply.
In this explanation, the motherboard circuit 20 in various embodiments of the present invention, except preserving current data, can also carry out information transmission.
The power supply circuits of the present embodiment have increased voltage detecting circuit, by voltage detecting circuit, the alternating current of ac power output output is sampled, root tool alternating voltage sampled value calculates alternating voltage, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and close output by power sense circuit control adapter, to prevent that unexpected power-off from causing damage to motherboard circuit.
In the above-described embodiments, alternating current sampling circuit 301 can have a variety of implementations, for example, can realize with existing integrated chip, also can such as, build by circuit common device (resistance, electric capacity etc.).The embodiment of the present invention provides a kind of implementation structure of alternating current sampling circuit, as shown in Figure 4.The alternating current sampling circuit that the present embodiment provides is made up of resistance R 1-resistance R 8 and capacitor C 1-capacitor C 3.Wherein, resistance R 1-resistance R 8 has formed bleeder circuit.Capacitor C 3 is drawn the output of alternating current sampling circuit 301, is designated as V+ and V-.Wherein, output V+ and V-, for alternating voltage sampled value is passed to control unit 303, process and obtain alternating voltage alternating voltage sampled value for control unit 303.For example, control unit 303 can calculate alternating voltage by dividing potential drop ratio.
This circuit structure is realized simple, and cost is lower.
In the above-described embodiments, control unit 303 can be by multiple implementation.Comparatively preferred, control unit 303 can directly be realized with various integrated chips, for example, can use the realizations such as the chip of the BL6523x series of chip, the BL company of the MSP430x series of TI company, but be not limited to this.The embodiment of the present invention provides a kind of structure of the control unit of being realized by integrated chip 303, as shown in Figure 5.Wherein, V+ and V-are the input pins of being responsible for receiving alternating voltage sampled value; RST is reset pin; AVCC is analog power pin; DVCC is digital power pin; AVSS is pin in analog; DVSS is pin digitally; RXD and TXD are serial line interfaces, i.e. the first output; ENABLE is an I/O interface, i.e. the second output; XO_OUT and XO_IN are the clock pins of this chip, and wherein crystal oscillator X1, capacitor C 1 and capacitor C 2 have formed the clock circuit that master clock is provided to this chip.Wherein, the output V+ in Fig. 4 is connected with input pin V+ and V-in Fig. 5 respectively with V-.
In the above-described embodiments, ac-dc converter circuit 302 can by multiple implementation, for example, can be realized by power supply chip, also can build by discrete device, does not limit herein.
In the above-described embodiments, the stand-by power supply circuit 50 in power supply circuits can adopt electric capacity scheme to realize, and also can adopt battery to realize.And owing to there being the existence of voltage detecting circuit 30, the frequency of utilization of stand-by power supply circuit 50 is not very high, and only for for motherboard circuit 20 save datas, so less demanding to the energy storage capacity of electric capacity or battery.
In the time using battery to realize stand-by power supply circuit 50, can use common lithium battery, but be not limited to this.
Wherein, use electric capacity scheme to realize stand-by power supply circuit 50 for more preferred implementation.The present embodiment provides a kind of structure of the stand-by power supply circuit 50 that uses electric capacity realization, as shown in Figure 6.The stand-by power supply circuit 50 of the present embodiment is mainly made up of diode D1-D4, current-limiting resistance R and super capacitor group C.Wherein, super capacitor group can be the capacitance group of a farad level.The capacity of super capacitor can do suitable selection according to the requirement of motherboard circuit 20 power consumptions, for example, can realize by 2 capacitances in series.
As shown in Figure 6, input can be connected with the output of adapter 10, and output is connected with the electric power management circuit of motherboard circuit 20.Concrete, when power supply circuits are normally worked, the output of adapter 10 powers on the one hand motherboard circuit 20, charges on the other hand by current-limiting resistance to super capacitor group; In the time that power supply circuits need to be closed output, super capacitor group can continue to power to motherboard circuit 20, can not pour in down a chimney back in adapter 10 simultaneously.
The implementation structure of the stand-by power supply circuit that the present embodiment provides is simple, be easy to realize, and cost is lower, and useful life is longer.
In the above-described embodiments, control unit 303 be connected with motherboard circuit 20 use photoelectric coupled circuit can be realized by various ways.The embodiment of the present invention provides a kind of specific implementation structure of photoelectric coupled circuit, as shown in Figure 7.The photoelectric coupled circuit of the present embodiment mainly comprises: optocoupler D1 and optocoupler D2, and the peripheral circuit of optocoupler D1 and optocoupler D2 formation, its specific implementation is shown in Figure 7, is not described in detail in this.
Wherein, TXD shown in Fig. 7 is connected with serial line interface TXD and RXD in Fig. 5 respectively with RXD, and the CPU_RX in Fig. 7 is connected with the serial line interface on motherboard circuit 20 respectively with CPU_TX.VCC in Fig. 7 is the power supply of control unit 303 one end, and VddIO is the power supply of motherboard circuit 20 one end.
In sum; the embodiment of the present invention can realize the intelligent management of power supply very like a cork; data storage in time and information transmission; be applicable to end product or the equipment of directly being powered by civil power or industrial electrical network; as the power protection of home terminal, power equipment etc. and data protection, occur when abnormal, can giving warning in advance at civil power or industrial electrical network voltage; and make corresponding action, needn't wait until after danger arrives and just make a response.In addition, the power supply circuits that the embodiment of the present invention provides only need to increase alternating current sampling circuit and the control unit that can process alternating voltage sampling, a small-power ac-dc converter circuit is powered to control unit, several common photoelectric coupled circuit, a stand-by power supply circuit, realizes cost lower, but reliability is high, select the device of technical grade, machine life can reach more than 10 years, and cost performance is high; The power consumption of control unit is very little in addition, and power consumption increases few.
The flow chart of the method for supplying power to that Fig. 8 provides for one embodiment of the invention.The method of supplying power to of the present embodiment can use power supply circuits shown in Fig. 1 or Fig. 2 to realize, the namely operation principle of power supply circuits.As shown in Figure 8, the method for supplying power to of the present embodiment comprises:
Step 801, voltage detecting circuit are sampled to the alternating voltage of the input input by voltage detecting circuit, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage are offered to motherboard circuit.
Step 802, motherboard circuit compare alternating voltage and default early warning higher limit or default early warning lower limit, and in the time that alternating voltage is greater than early warning higher limit or is less than early warning lower limit, preserve current data, and send out code by the first output of voltage detecting circuit to voltage detecting circuit.
Step 803, voltage detecting circuit receive out code, and by the second output control adapter of voltage detecting circuit, so that adapter stops powering to motherboard circuit.
Wherein, under normal circumstances, adapter is converted to the alternating current of ac power output output direct current and exports to motherboard circuit, to power to motherboard circuit.
The input of voltage detecting circuit is connected with ac power output, for providing alternating current to voltage detecting circuit.By voltage detecting circuit, the alternating voltage of input is sampled, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit.Motherboard circuit compares by alternating voltage that voltage detecting circuit is provided and default early warning higher limit or early warning lower limit, judge whether may occur making the situation of the unexpected power-off of motherboard circuit according to comparative result, and judging may there is the situation that makes the unexpected power-off of motherboard circuit time, preserve in time current data, and by sending out code to voltage detecting circuit, make voltage detecting circuit control adapter make adapter stop, to motherboard circuit power supply, can preventing like this because occurring that unexpected power-off causes damage to motherboard circuit.
Wherein, motherboard circuit, in the time judging alternating voltage and be greater than early warning higher limit or be less than early warning lower limit, is determined the situation that may make its unexpected power-off.
The power supply circuits that the method for supplying power to of the present embodiment provides based on the embodiment of the present invention are realized, by voltage detecting circuit, the alternating current of ac power output output is sampled, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and stop powering to motherboard circuit by power sense circuit control adapter, to prevent that unexpected power-off from causing damage to motherboard circuit.
The flow chart of the method for supplying power to that Fig. 9 provides for another embodiment of the present invention.The present embodiment can be realized based on power supply circuits shown in Fig. 1 or Fig. 2 equally.As shown in Figure 9, the method for the present embodiment comprises:
Step 901, voltage detecting circuit are sampled to the alternating voltage of the input input by voltage detecting circuit, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage are offered to motherboard circuit.
Step 902, motherboard circuit compare alternating voltage and default early warning higher limit or default early warning lower limit, to judge whether alternating voltage is greater than early warning higher limit or is less than early warning lower limit; If judged result is yes, execution step 903; If judged result is no, execution step 905.
If judged result is yes, illustrate that alternating voltage is greater than early warning higher limit or is less than early warning lower limit; If judged result is no, illustrate that alternating voltage is not more than early warning higher limit and is not less than early warning lower limit.
Step 903, motherboard circuit are preserved current data, and send out code by the first output of voltage detecting circuit to voltage detecting circuit, so that voltage detecting circuit control adapter stops to motherboard circuit power supply, and perform step 904.
Step 904, voltage detecting circuit receive out code, and by the second output control adapter of voltage detecting circuit, so that adapter stops to motherboard circuit power supply, and perform step 907.
Step 905, motherboard circuit compare alternating voltage and default normal range (NR) higher limit or default normal range (NR) lower limit, to judge whether alternating voltage is greater than default normal range (NR) higher limit or is less than default normal range (NR) lower limit; If judged result is yes, execution step 906; If judged result is no, execution step 907.
If judged result is yes, illustrate that alternating voltage is greater than default normal range (NR) higher limit or is less than default normal range (NR) lower limit, outside with normal range (NR); If judged result is no, illustrate that alternating voltage is not more than default normal range (NR) higher limit and is not less than default normal range (NR) lower limit, within normal range (NR).
Step 906, motherboard circuit are preserved current data, and report the unsettled information of alternating voltage to administrative center, and perform step 907.
Optionally, motherboard circuit is greater than normal range (NR) higher limit at alternating voltage, and continue to be greater than after the first fixed time of normal range (NR) higher limit, or be less than normal range (NR) lower limit at alternating voltage, and continue to be less than after the second fixed time of normal range (NR) lower limit, just carry out and preserve current data, and report the operation of the unsettled information of alternating voltage to administrative center, be conducive to improve the accuracy that judges whether to occur unexpected power-off.
This time operation of step 907, end.
Further, voltage detecting circuit can comprise alternating current sampling circuit, ac-dc converter circuit and control unit.
Based on this, step 901 can be specifically: the alternating current sampling circuit in voltage detecting circuit is sampled to the alternating voltage of the input input by alternating current sampling circuit, and alternating voltage sampled value is offered to the control unit in voltage detecting circuit; Control unit calculates alternating voltage according to alternating voltage sampled value, then by the first output of control unit, interchange is offered to motherboard circuit.
Optionally, the alternating voltage that control unit can directly the AC sampling value providing according to alternating current sampling circuit be provided by the first output of control unit offers motherboard circuit.
Optionally, control unit can also compare alternating voltage and default normal range (NR) higher limit or default normal range (NR) lower limit, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, by the first output of control unit, alternating voltage is offered to motherboard circuit.
Further, control unit can also, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, send a warning message to motherboard circuit.
In step 903, motherboard circuit by the first output of voltage detecting circuit to voltage detecting circuit transmission out code can be specifically: motherboard circuit sends out code by the first output of control unit to control unit.
Step 904 can be specifically: control unit receives out code, and by the second output control adapter of control unit, so that adapter stops powering to motherboard circuit.
In said process, especially be not more than default normal range (NR) higher limit and be not less than default normal range (NR) lower limit at alternating voltage,, within normal range (NR) time, motherboard circuit can also send sampled value to control unit by the first output of control unit and obtain instruction.Accordingly, control unit obtains instruction according to sampled value, sends alternating voltage by the first output of control unit to motherboard circuit.
The power supply circuits that the method for supplying power to of the present embodiment provides based on the embodiment of the present invention are realized, by voltage detecting circuit, the alternating current of ac power output output is sampled, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage sampled value and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and close output by power sense circuit control adapter, to prevent that unexpected power-off from causing damage to motherboard circuit.
A kind of electric equipment that one embodiment of the invention provides, comprising: power supply circuits.
Wherein, power supply circuits comprise: adapter, motherboard circuit and voltage detecting circuit.
Wherein, the input of adapter is connected with ac power output, and the output of adapter is connected with motherboard circuit.Adapter, for processing and export direct current to power to motherboard circuit to the alternating voltage of input.
The input of voltage detecting circuit is connected with ac power output, and the first output of voltage detecting circuit is connected with motherboard circuit, and the second output of voltage detecting circuit is connected with adapter.Voltage detecting circuit, for the alternating voltage of input is sampled, calculate alternating voltage according to alternating voltage sampled value, alternating voltage is offered to motherboard circuit, and receive motherboard circuit send out code, pass through the second output control adapter according to out code, so that adapter stops powering to motherboard circuit.
Motherboard circuit, compare for alternating voltage that voltage detecting circuit is provided and default early warning higher limit or default early warning lower limit, in the time that alternating voltage is greater than early warning higher limit or is less than early warning lower limit, preserve current data, and export out code by the first output of voltage detecting circuit to voltage detecting circuit.
Wherein, the description that the operation principle of power supply circuits and structure can embodiment shown in Figure 2, does not repeat them here.
The electric equipment of the present embodiment can be various use civil powers or directly end product or the equipment of power supply of industrial electrical network, such as home terminal, power equipment etc.Illustrating, can be washing machine, refrigerator etc. as the electric equipment of home terminal; Can be electric power gateway etc. as the electric equipment of power equipment.
The electric equipment of the present embodiment is owing to comprising power supply circuits, power supply circuits have increased voltage detecting circuit, by voltage detecting circuit, the alternating current of ac power output output is sampled, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and close its output by power sense circuit control adapter and stop powering to motherboard circuit, to prevent that unexpected power-off from causing damage to motherboard circuit.
Further, motherboard circuit in power supply circuits in above-mentioned electric equipment can also be used in the time that alternating voltage is not more than early warning higher limit and is not less than early warning lower limit, alternating voltage and default normal range (NR) higher limit or default normal range (NR) lower limit are compared, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, preserve current data, and report the unsettled information of alternating voltage to administrative center.Motherboard circuit, in the time finding that alternating voltage fluctuates outside normal range (NR), is preserved in time current data and situation is reported, and can further reduce loss of data or the impaired probability of motherboard circuit.
Further, motherboard circuit in power supply circuits in above-mentioned electric equipment can be specifically for being greater than normal range (NR) higher limit at alternating voltage, and continue to be greater than after the first fixed time of normal range (NR) higher limit, or be less than normal range (NR) lower limit at alternating voltage, and continue to be less than after the second fixed time of normal range (NR) lower limit, preserve current data, and report the unsettled information of alternating voltage to administrative center.Motherboard circuit can improve in this way and judges that alternating voltage is outside normal range (NR), whether can cause the accuracy of the unexpected power-off of motherboard circuit, the wasting of resources causing to reduce erroneous judgement within early warning range while there is fluctuation.
Further, the voltage detecting circuit in the power supply circuits in above-mentioned electric equipment comprises: alternating current sampling circuit, ac-dc converter circuit and control unit.
Wherein, the input of alternating current sampling circuit is connected with ac power output, and the output of alternating current sampling circuit is connected with the input of control unit, the input that the input of alternating current sampling circuit is voltage detecting circuit.Alternating current sampling circuit, for the alternating voltage of input is sampled, and offers control unit by alternating voltage sampled value.
The input of ac-dc converter circuit is connected with ac power output, and the output of ac-dc converter circuit is connected with control unit.Ac-dc converter circuit, for the alternating voltage of input is converted to direct current, and exports to control unit, to power to control unit.
The first output of control unit is connected with motherboard circuit, the second output of control unit is connected with adapter, the first output that the first output of control unit is voltage detecting circuit, the second output that the second output of control unit is voltage detecting circuit.Control unit, for calculating alternating voltage according to alternating voltage sampled value, then by the first output of control unit, alternating voltage is offered to motherboard circuit, and receive the out code of motherboard circuit output, then pass through the second output control adapter of control unit according to out code, so that adapter stops powering to motherboard circuit.
Further, the first output of control unit can be connected with motherboard circuit by photoelectric coupled circuit.
Further, the first output of control unit can be a string line interface.The second output of control unit can be an I/O interface.
Further, control unit specifically can be for comparing alternating voltage and default normal range (NR) higher limit or default normal range (NR) lower limit, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, by the first output of control unit, alternating voltage is offered to motherboard circuit.Because control unit only offers motherboard circuit by fluctuation to the alternating voltage outside normal range (NR), control unit, by alternating voltage is screened, can reduce the handled data volume of motherboard circuit, is conducive to alleviate the processing load of motherboard circuit.And for the alternating voltage within normal range (NR), control unit can be abandoned, do not offer motherboard circuit.
Further, control unit can also be used for, in the time that alternating voltage is greater than normal range (NR) higher limit or is less than normal range (NR) lower limit, sending a warning message to motherboard circuit.Control unit can point out motherboard circuit to do further processing to this alternating voltage by sending a warning message to motherboard circuit, is conducive to improve the promptness that motherboard circuit is processed this alternating voltage, can further reduce the probability that loss of data occurs.
Further, motherboard circuit can also be used for obtaining instruction by the first output of control unit to control unit transmission sampled value.Especially in the time that alternating voltage is not more than normal range (NR) higher limit and is not less than normal range (NR) lower limit, motherboard circuit can send sampled value to control unit by the first output of control unit and obtain instruction.Correspondingly, control unit can also be used for obtaining instruction according to sampled value, sends alternating voltage by the first output of control unit to motherboard circuit.
Further, the power supply circuits in above-mentioned electric equipment can also comprise: overvoltage crowbar.
The input of overvoltage crowbar is connected with ac power output, and the output of overvoltage crowbar is connected with the input of adapter and the input of alternating current sampling circuit respectively.
Further, the power supply circuits in above-mentioned electric equipment can also comprise: stand-by power supply circuit.
Stand-by power supply circuit, for powering to motherboard circuit after the output at overvoltage crowbar blocking-up ac power output, so that motherboard circuit is preserved current data.
Optionally, the stand-by power supply circuit of the present embodiment is charge power supply, and the input of stand-by power supply circuit is connected with the output of adapter, in order to charge by adapter.
In above-mentioned electric equipment, the structure of power supply circuits and operation principle can, referring to the description of Fig. 3 A illustrated embodiment, not repeat them here.
The electric equipment of the present embodiment is owing to comprising power supply circuits, power supply circuits have increased voltage detecting circuit, by voltage detecting circuit, the alternating current of ac power output output is sampled, calculate alternating voltage according to alternating voltage sampled value, then alternating voltage is offered to motherboard circuit, motherboard circuit is by comparing alternating voltage and early warning higher limit or early warning lower limit, judge whether to occur the situation of unexpected power-off according to comparative result, and in the time judging the situation that unexpected power-off likely occurs, preserve in time current data to prevent loss of data, and close its output by power sense circuit control adapter and stop powering to motherboard circuit, to prevent that unexpected power-off from causing damage to motherboard circuit.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can complete by the relevant hardware of program command, aforesaid program can be stored in a computer read/write memory medium, this program, in the time carrying out, is carried out the step that comprises said method embodiment; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CDs.
Finally it should be noted that: above each embodiment, only in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to aforementioned each embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or some or all of technical characterictic is wherein equal to replacement; And these amendments or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.