POS terminal Bluetooth printing method, system and device and storage medium
By combining Bluetooth communication protocol and ESC/POS protocol, wireless connection and data processing between POS terminal and printer are realized, which solves the problem of insufficient convenience of wired printing method and limitations of wireless printing method, and improves the flexibility and convenience of printing.
Patent Information
- Application Number
- CN202410514477.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2024-08-30
AI Technical Summary
Existing wired printing methods cannot meet convenience needs, and wireless printing methods lack support for the ESC/POS command set, resulting in limitations when printing special formats or complex content.
By combining the Bluetooth communication protocol and the ESC/POS protocol, the wireless connection between the POS terminal and the printer is realized, generating and sending ESC/POS instructions, parsing and executing printing operations, including data processing and error handling to ensure printing quality and stability.
It improves the flexibility and convenience of printing, meets users' convenience needs, maintains the original functions of the ESC/POS protocol, does not require large-scale changes to existing equipment and software, and solves the limitations of wireless printing.
Smart Images

Figure CN118567585A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of POS terminal printing technology, and in particular to a POS terminal Bluetooth printing method, system, device and storage medium. Background Art
[0002] With the popularization of mobile devices and the development of wireless communication technology, more and more scenarios require the realization of mobile printing functions. In the current electronic printing technology, the ESC / POS (Electronic Standard Commands for Printers) protocol is a widely used printer control language protocol. The traditional ESC / POS protocol mainly communicates with the printer through a wired connection (such as serial port, USB, etc.), which is inconvenient in some occasions that require mobile printing or wireless connection. The traditional wired printing method is limited by the cable length and interface compatibility, and cannot meet the user's convenience needs. Bluetooth printing technology, with its wireless, high-speed, and low-power characteristics, has gradually become the mainstream choice for mobile printing. However, existing Bluetooth printing solutions often lack support for the ESC / POS instruction set, resulting in limitations when printing special formats or complex content. Summary of the invention
[0003] The main purpose of the present invention is to provide a POS terminal Bluetooth printing method, system, device and storage medium, aiming to solve the problems that the existing wired printing method cannot meet the convenience requirements and the wireless printing method has usage limitations.
[0004] To achieve the above object, the present invention provides a POS terminal Bluetooth printing method, comprising:
[0005] Establish a connection with the printer based on the Bluetooth communication protocol;
[0006] When receiving a print request signal, generating an ESC / POS instruction according to the print request signal;
[0007] The ESC / POS command is sent to the printer based on the Bluetooth communication protocol, so that the printer parses and converts the ESC / POS command through a parsing module and executes a corresponding printing operation.
[0008] In some embodiments, upon receiving a print request signal, generating an ESC / POS instruction according to the print request signal includes:
[0009] When receiving a print request signal, determining the content to be printed according to the print request signal;
[0010] The content to be printed is converted into ESC / POS instructions.
[0011] In some embodiments, the printer parses and converts the ESC / POS instruction through a parsing module and performs a corresponding printing operation, including:
[0012] The printer parses the ESC / POS command through an ESC / POS command parsing module to convert the ESC / POS command into a printer operation command;
[0013] Receiving the data to be printed through the data processing module and performing data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment;
[0014] A corresponding printing operation is performed on the target printing data based on the printer operation instruction.
[0015] In some embodiments, the method further comprises:
[0016] When a printing error signal is received during the printing process, an error handling operation is performed based on the printing error signal through the error handling module; wherein the error handling operation includes re-establishing the connection and re-sending the ESC / POS command.
[0017] In addition, to achieve the above-mentioned purpose, the present invention also proposes a POS terminal Bluetooth printing system, comprising: a mobile device and a printer; wherein,
[0018] The mobile device comprises a Bluetooth communication module, which is used to establish a connection with the printer based on the Bluetooth communication protocol, generate an ESC / POS instruction according to the print request signal when receiving a print request signal, and send the ESC / POS instruction to the printer based on the Bluetooth communication protocol;
[0019] The printer includes a parsing module for parsing and converting the ESC / POS instructions and executing corresponding printing operations.
[0020] In some embodiments, the mobile device includes a POS terminal, the Bluetooth communication module includes an ESC / POS Bluetooth printing driver, and the ESC / POS Bluetooth printing driver is used to convert ESC / POS instructions into signals recognizable by the Bluetooth protocol.
[0021] In some embodiments, the printer includes an ESC / POS instruction parsing module and a data processing module; wherein,
[0022] The data processing module is used to receive the data to be printed and perform data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment;
[0023] The ESC / POS instruction parsing module is used to parse the ESC / POS instruction to convert the ESC / POS instruction into a printer operation instruction; and to perform a corresponding printing operation on the target printing data based on the printer operation instruction.
[0024] In some embodiments, the mobile device further comprises an error handling module for performing an error handling operation based on a printing error signal when the printing error signal is received during the printing process; wherein the error handling operation comprises re-establishing a connection and resending an ESC / POS instruction.
[0025] In addition, to achieve the above-mentioned purpose, the present invention also proposes an electronic device, which includes: a memory, a processor, and a POS terminal Bluetooth printing program stored in the memory and executable on the processor, wherein the POS terminal Bluetooth printing program is configured to implement the POS terminal Bluetooth printing program method as described above.
[0026] In addition, to achieve the above purpose, the present invention also proposes a storage medium, which stores a POS terminal Bluetooth printing program, and the POS terminal Bluetooth printing program is used to enable a processor to implement the POS terminal Bluetooth printing program method as described above when executed.
[0027] The present invention provides a POS terminal Bluetooth printing method, comprising: establishing a connection with a printer based on a Bluetooth communication protocol; generating an ESC / POS instruction according to the print request signal when a print request signal is received; sending the ESC / POS instruction to the printer based on the Bluetooth communication protocol, so that the printer parses and converts the ESC / POS instruction through a parsing module and performs a corresponding printing operation. The present invention realizes wireless connection and mobile printing of the printer by combining the ESC / POS protocol with Bluetooth technology, thereby improving the flexibility and convenience of printing. At the same time, the method maintains the original printing function of the ESC / POS protocol, does not require large-scale changes to existing printing equipment and software, and has strong practicality, thereby solving the problems that the existing wired printing method cannot meet the convenience requirements and the wireless printing method has usage limitations. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of a flow chart of an embodiment of a POS terminal Bluetooth printing method of the present invention;
[0030] Figure 3This is a structural block diagram of an embodiment of a POS terminal Bluetooth printing system of the present invention.
[0031] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0034] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0035] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of an electronic device of the hardware operating environment involved in the embodiment of the present invention.
[0036] like Figure 1As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM memory) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0037] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0038] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a POS terminal Bluetooth printing program.
[0039] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the POS terminal Bluetooth printing program stored in the memory 1005 through the processor 1001, and executes the POS terminal Bluetooth printing method provided by the embodiment of the present invention.
[0040] With the popularization of mobile devices and the development of wireless communication technology, more and more scenes need to realize the mobile printing function. In the current electronic printing technology, the ESC / POS protocol is a widely used printer control language protocol. The traditional ESC / POS protocol mainly communicates with the printer through a wired connection mode (such as a serial port, USB, etc.), which is inconvenient in some occasions where mobile printing or wireless connection is required. The traditional wired printing mode is limited by the cable length and interface compatibility, and cannot meet the convenience requirements of users. The Bluetooth printing technology, with its wireless, high-speed, low-power characteristics, has gradually become the mainstream choice for mobile printing. However, the existing Bluetooth printing scheme often lacks support for the ESC / POS instruction set, resulting in limitations when printing special formats or complex content. Therefore, the present invention develops a POS terminal Bluetooth printing method, system, device and storage medium based on the ESC / POS protocol, which has important practical significance and application value.
[0041] The present invention provides a POS terminal Bluetooth printing method, system, equipment and storage medium.
[0042] The embodiment of the present invention provides a POS terminal Bluetooth printing method, referring to Figure 2 , Figure 2 The figure is a flow chart of an embodiment of a POS terminal Bluetooth printing method of the present invention.
[0043] like Figure 2 As shown, the POS terminal Bluetooth printing method includes:
[0044] Step S100: Establishing a connection with a printer based on the Bluetooth communication protocol;
[0045] Step S200: upon receiving a print request signal, generating an ESC / POS instruction according to the print request signal;
[0046] Step S300: sending the ESC / POS command to the printer based on the Bluetooth communication protocol, so that the printer parses and converts the ESC / POS command through a parsing module and executes a corresponding printing operation.
[0047] It should be noted that the execution subject in this embodiment may be an electronic device (mobile device), which may be a computer device with data processing capabilities, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment, the electronic device is taken as a POS terminal for example.
[0048] Specifically, a connection is established with the printer based on the Bluetooth communication protocol: a mobile device such as a POS terminal establishes a connection with the printer through a Bluetooth communication module to ensure that the communication channel between the two is unobstructed to achieve stable data transmission.
[0049] In one embodiment, when a print request signal is received, an ESC / POS instruction is generated according to the print request signal, including: when a print request signal is received, determining the content to be printed according to the print request signal; and converting the content to be printed into an ESC / POS instruction.
[0050] Specifically, an ESC / POS Bluetooth printing driver is installed in a mobile device such as a POS terminal, and the ESC / POS Bluetooth printing driver is used to convert ESC / POS instructions into signals recognizable by the Bluetooth protocol; the mobile device establishes a connection with the printer via the Bluetooth protocol; the mobile device converts the content to be printed into ESC / POS instructions and sends them to the printer via the Bluetooth protocol.
[0051] In one embodiment, the printer parses and converts the ESC / POS instructions through a parsing module and executes corresponding printing operations, including: the printer parses the ESC / POS instructions through an ESC / POS instruction parsing module to convert the ESC / POS instructions into printer operation instructions; receives the data to be printed through a data processing module and performs data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment; and executes corresponding printing operations on the target printing data based on the printer operation instructions.
[0052] Specifically, the printer receives and parses the ESC / POS instructions sent by the mobile device (POS terminal) to perform printing operations. The printer is equipped with an ESC / POS instruction parsing module, which is responsible for parsing the ESC / POS instructions sent from the mobile device (POS terminal) and converting the ESC / POS instructions into internal instructions that the printer can recognize, thereby controlling various operations of the printer, such as printing content, paper cutting, printing speed, etc.
[0053] Specifically, the printer is also provided with a data processing module, which is responsible for processing the print data received from the mobile device, including data format conversion, encoding adjustment, etc., to ensure that the printed content meets expectations.
[0054] In one embodiment, the method further includes: when a printing error signal is received during the printing process, performing an error handling operation based on the printing error signal by an error handling module; wherein the error handling operation includes reestablishing a connection and resending an ESC / POS instruction.
[0055] Specifically, a mobile device such as a POS terminal is provided with an error handling module, which is used to handle various errors in the communication process, such as connection interruption, instruction error, etc., to ensure the stability and reliability of the printing process.
[0056] It can be understood that in this embodiment, the organic combination of the Bluetooth communication module and the ESC / POS instruction parsing module enables the mobile device (POS terminal) to conveniently send various ESC / POS instructions to achieve complex printing requirements. At the same time, with the assistance of the data processing module and the error handling module, the accuracy and stability of the printing process are guaranteed.
[0057] In one example, the POS terminal Bluetooth printing method described in this embodiment adopts the Bluetooth printing technology based on the ESC / POS instruction set. In specific implementation, it can be achieved by the following steps:
[0058] Step 1: The mobile device (POS terminal) establishes a connection with the printer through the Bluetooth communication module to ensure that the communication channel between the two is unobstructed.
[0059] Step 2: The mobile device generates corresponding ESC / POS instructions according to the printing requirements and sends them to the printer via the Bluetooth communication module.
[0060] Step 3: After the printer receives the ESC / POS command, it parses it through the ESC / POS command parsing module, converts it into internal commands, and executes the corresponding printing operation.
[0061] Step 4: During the printing process, the data processing module processes the received printing data to ensure the accuracy and readability of the printed content.
[0062] Step 5: If an error occurs during the printing process, the error handling module will capture and process it in time, such as re-establishing the connection, re-sending the command, etc., to ensure the smooth progress of the printing process.
[0063] Through the above implementation methods, the POS terminal Bluetooth printing method described in this embodiment adopts Bluetooth printing technology based on the ESC / POS instruction set. This technology combines Bluetooth wireless communication technology and ESC / POS printing instructions to achieve seamless connection and efficient printing between mobile devices and printers. It can achieve efficient and stable communication between mobile devices (POS terminals) and printers, and meet users' requirements for various printing needs.
[0064] It is understandable that in actual specific application scenarios, the POS terminal Bluetooth printing method based on ESC / POS instructions in this embodiment can be applied to the merchant acquiring application to print receipts. The specific process of the POS terminal Bluetooth printing method described in this embodiment is described using an embodiment applied to the merchant acquiring application on the POS terminal:
[0065] Specifically, when a merchant uses an acquiring application to print a receipt for a consumer, the acquiring application will follow these steps:
[0066] Step 1: The acquiring application establishes a connection with the printer via the Bluetooth protocol. During the connection process, the printer needs to turn on the Bluetooth receiving function and set it to be searchable. After searching for the printer, create a Bluetooth channel connection.
[0067] Step 3: The acquiring application converts the content to be printed into ESC / POS instructions and sends them to the printer via Bluetooth protocol. The user can choose to print the entire document or print certain parts of the document.
[0068] Step 4: The printer receives and interprets the ESC / POS command and performs the printing operation. During the printing process, the printer converts the file into physical characters according to the command and prints the paper one by one.
[0069] Through the above steps, the POS terminal Bluetooth printing method based on ESC / POS instructions in this embodiment can realize the printing of receipts by acquiring applications, thereby improving the flexibility and convenience of printing.
[0070] It should be noted that the advantage of the POS terminal Bluetooth printing method described in this embodiment lies in its strong flexibility and adaptability, and it can be personalized according to different printing needs. First, users (such as merchants using POS terminals) can print, copy and transmit bills anytime and anywhere through the POS terminal, which greatly improves work efficiency. Secondly, for complex printing tasks, the ESC / POS protocol ensures the accuracy and efficiency of instructions and ensures the quality of print output. In addition, the POS terminal Bluetooth printing method described in this embodiment also makes full use of the convenience of Bluetooth technology, and can quickly establish a connection even in a small space, truly realizing "connect and use", reducing the tedious steps of user installation and debugging. It is understandable that the "merchant acquiring application" and similar expressions involved in this embodiment refer to mobile applications or software drivers developed by Internet companies and provided to merchants for installation in mobile devices such as mobile phones and POS terminals for printing.
[0071] It is understandable that in terms of security performance, users can set printing permissions according to actual conditions, and only mobile devices that have been legally authenticated, such as handheld POS devices, can communicate with the printer. The security mechanism helps prevent illegal access and data leakage, ensuring the security and controllability of merchants' printing resources. In order to better meet the printing needs of different industries and different scenarios, the POS terminal Bluetooth printing method described in this embodiment also supports compatible printing of multiple file formats, covering almost all common printing needs. At the same time, the Bluetooth printing method based on the ESC / POS protocol has excellent customizability, and users can flexibly adjust the printing settings according to their own needs. Whether it is special paper type, print quality requirements, or personalized print content, a full range of solutions can be provided. In terms of environmental protection and energy saving, the POS terminal Bluetooth printing method described in this embodiment also embodies the green concept, adopts advanced energy-saving technology and algorithms, effectively reduces energy consumption during printing, and meets the sustainable development needs in modern office environments.
[0072] In practical applications, the Bluetooth printing method based on the ESC / POS protocol in this embodiment can achieve highly flexible and adaptable printing, which can not only solve the problem of merchant collection bill printing, but also has significant convenience and efficiency, truly realizing "one-touch printing", and facilitating merchants to upgrade their collection to intelligentization.
[0073] The present embodiment provides a POS terminal Bluetooth printing method, including: establishing a connection with a printer based on a Bluetooth communication protocol; generating an ESC / POS instruction according to the print request signal when a print request signal is received; sending the ESC / POS instruction to the printer based on the Bluetooth communication protocol, so that the printer parses and converts the ESC / POS instruction through a parsing module and performs a corresponding printing operation. The present embodiment of the method combines the ESC / POS protocol with Bluetooth technology to achieve wireless connection and mobile printing of the printer, thereby improving the flexibility and convenience of printing. At the same time, the method maintains the original printing function of the ESC / POS protocol, does not require large-scale changes to existing printing equipment and software, and has strong practicality, thereby solving the problems that the existing wired printing method cannot meet the convenience requirements and the wireless printing method has usage limitations.
[0074] In addition, an embodiment of the present invention further provides a storage medium, on which a POS terminal Bluetooth printing program is stored. When the POS terminal Bluetooth printing program is executed by a processor, the steps of the POS terminal Bluetooth printing method described above are implemented.
[0075] Reference Figure 3 , Figure 3 This is a structural block diagram of an embodiment of a POS terminal Bluetooth printing system of the present invention.
[0076] like Figure 3 As shown, the POS terminal Bluetooth printing system includes: a mobile device and a printer; wherein,
[0077] The mobile device comprises a Bluetooth communication module, which is used to establish a connection with the printer based on the Bluetooth communication protocol, generate an ESC / POS instruction according to the print request signal when receiving a print request signal, and send the ESC / POS instruction to the printer based on the Bluetooth communication protocol;
[0078] The printer includes a parsing module for parsing and converting the ESC / POS instructions and executing corresponding printing operations.
[0079] In one embodiment, the printer includes an ESC / POS instruction parsing module and a data processing module; wherein,
[0080] The data processing module is used to receive the data to be printed and perform data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment;
[0081] The ESC / POS instruction parsing module is used to parse the ESC / POS instruction to convert the ESC / POS instruction into a printer operation instruction; and to perform a corresponding printing operation on the target printing data based on the printer operation instruction.
[0082] In one embodiment, the mobile device further includes an error handling module for performing an error handling operation based on a printing error signal when the printing error signal is received during the printing process; wherein the error handling operation includes re-establishing a connection and resending an ESC / POS instruction.
[0083] It should be noted that the purpose of the present invention is to provide a POS terminal Bluetooth printing system, which adopts Bluetooth printing technology based on the ESC / POS protocol. This technology combines Bluetooth wireless communication technology and ESC / POS printing instructions to achieve seamless connection and efficient printing between mobile devices and printers.
[0084] Specifically, the POS terminal Bluetooth printing system includes the following modules:
[0085] 1. Bluetooth communication module: The Bluetooth communication module is responsible for establishing and maintaining the Bluetooth connection between the mobile device (POS terminal) and the printer to ensure stable data transmission.
[0086] 2. ESC / POS command parsing module: The ESC / POS command parsing module is responsible for parsing the ESC / POS commands sent from the mobile device and converting the ESC / POS commands into internal commands that the printer can recognize, thereby controlling various operations of the printer, such as printing content, paper cutting, printing speed, etc.
[0087] 3. Data processing module: The data processing module is responsible for processing the printing data received from the mobile device, including data format conversion, encoding adjustment, etc., to ensure that the printed content meets expectations.
[0088] 4. Error handling module: This error handling module is used to handle various errors in the communication process, such as connection interruption, command error, etc., to ensure the stability and reliability of the printing process.
[0089] In this embodiment, the Bluetooth communication module and the ESC / POS instruction parsing module are organically combined to enable the mobile device (POS terminal) to conveniently send various ESC / POS instructions to achieve complex printing requirements. At the same time, with the assistance of the data processing module and the error handling module, the accuracy and stability of the printing process are guaranteed.
[0090] In one embodiment, the mobile device includes a POS terminal, and the Bluetooth communication module includes an ESC / POS Bluetooth printing driver, and the ESC / POS Bluetooth printing driver is used to convert ESC / POS instructions into signals recognizable by the Bluetooth protocol.
[0091] Specifically, an ESC / POS Bluetooth printing driver is installed in a mobile device such as a POS terminal, and the ESC / POS Bluetooth printing driver is used to convert ESC / POS instructions into signals recognizable by the Bluetooth protocol; the mobile device establishes a connection with the printer via the Bluetooth protocol; the mobile device converts the content to be printed into ESC / POS instructions and sends them to the printer via the Bluetooth protocol.
[0092] The present embodiment provides a POS terminal Bluetooth printing system, comprising: a mobile device and a printer; wherein the mobile device comprises a Bluetooth communication module, which is used to establish a connection with the printer based on the Bluetooth communication protocol, and when receiving a print request signal, generates an ESC / POS instruction according to the print request signal, and sends the ESC / POS instruction to the printer based on the Bluetooth communication protocol; the printer comprises a parsing module, which is used to parse and convert the ESC / POS instruction and perform corresponding printing operations. The system of the present embodiment realizes wireless connection and mobile printing of the printer by combining the ESC / POS protocol with Bluetooth technology, thereby improving the flexibility and convenience of printing. At the same time, the system maintains the original printing function of the ESC / POS protocol, does not require large-scale changes to existing printing equipment and software, and has strong practicality, thereby solving the problems that the existing wired printing method cannot meet the convenience requirements and the wireless printing method has usage limitations.
[0093] It should be noted that the technical details not fully described in the embodiment of the POS terminal Bluetooth printing system can be found in the POS terminal Bluetooth printing method described above provided in any embodiment of the present invention, and will not be repeated here.
[0094] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0095] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0096] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0097] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0099] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A POS terminal Bluetooth printing method, characterized in that: include: Establish a connection with the printer based on the Bluetooth communication protocol; When receiving a print request signal, generating an ESC / POS instruction according to the print request signal; The ESC / POS command is sent to the printer based on the Bluetooth communication protocol, so that the printer parses and converts the ESC / POS command through a parsing module and executes a corresponding printing operation.
2. The method according to claim 1, characterized in that When receiving a print request signal, generating an ESC / POS instruction according to the print request signal includes: When receiving a print request signal, determining the content to be printed according to the print request signal; The content to be printed is converted into ESC / POS instructions.
3. The method according to claim 1, characterized in that The printer parses and converts the ESC / POS command through a parsing module and performs a corresponding printing operation, including: The printer parses the ESC / POS command through an ESC / POS command parsing module to convert the ESC / POS command into a printer operation command; Receiving the data to be printed through the data processing module and performing data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment; A corresponding printing operation is performed on the target printing data based on the printer operation instruction.
4. The method according to claim 1, characterized in that The method further comprises: When a printing error signal is received during the printing process, an error handling operation is performed based on the printing error signal by the error handling module; wherein the error handling operation includes re-establishing a connection and re-sending an ESC / POS instruction.
5. A POS terminal Bluetooth printing system, characterized in that: include: Mobile devices and printers; The mobile device comprises a Bluetooth communication module, which is used to establish a connection with the printer based on the Bluetooth communication protocol, generate an ESC / POS instruction according to the print request signal when receiving a print request signal, and send the ESC / POS instruction to the printer based on the Bluetooth communication protocol; The printer includes a parsing module for parsing and converting the ESC / POS instructions and executing corresponding printing operations.
6. The system according to claim 5, characterized in that The mobile device comprises a POS terminal, and the Bluetooth communication module comprises an ESC / POS Bluetooth printing driver, and the ESC / POS Bluetooth printing driver is used for converting ESC / POS instructions into signals recognizable by the Bluetooth protocol.
7. The system according to claim 5, characterized in that The printer includes an ESC / POS instruction parsing module and a data processing module; wherein, The data processing module is used to receive the data to be printed and perform data processing operations on the data to be printed to obtain target printing data; wherein the data processing operations include data format conversion and encoding adjustment; The ESC / POS instruction parsing module is used to parse the ESC / POS instruction to convert the ESC / POS instruction into a printer operation instruction; and to perform a corresponding printing operation on the target printing data based on the printer operation instruction.
8. The system according to claim 5, characterized in that The mobile device further comprises an error handling module, which is used to perform an error handling operation based on a printing error signal when a printing error signal is received during the printing process; wherein the error handling operation comprises re-establishing a connection and re-sending an ESC / POS instruction.
9. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a POS terminal Bluetooth printing program stored in the memory and executable on the processor, wherein the POS terminal Bluetooth printing program is configured to implement the POS terminal Bluetooth printing method according to any one of claims 1 to 4.
10. A storage medium, characterized in that: The storage medium stores a POS terminal Bluetooth printing program, and the POS terminal Bluetooth printing program is used to enable the processor to implement the POS terminal Bluetooth printing method according to any one of claims 1 to 4 when executed.
Citation Information
Cited By
Data printing method and device, electronic equipment and computer storage medium
CN120029566A
Data printing method and device, electronic equipment and computer storage medium
CN120029566B
Printing control method and device and electronic equipment
CN121541840A
