Compatible method and system of self-service terminal printer and medium

By defining standard interfaces and creating adapter classes, the system achieves compatibility with multiple printer brands, encrypts transmission to protect privacy, and automatically switches to a backup printer. This solves the compatibility, security, and reliability issues of medical self-service terminal printer systems, improving service efficiency and user experience.

CN120891997APending Publication Date: 2025-11-04INSPUR FINANCIAL INFORMATION TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511027483.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

Existing medical self-service terminal printer systems suffer from poor compatibility, high development costs, insecure data transmission, low efficiency in consumable management, and inconvenient maintenance. In particular, when printer equipment is out of production or malfunctions, this can lead to service interruptions and leakage of user privacy.

Method used

By defining standard interfaces and creating adapter classes, we achieve compatibility with multiple printer brands, protect data through encrypted transmission, monitor consumable status in real time and automatically switch to a backup printer, and dynamically load the adapter library to adapt to different printers.

Benefits of technology

It achieves high compatibility with different brands and models of printers, ensures data transmission security, reduces service downtime, improves hospital service efficiency and user experience, and reduces development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120891997A_ABST
    Figure CN120891997A_ABST
Patent Text Reader

Abstract

The invention provides a self-service terminal printer compatible method and system and a medium, and belongs to the technical field of printing self-service terminals.The method comprises the steps that a standard interface is defined, and a printer function is abstracted into a universal operation template; creating an adapter class for each printer type, defining conversion logic of a printer protocol and a standard interface, and compiling the adapter class into an adapter dynamic library; creating a multi-protocol printer calling interface; adding the type of the printer into a configuration file, loading an adapter dynamic library and instantiating an adapter object; a printing request is received, the encrypted printing data are analyzed and decrypted, and a printing operation object is generated; converting the print job object into a printer instruction stream by using the adapter object and executing the printer instruction stream; and polling the state of the printer, performing early warning when the consumable allowance is identified to be lower than a threshold value, and switching a standby printer when the printer is identified to be faulty. The system is compatible with various printers, data safety is guaranteed, consumables and faults are monitored, and printing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of printing self-service terminals, and particularly relates to a compatible method and system of a self-service terminal printer and a medium. BACKGROUND

[0002] With the development of medical self-service, the demand for medical self-service terminal printing is growing rapidly. However, in the development process of medical self-service terminals, the following problems need to be solved urgently: Firstly, different printer manufacturers use private communication protocols, which leads to the development of special drivers for each brand and even specific models when integrating printers in terminal software. This method not only has a long development cycle, but also increases development costs. Moreover, when a printer device is discontinued (such as a certain type of thermal printer), the terminal software needs to be restructured on a large scale to adapt to the alternative model. Secondly, sensitive data such as patient test reports and medical records are often sent in plaintext form during transmission to the printer, making it easy for unauthorized devices to access the print bus and steal data, seriously threatening user privacy and security. Thirdly, the current monitoring of consumable reserves relies on manual inspection, which is inefficient and prone to errors. Paper and other consumables running out can cause service interruptions, causing inconvenience to patients and affecting the service efficiency of hospitals. At the same time, when a printer malfunctions, it usually needs to be disassembled and returned to the site for repair, which takes a long time and exacerbates the degree of service interruption.

[0003] Currently, although there are some middleware encapsulation layer solutions that attempt to convert the underlying protocol to achieve a certain degree of compatibility, these solutions still have problems: first, new printers need to recompile the entire system, and there is a lack of dynamic encryption and consumable prediction capabilities. SUMMARY

[0004] In a first aspect, the embodiments of the present application provide a compatible method of a self-service terminal printer, comprising the following steps: S1. Defining a standard interface for printer operation, and abstracting printer job functions into a general operation template; the printer job functions include printing, status inquiry and configuration; S2. Creating an adapter class for each printer type, defining the conversion logic between the printer protocol and the standard interface in the adapter class, and compiling each adapter class into a corresponding adapter dynamic library; S3. Creating a multi-protocol printer calling interface to provide a calling path for the calling needs of different types of applications; S4. Adding the type of the currently used printer device to the configuration file of the self-service terminal, dynamically loading the corresponding adapter dynamic library according to the type, and instantiating the adapter object; S5. Receiving the encrypted print request, parsing the calling path and encrypted print data, decrypting the encrypted print data and generating a standard print job object; S6. Using the adapter object to convert the standard print job object into a command stream of the target printer job function according to the printer protocol and executing; S7. Real-time polling of the printer status, triggering a pre-warning when identifying that the consumable level is below the threshold, and automatically switching to the backup printer and re-executing steps S4-S6 when identifying a printer failure.

[0005] Further, the specific steps of step S1 are as follows: S11. Defining a standard interface for printer operation, defining a print function for executing a print job function, a state query function for obtaining a printer device state, and a configuration function for updating a printer parameter; S12. Building a general operation template of the print function: Encapsulating the requested print content into a structured object containing metadata, including coordinate positioning, font specification, and encryption identifier.

[0006] Further, the specific steps of step S2 are as follows: S21. Creating a unique dynamic link library for each printer type, and building protocol conversion logic of the adapter class in the dynamic link library: Mapping the standard interface to the instruction sequence of the corresponding type of printer job function; Mapping the printer job function execution return data to a format recognizable by the standard interface; S22. Using a compiler to compile the source code of each adapter class into a dynamic link library of the platform to which the self-service terminal belongs.

[0007] Further, the specific steps of step S3 are as follows: S31. Building a calling path of the dynamic link library for the local application of the self-service terminal, responding to the print task; S32. Building a calling path of the HTTP-REST interface for the Web application, triggering the print task in response to the HTTP request; S33. Building a calling path of the WebSocket interface for the mobile application of the client, responding to the real-time communication print task.

[0008] Further, the specific steps of step S4 are as follows: S41. Adding the type identification code of the currently used printer device to the configuration file of the self-service terminal in the form of a configuration item; S42. After the self-service terminal is started, the type identification code of the printer device in the configuration item of the configuration file is parsed, and a matched adapter class dynamic library is loaded through an operating system dynamic loader, and an adapter instance function in the dynamic library is called to perform adapter object instantiation.

[0009] Further, the step S5 specifically comprises the following steps: S51. Receiving an encrypted print request, and parsing the message header to separate out a call path identifier and an encrypted data block; S52. Selecting a decryption method according to the call path identifier: If the call path identifier is a dynamic link library, the encrypted data block is decrypted using an emergency security module; If the call path is an HTTP-REST interface or a WebSocket interface, the encrypted data block is decrypted using a TLS session key; S53. Constructing a standard print job object according to the decryption result and a standard interface, and filling the coordinate positioning, font specification and encrypted identifier of the print content into a general operation template of a print function.

[0010] Further, the step S6 specifically comprises the following steps: S61. Calling a job conversion function of the adapter object to protocol-encapsulate the data content of the standard print job object and convert it into a print instruction sequence matched with the target printer type, so as to adapt to the processing requirement of the target printer; S62. Encapsulating the print instruction sequence into an instruction stream, transmitting the instruction stream to the target printer device through a secure communication channel, and performing a physical printing operation and print job output.

[0011] Further, the step S7 specifically comprises the following steps: S71. Performing a dual-mode polling: Sending a state query instruction to the printer at a preset time interval through a state query function of the adapter object, and obtaining a state code returned by the printer; Listening to a printer event interrupt through a listening function of the adapter object, and extracting the state code from the printer event; S72. Converting the state code returned by the printer into a unified state enumeration value according to a preset mapping rule, and configuring a corresponding state response action for each unified state enumeration value; S73. When the state code is a printer fault, recording a printer fingerprint to a blacklist, selecting an optimal backup printer device from a printer pool, and performing a hot update of the configuration file and reloading the adapter according to the steps S4-S6.

[0012] In a second aspect, the embodiments of the present application further provide a compatible system of a self-service terminal printer, comprising: An interface abstraction module is configured to define a standard interface of printer operation, and abstract printer job functions into a general operation template; the printer job functions include printing, status query and configuration; An adapter dynamic library construction module is configured to create an adapter class for each printer type, define conversion logic between a printer protocol and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; A multi-protocol calling path construction module is configured to create a multi-protocol printer calling interface, and provide a calling path for calling requirements of different types of applications; A dynamic loading module is configured to add a type of a currently used printer device to a configuration file of the self-service terminal, dynamically load a corresponding adapter dynamic library according to the type, and instantiate an adapter object; A printing data security processing module is configured to receive an encrypted printing request, parse a calling path and encrypted printing data, decrypt the encrypted printing data, and generate a standard printing job object; A protocol conversion execution module is configured to use the adapter object to convert the standard printing job object into an instruction stream of a target printer job function according to a printer protocol, and execute the instruction stream; A status monitoring module is configured to poll a printer status in real time, trigger a pre-warning when recognizing that a consumable amount is below a threshold, and automatically switch to a backup printer and re-execute adapter loading, printing data security processing and printing protocol conversion when recognizing a printer failure.

[0013] In a third aspect, an embodiment of the present application further provides a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement steps of the compatible method of the self-service terminal printer according to the first aspect.

[0014] From the above technical solutions, the present application has the following advantages: The self-service terminal printer compatible method, system and medium provided by the application realize the compatibility of different brands and models of printers, avoid the cumbersome process of developing a special driver for each printer model by defining a standard interface and creating an adapter class, shorten the development cycle and reduce the development cost; The setting of encrypted print request ensures the confidentiality of sensitive data such as patient test reports and cases during transmission, prevents data leakage, protects user privacy, and ensures the security of printed data; By polling the printer status in real time and warning of insufficient consumables, service interruption caused by depleted consumables is avoided, the service efficiency and patient experience of the hospital are improved, and the efficiency and accuracy of consumable management are improved; When the printer fails, the standby printer can be automatically switched and the printing process can be re-executed, reducing the service interruption time, ensuring the continuous and stable operation of the self-service terminal, and enhancing the reliability and availability of the self-service terminal printing function; When a new printer type is added, the entire system does not need to be recompiled, only the corresponding adapter dynamic library needs to be added, which is convenient and fast to adapt to the access of different printers. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the present application, the drawings needed to be used in the description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0016] Figure 1 The flowchart of the self-service terminal printer compatible method of the present application.

[0017] Figure 2 The schematic diagram of the self-service terminal printer compatible system of the present application. DETAILED DESCRIPTION

[0018] In the following detailed description of the specific steps of the self-service terminal printer compatible method, various embodiments of the present disclosure will be described more fully. The present disclosure can have various embodiments, and adjustments and changes can be made therein. However, it should be understood that there is no intention to limit various embodiments of the present disclosure to the specific embodiments disclosed herein, but the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives falling within the spirit and scope of various embodiments of the present disclosure.

[0019] Illustratively, with the rapid development of medical self-service, the printing demand of medical self-service terminal presents a rapid growth trend. However, in the development process of medical self-service terminal, there are some problems to be solved: First, different printer manufacturers have adopted private communication protocols, which directly leads to the fact that terminal software must develop special drivers for each brand and even specific models when integrating printers. This not only greatly prolongs the development cycle, but also significantly increases the development cost. Moreover, once the printer equipment is out of production, for example, a certain type of thermal printer is off the market, the terminal software has to be restructured on a large scale to adapt to the alternative model. Second, during the transmission of sensitive data such as patient test reports and cases to the printer, most of them are sent in plaintext form. This allows unauthorized devices to easily access the print bus and steal data, seriously threatening the privacy and security of users. Third, the current monitoring of consumable reserves mainly relies on manual inspection, which is inefficient and prone to errors. Paper and other consumables running out often leads to service interruption, causing inconvenience to patients and affecting the service efficiency of the hospital. At the same time, when the printer malfunctions, the device usually needs to be disassembled on site for repair, which takes a long time and further exacerbates the degree of service interruption.

[0020] Currently, although there are some middleware encapsulation layer solutions on the market, which try to achieve a certain degree of compatibility by converting the underlying protocol, these solutions still have obvious problems: first, when a new printer is added, the entire system needs to be recompiled, lacking dynamic encryption and consumable prediction capabilities. Some solutions often need to recompile the entire system when facing new printer models, which is a tedious process that seriously hinders the flexibility and scalability of the system. At the same time, these solutions lack dynamic encryption capabilities, which cannot effectively protect the security of data during transmission. In addition, the lack of consumable prediction capability also leads to the inability to early warn of insufficient consumable reserves, so that measures cannot be taken in time to avoid service interruption.

[0021] To solve the above problems, the embodiment provides a compatible method for self-service terminal printers, which realizes the compatibility of multiple brands of printers, protects privacy through encrypted transmission, automatically switches to a backup printer, and improves the stability and security of medical self-service terminal printing services by defining a standard interface and creating an adapter class.

[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.

[0023] Please refer to Figure 1 Fig. 1 is a flowchart of a compatible method for self-service terminal printers in a specific embodiment, and the method includes the following steps: S1. Define a standard interface of printer operation, abstract the printer job function as a general operation template; the printer job function includes printing, status query and configuration; It should be noted that the printer operation is abstracted as a unified standard interface, so that subsequent operations on different printers are based on this standard, improving the maintainability and scalability of the code, providing a basis for compatibility with multiple printers; S2. Create an adapter class for each printer type, define the conversion logic between the printer protocol and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; It should be noted that the adapter class is customized for each printer type and compiled into a dynamic library, which realizes the conversion between the printer protocol and the standard interface, facilitates the self-service terminal to load the adapter of different printers as needed, and enhances compatibility and adaptability; S3. Create a multi-protocol printer calling interface to provide a calling path for the calling needs of different types of applications; It should be noted that the calling needs of different types of applications are met, and diversified calling paths are provided, so that the printing function can be integrated into various application environments, expanding the application scenarios of the self-service terminal; S4. Add the type of the currently used printer device to the configuration file of the self-service terminal, dynamically load the corresponding adapter dynamic library according to the type, and instantiate the adapter object; It should be noted that the correspondence between the printer type and the adapter dynamic library is managed through the configuration file, realizing seamless switching when the printer device is replaced or added, without the need to modify a large amount of code, reducing maintenance cost and error risk; S5. Receive an encrypted print request, parse the calling path and encrypted print data, decrypt the encrypted print data and generate a standard print job object; It should be noted that the print data is encrypted and decrypted, preventing data leakage during transmission, protecting user privacy and important hospital data, and improving the security of the self-service terminal; S6. Use the adapter object to convert the standard print job object into a target printer job function instruction stream according to the printer protocol and execute it; It should be noted that the standard print job object is converted into a specific printer recognizable instruction stream through the adapter object, ensuring that different printers can accurately execute the print task, improving the accuracy and reliability of printing; S7. Real-time polling of printer status, triggering an early warning when identifying that the consumable level is below a threshold, and automatically switching to a backup printer and re-executing steps S4-S6 when identifying a printer failure; It needs to be explained that real-time control of the printer status, timely warning of insufficient consumables and printer failure, and automatic switching of the standby printer can minimize service interruption time, ensure the continuous normal operation of the self-service terminal, and improve the service quality and patient satisfaction of the hospital.

[0024] The embodiment defines a standard interface, creates an adapter class and compiles it into a dynamic library, builds a multi-protocol calling interface, realizes efficient compatibility with different brands and models of printers, encrypts the print request to ensure data transmission security, monitors the printer status in real time, warns of insufficient consumables and automatically switches to the standby printer to reduce service interruption time, dynamically loads the adapter to facilitate the addition of new printer types, reduces development cost and maintenance difficulty, and ultimately improves the compatibility, security and reliability of the medical self-service terminal printing service, optimizes the hospital service process, and improves the patient experience.

[0025] Further, as a refinement and extension of the above embodiment, in order to fully describe the specific implementation process in this embodiment, another compatible method of a self-service terminal printer is provided, which comprises the following steps: S1. Define a standard interface for printer operation, and abstract printer job functions into a general operation template; the printer job functions include printing, status query and configuration; step S1 specifically comprises the following steps: S11. Define a standard interface for printer operation, define a print function for executing a print job function, a status query function for obtaining a printer device status, and a configuration function for updating a printer parameter; Illustratively, the print function is defined as execute_print(content), which receives structured print content as an argument and returns a Boolean value indicating print success / failure; The status query function is defined as get_status(), which has no parameters and returns a dictionary containing "device online status, consumable amount, error code"; The configuration function is defined as update_config(params), which receives a parameter dictionary (such as {"print_speed":3, "darkness":5}) and returns the configuration update result; S12. Build a general operation template for the print function: Encapsulate the print request content into a structured object containing metadata, including coordinate positioning, font specifications and encrypted identifiers; Illustratively, in the print request of a certain hospital self-service terminal, the structured object is as follows: { "metadata": { "coordinates": {"x": 50, "y": 100}, / / Starting coordinates of the printed content on the paper "font": {"name": "SimSun", "size": 12, "bold": true}, / / Font specifications "encryption_id": "MD5-20250720-1a3b5c" / / Encryption identifier used to verify data integrity }, "content": "Patient Name: xxx | Consultation Number: 20250720001 | Examination Item: Complete Blood Count" / / Core Printable Content } S2. Create an adapter class for each printer type, define the conversion logic between the printer protocol and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; the specific steps of step S2 are as follows: S21. Create a unique dynamic link library for each printer type, and build the protocol conversion logic of the adapter class within the dynamic link library: Map the standard interface to the instruction sequence of the corresponding printer job function; Map the data returned by the printer job function to a format recognizable by the standard interface; For example, consider "dot matrix printers" and "thermal printers": When the standard interface calls execute_print(content): The dot matrix printer adapter will convert the content into an "ESC / POS command set" (such as ESC@ to initialize the printer, ESC! to set the font size); The thermal printer adapter will be converted to the "TSPL instruction set" (such as SIZE 80mm, 100mm to define paper size, TEXT instruction to write text); When the printer returns status data: The "0x01" code returned by the dot matrix printer will be converted to the standard interface {"status":"paper_empty"}; The "E02" code returned by the thermal printer is also converted to {"status":"paper_empty"} to achieve a unified status format; S22. Use a compiler to compile the source code of each adapter class into a dynamic link library for the platform to which the self-service terminal belongs; Exemplarily, the Linux platform generates a dynamic link library in the.so file format, the Windows platform generates a dynamic link library in the.dll file format, and the macOS platform generates a dynamic link library in the.dylib file format; S3. Create a multi-protocol printer calling interface to provide a calling path for the calling requirements of different types of applications; the specific steps of step S3 are as follows: S31. Construct a calling path of a dynamic link library for a local application of the self-service terminal to respond to a printing task; Exemplarily, the “social security payment certificate printing” local program of the self-service terminal directly calls the execute_print method in libprinter_adapter.so (Linux) through a system function to trigger a printing task; S32. Construct a calling path of an HTTP-REST interface for a Web application to trigger a printing task in response to an HTTP request; Exemplarily, when a user clicks “print” on the “report query” page of the hospital official website, the front end sends encrypted data through a POST / api / print request, and the back end HTTP-REST interface receives and parses the encrypted data and calls the printing logic; S33. Construct a calling path of a WebSocket interface for a mobile application of a client to respond to a printing task in real time communication; Exemplarily, a user scans the two-dimensional code of the self-service terminal through a mobile phone APP to establish a WebSocket connection, and sends a “copy of ID card” instruction in real time. The self-service terminal receives the request through the long connection and immediately executes printing; S4. Add the type of the currently used printer device to the configuration file of the self-service terminal, dynamically load the corresponding adapter dynamic library according to the type, and instantiate the adapter object; the specific steps of step S4 are as follows: S41. Add the type identification code of the currently used printer device to the configuration file of the self-service terminal in the form of a configuration item; S42. After the self-service terminal is started, the type identification code of the printer device in the configuration item of the configuration file is parsed, and the matching adapter class dynamic library is loaded through the operating system dynamic loader to call the adapter instance function in the dynamic library for adapter object instantiation; S5. Receive an encrypted printing request, parse the calling path and encrypted printing data, decrypt the encrypted printing data, and generate a standard printing job object; the specific steps of step S5 are as follows: S51. Receive an encrypted printing request, and parse the message header to separate the calling path identifier and the encrypted data block; S52. Select a decryption method according to the calling path identifier: If the calling path identifier is a dynamic link library, the encrypted data block is decrypted using the emergency security module; If the calling path is an HTTP-REST interface or a WebSocket interface, the encrypted data block is decrypted using a TLS session key; S53. Construct a standard print job object according to the decryption result and the standard interface, and fill the coordinate positioning, font specification, and encrypted identifier of the print content into the general operation template of the print function; S6. Convert the standard print job object into an instruction stream of the target printer job function according to the printer protocol using the adapter object and execute it; the specific steps of step S6 are as follows: S61. Call the job conversion function of the adapter object, protocol-encapsulate the data content of the standard print job object, convert it into a print instruction sequence matching the target printer type, and adapt to the processing needs of the target printer; Exemplarily, the print instruction sequence includes text layout instructions, image rendering instructions, and barcode generation function instructions; S62. Encapsulate the print instruction sequence into an instruction stream, transmit it to the target printer device through a secure communication channel, execute a physical printing operation, and output a print job; S7. Poll the printer status in real time, trigger a warning when it is identified that the consumable level is below a threshold, and automatically switch to a backup printer and re-execute steps S4-S6 when a printer failure is identified; the specific steps of step S7 are as follows: S71. Perform dual-mode polling: Send a status query instruction to the printer at a preset time interval through the status query function of the adapter object, and obtain the status code returned by the printer; Listen to the printer event interrupt through the listening function of the adapter object, and extract the status code from the printer event; S72. Convert the status code returned by the printer into a unified state enumeration value according to a preset mapping rule, and configure a corresponding state response action for each unified state enumeration value; Exemplarily, when the status code is 0xA1, it indicates that the paper level is <10%, and a warning is sent to the operation and maintenance platform; When the status code is 0xB2, it indicates a paper jam error, and an automatic obstacle removal operation is triggered; When the status code is 0xC3, it indicates a hardware failure, and a fault switching process is executed; S73. When the status code is a printer failure, record the printer fingerprint in a blacklist, select an optimal backup printer device from a printer pool, and hot update the configuration file and reload the adapter according to steps S4-S6.

[0026] It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0027] As Figure 2 shown below is an embodiment of a compatible system of a self-service terminal printer provided by the embodiments of the present disclosure, which belongs to the same inventive concept as the compatible method of the self-service terminal printer of the above embodiments. Details not described in the embodiment of the compatible system of the self-service terminal printer can be referred to the above embodiments of the compatible method of the self-service terminal printer.

[0028] The system comprises: An interface abstraction module is configured to define a standard interface of printer operation, and abstract printer job functions into a general operation template; the printer job functions include printing, status query and configuration; An adapter dynamic library construction module is configured to create an adapter class for each printer type, define conversion logic between printer protocols and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; A multi-protocol calling path construction module is configured to create a multi-protocol printer calling interface, and provide a calling path for calling requirements of different types of applications; A dynamic loading module is configured to add the type of the currently used printer device to the configuration file of the self-service terminal, dynamically load the corresponding adapter dynamic library according to the type, and instantiate an adapter object; A print data security processing module is configured to receive an encrypted printing request, parse out a calling path and encrypted print data, decrypt the encrypted print data, and generate a standard print job object; A protocol conversion execution module is configured to use the adapter object to convert the standard print job object into an instruction stream of target printer job functions according to the printer protocol and execute the instruction stream; A status monitoring module is configured to poll the printer status in real time, trigger a warning when it is identified that the consumable amount is below a threshold, and automatically switch to a backup printer and re-execute adapter loading, print data security processing, and print protocol conversion when it is identified that the printer is malfunctioning.

[0029] In this embodiment, the interface abstraction module, the adapter dynamic library construction module, the multi-protocol calling path construction module, the dynamic loading module, the print data security processing module, the protocol conversion execution module, and the status monitoring module interact and cooperate to achieve multi-brand printer compatibility, encrypted transmission to protect privacy, automatic switching to a backup printer, and improve the stability and security of medical self-service terminal printing services.

[0030] The compatible method of the self-service terminal printer provided in the embodiments of the present application can be applied to an electronic device. Those skilled in the art can understand that the structure of the electronic device involved in the embodiments of the present application does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than the diagram, or combine certain components, or different component arrangements. In the embodiments of the present application, the electronic device includes but is not limited to a laptop computer, a desktop computer, a workstation, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or claimed herein.

[0031] The electronic device can include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, a key, a camera, a display screen, and a SIM card interface, and the like.

[0032] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than the diagram, or combine certain components, or split certain components, or different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.

[0033] The processor can include one or more processing units, such as: the processor can include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0034] The processor can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0035] The memory in the processor can also be configured to store instructions and data. In some embodiments, the memory in the processor is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor. If the processor needs to use the instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor, thereby improving the efficiency of the system.

[0036] The electronic device realizes the definition of the standard interface of the printer operation of the self-service terminal printer compatible method of the application, abstracts the printer job function as a general operation template, and the printer job function includes printing, status query and configuration. An adapter class is created for each printer type, the conversion logic between the printer protocol and the standard interface is defined in the adapter class, and each adapter class is compiled into a corresponding adapter dynamic library. A multi-protocol printer calling interface is created to provide a calling path for the calling needs of different types of applications. The type of the currently used printer device is added to the configuration file of the self-service terminal, the corresponding adapter dynamic library is dynamically loaded according to the type, and the adapter object is instantiated. The encrypted printing request is received, the calling path and the encrypted printing data are parsed, the encrypted printing data is decrypted and a standard printing job object is generated. The adapter object is used to convert the standard printing job object into the instruction stream of the target printer job function according to the printer protocol and execute it. The printer state is polled in real time, a warning is triggered when it is identified that the consumable amount is lower than the threshold, and when a printer failure is identified, the standby printer is automatically switched and the adapter loading, printing data security processing and printing protocol conversion are re-executed. The technical scheme achieves the beneficial effects of multi-brand printer compatibility, encrypted transmission to protect privacy, automatic switching of standby printers, and improved stability and security of medical self-service terminal printing services by defining a standard interface and creating an adapter class.

[0037] In the storage medium provided in the application, a program product capable of realizing the compatible method of the self-service terminal printer is stored.

[0038] The compatible method of the self-service terminal printer comprises: defining a standard interface of printer operation, abstracting printer job functions into a general operation template; the printer job functions comprise printing, status query and configuration; creating an adapter class for each printer type, defining conversion logic between the printer protocol and the standard interface in the adapter class, and compiling each adapter class into a corresponding adapter dynamic library; creating a multi-protocol printer calling interface, providing a calling path for calling requirements of different types of applications; adding the type of the currently used printer device to the configuration file of the self-service terminal, dynamically loading the corresponding adapter dynamic library according to the type, and instantiating an adapter object; receiving an encrypted printing request, parsing the calling path and encrypted printing data, decrypting the encrypted printing data and generating a standard printing job object; using the adapter object to convert the standard printing job object into an instruction stream of the target printer job function according to the printer protocol and executing the instruction stream; polling the printer status in real time, triggering a warning when it is identified that the consumable level is lower than a threshold, and automatically switching to a backup printer and re-executing adapter loading, printing data security processing and printing protocol conversion when it is identified that the printer is malfunctioning.

[0039] In some possible implementation manners, the compatible method of the self-service terminal printer of the present disclosure can be implemented in the form of a program product, which comprises program codes for causing a terminal device to perform the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of the present specification when the program product is run on the terminal device.

[0040] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0041] The above description of disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A compatibility method for self-service terminal printers, characterized in that, Includes the following steps: S1. Define a standard interface for printer operation, and abstract printer job functions into a general operation template; the printer job functions include printing, status query, and configuration; S2. Create an adapter class for each printer type, define the conversion logic between the printer protocol and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; S3. Create a multi-protocol printer call interface to provide call paths for the call needs of different types of applications; S4. Add the type of the currently used printer device to the configuration file of the self-service terminal, dynamically load the corresponding adapter dynamic library according to the type, and instantiate the adapter object; S5. Receive the encrypted print request, parse out the call path and encrypted print data, decrypt the encrypted print data and generate a standard print job object; S6. Use the adapter object to convert the standard print job object into a command stream for the target printer job function according to the printer protocol and execute it; S7. Poll the printer status in real time. When the consumables level is found to be below the threshold, trigger an alarm. When a printer malfunction is detected, automatically switch to a backup printer and re-execute steps S4-S6.

2. The compatibility method for self-service terminal printers according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Define the standard interface for printer operation, including the printing function for executing print jobs, the status query function for obtaining printer device status, and the configuration function for updating printer parameters; S12. Construct a general template for printing functions: The requested print content is encapsulated into a structured object containing metadata, including coordinates, font specifications, and encryption identifiers.

3. The compatibility method for self-service terminal printers according to claim 2, characterized in that, The specific steps of step S2 are as follows: S21. Create a unique dynamic link library for each printer type, and build the protocol conversion logic of the adapter class within the dynamic link library: Map the standard interface to the instruction sequence of the corresponding printer job function; Map the data returned by the printer job function to a format recognizable by the standard interface; S22. Use the compiler to compile the source code of each adapter class into a dynamic link library for the platform to which the self-service terminal belongs.

4. The compatibility method for self-service terminal printers according to claim 3, characterized in that, The specific steps of step S3 are as follows: S31. Build the dynamic link library call path for the local application of the self-service terminal and respond to the print task; S32. Build the call path for the HTTP-REST interface of the web application and trigger the print task in response to the HTTP request; S33. Build the WebSocket interface call path for the client's mobile application and respond to real-time communication printing tasks.

5. The compatibility method for self-service terminal printers according to claim 4, characterized in that, The specific steps of step S4 are as follows: S41. Add the type identifier code of the currently used printer device to the configuration file of the self-service terminal as a configuration item; S42. After the self-service terminal starts, it parses the printer device type identifier code in the configuration item of the configuration file, loads the matching adapter class dynamic library through the operating system dynamic loader, and calls the adapter instance function in the dynamic library to instantiate the adapter object.

6. The compatibility method for self-service terminal printers according to claim 5, characterized in that, The specific steps of step S5 are as follows: S51. Receive the encrypted print request, parse the message header, and separate the call path identifier and encrypted data block; S52. Select the decryption method based on the call path identifier: If the calling path identifier is a dynamic link library, use the emergency security module to decrypt the encrypted data block; If the call path is an HTTP-REST interface or a WebSocket interface, use the TLS session key to decrypt the encrypted data block; S53. Construct a standard print job object based on the decryption result and standard interface, and fill the coordinate positioning, font specifications and encryption identifier of the print content into the general operation template of the print function.

7. The compatibility method for self-service terminal printers according to claim 6, characterized in that, The specific steps of step S6 are as follows: S61. Call the job conversion function of the adapter object to encapsulate the data content of the standard print job object into a sequence of print instructions that matches the target printer type, thus adapting to the processing requirements of the target printer. S62. Encapsulate the print instruction sequence into an instruction stream, transmit it to the target printer device through a secure communication channel, perform physical printing operations, and output the print job.

8. The compatibility method for self-service terminal printers according to claim 7, characterized in that, The specific steps of step S7 are as follows: S71. Perform dual-mode polling: The status query function of the adapter object is used to send a status query command to the printer at preset time intervals to obtain the status code returned by the printer. Listen for printer event interruptions using the adapter object's listener function and extract the status code from the printer events; S72. Convert the status code returned by the printer into a unified status enumeration value according to the preset mapping rules, and configure the corresponding status response action for each unified status enumeration value; S73. When the status code is printer malfunction, record the printer fingerprint to the blacklist, select the best backup printer from the printer pool, and perform hot update of the configuration file and reload the adapter according to steps S4-S6.

9. A compatible system for self-service terminal printers, characterized in that, include: The interface abstraction module is used to define the standard interface for printer operation, abstracting printer job functions into a general operation template. The printer job functions include printing, status query, and configuration; The adapter dynamic library building module is used to create an adapter class for each printer type, define the conversion logic between the printer protocol and the standard interface in the adapter class, and compile each adapter class into a corresponding adapter dynamic library; The multi-protocol call path building module is used to create multi-protocol printer call interfaces and provide call paths for the call requirements of different types of applications. The dynamic loading module is used to add the type of the currently used printer device to the configuration file of the self-service terminal, dynamically load the corresponding adapter dynamic library according to the type, and instantiate the adapter object. The print data security processing module is used to receive encrypted print requests, parse out the call path and encrypted print data, decrypt the encrypted print data and generate standard print job objects. The protocol conversion execution module is used to convert a standard print job object into a stream of instructions for the target printer job function according to the printer protocol using an adapter object and then execute it. The status monitoring module is used to poll the printer status in real time. When it detects that the consumables are below the threshold, it triggers an alarm. When it detects a printer malfunction, it automatically switches to a backup printer and re-executes adapter loading, print data security processing, and print protocol conversion.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the compatible method for a self-service terminal printer as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Printing method and device, electronic equipment and computer readable storage medium

    CN113190187A

  • Printing method and device, equipment and storage medium

    CN118151869A

  • Printer intelligent switching and calibration system for computer printing

    CN120335736A