CN-121989571-A - Control method and device of label printer, label printer and storage medium
Abstract
The application discloses a control method and device of a label printer, the label printer and a storage medium. The method comprises the steps of obtaining current data inflow state information corresponding to the label printer, wherein the current data inflow state information comprises at least one of a current receiving rate corresponding to data to be printed and a current data stock in a receiving buffer zone, and adjusting the printing rate of the label printer according to the current data inflow state information, so that the printing rate can be dynamically adjusted according to the actual data inflow situation, the problem that the label printer is blocked due to insufficient data stock caused by the fact that the data transmission speed is not kept up with the printing speed is effectively avoided, and the problem that the data is lost due to overflow of the receiving buffer zone caused by too fast data inflow is avoided, and the label printer can maintain high-efficiency, stable and continuous printing performance in various application scenes.
Inventors
- LUO LIMING
Assignees
- 武汉精臣智慧标识科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20251229
Claims (15)
- 1. A control method of a label printer, the method comprising: the method comprises the steps of obtaining current data inflow state information corresponding to a label printer, wherein the current data inflow state information comprises at least one of current receiving rate corresponding to data to be printed and current data stock in a receiving buffer area; and adjusting the printing rate of the label printer according to the current data inflow state information.
- 2. The method of claim 1, wherein the current data inflow status information comprises a current data inventory in a receive buffer; The adjusting the printing rate of the label printer according to the current data inflow status information comprises the following steps: and adjusting the printing rate of the label printer according to the current data stock and a preset data stock threshold.
- 3. The method of claim 2, wherein said adjusting the print rate of the label printer based on the current data stock and a preset data stock threshold comprises: when the current data stock is lower than a preset data stock threshold, reducing the printing rate of the label printer; When the current data storage quantity is higher than the preset data storage quantity threshold value, the printing rate of the label printer is increased; and when the current data stock is equal to the preset data stock threshold, controlling the printing rate of the label printer to be unchanged.
- 4. The method of claim 1, wherein the print rate Wherein R is the current receiving rate, B is the current data stock, B0 is the preset data stock threshold, and K1 and K2 are preset weight coefficients greater than zero.
- 5. The method of claim 1, wherein the method further comprises: calculating the printing time length corresponding to the current data stock based on the current printing rate; calculating the receiving time length required for receiving the data to be printed to the data stock in the receiving buffer zone to reach the current data stock based on the current receiving rate; and adjusting the printing rate of the label printer according to the current data inflow state information so that the printing duration is always greater than or equal to the receiving duration.
- 6. The method of claim 1, wherein the method further comprises: Acquiring current data to be printed corresponding to current label paper; Controlling the label printer to print the current label paper at a first printing rate under the condition that the current data to be printed is inconsistent with future data to be printed corresponding to the next label paper; And executing the step of adjusting the printing rate of the label printer according to the current data inflow state information under the condition that the current data to be printed is consistent with the future data to be printed corresponding to the next label paper.
- 7. The method of claim 6, wherein the method further comprises: If the current receiving rate is lower than the initial receiving rate under the condition that the current data to be printed is inconsistent with future data to be printed corresponding to the next piece of label paper, controlling the label printer to print the current label paper at a second printing rate, wherein the second printing rate is lower than the first printing rate; And if the current receiving rate is higher than or equal to the initial receiving rate under the condition that the current data to be printed is inconsistent with the future data to be printed corresponding to the next piece of label paper, executing the step of controlling the label printer to print the current label paper at the first printing rate.
- 8. The method of claim 6, wherein after said controlling said label printer to print said current label paper at a first print rate, said method further comprises: controlling the label printer to continuously receive data to be printed during the gap movement of the current label paper and the next label paper; And controlling the label printer to print the next piece of label paper at a third printing rate, wherein the third printing rate is higher than the first printing rate.
- 9. The method of claim 1, wherein the method further comprises: If the printing data corresponding to each of the continuous multiple label papers to be printed are consistent, and the multiple label papers are all short label papers, when a first label paper in the multiple label papers is printed, controlling the label printer to print the first label paper at a fourth printing speed; And after the first piece of label paper is printed, calling the received and stored printing data, and controlling the label printer to print the label paper to be printed in the plurality of pieces of label paper at a fifth printing rate, wherein the fifth printing rate is higher than the fourth printing rate.
- 10. The method of claim 1, wherein the method further comprises: If the printing data corresponding to each piece of continuous label paper to be printed are consistent, and the pieces of label paper are all long label paper, sequentially receiving a plurality of printing data packets; Controlling the label printer to print the long label paper at a sixth printing rate based on the received printing data packet, wherein a first time period required for printing the current printing data packet at the sixth printing rate is longer than a second time period required for correspondingly receiving and completely storing the next printing data packet in the receiving buffer area; And after the printing of the first long label paper in the plurality of label papers is finished, calling the received and stored complete printing data, and controlling the label printer to print the rest label papers to be printed in the plurality of label papers at a seventh printing rate, wherein the seventh printing rate is higher than the sixth printing rate.
- 11. The method of claim 1, wherein the method further comprises: acquiring an average receiving rate corresponding to data to be printed in a current time period; predicting a predicted data inventory received in the receive buffer over a future time period based on the average receive rate; And adjusting the printing rate of the label printer according to the predicted data stock.
- 12. The method of claim 1, wherein the current data inflow status information includes a current reception rate corresponding to data to be printed; The adjusting the printing rate of the label printer according to the current data inflow status information comprises the following steps: And controlling the label printer to print at a corresponding target printing rate according to a target receiving rate range to which the current receiving rate belongs, wherein the higher the receiving rate corresponding to the target receiving rate range to which the current receiving rate belongs is, the higher the corresponding target printing rate is.
- 13. A control device of a label printer, the device comprising: The first acquisition module is used for acquiring current data inflow state information corresponding to the label printer, wherein the current data inflow state information comprises at least one of a current receiving rate corresponding to data to be printed and a current data stock in a receiving buffer area; and the first adjusting module is used for adjusting the printing rate of the label printer according to the current data inflow state information.
- 14. A label printer comprising a processor and a memory, wherein the memory stores a computer program, characterized in that the computer program is adapted to be loaded by the processor and to perform the control method of the label printer according to any one of claims 1 to 12.
- 15. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the control method of a label printer as claimed in any one of claims 1-12.
Description
Control method and device of label printer, label printer and storage medium Technical Field The present application relates to the technical field of label printers, and in particular, to a control method and apparatus for a label printer, a computer readable storage medium, and a computer program product. Background The label refers to the literal, graphic and symbol on the product and all the explanatory matters. The label is widely applied to the scenes of super-retail business, industrial production, express delivery, clothing, office management and the like, such as price labels, product description labels, shelf labels, bar code labels, clothing labels, document labels, file storage labels, various articles, stationery labels, express delivery face sheets and the like. In the prior art, when the label paper is printed, the situation that the Bluetooth data transmission speed cannot keep up with the printing speed can cause the jam occurs, if no printing data exists, the printer can pause printing until the printing data is stored in the printer, so that the situation that the printing jam occurs when the printing data does not exist in the printer. Disclosure of Invention The embodiment of the application provides a control method and device of a label printer, the label printer and a storage medium, which can dynamically adjust the printing speed according to the actual data inflow condition, so that the problem of printing stuck caused by insufficient data storage of the label printer due to the fact that the data transmission speed is not followed by the printing speed can be effectively avoided, and the problem of data loss caused by overflow of a receiving buffer area due to too fast data inflow can be avoided. The technical scheme is as follows: In a first aspect, an embodiment of the present application provides a method for controlling a label printer, where the method includes: The method comprises the steps of obtaining current data inflow state information corresponding to the label printer, wherein the current data inflow state information comprises at least one of current receiving rate corresponding to data to be printed and current data stock in a receiving buffer area; and adjusting the printing rate of the label printer according to the current data inflow state information. In one possible implementation, the current data inflow status information includes a current data stock in the receiving buffer; the adjusting the printing rate of the label printer according to the current data inflow status information includes: And adjusting the printing rate of the label printer according to the current data stock and a preset data stock threshold. In one possible implementation manner, the adjusting the printing rate of the label printer according to the current data stock and a preset data stock threshold includes: When the current data stock is lower than a preset data stock threshold, reducing the printing rate of the label printer; when the current data storage amount is higher than the preset data storage amount threshold value, the printing rate of the label printer is increased; And when the current data stock is equal to the preset data stock threshold, controlling the printing speed of the label printer to be unchanged. In one possible implementation, the above-described print rateWherein R is the current receiving rate, B is the current data stock, B0 is the preset data stock threshold, and K1 and K2 are preset weight coefficients greater than zero. In one possible implementation manner, the method further includes: calculating the printing time length corresponding to the current data stock based on the current printing rate; calculating a receiving time period required for receiving the data to be printed and the data stock in the receiving buffer zone to reach the current data stock based on the current receiving rate; and adjusting the printing rate of the label printer according to the current data inflow state information so that the printing duration is always longer than or equal to the receiving duration. In one possible implementation manner, the method further includes: Acquiring current data to be printed corresponding to current label paper; Controlling the label printer to print the current label paper at a first printing rate under the condition that the current data to be printed is inconsistent with future data to be printed corresponding to the next label paper; and executing the step of adjusting the printing rate of the label printer according to the current data inflow state information under the condition that the current data to be printed is consistent with the future data to be printed corresponding to the next label paper. In one possible implementation manner, the method further includes: If the current receiving rate is lower than the initial receiving rate under the condition that the current data to be printed is inconsistent with future data to be pr