Printing method, electronic device, storage medium, and computer program product
By integrating multiple printing methods into the terminal device and selecting them cyclically based on priority information, the problem of poor printing program stability is solved, the printing success rate and stability are improved, and it can adapt to different scenario needs.
Patent Information
- Application Number
- PCT/CN2025/108424
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-22
- Filing Date
- 2025-07-14
- Publication Date
- 2026-01-29
AI Technical Summary
The existing printing program has poor stability and is affected by many factors such as network environment, device compatibility, software quality and user operation, resulting in an unstable printing process.
Multiple printing methods are integrated into the terminal device. Printing priority information is obtained, and printing is performed in a loop based on the priority information until success is achieved. This ensures that the priority of the printing method selected in each round is lower than that of the previous round, and the printing order can be flexibly adjusted.
It improves the success rate of printing and the stability of the process, and makes the printing process more flexible by setting priorities to adapt to different scenario needs.
Smart Images

Figure CN2025108424_29012026_PF_FP_ABST
Abstract
Description
Printing methods, electronic devices, storage media, and computer program products Technical Field
[0001] This application relates to the field of printing technology, and more particularly to a printing method, electronic device, storage medium, and computer program product. Background Technology
[0002] A printing app is an application installed on terminal devices such as smartphones and tablets. Users can remotely control the printer through the printing app to conveniently print documents, pictures, etc.
[0003] For example, some printing programs support cloud printing, where users can send print jobs to a cloud server via the network, and the cloud server will then forward them to the designated printer for printing.
[0004] However, while printing programs provide users with convenient printing solutions, the implementation of printing functions is affected by many factors such as network environment, device compatibility, software quality, and user operation, resulting in poor stability. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a printing method, electronic device, storage medium, and computer program product to improve the success rate and stability of printing.
[0006] To achieve the above technical objectives, the embodiments of this application provide the following technical solutions:
[0007] In a first aspect, embodiments of this application provide a printing method applied to a terminal device. The printing method includes: obtaining printing priority information, wherein the printing priority information represents the priority among multiple printing methods; repeatedly executing the step of selecting a printing method based on the printing priority information for printing until printing is successful; wherein the priority of the printing method selected in each round of the cycle is lower than the priority of the printing method selected in the previous round of the cycle.
[0008] Secondly, embodiments of this application provide a printing apparatus, comprising: an acquisition module for acquiring printing priority information, wherein the printing priority information represents the priority among multiple printing methods; and a looping module for repeatedly executing the step of selecting a printing method based on the printing priority information for printing until printing is successful; wherein the priority of the printing method selected in each loop is lower than the priority of the printing method selected in the previous loop.
[0009] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory; wherein the memory is connected to the processor and is used to store a computer program; the processor is used to implement the printing method as described in the first aspect by running the computer program stored in the memory.
[0010] Fourthly, embodiments of this application provide a storage medium storing a computer program, which, when run by a processor, implements the printing method as described in the first aspect.
[0011] Fifthly, embodiments of this application provide a computer program product on which a computer program is stored. When the computer program is executed by a processor, it implements the printing method as described in the first aspect.
[0012] The printing method provided in this application integrates multiple printing modes into a terminal device. First, it acquires printing priority information before printing, which represents the priority among various printing modes. Then, it iteratively executes the step of selecting a printing mode based on the printing priority information until printing is successful. This way, even if printing fails in one mode, other printing modes can still be selected to continue printing, improving the overall success rate and stability of the printing process. Furthermore, the priority of the printing mode selected in each round of iteration is lower than the priority of the printing mode selected in the previous round. The order in which printing modes are selected can be set through priority settings, making the printing process more flexible. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0014] Figure 1 is a schematic flowchart of a printing method provided in an embodiment of this application;
[0015] Figure 2 is a schematic diagram of the actual application of a printing method provided in an embodiment of this application;
[0016] Figure 3 is a flowchart illustrating the ZPL printing process in an embodiment of this application;
[0017] Figure 4 is a structural block diagram of a printing device provided in an embodiment of this application;
[0018] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] Unless otherwise defined, the technical or scientific terms used in the embodiments of this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to avoid confusion of the constituent elements.
[0020] Unless the context otherwise requires, throughout this specification, "a plurality of" means "at least two," and "including" is interpreted as open-ended or encompassing, that is, "including, but not limited to." In the description of this specification, terms such as "one embodiment," "some embodiments," "exemplary embodiment," "example," "specific example," or "some examples" are intended to indicate that a particular feature, structure, material, or characteristic associated with that embodiment or example is included in at least one embodiment or example of this application. The illustrative representations of the above terms do not necessarily refer to the same embodiment or example.
[0021] 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, and 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.
[0022] Overview
[0023] As described in the background section, in printing solutions using printing programs, various factors such as network environment, device compatibility, software quality, and user operation can affect the printing process or results. These factors can lead to instability in the printing process. To solve this problem, targeted optimization and development are usually required for each aspect. Furthermore, if a printing error or failure occurs, the system will typically automatically reprint or issue a relevant prompt. If reprinting fails or a printing failure or error message is issued directly, manual intervention is required to take appropriate measures to ensure the printing process can continue.
[0024] In response to the aforementioned technological limitations, the inventors of this application have moved beyond the aspects affecting printing stability and explored new avenues to expand the printing methods. They proposed a printing method that integrates multiple printing methods into the terminal device. First, printing priority information is obtained before printing. Then, the process of selecting a printing method based on this priority information is executed iteratively until printing is successful. This way, even if printing fails in one method, other methods can still be selected to continue printing, improving the overall success rate and stability of the printing process. Furthermore, the priority of the printing method selected in each round of iteration is lower than the priority of the method selected in the previous round. This priority setting allows for setting the order in which printing methods are selected, making the printing process more flexible.
[0025] Exemplary methods
[0026] This application provides a printing method applied to a terminal device, including mobile phones, laptops, desktop computers, smart wearable devices, etc. This embodiment uses a computer as an example for illustrative purposes. The printing method can be executed through an application installed on the computer, but is not limited thereto. As shown in Figure 1, the printing method may include:
[0027] S101: Get print priority information.
[0028] In this step, print priority information represents the priority among various printing methods. The number of printing methods includes, but is not limited to, two. Furthermore, the specific content of the printing method is not limited here; it can be any method capable of achieving the printing function. In some embodiments, print priority information can be stored in the cloud, and different terminal devices can retrieve print priority information from the cloud. The cloud can store different content of print priority information for different terminal devices or store the same content of print priority information. In other embodiments, print priority information can also be stored and maintained locally on the terminal device.
[0029] Different printing methods can have the same or different priorities. For example, priorities can be divided into three levels: high, medium, and low. Each printing method belongs to one of these levels. Of course, the priority division is not limited to this; the number of priority levels can include, but is not limited to, three.
[0030] In some embodiments, the priority among multiple printing methods is positively correlated with the target attributes of the printing methods; wherein the target attributes include at least one of printing efficiency and printing stability. For example, when the target attribute is printing efficiency, the higher the printing efficiency, the higher its priority or priority level, and the more likely it is to be selected in subsequent loops. Conversely, the lower the printing efficiency, the lower its priority or priority level, and the less likely it is to be selected in subsequent loops. Similarly, when the target attribute is printing stability, the higher the printing stability, the higher its priority or priority level, and the more likely it is to be selected in subsequent loops. Conversely, the lower the printing stability, the lower its priority or priority level, and the less likely it is to be selected in subsequent loops. When the target attributes include printing efficiency and printing stability, a comprehensive attribute value can be calculated based on a preset weight of the two. The higher the comprehensive attribute value, the higher its priority or priority level, and the more likely it is to be selected in subsequent loops. Conversely, the lower the comprehensive attribute value, the lower its priority or priority level, and the less likely it is to be selected in subsequent loops. One possible way to calculate the comprehensive attribute value is to pre-set the weights of the two attributes to 0.7 and 0.3 respectively. For example, if a certain printing method has a printing efficiency of 0.8 and a printing stability of 0.6, then its comprehensive attribute value would be 0.8*0.7 + 0.6*0.3 = 0.74.
[0031] Step S102: Repeatedly execute the steps of selecting the printing method based on the printing priority information until printing is successful.
[0032] In this step, the priority of the printing method selected in each round of the loop is lower than the priority of the printing method selected in the previous round. During the cyclical execution of the step of selecting a printing method based on printing priority information, one printing method is selected in each round, and then printing is performed based on the printing method selected in this round. If printing is successful, the loop stops; if printing fails, the loop continues to the next round. Furthermore, the priority of the printing method selected in the next round is lower than the priority of the printing method selected in the current round. In some embodiments, printing failure includes various situations where printing is not successful, such as printing errors, unsupported printing methods, etc.
[0033] It is worth noting that this application does not limit the data to be printed or the data that needs to be printed. It can be any data format and any data content. For example, the data to be printed can be images, text, tables, etc. As another example, in the logistics field, when a terminal device installs an application to print waybills, the data to be printed is the waybill data. The waybill can be a courier waybill, which is a document used by the courier industry to record information such as the sender, recipient, product weight, and price during the delivery of goods.
[0034] In this embodiment, multiple printing methods can be integrated into the terminal device. First, printing priority information is obtained before printing, representing the priority among various printing methods. Then, the step of selecting a printing method based on the printing priority information is executed cyclically until printing is successful. This way, even if printing fails in one method, other methods can still be selected to continue printing, improving the overall success rate and stability of the printing process. Furthermore, the priority of the printing method selected in each round of the cycle is lower than the priority of the printing method selected in the previous round. The order in which printing methods are selected can be set through priorities, making the printing process more flexible.
[0035] In some embodiments of this application, during the process of repeatedly executing the step of selecting a printing method based on printing priority information, if the printing method selected in the current cycle is not supported by the terminal device, then the next cycle is performed.
[0036] It should be noted that for each additional printing method supported by a terminal device, corresponding development or configuration is required for the application implementing the method provided in this embodiment. Therefore, the number of printing methods supported by a terminal device is positively correlated with the complexity of the application. To avoid excessive application complexity, the terminal device in this application does not support all printing methods. For example, a small number of printing methods may be selected for support. However, in some scenarios, for ease of maintaining printing priority information, the number of printing methods in the printing priority information is usually greater than the number of printing methods supported by a single terminal device. In some embodiments, due to differences in manufacturers, models, operating systems, etc., different terminal devices support different printing methods. In this case, the printing priority information can represent the priority of all printing methods supported by the terminal devices. For example, terminal device A supports printing method a and printing method b. Terminal device B supports printing method a and printing method d. The printing priority information can represent the priority of printing method a, printing method b, and printing method d.
[0037] This can lead to situations where the terminal device does not support a certain printing method. For example, in the previous example, terminal device B does not support printing method b. Continuing to use a printing method that the terminal device does not support will inevitably result in printing failure, wasting time. Therefore, in each iteration, after selecting a printing method, it can be first determined whether the terminal device supports the selected printing method. If not, the next iteration can proceed directly. If it does support it, printing can be performed based on the selected printing method. In some embodiments, the terminal device can be configured with identifiers of its supported printing methods. Based on the comparison between the identifiers of the selected printing method and the identifiers of the printing methods supported by the terminal device, it can be determined whether the terminal device supports the selected printing method.
[0038] In this embodiment, if the printing method selected in each cycle is not supported by the terminal device, the next cycle can be performed, thereby improving printing efficiency.
[0039] To meet printing needs in different scenarios, in some embodiments of this application, the method further includes the following before obtaining printing priority information:
[0040] Receive priority information configured by the user for each printing method;
[0041] Print priority information is generated based on priority information.
[0042] It should be noted that priority information can represent the priority of its corresponding printing method. In some embodiments, this priority information can be a priority level. For example, when the priority is divided into three levels: high, medium, and low, the priority information configured for a printing method can be high, medium, or low.
[0043] It is understandable that the priority of the printing method determines the order in which the printing method is selected during the cyclical execution of the step of selecting the printing method based on the printing priority information. Furthermore, by adjusting the order in which the printing methods are selected, the needs of different printing scenarios can be met. In some embodiments, the user can determine the order in which each printing method is selected based on the needs of the printing scenario, and then configure the priority information of each printing method based on the order in which the printing methods are selected. For example, printing method A has the fastest printing efficiency but the worst printing effect. Printing method B has the worst printing efficiency but the best printing effect. If the requirement of the printing scenario is that the terminal device needs to complete printing as quickly as possible, then the priority information of printing method A can be configured as high, and the priority information of printing method B can be configured as low. Thus, printing method A, which has the fastest printing efficiency, is selected first during the printing process. If the requirement of the printing scenario is that the terminal device needs to present the best possible printing effect, then the priority information of printing method A can be configured as low, and the priority information of printing method B can be configured as high. Thus, printing method B, which has the best printing effect, is selected first during the printing process. In some embodiments, the user-configured printing method can also be received.
[0044] In this embodiment, users can flexibly configure the priority of each printing method according to the needs of the printing scenario.
[0045] In some embodiments of this application, the printing methods include: a first printing method that prints using a printing language, a second printing method that prints by generating hypertext markup language data of the object to be printed in the cloud, and a third printing method that prints by generating hypertext markup language data of the object to be printed locally on a terminal device.
[0046] It should be noted that the printing language is the native language that the printer can recognize. For example, the printing language can be ZPL (Zebra Programming Language), PCL (Printer Control Language), etc., but is not limited to these. In the second printing method, the terminal device can send the object to be printed to the cloud, using the cloud's functions to generate HTML data for the object. Then, it uses the HTML data returned from the cloud for printing. In the third printing method, the terminal device locally generates the HTML data for the object to be printed. Then, it uses the generated HTML data for printing.
[0047] The printing method provided in this application is illustrated below with a specific example. Assume the printing methods include: ZPL printing using ZPL, cloud HTML printing using the cloud, and local self-drawing printing. As shown in Figure 2, the printing method in this example includes:
[0048] To begin, obtain print priority information, which includes: ZPL printing is greater than cloud HTML printing, and cloud HTML printing is greater than local self-drawn printing.
[0049] S201: Determine if ZPL printing is supported. If yes, proceed to S202; otherwise, proceed to S204.
[0050] S202: Print the object to be printed based on ZPL printing.
[0051] S203: Determine if printing was successful. If yes, end; otherwise, proceed to S204.
[0052] S204: Print the object to be printed based on cloud HTML printing.
[0053] S205: Determine if printing was successful. If yes, end; otherwise, proceed to S206.
[0054] S206: Print the object to be printed based on local self-drawn printing.
[0055] In this embodiment, a first printing method, a second printing method, and a third printing method can be provided to meet different printing needs.
[0056] In some embodiments of this application, in the step of repeatedly executing the step of selecting a printing method based on printing priority information, if the printing method selected in this round of the cycle is the first printing method, then the step of repeatedly executing the printing includes:
[0057] Obtain the data to be printed; send the data to be printed to the server, so that the server can generate a print description based on the data to be printed, and send the print description to the terminal device; wherein, the print description is the data to be printed described in a printing language;
[0058] Receive the print description returned by the server and send the print description to the printer so that the printer can print based on the print description.
[0059] It should be noted that the server is an electronic device that communicates with the terminal device. The terminal device and the server can interact with each other via wired or wireless means. For example, both the terminal device and the server are connected to the Internet, so they can interact with each other via the Internet. In this embodiment, the server integrates a preset translation function, which can translate data into a representation in a printing language, that is, data described in a printing language. Here, the terminal device can obtain the printing description with the help of the server's translation function. Specifically, the terminal device can call the interface provided by the server, send the data to be printed as a parameter of the request to the server along with the request. The server will respond to the request by generating a printing description and returning the printing description to the terminal device. In addition, the terminal device communicates with the printer. The connection method between the terminal device and the printer can be a wired connection, a wireless connection, etc., which is not limited in this embodiment. It can be understood that the terminal device can control the printer to print by transmitting data to the printer. Since the printing description is a description of the data to be printed in a printing language, the printer can quickly recognize the printing description, obtain the data to be printed, and print it out.
[0060] In this embodiment, after acquiring the data to be printed, a printing description, or print description, is generated using a server. This print description is then sent to the printer, which is controlled to print based on it. Since the printing language is a native language that the printer can recognize, printing based on the data described in the printing language is a highly efficient method, enabling fast printing and eliminating reliance on a browser.
[0061] In some embodiments of this application, sending a print description to the printer includes:
[0062] The printing description is sent to the printer by calling the printing interface of the terminal device's operating system through the bridging layer. The bridging layer is an intermediate layer between the terminal device's application and the operating system.
[0063] It should be noted that the operating system's printing interface, as a native interface at the underlying level of the terminal device, is more convenient and efficient to use. Therefore, printing can be implemented using the operating system's printing interface. However, the operating system's printing interface has fixed attributes and calling rules, and not all applications installed on the terminal device can directly call the operating system's printing interface. Therefore, this embodiment establishes a bridge layer between the application and the operating system, using the bridge layer to enable the application to call the operating system's printing interface.
[0064] Specifically, the bridging layer is operating system-dependent, and the bridging layer varies across different operating systems. Here, it's sufficient to ensure that the bridging layer can connect the terminal device's application and the operating system's printing interface. For example, assuming the terminal device's operating system is Windows, an application on the terminal device can execute the aforementioned printing method. This application could be developed using the Electron front-end development framework. In this case, Electron primarily uses JavaScript, and JavaScript does not have the ability to call the Windows operating system's printing interface. However, C / C++ does have the ability to directly call the Windows operating system's printing interface. Therefore, a bridging layer can be written using the Node-API. The Node-API is also based on C / C++. Furthermore, the Electron application uses the Node-API to interact with the C / C++ language, and uses the C / C++ language to call the Windows operating system's printing interface. Ultimately, this indirectly gives the Electron application the ability to call the Windows operating system's printing interface.
[0065] In this embodiment, the terminal device's underlying native interface is invoked to participate in the printing task, making the entire printing process more convenient and efficient.
[0066] In some embodiments of this application, the print description is sent to the printer by calling the printing interface of the terminal device's operating system through the bridging layer, including:
[0067] Create a new process; in the new process, call the terminal device's operating system's printing interface through the bridging layer to send the print description to the printer.
[0068] It should be noted that the new process is different from the main process; it is another process created while the main process continues to exist. For example, when the printing method provided in this embodiment is executed through the target application, a main process is created in the terminal device to run the target application. When it is necessary to call the printing interface, a new process is created, and the printing interface of the terminal device's operating system is called through the bridge layer in the new process to send the print description to the printer. Since the printing interface under some operating systems is a synchronous blocking interface, directly calling the interface will cause the main process to block. For example, the writePrinter interface under the Windows operating system is a synchronous blocking interface. If the application directly calls this interface, it will cause the main process to block, making the application unresponsive and resulting in a "freeze". Therefore, it is necessary to implement the calling of the printing interface under the operating system in the new process.
[0069] In this embodiment of the application, by calling the operating system's printing interface in a new process, the blocking caused by the printing interface can be avoided.
[0070] Referring to Figure 3, this is a flowchart illustrating the ZPL printing process in this embodiment. The parties involved in the printing process are the user, the client, the Node-API module, the C / C++ module, and the printer. The client is a desktop application installed on the terminal device, developed using the Electron front-end framework. The terminal device operates on Windows. The Node-API module is a bridging layer implemented based on Node-API, allowing the C / C++ module to directly access the native interfaces of the Windows operating system. This embodiment uses printing a shipping label as an example, but the printed data is not limited to shipping labels.
[0071] When a user triggers printing, the client will call the cloud printing command interface to send the label data to the cloud printing platform. The cloud printing platform is equivalent to the server in the above embodiment; it can generate a print description for the label, and the generation process is the same, so it will not be repeated here. It can be understood that this print description can be the label data described by ZPL, or it can be called a print command. For example, the print description can be: ^MMT; ^CW0,E:MHEIGB18.TTF; ^CI26; ^CF0^FS; ^LH0,0; ^PW596, etc. The interpretations of each statement in the print description are as follows: Set the label rotation mode to "rotate 90 degrees"; Set not to perform cleaning operation; Set the character set to ISO-8859-1; Clear the current font format settings; Set the origin coordinates of the print position to the top left corner (0,0); Set the print width to 596 units.
[0072] After receiving a print command from the cloud printing platform, the client starts a new process. Within this new process, the operating system's print interface is called via a bridge layer to send the print command to the printer. The printer then prints based on the received command and sends a success message to the user upon completion.
[0073] In this embodiment, by introducing Node-API modules and C / C++ modules to call the underlying printing interface of the Windows operating system, printing efficiency and stability can be improved. Simultaneously, printing support facilities, including online / offline status and printing preferences, can be integrated. Furthermore, by combining the printer language ZPL instructions, the issue of label offset can be optimized.
[0074] Exemplary device
[0075] Some embodiments of this application also provide a printing apparatus for use in a terminal device, as shown in FIG4, the printing apparatus comprising:
[0076] The acquisition module 401 is used to acquire printing priority information, wherein the printing priority information represents the priority among various printing methods; the loop module 402 is used to repeatedly execute the step of selecting a printing method based on the printing priority information until printing is successful; wherein the priority of the printing method selected in each loop is lower than the priority of the printing method selected in the previous loop.
[0077] In some embodiments, the loop module 402 is specifically used to perform the next loop if the printing method selected in the current loop is not supported by the terminal device during the process of repeatedly executing the step of selecting a printing method based on printing priority information.
[0078] In some embodiments, the priority among multiple printing methods is positively correlated with the target attributes of the printing methods; wherein the target attributes include at least one of printing efficiency and printing stability.
[0079] In some embodiments, the apparatus further includes: a receiving module for receiving priority information configured by the user for each printing method; and a generating module for generating printing priority information based on the priority information.
[0080] In some embodiments, the printing method includes multiple of the following: a first printing method that prints using a printing language, a second printing method that prints using hypertext markup language data of the object to be printed generated in the cloud, and a third printing method that prints using hypertext markup language data of the object to be printed generated locally on a terminal device.
[0081] In some embodiments, if the printing method selected in this round of loop is the first printing method, then the loop module 402 is specifically used to obtain the data to be printed; send the data to be printed to the server so that the server generates a print description based on the data to be printed and sends the print description to the terminal device; wherein, the print description is the data to be printed described in a printing language; receive the print description returned by the server and send the print description to the printer so that the printer prints based on the print description.
[0082] In some embodiments, the loop module 402 performs the step of sending a print description to the printer, including: calling the printing interface of the terminal device's operating system through a bridging layer to send the print description to the printer, wherein the bridging layer is an intermediate layer between the terminal device's application and the operating system.
[0083] In some embodiments, the loop module 402 performs the step of calling the printing interface of the terminal device's operating system through the bridging layer to send the print description to the printer, including: creating a new process; and in the new process, calling the printing interface of the terminal device's operating system through the bridging layer to send the print description to the printer.
[0084] The printing apparatus provided in this application embodiment belongs to the same inventive concept as the printing method provided in the above embodiments of this application. Technical details not described in detail in this embodiment can be found in the specific processing content of the printing method provided in the above embodiments of this application, and will not be repeated here.
[0085] Exemplary electronic devices
[0086] Another embodiment of this application also provides an electronic device. Referring to FIG5, an exemplary embodiment of this application also provides an electronic device, including: a memory and a processor. The memory stores a computer program, and the processor executes the steps in the printing method according to various embodiments of this application described in the above embodiments.
[0087] The internal structure of the electronic device is shown in Figure 5. The electronic device includes a processor, memory, network interface, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it follows the steps of the printing method according to various embodiments of this application described in the above embodiments.
[0088] The processor may include the main processor, as well as baseband chips, modems, etc.
[0089] The memory stores programs that execute the technical solutions provided in the embodiments of this application, and may also store operating systems and other critical business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0090] The processor can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the scheme provided in the embodiments of this application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0091] Input devices may include devices that receive data and information input by the user, such as keyboards, mice, cameras, scanners, light pens, voice input devices, touch screens, pedometers, or gravity sensors.
[0092] Output devices may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0093] Network interfaces may include devices such as transceivers for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0094] The processor executes the program stored in the memory and calls other devices, which can be used to implement the various steps of any of the printing methods provided in the above embodiments of this application.
[0095] The electronic device may also include a display component and a voice component. The display component may be a liquid crystal display screen or an e-ink display screen. The input device of the electronic device may be a touch layer covering the display component, or a button, trackball or touchpad set on the casing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0096] Those skilled in the art will understand that the structure shown in Figure 5 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0097] Exemplary computer program products and storage media
[0098] In addition to the methods and devices described above, the printing method provided in the embodiments of this application can also be a computer program product, which includes computer program instructions. When the computer program instructions are run by a processor, they cause the processor to perform the steps in the printing methods according to various embodiments of this application as described in the "Exemplary Methods" section above.
[0099] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0100] Furthermore, embodiments of this application also provide a storage medium storing a computer program thereon, the computer program being executed by a processor of the steps in the printing methods according to various embodiments of this application as described in the "Exemplary Methods" section above.
[0101] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0102] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0103] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the solutions provided in the embodiments of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A printing method characterized by, The printing method is applied to a terminal device and comprises the following steps: obtaining printing priority information, wherein the printing priority information represents priorities among multiple printing modes; cyclically performing a step of selecting a printing mode based on the printing priority information to print until printing is successful; wherein the priority of the printing mode selected in each cycle is lower than the priority of the printing mode selected in the previous cycle.
2. The method of claim 1, wherein, The cyclically performing a step of selecting a printing mode based on the printing priority information to print comprises the following steps: determining whether the printing mode selected in the current cycle is supported by the terminal device; if the printing mode selected in the current cycle is supported by the terminal device, selecting a printing mode based on the printing priority information to print; if the printing mode selected in the current cycle is not supported by the terminal device, proceeding to the next cycle.
3. The method of claim 2, wherein, The determining whether the printing mode selected in the current cycle is supported by the terminal device comprises the following steps: based on a comparison result of identification information of the printing mode selected in the current cycle and identification information of printing modes supported by the terminal device, determining whether the printing mode selected in the current cycle is supported by the terminal device.
4. The method of claim 1, wherein, The priorities among the multiple printing modes are positively correlated with target attributes of the printing modes; wherein the target attributes comprise at least one of printing efficiency and printing stability.
5. The method of claim 4, wherein, The target attributes comprise the printing efficiency and the printing stability, the priorities among the multiple printing modes are positively correlated with a comprehensive attribute value, and the comprehensive attribute value is calculated based on preset weights of the printing efficiency and the printing stability.
6. The method of claim 1, wherein, Before the obtaining of the printing priority information, the method further comprises the following steps: receiving priority information configured by a user for each printing mode; generating the printing priority information based on the priority information.
7. The method of claim 1, wherein, The printing modes comprise multiple items in first printing modes that realize printing through printing languages, second printing modes that realize printing through hypertext markup language data of a to-be-printed object generated by a cloud, and third printing modes that realize printing through hypertext markup language data of a to-be-printed object generated locally by a terminal device.
8. The method of claim 7, wherein, In the cyclically performing a step of selecting a printing mode based on the printing priority information to print, if the printing mode selected in the current cycle is the first printing mode, the step of printing in the current cycle comprises the following steps: obtaining to-be-printed data; sending the to-be-printed data to a server to enable the server to generate a print description according to the to-be-printed data and send the print description to the terminal device; wherein the print description is the to-be-printed data described in a printing language; receiving the print description returned by the server and sending the print description to a printer to enable the printer to print based on the print description.
9. The method of claim 8, wherein, The sending of the print description to the printer comprises the following steps: calling a printing interface of an operating system of the terminal device through a bridge layer to send the print description to the printer, wherein the bridge layer is an intermediate layer between an application program of the terminal device and the operating system.
10. The method of claim 9, wherein, The print description is sent to the printer by calling a print interface of an operating system of the terminal device through the bridge layer. creating a new process; sending the print description to the printer by calling the print interface of the operating system of the terminal device through the bridge layer in the new process.
11. A printing device, characterized by comprising: an obtaining module, configured to obtain print priority information, wherein the print priority information represents priorities among multiple print modes; a circulating module, configured to cyclically execute a step of selecting a print mode for printing based on the print priority information until printing is successful, wherein a priority of a print mode selected in each cycle is lower than a priority of a print mode selected in a previous cycle.
12. An electronic device, comprising: comprising: a processor and a memory; wherein the memory is connected with the processor, and the memory is configured to store a computer program; the processor is configured to realize the print method in any one of claims 1 to 10 by running the computer program stored in the memory.
13. A non-transitory storage medium, comprising: The storage medium has a computer program stored thereon, and the computer program, when being run by a processor, realizes the print method in any one of claims 1 to 10.
14. A computer program product, characterised in that, The computer program product has a computer program stored thereon, and the computer program, when being executed by a processor, realizes the print method in any one of claims 1 to 10.
Citation Information
Patent Citations
Printing device selection method, server and printing system
CN107273068A
Logistics express sheet double-printing method, device and equipment and storage medium
CN112035075A
Printing method
CN113176865A
Job priority control method and system based on printer
CN117573050A
Printing priority decision system
JP2004151806A