Method, device, equipment and medium for saving printer mileage after power failure
By designing a power-down storage circuit in the printer, using capacitors and diodes to detect voltage thresholds and automatically save the number of print kilometers when the power supply fails, the problem that the printer cannot accurately ensure the number of print kilometers in the existing technology is solved, and the stability of the printer is improved and data integrity.
Patent Information
- Application Number
- CN202411245627.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing printers cannot accurately ensure that the current print kilometers are stored in the event of a system or power failure, resulting in the printer stop working every minute to save data, affecting printing efficiency.
A printer power-down storage circuit is designed, including a control module, level generation module, voltage division module, current limiting module and read and write chip. Through the coordination of capacitors and diodes, the voltage threshold is detected and the current is automatically saved when the power supply is powered down. Print the number of kilometers and ensure data integrity with the assistance of backup power supply and delay relays.
It realizes that the current print kilometers is stored when the printer power is powered off, avoiding data loss, enhances the stability and reliability of the printer, and ensures that the printing task can be restarted normally when the power is restored.
Smart Images

Figure CN118752921B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printers, and in particular to a method, device, equipment and medium for saving printer mileage after power failure. Background Art
[0002] At present, printers in the prior art are usually set to save the printed mileage once every one minute. When the system or power supply of the printer fails during the printing process, the mileage currently being printed cannot be saved. As a result, when the printer needs to process a large amount of data during operation, the printer needs to stop working every one minute to save the current mileage of the printer, and the current printed mileage cannot be effectively saved accurately. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a method, device, equipment and medium for saving the mileage of a printer when power is off, which can effectively save the current printing mileage of the printer.
[0004] In a first aspect, an embodiment of the present invention provides a method for saving the mileage of a printer after power failure, which is applied to a power failure saving circuit of a printer. The power failure saving circuit of the printer includes a control module, a level generating module, a voltage dividing module, a current limiting module and a read-write chip. The voltage dividing module is respectively connected to the level generating module and the current limiting module. The control module is respectively connected to the level generating module, the voltage dividing module, the current limiting module and the read-write chip. The level generating module is provided with a first capacitor and a first diode. One end of the first capacitor is grounded, and the other end of the first capacitor is respectively connected to an input power supply and a cathode of the first diode. The anode of the first diode is connected to the voltage dividing module. The method for saving the mileage of a printer after power failure includes:
[0005] Turning on the input power supply, so that the level generating module charges the first capacitor and outputs a first level signal to the voltage dividing module;
[0006] The voltage dividing module divides the first level signal to obtain a second level signal, and inputs the second level signal to the current limiting module;
[0007] The current limiting module limits the current of the second level signal and then inputs the current to the control module;
[0008] The control module compares the second level signal with a preset voltage threshold. When the second level signal is lower than the voltage threshold, the control module obtains the current printing mileage of the printer and writes the current printing mileage into the read-write chip.
[0009] In some embodiments of the present invention, the printer power-off saving circuit is further provided with a backup power supply and a time delay relay, and the backup power supply is respectively connected to the control module and the level generating module through the time delay relay. After the current printing mileage is written into the read-write chip, the method further includes:
[0010] When the input power is powered off;
[0011] The delay relay performs power-off timing on the printer power-off saving circuit. When the power-off timing reaches the preset time of the delay relay, the delay relay is turned on to enable the backup power supply to supply power to the control module and the level generating module.
[0012] The printer power-off saving circuit is restarted so that the control module continues to execute the printing instruction and sends the first level signal to the voltage dividing module.
[0013] In some embodiments of the present invention, the printer power-off saving circuit is further provided with a power-on buffer module, the power-on buffer module is respectively connected to the level generating module and the voltage dividing module, and the delay relay is turned on so that the backup power supply supplies power to the control module and the level generating module, including:
[0014] After the time delay relay is turned on, a buffer power-on signal is sent to the control module, and the control module turns on the power-on buffer module according to the buffer power-on signal;
[0015] The power-on buffer module receives a third level signal sent by the backup power supply, obtains a first threshold range of the power-on buffer module, and when the third level signal is within the first threshold range, the power-on buffer module sends the third level signal to the level generating module, and the level generating module generates the first level signal according to the third level signal;
[0016] When the third level signal is not within the first threshold range, the power-on buffer module adjusts the third level until the third level signal is within the first threshold range.
[0017] In some embodiments of the present invention, the power-on buffer module is provided with a plurality of parallel second resistors, a second capacitor and a first relay, one end of the first relay and one end of the plurality of second resistors are connected to the first end of the delay relay, the other end of the first relay and the other end of the plurality of second resistors are connected to one end of the second capacitor, the other end of the second capacitor is connected to the second end of the delay relay, each second resistor is provided with a first switch, and the power-on buffer module adjusts the third level until the third level signal is within the first threshold range, including:
[0018] When the third level signal is greater than the first threshold range, the first capacitor is charged to supplement the current in the third level signal; when the third level signal is less than the first threshold range, the first capacitor is discharged to consume the current in the third level signal;
[0019] The control module controls the first relay to be attracted according to the buffer power-on signal, and turns on the second capacitor, so that the second capacitor performs charging and discharging operations;
[0020] When the charging current of the second capacitor is within a first current threshold range, the plurality of first switches are turned on, so that the plurality of second resistors shunt the second capacitor, and the second capacitor enters a discharge state;
[0021] When the charging current of the second capacitor is within a second current threshold range, the plurality of first switches are turned off to allow the second capacitor to enter a charging state.
[0022] In some embodiments of the present invention, the current limiting module is provided with a third resistor and a second diode, one end of the third resistor is connected to the voltage divider module, the other end of the third resistor and the anode of the second diode are connected to the control module, the cathode of the second diode is grounded, and after the level generating module is started and the first capacitor is turned on, the method further includes:
[0023] The first capacitor performs a filtering operation on the input power supply to obtain a first power supply signal and a second voltage threshold range;
[0024] When the level generating module is in a normal working state, the control module charges the first capacitor according to the first power signal until the real-time capacitor voltage value of the first capacitor is within the second voltage threshold range, and obtains the current capacitor voltage value of the first capacitor;
[0025] The second diode is turned on, and the second diode stabilizes the current capacitor voltage value to obtain the first level signal.
[0026] In some embodiments of the present invention, the control module writes the current printing mileage into the read-write chip, including:
[0027] The control module acquires printing information, determines a printing time according to the printing information, and determines a plurality of first storage time points within the printing time;
[0028] The control module determines the storage period of the printer power-off saving circuit according to a plurality of the first storage time points;
[0029] The read-write chip stores the current printing mileage according to the storage cycle.
[0030] In some embodiments of the present invention, after the read / write chip saves the current printing mileage according to the storage cycle, the method further includes:
[0031] Obtaining an average power-off cycle of the printer power-off saving circuit, and setting a plurality of second storage time points within the average power-off cycle;
[0032] The control module adds a spare read / write area in the read / write chip according to the average power-off cycle, and when the printer power-off saving circuit is within the average power-off cycle, the control module writes the current printing mileage into the spare read / write area.
[0033] In a second aspect, an embodiment of the present invention provides a device for saving printer mileage during power failure, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the method for saving printer mileage during power failure as described in the first aspect above.
[0034] In a third aspect, an embodiment of the present invention provides an electronic device, comprising the device for saving printer mileage upon power failure as described in the second aspect above.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions for executing the method for saving printer mileage upon power failure as described in the first aspect above.
[0036] The method for saving the mileage of a printer after power failure according to the embodiment of the present invention has at least the following beneficial effects:
[0037] The input power is turned on, so that the level generating module charges the first capacitor and outputs the first level signal to the voltage dividing module; the voltage dividing module divides the first level signal to obtain the second level signal, and inputs the second level signal to the current limiting module; the current limiting module limits the current of the second level signal and inputs it to the control module; the control module compares the second level signal with the preset voltage threshold, and when the second level signal is lower than the voltage threshold, the control module obtains the current printing mileage of the printer and writes the current printing mileage into the read-write chip. According to the technical solution of this embodiment, when the control module detects a low level, the control module immediately erases the physical position corresponding to the read-write chip and writes the current printing mileage of the printer to complete the saving. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of a method for saving printer mileage after power failure provided by an embodiment of the present invention;
[0039] Figure 2 This is a flow chart after writing the current printing mileage into the read-write chip provided by an embodiment of the present invention;
[0040] Figure 3 It is a flow chart of turning on the time delay relay provided by an embodiment of the present invention so that the backup power supply supplies power to the control module and the level generating module;
[0041] Figure 4 is a flow chart of the power-on cache module adjusting the third level until the third level signal is within the first threshold range provided by an embodiment of the present invention;
[0042] Figure 5 This is a flow chart after outputting a first level signal to a voltage divider module according to an embodiment of the present invention;
[0043] Figure 6 It is a flow chart of a control module provided by an embodiment of the present invention writing the current printing mileage into a read-write chip;
[0044] Figure 7 This is a flow chart after saving the current printed mileage provided by an embodiment of the present invention;
[0045] Figure 8 is a structural diagram of a device for storing the mileage of a printer during power failure provided by another embodiment of the present invention;
[0046] Fig. 9 The present invention is a circuit diagram of a circuit for saving the mileage of a printer upon power failure provided by an embodiment of the present invention.
[0047] Reference numerals:
[0048] Control module 100; level generating module 200; voltage dividing module 300; current limiting module 400; read / write chip 500; backup power supply 600; delay relay 700; power-on buffer module 800; first relay 810; first resistor R1; second resistor R2; third resistor R3; fourth resistor R4; first capacitor C1; second capacitor C2; switch S2; first diode D1; second diode D2; input power supply VIN. DETAILED DESCRIPTION
[0049] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0050] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0051] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0052] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0053] Reference Figure 1 and Fig. 9The embodiment of the present invention provides a method for saving the mileage of a printer after power failure, which is applied to a power failure saving circuit of a printer. The power failure saving circuit of the printer includes a control module 100, a level generating module 200, a voltage dividing module 300, a current limiting module 400 and a read-write chip 500. The voltage dividing module 300 is respectively connected to the level generating module 200 and the current limiting module 400. The control module 100 is respectively connected to the level generating module 200, the voltage dividing module 300, the current limiting module 400 and the read-write chip 500. The level generating module 200 is provided with a first capacitor C1 and a first diode D1. One end of the first capacitor C1 is grounded, and the other end of the first capacitor C1 is respectively connected to the input power supply VIN and the cathode of the first diode D1. , the anode of the first diode D1 is connected to the voltage divider module 300, and the method for saving the mileage of the printer when it is powered off includes: connecting the input power supply VIN, so that the level generating module 200 charges the first capacitor C1, and outputs a first level signal to the voltage divider module 300; the voltage divider module 300 divides the first level signal to obtain a second level signal, and inputs the second level signal to the current limiting module 400; the current limiting module 400 limits the current of the second level signal and inputs it to the control module 100; the control module 100 compares the second level signal with a preset voltage threshold, and when the second level signal is lower than the voltage threshold, the control module 100 obtains the current printing mileage of the printer and writes the current printing mileage into the read-write chip 500. According to the technical solution of this embodiment, the current printing mileage of the printer is saved by controlling and adjusting the high and low levels of the power-off saving circuit of the printer. When the input power supply VIN is in a normal power supply state, the input power supply VIN supplies power to the first capacitor C1 to generate a first level signal. The first level signal is stabilized by the first diode D1 and then outputs a second level signal. At this time, the second level signal is a high level signal. After the second level signal is processed by the voltage divider module 300 and the current limiting module 400 to limit the current and divide the voltage of the second level signal, the second level signal is adjusted to a level signal that meets the preset voltage threshold range at the I / O interface of the control module 100. The control module 100 does not perform other processing on the second level signal, and the printer works normally.
[0054] When the input power supply VIN is disconnected from the level generating module 200, the first capacitor C1 is in a discharge state. At this time, the level of the second level signal output after the voltage stabilization by the first diode D1 gradually decreases. When the second level signal is processed by the first resistor R1 and the third resistor R3 of the voltage dividing module 300, the second level signal is converted into a second level signal. At this time, the second level signal is a low level signal. Under the action of the fourth resistor R4 and the second diode D2 of the current limiting module 400, the second level signal is adjusted to a level signal that meets the voltage threshold range preset at the I / O interface of the control module 100. At this time, the control module 100 detects that the second level signal connected to the I / O interface is a low level signal. The control module 100 obtains the current printing kilometres of the printer and immediately writes the current printing kilometres into the read-write chip 500, that is, saves the power off.
[0055] The control method of the embodiment of the present invention is further described below based on the accompanying drawings.
[0056] Reference Figure 1 , Figure 1 A flowchart of a method for saving the mileage of a printer after power failure provided by an embodiment of the present invention, the method for saving the mileage of a printer after power failure includes but is not limited to the following steps:
[0057] Step S11, turning on the input power supply, so that the level generating module charges the first capacitor and outputs the first level signal to the voltage dividing module;
[0058] It should be noted that, when the printer is started by inputting power, the first capacitor and the first diode of the level generating module work, and after the first level signal is stabilized by the first diode, the first level signal is input to the voltage dividing module. In addition, the charging process of the first capacitor is controlled by the control module, so that the second resistor limits the current of the first level signal generated by the first capacitor to prevent the components in the circuit from being damaged by excessive current, and when the printer is powered off, the charge stored in the first capacitor can maintain the printer power-off preservation circuit to continue to work for a period of time, thereby realizing the preservation and recording of the printed data.
[0059] Step S12, the voltage dividing module divides the first level signal to obtain a second level signal, and inputs the second level signal to the current limiting module;
[0060] It should be noted that the voltage divider module is provided with a first resistor and a second resistor, and the first level signal input to the voltage divider module is divided by the first resistor and the second resistor to obtain a second level signal. The voltage divider module reduces the voltage level of the first voltage signal to prevent the first level signal from directly acting on the current limiting module or directly input into the control module, thereby preventing damage to the read-write chip or circuit elements. The voltage divider module can also adjust the voltage dividing ratio by adjusting the resistance values of the first resistor and the second resistor in the voltage divider module to meet the second level signal required by the subsequent current limiting module and the control module.
[0061] It should be noted that the printer power-off preservation circuit is also provided with a clock module, and the clock module is connected to the voltage divider module and the control module respectively. The clock module sends a first clock signal to the control module, and the control module analyzes the first clock signal to obtain a clock frequency and a clock phase; determines a first clock cycle, a second clock cycle and a third clock cycle of the clock module according to the clock frequency and the clock phase; determines a first resistance value of the first resistor and a second resistance value of the third resistor, and when the clock module is in the first clock cycle, the control module adjusts the first resistance value to a first target resistance value, and adjusts the second resistance value to a second target resistance value, determines a first voltage amplitude of the first level signal according to the first target resistance value and the second target resistance value, and the control module adjusts the first level signal to the second level signal according to the first voltage amplitude , wherein the first target resistance is greater than the second target resistance; determine the third resistance of the first resistor and the fourth resistance of the third resistor, when the clock module is the second clock cycle, the control module adjusts the second resistance to the third target resistance, and adjusts the fourth resistance to the fourth target resistance, determines the second target resistance of the first level signal according to the third target resistance and the fourth target resistance, and the control module adjusts the first level signal to the second level signal according to the second voltage amplitude, wherein the second target resistance is less than the fourth target resistance; when the clock module is the third clock cycle, the control module adjusts the fifth resistance of the first resistor to be equal to the sixth resistance of the third resistor, obtains the third voltage amplitude of the fifth resistance and the sixth resistance, and the control module adjusts the first level signal to the second level signal according to the third voltage amplitude. This embodiment adjusts the resistance values of the first resistor and the second resistor according to multiple clock cycles of the clock module through the control module, flexibly adapts to different workload requirements, adjusts the first resistor and the third resistor to the target resistance value according to different clock cycles, describes the voltage fluctuation range of the current first resistor and the third resistor according to different voltage amplitudes, and adjusts the resistance values of the first resistor and the third resistor, thereby modulating the first level signal into the second level signal. Through the precise control of the clock cycle, when the printer is no longer working or is in a low power consumption state, the resistance value of the voltage divider module is adjusted to reduce the power consumption of the printer power-off saving circuit, and with the change of the printer working state (such as printing, standby and shutdown, etc.), the voltage demand for the input power supply is also different. The clock module realizes the dynamic adjustment of the conversion of the first level signal to the second level signal by dynamically adjusting the resistance value of the voltage divider module according to the current working state, so as to meet the power demand of the printer power-off saving circuit under different workloads.
[0062] Step S13, the current limiting module limits the current of the second level signal and inputs it to the control module;
[0063] It should be noted that the current limiting module is provided with a third resistor and a second diode, and the second level signal is current limited by the third resistor, and the second diode is turned on, so that the second level signal is input to the control module. Among them, the third resistor is a current limiting resistor. When the second level signal is input to the control module through the current limiting module, the current limiting resistor will limit the current size of the second level signal to ensure that the control module can obtain accurate high and low level signals.
[0064] In step S14, the control module compares the second level signal with a preset voltage threshold. When the second level signal is lower than the voltage threshold, the control module obtains the current printing mileage of the printer and writes the current printing mileage into the read-write chip.
[0065] It should be noted that when the control module receives the second level signal, it will immediately compare the second level signal with the voltage threshold preset in the control module. When the second level signal is lower than the voltage threshold, the control module determines that the printer has entered or is about to enter a power-off state. At this time, the control module detects that the second level signal connected to the I / 0 interface is a low level signal. The control module obtains the current printing mileage of the printer and immediately writes the current printing mileage into the read-write chip, that is, saves the power off.
[0066] It should be noted that when the input power supply is disconnected from the level generating module, the first capacitor is in a discharge state, and the level of the second level signal output after the voltage stabilization by the first diode gradually decreases. When the second level signal is processed by the first resistor and the second resistor of the voltage divider module, the second level signal is converted into a second level signal, and the second level signal is a low level signal. Under the action of the third resistor and the second diode of the current limiting module, the second level signal is adjusted to a level signal that meets the voltage threshold range preset at the I / 0 interface of the control module. At this time, the control module detects that the second level signal connected to the I / 0 interface is a low level signal, and the control module obtains the current printing kilometres of the printer, and immediately writes the current printing kilometres into the read-write chip, that is, saves the power off.
[0067] In addition, in one embodiment, the printer power-off saving circuit is further provided with a backup power supply 600 and a delay relay 700, and the backup power supply 600 is connected to the control module 100 and the level generating module 200 respectively through the delay relay 700, referring to Figure 2 ,exist Figure 1 After step S14 in the illustrated embodiment, the following steps are also included but not limited to:
[0068] Step S21, when the input power fails, the delay relay performs power-off timing on the printer power-off saving circuit, and when the power-off timing reaches the preset time of the delay relay, the delay relay is turned on to allow the backup power supply to supply power to the control module and the level generating module;
[0069] Step S22, the printer power-off saving circuit is restarted so that the control module continues to execute the printing instruction and sends the first level signal to the voltage dividing module.
[0070] It should be noted that when the input power fails, the delay timer starts timing. When the power failure timing reaches the preset time, the delay relay changes from the disconnected state to the on state. At this time, the backup power supply supplies power to the control module and the level generation module through the path provided by the delay relay, ensuring that after the input power fails, the printer power failure saving circuit can continue to operate and write the current printing mileage into the read-write chip. By setting a backup power supply and a delay relay in the printer power failure saving circuit, it automatically switches to the backup power supply after power failure, and controls the printer power failure saving circuit to restart and execute instructions, thereby enhancing the stability and reliability of the printer system. The user can restore the normal operation of the printer without manual intervention, and can accurately obtain the power-on cycle and power-off cycle of the printer.
[0071] In addition, in one embodiment, the printer power-off saving circuit is further provided with a power-on buffer module 800, which is connected to the level generating module 200 and the voltage dividing module 300 respectively. Figure 3 ,exist Figure 2 In step S21 of the illustrated embodiment, the following steps are also included but not limited to:
[0072] Step S31, after the delay relay is turned on, a buffer power-on signal is sent to the control module, and the control module turns on the power-on buffer module according to the buffer power-on signal;
[0073] Step S32, the power-on buffer module receives the third level signal sent by the backup power supply, obtains the first threshold range of the power-on buffer module, and when the third level signal is within the first threshold range, the power-on buffer module sends the third level signal to the level generating module, and the level generating module generates a first level signal according to the third level signal;
[0074] Step S33: when the third level signal is not within the first threshold range, the power-on buffer module adjusts the third level until the third level signal is within the first threshold range.
[0075] It should be noted that after the printer loses power, the delay relay will be turned on after a preset delay time to ensure that the input power is completely cut off and stabilized before the subsequent backup power buffer power-on operation is performed to prevent the backup power from instantly powering on and causing impact on the components of the printer power-off preservation circuit. When the delay relay is turned on, the buffer power-on signal value control module is sent as a trigger signal for the subsequent power-on buffer operation. After the control module receives the buffer power-on signal, it will turn on the power-on buffer module according to the preset program logic. The main function of the power-on buffer module is to provide a smooth voltage rise process when the power is restored to protect the electronic components inside the printer from voltage mutations. The power-on buffer module receives a third level signal from the backup power supply, and the power-on buffer module monitors the third level signal through a preset first threshold range. When the third level signal is within the first threshold range, the power-on buffer module directly sends the third level signal to the level generation module. If the third level signal is not within the first threshold range, the power-on buffer module adjusts the third level signal, such as filtering, voltage stabilization, etc., until the third level signal is within the first threshold range. The level generation module receives the third level signal processed by the power-on buffer module, and generates a stable first level signal according to the third level signal to re-drive the printer power-off protection circuit to work. In this embodiment, through the synergistic effect of the delay relay and the power-on buffer module, the impact on the printer hardware at the moment of power recovery is effectively avoided, thereby extending the service life of the printer, ensuring that the printer can receive a stable power supply voltage when power is restored, and reducing the failure rate caused by voltage fluctuations.
[0076] In addition, in one embodiment, the power-on buffer module is provided with a plurality of parallel second resistors R2, a second capacitor C2 and a first relay 810, one end of the first relay 810 and one end of the plurality of second resistors R2 are connected to the first end of the delay relay 700, the other end of the first relay 810 and the other end of the plurality of second resistors R2 are connected to one end of the second capacitor C2, the other end of the second capacitor C2 is connected to the second end of the delay relay 700, each second resistor R2 is provided with a first switch S2, refer to Figure 4 ,exist Figure 2 Step S33 of the illustrated embodiment also includes but is not limited to the following steps:
[0077] Step S41, when the third level signal is greater than the first threshold range, the first capacitor is charged to supplement the current in the third level signal; when the third level signal is less than the first threshold range, the first capacitor is discharged to consume the current in the third level signal;
[0078] Step S42, the control module controls the first relay to be attracted according to the buffer power-on signal, and turns on the second capacitor, so that the second capacitor performs charging and discharging operations;
[0079] Step S43, when the charging current of the second capacitor is within the first current threshold range, the plurality of first switches are turned on so that the plurality of second resistors shunt the second capacitor, and the second capacitor enters a discharge state;
[0080] Step S44: when the charging current of the second capacitor is within the second current threshold range, the plurality of first switches are turned off to allow the second capacitor to enter a charging state.
[0081] It should be noted that when the third level signal is greater than the first threshold range, the first capacitor starts to charge, and the excess current in the third level signal is supplemented and adjusted to stabilize the signal level of the third level signal. When the third level signal is less than the first threshold range, the first capacitor is discharged, and the insufficient current in the third level signal is supplemented by releasing the stored charge, thereby ensuring the stability of the third level signal; further, the control module controls the pull-in of the first relay according to the buffer power-on signal, and when the first relay is pulled in, the second capacitor is turned on to enable the second capacitor to perform charging and discharging operations. During the charging process of the second capacitor, when the charging current is within the first current threshold range, multiple first switches are turned on, and the charging current is shunted through multiple second resistors to slow down the charging speed of the second capacitor and enter a slow charging state. When the charging current of the second capacitor is reduced to within the second current threshold range, multiple first switches are turned off. At this time, the charging process of the second capacitor is no longer hindered by the shunt resistor, thereby entering a normal charging state. By setting a plurality of switches and a plurality of second resistors, as well as a first current threshold and a second current threshold, the charging current can be finely managed, and the charging and discharging state of the second capacitor can be dynamically adjusted to achieve the best current regulation effect.
[0082] In addition, in one embodiment, the current limiting module 400 is provided with a fourth resistor R4 and a second diode D2, one end of the fourth resistor R4 is connected to the voltage dividing module 300, the other end of the fourth resistor R4 is connected to the anode of the second diode D2 and the control module 100, and the cathode of the second diode D2 is grounded. Figure 5 ,exist Figure 1 After step S11 of the illustrated embodiment, the following steps are also included but not limited to:
[0083] Step S51, the first capacitor performs a filtering operation on the input power to obtain a first power signal and a second voltage threshold range;
[0084] Step S52, when the level generating module is in a normal working state, the control module charges the first capacitor according to the first power signal until the real-time capacitor voltage value of the first capacitor is within the second voltage threshold range, and obtains the current capacitor voltage value of the first capacitor;
[0085] Step S53, turning on the second diode, the second diode stabilizes the current capacitor voltage value to obtain a first level signal.
[0086] It should be noted that the input power is filtered by the first capacitor to remove high-frequency noise and ripples in the power supply, thereby obtaining a stable first power signal, and the second voltage threshold is used to determine the charging state of the first capacitor. When the level generation module is in a normal working state, the voltage of the first capacitor is continuously monitored. Further, the control module charges the first capacitor according to the first power signal, and as the charging proceeds, the real-time capacitor voltage of the first capacitor gradually increases. When the real-time capacitor voltage of the first capacitor reaches the second voltage threshold range, the control module obtains the current capacitor voltage value, and turns on the second diode to limit and adjust the current capacitor voltage value, so that the level generation module outputs a stable first level signal. This embodiment adopts a power-off protection circuit to provide a certain period of backup power support when the printer input power is suddenly interrupted. When the read-write chip is powered off and saved, there is still enough time to complete the current printing task and obtain an effective power-off cycle.
[0087] In addition, in one embodiment, referring to Figure 6 ,exist Figure 1 Step S14 of the illustrated embodiment also includes but is not limited to the following steps:
[0088] Step S61, the control module obtains printing information, determines the printing time according to the printing information, and determines a number of first storage time points within the printing time;
[0089] Step S62, the control module determines the storage period of the printer power-off storage circuit according to a plurality of first storage time points;
[0090] Step S63, the read-write chip saves the current printing mileage according to the storage cycle.
[0091] It should be noted that the level generating module will record the printing information when the input power is powered on or off, and the control module determines several first storage time points through the printing time. The control module sends a save command to the control module according to the multiple first storage time points, and sends the current printing mileage of the printer as the data to be saved. The read-write chip writes the current printing mileage into the read-write chip for storage according to the storage cycle. The printer only needs to save the accurate printing mileage of the printer according to the storage cycle.
[0092] In addition, in one embodiment, referring to Figure 7 ,exist Figure 6 After step S63 in the illustrated embodiment, the following steps are also included but not limited to:
[0093] Step S71, obtaining an average power-off cycle of the printer power-off storage circuit, and setting a plurality of second storage time points within the average power-off cycle;
[0094] Step S72, the control module adds a spare read-write area in the read-write chip according to the average power-off cycle, and when the printer power-off saving circuit is within the average power-off cycle, the control module writes the current printing mileage into the spare read-write area.
[0095] It should be noted that the control module monitors the power-on information and power-off information of the printer, records the time point of each power-off, and calculates the time interval between two adjacent power-offs. By statistically analyzing multiple power-off time intervals, the average power-off cycle of the printer power-off storage circuit is obtained, which reflects the average frequency of power state switching of the printer during normal use. Within the average power-off cycle, the control module sets a number of second storage time points, wherein the multiple second storage time points can be fixed, such as saving data once every certain period of time, or dynamic, such as determined by the use status of the printer or an external trigger signal; the control module dynamically divides a spare read-write area in the read-write chip according to the setting of the average power-off cycle and the storage time point, which is used to temporarily store data during the power-off cycle to prevent data from being lost due to power failure. When the printer power-off storage circuit is in the average power-off cycle, the control module writes the current printing mileage into the spare read-write area. By setting the storage time point and adding the spare read-write area within the average power-off cycle, it is ensured that the current printing mileage can be saved in time before the printer is powered off.
[0096] like Figure 8 As shown, Figure 8 The present invention also provides a device for storing the mileage of a printer after power failure, including:
[0097] The processor 801 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0098] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the printer mileage power-off saving method of the embodiment of this application;
[0099] Input / output interface 803, used to implement information input and output;
[0100] The communication interface 804 is used to realize the communication interaction between the present apparatus and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0101] A bus 805 that transmits information between various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0102] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0103] An embodiment of the present application also provides an electronic device, including the printer mileage power-off storage device as described above.
[0104] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned printer mileage power-off saving method is implemented.
[0105] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0106] It will be appreciated by those skilled in the art that all or some of the steps and systems in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0107] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present invention. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for saving printer mileage after power failure, characterized in that: Applied to a power-off saving circuit of a printer, the power-off saving circuit of the printer comprises a control module, a level generating module, a voltage dividing module, a current limiting module and a read-write chip, the voltage dividing module is respectively connected to the level generating module and the current limiting module, the control module is respectively connected to the level generating module, the voltage dividing module, the current limiting module and the read-write chip, the level generating module is provided with a first capacitor and a first diode, one end of the first capacitor is grounded, the other end of the first capacitor is respectively connected to an input power supply and a cathode of the first diode, the anode of the first diode is connected to the voltage dividing module, and the printer mileage power-off saving method comprises: Turning on the input power supply, so that the level generating module charges the first capacitor and outputs a first level signal to the voltage dividing module; The voltage dividing module divides the first level signal to obtain a second level signal, and inputs the second level signal to the current limiting module; The current limiting module limits the current of the second level signal and then inputs the current to the control module; The control module compares the second level signal after current limiting with a preset voltage threshold. When the second level signal after current limiting is lower than the preset voltage threshold, the control module obtains the current printing mileage of the printer and writes the current printing mileage into the read-write chip.
2. The method for saving printer mileage after power failure according to claim 1, characterized in that: The printer power-off saving circuit is also provided with a backup power supply and a time delay relay, and the backup power supply is respectively connected to the control module and the level generating module through the time delay relay. After the current printing mileage is written into the read-write chip, the method further includes: When the input power fails, the delay relay performs power-off timing on the printer power-off saving circuit, and when the power-off timing reaches the preset time of the delay relay, the delay relay is turned on to enable the backup power supply to supply power to the control module and the level generating module; The printer power-off saving circuit is restarted so that the control module continues to execute the printing instruction and sends the first level signal to the voltage dividing module.
3. The method for saving printer mileage after power failure according to claim 2, characterized in that: The printer power-off saving circuit is further provided with a power-on buffer module, the power-on buffer module is respectively connected to the level generating module and the voltage dividing module, the delay relay is turned on so that the backup power supply supplies power to the control module and the level generating module, including: After the time delay relay is turned on, a buffer power-on signal is sent to the control module, and the control module turns on the power-on buffer module according to the buffer power-on signal; The power-on buffer module receives a third level signal sent by the backup power supply, obtains a first threshold range of the power-on buffer module, and when the third level signal is within the first threshold range, the power-on buffer module sends the third level signal to the level generating module, and the level generating module generates the first level signal according to the third level signal; When the third level signal is not within the first threshold range, the power-on buffer module adjusts the third level signal until the third level signal is within the first threshold range.
4. The method for saving printer mileage after power failure according to claim 3, characterized in that: The power-on buffer module is provided with a plurality of groups of second resistors, second capacitors and first relays connected in parallel, each group includes a second resistor, a second capacitor and the first relay, one end of each second resistor is connected to the first end of the delay relay, the other end of each second resistor is connected to one end of the corresponding second capacitor, one end of each second capacitor is connected to one end of the corresponding first relay, the other end of each first relay is connected to the second end of the corresponding delay relay, each first relay is provided with a first switch, and the power-on buffer module adjusts the third level signal until the third level signal is within the first threshold range, including: When the third level signal is greater than the first threshold range, the first capacitor is charged to supplement the current in the third level signal; when the third level signal is less than the first threshold range, the first capacitor is discharged to consume the current in the third level signal; The control module controls the first relay to be attracted according to the buffer power-on signal, and turns on the second capacitor, so that the second capacitor performs charging and discharging operations; When the charging current of the second capacitor is within a first current threshold range, the plurality of first switches are turned on, so that the plurality of second resistors shunt the second capacitor, and the second capacitor enters a discharge state; When the charging current of the second capacitor is within a second current threshold range, the plurality of first switches are turned off to allow the second capacitor to enter a charging state.
5. The method for saving printer mileage after power failure according to claim 1, characterized in that: The control module writes the current printing mileage into the read-write chip, including: The control module acquires printing information, determines a printing time according to the printing information, and determines a plurality of first storage time points within the printing time; The control module determines the storage period of the printer power-off saving circuit according to a plurality of the first storage time points; The read-write chip stores the current printing mileage according to the storage cycle.
6. The method for saving printer mileage after power failure according to claim 5, characterized in that: After the read / write chip saves the current printing mileage according to the storage cycle, the method further includes: Obtaining an average power-off cycle of the printer power-off saving circuit, and setting a plurality of second storage time points within the average power-off cycle; The control module adds a spare read / write area in the read / write chip according to the average power-off cycle, and when the printer power-off saving circuit is within the average power-off cycle, the control module writes the current printing mileage into the spare read / write area.
7. A device for saving printer mileage after power failure, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the printer mileage power-off saving method as described in any one of claims 1 to 6.
8. An electronic device, characterized in that: It includes the printer mileage power-off storage device as described in claim 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method for saving printer mileage after power failure as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Machine tool processing coordinate power down saving system and method
CN103105821A
Power-down protection device
CN104090527A
MCU power failure data storage circuit and method based on farad capacitor
CN115220962A
3D printer and power off detected device thereof
CN206733607U
Power source and power failure detection device
JP2013158210A
