Printing method based on lightweight UI framework, intelligent hardware, storage medium and electronic equipment
By calling the printing service and encapsulation service of the lightweight UI framework in the smart hardware, the printing command is converted into a command-line command, which solves the problem that the lightweight UI framework device cannot print files and realizes the connection with the printer and file printing.
Patent Information
- Application Number
- CN202510905092.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-11-25
AI Technical Summary
In the existing technology, smart hardware with a lightweight UI framework cannot connect to a printer to print documents.
When a print request is received by smart hardware, the print service in the lightweight UI framework is invoked to generate a print command, which is then encapsulated as a command-line command and sent to a general printing system to control the printer to print the file.
Smart devices with a lightweight UI framework can connect to printers to complete document printing tasks.
Smart Images

Figure HDA0005478761190000011 
Figure HDA0005478761190000012 
Figure HDA0005478761190000021
Abstract
Description
Technical Field
[0001] This application relates to the field of smart hardware, and more particularly to a printing method based on a lightweight UI framework, smart hardware, storage media, and electronic devices. Background Technology
[0002] With the development of the internet, devices such as computers and mobile phones can connect to printers to control the printing of documents. However, smart hardware such as dictionary pens with lightweight UI frameworks cannot connect to printers for document printing. Summary of the Invention
[0003] This application provides a printing method, apparatus, storage medium, and electronic device based on a lightweight UI framework to solve the technical problem that smart hardware with a lightweight UI framework installed cannot print documents.
[0004] In a first aspect, this application provides a printing method based on a lightweight UI framework, comprising: when the smart hardware receives a print request initiated by a target application, invoking a print service in the lightweight UI framework to generate a print command, wherein the print request is used to request the printing of a target file, and the print service is a service for cross-application invocation; invoking an encapsulation service to encapsulate the print command into a command-line command; and sending the command-line command to a general printing system of the smart hardware, so that the general printing system controls the printer to print the target file.
[0005] Secondly, this application provides a smart hardware, comprising: a calling module, configured to, upon receiving a print request initiated by a target application, call a print service in a lightweight UI framework to generate a print command, wherein the print request is used to request the printing of a target file, and the print service is a service for cross-application invocation; a calling encapsulation service, configured to encapsulate the print command into a command-line command; and a sending module, configured to send the command-line command to a general-purpose printing system of the smart hardware, so that the general-purpose printing system controls the printer to print the target file.
[0006] Thirdly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor is configured to implement any of the above-described printing methods based on a lightweight UI framework when executing the computer program.
[0007] Fourthly, this application also provides a computer storage medium storing computer-executable instructions, which are used to execute the printing method based on a lightweight UI framework described in any of the above claims of this application.
[0008] Compared with the prior art, the technical solution provided in this application has the following advantages: When the smart hardware receives a print request initiated by the target application, the solution provided in this application calls the print service in the lightweight UI framework to generate a print command. The print request is used to request the printing of a target file, and the print service is a service used for cross-application calls. The encapsulation service is called to encapsulate the print command into a command-line command. The command-line command is sent to the general printing system of the smart hardware so that the general printing system controls the printer to print the target file. This allows smart devices with a lightweight UI framework to connect to the printer and print files. Attached Figure Description
[0009] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0011] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0012] Figure 1 A flowchart illustrating a printing method based on a lightweight UI framework provided in this application embodiment;
[0013] Figure 2 A flowchart illustrating another printing method based on a lightweight UI framework provided in this application embodiment;
[0014] Figure 3 A printing flowchart of a printing method based on a lightweight UI framework provided for embodiments of this application;
[0015] Figure 4 A schematic diagram of the services at each layer of a smart hardware device provided in an embodiment of this application;
[0016] Figure 5A schematic diagram of a smart hardware provided in an embodiment of this application;
[0017] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0020] To address the technical problem that smart hardware with a lightweight UI framework cannot print documents in the prior art, this application provides a printing method based on a lightweight UI framework, which can achieve the effect of printing documents on smart devices with a lightweight UI framework.
[0021] Figure 1 A flowchart illustrating a printing method based on a lightweight UI framework, provided as an embodiment of this application. Figure 1 As shown, the printing method based on the lightweight UI framework includes:
[0022] S102, when the smart hardware receives a print request initiated by the target application, it calls the print service in the lightweight UI framework to generate a print command. The print request is used to request the printing of the target file, and the print service is a service used for cross-application calls.
[0023] S104, Invoke the encapsulation service to encapsulate the above print command into a command line command;
[0024] S106, the above command line command is sent to the general printing system of the above-mentioned smart hardware so that the general printing system controls the printer to print the above-mentioned target file.
[0025] The aforementioned printing method based on a lightweight UI framework can be applied to scenarios where smart hardware is used to print documents. The smart hardware is an embedded device with a screen that uses a lightweight UI display framework. The User Interface Designer (UI) display framework refers to the software framework used to build and manage the user interface; that is, the software framework used when displaying content on the user terminal's display interface. The lightweight UI display framework is a software framework used in embedded systems to develop and manage the user interface. It is a graphical user interface system specifically designed for resource-constrained embedded devices, such as dictionary pens, audio players, or similar learning hardware. This lightweight UI display framework and the aforementioned printing method based on it can be applicable. The lightweight UI display framework can be a cross-platform UI display framework (Hardware as a Service User Interface, HaasUI), an embedded graphics library (Light and Versatile Graphics Library, LVGL), or a graphical interface development tool like Qt for Embedded. In this embodiment, when a user uses smart hardware with a lightweight UI framework, they can connect a printer to print documents from the smart hardware.
[0026] In this embodiment, the smart hardware can run an application (APP). Users can print documents through the application while using it. For example, if the application is a classroom application to assist learning, classroom learning documents can be printed out. Alternatively, the application can be a scanning program that calls the printer to print out the content scanned by the smart hardware.
[0027] In this embodiment, the application requesting the print request can be considered the target application. The print request initiated by the target application is received. Since the target application is an application installed on the smart hardware and lacks the ability to acquire or perceive other applications, after the application initiates the print request, the smart hardware calls the print service within the lightweight UI framework to generate the print command. This print service is a service within the lightweight UI framework used to perceive other applications, enabling cross-application calls. After calling the print service in the lightweight UI framework, the print service generates the print command from the target application's print request and transmits the print command to the encapsulation service. The encapsulation service encapsulates the print command into a command-line command, which can then be sent to the smart hardware's general-purpose printing system. The general-purpose printing system then controls the printer to print the target file.
[0028] For example, such as Figure 2 As shown, a user can initiate a print request when using the target application. The print request generates a print command by calling the print service. The print service is used for cross-application calls; the target application calls the print service to invoke the encapsulated service. After obtaining the print command, the encapsulated service encapsulates it into a command-line command. This command-line command can be recognized by the Common UNIX Printing System (CUPS), which then sends the print instruction to the printer, instructing the printer to print the target document.
[0029] In this embodiment, the universal printing system can be an executable program obtained by compiling code. The compiled code for the universal printing system can be obtained online or programmed manually. If obtained online, some open-source compiled code can be acquired and compiled to create the universal printing system. If programmed manually, the programmed code is then compiled into the universal printing system.
[0030] Since the code for general printing systems may differ, certain adjustments can be made during compilation to adapt to the printing process of this embodiment. For example, before compiling the code, the allowed data format of printing information can be determined. For instance, if the code defines the format for data such as the number of pages to print and the number of copies to print, this format is passed to the packaging service. The packaging service then packages the corresponding printing information into the appropriate format during the packaging process.
[0031] If the generic printing system does not pass the data format of the allowed printing information to the encapsulation service before compilation, the target application can query the generic printing system through the encapsulation service after calling the printing service to determine the format requirements of the generic printing system, and then encapsulate according to the format requirements.
[0032] The solution provided in this application embodiment, when the smart hardware receives a print request initiated by the target application, calls the print service in the lightweight UI framework to generate a print command. The print request is used to request the printing of a target file, and the print service is a service used for cross-application calls. The encapsulation service is called to encapsulate the print command into a command-line command. The command-line command is sent to the general printing system of the smart hardware so that the general printing system controls the printer to print the target file. This allows smart devices with a lightweight UI framework to connect to the printer and print files.
[0033] As an optional example, before receiving the print request, the method further includes: configuring the print service in the lightweight UI framework, wherein the print service is configured with a permission identifier, which is used to indicate the applications that are allowed to call the print service.
[0034] In this embodiment, to achieve the effect of printing target files by applications on smart hardware, a printing service can be configured in a lightweight UI framework. After configuring the printing service, the target application can print the target file through the printing service. The printing service can be configured by embedding a printing program into the lightweight UI framework. The embedded printing program, i.e., the printing service, can be adapted to all applications on the smart hardware, or it can be configured to allow only some applications on the smart hardware to use it based on permission identifiers. If only some applications on the smart hardware are allowed to use it, a permission identifier record table is preset in the printing service. For target applications that have permission to use the printing service, the permission identifier is recorded in the permission identifier record table. For applications that do not have permission to use the printing service, the printing request from that application may not be responded to, or an error result may be returned.
[0035] Different printing services can be provided for different smart hardware, such as smart hardware with different operating systems, models, or functions, so as to be compatible with the smart hardware.
[0036] As an optional example, before receiving the above-mentioned print request, the method further includes: configuring the above-mentioned encapsulation service in the hardware system of the above-mentioned smart hardware, wherein the above-mentioned encapsulation service is configured with a command form before encapsulation and a command form after encapsulation, and the command form after encapsulation is the above-mentioned command line command.
[0037] In this embodiment, after configuring the printing service in the aforementioned lightweight UI framework, when the target application wants to print a target file, it will call the printing service to achieve cross-application communication. The printing service converts the target application's print request into a print command, which is then handed over to the encapsulation service for encapsulation. In this embodiment, the encapsulation service is a service configured in the hardware system of the smart hardware. Upon receiving the print command, it needs to encapsulate the print command according to its command format and the required encapsulated command format.
[0038] In this embodiment, the print command format is generally uniform. That is, after the print service in the lightweight UI framework is invoked, it converts the print request into this print command. The format of this print command is fixed; only the file to be printed and the parameters related to that file differ. However, the format of the encapsulated print command must be encapsulated according to the requirements of a general printing system. In other words, the original print command is encapsulated into a format that the general printing system can recognize. In this embodiment, the general printing system can be a system capable of recognizing command-line commands, so the encapsulation service encapsulates the print command into a command-line command.
[0039] As an optional example, before receiving the above-mentioned print request, the method further includes: obtaining the code of the above-mentioned general printing system; compiling the above-mentioned code locally on the above-mentioned smart hardware to obtain the compiled above-mentioned general printing system.
[0040] The universal printing system in this embodiment can be a system obtained by locally compiling code. The universal printing system's functionality is written in code, which can then be compiled locally on the smart hardware to produce a binary executable program. Upon receiving a packaged print command, the compiled binary executable program connects to the printer via the smart device's wireless network and controls the printer to print the target document.
[0041] As an optional example, after sending the command line command to the general printing system of the smart hardware, the method further includes: when the printer finishes printing each document, the general printing system sends the printing result back to the packaging service, the packaging service sends the printing result back to the lightweight UI framework, and the lightweight UI framework sends the printing result back to the target application so that the target application can display the real-time printing progress.
[0042] In this embodiment, various applications on the smart hardware can request to print files. These print requests are arranged sequentially, and the smart hardware prints the files in that order. Since the files are printed by sending commands to the printer via a universal printing system, the printer sends a print result back to the universal printing system after completing the print. The universal printing system then sends the print result back to the lightweight UI framework via a wrapper service. The lightweight UI framework then sends the print result back to the application that initiated the print request. This allows the application to display the real-time printing progress.
[0043] If multiple print requests are initiated by the same application, the print progress can be displayed on that application. If multiple print requests are initiated by different applications, the print progress can be displayed on the smart hardware's operating system after the print result of a certain file is notified to the corresponding application.
[0044] As an optional example, the general printing system that sends the command line command to the smart hardware includes: when the general printing system does not detect the smart hardware, re-encapsulating the printing command through the encapsulation service to obtain the encapsulated command; and storing the encapsulated command in the printing queue for later invocation.
[0045] In this embodiment, the target application initiates a print request, generates print commands through a lightweight UI framework, encapsulates the commands through an encapsulation service, and finally prints the target file through a universal printing system. Some of these components—the lightweight UI framework, the encapsulation service, and the universal printing system—may not be found under certain circumstances. For example, this embodiment uses a universal printing system to establish a connection with the printer and send print commands. If the universal printing system is not found on the smart hardware, the encapsulated print commands generally cannot be transmitted to the printer. This could be due to the universal printing system not being compiled on the smart hardware, or the universal printing system not starting correctly, or not being fully prepared after starting. Therefore, in this embodiment, the encapsulated print commands can be stored in a print queue, waiting to be called. If the universal printing system is not found due to not starting or not being fully prepared after starting, it can automatically search for print commands in the print queue after the universal printing system has started and send them to the printer for printing.
[0046] This method can automatically search for and print print commands in the print queue after the general printing system has started up, without requiring the user to repeatedly initiate print requests.
[0047] As an optional example, the above-mentioned call to the encapsulation service to encapsulate the above-mentioned print command into a command-line command includes: when the above-mentioned encapsulation service is not detected, sending the above-mentioned print request directly to the above-mentioned general printing system.
[0048] In this embodiment, if the encapsulation service is not detected, it may be because the encapsulation service is not started or is not installed. In this case, the print request can be directly sent to the general printing system. Normally, if the print request is directly sent to the general printing system, the system will not be able to recognize it because the print request does not match the command format or form of the general printing system. However, in this embodiment, the print request is sent directly to the general printing system because the system may retain the function of encapsulating requests of specific formats during programming. Therefore, after the print request is sent to the general printing system, the system can convert the format of the print request to obtain a command-line command that it can recognize, and then send it to the printer for printing.
[0049] If neither the packaging service nor a general printing system is installed in this embodiment, then you can try sending the print request directly to the printer. If the printer has a recognition function, it can recognize the print request and print it.
[0050] The above examples are optional attempts only. If the general printing system does not have encapsulation functionality or the printer does not have the relevant function, an error message may be returned after the print request is sent, indicating that the printing cannot be completed.
[0051] Figure 3 This is a schematic diagram of the printing process in this embodiment. The third-party APP is the target application. The APP calls the HaaSUI service, which is the printing service in the lightweight HaaSUI framework. The HaaSUI service calls the local Hypertext Transfer Protocol (HTTP) service, which is the encapsulation service. The encapsulation service calls the CUPS service, which instructs the printer to print the target file.
[0052] CUPS is cross-compiled to produce a binary executable program usable on Advanced RISC Machines (ARM). It can be compiled using the arm-linux cross-compilation toolchain. Since it does not require the use of Universal Serial Bus (USB), the disable-libusb parameter can be turned off. A local HTTP service provides an interface for print control. When transmitting print commands, print information such as file information and parameters (page number, number of copies, paper size, etc.) can be carried. The application can control CUPS to access the printer through the print service in HaaSUI by calling the local HTTP request.
[0053] When an app needs to print, it calls the print service via HaaSUI's service API. For example, it uses the `print` command followed by a local file path. Then, it waits for an asynchronous response. Upon receiving the print command and file path, HaaSUI's print service sends an HTTP request to the cups service process, notifying it to send the print command and file path via an HTTP request and wait for a response. The cups service process, upon receiving the print command and file path, can then construct the command-line arguments required by cups and directly call cups to print. After printing is complete, the cups command returns a result, which becomes the HTTP response from the local HTTP service. Once the print service receives the cups result from the HTTP request, it can asynchronously notify the app of the result through HaaSUI's service mechanism.
[0054] Figure 4 This is a schematic diagram of the services at each layer of the smart hardware in this embodiment. The APP is located in the application layer and prints by calling the printing service of HaaSUI in the application layer. The printing service calls the local HTTP service in the service layer to execute a shell command, notifies the CUPS process, and notifies the printer to print the document via the Internet Printing Protocol (IPP).
[0055] Figure 5 This is a schematic diagram of a smart hardware device according to this embodiment. It includes:
[0056] Module 502 is invoked to call the print service in the lightweight UI framework to generate print commands when a print request is received from the target application. The print request is used to request the printing of the target file, and the print service is a service used for cross-application calls. The encapsulation service is invoked to encapsulate the print commands into command-line commands.
[0057] The sending module 504 is used to send command line commands to the general printing system of the smart hardware so that the general printing system controls the printer to print the target file.
[0058] The aforementioned smart hardware can be applied in scenarios where smart hardware is used to print documents. The smart hardware is an embedded device with a screen and a lightweight UI display framework. The User Interface Designer (UI) display framework refers to the software framework used to build and manage the user interface; that is, the software framework used when displaying content on the user terminal's display interface. The lightweight UI display framework refers to the software framework used in embedded systems to develop and manage the user interface. It is a graphical user interface system specifically designed for resource-constrained embedded devices, such as dictionary pens, audio learning devices, or similar learning hardware. The lightweight UI display framework can be a cross-platform UI display framework (Hardware as a Service User Interface, HaasUI), an embedded graphics library (Light and Versatile Graphics Library, LVGL), or a graphical interface development tool like Qt for Embedded. In this embodiment, when a user uses the smart hardware with the lightweight UI framework, they can connect a printer to print documents from the smart hardware.
[0059] In this embodiment, the smart hardware can run an application (APP). Users can print documents through the application while using it. For example, if the application is a classroom application to assist learning, classroom learning documents can be printed out. Alternatively, the application can be a scanning program that calls the printer to print out the content scanned by the smart hardware.
[0060] In this embodiment, the application requesting the print request can be considered the target application. The print request initiated by the target application is received. Since the target application is an application installed on the smart hardware and lacks the ability to acquire or perceive other applications, after the application initiates the print request, the smart hardware calls the print service within the lightweight UI framework to generate the print command. This print service is a service within the lightweight UI framework used to perceive other applications, enabling cross-application calls. After calling the print service in the lightweight UI framework, the print service generates the print command from the target application's print request and transmits the print command to the encapsulation service. The encapsulation service encapsulates the print command into a command-line command, which can then be sent to the smart hardware's general-purpose printing system. The general-purpose printing system then controls the printer to print the target file.
[0061] For example, such as Figure 2As shown, a user can initiate a print request when using the target application. The print request generates a print command by calling the print service. The print service is used for cross-application calls; the target application calls the print service to invoke the encapsulated service. After obtaining the print command, the encapsulated service packages it into a command-line command. This command-line command can be recognized by the general-purpose printing system CUPS, which then sends the print instruction to the printer, instructing the printer to print the target document.
[0062] The solution provided in this application embodiment, when the smart hardware receives a print request initiated by the target application, calls the print service in the lightweight UI framework to generate a print command. The print request is used to request the printing of a target file, and the print service is a service used for cross-application calls. The encapsulation service is called to encapsulate the print command into a command-line command. The command-line command is sent to the general printing system of the smart hardware so that the general printing system controls the printer to print the target file. This allows smart devices with a lightweight UI framework to connect to the printer and print files.
[0063] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.
[0064] like Figure 6 As shown in the figure, this application provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0065] Memory 113 is used to store computer programs;
[0066] In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the printing method based on a lightweight UI framework provided in any of the foregoing method embodiments.
[0067] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the printing method based on a lightweight UI framework as provided in any of the foregoing method embodiments.
[0068] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0069] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0070] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0071] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A printing method based on a lightweight UI framework, characterized in that, include: When the smart hardware receives a print request initiated by the target application, it calls the print service in the lightweight UI framework to generate a print command. The print request is used to request the printing of the target file, and the print service is a service that can be called across applications. Call the encapsulation service to encapsulate the print command into a command-line command; The command line command is sent to the general printing system of the smart hardware so that the general printing system controls the printer to print the target file.
2. The method according to claim 1, characterized in that, Before receiving the print request, the method further includes: The printing service is configured in the lightweight UI framework, wherein the printing service is configured with a permission identifier, which is used to indicate the applications that are allowed to call the printing service.
3. The method according to claim 1, characterized in that, Before receiving the print request, the method further includes: The packaging service is configured in the hardware system of the smart hardware, wherein the packaging service is configured with a command form before packaging and a command form after packaging, and the command form after packaging is the command line command.
4. The method according to claim 1, characterized in that, Before receiving the print request, the method further includes: Obtain the code for the general printing system; The code is compiled locally on the smart hardware to obtain the compiled general printing system.
5. The method according to claim 1, characterized in that, After sending the command-line command to the general printing system of the smart hardware, the method further includes: When the printer finishes printing each document, the general printing system sends the printing result back to the packaging service. The packaging service then sends the printing result back to the lightweight UI framework, which in turn sends it back to the target application so that the target application can display the real-time printing progress.
6. The method according to claim 1, characterized in that, The general-purpose printing system that sends the command-line commands to the smart hardware includes: When the general printing system does not detect the smart hardware, the printing command is repackaged through the packaging service to obtain the packaged command; The encapsulated command is stored in the print queue, waiting to be called.
7. The method according to claim 1, characterized in that, The process of calling the encapsulation service to encapsulate the print command into a command-line command includes: If the encapsulation service is not detected, the print request is sent directly to the general printing system.
8. A smart hardware device, characterized in that, include: The calling module is used to call the printing service in the lightweight UI framework to generate printing commands when a print request is received from the target application. The print request is used to request the printing of the target file, and the printing service is a service that can be called across applications. The calling encapsulation service encapsulates the printing commands into command-line commands. The sending module is used to send the command line commands to the general printing system of the smart hardware, so that the general printing system controls the printer to print the target file.
9. An electronic device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; At least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the memory stores a computer program, and the processor executes the computer program to implement the printing method based on a lightweight UI framework as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions for performing the printing method based on a lightweight UI framework as described in any one of claims 1 to 7 of this application.