CN114661132A - 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
CN114661132A
CN114661132A CN202210323224.0A CN202210323224A CN114661132A CN 114661132 A CN114661132 A CN 114661132A CN 202210323224 A CN202210323224 A CN 202210323224A CN 114661132 A CN114661132 A CN 114661132A
Authority
CN
China
Prior art keywords
printer
electric quantity
printing
target data
power
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.)
Granted
Application number
CN202210323224.0A
Other languages
Chinese (zh)
Other versions
CN114661132B (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

Images

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 capacity, a printing capacity threshold value, preset recovery time and target data of the printer according to the printing instruction, and determining whether the printer meets printing conditions or not according to the initial battery capacity, the printing capacity threshold value and the target data; when the printer meets the printing condition, the printer is operated to print the target data until the target data is printed, and the current battery capacity 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. Namely, in the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold, and the monitoring power of the printer is determined according to the power change of the printer before and after printing for reporting, so that the problem that the printer cannot be normally used due to 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 computer technology, in particular to an electric quantity monitoring method and device, a printer and a storage medium.
Background
With the daily use of electronic office work, printers have become basic electronic devices in people's work and life, and various printers are available on the market. The printer is divided into a socket-suitable printer and a battery-powered printer according to the type of the power supply used by the printer, wherein the socket-suitable printer is relatively stable in the operation process and is inconvenient to carry; the battery power supply type printer is convenient to carry, but the battery power supply type printer is in the use period, the battery power consumption is large, the large current causes the battery power to descend in the twinkling of an eye easily in the twinkling of an eye, the system misjudges that the battery power is too low and leads to abnormal shutdown, make the printer unable normal use, simultaneously after the abnormal shutdown, start again, because misjudge that the power is too low and lead to abnormal shutdown, probably make the start fail, perhaps need charge and resume normal percentage of battery power, just can normal use.
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 monitoring electric quantity of the printer to be reported according to the electric quantity change of the printer before and after printing on the premise of determining that the printer has printing capacity, so that the stable printing of the printer is ensured.
In a first aspect, an embodiment of the present invention provides an electric quantity monitoring method, where the method includes:
acquiring initial battery electric quantity, a printing electric quantity threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets a printing condition according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
when the printer meets the printing condition, operating the printer to print target data until the target data is printed, and acquiring the current battery capacity of the printer 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 print condition according to the initial battery power, the print 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 unit data printing electric quantity of the printer;
and calculating the predicted consumed electric quantity corresponding to the target data according to the unit data printing electric quantity.
Further, determining whether the printer satisfies a print condition according to the initial battery power, the print power threshold, and the predicted power consumption includes:
determining the sum of the printing electric quantity threshold value and the predicted consumed electric quantity;
determining whether the initial battery charge is greater than a sum of the print charge threshold and a predicted consumed charge;
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 capacity of the printer according to the preset recovery time includes:
and after the target data is printed, acquiring the current battery capacity of the printer after the preset recovery time.
Further, determining the monitored electric quantity of the printer according to the current battery electric quantity and the initial battery electric quantity includes:
acquiring a preset difference value, and determining the difference between the initial battery capacity and the current battery capacity;
determining whether the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity;
and when the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity, taking the initial battery capacity as the monitoring capacity of the printer.
Further, after determining whether the preset difference is greater than the difference between the initial battery level and the current battery level, the method further includes:
and when the preset difference value is not larger than the difference between the initial battery capacity and the current battery capacity, taking the current battery capacity as the monitoring capacity of the printer.
In a second aspect, an embodiment of the present invention further provides an electric quantity monitoring device, where the device includes:
the condition determining module is used for acquiring the initial battery electric quantity, the printing electric quantity threshold value, the preset recovery time and the target data of the printer according to the printing instruction, and determining whether the printer meets the printing condition or not according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
the electric quantity obtaining module is used for operating the printer to print target data when the printer meets printing conditions until the target data is printed, and obtaining 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, where the printer includes:
one or more processors;
a storage device to store one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused 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, where the computer program is executed by a processor to implement the power monitoring method.
According to the embodiment of the invention, the initial battery electric quantity, the printing electric quantity 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 electric quantity, the printing electric quantity threshold value and the target data; when the printer meets the printing condition, the printer is operated to print the target data until the target data is printed, and the current battery capacity 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. Namely, in the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold, and the monitoring power of the printer is determined according to the power change of the printer before and after printing for reporting, so that the problem that the printer cannot be normally used due to 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 power monitoring method according to an embodiment of the present invention;
fig. 2 is another schematic flow chart of a power monitoring method 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 present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a schematic flow chart of a power monitoring method according to an embodiment of the present invention, which can be executed by a power monitoring apparatus according to an embodiment of the present invention, where the apparatus can be implemented in software and/or hardware. In a specific embodiment, the apparatus may be integrated in an electronic device, which may be, for example, a server. The following embodiments will be described by taking as an example that the apparatus is integrated in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
s110, acquiring initial battery capacity, a printing capacity threshold value, preset recovery time and target data of the printer according to a printing instruction, and determining whether the printer meets a printing condition according to the initial battery capacity, the printing capacity threshold value and the target data;
the printing instruction may be an instruction sent by an upper computer of the printer for printing target data, where the printing instruction includes the target data, where the upper computer may be all electronic devices capable of sending the printing instruction to the printer for execution, and the electronic devices may be connected to the printer in a wireless and wired data transfer manner for data transfer and instruction transfer, where the wired data transfer manner may be a serial port and a wire connection, and the wireless data transfer manner may be network sharing and a bluetooth connection, or may be an application program installed on the upper computer for instruction control. The printer can be a computer output device with a battery for driving the printer to normally work, and is used for meeting the printing requirements of users in the moving process, wherein the device can be a printing device with a plurality of functions, or a printer with a single printing function, and can transmit data through a wired communication technology and a wireless communication technology to obtain printing data. The initial battery level of the printer may be the battery level of the printer before the printer prints the target data, and is used to determine whether the printer continues to print normally. The printing electric quantity threshold value can be the lowest printing electric quantity which is preset according to actual demands and experimental data and used for guaranteeing the printing effect and the normal operation of the printer, and the electric quantity can maintain one-time normal printing. The preset recovery time may be a time for which the voltage of the battery of the printer drops after one-time printing and the voltage needs to be recovered and stabilized, or a time for which 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. the actual content printed by the printer this time.
In 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 performing data transmission with the upper computer according to the target data, so as to instruct the printer to perform data printing. 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 instruction triggers printing to obtain initial battery capacity, a printing capacity 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 capacity, the printing capacity 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 a target, the initial battery capacity of the printer is reported, and the printer is used for indicating a user to replace a battery or charge the battery.
S120, when the printer meets the printing condition, operating the printer to print the target data until the target data is printed, and acquiring the current battery capacity of the printer according to preset recovery time;
in specific implementation, the current battery power of the printer may be the battery power of the printer after a preset recovery time after the printer prints the target data, and is used for determining the monitoring power of the printer. Whether the printer meets the printing condition is determined according to the initial battery capacity of the printer, the printing capacity threshold value and the target data, if the printer meets the printing condition, the printer prints according to the target data, the target data in the printing instruction is used as the current printing data of the printer to be printed by the printer, when the printing task corresponding to the target data is completed, the printing of the target data is completed, at the moment, the printing is in a standby state, the current battery capacity of the printer is acquired after the preset recovery time, and therefore the current battery capacity of the printer is determined according to the initial battery capacity of the printer and the current battery capacity 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 concrete realization, the monitoring electric quantity of printer can be after accomplishing the print task that the print order corresponds, the demonstration electric quantity of printer, whether be used for monitoring the printer and need carry out the unusual shutdown of electric quantity deficiency, according to the initial battery electric quantity of printer, whether printing electric quantity threshold value and target data confirm the printer and satisfy the printing condition, with the initial battery electric quantity of confirming the printer can accomplish the print task that the print order corresponds, if the initial battery electric quantity of printer can accomplish the print task that the print order corresponds and can shield the printing in-process, carry out the change of the battery electric quantity of printer that the action of printing arouses, avoid printing the process because of the unstability of printer electric quantity, make the battery voltage decline of printer cause the unusual shutdown of printer. The difference between the current battery capacity of the printer and the initial battery capacity of the printer is determined, the monitoring capacity of the printer is determined by comparing the preset updating difference and the difference between the preset updating difference and the initial battery capacity of the printer, wherein the monitoring capacity of the printer is not only the display capacity of the printer, but also whether the printer monitored by a system of the printer can work normally or not.
According to the embodiment of the invention, the initial battery electric quantity, the printing electric quantity 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 electric quantity, the printing electric quantity threshold value and the target data; when the printer meets the printing condition, running the printer to print target data until the target data is printed, and acquiring the current battery capacity of the printer according to 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. Namely, in the embodiment of the present invention, the printing capability of the printer is determined by obtaining the initial battery power and the printing power threshold, and the monitoring power of the printer is determined according to the power change of the printer before and after printing, so as to avoid that the printer cannot be normally used due to abnormal shutdown caused by unstable power of the printer during the printing process.
The method for monitoring the electric quantity provided by the embodiment of the present invention is further described below, and as shown in fig. 2, the method may specifically include the following steps:
s210, acquiring initial battery power, a printing power threshold, preset recovery time and target data of the printer according to the printing instruction, and determining predicted power consumption corresponding to the target data;
in the specific implementation, the predicted consumption amount corresponding to the target data can be the battery power required to be consumed by the printer to complete the target data, which is calculated according to the unit data printing power of the printer, and whether the predicted consumption amount corresponding to the target data is the initial battery power of the printer to be predicted to complete the printing task of the target data or not is determined, so that the printing can be performed on the shielded printer due to the voltage transformation change of the battery caused by the execution of the printing task, the change of the battery power of the printer caused by the execution of the printing action in the shielding printing process is avoided, and the abnormal shutdown of the printer 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 unit data printing electric quantity 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 may be a battery electric quantity consumed by the printer to print the unit data calculated according to the historical printing data, where the unit data may be average data of printed characters, pictures and blank areas, and may be a generic term for unit character printing, unit picture printing and unit blank area printing. When the unit data is the average data of the printed characters, pictures and blank areas, 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 unit data printing electric quantity to obtain the predicted consumed electric quantity corresponding to the target data; when unit data is a general name of unit character printing, unit picture printing and unit blank area printing, the character printing amount, the picture printing amount and the blank area in target data need to be determined, the consumed electric quantities corresponding to the characters, the pictures and the blank area in the target data are respectively calculated according to the unit data printing electric quantities corresponding to different data contents, and the consumed electric quantities corresponding to the characters, the pictures and the blank area in the target data are accumulated to obtain the predicted consumed electric quantity corresponding to the target data. The total mean value corresponding to the target data is a multiple relation of the target data and the mean value data, the character printing quantity is the quantity of unit character printing contained in the target data, the picture printing quantity is the quantity of unit picture printing contained in the target data, and the blank area is the quantity of unit blank area printing contained in the target data.
S220, determining whether the printer meets the printing condition according to the initial battery electric quantity, the printing electric quantity threshold value and the predicted consumed electric quantity;
in the specific implementation, the sum of the printing electric quantity threshold and the predicted consumed electric quantity is determined, whether the printer meets the printing condition is measured by comparing the initial battery electric quantity with the sum of the printing electric quantity threshold and the predicted consumed electric quantity, and when the initial battery electric quantity is larger than the sum of the printing electric quantity threshold and the predicted consumed vector, the printer meets the printing condition; when the initial battery power is less 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 include the condition that the initial battery power is equal to the sum of the printing power threshold and the predicted consumption vector, and the initial battery power is less than the acquired power due to standby consumption or other operations during printing, so that the initial battery power is equal to the sum of the printing power threshold and the predicted consumption vector and is set to be not meet the printing condition, and the battery shortage 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 the sum of a printing electric quantity threshold value and the predicted consumed electric quantity;
determining whether the initial battery charge is greater than a sum of the print charge threshold and the predicted consumed charge;
when the initial battery charge is greater than the sum of the print charge threshold and the predicted consumed charge, the printer satisfies the print condition.
In the specific implementation, after the unit data printing electric quantity of the printer is obtained, the predicted electric quantity consumed corresponding to the target data is calculated according to the unit data printing electric quantity, and the predicted electric quantity consumed corresponding to the target data is determined. The electric quantity corresponding to the printing condition is determined according to the printing electric quantity threshold value and the predicted consumed electric quantity, the electric quantity corresponding to the printing condition is compared with the initial battery electric quantity of the printer according to the condition, and whether the initial battery electric quantity of the printer meets the printing condition or not is determined. The electric quantity corresponding to the printing condition is the sum of the printing electric quantity threshold and the predicted consumed electric quantity, and the predicted consumed electric quantity is the consumed electric quantity corresponding to the target data because the printing electric quantity threshold is the threshold with good printing effect when the printer is normally standby, and the sum of the printing electric quantity threshold and the predicted consumed electric quantity indicates that the printing effect is good and the printer is normally standby and completes the required consumed electric quantity for printing the target data. When the sum of the printing electric quantity threshold value and the predicted consumed electric quantity is determined, comparing the initial battery electric quantity with the sum of the printing electric quantity threshold value and the predicted consumed 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 consumed vector, the printer meets the printing condition; when the initial battery power is less 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 include the condition that the initial battery power is equal to the sum of the printing power threshold and the predicted consumption vector, and the initial battery power is less than the acquired power due to standby consumption or other operations during printing, so that the initial battery power is equal to the sum of the printing power threshold and the predicted consumption vector and is set to be not meet the printing condition, and the battery shortage is avoided.
S230, when the printer meets the printing condition, operating the printer to print the target data until the target data is printed, and acquiring the current battery capacity of the printer according to preset recovery time;
further, obtaining the current battery capacity of the printer according to the preset recovery time includes:
and after the target data is printed, acquiring the current battery capacity of the printer after the preset recovery time.
In specific implementation, the current battery power of the printer may be the battery power of the printer after a preset recovery time after the printer prints the target data, and is used for determining the monitoring power of the printer. Whether the printer meets the printing condition is determined according to the initial battery capacity of the printer, the printing capacity threshold value and the target data, if the printer meets the printing condition, the printer prints according to the target data, the target data in the printing instruction is used as the current printing data of the printer to be printed by the printer, when the printing task corresponding to the target data is completed, the printing of the target data is completed, at the moment, the printing is in a standby state, the current battery capacity of the printer is acquired after the preset recovery time, and therefore the current battery capacity of the printer is determined according to the initial battery capacity of the printer and the current battery capacity of the printer.
And S240, determining the monitoring electric quantity of the printer according to the current battery electric quantity and the initial battery electric quantity.
Further, determining the monitored power of the printer based on the current battery power and the initial battery power includes:
acquiring a preset difference value, and determining the difference between the initial battery capacity and the current battery capacity;
determining whether the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity;
and when the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity, taking the initial battery capacity as the monitoring capacity of the printer.
In concrete implementation, the preset difference value can be a change threshold value of the monitoring quantity for updating the printer, which is preset according to actual requirements and experimental data, and the monitoring electric quantity of the printer is updated only when the change of the last monitoring electric quantity from the printer is greater than the preset difference value. For example, the printer consumes an electric quantity with a preset difference value only in one hour in the standby state, the monitored electric quantity after one hour is updated to the current electric quantity of the printer to subtract the preset difference value, and the monitored electric quantity is not updated when the consumed electric quantity 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 greater than the difference between the initial battery capacity and the current battery capacity, comparing the preset difference value with the difference between the initial battery capacity and the current battery capacity, and when the preset difference value is greater than the difference between the initial battery capacity and the current battery capacity, taking the initial battery capacity as the monitoring capacity of the printer, otherwise, when the preset difference value is not greater than the difference between the initial battery capacity and the current battery capacity, taking the current battery capacity as the monitoring capacity of the printer.
Further, after determining whether the preset difference is greater than the difference between the initial battery level and the current battery level, the method further includes:
and when the preset difference value is not larger than the difference between the initial battery capacity and the current battery capacity, taking the current battery capacity as the monitoring capacity of the printer.
In the specific implementation, the difference between the initial battery capacity and the current battery capacity is determined, the consumed electric capacity of the printer before and after printing is calculated, the consumed electric capacity of the printer before and after printing is compared with a preset difference value, and if the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity, the current printer does not need to update the monitored electric capacity, and the monitored electric capacity of the printer is still the initial battery capacity; if the preset difference value is not larger than the difference between the initial battery capacity and the current battery capacity, it will be described that the current printer needs to update the monitored electric capacity, and the monitored electric capacity of the printer is the current battery capacity.
According to the embodiment of the invention, the initial battery electric quantity, the printing electric quantity 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 electric quantity, the printing electric quantity threshold value and the target data; when the printer meets the printing condition, the printer is operated to print the target data until the target data is printed, and the current battery capacity 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. Namely, in the embodiment of the invention, the printing capacity of the printer is determined by acquiring the initial battery power and the printing power threshold, and the monitoring power of the printer is determined according to the power change of the printer before and after printing for reporting, so that the problem that the printer cannot be normally used due to abnormal shutdown caused by unstable power of the printer in the printing process is avoided.
Fig. 3 is a schematic structural diagram of an electric quantity monitoring device according to an embodiment of the present invention, and as shown in fig. 3, the electric quantity monitoring device includes:
a condition determining module 310, configured to obtain an initial battery capacity, a printing capacity threshold, a preset recovery time, and target data of a printer according to a printing instruction, and determine whether the printer satisfies a printing condition according to the initial battery capacity, the printing capacity threshold, and the target data;
the electric quantity obtaining module 320 is configured to, when the printer meets a printing condition, operate the printer to print target data until the target data is printed, and obtain a current battery electric quantity of the printer according to the preset recovery time;
an electric quantity determining module 330, configured to determine the monitored electric quantity of the printer according to the current battery electric quantity and the initial battery electric quantity.
In one embodiment, the determining whether the printer satisfies the print condition according to the initial battery power, the print power threshold and the target data by the condition determining module 310 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.
In one embodiment, the determining the predicted power consumption amount corresponding to the target data by the condition determining module 310 includes:
acquiring unit data printing electric quantity of the printer;
and calculating the predicted consumed electric quantity corresponding to the target data according to the unit data printing electric quantity.
In one embodiment, the determining whether the printer satisfies the print condition according to the initial battery power, the print power threshold, and the predicted power consumption module 310 includes:
determining the sum of the printing electric quantity threshold value and the predicted consumed electric quantity;
determining whether the initial battery charge is greater than a sum of the print charge threshold and a predicted consumed charge;
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 an embodiment, the acquiring module 320 acquires 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 capacity of the printer after the preset recovery time.
In one embodiment, the determining the monitored power of the printer by the power determining module 330 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 capacity and the current battery capacity;
determining whether the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity;
and when the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity, taking the initial battery capacity as the monitoring capacity of the printer.
In one embodiment, after determining whether the preset difference is greater than the difference between the initial battery level and the current battery level, the power determining module 330 further includes:
and when the preset difference value is not larger than the difference between the initial battery capacity and the current battery capacity, taking the current battery capacity as the monitoring capacity of the printer.
According to the device provided by the embodiment of the invention, the initial battery electric quantity, the printing electric quantity 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 electric quantity, the printing electric quantity threshold value and the target data; when the printer meets the printing condition, the printer is operated to print the target data until the target data is printed, and the current battery capacity 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. Namely, in the embodiment of the present invention, the printing capability of the printer is determined by obtaining the initial battery power and the printing power threshold, and the monitoring power of the printer is determined according to the power change of the printer before and after printing, so as to avoid that the printer cannot be normally used due to abnormal shutdown caused by unstable power of the printer during the printing process.
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 impose any limitation on the function and scope of use of the embodiment of the present invention.
As shown in FIG. 4, printer 12 is in the form of a general purpose computing device. The components of printer 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, 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 may 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. 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 and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are 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, for example, in 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 of which or some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Printer 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with printer 12, and/or with any devices (e.g., network card, modem, etc.) that enable printer 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, printer 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with the other modules of printer 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with printer 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
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 including: .
Acquiring initial battery electric quantity, a printing electric quantity threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets a printing condition according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
when the printer meets the printing condition, operating the printer to print target data until the target data is printed, and acquiring the current battery capacity of the printer 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.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the power monitoring method, and the method includes:
acquiring initial battery electric quantity, a printing electric quantity threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets a printing condition or not according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
when the printer meets the printing condition, operating the printer to print target data until the target data is printed, and acquiring the current battery capacity of the printer 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.
Computer storage media for embodiments of the invention may employ 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. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 the context of 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.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, 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 thereof. 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 for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. 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, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for monitoring power, comprising:
acquiring initial battery electric quantity, a printing electric quantity threshold value, preset recovery time and target data of a printer according to a printing instruction, and determining whether the printer meets a printing condition according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
when the printer meets the printing condition, operating the printer to print target data until the target data is printed, and acquiring the current battery capacity of the printer 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.
2. The method of claim 1, wherein determining whether the printer satisfies a print condition based on the initial battery charge level, the print charge level threshold, and the target data comprises:
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.
3. The method of claim 2, wherein determining the predicted power consumption corresponding to the target data comprises:
acquiring unit data printing electric quantity of the printer;
and calculating the predicted consumed electric quantity corresponding to the target data according to the unit data printing electric quantity.
4. The method of claim 2, wherein determining whether the printer satisfies a print condition based on the initial battery charge, the print charge threshold, and the predicted consumed charge comprises:
determining the sum of the printing electric quantity threshold value and the predicted consumed electric quantity;
determining whether the initial battery charge is greater than a sum of the print charge threshold and a predicted consumed charge;
and when the initial battery electric quantity is larger than the sum of the printing electric quantity threshold value and the predicted consumed electric quantity, the printer meets the printing condition.
5. 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 capacity of the printer after the preset recovery time.
6. The method of claim 1, wherein determining the monitored power level of the printer based on the current battery power level and the initial battery power level comprises:
acquiring a preset difference value, and determining the difference between the initial battery capacity and the current battery capacity;
determining whether the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity;
and when the preset difference value is larger than the difference between the initial battery capacity and the current battery capacity, taking the initial battery capacity as the monitoring capacity of the printer.
7. The method of claim 6, after determining whether the preset difference is greater than the difference between the initial battery level and the current battery level, further comprising:
and when the preset difference value is not larger than the difference between the initial battery capacity and the current battery capacity, taking the current battery capacity as the monitoring capacity of the printer.
8. An electrical quantity monitoring device, comprising:
the condition determining module is used for acquiring the initial battery electric quantity, the printing electric quantity threshold value, the preset recovery time and the target data of the printer according to the printing instruction, and determining whether the printer meets the printing condition or not according to the initial battery electric quantity, the printing electric quantity threshold value and the target data;
the electric quantity obtaining module is used for operating the printer to print target data when the printer meets printing conditions until the target data is printed, and obtaining 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.
9. A printer, characterized in that the printer comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the power monitoring method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of monitoring electrical quantities according to any one of claims 1-7.
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 true CN114661132A (en) 2022-06-24
CN114661132B 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
CN114661132B (en) 2024-04-26

Similar Documents

Publication Publication Date Title
CN102789305B (en) Postponing suspend
US7904739B2 (en) Managing a power state for a peripheral
US20240020017A1 (en) Monitoring method and apparatus for electronic device, and electronic device
CN111078422A (en) Message processing method, message processing device, readable storage medium and electronic equipment
CN111427666A (en) Method and system for quickly importing virtual machine image in OpenStack environment
CN114513545B (en) Request processing method, device, equipment and medium
CN114978883A (en) Network wake-up management method and device, electronic equipment and storage medium
CN109561134B (en) Electronic device, distributed cluster service distribution method and storage medium
CN113685284A (en) Electric fuel pump control method, device, equipment and storage medium
CN114661132B (en) Electric quantity monitoring method and device, printer and storage medium
CN107291213B (en) Mode selection method, device, terminal and computer readable storage medium
CN111858604B (en) Data storage method and device, electronic equipment and storage medium
CN110928940B (en) Data writing method and device based on kafka cluster, electronic equipment and storage medium
CN113285890B (en) Gateway flow distribution method and device, electronic equipment and storage medium
CN115756135A (en) Processor management method and computing device
US7398922B2 (en) POS terminal apparatus
CN113360092A (en) Data storage method, data storage device and electronic equipment
CN112817788A (en) Task abnormity warning method, device, server and storage medium
JP2017065203A (en) Image formation apparatus and program
CN114587196B (en) Cleaning robot control method and device and cleaning robot
CN113910782B (en) Method and device for monitoring printing consumables in image forming device and electronic equipment
CN101976111B (en) Computer system and power management method
WO2023010918A1 (en) Information processing method, terminal device, cloud server, and storage medium
JP2000276322A (en) Printing system controlling method
CN117149311B (en) Service execution method

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