Data printing method, POS terminal and device

By establishing a communication protocol between POS terminals, the data to be printed is sent from the POS terminal without printing function to the POS terminal with printing function for printing, solving the problem of bulky and high performance requirements of the existing POS terminals, and achieving efficient data printing.

CN119937942APending Publication Date: 2025-05-06SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411771111.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Existing POS terminals need to carry printing functions when printing receipts, which leads to bulky and inconvenient. The same terminal needs to have checkout and printing functions at the same time, which adds performance requirements.

Method used

By establishing a communication protocol between POS terminals of different functions, the data to be printed is encapsulated by the first POS terminal without the printing function and sent to the second POS terminal with the printing function for printing.

Benefits of technology

The time for data printing is reduced, printing efficiency is improved, the requirements for the performance of the first POS terminal are reduced, and information interaction between POS terminals is facilitated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119937942A_ABST
    Figure CN119937942A_ABST
Patent Text Reader

Abstract

The invention discloses a data printing method, a POS terminal and a data printing device, which are used for reducing data printing time. The method comprises the steps of obtaining to-be-printed data, wherein the to-be-printed data carries an identifier of a first POS terminal; the to-be-printed data are packaged, wherein the packaged to-be-printed data meet the data format requirement of a preset communication protocol; sending the packaged to-be-printed data to a second POS terminal based on a preset communication protocol, wherein the second POS terminal has a printing function; the packaged to-be-printed data is received, the packaged to-be-printed data is data sent to the second POS terminal through a preset communication protocol after the first POS terminal obtains the to-be-printed data and packages the to-be-printed data, and the packaged to-be-printed data meets the data format requirement of the preset communication protocol; the to-be-printed data carries an identifier of the first POS terminal; and printing the packaged to-be-printed data based on the identifier of the first POS terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of POS terminals, and in particular to a data printing method, a POS terminal and a device. Background Art

[0002] As a transaction device, POS terminals are widely used in various retail, catering, hotels, supermarkets and other places. In the retail industry, POS terminals can provide data services and management functions for commodity transactions and realize non-cash settlement. In the financial, hotel and other service industries, POS terminals also play an important role and support a variety of payment methods. In the modern business environment, POS terminals have become an important tool for merchants' daily operations, and their function of printing receipts is indispensable. It is not only an important voucher for transactions, but also an important means to improve service quality, promote compliance operations and promote business innovation.

[0003] However, the waiter needs to use a POS terminal with a printing function to print and take the ticket first, or carry a POS terminal with a printing function to serve the customer to check out, which makes printing the receipt time-consuming and laborious. In addition, the POS terminal with a printing function is bulky and inconvenient to carry. The same POS terminal has both checkout and printing functions, which places high performance requirements on the POS terminal. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a data printing method, a POS terminal and a device.

[0005] The technical solution provided in this application is described below:

[0006] A first aspect of the present application provides a data printing method, which is applied to a first POS terminal, where the first POS terminal does not have a printing function. The method includes:

[0007] Acquire data to be printed, wherein the data to be printed carries an identification of the first POS terminal;

[0008] Encapsulating the data to be printed, wherein the encapsulated data to be printed complies with data format requirements of a preset communication protocol;

[0009] The packaged data to be printed is sent to a second POS terminal based on the preset communication protocol, wherein the second POS terminal has a printing function.

[0010] Optionally, packaging the data to be printed includes:

[0011] Adding a data type identification field to the header of the data to be printed;

[0012] According to the data type identification field, the data to be printed is encapsulated using a corresponding format.

[0013] Optionally, the preset communication protocol is a TCP / IP protocol, and sending the encapsulated data to be printed to the second POS terminal based on the preset communication protocol includes:

[0014] Obtaining the IP address of the second POS terminal;

[0015] According to the IP address of the second POS terminal, the encapsulated data to be printed is sent to the second POS terminal through the TCP / IP protocol.

[0016] A second aspect of the present application provides another data printing method, which is applied to a second POS terminal, where the second POS terminal has a printing function, and the method includes:

[0017] receiving packaged data to be printed, wherein the packaged data to be printed is data obtained by the first POS terminal, packaged, and sent to the second POS terminal through a preset communication protocol, the packaged data to be printed conforms to the data format requirement of the preset communication protocol, the data to be printed carries an identification of the first POS terminal, and the first POS terminal does not have a printing function;

[0018] The packaged data to be printed is printed based on the identification of the first POS terminal.

[0019] Optionally, printing the packaged data to be printed based on the identification of the first POS terminal includes:

[0020] If there are multiple first POS terminals, a print queue is created based on the identifier of each first POS terminal, and the data to be printed are printed sequentially based on the printing order of each packaged data to be printed in the print queue.

[0021] Optionally, printing the packaged data to be printed based on the identification of the first POS terminal includes:

[0022] querying a preconfigured printing format template according to the identification of the first POS terminal;

[0023] The packaged data to be printed is printed according to the printing format template.

[0024] Optionally, after printing the packaged data to be printed based on the identification of the first POS terminal, the method further includes:

[0025] Send a printing completion notification message to the first POS terminal.

[0026] A third aspect of the present application provides a POS terminal, wherein the POS terminal is a first POS terminal, and the first POS terminal does not have a printing function, including:

[0027] An acquiring unit, configured to acquire data to be printed, wherein the data to be printed carries an identification of the first POS terminal;

[0028] An encapsulation unit, used for encapsulating the data to be printed, wherein the encapsulated data to be printed conforms to the data format requirement of a preset communication protocol;

[0029] The sending unit is used to send the packaged data to be printed to a second POS terminal based on the preset communication protocol, wherein the second POS terminal has a printing function.

[0030] A fourth aspect of the present application provides a POS terminal, wherein the POS terminal is a second POS terminal, and the second POS terminal has a printing function, including:

[0031] a receiving unit, configured to receive packaged data to be printed, wherein the packaged data to be printed is data obtained by a first POS terminal, packaged, and then sent to a second POS terminal through a preset communication protocol, the packaged data to be printed conforms to a data format requirement of the preset communication protocol, the data to be printed carries an identification of the first POS terminal, and the first POS terminal does not have a printing function;

[0032] A printing unit is used to print the packaged data to be printed based on the identification of the first POS terminal.

[0033] It can be seen from the above technical solutions that this application has the following advantages:

[0034] By establishing a communication protocol between POS terminals with different functions, the data to be printed is processed and encapsulated and transmitted to the POS terminal with printing function, which facilitates information exchange between POS terminals and improves printing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solution in 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 paying any creative work.

[0036] Figure 1A schematic diagram of an embodiment of the data printing method provided by the present application;

[0037] Figure 2 A schematic diagram of a flow chart of an embodiment of the first POS terminal sending data to be printed to the second POS terminal provided in the present application;

[0038] Figure 3 A schematic diagram of a flow chart of an embodiment of a second POS terminal receiving data to be printed provided by the present application;

[0039] Figure 4 A schematic diagram of an embodiment of a flow chart of printing data by a second POS terminal provided in the present application;

[0040] Figure 5 A structural diagram of an embodiment of a first POS terminal data printing device provided by the present application;

[0041] Figure 6 A structural diagram of an embodiment of a second POS terminal data printing device provided by the present application;

[0042] Figure 7 This is a structural diagram of another embodiment of the data printing device provided in this application. DETAILED DESCRIPTION

[0043] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0044] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0045] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0046] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0047] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0048] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0049] As a transaction device, POS terminals are widely used in various retail, catering, hotels, supermarkets and other places. In the retail industry, POS terminals can provide data services and management functions for commodity transactions and realize non-cash settlement. In the financial, hotel and other service industries, POS terminals also play an important role and support a variety of payment methods. In the modern business environment, POS terminals have become an important tool for merchants' daily operations, and their function of printing receipts is indispensable. It is not only an important voucher for transactions, but also an important means to improve service quality, promote compliance operations and promote business innovation.

[0050] However, the waiter needs to use a POS terminal with a printing function to print and take the ticket first, or carry a POS terminal with a printing function to serve the customer to check out, which makes printing the receipt time-consuming and laborious. In addition, the POS terminal with a printing function is bulky and inconvenient to carry. The same POS terminal has both checkout and printing functions, which places high performance requirements on the POS terminal.

[0051] Based on this, the present application discloses a data printing method, a POS terminal and a device for reducing the time of data printing.

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] The method of the present application is applied to a POS terminal, and is described below by taking the execution subject as a first POS terminal as an example, wherein the first POS terminal does not have a printing function, and the second POS terminal has a printing function.

[0054] See also Figure 1 The present application first provides an embodiment of data printing, which comprises the following steps:

[0055] S101, a first POS terminal obtains data to be printed, wherein the data to be printed carries an identification of the first POS terminal;

[0056] The first POS terminal can obtain the data to be printed from the transaction record buffer in the database. Each transaction data is associated with the corresponding first POS terminal in the database. When the first POS terminal completes the scanning, pricing and confirmation of the goods, the detailed information of the transaction, such as the name of the goods, quantity, unit price, total price, transaction time, payment method, etc., will be stored in the temporary buffer as the data to be printed. These data to be printed contain a specific field for identifying that the transaction is from the first POS terminal. This identifier is the device number of the first POS terminal or a unique identifier pre-assigned to the first POS terminal. In the subsequent printing process, the source of the data can be determined based on this identifier, and it can also be used to distinguish the printing tasks of different POS terminals.

[0057] S102, the first POS terminal encapsulates the data to be printed, wherein the encapsulated data to be printed conforms to the data format requirement of the preset communication protocol;

[0058] The first POS terminal can encapsulate the data to be printed through CCP Service, which is a proxy server software. After the first POS terminal generates the data to be printed, CCP Service starts to encapsulate it. CCP Service first adds a specific header identifier containing the source, type and version information of the data at the beginning of the data to be printed, and then checks and sorts each field in the data to be printed, converts the fields that do not conform to the format, and adds a check code at the end of the data to be printed after the processing is completed. This check code is calculated based on the CRC check algorithm for the entire data to be printed, and is used to verify the integrity of the data at the receiving end. The encapsulation of the data to be printed is completed through CCP Service, and the encapsulated data to be printed meets the data format requirements of the preset communication protocol.

[0059] S103: The first POS terminal sends the packaged data to be printed to the second POS terminal based on a preset communication protocol, where the second POS terminal has a printing function.

[0060] In a network environment, the second POS terminal is configured as a terminal with a printing function and is in a listening state waiting to receive data from other devices. The first POS terminal obtains the IP address of the second POS terminal by querying a local configuration file or a network configuration service. The first POS terminal constructs the encapsulated data to be printed into a data packet that conforms to a preset communication protocol format, wherein the application layer data portion contains the data to be printed encapsulated according to a custom application layer protocol. The first POS terminal sends this data packet to the second POS terminal through a network interface.

[0061] In this embodiment, by establishing a communication protocol between POS terminals with different functions, the data to be printed is processed and packaged and transmitted to the POS terminal with printing function, which facilitates information exchange between POS terminals and improves printing efficiency.

[0062] In the above steps S102 to S103, the first POS terminal encapsulates the data to be printed and sends it to the second POS terminal through a preset communication protocol. Figure 3 , Figure 3 An embodiment of sending to-be-printed data from a first POS terminal to a second POS terminal comprises the following steps:

[0063] S201, the first POS terminal adds a data type identification field to the header of the data to be printed;

[0064] For different types of data to be printed, the first POS terminal adds an identification field to the corresponding data type.

[0065] Specifically, the first POS terminal obtains the data to be printed related to the sales receipt from the database. The data includes information such as product name, quantity, unit price, total price, transaction time, cashier number, etc. In order to quickly identify the data type in subsequent processing, it is necessary to add a data type identification field to the header of the data to be printed. In this way, whether the data is sent to a terminal with a printing function for printing or the intermediate device in the data transmission process performs data inspection, it can be quickly determined that this is the sales receipt type of data to be printed based on this data type identification field.

[0066] S202, the first POS terminal encapsulates the data to be printed using a corresponding format according to the data type identification field;

[0067] The data to be printed includes information such as the name, quantity, unit price, total price, transaction time and cashier number of the goods purchased by the customer.

[0068] The corresponding format is a customized compact format. First, the data type identifier is used as the starting mark, and then the data are arranged in the order of product name, quantity, unit price, total price, transaction time, and cashier number. According to different data type identification fields, the data to be printed is encapsulated using the corresponding format.

[0069] S203, the first POS terminal obtains the IP address of the second POS terminal;

[0070] The IP address is a digital identifier used to identify and find devices in the network. The first POS terminal and the second POS terminal are both in the same wireless network environment. After the second POS terminal is turned on, it obtains an IP address belonging to itself through the dynamic host configuration protocol. The first POS terminal runs a special network scanning program and sends a message containing the query request of the first POS terminal in the wireless network frequency band. The second POS terminal receives the query request and sends its own IP address back to the first POS terminal through the wireless connection. After receiving the IP address, the first POS terminal stores the IP address of the second POS terminal in the memory cache for subsequent data interaction.

[0071] S204: The first POS terminal sends the encapsulated data to be printed to the second POS terminal through the TCP / IP protocol according to the IP address of the second POS terminal.

[0072] The TCP / IP protocol is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. The TCP / IP protocol can be established by obtaining the IP address of the second POS terminal. After the TCP / IP protocol is established, the encapsulated data to be printed is sent to the second POS terminal. Specifically, a TCP / IP protocol request is initialized, and a TCP / IP data packet containing a connection request is sent to the default TCP / IP port of the second POS terminal. The second POS terminal receives the connection request and verifies the connection request. If the verification is successful, the TCP / IP protocol is successfully established. Subsequently, the second POS terminal can receive the encapsulated data to be printed through this TCP / IP protocol.

[0073] In this embodiment, accurate connection positioning can be achieved by obtaining the IP address of the second POS terminal. In a complex network environment, the first POS terminal can accurately find the specific device to communicate with by obtaining the IP address of the second POS terminal, avoiding data from being sent to the wrong device, thereby improving the accuracy of the entire transaction process.

[0074] The following describes the process of the second POS terminal receiving the data to be printed and printing it. Figure 2 , Figure 2 An embodiment of receiving the data to be printed by the second POS terminal comprises the following steps:

[0075] S301, the second POS terminal receives the packaged data to be printed;

[0076] The second POS terminal obtains the data to be printed, which contains detailed information of the transaction and carries the identification of the first POS terminal.

[0077] The preset communication protocol may be a custom application layer protocol based on the TCP / IP protocol, which specifies the format requirements of data, including a data packet header and a data content portion.

[0078] The first POS terminal encapsulates the acquired data to be printed according to the preset communication protocol. Specifically, the second POS terminal is in a listening state, waiting to receive data from the first POS terminal. The first POS terminal encapsulates the data to be printed into a data packet, and sends the data packet to the second POS terminal through the network. The second POS terminal receives the network data packet according to the TCP / IP protocol, and then parses the data packet according to the data format requirements of the custom application layer protocol, confirming that this is the encapsulated data to be printed from the first POS terminal, thereby completing the receiving operation.

[0079] S302: The second POS terminal prints the packaged data to be printed based on the identification of the first POS terminal.

[0080] After receiving the to-be-printed data packaged by the first POS terminal, the second POS terminal first parses the identification of the first POS terminal from the packaged data. Different printing formats are required for printing tasks from different POS terminals.

[0081] The received data to be printed is converted into a format that can be processed by the second POS terminal, including converting the encoding method and data structure of the data to be printed. The second POS terminal parses the data to be printed according to the predefined data format and parsing logic, obtains the print content and prints it directly, so that the printing process is simple and fast.

[0082] In this embodiment, the first POS terminal for checkout is connected to the second POS terminal that can print at the front desk, and the data to be printed is sent to the second POS terminal through the TCP / IP protocol. This design can meet the customer's demand for printing receipts in advance and reduce the waiting time of customers. The checkout and printing functions are separated in different POS terminals, and the performance requirements of the first POS terminal are relatively low. By establishing a communication protocol between POS terminals with different functions, the data to be printed is processed and packaged and transmitted to the terminal with printing function, which facilitates information exchange between the first POS terminal and the second POS terminal.

[0083] In the above step S302, based on the identification of the first POS terminal, the second POS terminal prints the packaged data to be printed. Figure 4 , Figure 4 An embodiment of printing data for a second POS terminal comprises the following steps:

[0084] S401, the second POS terminal searches for a pre-configured printing format template according to the identification of the first POS terminal;

[0085] In order to meet different business needs and management requirements, different printing format templates are pre-configured for different first POS terminals. When the second POS terminal receives the packaged data to be printed from these first POS terminals, it starts to query the pre-configured printing format template. Different first POS terminals have unique identifiers, which facilitates the second POS terminal to identify the type of the first POS terminal. When receiving the packaged data to be printed, the second POS terminal queries the corresponding printing format template according to the identifier, and then extracts relevant information from the data to be printed according to the template for typesetting and printing.

[0086] S402, the second POS terminal prints the packaged data to be printed according to the printing format template;

[0087] For different first POS terminals, the pre-configured printing format templates have different formats. According to the characteristics of the first POS terminal, the printing format template is pre-configured. There is no need to reset various parameters each time printing. Instead, the packaged data to be printed is printed according to the printing format template, which greatly reduces the setting time and improves efficiency. For the staff, there is no need to adjust the parameters each time printing, and the printing task can be completed quickly.

[0088] S403: If there are multiple first POS terminals, the second POS terminal creates a print queue based on the identifier of each first POS terminal, and prints the encapsulated data to be printed in sequence based on the printing order of each encapsulated data to be printed in the print queue;

[0089] Assume that there are a plurality of first POS terminals without a printing function, respectively identified as "POS1", "POS2" and "POS3", and there is a second POS terminal with a printing function.

[0090] After completing the transaction, each first POS terminal encapsulates its own data to be printed according to the preset communication protocol and sends it to the second POS terminal. After receiving the data from different first POS terminals, the second POS terminal creates a print queue based on the identification of each first POS terminal. When the encapsulated data to be printed from "POS1" arrives first, it is placed at the head of the subqueue corresponding to "POS1"; then the data from "POS2" arrives and is placed at the head of the subqueue corresponding to "POS2"; then new data from "POS1" arrives and is placed behind the existing data in the "POS1" subqueue in order. The data to be printed is printed in sequence, and the data is removed from the "POS1" subqueue after printing is completed. Then check whether there is any data in the "POS1" subqueue. If so, continue printing; if not, check other subqueues.

[0091] By creating a print queue based on the identifier of each first POS terminal and printing in sequence according to the printing order of each packaged data to be printed in the queue, it is ensured that the print tasks from different first POS terminals can be printed in order at the second POS terminal.

[0092] S404: The second POS terminal sends a printing completion notification message to the first POS terminal.

[0093] After the first POS terminal completes the payment, the second POS terminal prints the packaged data to be printed according to the set printing format template. After printing is completed, the second POS terminal sends a printing completion notification message to the first POS terminal. After receiving this notification message, the first POS terminal displays "The receipt has been printed, please check it" on the screen, which is convenient for the cashier to inform the customer that the transaction process has been completed.

[0094] In this embodiment, a print queue is created, and printing is performed in sequence according to the printing order, which facilitates the management of the data to be printed and avoids confusion caused by too much data to be printed. Different printing format templates are pre-configured to reduce the time required for each reset, improve work efficiency, facilitate batch printing, and save time. After printing is completed, a notification message of printing completion is sent to facilitate system error troubleshooting. If a problem occurs during the transaction process, the printing completion notification message can serve as an important troubleshooting point. According to whether the first POS terminal receives this message, it is determined whether it is a problem with the printing system or a problem with the notification message transmission, so that troubleshooting and repair can be performed more targeted.

[0095] See also Figure 5 The present application provides a POS terminal, which is a first POS terminal and does not have a printing function, including:

[0096] An acquisition unit 501 is used to acquire data to be printed, wherein the data to be printed carries an identification of the first POS terminal;

[0097] The encapsulation unit 502 is used to encapsulate the data to be printed, wherein the encapsulated data to be printed conforms to the data format requirement of the preset communication protocol;

[0098] The sending unit 503 is used to send the packaged data to be printed to the second POS terminal based on a preset communication protocol, where the second POS terminal has a printing function.

[0099] Optionally, the encapsulation unit 502 is further configured to:

[0100] Add a data type identification field to the header of the data to be printed;

[0101] According to the data type identification field, the data to be printed is encapsulated using the corresponding format.

[0102] Optionally, the sending unit 503 is further configured to:

[0103] Obtain the IP address of the second POS terminal;

[0104] According to the IP address of the second POS terminal, the encapsulated data to be printed is sent to the second POS terminal through the TCP / IP protocol.

[0105] See also Figure 6 The present application further provides a POS terminal, which is a second POS terminal, and the second POS terminal has a printing function, including:

[0106] The receiving unit 601 is used to receive packaged data to be printed, wherein the packaged data to be printed is data to be printed obtained by the first POS terminal, and after the data to be printed is packaged, the data is sent to the second POS terminal through a preset communication protocol, the packaged data to be printed meets the data format requirements of the preset communication protocol, the data to be printed carries the identification of the first POS terminal, and the first POS terminal does not have a printing function;

[0107] The printing unit 602 is used to print the packaged data to be printed based on the identification of the first POS terminal.

[0108] Optionally, the printing unit 602 is further used for:

[0109] If there are multiple first POS terminals, a print queue is created based on the identification of each first POS terminal, and the data to be printed are printed sequentially based on the printing order of each packaged data to be printed in the print queue.

[0110] Optionally, the printing unit 602 is further used for:

[0111] querying a preconfigured printing format template according to the identification of the first POS terminal;

[0112] Print the packaged data to be printed according to the print format template.

[0113] Optionally, also include:

[0114] The notification unit 603 is configured to send a printing completion notification message to the first POS terminal.

[0115] See also Figure 7 , the present application also provides a data printing device, comprising:

[0116] Processor 701, memory 702, input and output unit 703, bus 704;

[0117] The processor 701 is connected to the memory 702, the input and output unit 703 and the bus 704;

[0118] The memory 702 stores a program, and the processor 701 calls the program to execute any of the above data printing methods.

[0119] The present application also relates to a computer-readable storage medium, on which a program is stored. When the program is run on a computer, the computer executes any of the above data printing methods.

[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0121] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0122] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. A data printing method, characterized in that: Applied to a first POS terminal, the first POS terminal does not have a printing function, the method includes: Acquire data to be printed, wherein the data to be printed carries an identification of the first POS terminal; Encapsulating the data to be printed, wherein the encapsulated data to be printed complies with data format requirements of a preset communication protocol; The packaged data to be printed is sent to a second POS terminal based on the preset communication protocol, wherein the second POS terminal has a printing function.

2. The data printing method according to claim 1, characterized in that: The encapsulating the data to be printed comprises: Adding a data type identification field to the header of the data to be printed; According to the data type identification field, the data to be printed is encapsulated using a corresponding format.

3. The data printing method according to claim 1 or 2, characterized in that: The preset communication protocol is the TCP / IP protocol, and sending the encapsulated data to be printed to the second POS terminal based on the preset communication protocol includes: Obtaining the IP address of the second POS terminal; According to the IP address of the second POS terminal, the encapsulated data to be printed is sent to the second POS terminal through the TCP / IP protocol.

4. A data printing method, characterized in that: Applied to a second POS terminal, the second POS terminal having a printing function, the method comprising: receiving packaged data to be printed, wherein the packaged data to be printed is data obtained by the first POS terminal, packaged, and sent to the second POS terminal through a preset communication protocol, the packaged data to be printed conforms to the data format requirement of the preset communication protocol, the data to be printed carries an identification of the first POS terminal, and the first POS terminal does not have a printing function; The packaged data to be printed is printed based on the identification of the first POS terminal.

5. The data printing method according to claim 4, characterized in that: Printing the packaged data to be printed based on the identification of the first POS terminal includes: If there are multiple first POS terminals, a print queue is created based on the identifier of each first POS terminal, and the data to be printed are printed sequentially based on the printing order of each packaged data to be printed in the print queue.

6. The data printing method according to claim 4, characterized in that: Printing the packaged data to be printed based on the identification of the first POS terminal includes: querying a preconfigured printing format template according to the identification of the first POS terminal; The packaged data to be printed is printed according to the printing format template.

7. The data printing method according to claim 5 or 6, characterized in that: After printing the packaged data to be printed based on the identification of the first POS terminal, the method further includes: Send a printing completion notification message to the first POS terminal.

8. A POS terminal, characterized in that: The POS terminal is a first POS terminal, which does not have a printing function and includes: An acquiring unit, configured to acquire data to be printed, wherein the data to be printed carries an identification of the first POS terminal; An encapsulation unit, used for encapsulating the data to be printed, wherein the encapsulated data to be printed conforms to the data format requirement of a preset communication protocol; The sending unit is used to send the packaged data to be printed to a second POS terminal based on the preset communication protocol, wherein the second POS terminal has a printing function.

9. A POS terminal, characterized in that: The POS terminal is a second POS terminal, and the second POS terminal has a printing function, including: a receiving unit, configured to receive packaged data to be printed, wherein the packaged data to be printed is data obtained by a first POS terminal, packaged, and then sent to a second POS terminal through a preset communication protocol, the packaged data to be printed conforms to a data format requirement of the preset communication protocol, the data to be printed carries an identification of the first POS terminal, and the first POS terminal does not have a printing function; A printing unit is used to print the packaged data to be printed based on the identification of the first POS terminal.

10. A data printing device, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the data printing method according to any one of claims 1 to 3, or executes the data printing method according to any one of claims 4 to 7.