Method for improving system stability during Bluetooth printing

By creating virtual Bluetooth devices in POS machines and migrating the printing library logic to HAL services, the system stability problem during Bluetooth printing is solved, and compatibility utilization of built-in printers and system stability is improved.

CN119781701AActive Publication Date: 2025-04-08FUJIAN NEWLAND PAYMENT TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411907222.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-08
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

In the prior art, system stability during Bluetooth printing is threatened by dependence and vulnerability, especially the crash of the print library may cause the system to be unable to use normally.

Method used

Bluetooth Socket communication is implemented to send printing instructions by creating a virtual Bluetooth device on the software system framework layer of the POS machine and setting it as a built-in printer. At the same time, the logic of the print library is migrated to the hardware abstraction layer HAL service and compiled to the vendor partition to ensure that the HAL service runs automatically and provide a unified AIDL interface to achieve seamless communication between the operating system and the print driver.

Benefits of technology

It realizes compatibility and utilization of built-in printers, improves system stability and reliability, avoids interference with other parts of the system by printing library crashes, and reduces the impact of system crashes or restarts on printing services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781701A_ABST
    Figure CN119781701A_ABST
Patent Text Reader

Abstract

The invention discloses a method for improving system stability during Bluetooth printing, the scheme is applied to a multimedia intelligent POS (Point Of Sale), when a POS machine opens a Bluetooth function, a connected virtual Bluetooth device is automatically created, and the virtual Bluetooth device is used as a bridge of a software level and simulates a communication interface of a Bluetooth printer, so that the system stability during Bluetooth printing is improved. And the APPs which originally interact with the external Bluetooth printer through the Android native Bluetooth interface can be seamlessly connected to the virtual equipment. Through the mode, the APP program on the external terminal or equipment can perform printing operation by using the built-in printer of the multimedia intelligent POS all-in-one machine without any modification, so that compatibility and utilization of the built-in printer are realized, and greater convenience and cost saving are brought to commercial tenants. Besides, according to the scheme, the printing library is migrated to the vendor process, so that the printing function is isolated from other functions of the system, the stability and reliability of the system are improved, and better experience is provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of POS printing management, and in particular to a method for improving system stability during Bluetooth printing. Background Art

[0002] In the current payment and acquiring market, it has become a common practice for Android devices to connect to external printers via Bluetooth to print receipts. This method provides convenience for merchants because the consistency of Bluetooth communication allows these applications to be easily installed on any Bluetooth-enabled Android device and put into use quickly. However, this solution also has its inherent limitations, mainly the need to purchase additional external printers, which undoubtedly increases the operating costs of merchants.

[0003] With the development of technology, multimedia smart POS all-in-one machines have emerged. These devices have built-in printer modules, providing merchants with a more integrated solution. However, due to the different interface definitions and implementation methods of the printing modules of different manufacturers, Android acquiring applications that originally used Bluetooth external printers to print cannot be directly compatible with the built-in printers of these smart POS all-in-one machines.

[0004] In addition, the JNI architecture is currently widely used in the Bluetooth printing process. The JNI architecture is responsible for encapsulating the printing library into the system process to achieve the interaction between Java code and native code (such as C / C++). However, this architecture also brings risks: if the printing library crashes for some reason (such as code errors, insufficient resources), it will affect the entire system process and cause the system to be unable to be used normally. This dependence and fragility threatens the stability of the system, so the stability and robustness of the printing library are extremely high. Summary of the invention

[0005] In view of this, an object of the present invention is to provide a method for improving system stability during Bluetooth printing, which has reliable implementation, flexible application, and little impact on system operation.

[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:

[0007] A method for improving system stability during Bluetooth printing, applied to a POS machine, comprising:

[0008] S01. POS machine starts Bluetooth function;

[0009] S02. Create a virtual Bluetooth device on the software system framework layer of the POS machine, set it as a built-in printer, and define the state as connected;

[0010] S03. The application sends a print instruction to the built-in printer of the POS machine through Bluetooth Socket communication, and the built-in printer passes the print instruction to the print driver of the POS machine to enable the POS machine to execute the print operation.

[0011] As a possible implementation, further, in the present solution S02, the logic of the printing library of the built-in printer is structured in the hardware abstraction layer HAL service and compiled into the vendor partition of the POS machine, so that after the system of the POS machine is started, the hardware abstraction layer HAL service automatically runs and runs in the vendor process.

[0012] As a possible implementation mode, further, the hardware abstraction layer HAL service described in this solution also realizes seamless communication between the operating system and the print driver by defining a unified interface and an AIDL service interface.

[0013] As a better implementation option, preferably, the hardware abstraction layer HAL service described in this solution is automatically started at boot time through the .rc file configuration, so that the HAL service automatically runs after the POS machine system is started.

[0014] As a preferred implementation option, preferably, this solution also includes:

[0015] Use AIDL to define the service interface and generate a C++ interface class; the C++ interface class contains pure virtual functions common to the client and the server, which are used to describe the operations required for the hardware abstraction layer HAL service to communicate with other system layers.

[0016] As a possible implementation, further, in the present solution S03, the application is an application program that supports interaction with an external printer, and the application establishes a Bluetooth communication connection with the virtual built-in printer of the POS machine.

[0017] As a better implementation option, preferably, in the present solution S03, after the built-in printer of the POS machine receives the print instruction, it obtains an instance of the hardware abstraction layer HAL service through the system layer, disassembles the print instruction and calls the print service through the AIDL service interface, and the print service passes the print instruction to the underlying print driver to enable the POS machine to perform the print operation.

[0018] Based on the above, the present solution also provides a POS machine receipt printing management method, which includes the above-mentioned method for improving system stability during Bluetooth printing.

[0019] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art: when the present solution is applied to the multimedia intelligent POS, when the Bluetooth function of the POS machine is turned on, a connected virtual Bluetooth device (called "built-in printer") is automatically created. The virtual Bluetooth device is actually a bridge at the software level, which simulates the communication interface of the Bluetooth printer, so that those APPs that originally interacted with the external Bluetooth printer through the Android native Bluetooth interface can be seamlessly connected to this virtual device. In this way, the APP program on the external terminal or device can use the built-in printer of the multimedia intelligent POS all-in-one machine to print without any modification, thereby achieving compatibility and utilization of the built-in printer, bringing greater convenience and cost savings to merchants.

[0020] In addition, this solution restructures the Bluetooth printing library, separating the printing library from the system process to the vendor process in accordance with the Android Treble architecture. Once a crash occurs, it will not have any impact on the system operation, and will only be limited to abnormal printing functions. In addition, this solution isolates the printing function from other system functions by migrating the printing library to the vendor process. This isolation mechanism effectively prevents the crash of the printing library from interfering with other parts of the system. It improves the stability and reliability of the system and provides users with a better experience. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1 This is a brief implementation flow diagram of this method. DETAILED DESCRIPTION

[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.

[0024] Combination Figure 1 As shown, the present embodiment provides a method for improving system stability during Bluetooth printing, which is applied to a POS machine and includes:

[0025] S01. POS machine starts Bluetooth function;

[0026] S02. Create a virtual Bluetooth device on the software system framework layer of the POS machine, set it as a built-in printer, and define the state as connected;

[0027] S03. The application sends a print instruction to the built-in printer of the POS machine through Bluetooth Socket communication, and the built-in printer passes the print instruction to the print driver of the POS machine to enable the POS machine to execute the print operation.

[0028] This embodiment mainly focuses on the reconstruction and optimization of the printing service based on the Android Treble architecture to achieve a more efficient, stable and compatible printing function.

[0029] Among them, in this scheme S02, the logic of the printing library of the built-in printer is structured in the hardware abstraction layer HAL service and compiled into the vendor partition of the POS machine, so that after the system of the POS machine is started, the hardware abstraction layer HAL service automatically runs, and it runs in the vendor process. In addition, the hardware abstraction layer HAL service described in this scheme also realizes seamless communication between the operating system and the print driver by defining a unified interface and an AIDL service interface. As a better implementation option, preferably, the hardware abstraction layer HAL service described in this scheme is automatically started at boot time through the .rc file configuration, so that after the system of the POS machine is started, the HAL service automatically runs.

[0030] As a better implementation option, preferably, this solution also includes:

[0031] Use AIDL to define the service interface and generate a C++ interface class; the C++ interface class contains pure virtual functions common to the client and the server, which are used to describe the operations required for the hardware abstraction layer HAL service to communicate with other system layers.

[0032] In the present solution S03, the application is an application program that supports interaction with an external printer, and the application establishes a Bluetooth communication connection with the virtual built-in printer of the POS machine; at the same time, in S03, after the built-in printer of the POS machine receives the print instruction, it obtains an instance of the hardware abstraction layer HAL service through the system layer, disassembles the print instruction and calls the print service through the AIDL service interface, and the print service passes the print instruction to the underlying print driver to enable the POS machine to perform the print operation.

[0033] The main technical points and their corresponding effects of this embodiment can be summarized as follows:

[0034] 1. Hardware Abstraction Layer (HAL) Refactoring

[0035] Migrate the logic of the print library to the HAL service to ensure isolation from the hardware and driver. The HAL service compiles the vendor partition and automatically starts at boot through the .rc file configuration to ensure service stability. Provide a unified AIDL interface so that the operating system can communicate directly with the print driver without having to worry about the underlying details.

[0036] 2. AIDL interface definition

[0037] Use AIDL to define the service interface and generate a C++ interface class. The interface class contains pure virtual functions common to both the client and the server, which are used to describe the operations required for the HAL layer to communicate with other layers. This simplifies interface calls and improves system maintainability and scalability.

[0038] 3. Bluetooth Socket Communication

[0039] The application on the terminal can send print commands to the built-in printer through the Bluetooth Socket to realize the wireless printing function. The system layer obtains the HAL service instance, disassembles the command and calls the print service through the AIDL interface. The print service passes the command to the underlying print driver to execute the print operation. This innovation expands the use scenarios of the print service and improves the convenience and flexibility of printing.

[0040] Accordingly, compared with the prior art, the advantages of the solution of this embodiment include the following:

[0041] Architecture optimization: Move the printing logic from the application layer or system service layer to the HAL layer to reduce system dependence and improve stability.

[0042] Automatic startup: Compile the HAL service into the vendor partition to ensure that it runs automatically when the system starts, without manual intervention.

[0043] Unified interface: Provides a unified interface to simplify the communication between the operating system and the print driver and improve compatibility.

[0044] AIDL interface definition: Use AIDL to define service interfaces and automatically generate C++ interface classes to improve code maintainability and scalability.

[0045] By implementing this solution, a more stable, compatible and easy-to-maintain printing service can be provided for the Android system to meet users' needs for high-quality printing functions.

[0046] When there is a code error or insufficient resources, the system will stop running in the existing solution. However, the solution of this embodiment can ensure that the POS system can still operate normally when there is a print service error or insufficient resources. That is, this solution significantly improves the stability and reliability of the print service and reduces the impact of system crashes or restarts on the print service.

[0047] Based on the above, the present solution also provides a POS machine receipt printing management method, which includes the above-mentioned method for improving system stability during Bluetooth printing.

[0048] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device 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 method for improving system stability during Bluetooth printing, applied to POS machines, characterized in that: It includes: S01. POS machine starts Bluetooth function; S02. Create a virtual Bluetooth device on the software system framework layer of the POS machine, set it as a built-in printer, and define the state as connected; S03. The application sends a print instruction to the built-in printer of the POS machine through Bluetooth Socket communication, and the built-in printer passes the print instruction to the print driver of the POS machine to enable the POS machine to execute the print operation.

2. The method for improving system stability during Bluetooth printing as claimed in claim 1, characterized in that: In S02, the logic of the printing library of the built-in printer is structured in the hardware abstraction layer HAL service and compiled into the vendor partition of the POS machine, so that after the system of the POS machine is started, the hardware abstraction layer HAL service automatically runs, and it runs in the vendor process; The hardware abstraction layer HAL service also implements seamless communication between the operating system and the print driver by defining a unified interface and an AIDL service interface.

3. The method for improving system stability during Bluetooth printing as claimed in claim 2, characterized in that: The hardware abstraction layer HAL service is automatically started at boot time through the .rc file configuration, so that the HAL service automatically runs after the system of the POS machine is started.

4. The method for improving system stability during Bluetooth printing as claimed in claim 2, characterized in that: Also includes: Use AIDL to define the service interface and generate a C++ interface class; the C++ interface class contains pure virtual functions common to the client and the server, which are used to describe the operations required for the hardware abstraction layer HAL service to communicate with other system layers.

5. The method for improving system stability during Bluetooth printing as claimed in claim 1, characterized in that: In S03, the application is an application program that supports interaction with an external printer, and the application establishes a Bluetooth communication connection with the virtual built-in printer of the POS machine.

6. The method for improving system stability during Bluetooth printing according to claim 2 or 3, characterized in that: In S03, after the built-in printer of the POS machine receives the printing instruction, it obtains an instance of the hardware abstraction layer HAL service through the system layer, disassembles the printing instruction and calls the printing service through the AIDL service interface. The printing service passes the printing instruction to the underlying printing driver to enable the POS machine to perform the printing operation.

7. A POS machine ticket printing management method, characterized in that: It includes the method for improving system stability during Bluetooth printing as described in one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for realizing virtual Bluetooth printer by intelligent POS machine

    CN110503786A

  • Method and device for realizing virtual printer, and cash register

    CN117608755A

  • Parameter updating method and terminal equipment

    CN117707562A

  • Virtual system bluetooth communication method and device, virtual system, storage medium, and electronic apparatus

    WO2019127476A1

  • Terminal system architecture, communication system and communication method, and storage medium

    WO2020119316A1