Business data printing method, device, electronic device and readable storage medium
By obtaining the storage and template address of business data on the printing device on the server side and generating the printing URL of the target format file, the problem that business data from different business platforms cannot be directly printed on the client is solved, and cross-platform business data printing and efficient conversion are realized.
Patent Information
- Application Number
- CN202210882419.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-07-26
AI Technical Summary
Business data from different business platforms cannot be printed directly on the client, mainly because the client is incompatible with the business platform.
The printing device on the server side responds to the client's printing instruction, obtains the storage address and template address of the business data, generates the target format file and printing website, and the client prints by accessing the website.
It realizes cross-platform business data printing, solves the printing problem caused by incompatibility between the client and the business platform, improves the efficiency of data conversion and printing, and expands the scope of application.
Smart Images

Figure CN115167791B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic device and readable storage medium for printing business data. Background Art
[0002] In related technologies, different business data are stored on different business platforms, and the printing of business data is performed through the collaboration between the business platform and the client. If the client is incompatible with the business platform, printing cannot be performed. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the related art.
[0004] To this end, a first aspect of the present invention is to provide a method for printing business data.
[0005] A second aspect of the present invention is to provide a device for printing business data.
[0006] A third aspect of the present invention is to provide an electronic device.
[0007] A fourth aspect of the present invention is to provide a readable storage medium.
[0008] In view of this, according to one aspect of the present invention, a method for printing business data is proposed, which can be used in a server. The printing method includes: responding to a printing instruction sent by a client, determining the storage address and template address of the business data according to the printing instruction; obtaining the business data according to the storage address, and obtaining the target printing template according to the template address; generating a target format file and a printing URL of the target format file according to the business data and the target printing template; and sending the printing URL to the client so that the client can print the target format file through the printing URL.
[0009] It should be noted that the business data printing method proposed in the present invention is used to print business data of different business platforms, and its execution entity can be a business data printing device. In order to more clearly illustrate the business data printing method proposed in the present invention, the following technical solution uses the execution entity of the business data printing method as an example of a business data printing device.
[0010] In this technical solution, when the printing device receives a print instruction sent by the client, the printing device can parse the print instruction to determine the storage address of the business data that the client wants to print and the template address of the template for printing the business data.
[0011] Furthermore, the printing device obtains the business data that the customer wants to print according to the storage address. Specifically, different business data are stored in different business platforms, and the printing device can access the corresponding business platform through the storage address to retrieve the business data that the customer wants to print.
[0012] Furthermore, the printing device obtains the target printing template for printing the business data according to the template address. Specifically, the printing device has prepared multiple printing templates according to the requirements of different business platforms and stored them in a storage device. The printing device can retrieve the target printing template from the storage device according to the template address.
[0013] Furthermore, the printing device generates a target format file and a printing URL for the target format file based on the business data and the target print template. Specifically, the printing device can process the business data and map the processed business data to the target print template according to a corresponding relationship to generate the target file, wherein the target format file is generally a PDF file.
[0014] Specifically, after generating the target format file, the printing device saves it and generates a URL for accessing the target file, ie, the above-mentioned printing URL, based on the saved address information.
[0015] Furthermore, the printing device sends the printing website to the client, and the client can view and print the target format file by accessing the printing website through a browser.
[0016] In related technologies, different business data are stored on different business platforms, and the printing of business data is performed through the collaboration between the business platform and the print control. If the print control is incompatible with the business platform, printing cannot be performed.
[0017] Therefore, in the technical solution of the present invention, a method for printing business data applied to the server side is proposed. The method can respond to the print instruction sent by the client through a printing device, obtain the storage address of the business data and the template address of the template required to print the business data, and then determine the target format file and the printing URL of the target format file based on the business data obtained through the storage address and the target printing template obtained through the template address, and finally send the printing URL to the client. That is, the technical solution of the present invention is to retrieve the business data required by the customer from different business platforms on the server side, and at the same time convert the business data into the target format file according to the target printing template, and generate the printing URL of the target format file, so that the client can view and print the target format file by accessing the URL, thereby solving the problem that the customer cannot print business data due to incompatibility between the client and the business platform.
[0018] In addition, the business data printing method proposed in the above technical solution of the present invention may also have the following additional technical features:
[0019] In the above technical solution, the printing instruction includes a printing number, and the step of determining the storage address and template address of the business data according to the printing instruction specifically includes: querying the first database according to the printing number to determine the storage address and template address corresponding to the printing number; wherein the first database is a database that stores the association relationship between the printing number, storage address and template address.
[0020] In this technical solution, the printing instruction includes a printing number, and the first database represents a database storing the association relationship between the printing number, the storage address and the template address.
[0021] Specifically, the process of the printing device determining the storage address and the template address according to the printing instruction is as follows: the printing device queries the first database according to the printing number, and determines the corresponding storage address and template address according to the association relationship.
[0022] In this technical solution, since the print number is uniquely associated with the template address and storage address in the first database, the printing device can determine the storage address and template address corresponding to the print number by querying the first database. This improves the efficiency and accuracy of determining the storage address and template address.
[0023] In the above technical solution, the print instruction also includes a query instruction, and the step of obtaining business data according to the storage address specifically includes: sending a query instruction to the business platform corresponding to the storage address, and receiving the business data returned by the business platform.
[0024] In this technical solution, the above-mentioned printing instruction also includes a query instruction, which can be used to query business data.
[0025] Specifically, the process of the printing device acquiring the service data according to the storage address is as follows: the printing device sends the above query instruction to the service platform corresponding to the storage address, and thus acquires the service data required by the customer.
[0026] Specifically, the business platform can filter the data it stores according to the above-mentioned query instructions and determine the business data corresponding to the query instructions, that is, the business data required by the customer. After the business platform queries the business data, it will return the business data to the printing device. Therefore, the printing device can obtain the business data required by the customer by sending query instructions to the business platform corresponding to the storage address.
[0027] In the above technical solution, the step of obtaining the target printing template according to the template address specifically includes: when it is determined that the template address is a local address, retrieving the target printing template from the storage device of the server according to the template address; or when it is determined that the template address is a remote address, retrieving the target printing template from the remote service platform according to the template address; wherein, the storage device of the server stores a standard printing template, and the remote service platform stores a printing template that is modified from the standard printing template.
[0028] In this technical solution, the storage device of the server stores standard printing templates corresponding to different business platforms, and the remote service platform stores printing templates modified by customers according to different needs.
[0029] Specifically, the process of the printing device acquiring the target printing template according to the template address is as follows: the printing device first determines the type of the template address, that is, determines whether the template address is a local address or a remote address.
[0030] Specifically, if the printing device determines that the template address is a local address, it retrieves the target printing template from the server's storage device based on the template address. Specifically, if the template address is a local address, it indicates that the target printing template required by the client is a standard printing template, so the printing device needs to retrieve it from the server's storage device.
[0031] Specifically, if the printing device determines that the template address is a remote address, it retrieves the target printing template from the remote service platform based on the template address. Specifically, if the template address is a remote address, it indicates that the target printing template required by the customer is a modified version of the standard printing template, and therefore the printing device needs to retrieve it from the remote service platform.
[0032] In this technical solution, the printing device can quickly determine the method for obtaining the target printing template by judging the type of the template address, thereby improving the efficiency of obtaining the target printing template.
[0033] In the above technical solution, the steps of generating a target format file and a printing URL of the target format file based on the business data and the target printing template specifically include: when it is determined that there are historical printing records of the business data, retrieving the target format file and the printing URL of the target format file corresponding to the business data according to the historical printing records; or when it is determined that there are no historical printing records of the business data, converting the business data into preset format data, merging the preset format data with the target printing template to generate a target format file, saving the target format file and generating a printing URL.
[0034] In this technical solution, the above-mentioned historical printing records represent printing records of business data on the server side.
[0035] Specifically, the process of the printing device generating the target format file and the printing URL of the target format file according to the business data and the target printing template is as follows: the printing device first determines whether there is a historical printing record of the business data in the printing record of the server.
[0036] Specifically, when it is determined that there is a historical printing record of the business data, the printing device directly retrieves the target format file corresponding to the business data and the printing URL of the target format file according to the historical printing record.
[0037] Specifically, if there is a historical print record for the business data, it indicates that the business data has been printed before. Therefore, the printing device does not need to regenerate the target format file based on the business data and the target print template. Instead, it can directly retrieve the target format file and print URL corresponding to the business data. This effectively improves the efficiency of determining the target format file and print URL, and effectively reduces the resource usage of the printing device.
[0038] Specifically, when it is determined that there is no historical printing record of business data, the printing device converts the business data into preset format data, and then maps and merges the preset format data with the target printing template to generate a target format file, and finally generates a printing URL based on the location information saved in the target format file.
[0039] Specifically, if there is no historical printing record of the business data, it means that the business data has not been printed before. Therefore, the printing device needs to process the business data, generate preset format data, and then map the preset format data to the target printing template to determine the target format file and printing URL.
[0040] In this technical solution, the printing device determines whether there is a historical printing record of business data in the server's printing record, and uses different methods to determine the target format file and the printing URL of the target format file. In this way, the efficiency of determining the target format file and the printing URL is effectively improved, and the resource usage of the printing device is effectively reduced.
[0041] In the above technical solution, the step of converting the business data into data in a preset format specifically includes: converting the business data into data in a preset format by using a depth traversal algorithm.
[0042] In this technical solution, the printing device converts business data into preset format data by adopting a deep traversal algorithm, effectively ensuring that the determined preset format data can accurately express the entire content of the business data, thereby ensuring the accuracy of generating the target format file through the preset format data in subsequent steps.
[0043] In the above technical solution, before responding to the printing instruction sent by the client and determining the storage address and template address of the business data according to the printing instruction, the printing method also includes: generating multiple standard printing templates according to the requirements of different business platforms, and saving the multiple standard printing templates to the storage device of the server.
[0044] In this technical solution, different business platforms may require different printing templates due to the varying types of business data. For example, a business platform managing vehicle maintenance and inspection data may require a relatively large number of tables in its printing template. Therefore, the printing device must generate multiple standard printing templates corresponding to the requirements of each business platform and store them in the server's storage device. This allows the printing device to retrieve the target template address from the template address in subsequent steps.
[0045] In the related art, target format files are usually generated through program code. This method is not well compatible with various data types, and the code writing is cumbersome and difficult, cannot be customized, and has a small application range.
[0046] Therefore, in the technical solution of the present invention, multiple target printing templates for generating target format files are prepared in advance according to the needs of different business platforms. In the process of generating the target format file, it is only necessary to map and merge the business data and the standard printing template to generate the target format file. In this way, it can be compatible with various data types, and there is no need to write a code book, and customization can be performed, which expands the application scope of the present invention.
[0047] According to a second aspect of the present invention, a business data printing device is proposed, including: a first processing module, used to respond to a printing instruction sent by a client, and determine the storage address and template address of the business data according to the printing instruction; a second processing module, used to obtain the business data according to the storage address, and obtain the target printing template according to the template address; a third processing module, used to generate a target format file and a printing URL of the target format file according to the business data and the target printing template; and a fourth processing module, used to send the printing URL to the client, so that the client can print the target format file through the printing URL.
[0048] In this technical solution, when receiving a print instruction sent by the client, the first processing module can parse the print instruction to determine the storage address of the business data that the client wants to print and the template address of the template for printing the business data.
[0049] Furthermore, the second processing module obtains the business data that the customer wants to print according to the storage address. Specifically, different business data are stored in different business platforms, and the second processing module can access the corresponding business platform through the storage address to retrieve the business data that the customer wants to print.
[0050] Furthermore, the second processing module obtains the target printing template for printing the business data according to the template address. Specifically, the first processing module pre-produces a variety of printing templates according to the requirements of different business platforms and stores them in a storage device. The second processing module can retrieve the target printing template from the storage device according to the template address.
[0051] Furthermore, a third processing module generates a target format file and a printing URL for the target format file based on the business data and the target print template. Specifically, the third processing module can process the business data and map the processed business data to the target print template according to a corresponding relationship to generate the target file, wherein the target format file is generally a PDF file.
[0052] Specifically, after the target format file is generated, the third processing module saves it and generates a URL for accessing the target file, ie, the above-mentioned printing URL, based on the saved address information.
[0053] Furthermore, the fourth processing module sends the print URL to the client, and the client can view and print the target format file by accessing the print URL through a browser.
[0054] In related technologies, different business data are stored on different business platforms, and the printing of business data is performed through the collaboration between the business platform and the print control. If the print control is incompatible with the business platform, printing cannot be performed.
[0055] Therefore, in the technical solution of the present invention, a method for printing business data applied to the server side is proposed, which can respond to the printing instruction sent by the client through the first processing module, obtain the storage address of the business data and the template address of the template required to print the business data, the second processing module can obtain the business data according to the storage address, and can obtain the target printing template according to the template address, the third processing module can determine the target format file and the printing URL of the target format file according to the above business data and the target printing template, and the fourth processing module can send the printing URL to the client for the client to print. In the technical solution of the present invention, the printing device of the business data is set on the server side, that is, the technical solution of the present invention is to retrieve the business data required by the customer from different business platforms on the server side, and at the same time convert the business data into the target format file according to the target printing template, and generate the printing URL of the target format file, so that the client can view and print the target format file by accessing the URL, which solves the problem that the customer cannot print business data due to incompatibility between the client and the business platform.
[0056] According to the third aspect of the present invention, an electronic device is proposed, comprising: a memory, in which programs or instructions are stored; a processor, which executes the programs or instructions stored in the memory to implement the steps of the business data printing method proposed in the above technical solution of the present invention, thereby having all the beneficial technical effects of the business data printing method proposed in the above technical solution of the present invention, and will not be elaborated on here.
[0057] According to a fourth aspect of the present invention, a readable storage medium is provided, which stores a program or instructions. When executed by a processor, the program or instructions implement the business data printing method provided by the above technical solution of the present invention. Therefore, the readable storage medium has all the beneficial effects of the business data printing method provided by the above technical solution of the present invention, and no further details are given here.
[0058] Additional aspects and advantages of the invention will become apparent from the description which follows, or may be learned by practice of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0060] Figure 1 FIG1 shows a flow chart of a method for printing business data according to an embodiment of the present invention;
[0061] Figure 2 A second flow chart of a method for printing business data according to an embodiment of the present invention is shown;
[0062] Figure 3The third flowchart of the method for printing business data according to an embodiment of the present invention is shown;
[0063] Figure 4 A fourth flowchart of a method for printing business data according to an embodiment of the present invention is shown;
[0064] Figure 5 FIG5 is a flowchart of a method for printing business data according to an embodiment of the present invention;
[0065] Figure 6 FIG6 shows a sixth flow chart of a method for printing business data according to an embodiment of the present invention;
[0066] Figure 7 FIG7 is a flowchart of a method for printing business data according to an embodiment of the present invention;
[0067] Figure 8 A schematic block diagram showing a device for printing business data according to an embodiment of the present invention is shown;
[0068] Figure 9 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0069] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present invention and the features therein can be combined with each other without conflict.
[0070] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0071] The following combination Figures 1 to 9 , the business data printing method, device, electronic device and readable storage medium provided by the embodiments of the present invention are described in detail through specific embodiments and their application scenarios.
[0072] Example 1:
[0073] Figure 1 A schematic flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing method includes:
[0074] S102, responding to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction;
[0075] S104, obtaining business data according to the storage address, and obtaining the target printing template according to the template address;
[0076] S106, generating a target format file and a printing URL of the target format file according to the business data and the target printing template;
[0077] S108: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0078] It should be noted that the business data printing method proposed in the present invention is used to print business data of different business platforms, and its execution entity can be a business data printing device. In order to more clearly illustrate the business data printing method proposed in the present invention, the following embodiment uses the execution entity of the business data printing method as an example of a business data printing device.
[0079] In this embodiment, when the printing device receives the printing instruction sent by the client, the printing device can parse the printing instruction to determine the storage address of the business data that the client wants to print and the template address of the template for printing the business data.
[0080] Furthermore, the printing device obtains the business data that the customer wants to print according to the storage address. Specifically, different business data are stored in different business platforms, and the printing device can access the corresponding business platform through the storage address to retrieve the business data that the customer wants to print.
[0081] Furthermore, the printing device obtains the target printing template for printing the business data according to the template address. Specifically, the printing device has prepared multiple printing templates according to the requirements of different business platforms and stored them in a storage device. The printing device can retrieve the target printing template from the storage device according to the template address.
[0082] Furthermore, the printing device generates a target format file and a printing URL for the target format file based on the business data and the target print template. Specifically, the printing device can process the business data and map the processed business data to the target print template according to a corresponding relationship to generate the target file, wherein the target format file is generally a PDF file.
[0083] Specifically, after generating the target format file, the printing device saves it and generates a URL for accessing the target file, ie, the above-mentioned printing URL, based on the saved address information.
[0084] Furthermore, the printing device sends the printing website to the client, and the client can view and print the target format file by accessing the printing website through a browser.
[0085] In related technologies, different business data are stored on different business platforms, and the printing of business data is performed through the collaboration between the business platform and the print control. If the print control is incompatible with the business platform, printing cannot be performed.
[0086] Therefore, in an embodiment of the present invention, a method for printing business data applied to a server is proposed. The method can obtain the storage address of the business data and the template address of the template required to print the business data through a printing device in response to a print instruction sent by a client. Then, based on the business data obtained through the storage address and the target printing template obtained through the template address, a target format file and a printing URL for the target format file are determined, and finally the printing URL is sent to the client. That is, in an embodiment of the present invention, the server retrieves the business data required by the client from different business platforms, converts the business data into a target format file according to the target printing template, and generates a printing URL for the target format file, so that the client can view and print the target format file by accessing the URL, thereby solving the problem of the client being unable to print business data due to incompatibility between the client and the business platform.
[0087] Figure 2 A flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing instruction includes a print number. The printing method includes:
[0088] S202, in response to the print instruction sent by the client, querying the first database according to the print number to determine the storage address and template address corresponding to the print number;
[0089] S204, obtaining business data according to the storage address, and obtaining the target printing template according to the template address;
[0090] S206, generating a target format file and a printing URL of the target format file according to the business data and the target printing template;
[0091] S208: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0092] The first database is a database storing the association relationship between the printing number, the storage address and the template address.
[0093] In this embodiment, the print instruction includes a print number, and the first database is a database storing associations among print numbers, storage addresses, and template addresses.
[0094] Specifically, the process of the printing device determining the storage address and the template address according to the printing instruction is as follows: the printing device queries the first database according to the printing number, and determines the corresponding storage address and template address according to the association relationship.
[0095] In this embodiment, since the print number is uniquely associated with the template address and storage address in the first database, the printing device can determine the storage address and template address corresponding to the print number by querying the first database. This improves the efficiency and accuracy of determining the storage address and template address.
[0096] Figure 3 A flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing instruction also includes a query instruction. The printing method includes:
[0097] S302, in response to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction;
[0098] S304, sending a query instruction to the business platform corresponding to the storage address, receiving the business data returned by the business platform, and obtaining the target printing template according to the template address;
[0099] S306, generating a target format file and a printing URL of the target format file according to the business data and the target printing template;
[0100] S308: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0101] In this embodiment, the print instruction also includes a query instruction, which can be used to query business data.
[0102] Specifically, the process of the printing device acquiring the service data according to the storage address is as follows: the printing device sends the above query instruction to the service platform corresponding to the storage address, and thus acquires the service data required by the customer.
[0103] Specifically, the business platform can filter the data it stores according to the above-mentioned query instructions and determine the business data corresponding to the query instructions, that is, the business data required by the customer. After the business platform queries the business data, it will return the business data to the printing device. Therefore, the printing device can obtain the business data required by the customer by sending query instructions to the business platform corresponding to the storage address.
[0104] For example, in order to ensure that business data is not stolen, the business data returned by the business platform is usually encrypted. Therefore, after receiving the acquired business data, the printing device also needs to use MD5 to decrypt the acquired business data so that the subsequent steps can generate the target format file based on the business data and the target printing template.
[0105] Figure 4 A schematic flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing method includes:
[0106] S402, responding to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction;
[0107] S404, obtaining business data according to the storage address;
[0108] S406, when it is determined that the template address is a local address, the target printing template is retrieved from the storage device of the server according to the template address;
[0109] S408, when it is determined that the template address is a remote address, retrieving the target printing template from the remote service platform according to the template address;
[0110] S410, generating a target format file and a printing URL of the target format file according to the business data and the target printing template;
[0111] S412: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0112] The storage device of the server stores a standard printing template, and the remote service platform stores a printing template that is modified from the standard printing template.
[0113] In this embodiment, the storage device of the server stores standard printing templates corresponding to different service platforms, and the remote service platform stores printing templates modified by the customer according to different needs.
[0114] Specifically, the process of the printing device acquiring the target printing template according to the template address is as follows: the printing device first determines the type of the template address, that is, determines whether the template address is a local address or a remote address.
[0115] Specifically, if the printing device determines that the template address is a local address, it retrieves the target printing template from the server's storage device based on the template address. Specifically, if the template address is a local address, it indicates that the target printing template required by the client is a standard printing template, so the printing device needs to retrieve it from the server's storage device.
[0116] Specifically, if the printing device determines that the template address is a remote address, it retrieves the target printing template from the remote service platform based on the template address. Specifically, if the template address is a remote address, it indicates that the target printing template required by the customer is a modified version of the standard printing template, and therefore the printing device needs to retrieve it from the remote service platform.
[0117] In this embodiment, the printing device can quickly determine the method for acquiring the target printing template by judging the type of the template address, thereby improving the efficiency of acquiring the target printing template.
[0118] Figure 5 A schematic flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing method includes:
[0119] S502, in response to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction;
[0120] S504, obtaining business data according to the storage address, and obtaining the target printing template according to the template address;
[0121] S506, when it is determined that there is a historical printing record of the business data, retrieve the target format file corresponding to the business data and the printing URL of the target format file according to the historical printing record;
[0122] S508, if it is determined that there is no historical printing record of the business data, converting the business data into preset format data, merging the preset format data with the target printing template to generate a target format file, saving the target format file and generating a printing URL;
[0123] S510: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0124] In this embodiment, the above-mentioned historical printing records represent printing records of service data on the server side.
[0125] Specifically, the process of the printing device generating the target format file and the printing URL of the target format file according to the business data and the target printing template is as follows: the printing device first determines whether there is a historical printing record of the business data in the printing record of the server.
[0126] Specifically, when it is determined that there is a historical printing record of the business data, the printing device directly retrieves the target format file corresponding to the business data and the printing URL of the target format file according to the historical printing record.
[0127] Specifically, if there is a historical print record for the business data, it indicates that the business data has been printed before. Therefore, the printing device does not need to regenerate the target format file based on the business data and the target print template. Instead, it can directly retrieve the target format file and print URL corresponding to the business data. This effectively improves the efficiency of determining the target format file and print URL, and effectively reduces the resource usage of the printing device.
[0128] Specifically, when it is determined that there is no historical printing record of business data, the printing device converts the business data into preset format data, and then maps and merges the preset format data with the target printing template to generate a target format file, and finally generates a printing URL based on the location information saved in the target format file.
[0129] Specifically, if there is no historical printing record of the business data, it means that the business data has not been printed before. Therefore, the printing device needs to process the business data, generate preset format data, and then map the preset format data to the target printing template to determine the target format file and printing URL.
[0130] For example, taking the preset format data as key-value pair data and the target format file as a PDF format file as an example, when there is no historical printing record of the business data, the process of the printing device generating the target format file and printing address based on the business data and the target printing template is: the printing device first processes the business data into key-value pair data, and establishes an intermediate worksheet, and at the same time deletes the header, footer and preparation parameter columns in the intermediate worksheet.
[0131] Furthermore, the printing device searches for paired list tags between the intermediate worksheet and the target printing template. If so, a depth + breadth traversal is performed to copy and insert the hierarchical list in the target printing template into the intermediate worksheet. After the list is completely inserted, the list tag is deleted. If there are tags that need to merge the same fields, the tags are merged.
[0132] Furthermore, the printing device inserts the list header of the target printing template into the first row of each page of the intermediate worksheet, extracts the header and footer of the target printing template, and determines the page numbers from which the header and footer are inserted into the header and footer parts of the intermediate worksheet according to the settings of the header and footer.
[0133] Furthermore, the printing device maps the key-value pair data and inserts it into an intermediate worksheet, and converts the intermediate worksheet into a PDF file binary stream, namely the target file mentioned above.
[0134] Specifically, for the object selection box label, cell frame label and picture label data in the intermediate worksheet, the printing device sets the selection box label, cell frame label and picture label by comparing the key values corresponding to the selection box label, cell frame label and picture label with the key value pair data.
[0135] Furthermore, the printing device saves the binary stream of the PDF file to the storage device of the server, and the server generates a printing website address. Specifically, the printing website address is a URL address.
[0136] In this embodiment, the printing device determines whether there is a historical printing record of business data in the printing record of the server, and uses different methods to determine the target format file and the printing URL of the target format file. In this way, the efficiency of determining the target format file and the printing URL is effectively improved, and the resource usage of the printing device is effectively reduced.
[0137] Figure 6 A schematic flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing method includes:
[0138] S602, in response to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction;
[0139] S604, obtaining business data according to the storage address, and obtaining the target printing template according to the template address;
[0140] S606, when it is determined that there is a historical printing record of the business data, retrieve the target format file corresponding to the business data and the printing URL of the target format file according to the historical printing record;
[0141] S608, if it is determined that there is no historical printing record of the business data, converting the business data into preset format data using a deep traversal algorithm, merging the preset format data with a target printing template to generate a target format file, saving the target format file and generating a printing URL;
[0142] S610: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0143] In this embodiment, the printing device converts the business data into preset format data by adopting a deep traversal algorithm, effectively ensuring that the determined preset format data can accurately express the entire content of the business data, thereby ensuring the accuracy of generating the target format file through the preset format data in subsequent steps.
[0144] Figure 7 A schematic flow chart of a method for printing business data according to an embodiment of the present invention is shown, wherein the printing method includes:
[0145] S702, generating multiple standard printing templates according to the requirements of different business platforms, and saving the multiple standard printing templates to the storage device of the server;
[0146] S704, responding to the print instruction sent by the client, determining the storage address and template address of the business data according to the print instruction;
[0147] S706, obtaining business data according to the storage address, and obtaining the target printing template according to the template address;
[0148] S708, generating a target format file and a printing URL of the target format file according to the business data and the target printing template;
[0149] S710: Send the print URL to the client, so that the client can print the target format file through the print URL.
[0150] In this embodiment, due to the differences in the types of business data across different service platforms, the required printing templates may differ. For example, a service platform managing vehicle maintenance and inspection data may require a relatively large number of tables in its printing template. Therefore, the printing device needs to generate multiple standard printing templates corresponding to the requirements of each service platform and store them in the server's storage device. This allows the printing device to retrieve the target template address from the template address in subsequent steps.
[0151] For example, the printing device can quickly produce the above-mentioned standard printing template through EXCEL. The specific process is to set the template parameters according to the business platform requirements, set whether the template needs headers and footers according to the business platform requirements, such as on which page the header and footer need to appear, set whether the template needs to insert tables according to the business platform requirements, such as a business platform that manages vehicle maintenance and inspection data needs to insert a large number of tables, set whether the template needs to insert radio buttons according to the business platform requirements, set whether the template needs to dynamically select objects according to the business platform requirements, and set whether the template needs to dynamically insert pictures according to the business platform requirements.
[0152] In the related art, target format files are usually generated through program code. This method is not well compatible with various data types, and the code writing is cumbersome and difficult, cannot be customized, and has a small application range.
[0153] Therefore, in an embodiment of the present invention, multiple target printing templates for generating target format files are prepared in advance according to the needs of different business platforms. In the process of generating the target format file, it is only necessary to map and merge the business data and the standard printing template to generate the target format file. In this way, it can be compatible with various data types, and there is no need to write a code book, and customization can be performed, which expands the application scope of the present invention.
[0154] Example 2:
[0155] Figure 8A schematic block diagram of a business data printing device according to an embodiment of the present invention is shown. The business data printing device 800 includes: a first processing module 802, for responding to a print instruction sent by a client, and determining a storage address and a template address of the business data according to the print instruction; a second processing module 804, for obtaining business data according to the storage address, and obtaining a target print template according to the template address; a third processing module 806, for generating a target format file and a print URL of the target format file according to the business data and the target print template; and a fourth processing module 808, for sending the print URL to the client, so that the client can print the target format file through the print URL.
[0156] In this embodiment, upon receiving a print instruction sent by the client, the first processing module 802 may parse the print instruction to determine the storage address of the business data that the client wants to print and the template address of the template for printing the business data.
[0157] Furthermore, the second processing module 804 obtains the business data that the customer wants to print according to the storage address. Specifically, different business data are stored in different business platforms. The second processing module 804 can access the corresponding business platform through the storage address to retrieve the business data that the customer wants to print.
[0158] Furthermore, the second processing module 804 obtains a target printing template for printing the business data according to the template address. Specifically, the first processing module 802 pre-produces a variety of printing templates according to the requirements of different business platforms and stores them in a storage device. The second processing module 804 can retrieve the target printing template from the storage device according to the template address.
[0159] Furthermore, the third processing module 806 generates a target format file and a print URL for the target format file based on the business data and the target print template. Specifically, the third processing module 806 can process the business data and map the processed business data to the target print template according to a corresponding relationship to generate the target file, wherein the target format file is generally a PDF file.
[0160] Specifically, after generating the target format file, the third processing module 806 saves it and generates a URL for accessing the target file, ie, the above-mentioned printing URL, based on the saved address information.
[0161] Furthermore, the fourth processing module 808 sends the print URL to the client, and the client can view and print the target format file by accessing the print URL through a browser.
[0162] In related technologies, different business data are stored on different business platforms, and the printing of business data is performed through the collaboration between the business platform and the print control. If the print control is incompatible with the business platform, printing cannot be performed.
[0163] Therefore, in an embodiment of the present invention, a method for printing business data applied to the server side is proposed, which can respond to the print instruction sent by the client through the first processing module 802, obtain the storage address of the business data and the template address of the template required to print the business data, the second processing module 804 can obtain the business data according to the storage address, and can obtain the target printing template according to the template address, the third processing module 806 can determine the target format file and the printing URL of the target format file according to the above business data and the target printing template, and the fourth processing module 808 can send the printing URL to the client for the client to print. In an embodiment of the present invention, the business data printing device 800 is set on the server side, that is, the embodiment of the present invention is to retrieve the business data required by the customer from different business platforms on the server side, and at the same time convert the business data into the target format file according to the target printing template, and generate the printing URL of the target format file, so that the client can view and print the target format file by accessing the URL, which solves the problem that the customer cannot print business data due to incompatibility between the client and the business platform.
[0164] Furthermore, in this embodiment, the printing instruction includes a printing number, and the first processing module 802 is also used to query the first database according to the printing number to determine the storage address and template address corresponding to the printing number; wherein the first database is a database that stores the association relationship between the printing number, storage address and template address.
[0165] Furthermore, in this embodiment, the print instruction also includes a query instruction, and the second processing module 804 is further configured to send the query instruction to the service platform corresponding to the storage address, and receive service data returned by the service platform.
[0166] Furthermore, in this embodiment, the second processing module 804 is also used to retrieve the target printing template from the storage device of the server according to the template address when it is determined that the template address is a local address; or to retrieve the target printing template from the remote service platform according to the template address when it is determined that the template address is a remote address; wherein the storage device of the server stores the standard printing template, and the remote service platform stores the printing template that is modified from the standard printing template.
[0167] Furthermore, in this embodiment, the third processing module 806 is also used to retrieve the target format file and the printing URL of the target format file corresponding to the business data according to the historical printing record when it is determined that there is a historical printing record of the business data; or to convert the business data into preset format data when it is determined that there is no historical printing record of the business data, merge the preset format data with the target printing template to generate a target format file, save the target format file and generate a printing URL.
[0168] Furthermore, in this embodiment, the third processing module 806 is further configured to convert the business data into data in a preset format through a depth traversal algorithm.
[0169] Furthermore, in this embodiment, the first processing module 802 is further configured to generate a plurality of standard printing templates according to requirements of different business platforms, and save the plurality of standard printing templates to a storage device of the server.
[0170] Example 3:
[0171] Figure 9 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown, and the electronic device 900 includes: a memory 902, in which programs or instructions are stored; a processor 904, which executes the programs or instructions stored in the memory 902 to implement the steps of the business data printing method proposed in the above embodiment of the present invention, and thus has all the beneficial technical effects of the business data printing method proposed in the above embodiment of the present invention, which will not be elaborated on here.
[0172] Example 4:
[0173] According to a fourth embodiment of the present invention, a readable storage medium is provided, which stores a program or instructions. When executed by a processor, the program or instructions implement the business data printing method proposed in the above-mentioned embodiments of the present invention. Therefore, the readable storage medium has all the beneficial effects of the business data printing method proposed in the above-mentioned embodiments of the present invention, and no further details are given here.
[0174] In this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified or limited. Terms such as "connect," "install," and "fix" should be interpreted broadly. For example, "connect" can refer to a fixed connection, a detachable connection, or an integral connection; and can be directly connected or indirectly connected through an intermediary. Those skilled in the art will understand the specific meanings of these terms in the present invention based on specific circumstances.
[0175] Throughout this specification, terms such as "one embodiment," "some embodiments," and "specific embodiments" mean that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0176] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in this field can implement it. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0177] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for printing business data, characterized in that: For a server, the printing method includes: In response to a print instruction sent by the client, determining a storage address and a template address of the business data according to the print instruction; Acquire the business data according to the storage address, and acquire the target printing template according to the template address; Generate a target format file and a printing URL of the target format file according to the business data and the target printing template; Sending the print URL to the client, so that the client can print the target format file through the print URL; The generating of the target format file and the printing URL of the target format file according to the business data and the target printing template specifically includes: In the case where it is determined that there is a historical printing record of the business data, retrieving the target format file corresponding to the business data and the printing URL of the target format file according to the historical printing record; or If it is determined that there is no historical printing record of the business data, converting the business data into preset format data, mapping and merging the preset format data with a standard printing template to generate a target format file, saving the target format file and generating the printing URL; During the mapping and merging operation, an intermediate work table is created, and a search is performed to determine whether a matching list tag exists between the intermediate work table and the target printing template. If so, a depth traversal and a breadth traversal are performed. The acquiring of the target printing template according to the template address specifically includes: In the case where it is determined that the template address is a local address, retrieving the target printing template from the storage device of the server according to the template address; or In the case where it is determined that the template address is a remote address, retrieving the target printing template from the remote service platform according to the template address; The storage device of the server stores a standard printing template, and the remote service platform stores a printing template that is modified from the standard printing template.
2. The method for printing business data according to claim 1, characterized in that: The printing instruction includes a printing number, and determining the storage address and template address of the business data according to the printing instruction specifically includes: querying a first database according to the print number to determine the storage address and the template address corresponding to the print number; Wherein, the first database is a database storing the association relationship between the print number, the storage address and the template address.
3. The method for printing business data according to claim 1, characterized in that: The printing instruction also includes a query instruction, and obtaining the business data according to the storage address specifically includes: The query instruction is sent to the service platform corresponding to the storage address, and the service data returned by the service platform is received.
4. The method for printing business data according to claim 1, wherein: The converting of the business data into data in a preset format specifically includes: The business data is converted into data in a preset format through a deep traversal algorithm.
5. The method for printing business data according to any one of claims 1 to 4, characterized in that: Before responding to a print instruction sent by the client and determining the storage address and template address of the business data according to the print instruction, the printing method further includes: According to the requirements of different business platforms, multiple standard printing templates are generated, and the multiple standard printing templates are saved in the storage device of the server.
6. A printing device for business data, characterized in that: The business data printing device is configured to implement the steps of the business data printing method according to any one of claims 1 to 5, including: A first processing module, configured to respond to a print instruction sent by a client and determine a storage address and a template address of the business data according to the print instruction; A second processing module is configured to obtain the business data according to the storage address and obtain a target printing template according to the template address; A third processing module is configured to generate a target format file and a printing URL for the target format file according to the business data and the target printing template; The fourth processing module is configured to send the print URL to the client, so that the client can print the target format file via the print URL.
7. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a program, and when the processor executes the program, the steps of the business data printing method according to any one of claims 1 to 5 are implemented.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the business data printing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Printing processing method and device, printing terminal, logistic platform and server
CN108572801A
Print control method, server. and computer readable storage medium
CN109388357A