CN114661132B - Electric quantity monitoring method and device, printer and storage medium - Google Patents

Electric quantity monitoring method and device, printer and storage medium Download PDF

Info

Publication number
CN114661132B
CN114661132B CN202210323224.0A CN202210323224A CN114661132B CN 114661132 B CN114661132 B CN 114661132B CN 202210323224 A CN202210323224 A CN 202210323224A CN 114661132 B CN114661132 B CN 114661132B
Authority
CN
China
Prior art keywords
printer
electric quantity
printing
power
target data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210323224.0A
Other languages
Chinese (zh)
Other versions
CN114661132A (en
Inventor
请求不公布姓名
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Hanyin Electronic Technology Co Ltd
Original Assignee
Xiamen Hanyin Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Hanyin Electronic Technology Co Ltd filed Critical Xiamen Hanyin Electronic Technology Co Ltd
Priority to CN202210323224.0A priority Critical patent/CN114661132B/en
Publication of CN114661132A publication Critical patent/CN114661132A/en
Application granted granted Critical
Publication of CN114661132B publication Critical patent/CN114661132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/28Supervision thereof, e.g. detecting power-supply failure by out of limits supervision
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/121Facilitating exception or error detection and recovery, e.g. fault, media or consumables depleted
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1229Printer resources management or printer maintenance, e.g. device status, power levels
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/126Job scheduling, e.g. queuing, determine appropriate device
    • G06F3/1263Job scheduling, e.g. queuing, determine appropriate device based on job priority, e.g. re-arranging the order of jobs, e.g. the printing sequence
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The invention discloses an electric quantity monitoring method, an electric quantity monitoring device, a printer and a storage medium. The method comprises the following steps: acquiring initial battery power, a printing power threshold value, preset recovery time and target data of the printer according to the printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data; when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time; and determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery. In other words, according to the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold value, and the monitoring power of the printer is determined according to the power change of the printer before and after printing to report, so that abnormal shutdown caused by unstable power of the printer in the printing process is avoided.

Description

Electric quantity monitoring method and device, printer and storage medium
Technical Field
The embodiment of the invention relates to a computer technology, in particular to an electric quantity monitoring method, an electric quantity monitoring device, a printer and a storage medium.
Background
With the daily use of electronic office work, printers become basic electronic devices in work and life of people, and various printers are available on the market. The printer is divided into a socket-applicable printer and a battery-powered printer from the type of the printer using a power supply, wherein the socket-applicable printer is relatively stable in the operation process and inconvenient to carry; the battery power type printer is convenient to carry, but the battery power type printer is large in battery power consumption during use, the battery power is easy to be instantaneously reduced due to instantaneous high current, the system misjudges that the battery power is too low to cause abnormal shutdown, so that the printer cannot be used normally, and after the printer is abnormally shutdown, the printer is started again, and the printer is likely to be failed to start up due to abnormal shutdown caused by the too low misjudged power, or the battery power is required to be charged to recover the normal percentage of the battery power, so that the printer can be used normally.
Disclosure of Invention
The invention provides an electric quantity monitoring method, an electric quantity monitoring device, a printer and a storage medium, which are used for determining the monitored electric quantity of the printer to report according to the electric quantity change of the printer before and after printing on the premise that the printer is determined to have printing capacity, so that stable printing of the printer is ensured.
In a first aspect, an embodiment of the present invention provides a method for monitoring electric power, including:
acquiring initial battery power, a printing power threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data;
When the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time;
And determining the monitoring electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery.
Further, determining whether the printer satisfies a printing condition according to the initial battery power, the printing power threshold, and the target data includes:
determining the predicted power consumption corresponding to the target data;
And determining whether the printer meets the printing condition according to the initial battery power, the printing power threshold and the predicted consumed power.
Further, determining the predicted power consumption corresponding to the target data includes:
acquiring the printing electric quantity of unit data of the printer;
and calculating the predicted power consumption corresponding to the target data according to the unit data printing power.
Further, determining whether the printer satisfies a printing condition according to the initial battery power, the printing power threshold, and the predicted power consumption includes:
Determining a sum of the printing power threshold and a predicted power consumption;
Determining whether the initial battery charge is greater than a sum of the printing charge threshold and a predicted power consumption;
And when the initial battery power is larger than the sum of the printing power threshold and the predicted consumed power, the printer meets the printing condition.
Further, obtaining the current battery power of the printer according to the preset recovery time includes:
and after the target data is printed, acquiring the current battery electric quantity of the printer through the preset recovery time.
Further, determining the monitored power of the printer according to the current battery power and the initial battery power includes:
acquiring a preset difference value, and determining the difference between the initial battery quantity and the current battery quantity;
determining whether the preset difference is greater than a difference between the initial battery amount and the current battery amount;
And when the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, taking the initial battery quantity as the monitoring electric quantity of the printer.
Further, after determining whether the preset difference is greater than a difference between the initial battery amount and the current battery amount, the method further includes:
And when the preset difference value is not larger than the difference between the initial battery quantity and the current battery quantity, taking the current battery quantity as the monitoring electric quantity of the printer.
In a second aspect, an embodiment of the present invention further provides an electrical quantity monitoring device, including:
The condition determining module is used for acquiring initial battery power, a printing power threshold value, preset recovery time and target data of the printer according to the printing instruction, and determining whether the printer meets the printing condition according to the initial battery power, the printing power threshold value and the target data;
The electric quantity acquisition module is used for operating the printer to print target data until the target data is printed when the printer meets printing conditions, and acquiring the current battery electric quantity of the printer according to the preset recovery time;
And the electric quantity determining module is used for determining the monitoring electric quantity of the printer according to the current battery electric quantity and the initial battery electric quantity.
In a third aspect, an embodiment of the present invention further provides a printer, including:
One or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the power monitoring method.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the power monitoring method.
According to the embodiment of the invention, the initial battery power, the printing power threshold value, the preset recovery time and the target data of the printer are obtained according to the printing instruction, and whether the printer meets the printing condition is determined according to the initial battery power, the printing power threshold value and the target data; when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time; and determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery. In other words, according to the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold value, and the monitoring power of the printer is determined according to the power change of the printer before and after printing to report, so that abnormal shutdown caused by unstable power of the printer in the printing process is avoided.
Drawings
Fig. 1 is a schematic flow chart of a method for monitoring electric quantity according to an embodiment of the present invention;
fig. 2 is another flow chart of a method for monitoring electric quantity according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electric quantity monitoring device according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of a printer according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Fig. 1 is a schematic flow chart of a method for monitoring electric quantity according to an embodiment of the present invention, where the method may be performed by an electric quantity monitoring device according to an embodiment of the present invention, and the device may be implemented in software and/or hardware. In a specific embodiment, the apparatus may be integrated in an electronic device, which may be a server, for example. The following embodiments will be described taking the example of the integration of the apparatus in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
S110, acquiring initial battery power, a printing power threshold value, preset recovery time and target data of the printer according to a printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data;
The printing instruction may be an instruction sent by an upper computer of the printer to print target data, where the printing instruction includes the target data, where the upper computer may be any electronic device capable of sending the printing instruction to the printer for execution, where the electronic device may be connected to the printer by a wireless and wired data transmission manner to perform data transmission and instruction transmission, where the wired data transmission manner may be a serial port and a wire connection, and the wireless data transmission may be a network sharing and bluetooth connection, or an application program installed on the upper computer to perform instruction manipulation. The printer may be a computer output device having a battery for driving the printer to normally operate for satisfying the print demands of users in the middle of movement, wherein the device may be a printing device having a plurality of functions, or a printer having a single printing function, and data transmission may be performed through a wired communication technology and a wireless communication technology to obtain print data. The initial battery power of the printer may be a battery power of the printer before the printer prints the target data, for determining whether the printer continues to print normally. The printing electric quantity threshold value can be the minimum printing electric quantity preset according to actual demands and experimental data and used for guaranteeing printing effects and normal operation of the printer, and the electric quantity can maintain normal printing once. The preset recovery time may be a time when the voltage of the battery of the printer drops after one printing and the voltage is required to be recovered and stabilized, or a time when the electric quantity of the battery is recovered and stabilized. The target data may be print data to be printed by the printer, i.e., actual content printed by the printer this time.
In a specific implementation, the upper computer receives print data to be printed as target data, and generates a print instruction which can be received by a printer which performs data transmission with the upper computer according to the target data, and the print instruction is used for instructing the printer to perform data printing. And the printer receives the printing instruction sent by the upper computer and analyzes the printing instruction to obtain target data contained in the printing instruction. The method comprises the steps that a printing command triggers printing to obtain initial battery electric quantity, a printing electric quantity threshold value and preset recovery time of a printer before printing, whether the printer meets printing conditions or not is determined according to the initial battery electric quantity, the printing electric quantity threshold value and target data of the printer, if the printer meets the printing conditions, the printer prints according to the target data, if the printer does not meet the printing conditions, the printer cannot print according to the target, the initial battery electric quantity of the printer is reported, and the initial battery electric quantity of the printer is used for indicating a user to replace a battery or charge the battery.
S120, when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time;
In a specific implementation, the current battery power of the printer may be the battery power of the printer after the preset recovery time elapses after the printer prints the target data, which is used for determining the monitored power of the printer. Determining whether the printer meets the printing condition according to the initial battery power of the printer, a printing power threshold value and target data, if the printer meets the printing condition, printing according to the target data, printing by using the target data in a printing instruction as current printing data of the printer, and when a printing task corresponding to the target data is completed, finishing printing by using the target data, wherein at the moment, the printing is in a standby state, and acquiring the current battery power of the printer after a preset recovery time so as to determine the current battery power of the printer according to the initial battery power of the printer and the current battery power of the printer.
And S130, determining the monitoring electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery.
In a specific implementation, after a print job corresponding to a print instruction is completed, the monitored electric quantity of the printer can be the display electric quantity of the printer, which is used for monitoring whether the printer needs to be powered off abnormally due to insufficient electric quantity or not, determining whether the printer meets the printing condition according to the initial battery electric quantity of the printer, a print electric quantity threshold value and target data, so as to determine whether the initial battery electric quantity of the printer can complete the print job corresponding to the print instruction, and if the initial battery electric quantity of the printer can complete the print job corresponding to the print instruction, the change of the battery electric quantity of the printer caused by executing the printing action can be shielded in the printing process, so that the abnormal power off of the printer caused by the unstable electric quantity of the printer due to the battery voltage drop of the printer is avoided. And determining the difference value between the current battery electric quantity of the printer and the initial battery electric quantity of the printer, and comparing and determining the monitoring electric quantity of the printer according to the preset updating difference value and the difference value between the current battery electric quantity of the printer and the initial battery electric quantity of the printer, wherein the monitoring electric quantity of the printer is not only the display electric quantity of the printer, but also whether the printer for system monitoring of the printer can work normally or not.
According to the embodiment of the invention, the initial battery power, the printing power threshold value, the preset recovery time and the target data of the printer are obtained according to the printing instruction, and whether the printer meets the printing condition is determined according to the initial battery power, the printing power threshold value and the target data; when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time; and determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery. In other words, according to the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold value, and the monitoring power of the printer is determined according to the power change of the printer before and after printing to report, so that abnormal shutdown caused by unstable power of the printer in the printing process is avoided.
The method for monitoring electric quantity provided by the embodiment of the invention is further described below, and as shown in fig. 2, the method specifically includes the following steps:
s210, acquiring initial battery power, a printing power threshold, preset recovery time and target data of a printer according to a printing instruction, and determining predicted power consumption corresponding to the target data;
In a specific implementation, the predicted consumption corresponding to the target data may be the battery power required to be consumed by the printer for completing the target data according to the unit data printing power of the printer, and it is determined whether the initial battery power of the predicted printer corresponding to the target data can complete the printing task of the target data, so that the printing can be performed under the condition that the battery voltage changes caused by the execution of the printing task by the shielded printer, the change of the battery power of the printer caused by the execution of the printing action is shielded, and the abnormal shutdown caused by the instability of the battery power of the printer in the printing process is avoided.
Further, determining the predicted power consumption corresponding to the target data includes:
acquiring the printing electric quantity of unit data of a printer;
And calculating the predicted consumed electric quantity corresponding to the target data according to the unit data printing electric quantity.
In a specific implementation, the unit data printing electric quantity of the printer can be the battery electric quantity consumed by the printer for printing the unit data calculated by the printer according to the historical printing data, wherein the unit data can be the average value data of the printed characters, pictures and blank areas, and can be the collective name of unit character printing, unit picture printing and unit blank area printing. When the unit data is the average data of the printed text, the picture and the blank area, determining the average total amount corresponding to the target data according to the average data, and calculating according to the average total amount corresponding to the target data and the printing electric quantity of the unit data to obtain the predicted consumed electric quantity corresponding to the target data; when the unit data is the collective name of unit text printing, unit picture printing and unit blank area printing, the text printing amount, the picture printing amount and the blank area in the target data need to be determined, the consumed electric quantity corresponding to the text, the picture and the blank area in the target data is calculated according to the unit data printing electric quantity corresponding to different data contents, and the consumed electric quantity corresponding to the text, the picture and the blank area in the target data is accumulated to obtain the predicted consumed electric quantity corresponding to the target data. The average total amount corresponding to the target data is a multiple relation between the target data and the average data, the character printing amount is the number of unit character printing contained in the target data, the picture printing amount is the number of unit picture printing contained in the target data, and the blank area is the number of unit blank area printing contained in the target data.
S220, determining whether the printer meets the printing condition according to the initial battery power, the printing power threshold and the predicted consumed power;
In the specific implementation, when determining the sum of the printing electric quantity threshold value and the predicted consumption electric quantity, comparing according to the initial battery electric quantity and the sum of the printing electric quantity threshold value and the predicted consumption electric quantity to judge whether the printer meets the printing condition, and when the initial battery electric quantity is larger than the sum of the printing electric quantity threshold value and the predicted consumption vector, the printer meets the printing condition; when the initial battery power is smaller than or equal to the sum of the printing power threshold and the predicted consumption vector, the printer does not meet the printing condition, wherein the printer does not comprise the sum of the printing power threshold and the predicted consumption vector, and the initial battery power is smaller than the acquired power due to standby consumption or other operations during printing, so that the sum of the initial battery power and the printing power threshold and the predicted consumption vector is set to be not met, and the defect of the battery is avoided.
Further, determining whether the printer satisfies the printing condition according to the initial battery power, the printing power threshold and the predicted power consumption includes:
determining a sum of a printing power threshold and a predicted power consumption;
Determining whether the initial battery charge is greater than a sum of a printing charge threshold and a predicted consumed charge;
When the initial battery power is greater than the sum of the printing power threshold and the predicted consumed power, the printer satisfies the printing condition.
In specific implementation, after the unit data printing electric quantity of the printer is obtained, calculating the predicted consumed electric quantity corresponding to the target data according to the unit data printing electric quantity, and determining the predicted consumed electric quantity corresponding to the target data. And determining the electric quantity corresponding to the printing condition according to the printing electric quantity threshold value and the predicted consumed electric quantity, comparing the electric quantity corresponding to the printing condition with the initial battery electric quantity of the printer, and determining whether the initial battery electric quantity of the printer meets the printing condition. The electric quantity corresponding to the printing condition is the sum of a printing electric quantity threshold and a predicted electric quantity consumption, and the predicted electric quantity consumption is the electric quantity consumption corresponding to the target data because the printing electric quantity threshold is the threshold of normal standby of the printer and the printing effect is good, so that the printing effect is good, and the printer normally stands by and the required electric quantity consumption for completing the printing of the target data is indicated. Determining the sum of a printing electric quantity threshold value and a predicted consumption electric quantity, and comparing according to the initial battery electric quantity and the sum of the printing electric quantity threshold value and the predicted consumption electric quantity to judge whether the printer meets the printing condition, wherein when the initial battery electric quantity is larger than the sum of the printing electric quantity threshold value and the predicted consumption vector, the printer meets the printing condition; when the initial battery power is smaller than or equal to the sum of the printing power threshold and the predicted consumption vector, the printer does not meet the printing condition, wherein the printer does not comprise the sum of the printing power threshold and the predicted consumption vector, and the initial battery power is smaller than the acquired power due to standby consumption or other operations during printing, so that the sum of the initial battery power and the printing power threshold and the predicted consumption vector is set to be not met, and the defect of the battery is avoided.
S230, when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time;
further, obtaining the current battery power of the printer according to the preset recovery time includes:
and after the target data is printed, acquiring the current battery electric quantity of the printer through a preset recovery time.
In a specific implementation, the current battery power of the printer may be the battery power of the printer after the preset recovery time elapses after the printer prints the target data, which is used for determining the monitored power of the printer. Determining whether the printer meets the printing condition according to the initial battery power of the printer, a printing power threshold value and target data, if the printer meets the printing condition, printing according to the target data, printing by using the target data in a printing instruction as current printing data of the printer, and when a printing task corresponding to the target data is completed, finishing printing by using the target data, wherein at the moment, the printing is in a standby state, and acquiring the current battery power of the printer after a preset recovery time so as to determine the current battery power of the printer according to the initial battery power of the printer and the current battery power of the printer.
S240, determining the monitoring electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery.
Further, determining the monitored power of the printer according to the current battery power and the initial battery power comprises:
acquiring a preset difference value, and determining the difference between the initial battery quantity and the current battery quantity;
Determining whether the preset difference is greater than the difference between the initial battery amount and the current battery amount;
and when the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, taking the initial battery quantity as the monitoring electric quantity of the printer.
In a specific implementation, the preset difference value may be a change threshold value preset according to actual requirements and experimental data and used for updating the monitored quantity of the printer, and the monitored electric quantity of the printer is updated only when the change of one monitored electric quantity on the distance of the printer is greater than the preset difference value. For example, the printer consumes the electric quantity of a preset difference value in a standby state in one hour, the monitored electric quantity after one hour is updated to the current electric quantity of the printer until the preset difference value is subtracted, and the monitored electric quantity is not updated when the consumption is smaller than the preset difference value, so that the working state of the printer is stabilized, and the consumption of the printer is reduced. And determining whether the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, comparing the preset difference value with the difference between the initial battery quantity and the current battery quantity, taking the initial battery quantity as the monitoring electric quantity of the printer when the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, otherwise, taking the current battery quantity as the monitoring electric quantity of the printer when the preset difference value is not larger than the difference between the initial battery quantity and the current battery quantity.
Further, after determining whether the preset difference is greater than the difference between the initial battery amount and the current battery amount, the method further includes:
And when the preset difference value is not larger than the difference between the initial battery quantity and the current battery quantity, taking the current battery quantity as the monitoring electric quantity of the printer.
In the specific implementation, the difference between the initial battery quantity and the current battery quantity is determined, the consumed electric quantity of the printers before and after printing is calculated, the consumed electric quantity of the printers before and after printing is compared with a preset difference value, if the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, the fact that the current printer does not need to update the monitored electric quantity is indicated, and the monitored electric quantity of the printer is still the initial battery quantity; if the preset difference value is not greater than the difference between the initial battery quantity and the current battery quantity, the current printer is required to update the monitored electric quantity, and the monitored electric quantity of the printer is the current battery quantity.
According to the embodiment of the invention, the initial battery power, the printing power threshold value, the preset recovery time and the target data of the printer are obtained according to the printing instruction, and whether the printer meets the printing condition is determined according to the initial battery power, the printing power threshold value and the target data; when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time; and determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery. In other words, according to the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold value, and the monitoring power of the printer is determined according to the power change of the printer before and after printing to report, so that abnormal shutdown caused by unstable power of the printer in the printing process is avoided.
Fig. 3 is a schematic structural diagram of an electrical quantity monitoring device according to an embodiment of the present invention, as shown in fig. 3, the electrical quantity monitoring device includes:
The condition determining module 310 is configured to obtain an initial battery power, a printing power threshold, a preset recovery time and target data of a printer according to a printing instruction, and determine whether the printer meets a printing condition according to the initial battery power, the printing power threshold and the target data;
The electric quantity obtaining module 320 is configured to operate the printer to print target data when the printer meets a printing condition, until the target data is printed, and obtain the current battery electric quantity of the printer according to the preset recovery time;
And the power determining module 330 is configured to determine a monitored power of the printer according to the current battery power and the initial battery power.
In one embodiment, the condition determining module 310 determines whether the printer satisfies a printing condition according to the initial battery power, the printing power threshold, and the target data, including:
determining the predicted power consumption corresponding to the target data;
And determining whether the printer meets the printing condition according to the initial battery power, the printing power threshold and the predicted consumed power.
In one embodiment, the condition determining module 310 determines the predicted power consumption corresponding to the target data, including:
acquiring the printing electric quantity of unit data of the printer;
and calculating the predicted power consumption corresponding to the target data according to the unit data printing power.
In one embodiment, the condition determining module 310 determines whether the printer satisfies a printing condition according to the initial battery power, the printing power threshold, and the predicted power consumption, including:
Determining a sum of the printing power threshold and a predicted power consumption;
Determining whether the initial battery charge is greater than a sum of the printing charge threshold and a predicted power consumption;
And when the initial battery power is larger than the sum of the printing power threshold and the predicted consumed power, the printer meets the printing condition.
In one embodiment, the power obtaining module 320 obtains the current battery power of the printer according to the preset recovery time, including:
and after the target data is printed, acquiring the current battery electric quantity of the printer through the preset recovery time.
In one embodiment, the power determining module 330 determines the monitored power of the printer according to the current battery power and the initial battery power, including:
acquiring a preset difference value, and determining the difference between the initial battery quantity and the current battery quantity;
determining whether the preset difference is greater than a difference between the initial battery amount and the current battery amount;
And when the preset difference value is larger than the difference between the initial battery quantity and the current battery quantity, taking the initial battery quantity as the monitoring electric quantity of the printer.
In one embodiment, the power determining module 330 further includes, after determining whether the preset difference is greater than a difference between the initial battery power and the current battery power:
And when the preset difference value is not larger than the difference between the initial battery quantity and the current battery quantity, taking the current battery quantity as the monitoring electric quantity of the printer.
According to the device provided by the embodiment of the invention, the initial battery power, the printing power threshold value, the preset recovery time and the target data of the printer are obtained according to the printing instruction, and whether the printer meets the printing condition is determined according to the initial battery power, the printing power threshold value and the target data; when the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time; and determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery. In other words, according to the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold value, and the monitoring power of the printer is determined according to the power change of the printer before and after printing to report, so that abnormal shutdown caused by unstable power of the printer in the printing process is avoided.
Fig. 4 is a schematic structural diagram of a printer according to an embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary printer 12 suitable for use in implementing embodiments of the present invention. The printer 12 shown in fig. 4 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 4, the printer 12 is in the form of a general purpose computing device. Components of printer 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Printer 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by printer 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and/or cache memory 32. The printer 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The printer 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the printer 12, and/or any devices (e.g., network card, modem, etc.) that enable the printer 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the printer 12 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, network adapter 20 communicates with other modules of printer 12 via bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with printer 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing a power monitoring method provided by an embodiment of the present invention, the method includes: .
Acquiring initial battery power, a printing power threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data;
When the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time;
And determining the monitoring electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery.
The embodiment of the invention also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for monitoring electric quantity, the method comprising:
acquiring initial battery power, a printing power threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data;
When the printer meets the printing conditions, the printer is operated to print target data until the target data is printed, and the current battery electric quantity of the printer is obtained according to the preset recovery time;
And determining the monitoring electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (7)

1. A method of monitoring power comprising:
acquiring initial battery power, a printing power threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets printing conditions according to the initial battery power, the printing power threshold value and the target data;
when the printer meets the printing conditions, operating the printer to print target data, shielding electric quantity monitoring in the printing process, and acquiring the current battery electric quantity of the printer according to the preset recovery time until the target data is printed;
determining the monitored electric quantity of the printer according to the current electric quantity of the battery and the initial electric quantity of the battery;
Wherein determining whether the printer satisfies a printing condition according to the initial battery power, the printing power threshold, and the target data comprises:
Determining the predicted power consumption corresponding to the target data, and determining the sum of the printing power threshold and the predicted power consumption;
when the initial battery power is greater than the sum of the printing power threshold and the predicted power consumption, the printer meets a printing condition;
wherein determining the monitored power of the printer according to the current battery power and the initial battery power comprises:
acquiring a preset difference value, and determining the difference between the initial battery power and the current battery power;
And when the preset difference value is larger than the difference between the initial battery electric quantity and the current battery electric quantity, taking the initial battery electric quantity as the monitoring electric quantity of the printer.
2. The method of claim 1, wherein determining the predicted power consumption corresponding to the target data comprises:
acquiring the printing electric quantity of unit data of the printer;
and calculating the predicted power consumption corresponding to the target data according to the unit data printing power.
3. The method of claim 1, wherein obtaining the current battery level of the printer according to the preset recovery time comprises:
and after the target data is printed, acquiring the current battery electric quantity of the printer through the preset recovery time.
4. The method of claim 1, further comprising, after determining whether the preset difference is greater than a difference between the initial battery level and the current battery level:
And when the preset difference value is not larger than the difference between the initial battery electric quantity and the current battery electric quantity, taking the current battery electric quantity as the monitoring electric quantity of the printer.
5. An electrical quantity monitoring device, comprising:
The condition determining module is used for acquiring initial battery power, a printing power threshold value, preset recovery time and target data of the printer according to the printing instruction, and determining whether the printer meets the printing condition according to the initial battery power, the printing power threshold value and the target data;
The electric quantity acquisition module is used for operating the printer to print target data when the printer meets printing conditions, shielding electric quantity monitoring in the printing process, and acquiring the current battery electric quantity of the printer according to the preset recovery time until the target data is printed;
The electric quantity determining module is used for determining the monitoring electric quantity of the printer according to the current battery electric quantity and the initial battery electric quantity;
The condition determining module is specifically configured to determine a predicted power consumption corresponding to the target data, and determine a sum of the printing power threshold and the predicted power consumption; when the initial battery power is larger than the sum of the printing power threshold and the predicted consumed power, the printer meets the printing condition;
The electric quantity determining module is specifically configured to obtain a preset difference value, and determine a difference between the initial battery electric quantity and the current battery electric quantity; and when the preset difference value is larger than the difference between the initial battery electric quantity and the current battery electric quantity, taking the initial battery electric quantity as the monitoring electric quantity of the printer.
6. A printer, the printer comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the power monitoring method of any of claims 1-4.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a method of monitoring electrical quantity according to any of claims 1-4.
CN202210323224.0A 2022-03-29 2022-03-29 Electric quantity monitoring method and device, printer and storage medium Active CN114661132B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210323224.0A CN114661132B (en) 2022-03-29 2022-03-29 Electric quantity monitoring method and device, printer and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210323224.0A CN114661132B (en) 2022-03-29 2022-03-29 Electric quantity monitoring method and device, printer and storage medium

Publications (2)

Publication Number Publication Date
CN114661132A CN114661132A (en) 2022-06-24
CN114661132B true CN114661132B (en) 2024-04-26

Family

ID=82034241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210323224.0A Active CN114661132B (en) 2022-03-29 2022-03-29 Electric quantity monitoring method and device, printer and storage medium

Country Status (1)

Country Link
CN (1) CN114661132B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1195956A (en) * 1997-09-18 1999-04-09 Canon Inc Device and method for controlling printing and storage medium storing computer-readable program
CN1326403A (en) * 1998-11-09 2001-12-12 西尔弗布鲁克研究有限公司 Printer and methods of operation
WO2004012075A1 (en) * 2002-07-26 2004-02-05 Seiko Epson Corporation Print system
CN104111428A (en) * 2014-07-14 2014-10-22 浪潮软件集团有限公司 Method for monitoring battery electric quantity of handheld billing terminal
CN104309314A (en) * 2014-10-16 2015-01-28 深圳市理邦精密仪器股份有限公司 Method and device for indicating remaining printing copies of thermal printer
CN107910909A (en) * 2017-11-01 2018-04-13 福建新大陆支付技术有限公司 A kind of POS electric power systems and its electric quantity managing method
CN108828919A (en) * 2018-07-20 2018-11-16 宜春小马快印科技有限公司 Carbon dust surplus monitoring method, device, readable storage medium storing program for executing and printer
CN111469714A (en) * 2020-04-24 2020-07-31 上海元城汽车技术有限公司 Starting control method, device, equipment and storage medium of extended range electric vehicle
CN112448444A (en) * 2020-11-05 2021-03-05 Oppo广东移动通信有限公司 Charging control method and device, electronic equipment and readable storage medium
CN112834818A (en) * 2021-01-05 2021-05-25 北京嘀嘀无限科技发展有限公司 Electric quantity determining method and device, storage medium and electronic equipment
CN113434096A (en) * 2021-05-17 2021-09-24 厦门汉印电子技术有限公司 Printer, adapter work control method and device thereof, and readable storage medium
CN114089197A (en) * 2021-11-11 2022-02-25 珠海格力电器股份有限公司 Door lock monitoring method and device, electronic equipment and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1195956A (en) * 1997-09-18 1999-04-09 Canon Inc Device and method for controlling printing and storage medium storing computer-readable program
CN1326403A (en) * 1998-11-09 2001-12-12 西尔弗布鲁克研究有限公司 Printer and methods of operation
WO2004012075A1 (en) * 2002-07-26 2004-02-05 Seiko Epson Corporation Print system
CN104111428A (en) * 2014-07-14 2014-10-22 浪潮软件集团有限公司 Method for monitoring battery electric quantity of handheld billing terminal
CN104309314A (en) * 2014-10-16 2015-01-28 深圳市理邦精密仪器股份有限公司 Method and device for indicating remaining printing copies of thermal printer
CN107910909A (en) * 2017-11-01 2018-04-13 福建新大陆支付技术有限公司 A kind of POS electric power systems and its electric quantity managing method
CN108828919A (en) * 2018-07-20 2018-11-16 宜春小马快印科技有限公司 Carbon dust surplus monitoring method, device, readable storage medium storing program for executing and printer
CN111469714A (en) * 2020-04-24 2020-07-31 上海元城汽车技术有限公司 Starting control method, device, equipment and storage medium of extended range electric vehicle
CN112448444A (en) * 2020-11-05 2021-03-05 Oppo广东移动通信有限公司 Charging control method and device, electronic equipment and readable storage medium
CN112834818A (en) * 2021-01-05 2021-05-25 北京嘀嘀无限科技发展有限公司 Electric quantity determining method and device, storage medium and electronic equipment
CN113434096A (en) * 2021-05-17 2021-09-24 厦门汉印电子技术有限公司 Printer, adapter work control method and device thereof, and readable storage medium
CN114089197A (en) * 2021-11-11 2022-02-25 珠海格力电器股份有限公司 Door lock monitoring method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114661132A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
CN102789305B (en) Postponing suspend
EP3855286B1 (en) Dormancy controlling method for on board computing platform, device and readable storage medium
US8392736B2 (en) Managing memory power usage
US11314311B2 (en) Battery runtime and performance management based upon presence detection
US7904739B2 (en) Managing a power state for a peripheral
CN103890693A (en) Report updated threshold level based on parameter
CN108872762B (en) Electronic equipment leakage detection method and device, electronic equipment and storage medium
CN111078422A (en) Message processing method, message processing device, readable storage medium and electronic equipment
CN110502345A (en) A kind of overload protection method, device, computer equipment and storage medium
US6772366B2 (en) Method and apparatus for detecting AC removal
CN114978883A (en) Network wake-up management method and device, electronic equipment and storage medium
CN101625650A (en) Controlling a computer system having a processor including a plurality of cores
US20210089109A1 (en) Management of turbo states based upon user presence
CN113685284A (en) Electric fuel pump control method, device, equipment and storage medium
CN114661132B (en) Electric quantity monitoring method and device, printer and storage medium
US20220391188A1 (en) Systems and methods for context-aware firmware update
CN114980021A (en) Vehicle state feedback method and device, electronic equipment and storage medium
JP2017065203A (en) Image formation apparatus and program
CN107480004B (en) Fault recovery method and device and computer equipment
CN115576783B (en) Blade server out-of-band log storage method and system of VPX case
JP2006119916A (en) Instrument for automatically measuring power consumption to effectively utilize remaining power
US10911628B2 (en) Image processing apparatus, method, and non-transitory computer-readable storage medium
CN112311560B (en) Remote wakeup method and remote wakeup system
CN113162781B (en) Service recovery method, device, system and storage medium
CN113910782B (en) Method and device for monitoring printing consumables in image forming device and electronic equipment

Legal Events

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