File generation method, client, server, electronic device, and storage medium

CN115617281BActive Publication Date: 2026-09-22BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211139354.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-19
Publication Date
2026-09-22
Estimated Expiration
2042-09-19

AI Technical Summary

Technical Problem

[0003]本公开提供一种文件生成方法、客户端、服务器、电子设备及存储介质,以至少解决相关技术中应用程序开发成本高的问题

Benefits of technology

[0101]本公开中服务器基于预设编程语言,构建文件生成代码;从而得到适用于各种操作系统的文件生成代码;基于操作系统标识以及所述文件生成代码,生成所述操作系统标识对应的应用安装包;从而根据不同的操作系统生成对应的应用安装包,并向所述操作系统标识对应的第一客户端发送所述应用安装包;降低了应用安装包的开发工作量以及开发成本;所述第一客户端基于所述应用安装包,安装目标应用;所述第一客户端基于所述目标应用对预设数据以及预设模板进行处理,生成预设文件,从而降低了预设文件的生成成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617281B_ABST
    Figure CN115617281B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a file generation method, a client, a server, an electronic device and a storage medium. The method comprises: receiving an application installation package sent by a server, the application installation package being generated by the server based on a file generation code and an operating system identifier of a local client; the file generation code being constructed by the server based on a preset programming language; installing a target application based on the application installation package; and processing preset data and a preset template based on the target application to generate a preset file. The present disclosure reduces the development workload and development cost of the application installation package, and reduces the generation cost of the preset file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a file generation method, client, server, electronic device, and storage medium. Background Technology

[0002] In related technologies, desktop printing client applications run on the desktop system, processing print data sent from upstream, rendering it according to requirements, sending the rendered data to the printer, and finally printing it. However, when desktop printing clients run on different operating systems, different operating systems support different application programming languages, requiring the development of different desktop printing clients using corresponding programming languages. Therefore, the development workload and cost of desktop printing client applications are large. Summary of the Invention

[0003] This disclosure provides a file generation method, a client, a server, an electronic device, and a storage medium to at least address the problem of high application development costs in related technologies. The technical solution of this disclosure is as follows:

[0004] According to a first aspect of the present disclosure, a file generation method is provided, comprising:

[0005] The system receives an application installation package sent by a server. The application installation package is generated by the server based on file generation code and the operating system identifier of the local client. The file generation code is constructed by the server based on a preset programming language.

[0006] Install the target application based on the application installation package;

[0007] Based on the target application, preset data and preset templates are processed to generate preset files.

[0008] In some embodiments, the step of processing preset data and preset templates based on the target application to generate a preset file includes:

[0009] Receive a preset file processing request sent by a second client, wherein the preset file processing request carries the preset data and the preset template;

[0010] Based on the preset file processing request, the preset data and the preset template are processed in the target application to generate the preset file.

[0011] In some embodiments, the step of processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file includes:

[0012] Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure;

[0013] Convert the first structure into the second structure;

[0014] Determine the template that matches the second structure to obtain the target template;

[0015] The target template is rendered based on the preset data to generate the preset file.

[0016] In some embodiments, if the preset file processing request is a preset file generation request, the method further includes:

[0017] The preset file is sent to the second client.

[0018] In some embodiments, if the preset file processing request is a preset file printing request, the method further includes:

[0019] Receive the printer acquisition request sent by the second client;

[0020] Based on the printer acquisition request, a printer list is sent to the second client; the second client is used to determine the target identifier of the target printer based on the printer list;

[0021] The system receives target configuration information sent by the second client; the target configuration information is determined by the second client based on the target identifier.

[0022] In some embodiments, the method further includes:

[0023] Receive the information configuration template acquisition request for the target printer sent by the second client, wherein the information configuration template acquisition request carries the target identifier;

[0024] Based on the information configuration template acquisition request, obtain the target information configuration template that matches the target identifier;

[0025] The target information configuration template is sent to the second client; the second client is used to determine the target configuration information of the target printer based on the target information configuration template.

[0026] In some embodiments, after processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file, the method further includes:

[0027] Based on the target configuration information and the preset file, a print job is generated;

[0028] Based on the target identifier, the print job is sent to the target printer; the target printer is used to print the preset file based on the target configuration information in the print job.

[0029] In some embodiments, the method further includes:

[0030] Receive a print feedback message sent by the target printer, the print feedback message including the task execution result of the print task;

[0031] The task execution result is sent to the second client.

[0032] In some embodiments, if the task execution result is a successful task execution result, the printed feedback message further includes task execution details, and the method further includes:

[0033] Receive the task details retrieval request for the print task sent by the second client;

[0034] Based on the task details retrieval request, the task execution details are sent to the second client.

[0035] In some embodiments, determining the template that matches the second structure to obtain the target template includes:

[0036] Search the local database to see if a template matching the second structure exists;

[0037] If the local database does not contain a template that matches the second structure, a target template retrieval request is sent to a preset server; the target template retrieval request carries the second structure.

[0038] The preset server receives a request based on the target template and finds a target template that matches the second structure.

[0039] In some embodiments, the step of processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file includes:

[0040] Based on the preset file processing request, the preset data and the preset template are parsed to obtain a preset number of messages to be processed;

[0041] In the target application, the preset number of message processing threads are invoked to process the preset number of messages to be processed and generate the preset file.

[0042] In some embodiments, the method further includes:

[0043] Determine the time required for each message processing thread to process each pending message;

[0044] Based on the time taken for each message processing thread to process each message to be processed, the preset number of messages to be processed are sorted.

[0045] A message pool is constructed based on the preset number of sorted messages to be processed.

[0046] The target application's interface thread is invoked to sequentially retrieve messages to be processed from the message pool, and the display interface of the target application is updated according to the processing result of each message.

[0047] According to a second aspect of the embodiments of this disclosure, another file generation method is provided, including:

[0048] Based on a preset programming language, generate code from the file;

[0049] Based on the operating system identifier and the file generation code, generate the application installation package corresponding to the operating system identifier;

[0050] The application installation package is sent to the first client corresponding to the operating system identifier; the first client is used to install the target application based on the application installation package; and to process preset data and preset templates based on the target application to generate a preset file.

[0051] In some embodiments, generating the application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code includes:

[0052] The generated code from the file is compressed to obtain a compressed code package;

[0053] Generate an executable file based on the compressed code package;

[0054] Based on the operating system identifier and the executable file, an application installation package corresponding to the operating system identifier is generated.

[0055] According to a third aspect of the present disclosure, a file generation client is provided, comprising:

[0056] The application installation package receiving module is configured to receive application installation packages sent by the server. The application installation package is an installation package generated by the server based on file generation code and the operating system identifier of the local client; the file generation code is constructed by the server based on a preset programming language.

[0057] The target application installation module is configured to install the target application based on the application installation package;

[0058] The preset file generation module is configured to process preset data and preset templates based on the target application to generate preset files.

[0059] In some embodiments, the preset file generation module includes:

[0060] The file processing request receiving unit is configured to receive a preset file processing request sent by a second client, wherein the preset file processing request carries the preset data and the preset template;

[0061] The preset file generation unit is configured to execute the preset file processing request, process the preset data and the preset template in the target application, and generate the preset file.

[0062] In some embodiments, the preset file generation unit includes:

[0063] The template parsing subunit is configured to perform a parsing of the preset template in the target application based on the preset file processing request, to obtain a first structure.

[0064] The structure conversion subunit is configured to perform the conversion of the first structure into the second structure;

[0065] The target template determination subunit is configured to perform the determination of a template that matches the second structure, thereby obtaining the target template;

[0066] The preset file generation subunit is configured to render the target template based on the preset data and generate the preset file.

[0067] In some embodiments, if the preset file processing request is a preset file generation request, the client may further include:

[0068] The preset file sending module is configured to send the preset file to the second client.

[0069] In some embodiments, if the preset file processing request is a preset file printing request, the client may further include:

[0070] The printer acquisition request receiving module is configured to receive printer acquisition requests sent by the second client;

[0071] The printer list sending module is configured to send a printer list to the second client based on the printer acquisition request; the second client is used to determine the target identifier of the target printer based on the printer list;

[0072] The target configuration information sending module is configured to receive target configuration information sent by the second client; the target configuration information is determined by the second client based on the target identifier.

[0073] In some embodiments, the client may further include:

[0074] The configuration template acquisition request receiving module is configured to receive the information configuration template acquisition request for the target printer sent by the second client, wherein the information configuration template acquisition request carries the target identifier;

[0075] The target information configuration template acquisition module is configured to execute a target information configuration template acquisition request based on the information configuration template acquisition request, and acquire a target information configuration template that matches the target identifier.

[0076] The target information configuration template sending module is configured to send the target information configuration template to the second client; the second client is used to determine the target configuration information of the target printer based on the target information configuration template.

[0077] In some embodiments, the client may further include:

[0078] The print job generation module is configured to generate a print job based on the target configuration information and the preset file.

[0079] The print job sending module is configured to send the print job to the target printer based on the target identifier; the target printer is used to print the preset file based on the target configuration information in the print job.

[0080] In some embodiments, the client may further include:

[0081] The print feedback message receiving module is configured to receive print feedback messages sent by the target printer, the print feedback messages including the task execution result of the print task;

[0082] The task execution result sending module is configured to send the task execution result to the second client.

[0083] According to a fourth aspect of the present disclosure, a file generation server is provided, comprising:

[0084] The code building module is configured to execute build files and generate code based on a preset programming language.

[0085] The application installation package generation module is configured to execute code based on the operating system identifier and the file generation code to generate an application installation package corresponding to the operating system identifier.

[0086] The application installation package sending module is configured to send the application installation package to a first client corresponding to the operating system identifier; the first client is used to install the target application based on the application installation package; and to process preset data and preset templates based on the target application to generate a preset file.

[0087] In some embodiments, the application installation package generation module includes:

[0088] The code compression package determination unit is configured to compress the generated code of the file to obtain a code compression package;

[0089] The executable file generation unit is configured to generate an executable file based on the code compressed package;

[0090] The application installation package generation unit is configured to generate an application installation package corresponding to the operating system identifier based on the operating system identifier and the executable file.

[0091] According to a fifth aspect of the present disclosure, a file generation system is provided, including a server and a first client.

[0092] The server is configured to: construct file generation code based on a preset programming language; generate an application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code; and send the application installation package to the first client corresponding to the operating system identifier.

[0093] The first client is used to install the target application based on the application installation package; and to process preset data and preset templates based on the target application to generate a preset file.

[0094] According to a sixth aspect of the present disclosure, an electronic device is provided, comprising:

[0095] processor;

[0096] Memory used to store the processor's executable instructions;

[0097] The processor is configured to execute the instructions to implement the file generation method described above.

[0098] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided, wherein when instructions in the computer-readable storage medium are executed by an electronic device processor, the electronic device is enabled to perform the file generation method described above.

[0099] According to an eighth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the file generation method described above.

[0100] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0101] In this disclosure, the server constructs file generation code based on a preset programming language, thereby obtaining file generation code applicable to various operating systems. Based on the operating system identifier and the file generation code, an application installation package corresponding to the operating system identifier is generated. Thus, a corresponding application installation package is generated according to different operating systems, and the application installation package is sent to the first client corresponding to the operating system identifier. This reduces the development workload and cost of the application installation package. The first client installs the target application based on the application installation package. The first client processes preset data and preset templates based on the target application to generate preset files, thereby reducing the generation cost of preset files.

[0102] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0103] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0104] Figure 1 This is an application environment diagram illustrating a file generation method according to an exemplary embodiment.

[0105] Figure 2 This is a flowchart illustrating a file generation method according to an exemplary embodiment.

[0106] Figure 3 This is a flowchart illustrating a method for a server to generate an application installation package corresponding to an operating system identifier based on an operating system identifier and the file generation code, according to an exemplary embodiment.

[0107] Figure 4 This is a flowchart illustrating, according to an exemplary embodiment, a method by which a first client processes the preset data and the preset template in the target application based on the preset file processing request to generate the preset file.

[0108] Figure 5 This is a flowchart illustrating a method for a second client to send the target configuration information to a first client according to an exemplary embodiment.

[0109] Figure 6 This is a flowchart illustrating a method by which a second client determines target configuration information of a target printer based on the target identifier, according to an exemplary embodiment.

[0110] Figure 7 This is a flowchart illustrating a method for installing a target application on a first client according to an exemplary embodiment.

[0111] Figure 8 This is a flowchart illustrating a document printing method according to an exemplary embodiment.

[0112] Figure 9 This is a flowchart illustrating a document printing interactive method according to an exemplary embodiment.

[0113] Figure 10 This is a flowchart illustrating a thread-based file printing method according to an exemplary embodiment.

[0114] Figure 11 This is a flowchart illustrating an interaction method of threads in a target application in a first client, according to an exemplary embodiment.

[0115] Figure 12 This is a flowchart illustrating another file generation method according to an exemplary embodiment.

[0116] Figure 13 This is a flowchart illustrating another file generation method according to an exemplary embodiment.

[0117] Figure 14 This is a block diagram illustrating a file generation client according to an exemplary embodiment.

[0118] Figure 15 This is a block diagram illustrating a file generation server according to an exemplary embodiment.

[0119] Figure 16 This is a block diagram illustrating an electronic device for generating files according to an exemplary embodiment. Detailed Implementation

[0120] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0121] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0122] To reduce the development workload and cost of application installation packages, and to reduce the cost of generating preset files, this disclosure provides a file generation method, client, server, electronic device, and storage medium.

[0123] Please see Figure 1 The diagram illustrates an application environment for a file generation method according to an exemplary embodiment. The application environment may include a server 01 and a client 02.

[0124] Specifically, in the embodiments of this specification, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and a memory, etc. Specifically, server 01 can be used to construct file generation code based on a preset programming language; and to generate an application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code; and to send the application installation package to the client 02 corresponding to the operating system identifier.

[0125] Specifically, in this embodiment, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, and in-vehicle terminals, and may also include software running on the physical device, such as web pages provided to users by service providers, or applications provided to users by such service providers. Specifically, the client 02 can be used to install a target application based on the application installation package; and to process preset data and preset templates based on the target application to generate preset files.

[0126] The following describes the multimedia information playback method based on the above system in this application. Figure 2This is a flowchart illustrating a file generation method provided in an embodiment of this application. This specification provides the operational steps of the method described in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the flowchart... Figure 2 As shown, the method may include:

[0127] In step S201, the server constructs file generation code based on a preset programming language.

[0128] In this embodiment of the disclosure, the preset programming language may include Java and the JavaFX Script programming language (JavaFX for short). JavaFX is a declarative, statically typed scripting language. JavaFX may also be replaced with Swing, a graphical user interface (GUI) toolkit designed for Java. Swing is part of the Java base classes and includes GUI components such as text boxes, buttons, dividers, and tables.

[0129] In step S202, the server generates an application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code.

[0130] In this embodiment of the disclosure, such as Figure 3 As shown, the server generates an application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code, including:

[0131] In step S2021, the server compresses the generated code from the file to obtain a compressed code package;

[0132] In this embodiment of the disclosure, the code compression package can be applied to different operating systems.

[0133] In step S2022, the server generates an executable file based on the code archive.

[0134] In this embodiment, the operating system identifier is used to represent different operating systems. The code archive can be processed differently depending on the operating system. A packaging program can package the code archive to generate executable files corresponding to each operating system; that is, different operating systems correspond to different executable files. The executable files can run and execute on different platforms and monitor printing.

[0135] In step S2023, the server generates an application installation package corresponding to the operating system identifier based on the operating system identifier and the executable file.

[0136] In this embodiment of the disclosure, the server generates an application installation package corresponding to the operating system identifier based on the operating system identifier and the executable file, including:

[0137] The server obtains the dependency package corresponding to the operating system identifier;

[0138] Specifically, in this embodiment, the dependency package represents the runtime environment of the language; different operating systems correspond to different dependency packages. Most dependency packages are library files, including dynamic and static libraries. If a program's dependency packages are not installed, the program itself cannot be used simply by installing them.

[0139] The server generates the application installation package corresponding to the operating system identifier based on the executable file and the dependency packages.

[0140] In this embodiment of the disclosure, the executable file and the dependency package corresponding to the operating system identifier can be packaged into an application installation package, thereby generating application installation packages for different operating systems.

[0141] In this embodiment of the disclosure, the server can generate an executable file based on the file generation code and obtain the corresponding dependency package based on the operating system identifier; and generate an application installation package corresponding to the operating system identifier based on the executable file and the dependency package; thereby realizing the generation of application installation packages for different operating systems based on a single universal file generation code, reducing code development costs.

[0142] In step S203, the server sends the application installation package to the first client corresponding to the operating system identifier.

[0143] In this embodiment of the disclosure, the server can send the application installation package to the client of the corresponding operating system for installation and use.

[0144] In step S204, the first client installs the target application based on the application installation package.

[0145] In this embodiment of the disclosure, after the first client installs the target application, it can be used to generate a preset file.

[0146] Specifically, in the embodiments of this disclosure, such as Figure 7 As shown, Figure 7 This is a flowchart illustrating a method for installing a target application on a first-client device. The server builds the source code, packages it into a JAR file using Maven, and then packages the JAR file into an executable file. This executable file can run and execute on different platforms and listen for output. The executable file and its dependencies are then packaged into an installation package for the corresponding platform (e.g., Inno Setup for Windows), for the first-client user to download and install. The Maven Project Object Model (POM) is a project management tool that uses a small amount of descriptive information to manage project builds, reports, and documentation. A JAR file is a compressed archive of Java code files; it's essentially a ZIP file, so you can use ZIP-related commands to create or decompress it. Inno Setup is a free installation creation software, characterized by its small size, simplicity, and elegant interface. It supports Pascal scripts and can quickly create a standard Windows 2000-style installation interface, sufficient for most installation tasks. Pascal is named in honor of Blaise Pascal, the famous 17th-century French philosopher and mathematician. It was designed and created by Swiss Professor Niklaus Wirth in the late 1960s. Pascal has a rigorous syntax, clear structure, easy-to-write programs, and high readability. It was the first structured programming language.

[0147] In step S205, the first client processes the preset data and preset template based on the target application to generate a preset file.

[0148] In this embodiment of the disclosure, the first client processes preset data and a preset template based on the target application to generate a preset file, including:

[0149] The second client sends a preset file processing request to the first client, the preset file processing request carrying the preset data and the preset template;

[0150] In this embodiment, the first client can be used to generate a preset file, and the second client can be the user. The second client can send preset data and a preset template to the first client so that the first client can generate the preset file. One first client can correspond to multiple second clients.

[0151] The first client processes the preset data and the preset template in the target application based on the preset file processing request, and generates the preset file.

[0152] In this embodiment of the disclosure, after the first client installs the target application, it can quickly generate a preset file for the second client based on the request of the second client.

[0153] In this embodiment of the disclosure, such as Figure 4 As shown, the first client, based on the preset file processing request, processes the preset data and the preset template in the target application to generate the preset file, including:

[0154] In step S2051, the first client parses the preset template in the target application based on the preset file processing request to obtain a first structure;

[0155] In this embodiment of the disclosure, the first client can parse the preset template to obtain the first structure.

[0156] In step S2052, the first client converts the first structure into a second structure;

[0157] In this embodiment of the disclosure, the first client can convert the first structure into a second structure based on the local data structure, and further determine the template.

[0158] In step S2053, the first client determines a template that matches the second structure to obtain the target template;

[0159] In this embodiment of the disclosure, the first client determines a template that matches the second structure to obtain a target template, including:

[0160] The first client searches its local database to see if a template matching the second structure exists;

[0161] In this embodiment of the disclosure, the local database may be the template cache database of the first client.

[0162] If the local database does not contain a template that matches the second structure, the first client sends a target template retrieval request to the preset server; the target template retrieval request carries the second structure.

[0163] In this embodiment of the disclosure, the preset server can be the backend server of the first client, used to store templates of different structures of the first client. The preset server may include, but is not limited to, a content delivery network (CDN).

[0164] The preset server obtains the request based on the target template and finds a template that matches the second structure, which is then used as the target template.

[0165] The preset server sends the target template to the first client.

[0166] In this embodiment of the disclosure, the first client can search for a template that matches the second structure in the local database, and can also search for the corresponding target template in the preset server, thereby ensuring that the target template can be quickly determined.

[0167] The method further includes:

[0168] If a template matching the second structure exists in the local database, the template matching the second structure will be used as the target template.

[0169] In step S2054, the first client renders the target template based on the preset data to generate the preset file.

[0170] In this embodiment of the disclosure, the first client needs to convert the structure of the preset template of the second client into a second structure that is compatible with the first client, and find the corresponding target template, thereby rendering the target template based on the preset data and quickly generating the preset file.

[0171] In this embodiment of the disclosure, if the preset file processing request is a preset file generation request, the method further includes:

[0172] The first client sends the preset file to the second client.

[0173] In this embodiment of the disclosure, the preset file may include, but is not limited to, PDF, JPG, and PNG format files; in the shopping application, the second client can open the shopping application and obtain the preset file corresponding to the purchase order. At this time, the preset file may be the package order.

[0174] In this embodiment of the disclosure, such as Figure 5 As shown, if the preset file processing request is a preset file printing request, the method further includes:

[0175] In step S501, the second client sends a printer acquisition request to the first client;

[0176] In this embodiment of the disclosure, the first client can be a printing client.

[0177] In step S502, the first client sends a printer list to the second client based on the printer acquisition request;

[0178] In this embodiment of the disclosure, the printer list may include identifiers of multiple printers and functional attribute information for each printer. For example, some printers support color printing, while others do not.

[0179] In step S503, the second client determines the target identifier of the target printer based on the printer list;

[0180] In this embodiment of the disclosure, the second client can determine the target identifier of the target printer in response to an operation command triggered based on any identifier in the printer list; the second client user can select the target printer based on the printer list.

[0181] In step S504, the second client determines the target configuration information of the target printer based on the target identifier;

[0182] In this embodiment of the disclosure, the second client user can set the target configuration information of the target printer, which may include the number of copies to be printed, the print format, etc.

[0183] In this embodiment of the disclosure, such as Figure 6 As shown, the second client determines the target configuration information of the target printer based on the target identifier, including:

[0184] In step S5041, the second client sends an information configuration template acquisition request for the target printer to the first client, the information configuration template acquisition request carrying the target identifier;

[0185] In this embodiment of the disclosure, after determining the target printer, the second client can obtain the information configuration template of the target printer through the first client.

[0186] In step S5042, the first client obtains a target information configuration template that matches the target identifier based on the information configuration template acquisition request;

[0187] In this embodiment of the disclosure, the first client can determine the target information configuration template corresponding to the target printer based on the target identifier. The target information configuration template can be used to set the configuration information of the target printer.

[0188] In step S5043, the first client sends the target information configuration template to the second client;

[0189] In step S5044, the second client determines the target configuration information of the target printer based on the target information configuration template.

[0190] In this embodiment of the disclosure, the second client can determine the target configuration information of the target printer in response to an operation instruction triggered based on the target information configuration template; the second client user can select or input the target configuration information based on the target information configuration template.

[0191] In this embodiment of the disclosure, the second client can obtain the corresponding information configuration template from the first client based on the target identifier of the target printer, and determine the configuration information of the target printer based on the information configuration template; thereby realizing the rapid determination of the configuration information of the target printer.

[0192] In step S505, the second client sends the target configuration information to the first client.

[0193] In this embodiment of the disclosure, the second client can obtain a list of printers through the first client, select a target printer, and further determine the target configuration information of the target printer, thereby enabling the rapid printing of a preset document.

[0194] In this embodiment of the disclosure, after the first client processes the preset data and the preset template in the target application based on the preset file processing request to generate the preset file, the method further includes:

[0195] The first client generates a print job based on the target configuration information and the preset file;

[0196] In this embodiment of the disclosure, the first client can construct a printing task based on the target configuration information and the preset file.

[0197] The first client sends the print job to the target printer based on the target identifier;

[0198] The target printer prints the preset file based on the target configuration information in the print job.

[0199] Specifically, in this embodiment of the disclosure, there can be multiple print jobs, each print job can correspond to a preset file; each print job can correspond to a target printer; when the first client receives multiple print jobs, it will isolate each target printer to ensure that the client program can process print jobs for different printers at the same time.

[0200] In this embodiment of the disclosure, the first client can construct a print job based on the target configuration information and the preset file, and send the print job to the corresponding target printer according to the target identifier, thereby realizing the fast printing of the preset file.

[0201] In this embodiment of the disclosure, such as Figure 8 As shown, Figure 8 This is a flowchart of a document printing method. The user sends data and a template to the printing client through an Independent Software Vendor (ISV). The desktop printing client receives the template and data (print task) from the user, renders the template according to the user's requirements, fills in the data into the template, generates the final print data, and sends this data to the printer for printing. The printing process information can be viewed on the client interface. If the printer fails to print due to paper output or abnormal conditions, the printer sends the reason for the failure back to the printing client.

[0202] In this embodiment of the disclosure, the method further includes:

[0203] The target printer sends a print feedback message to the first client, the print feedback message including the task execution result of the print job;

[0204] In this embodiment of the disclosure, the task execution result includes a successful task execution result and a failed task execution result. If the task execution result is a successful task execution result, the print feedback message also includes task execution details; if the task execution result is a failed task execution result, the print feedback message also includes the reason for the task execution failure, such as a paper jam, the printer being in an abnormal state, etc., thereby facilitating timely printer maintenance by the user.

[0205] The first client sends the task execution result to the second client.

[0206] In this embodiment of the disclosure, after the target printer executes the printing task, it can send the task execution result back to the first client, so that the first client can forward the task execution result to the second client in a timely manner, thereby enabling the second client user to know the execution result of the printing task in a timely manner.

[0207] In this embodiment of the disclosure, if the task execution result is a successful task execution result, the printed feedback message further includes task execution details, and the method further includes:

[0208] The second client sends a request to the first client to obtain the task details of the print job;

[0209] In this embodiment of the disclosure, when the second client has multiple printing tasks, it can select to obtain the task execution details of one or more of the tasks; the task execution details may include the task execution start time, end time, task execution parameters (e.g., the actual number of prints), etc.

[0210] Based on the task details retrieval request, the first client sends the task execution details to the second client.

[0211] In this embodiment of the disclosure, when the printing task is executed successfully, the second client can obtain the task execution details through the first client; when the printing task fails, the second client can also obtain the reason for the task failure through the first client.

[0212] In this embodiment of the disclosure, the second client can obtain the execution details of the printing task through the first client, thereby facilitating the second client user to accurately know the detailed execution results of the printing task and ensuring that the printing task meets the user's expectations.

[0213] Specifically, in the embodiments of this disclosure, such as Figure 9 As shown, Figure 9 A flowchart of a document printing interactive method, the method comprising:

[0214] 1. The second client (the user) sends a version information retrieval request to the first client (the printing client);

[0215] 1.1 The first client obtains its version information based on the version information acquisition request and sends it to the second client;

[0216] 2. When the second client determines that the version information of the first client matches the version information of the second client, it sends a printer list retrieval request to the first client;

[0217] 2.1 The first client returns a printer list to the second client based on the printer list retrieval request;

[0218] 3. The second client selects the target printer based on the printer list and sends a request to the first client to obtain the information configuration template of the target printer;

[0219] 3.1 The first client obtains the information configuration template of the target printer based on the information configuration template retrieval request and returns it to the second client;

[0220] 4. The second client sets the configuration information of the target printer based on the information configuration template and sends the configuration information to the first client;

[0221] 4.1 The first client configures the target printer based on the configuration information and returns a result to the second client indicating whether the configuration was successful.

[0222] 5. After receiving the configuration success result, the second client sends the data and template of the file to be printed to the first client;

[0223] 5.1 The first client returns the result of accepting the print request to the second client;

[0224] 5.2 The first client renders the template based on the data, generates a file to be printed, and sends it to the target printer;

[0225] 5.3 The target printer sends the printing execution result to the first client; the printing execution result includes a successful printing result and a failed printing result; when printing is successful, the target printer also sends the printing details to the first client;

[0226] 5.4. Based on the successful printing result, the first client sends a printing completion notification to the second client;

[0227] 6. The second client sends a query request for print job details to the first client;

[0228] 6.1 The first client returns the print task details to the second client.

[0229] Specifically, in the embodiments of this disclosure, such as Figure 10 As shown, Figure 10 A flowchart of a thread-based file printing method, including:

[0230] (1) The second client (user) sends a print job to the first client (printing client); the print job includes preset data and preset template;

[0231] (2) The first client parses the preset template and determines whether there is a template corresponding to the parsed structure in the local cache database; if there is, the template is obtained as the target template; if there is no template, the corresponding template is downloaded from the CDN and cached.

[0232] (3) The first client sends a print acceptance notification to the second client;

[0233] (4) The first client calls the rendering thread to render the preset data and the preset template to obtain a preset file;

[0234] (5) After rendering is complete, the first client sends a preset file to the target printer; each preset file corresponds to a print job;

[0235] (6) The target printer obtains print jobs sequentially based on the print thread pool;

[0236] (7) The target printer prints the preset file based on the printing thread.

[0237] In this embodiment of the disclosure, the first client, based on the preset file processing request, processes the preset data and the preset template in the target application to generate the preset file, including:

[0238] The first client parses the preset data and the preset template based on the preset file processing request to obtain a preset number of messages to be processed;

[0239] In the target application, the first client invokes the preset number of message processing threads to process the preset number of messages to be processed and generates the preset file.

[0240] In this embodiment of the disclosure, the first client can parse the preset data and the preset template to obtain a preset number of messages to be processed; and call the message processing thread to process each message to be processed, thereby quickly generating a preset file.

[0241] In this embodiment of the disclosure, the method further includes:

[0242] The first client determines the time for each message processing thread to process each pending message;

[0243] The first client sorts the preset number of messages to be processed based on the time it takes for each message processing thread to process each message to be processed;

[0244] Specifically, in this embodiment of the disclosure, a preset number of messages to be processed can be sorted in ascending order of time to obtain a sorting result.

[0245] The first client constructs a message pool based on the preset number of messages to be processed after sorting.

[0246] Specifically, in this embodiment of the disclosure, each message to be processed can be stored sequentially according to the sorting result to obtain a message pool.

[0247] The first client calls the UI thread of the target application to sequentially retrieve messages to be processed from the message pool, and updates the display interface of the target application according to the processing result of each message.

[0248] Specifically, in this embodiment of the disclosure, the processing result of the message to be processed in the first position can be obtained first, and the display interface can be updated once. Then the processing result of the message to be processed in the second position can be obtained, and the display interface can be updated a second time, and so on.

[0249] Specifically, in this embodiment, the interface of the target application can be beautified using custom CSS styles. The interface thread runs independently and interacts with other message processing threads via messages. CSS (Cascading Style Sheets) is a computer language used to style HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language) documents. CSS can not only statically style web pages but also dynamically format various elements of a web page in conjunction with various scripting languages. CSS enables pixel-level precise control over the layout of elements on a web page, supports almost all font sizes and styles, and has the ability to edit the styles of web page objects and models.

[0250] In this embodiment of the disclosure, such as Figure 11 As shown, Figure 11 This is a flowchart of the interaction methods of threads in the target application of the first client; it includes the UI thread, the message production thread, and the message pool; the message production thread indicates that the thread needs to update the UI, and sends the operation to the message pool in the form of a message, and the UI thread obtains the message from the message pool and consumes it. The number of message production threads can be set according to actual needs. For example, message production threads can include thread 1, thread 2, thread 3, and thread 4. Each message production thread corresponds to a message to be processed. A message pool is built based on the processing time of the message production threads. The message pool includes messages 1-4 corresponding to threads 1-4. Messages 1-4 can be sorted sequentially by processing time. For example, message 1 has the earliest processing time, and message 4 has the latest processing time. In practical applications, the messages in the message pool are not limited to being sorted in chronological order; they can also be sorted according to other conditions. The UI thread retrieves messages from the message pool sequentially and updates the display interface of the target application. First, the UI thread retrieves message 1 and updates the display interface once based on the processing result of message 1. Then, it retrieves message 2 and updates the display interface a second time based on the processing result of message 2. Then, it retrieves message 3 and updates the display interface a third time based on the processing result of message 3. Finally, it retrieves message 4 and updates the display interface a fourth time based on the processing result of message 4. This ensures that the execution result of each message production thread can be displayed in real time on the display interface.

[0251] In this embodiment of the disclosure, the interface thread in the first client runs independently. The messages are sorted according to the processing time of the message production thread, and a message pool is constructed. This facilitates the interface thread to obtain the messages to be processed from the message pool in sequence, and to update the display interface of the target application in sequence according to the message processing results. This enables orderly interaction between the interface thread and other message production threads, and improves the accuracy of the display interface of the target application.

[0252] This disclosure specifies that only one set of code needs to be developed for the first client application. The final executable file packaged from the code can run on different platforms, improving development efficiency and code applicability. Multiple interfaces are provided to users, allowing them to obtain real-time client running status and print job status, and adjust settings during the printing process. Users can set their own templates according to rules, transmit the templates and data to the printing client, and the client renders and prints them, giving users a high degree of freedom in customizing templates. Users can view the print job status in real-time on the client interface, query historical job details, and perform operations such as pausing and terminating printing.

[0253] As can be seen from the technical solutions provided in the embodiments of this specification above, in this disclosure, the server constructs file generation code based on a preset programming language, thereby obtaining file generation code applicable to various operating systems; based on the operating system identifier and the file generation code, an application installation package corresponding to the operating system identifier is generated; thereby generating corresponding application installation packages according to different operating systems, and sending the application installation package to the first client corresponding to the operating system identifier; reducing the development workload and development cost of the application installation package; the first client installs the target application based on the application installation package; the first client processes preset data and preset templates based on the target application to generate preset files, thereby reducing the generation cost of preset files.

[0254] The following describes a specific embodiment of a file generation method described in this specification, using the first client as the execution subject. Figure 12 This is a flowchart illustrating a file generation method provided in an embodiment of this application. Specifically, in conjunction with... Figure 12 As shown, the method may include:

[0255] In step S1201, an application installation package is received from the server. The application installation package is an installation package generated by the server based on file generation code and the operating system identifier of the local client. The file generation code is constructed by the server based on a preset programming language.

[0256] In step S1202, the target application is installed based on the application installation package;

[0257] In step S1203, preset data and preset templates are processed based on the target application to generate a preset file.

[0258] In some embodiments, the step of processing preset data and preset templates based on the target application to generate a preset file includes:

[0259] Receive a preset file processing request sent by a second client, wherein the preset file processing request carries the preset data and the preset template;

[0260] Based on the preset file processing request, the preset data and the preset template are processed in the target application to generate the preset file.

[0261] In some embodiments, the step of processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file includes:

[0262] Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure;

[0263] Convert the first structure into the second structure;

[0264] Determine the template that matches the second structure to obtain the target template;

[0265] The target template is rendered based on the preset data to generate the preset file.

[0266] In some embodiments, if the preset file processing request is a preset file generation request, the method further includes:

[0267] The preset file is sent to the second client.

[0268] In some embodiments, if the preset file processing request is a preset file printing request, the method further includes:

[0269] Receive the printer acquisition request sent by the second client;

[0270] Based on the printer acquisition request, a printer list is sent to the second client; the second client is used to determine the target identifier of the target printer based on the printer list;

[0271] The system receives target configuration information sent by the second client; the target configuration information is determined by the second client based on the target identifier.

[0272] In some embodiments, the method further includes:

[0273] Receive the information configuration template acquisition request for the target printer sent by the second client, wherein the information configuration template acquisition request carries the target identifier;

[0274] Based on the information configuration template acquisition request, obtain the target information configuration template that matches the target identifier;

[0275] The target information configuration template is sent to the second client; the second client is used to determine the target configuration information of the target printer based on the target information configuration template.

[0276] In some embodiments, after processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file, the method further includes:

[0277] Based on the target configuration information and the preset file, a print job is generated;

[0278] Based on the target identifier, the print job is sent to the target printer; the target printer is used to print the preset file based on the target configuration information in the print job.

[0279] In some embodiments, the method further includes:

[0280] Receive a print feedback message sent by the target printer, the print feedback message including the task execution result of the print task;

[0281] The task execution result is sent to the second client.

[0282] In some embodiments, if the task execution result is a successful task execution result, the printed feedback message further includes task execution details, and the method further includes:

[0283] Receive the task details retrieval request for the print task sent by the second client;

[0284] Based on the task details retrieval request, the task execution details are sent to the second client.

[0285] In some embodiments, determining the template that matches the second structure to obtain the target template includes:

[0286] Search the local database to see if a template matching the second structure exists;

[0287] If the local database does not contain a template that matches the second structure, a target template retrieval request is sent to a preset server; the target template retrieval request carries the second structure.

[0288] The preset server receives a request based on the target template and finds a target template that matches the second structure.

[0289] In some embodiments, the step of processing the preset data and the preset template in the target application based on the preset file processing request to generate the preset file includes:

[0290] Based on the preset file processing request, the preset data and the preset template are parsed to obtain a preset number of messages to be processed;

[0291] In the target application, the preset number of message processing threads are invoked to process the preset number of messages to be processed and generate the preset file.

[0292] In some embodiments, the method further includes:

[0293] Determine the time required for each message processing thread to process each pending message;

[0294] Based on the time taken for each message processing thread to process each message to be processed, the preset number of messages to be processed are sorted.

[0295] A message pool is constructed based on the preset number of sorted messages to be processed.

[0296] The target application's interface thread is invoked to sequentially retrieve messages to be processed from the message pool, and the display interface of the target application is updated according to the processing result of each message.

[0297] This specification provides a file generation method, wherein the server includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the file generation method described above.

[0298] The following describes a specific embodiment of a file generation method described in this specification, with the server as the executing entity. Figure 13 This is a flowchart illustrating a file generation method provided in an embodiment of this application. Specifically, in conjunction with... Figure 13 As shown, the method may include:

[0299] In step S1301, file generation code is constructed based on a preset programming language;

[0300] In step S1302, an application installation package corresponding to the operating system identifier is generated based on the operating system identifier and the file generation code.

[0301] In step S1303, the application installation package is sent to the first client corresponding to the operating system identifier; the first client is used to install the target application based on the application installation package; and to process preset data and preset templates based on the target application to generate a preset file.

[0302] In some embodiments, generating the application installation package corresponding to the operating system identifier based on the operating system identifier and the file generation code includes:

[0303] The generated code from the file is compressed to obtain a compressed code package;

[0304] Generate an executable file based on the compressed code package;

[0305] Based on the operating system identifier and the executable file, an application installation package corresponding to the operating system identifier is generated.

[0306] This specification provides a file generation method, wherein the server includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement the file generation method described above.

[0307] Figure 14 This is a block diagram illustrating a file generation client according to an exemplary embodiment. (Refer to...) Figure 14 The client includes:

[0308] The application installation package receiving module 1410 is configured to receive an application installation package sent by the server. The application installation package is an installation package generated by the server based on file generation code and the operating system identifier of the local client. The file generation code is constructed by the server based on a preset programming language.

[0309] The target application installation module 1420 is configured to install the target application based on the application installation package.

[0310] The preset file generation module 1430 is configured to process preset data and preset templates based on the target application to generate a preset file.

[0311] In some embodiments, the preset file generation module includes:

[0312] The file processing request receiving unit is configured to receive a preset file processing request sent by a second client, wherein the preset file processing request carries the preset data and the preset template;

[0313] The preset file generation unit is configured to execute the preset file processing request, process the preset data and the preset template in the target application, and generate the preset file.

[0314] In some embodiments, the preset file generation unit includes:

[0315] The template parsing subunit is configured to perform a parsing of the preset template in the target application based on the preset file processing request, to obtain a first structure.

[0316] The structure conversion subunit is configured to perform the conversion of the first structure into the second structure;

[0317] The target template determination subunit is configured to perform the determination of a template that matches the second structure, thereby obtaining the target template;

[0318] The preset file generation subunit is configured to render the target template based on the preset data and generate the preset file.

[0319] In some embodiments, if the preset file processing request is a preset file generation request, the client may further include:

[0320] The preset file sending module is configured to send the preset file to the second client.

[0321] In some embodiments, if the preset file processing request is a preset file printing request, the client may further include:

[0322] The printer acquisition request receiving module is configured to receive printer acquisition requests sent by the second client;

[0323] The printer list sending module is configured to send a printer list to the second client based on the printer acquisition request; the second client is used to determine the target identifier of the target printer based on the printer list;

[0324] The target configuration information sending module is configured to receive target configuration information sent by the second client; the target configuration information is determined by the second client based on the target identifier.

[0325] In some embodiments, the client may further include:

[0326] The configuration template acquisition request receiving module is configured to receive the information configuration template acquisition request for the target printer sent by the second client, wherein the information configuration template acquisition request carries the target identifier;

[0327] The target information configuration template acquisition module is configured to execute a target information configuration template acquisition request based on the information configuration template acquisition request, and acquire a target information configuration template that matches the target identifier.

[0328] The target information configuration template sending module is configured to send the target information configuration template to the second client; the second client is used to determine the target configuration information of the target printer based on the target information configuration template.

[0329] In some embodiments, the client may further include:

[0330] The print job generation module is configured to generate a print job based on the target configuration information and the preset file.

[0331] The print job sending module is configured to send the print job to the target printer based on the target identifier; the target printer is used to print the preset file based on the target configuration information in the print job.

[0332] In some embodiments, the client may further include:

[0333] The print feedback message receiving module is configured to receive print feedback messages sent by the target printer, the print feedback messages including the task execution result of the print task;

[0334] The task execution result sending module is configured to send the task execution result to the second client.

[0335] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0336] Figure 15 This is a block diagram illustrating a file generation server according to an exemplary embodiment. (Refer to...) Figure 15 The server includes:

[0337] Code building module 1510 is configured to execute code generation from build files based on a preset programming language;

[0338] The application installation package generation module 1520 is configured to execute code based on the operating system identifier and the file generation code to generate an application installation package corresponding to the operating system identifier.

[0339] The application installation package sending module 1530 is configured to send the application installation package to a first client corresponding to the operating system identifier; the first client is used to install a target application based on the application installation package; and to process preset data and preset templates based on the target application to generate a preset file.

[0340] In some embodiments, the application installation package generation module includes:

[0341] The code compression package determination unit is configured to compress the generated code of the file to obtain a code compression package;

[0342] The executable file generation unit is configured to generate an executable file based on the code compressed package;

[0343] The application installation package generation unit is configured to generate an application installation package corresponding to the operating system identifier based on the operating system identifier and the executable file.

[0344] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0345] In one exemplary embodiment, this disclosure provides a file generation system, including a server and a first client. The server is configured to construct file generation code based on a preset programming language; generate an application installation package corresponding to the operating system identifier based on an operating system identifier and the file generation code; and send the application installation package to the first client corresponding to the operating system identifier. The first client is configured to install a target application based on the application installation package; and process preset data and a preset template based on the target application to generate a preset file.

[0346] In one exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor-executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, it implements the file generation method provided in any of the above embodiments.

[0347] Figure 16 This is a block diagram illustrating an electronic device for document generation according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 16As shown, the electronic device includes a processor, memory, network interface, display screen, 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 the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored 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 implements a file generation method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0348] Those skilled in the art will understand that Figure 16 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0349] In an exemplary embodiment, an electronic device is also provided, comprising:

[0350] A processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the file generation method described above.

[0351] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, which can be executed by a processor of an electronic device to complete the file generation method described above. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0352] In an exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the file generation method described above.

[0353] In this disclosure, the server constructs file generation code based on a preset programming language, thereby obtaining file generation code applicable to various operating systems. Based on the operating system identifier and the file generation code, an application installation package corresponding to the operating system identifier is generated. Thus, a corresponding application installation package is generated according to different operating systems, and the application installation package is sent to the first client corresponding to the operating system identifier. This reduces the development workload and cost of the application installation package. The first client installs the target application based on the application installation package. The first client processes preset data and preset templates based on the target application to generate preset files, thereby reducing the generation cost of preset files.

[0354] 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. This 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.

[0355] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0356] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for generating a file, characterized in that, include: Receive an application installation package sent by the server, wherein the application installation package is an installation package generated by the server based on file generation code and the operating system identifier of the local client; The file generation code is a generic code built by the server based on a preset programming language; Install the target application based on the application installation package; Receive a preset file processing request sent by a second client, the preset file processing request carrying preset data and a preset template; Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure; Convert the first structure into the second structure; Search the local database to see if a template matching the second structure exists; If the local database does not have a template that matches the second structure, a target template retrieval request is sent to the preset server; The target template acquisition request carries the second structure; Receive the target template matching the second structure from the preset server based on the target template acquisition request; The target template is rendered based on the preset data to generate a preset file; The process of generating the application installation package includes: The generated code from the file is compressed to obtain a compressed code package suitable for different operating systems; an executable file is then generated based on the compressed code package. Obtain the dependency package corresponding to the operating system identifier, wherein the dependency package represents the runtime environment of the preset programming language in the operating system corresponding to the operating system identifier; Based on the executable file and the dependent packages, an application installation package corresponding to the operating system identifier is generated.

2. The method according to claim 1, characterized in that, If the preset file processing request is a preset file generation request, the method further includes: The preset file is sent to the second client.

3. The method according to claim 1, characterized in that, If the preset file processing request is a preset file printing request, the method further includes: Receive the printer acquisition request sent by the second client; Based on the printer acquisition request, a printer list is sent to the second client; the second client is used to determine the target identifier of the target printer based on the printer list; The system receives target configuration information sent by the second client; the target configuration information is determined by the second client based on the target identifier.

4. The method according to claim 3, characterized in that, The method further includes: Receive the information configuration template acquisition request for the target printer sent by the second client, wherein the information configuration template acquisition request carries the target identifier; Based on the information configuration template acquisition request, obtain the target information configuration template that matches the target identifier; The target information configuration template is sent to the second client; the second client is used to determine the target configuration information of the target printer based on the target information configuration template.

5. The method according to claim 3 or 4, characterized in that, After generating the preset file, the method further includes: Based on the target configuration information and the preset file, a print job is generated; Based on the target identifier, the print job is sent to the target printer; the target printer is used to print the preset file based on the target configuration information in the print job.

6. The method according to claim 5, characterized in that, The method further includes: Receive a print feedback message sent by the target printer, the print feedback message including the task execution result of the print task; The task execution result is sent to the second client.

7. The method according to claim 6, characterized in that, If the task execution result is a successful result, the printed feedback message also includes task execution details, and the method further includes: Receive the task details retrieval request for the print task sent by the second client; Based on the task details retrieval request, the task execution details are sent to the second client.

8. The method according to claim 1, characterized in that, The generation of the preset file also includes: Based on the preset file processing request, the preset data and the preset template are parsed to obtain a preset number of messages to be processed; In the target application, the preset number of message processing threads are invoked to process the preset number of messages to be processed and generate the preset file.

9. The method according to claim 8, characterized in that, The method further includes: Determine the time required for each message processing thread to process each pending message; Based on the time taken for each message processing thread to process each message to be processed, the preset number of messages to be processed are sorted. A message pool is constructed based on the preset number of sorted messages to be processed. The target application's interface thread is invoked to sequentially retrieve messages to be processed from the message pool, and the display interface of the target application is updated according to the processing result of each message.

10. A method for generating a file, characterized in that, include: Based on a preset programming language, construct a general file generation code; The generated code from the file is compressed to obtain a compressed code package suitable for different operating systems; Generate an executable file based on the compressed code package; Obtain the dependency package corresponding to the operating system identifier, wherein the dependency package represents the runtime environment of the preset programming language in the operating system corresponding to the operating system identifier; Based on the executable file and the dependent packages, an application installation package corresponding to the operating system identifier is generated. The application installation package is sent to the first client corresponding to the operating system identifier; the first client is used to install the target application based on the application installation package; And receive a preset file processing request sent by a second client, wherein the preset file processing request carries preset data and a preset template; Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure; Convert the first structure into the second structure; Search the local database to see if a template matching the second structure exists; If the local database does not have a template that matches the second structure, a target template retrieval request is sent to the preset server; The target template acquisition request carries the second structure; Receive the target template matching the second structure from the preset server based on the target template acquisition request; The target template is rendered based on the preset data to generate a preset file.

11. A file generation client, characterized in that, include: The application installation package receiving module is configured to receive application installation packages sent by the server. The application installation package is an installation package generated by the server based on file generation code and the operating system identifier of the local client. The file generation code is a general code built by the server based on a preset programming language. The target application installation module is configured to install the target application based on the application installation package; The preset file generation module is configured to receive a preset file processing request sent by a second client, the preset file processing request carrying preset data and a preset template; Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure; Convert the first structure into the second structure; Search the local database to see if a template matching the second structure exists; If the local database does not have a template that matches the second structure, a target template retrieval request is sent to the preset server; The target template acquisition request carries the second structure; Receive the target template matching the second structure from the preset server based on the target template acquisition request; The target template is rendered based on the preset data to generate a preset file; The process of generating the application installation package includes: The generated code from the file is compressed to obtain a compressed code package suitable for different operating systems; Generate an executable file based on the compressed code package; Obtain the dependency package corresponding to the operating system identifier, wherein the dependency package represents the runtime environment of the preset programming language in the operating system corresponding to the operating system identifier; Based on the executable file and the dependent packages, an application installation package corresponding to the operating system identifier is generated.

12. A file generation server, characterized in that, include: The code building module is configured to execute a generic file generation code based on a preset programming language. The application installation package generation module is configured to compress the generated code of the file to obtain a code compressed package suitable for different operating systems; Based on the code compressed package, an executable file is generated; the dependency package corresponding to the operating system identifier is obtained, wherein the dependency package represents the running environment of the preset programming language in the operating system corresponding to the operating system identifier; Based on the executable file and the dependent packages, an application installation package corresponding to the operating system identifier is generated. The application installation package sending module is configured to send the application installation package to a first client corresponding to the operating system identifier; the first client is used to install the target application based on the application installation package; And receive a preset file processing request sent by a second client, wherein the preset file processing request carries preset data and a preset template; Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure; Convert the first structure into the second structure; Search the local database to see if a template matching the second structure exists; If the local database does not have a template that matches the second structure, a target template retrieval request is sent to the preset server; The target template acquisition request carries the second structure; Receive the target template matching the second structure from the preset server based on the target template acquisition request; The target template is rendered based on the preset data to generate a preset file.

13. A document generation system, characterized in that, Including the server and the first client, The server is used to construct a universal file generation code based on a preset programming language; and to compress the file generation code to obtain a code compressed package suitable for different operating systems. Generate an executable file based on the compressed code package; Obtain the dependency package corresponding to the operating system identifier, wherein the dependency package represents the runtime environment of the preset programming language in the operating system corresponding to the operating system identifier; Based on the executable file and the dependent packages, an application installation package corresponding to the operating system identifier is generated; and the application installation package is sent to the first client corresponding to the operating system identifier. The first client is used to install the target application based on the application installation package; And receive a preset file processing request sent by a second client, wherein the preset file processing request carries preset data and a preset template; Based on the preset file processing request, the preset template is parsed in the target application to obtain a first structure; Convert the first structure into the second structure; Search the local database to see if a template matching the second structure exists; If the local database does not have a template that matches the second structure, a target template retrieval request is sent to the preset server; The target template acquisition request carries the second structure; Receive the target template matching the second structure from the preset server based on the target template acquisition request; The target template is rendered based on the preset data to generate a preset file.

14. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the file generation method as described in any one of claims 1-10.

15. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device is able to perform the file generation method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Cloud printing method and cloud printing server

    CN106775509A

  • Label generation method and device, template configuration method and device and storage medium

    CN112000302A

  • Application installation package generation method, computing device and storage medium

    CN114691146A