Label printing management method, system and equipment

Through communication connections between the terminal and the label printer, managing the printing status and resending the print packet, the problem of missed or repeated printing during the printing process is solved, and the reliability and accuracy of printing is improved.

CN117632052BActive Publication Date: 2024-11-22CHENGDU MEITUAN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311221951.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2024-11-22
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

In the prior art, how to effectively manage the label printing status of the label printer during the process of printing order labels is an urgent problem that needs to be solved, resulting in the problem of missed or repeated printing being difficult to avoid.

Method used

By establishing a communication connection between the terminal and the label printer, sending print packets and response messages, the label printer records the print status and resends the print packets if necessary to ensure accurate printing of the order labels.

Benefits of technology

It effectively avoids missed or repeated printing of order labels, improves the reliability of printing order labels, and ensures the accuracy and efficiency of the printing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117632052B_ABST
    Figure CN117632052B_ABST
Patent Text Reader

Abstract

The present application discloses a management method, system and device for label printing, which belongs to the field of computer technology. In the present application, a terminal sends a print data packet of a first order to a label printer, and the print data packet includes print content and a first instruction. The label printer prints the print content to form an order label and records the label printing status; then the label printer sends a response message to the terminal, and the response message carries the label printing status. The terminal determines whether it is necessary to resend the print data packet to the label printer according to the label printing status. In the embodiment of the present application, since the label printer can send the label printing status to the terminal, the terminal can determine whether it is necessary to resend the print data packet according to the label printing status, thereby avoiding the problem of missing order labels or repeatedly printing order labels, and improving the reliability of printing order labels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a management method, system and device for label printing. Background Art

[0002] Currently, in order to improve delivery efficiency, merchants will print order labels containing order content and stick the order labels on the outer packaging of the goods, so that delivery personnel can quickly find the goods they deliver through the order labels.

[0003] In the related art, a terminal device used by a merchant receives the order content of a user, generates a printing instruction according to the order content, sends the printing instruction to a printer, and the printer prints a corresponding order label according to the printing instruction.

[0004] In the process of printer printing order labels, how to manage the order label printing status is an urgent problem to be solved. Summary of the invention

[0005] The present application provides a label printing management method, system and device, which can be used to manage the label printing status of an order. The above technical solution is as follows:

[0006] In a first aspect, a label printing management method is provided, the method is applied to a label printer, the label printer is connected to a terminal, the method comprises:

[0007] Receive a print data packet of a first order sent by the terminal, wherein the print data packet includes print content and a first instruction, wherein the first instruction is used to instruct the label printer to print the print content to form an order label and record the label printing status of the first order;

[0008] A response message of the first order is sent to the terminal, wherein the response message carries a label printing status of the first order, and the label printing status is used to indicate whether the terminal resends the print data packet of the first order.

[0009] In a second aspect, an embodiment of the present application provides a method for managing label printing, the method being applied to a terminal, the terminal being connected to a label printer, the method comprising:

[0010] Sending a print data packet of a first order to the label printer, wherein the print data packet includes print content and a first instruction, wherein the first instruction is used to instruct the label printer to print the print content to form an order label and record the label printing status of the first order;

[0011] receiving a response message of the first order sent by the label printer, wherein the response message carries a label printing status of the first order, and the label printing status is used to indicate whether the terminal resends a print data packet of the first order;

[0012] When the label printing status indicates to resend the print data packet of the first order, the print data packet of the first order is resent to the label printer.

[0013] In the third aspect, an embodiment of the present application provides a label printing management device, which is configured on a label printer, and the label printer is connected to a terminal. The device includes: a first receiving module, used to receive a print data packet of a first order sent by the terminal, the print data packet includes print content and a first instruction, the first instruction is used to instruct the label printer to print the print content to form an order label, and record the label printing status of the first order; a first sending module, used to send a response message of the first order to the terminal, the response message carries the label printing status of the first order, and the label printing status is used to indicate whether the terminal resends the print data packet of the first order.

[0014] In a fourth aspect, an embodiment of the present application provides a label printing management device, which is configured at a terminal, and the terminal is connected to a label printer, and the device includes: a second sending module, used to send a print data packet of a first order to the label printer, the print data packet including print content and a first instruction, the first instruction being used to instruct the label printer to print the print content to form an order label, and record the label printing status of the first order; a second receiving module, used to receive a response message of the first order sent by the label printer, the response message carrying the label printing status of the first order; the second sending module is also used to resend the print data packet of the first order to the label printer when the label printing status indicates to resend the print data packet of the first order.

[0015] In the fifth aspect, an embodiment of the present application provides a label printing management system, which includes a label printer and a terminal, the label printer is used to execute a label printing management method such as any one of the above-mentioned first aspect, and the terminal is used to execute a label printing management method such as any one of the above-mentioned second aspect.

[0016] In the sixth aspect, an embodiment of the present application provides a label printing management device, the label printing management device includes a processor and a memory, at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor to enable the label printing management device to implement any of the above-mentioned label printing management methods.

[0017] In the seventh aspect, an embodiment of the present application provides a storage medium, which may be a computer-readable storage medium, storing at least one computer program, and at least one computer program is loaded and executed by a processor so that the computer implements any of the above-mentioned label printing management methods.

[0018] In an eighth aspect, an embodiment of the present application further provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the above-mentioned label printing management methods.

[0019] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0020] In the technical solution provided in the present application, the terminal sends a print data packet of the first order to the label printer, and the print data packet includes print content and a first instruction. The label printer prints the print content to form an order label, and records the label printing status of the first order according to the first instruction; the label printer sends a response message to the terminal, and the response message carries the label printing status of the first order. Therefore, the terminal can judge whether it is necessary to resend the print data packet to the label printer according to the label printing status of the first order. This can avoid missing some order labels and not printing, or the problem of repeated printing of some order labels, thereby improving the reliability of printing order labels. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0023] Figure 2 It is a flowchart of a label printing management method provided in an embodiment of the present application;

[0024] Figure 3 It is a flowchart of another label printing management method provided in an embodiment of the present application;

[0025] Figure 4 It is a flowchart of another label printing management method provided in an embodiment of the present application;

[0026] Figure 5 It is a structural diagram of a label printing management system provided in an embodiment of the present application;

[0027] Figure 6 It is a structural diagram of a label printing management device provided in an embodiment of the present application;

[0028] Figure 7 It is a structural diagram of another label printing management device provided in an embodiment of the present application;

[0029] Figure 8 It is a structural diagram of a label printing management device provided in an embodiment of the present application;

[0030] Fig. 9 It is a structural diagram of another label printing management device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0032] This application embodiment provides a label printing management method, please refer to Figure 1 , which shows a schematic diagram of an implementation environment of the method provided in an embodiment of the present application. The implementation environment may include: a terminal 11 and a label printer 12.

[0033] Among them, the terminal 11 is installed with an application or webpage that can display information, and the information that can be displayed by the application or webpage includes the printed content and order label obtained in the embodiment of the present application. Optionally, the terminal 11 can be any electronic product that can interact with the user through one or more methods such as a keyboard, a touch pad, a touch screen, a remote control, voice interaction or a handwriting device, such as a personal computer (PC), a mobile phone, a smart phone, a personal digital assistant (PDA), a wearable device, a pocket PC (PPC), a tablet computer, etc.

[0034] The label printer 12 may be a single label printer or a cluster of multiple label printers. The terminal 11 and the label printer 12 establish a communication connection via a wired or wireless network. Optionally, the terminal 11 may also be connected to the label printer 12 via a server 13.

[0035] Those skilled in the art should understand that the above-mentioned terminal 11 and label printer 12 are only examples, and other existing or future terminals or label printers, if applicable to the present application, should also be included in the scope of protection of the present application and are included here by reference.

[0036] The label printer 12 may be an output device such as an inkjet printer, a dot matrix printer, a laser printer, a thermal printer, etc. The terminal 11 may be a point of sale (POS) terminal, and the POS terminal and the printer establish a communication connection via a wired network, a universal serial bus (USB) or Bluetooth technology.

[0037] Based on the above Figure 1 In the implementation environment shown, the present application embodiment provides a label printing management method, which can be executed by a label printing management system, and the label printing management system includes a label printer and a terminal. Figure 2 As shown, the label printing management method includes S101-S104.

[0038] S101. The terminal sends a print data packet of a first order to a label printer, where the print data packet includes print content and a first instruction.

[0039] The first instruction is used to instruct the label printer to print the print content to form an order label and record the label printing status of the first order. The first order is an order received by the terminal and needs to print its corresponding order label. The data structure of the print data packet can be shown in Table 1. For example, the print data packet mainly includes three parts, namely: a data packet header, data content and a data packet end. The data content includes the print content, and the data packet end includes the first instruction of the first order.

[0040] Optionally, the data packet header may include a clear screen (CLS) instruction. The clear screen instruction is used to instruct the label printer to clear the print content stored in the print buffer. After the label printer receives the print data packet of the order, it stores the print content in the print data packet in the print buffer of the label printer to prepare for the subsequent typesetting and printing operations of the print content. The CLS instruction is added to the print data packet header to clear the print content stored in the print buffer.

[0041] In a possible implementation scenario, the print content stored in the print buffer is the print content of the previous order. After receiving the print data packet of the first order, the print content of the previous order stored in the print buffer is cleared to avoid repeated printing of order labels.

[0042] In another possible implementation scenario, the print content stored in the print buffer is the print content of the first order. Due to data transmission failure and other reasons, the print content of the first order stored in the print buffer may be incomplete or erroneous. In this way, after the order label of the first order fails to print, the terminal will resend the print data packet of the first order. After the label printer receives the print data packet, it uses the CLS instruction in the print data packet header to clear the incomplete or erroneous print content in the print buffer to avoid the printed order label of the first order being erroneous, thereby improving the accuracy of the printed order label.

[0043] In addition, the printed content is the content that the label printer needs to print out and present on the medium. The end of the data packet includes the first instruction of the first order. After receiving the first instruction of the first order, the label printer prints the printed content to form an order label and records the label printing status of the first order.

[0044] Table 1

[0045] Data packet header Data content Conclusion CLS Print content First order first instruction

[0046] In a possible implementation, the first instruction includes a first instruction header and an instruction order identifier, the first instruction header is used to indicate the category of the first instruction, and the instruction order identifier is used to indicate the order associated with the first instruction.

[0047] Exemplarily, the data structure of the first instruction is shown in Table 2, and the first instruction includes but is not limited to three parts: the first instruction header, the instruction order identifier, and the end of the instruction. Among them, the first instruction header occupies 7 bytes (Byte) and is used to indicate the category of the first instruction. In other words, the first instruction header is used to indicate that the instruction received by the label printer is the first instruction. For example: the first instruction header is "1F1B 1F 20 23 35 20", and the label printer receives an instruction header of "1F 1B 1F 2023 3520", which indicates that the instruction is the first instruction. The instruction order identifier occupies 4Bytes, which is used to indicate which order the first instruction is used to record the label printing status of. For example: the order identifier of the first order is "M", which means that the first instruction is used to indicate the label printing status of order M. The end of the instruction occupies 2Bytes, which is used to indicate the end of the first instruction, and the subsequent characters are no longer the content of the first instruction. For example, if the instruction ends with "0D 0A", when the label printer receives an instruction ending with "0D 0A", it indicates that the data stream included in the first instruction ends here, and the data streams received subsequently are not the first instruction.

[0048] Table 2

[0049] First instruction header Order ID End of instruction 1F 1B 1F 20 23 35 20 M 0D 0A

[0050] For example, after receiving the user's order information, the terminal marks the order as order M, extracts key information from the order information to generate print content, and the key information in the order information may include at least one of the user name, user contact information, user address, user notes when placing an order, and product information ordered by the user. After generating the print content, the terminal adds the print content to the position corresponding to the data content of the print data packet. Then, a first instruction corresponding to order M is generated, and the first instruction corresponding to order M is added to the position corresponding to the end of the data packet. The header of the data packet is the CLS instruction. At this point, a print data packet of order M is formed, and the print data packet of order M is sent to the label printer in the form of a data stream.

[0051] S102: The label printer prints the print content based on the first instruction to form an order label, and records the label printing status of the first order.

[0052] The label printing status of the first order refers to the status of the label printer in the process of printing the order label, and may also refer to the processing status of the label printer on the print data packet, and the processing status is used to indicate whether the terminal resends the print data packet of the first order. For example, the label printing status may include 4 states, namely: the print data packet of the first order is not received, the print data packet of the first order is received but not printed, printing is successful, and printing fails.

[0053] The label printer receives the print data packet sent by the terminal. Since the print data packet is sent in the form of a data stream, after the label printer receives the data stream, it is necessary to determine the type of data in the data stream to determine the subsequent operation to be performed on the data in the data stream. For example, the type of data can be determined by the data packet header or the instruction header.

[0054] Exemplarily, the label printer receives a piece of data in the data stream, determines whether the data is a CLS instruction, and if it is a CLS instruction, clears the content in the printer print buffer; if it is not a CLS instruction, determines whether the data is print content; if it is print content, stores the print content in the print buffer, performs print typesetting, and prepares for subsequent printing. If the data is not print content, determines whether it is the first instruction; if it is the first instruction, the label printer reads the order identifier from the first instruction and records the label printing status corresponding to the order identifier.

[0055] For example: when the first instruction is received, the label printing status of order M is recorded as receiving the print data packet of order M but not printing it, and in the subsequent printing process of order M, the label printing status corresponding to order M is recorded in sequence.

[0056] S103: The label printer sends a response message of the first order to the terminal.

[0057] The label printing status of the first order can be carried in the response message of the first order. Exemplarily, the label printer sends a label response message to the terminal mainly including but not limited to the following three situations:

[0058] (1) Real-time delivery

[0059] The label printer synchronizes the response message of the first order to the terminal in real time, that is, the label printer records the label printing status of the first order and sends a response message including the label printing status of the first order to the terminal.

[0060] (2) Query sending

[0061] After receiving the second instruction of the first order sent by the terminal, the label printer queries the label printing status corresponding to the first order, adds the queried label printing status corresponding to the first order to the response message, and sends a response message to the terminal. The second instruction is used to instruct the label printer to query the current label printing status of the first order and send the queried label printing status to the terminal.

[0062] (3) End sending

[0063] After the printing task for the first order is completed, the label printer sends a response message to the terminal. For example: after the order label of the first order is successfully printed, the label printer adds the label printing status of the successful printing to the response message, and the label printer sends the response message to the terminal. For another example: after the order label of the first order fails to print, the label printer adds the label printing status of the failed printing to the response message, and the label printer sends the response message to the terminal.

[0064] Exemplarily, in the case of ending the sending, the label printer can add all label printing statuses of the first order to the response message and send the response message to the terminal. The label printer can also only add the end status corresponding to the first order to the response message and send the response message to the terminal. The end status includes: printing success or printing failure.

[0065] In one possible implementation, the response message includes a message header, a message order identifier, a printer status, a label printing status, and the number of labels; the message header is used to indicate the category of the response message; the message order identifier is used to indicate the order associated with the response message; the printer status refers to the working status of the label printer; the label printing status refers to the processing status of the print data packet by the label printer, and the processing status is used to indicate whether the terminal resends the print data packet of the first order; the number of labels refers to the number of order labels that the label printer has printed.

[0066] Optionally, the response message includes a first response message and a second response message, wherein the first response message refers to a response message to the second instruction, and the second response message refers to a response message to the first instruction, that is, the second response message refers to a response message generated by the label printer and sent to the terminal when the label printing status is the end of printing.

[0067] Exemplarily, the data structure of the second response message is shown in Table 3, and the second response message includes the first message instruction header, order identifier, printer status, label printing status, and the number of labels. Among them, the first message header occupies 2 bytes, which is used to indicate that the message is a response message to the first instruction. For example: the first message header is "FE FE". If the terminal receives a message whose message header is "FE FE", the terminal can know that the message is a response message to the first instruction. The order identifier occupies 4 bytes, which is used to indicate which order the response message is for. For example: if the order identifier is "M", it indicates that the response message is a response message for order M. The printer status occupies 1 Byte, which refers to the current working status of the printer. Among them, the working status of the printer includes 5 states, namely: 0, 1, 2, 3, and 4. 0 indicates that the printer is in normal status, 1 indicates that the printer is in paper jam status, 2 indicates that the printer is out of paper status, 3 indicates that the printer is paused, and 4 indicates that the printer is printing. The label printing status occupies 1 Byte and can include 4 states: 0, 1, 2, and 3. 0 means that the label printer has not received the print data packet of order M, 1 means that the label printer has received the print data packet of order M but has not printed it, 2 means that the printing is successful, and 3 means that the printing fails. The number of labels occupies 1 Byte and is used to indicate the self-increment code of the labels printed by the label printer, that is, the number of labels that the label printer has printed.

[0068] Table 3

[0069]

[0070] S104: When the label printing status indicates to resend the print data packet of the first order, the terminal resends the print data packet of the first order to the label printer.

[0071] In a possible implementation, when the label printing status of the first order is that the print data packet of the first order has not been received, the print data packet of the first order is resent to the label printer. If the label printer has not received the print data packet of the first order, it indicates that for some reason, the label printer has not received the print data packet of the first order, and thus cannot print the order label corresponding to the first order.

[0072] When the label printer is unable to print the order label corresponding to the first order, the terminal resends the print data packet of the first order so that the label printer can re-receive the print data packet of the first order and re-print the order label based on the re-received print data packet to avoid missing orders.

[0073] In another possible implementation, when the label printing status of the first order is printing failure, the printing data packet of the first order is resent to the label printer. The printing failure may be caused by a printer failure or missing or tampered content of the data packet, resulting in the failure to print the order label successfully. At this time, the terminal resends the printing data packet to avoid order label errors or omissions.

[0074] When the label printing status is that the printing is successful, the terminal does not repeatedly send the printing data packet of the first order, which can avoid the problem of duplicate orders. When the label printing status is that the printing data packet is received but not printed, the terminal does not perform other operations and waits for the response message of the label printer.

[0075] In an embodiment of the present application, the terminal can determine whether to resend the print data packet of the first order based on the label printing status of the first order sent by the label printer, thereby avoiding the problem of missing orders or duplicate orders.

[0076] In one possible implementation, the working status of the label printer is detected; when the working status of the label printer is in an abnormal device state, printing of the print content is stopped; when the working status of the label printer is restored from the abnormal device state to the normal device state, the print content included in the print data packet is reprinted.

[0077] The working status of the label printer includes but is not limited to normal, paper jam, paper out, pause, printing, etc., among which the abnormal status of the device includes paper jam or paper out. When the label printer is in an abnormal state such as paper jam or paper out, the label printer stops the printing operation. After the label printer recovers from the abnormal working state to the normal state, the label printer reprints the print content stored in the print buffer. After printing is successful, a response message of successful printing is sent to the terminal.

[0078] Based on the above embodiment, the terminal is a POS terminal, and the present embodiment further illustrates the management method of label printing. Figure 3 As shown, the management method of label printing includes but is not limited to the following steps.

[0079] S201. The POS terminal sends a print data packet of a first order to a label printer. The print data packet includes print content and a first instruction.

[0080] The first instruction is used to instruct the label printer to print the print content to form an order label, and to instruct the label printer to record the label printing status of the first order.

[0081] S202: The label printer prints the print content based on the first instruction to form an order label, and records the label printing status of the first order.

[0082] The specific implementation process of steps S201-S202 in the embodiment of the present application is consistent with that of steps S101-S102 in the above embodiment, and can refer to the description in the above embodiment, which will not be repeated here.

[0083] S203: When the query condition is met, the POS terminal sends a second instruction of the first order to the label printer.

[0084] The second instruction is used to instruct the label printer to query the label printing status of the first order. The second instruction can be understood as an instruction sent by the POS terminal to the label printer to query the current label printing status of the first order. The data structure of the second instruction is shown in Table 4. The second instruction mainly includes three parts: the second instruction header, the order identifier, and the end of the instruction. The second instruction header occupies 7 bytes. The second instruction header is used to indicate that the instruction received by the label printer is the second instruction. For example: the second instruction header is "1F 1B 1F 20 23 34 20", and the label printer receives an instruction header of "1F 1B 1F 20 23 34 20, which indicates that the instruction is the second instruction. The order identifier occupies 4 bytes, which is used to indicate which order the second instruction is used to query the label printing status of. For example: the order identifier is "M", which means that the second instruction is used to query the current label printing status of order M. The end of the instruction includes 2 bytes, which is used to indicate the end of the second instruction, and the subsequent characters are no longer the content of the second instruction. For example: the end of the instruction is "0D 0A", and the label printer receives an instruction ending with "0D 0A", which indicates that the data stream included in the second instruction ends here, and the subsequent received data streams are not the second instruction.

[0085] Table 4

[0086] Second instruction header Order ID End of instruction 1F 1B 1F 20 23 34 20 M 0D 0A

[0087] The situations where the POS terminal sends the second instruction to the label printer include but are not limited to the following two situations:

[0088] (1) No response message is received from the label printer within the reference time.

[0089] Before the method is executed, the POS terminal and the label printer can negotiate or configure a reference time, which refers to the time from when the POS terminal sends the print data packet of the order to when the POS terminal receives the label printing status of the printing completion sent by the label printer. After the POS terminal sends the print data packet of the first order, if the label printing status of the printing completion of the order sent by the label printer is not received within the reference time, the POS terminal sends the second instruction of the first order to the label printer. The reference time can be set based on experience and can also be flexibly adjusted according to the application scenario.

[0090] (2) The data channel recovers from the channel failure state to the channel normal state.

[0091] A data channel is established between the POS terminal and the label printer, and the data channel is used for the POS terminal to send and transmit print data packets to the label printer. During the process of the POS terminal sending the print data packet of the first order, if a failure occurs in the data channel, the POS terminal cannot determine whether the label printer has successfully received the print data packet of the first order. Therefore, the POS terminal can send a second instruction of the first order to the label printer to instruct the label printer to query the label printing status of the first order and send it to the POS terminal.

[0092] S204: The label printer sends a first response message of the first order to the POS terminal according to the second instruction.

[0093] The first response message carries the label printing status of the first order queried by the label printer. The label printing status of the first order queried by the label printer refers to the current label printing status of the first order queried by the label printer after receiving the second instruction.

[0094] The data structure of the first response message is shown in Table 5. The first response message includes the second message header, order identifier, printer status, label printing status, and number of labels. Among them, the second message header occupies 2 bytes, which is used to indicate that the message is a response message to the second instruction. For example: the instruction header is "FB". If the POS terminal receives a message whose message header is "FB", the POS terminal can determine that the message is a response message to the second instruction. The order identifier includes 4 bytes, which is used to indicate which order the response message is for. For example: if the order identifier is "M", it indicates that the response message is a response message for order M. The printer status includes 1 Byte, which refers to the current status of the printer. Among them, the printer status includes 5 states, namely: 0, 1, 2, 3, and 4. 0 indicates that the printer is in normal state, 1 indicates that the printer is in paper jam state, 2 indicates that the printer is out of paper state, 3 indicates that the printer is in pause state, and 4 indicates that the printer is printing. The label printing status includes 1 Byte, which can include 4 states: 0, 1, 2, and 3. 0 means that the label printer has not received the print data packet of order M, 1 means that the label printer has received the print data packet of order M but has not printed it, 2 means that the printing is successful, and 3 means that the printing fails. The number of labels occupies 1 Byte and is used to indicate the self-increment code of the label printer to print the label, that is, the number of labels that the label printer has printed.

[0095] Table 5

[0096]

[0097] S205. The POS terminal resends the print data packet of the first order to the label printer.

[0098] If the label printer does not receive the print data packet of the first order, it indicates that for some reason, the label printer did not receive the print data packet of the first order, and thus cannot print the order label corresponding to the first order. In this case, the POS terminal resends the print data packet of the first order to the label printer, so that the label printer can re-receive the print data packet of the first order, and re-print the order label based on the re-received print data packet, thereby avoiding missing orders.

[0099] Optionally, when the label printing status of the first order is that the label printer receives the print data packet of order M but does not print it, the POS terminal does not need to process it and only needs to wait for the label printer to print the order label.

[0100] In a possible application scenario, such as Figure 4 As shown, the POS terminal mainly executes the process including S301-S310. The label printer mainly executes the process including S401-S411.

[0101] S301. The POS terminal generates a print data packet of order M.

[0102] S302: The POS terminal sends a print data packet of order M to the printer.

[0103] S303: If a channel failure occurs in the data channel during the process of sending the print data packet of order M, the POS terminal sends a second instruction to the label printer when the data channel recovers to a normal state.

[0104] S304. The POS terminal determines whether the second response message is received within the reference time period. If not, execute S305; if yes, execute S307.

[0105] S305: The POS terminal sends a second instruction to the printer.

[0106] S306. The POS terminal determines whether the first response message is received within the reference time period. If not, the process returns to step S305; if yes, the process returns to step S308.

[0107] S307: The POS terminal reads the label printing status in the second response message.

[0108] S308. The POS terminal reads the label printing status in the first response message.

[0109] S309: The POS terminal determines that the label printing status is successful, and determines that the order label of order M is successfully printed.

[0110] S310: If the POS terminal determines that the label printing status is printing failure, or the label printing status is that the printing data packet of order M has not been received, the process returns to re-execute S302.

[0111] S401: The label printer receives a data stream sent by a POS terminal.

[0112] S402: The label printer determines the data type in the received data stream.

[0113] S403: The label printer determines that the data type is a CLS instruction, and clears the print content in the printer print buffer.

[0114] S404: The label printer determines that the data type is print content, and stores the print content in a print buffer.

[0115] S405. The label printer determines that the data type is the first instruction, prints the print content in the print buffer, and records the label printing status of order M.

[0116] S406: The label printer determines that the data type is the second instruction, and queries the label printing status corresponding to order M.

[0117] S407: The label printer sends a first response message to the POS terminal.

[0118] S408, detecting the working status of the label printer.

[0119] S409: When the working state of the label printer is in an abnormal state, stop printing the print content.

[0120] S410: When the working state of the label printer is restored from the abnormal state to the normal state, the print content included in the print data packet is reprinted.

[0121] S411. After printing is completed, a second response message is sent to the POS terminal.

[0122] In one possible implementation, Figure 5 As shown, the management system for label printing includes a POS terminal and a label printer, and the POS terminal and the label printer establish a communication connection through a wired network, USB or Bluetooth technology. Among them, the label printer includes a data receiving module, a message response module, a data processing center, a print buffer, an instruction rendering module, a label printing module, and a label printing status storage module. Among them, the data receiving module is used to receive the data stream sent by the POS terminal, wherein the data stream includes the above-mentioned print data packet and the second instruction. The data processing center processes the received data stream, stores the print content in the print data packet into the print buffer, and sends the first instruction in the print data packet to the instruction rendering module. The instruction rendering module reads the print content from the print buffer based on the first instruction and performs typesetting and rendering. Then, the print content after typesetting and rendering is sent to the label printing module, and the label printing module prints. At the same time, the data processing center sends the order identifier to the label printing status storage module, and the label printing status storage module obtains the label printing status from the label printing module and stores the label printing status corresponding to the order identifier. After the data processing center receives the second instruction, or after the label printing module finishes printing, the data processing center reads the label printing status corresponding to the order identifier from the label printing status storage module and sends it to the message response module. The message response module generates a response message based on the label printing status corresponding to the order identifier and sends it to the POS terminal.

[0123] See also Figure 6, an embodiment of the present application provides a label printing management device, the label printing management device 600 includes: a first receiving module 601, used to receive a print data packet of a first order sent by a POS terminal, the print data packet includes print content and a first instruction, the first instruction is used to instruct the label printer to print the print content to form an order label, and record the label printing status of the first order; a first sending module 602, used to send a response message of the first order to the POS terminal, the response message carries the label printing status of the first order, and the label printing status is used to indicate whether the POS terminal resends the print data packet of the first order.

[0124] In one possible implementation, the first receiving module 601 is also used to receive a second instruction sent by the POS terminal, where the second instruction is used to instruct the label printer to query the label printing status of the first order; the first sending module 602 is also used to send a first response message of the first order to the POS terminal according to the second instruction, and the first response message carries the label printing status of the first order queried by the label printer.

[0125] In a possible implementation, the print data packet further includes: a clear instruction, where the clear instruction is used to instruct the label printer to clear the print content stored in the print buffer.

[0126] In a possible implementation, the first instruction includes a first instruction header and an instruction order identifier, the first instruction header is used to indicate the category of the first instruction, and the instruction order identifier is used to indicate the order associated with the first instruction.

[0127] In one possible implementation, the response message includes a message header, a message order identifier, a printer status, a label printing status, and the number of labels; the message header is used to indicate the category of the response message; the message order identifier is used to indicate the order associated with the response message; the printer status refers to the working status of the label printer; the label printing status refers to the processing status of the print data packet by the label printer; the number of labels refers to the number of order labels that the label printer has printed.

[0128] In one possible implementation, the device also includes: a reprint module, which is used to detect the working status of the label printer; when the working status of the label printer is in an abnormal device state, stop printing the print content; when the working status of the label printer is restored from the abnormal device state to the normal device state, reprint the print content included in the print data packet.

[0129] See also Figure 7, an embodiment of the present application provides a label printing management device, the label printing management device 700 includes: a second sending module 701, used to send a print data packet of a first order to a label printer, the print data packet includes print content and a first instruction, the first instruction is used to instruct the label printer to print the print content to form an order label, and record the label printing status of the first order; a second receiving module 702, used to receive a response message of the first order sent by the label printer, the response message carries the label printing status of the first order; the second sending module 701 is also used to resend the print data packet of the first order to the label printer when the label printing status indicates to resend the print data packet of the first order.

[0130] In one possible implementation, the second sending module 701 is also used to resend the print data packet of the first order to the label printer when the label printing status of the first order meets the resending condition; the label printing status of the first order meets the resending condition, including at least one of the following: the label printing status of the first order is that the print data packet of the first order has not been received; the label printing status of the first order is printing failure.

[0131] In one possible implementation, the second sending module 701 is also used to send a second instruction for the first order to the label printer when a query condition is met, and the second instruction is used to instruct the label printer to query the label printing status of the first order; the query condition includes at least one of the following: no response message sent by the label printer is received within a preset time period; the data channel recovers from a channel failure state to a channel normal state, and the data channel is a data channel for the terminal to send a print data packet to the label printer.

[0132] It should be noted that the device provided in the above embodiment only uses the division of the above functional modules as an example to implement its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0133] Figure 8It is a structural diagram of a label printing management device provided in an embodiment of the present application. The label printing management device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 801 and one or more memories 802, wherein the one or more memories 802 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 801, so that the device implements the label printing management method provided in the above-mentioned various method embodiments. Of course, the device may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The device may also include other components for realizing the functions of the device, which will not be repeated here.

[0134] Fig. 9 1 is a schematic diagram of a management device structure for label printing provided in an embodiment of the present application. The device may be a terminal, such as a smart phone, a tablet computer, a laptop computer, or a desktop computer. The terminal may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal, or other names.

[0135] Typically, the terminal includes: a processor 901 and a memory 902 .

[0136] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (central processing unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (graphics processing unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (artificial intelligence) processor, which is used to process computing operations related to machine learning.

[0137] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 so that the terminal implements the label printing management method provided in the method embodiment of the present application.

[0138] In some embodiments, the terminal may further optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907 and a power supply 908.

[0139] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (input / output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0140] The radio frequency circuit 904 is used to receive and transmit RF (radio frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (wireless fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (near fField communication), which is not limited in this application.

[0141] The display screen 905 is used to display a UI (user interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, which is set on the front panel of the terminal; in other embodiments, the display screen 905 can be at least two, which are respectively set on different surfaces of the terminal or are folded; in other embodiments, the display screen 905 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (liquid crystal display), OLED (organic light-emitting diode), etc.

[0142] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0143] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.

[0144] The power supply 908 is used to power various components in the terminal. The power supply 908 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 908 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0145] In some embodiments, the terminal further includes one or more sensors 909 , including but not limited to: an acceleration sensor 910 , a gyroscope sensor 911 , a pressure sensor 912 , an optical sensor 913 , and a proximity sensor 914 .

[0146] The acceleration sensor 910 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor 910 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 910. The acceleration sensor 910 can also be used for collecting game or user motion data.

[0147] The gyro sensor 911 can detect the body direction and rotation angle of the terminal, and the gyro sensor 911 can cooperate with the acceleration sensor 910 to collect the user's 3D actions on the terminal. The processor 901 can implement the following functions based on the data collected by the gyro sensor 911: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0148] The pressure sensor 912 can be set in the side frame of the terminal and / or the lower layer of the display screen 905. When the pressure sensor 912 is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 912. When the pressure sensor 912 is set in the lower layer of the display screen 905, the processor 901 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0149] The optical sensor 913 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 according to the ambient light intensity collected by the optical sensor 913. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 913.

[0150] The proximity sensor 914, also known as a distance sensor, is usually arranged on the front panel of the terminal. The proximity sensor 914 is used to collect the distance between the user and the front of the terminal. In one embodiment, when the proximity sensor 914 detects that the distance between the user and the front of the terminal is gradually decreasing, the processor 901 controls the display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 914 detects that the distance between the user and the front of the terminal is gradually increasing, the processor 901 controls the display screen 905 to switch from the screen-off state to the screen-on state.

[0151] Those skilled in the art will understand that Fig. 9 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0152] In an exemplary embodiment, a label printing management device is also provided, the label printing management device includes a processor and a memory, and the memory stores at least one computer program. The at least one computer program is loaded and executed by one or more processors to enable the computer device to implement any of the above label printing management methods.

[0153] In an exemplary embodiment, a storage medium is also provided, which may be a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor of a computer device so that the computer implements any of the above-mentioned label printing management methods.

[0154] In one possible implementation, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0155] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the above-mentioned label printing management methods.

[0156] The present application also provides a label printing management system, which includes a label printer and a terminal. The label printer is used to execute the following steps: Figure 2-Figure 4 In any of the above methods for managing label printing, the functions performed by the label printer are performed by the terminal as follows: Figure 2-Figure 4 The functions performed by the terminal or POS terminal in any of the label printing management methods.

[0157] It should be noted that the data (including but not limited to order content, print content, print data package, etc.) and instructions (including but not limited to the first instruction and the second instruction) involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the print data package, first instruction, second instruction, etc. involved in this application are all obtained with full authorization.

[0158] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0159] It should be noted that the terms "first", "second", etc. (if any) in the specification and claims of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0160] The above are merely exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A label printing management method, characterized in that: The method is applied to a label printer, the label printer is connected to a terminal, and the method comprises: receiving a print data packet of a first order sent by the terminal, wherein the print data packet includes print content, a first instruction, and a clear instruction, wherein the first instruction is used to instruct the label printer to print the print content to form an order label and record the label printing status of the first order, and the clear instruction is used to instruct the label printer to clear the print content stored in the print buffer; Determine whether the data in the received print data packet is the clear instruction, if it is the clear instruction, clear the content in the print buffer, if it is not the clear instruction, determine whether the data is the print content, if it is the print content, store the print content in the print buffer, and perform print typesetting, if it is not the print content, determine whether it is the first instruction, if it is the first instruction, read the order identifier from the first instruction, and record the label printing status corresponding to the order identifier; When receiving the first instruction, the label printing status corresponding to the first order identifier is recorded as receiving the print data packet of the first order but not printing it, and after the printing process of the first order, the label printing status corresponding to the first order is recorded in sequence; Sending a second response message of the first order to the terminal according to the first instruction, wherein the second response message is a response message generated by the label printer and sent to the terminal when the label printing status of the first order is printing completed; receiving a second instruction sent by the terminal, wherein the second instruction is used to instruct the label printer to query the label printing status of the first order, and is sent by the terminal to the label printer when a query condition is met, and the query condition includes at least one of the following: no response message sent by the label printer is received within a reference time period; a data channel is restored from a channel failure state to a channel normal state, and the data channel is a data channel through which the terminal sends the print data packet to the label printer; According to the second instruction, a first response message of the first order is sent to the terminal, and the first response message carries the label printing status of the first order queried by the label printer, and the label printing status is used to indicate whether the terminal resends the print data packet of the first order.

2. The method according to claim 1, characterized in that: The first instruction includes a first instruction header and an instruction order identifier; The first instruction header is used to indicate the category of the first instruction, and the instruction order identifier is used to indicate the order associated with the first instruction.

3. The method according to claim 1, characterized in that The response message includes a message header, a message order identifier, a printer status, a label printing status, and the number of labels; The message header is used to indicate the category of the response message; the message order identifier is used to indicate the order associated with the response message; the printer status refers to the working status of the label printer; the label printing status refers to the processing status of the print data packet by the label printer, and the processing status is used to indicate whether the terminal resends the print data packet of the first order; the number of labels refers to the number of order labels printed by the label printer.

4. The method according to claim 1, characterized in that: The method further comprises: Detecting the working status of the label printer; When the working state of the label printer is in an abnormal state, stop printing the print content; When the working state of the label printer is restored from the abnormal state to the normal state, the print content included in the print data packet is reprinted.

5. A label printing management method, characterized in that: The method is applied to a terminal, the terminal is connected to a label printer, and the method comprises: A print data packet of a first order is sent to the label printer, wherein the print data packet includes print content, a first instruction, and a clear instruction, wherein the first instruction is used to instruct the label printer to print the print content to form an order label and record the label printing status of the first order, and the clear instruction is used to instruct the label printer to clear the print content stored in the print buffer, so that the label printer receiving the print data packet performs the following operations: Determine whether the data in the received print data packet is the clear instruction, if it is the clear instruction, clear the content in the print buffer, if it is not the clear instruction, determine whether the data is the print content, if it is the print content, store the print content in the print buffer for printing and typesetting, if it is not the print content, determine whether it is the first instruction, if it is the first instruction, read the order identifier from the first instruction, and record the label printing status corresponding to the order identifier, when the first instruction is received, record the label printing status corresponding to the first order identifier as receiving the print data packet of the first order but not printing, and after the order printing process, record the label printing status corresponding to the order in sequence; receiving a second response message of the first order sent by the label printer, wherein the second response message is a response message generated by the label printer and sent to the terminal when the label printing status of the first order is printing completed; When the query condition is met, sending a second instruction of the first order to the label printer, wherein the second instruction is used to instruct the label printer to query the label printing status of the first order; The query condition includes at least one of the following: No response message sent by the label printer is received within the reference time period; The data channel is restored from a channel failure state to a channel normal state, and the data channel is the data channel through which the terminal sends the print data packet to the label printer; receiving a first response message of the first order sent by the label printer, wherein the response message carries a label printing status of the first order, and the label printing status is used to indicate whether the terminal resends a print data packet of the first order; When the label printing status indicates to resend the print data packet of the first order, the print data packet of the first order is resent to the label printer.

6. A label printing management system, characterized in that: The system comprises a label printer and a terminal, wherein the label printer is used to execute the label printing management method according to any one of claims 1 to 4, and the terminal is used to execute the label printing management method according to claim 5.

7. A label printing management device, characterized in that: The label printing management device includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the label printing management device implements the label printing management method as described in any one of claims 1 to 4, or the label printing management method as described in claim 5.