Data source printing method, device, electronic device and storage medium

By receiving the data to be printed, determining the target print page number identification based on the paging configuration information and splitting the page, the complex multiple printing problems in the prior art are solved, and the printing effect of simplifying printing steps and format accuracy is achieved.

CN115617283BActive Publication Date: 2025-07-25WINNING HEALTH TECHNOLOGY GROUP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211253317.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-13
Publication Date
2025-07-25
Estimated Expiration
2042-10-13

AI Technical Summary

Technical Problem

In the prior art, based on a single-sided printer, printing of data sources with special fields requires multiple filtering and printing in batches, resulting in complex printing steps and easy to miss verification and failing.

Method used

By receiving the data to be printed, the target printing page number identification is determined based on the paging configuration information, the page number to be printed is split into multiple pages to be printed, and the page number to be printed is printed according to the page number to be printed, so that printing in different formats is realized.

Benefits of technology

The printing steps are simplified, ensuring the accuracy of the printing format of each page, avoiding omissions and errors, and meeting the printing needs of different pages and different formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617283B_ABST
    Figure CN115617283B_ABST
Patent Text Reader

Abstract

The present application provides a data source printing method, apparatus, electronic device, and storage medium. The method includes: receiving the data to be printed sent by a requesting device; determining the target print page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed; splitting the data to be printed according to the target print page number identifier of each record to obtain a plurality of pages to be printed and the print identifier of each print page; and printing each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed. By paging the data to be printed according to the paging configuration information, it is possible to paginate the data to be printed into pages to be printed in different formats. Printing the paginated pages to be printed can meet the requirement that the printed pages are in different formats on different pages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of medical software, and in particular, to a data source printing method, device, electronic device, and storage medium. Background Art

[0002] The printing system sends the print data source stored on the computer to the printing device and prints the print data source on the printing device. In order to save printing costs, sometimes double-sided printing is required, and the printed data is required to conform to the binding format. For data sources with special fields, it is required to be on a separate page and the printing format is different from that of other data sources.

[0003] In the prior art, in the case of a single-sided printer, only one printing template can be set for one data source. For the printing of data sources with special fields, currently, it is necessary to filter the print data source multiple times and then print it in batches. Therefore, the existing printing steps are complex and it is easy to cause the problem of missing verification and unqualified. Summary of the Invention

[0004] The purpose of the present application is to provide a data source printing method, device, electronic device, and storage medium for the above-mentioned deficiencies in the prior art, so as to achieve printing with different formats on different pages and simplify the printing steps.

[0005] To achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:

[0006] In a first aspect, an embodiment of the present application provides a data source printing method, and the method includes:

[0007] Receiving the data to be printed sent by the requesting device, where the data to be printed includes multiple records;

[0008] Determining the target print page number identifier of each record according to the paging configuration information of the requesting device and the data to be printed, where the target print page number identifier is used to indicate the page number of the page where the record is printed after printing, and the page number includes: odd page numbers and even page numbers, and the paging configuration information includes parity configuration information and special configuration information;

[0009] Splitting the data to be printed according to the target print page number identifier of each record to obtain multiple pages to be printed and the print identifier of each page to be printed;

[0010] Printing each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed.

[0011] Optionally, determining the target print page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed includes:

[0012] Determining the initial print page number identifier for each record according to the parity configuration information of the requesting device and the data to be printed, where the parity configuration information is used to indicate the number of records in each page after printing;

[0013] If there is special configuration information of the requesting device, then adjusting the initial print page number identifier of at least one record according to the special configuration information to obtain the target print page number identifier for each record, where the target print page number identifier of the adjusted record includes a special print mark.

[0014] Optionally, determining the initial print page number identifier for each record according to the parity configuration information of the requesting device and the data to be printed includes:

[0015] Determining the total number of records of the data to be printed;

[0016] Calculating the ratio of the total number of records to the number of records in each page in the paging configuration information to obtain the total number of pages and the odd and even pages of the data to be printed;

[0017] Marking the initial print page number identifier for each record of the data to be printed according to the odd and even pages.

[0018] Optionally, splitting the data to be printed according to the target print page number identifier of each record to obtain multiple pages to be printed and the print identifier of each page to be printed includes:

[0019] Splitting out multiple records with the same target print page number identifier from the data to be printed, and combining the multiple records into a page to be printed;

[0020] Obtaining the print identifier of the page to be printed according to the target print page number identifier of each record in the page to be printed.

[0021] Optionally, obtaining the print identifier of the page to be printed according to the target print page number identifier of each record in the page to be printed includes:

[0022] If the target print page number identifier of the records in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an odd page number, then determining the print identifier of the page to be printed as an odd number and the special print mark;

[0023] If the target print page number identifier recorded in the to-be-printed page includes a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the to-be-printed page is an even number and the special print mark;

[0024] If the target print page number identifier recorded in the to-be-printed page does not include a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the to-be-printed page is an odd print identifier;

[0025] If the target print page number identifier recorded in the to-be-printed page does not include a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the to-be-printed page is an even print identifier.

[0026] Optionally, printing each to-be-printed page according to the page number printing configuration information of the requesting device and the print identifier of each to-be-printed page includes:

[0027] Determine the print template corresponding to each to-be-printed page according to the page number printing configuration information of the requesting device and the print identifier of each to-be-printed page;

[0028] Print the to-be-printed page based on the print template.

[0029] Optionally, printing the to-be-printed page based on the print template includes:

[0030] Print the to-be-printed page with an odd print identifier and an odd and special print identifier based on the print template;

[0031] Print the to-be-printed page with an even print identifier and an even and special print identifier based on the print template.

[0032] In a second aspect, an embodiment of the present application further provides a data source printing device, and the device includes:

[0033] A receiving module, configured to receive to-be-printed data sent by a requesting device, where the to-be-printed data includes multiple records;

[0034] A determining module, configured to determine the target print page number identifier of each record according to the paging configuration information of the requesting device and the to-be-printed data, where the target print page number identifier is used to indicate the page number of the page where the record is located after printing, and the page number includes: odd page numbers and even page numbers, and the paging configuration information includes parity configuration information and special configuration information;

[0035] A splitting module, configured to split the data to be printed according to the target print page number identifiers of each record, so as to obtain a plurality of pages to be printed and the print identifiers of each page to be printed;

[0036] A printing module, configured to print each page to be printed according to the page number printing configuration information of the requesting device and the print identifiers of each page to be printed.

[0037] Optionally, the determining module is specifically configured to:

[0038] Determine the initial print page number identifiers of each record according to the parity configuration information of the requesting device and the data to be printed, where the parity configuration information is used to indicate the number of records in each page after printing;

[0039] If there is special configuration information of the requesting device, adjust the initial print page number identifiers of at least one record according to the special configuration information to obtain the target print page number identifiers of each record, where the target print page number identifiers of the adjusted records include special print marks.

[0040] Optionally, the determining module is specifically configured to:

[0041] Determine the total number of records of the data to be printed;

[0042] Calculate the ratio of the total number of records to the number of records in each page in the paging configuration information to obtain the total number of pages and the odd pages and even pages of the data to be printed;

[0043] Mark the initial print page number identifiers for each record of the data to be printed according to the odd pages and even pages.

[0044] Optionally, the splitting module is specifically configured to:

[0045] Split multiple records with the same target print page number identifier from the data to be printed, and combine the multiple records into a page to be printed;

[0046] Obtain the print identifier of the page to be printed according to the target print page number identifiers of each record in the page to be printed.

[0047] Optionally, the splitting module is specifically configured to:

[0048] If the target print page number identifier of the record in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the page to be printed is odd and the special print mark;

[0049] If the target print page number identifier recorded in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the page to be printed is an even number and the special print mark;

[0050] If the target print page number identifier recorded in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the page to be printed is an odd print identifier;

[0051] If the target print page number identifier recorded in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the page to be printed is an even print identifier.

[0052] Optionally, the printing module is specifically configured to:

[0053] Determine the print template corresponding to each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed;

[0054] Print the page to be printed based on the print template.

[0055] Optionally, the printing module is specifically configured to:

[0056] Print the page to be printed with an odd print identifier and an odd and special print identifier based on the print template;

[0057] Print the page to be printed with an even print identifier and an even and special print identifier based on the print template.

[0058] In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the application program runs, the processor communicates with the storage medium through the bus. The processor executes the program instructions to perform the steps of the data source printing method described in the first aspect above.

[0059] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and the computer program is read and executed to perform the steps of the data source printing method described in the first aspect above.

[0060] The beneficial effects of the present application are:

[0061] A data source printing method, device, electronic device, and storage medium provided by the present application receive the data to be printed sent by a requesting device; determine the target printing page number identifier for each record according to the pagination configuration information of the requesting device and the data to be printed; split the data to be printed according to the target printing page number identifier of each record to obtain multiple pages to be printed and the printing identifier for each printing page; and print each page to be printed according to the page number printing configuration information of the requesting device and the printing identifier of each page to be printed. By paginating the data to be printed according to the pagination configuration information, it is possible to paginate the data to be printed into pages to be printed in different formats, and printing the paginated pages to be printed can meet the requirement that the printed pages are in different formats on different pages. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0063] Figure 1 A flowchart of a data source printing method provided by an embodiment of the present application;

[0064] Figure 2 A schematic diagram of determining an initial printing page number identifier provided by an embodiment of the present application;

[0065] Figure 3 A schematic diagram of determining a target printing page number identifier provided by an embodiment of the present application;

[0066] Figure 4 A flowchart of another data source pagination printing method provided by an embodiment of the present application;

[0067] Figure 5 A schematic diagram of splitting data to be printed provided by an embodiment of the present application;

[0068] Figure 6 A schematic diagram of a device for a data source printing method provided by an embodiment of the present application;

[0069] Figure 7 A structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0070] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. It should be understood that the accompanying drawings in this application only serve the purpose of illustration and description, and are not used to limit the protection scope of this application. Additionally, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowchart may not be implemented in sequence, and steps without a logical context relationship may be reversed or implemented simultaneously. Moreover, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of this application.

[0071] In addition, the described embodiments are only some embodiments of this application, rather than all embodiments. The components of the embodiments of this application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of this application that is claimed, but merely represents selected embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of this application.

[0072] It should be noted that the term "including" will be used in the embodiments of this application to indicate the existence of the subsequently stated features, but does not exclude the addition of other features.

[0073] The method in the embodiments of this application is applied to a printing system, which may include a requesting device and a printing device. Among them, the requesting device may be an electronic device such as a laptop or a desktop computer. The requesting device is connected to the printing device and sends the data to be printed to the printing device. The printing device prints the data to be printed according to the received data to be printed by using the method provided in the embodiments of this application. The requesting device may be one or more requesting devices.

[0074] Figure 1 The following is a schematic flowchart of a data source printing method provided in the embodiments of this application, and the execution entity may be, for example, the above-mentioned printing device. As Figure 1 shown, the method includes:

[0075] S101. Receive the data to be printed sent by the requesting device.

[0076] Optionally, the data to be printed may include multiple records, which indicate multiple lines of data. The data to be printed may include the data source name, data source description, primary key ID and name, core field ID and name, print order, etc. Among them, the data source name indicates the source name of the data to be printed. For example, the source of the print data is the Anesthesiology Department; the data source description indicates a specific description of the data to be printed. For example, the data to be printed is anesthetic drugs; the primary key ID and name indicate that each record of the print data can be found through the primary key; the core field ID and name indicate that the data to be printed can be determined through the core field. For example, if the core field is a certain person's name, the data to be printed is all the drug data used by that person's name; the print order can indicate the print priority order of the data to be printed.

[0077] S102. Determine the target print page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed.

[0078] Among them, the target print page number identifier is used to indicate the page number of the page where each record is located after printing.

[0079] Optionally, the above paging configuration information can be pre-configured for each requesting device on the printing device. The same paging configuration information can be applied to one requesting device, or it can also be applied to multiple requesting devices. The paging configuration information of the requesting device may include parity configuration information and special configuration information.

[0080] Among them, the parity configuration information may be the number of records on the odd and even pages. Exemplarily, the number of records on the odd and even pages is set to 25 records, that is, the number of lines per page is set to 25 lines. The special configuration information may be the primary key value of the special field pre-set in the requesting device and the number of records in the special page after printing. Among them, the records containing the special field can be found through the primary key value of the special field. The primary key values corresponding to different special fields are different, and the special print marks of the records containing different special fields are different. For example, for special field 1, the special print mark of the record containing special field 1 can be set to special 1; for special field 2, the special print mark of the record containing special field 2 can be set to special 2.

[0081] Optionally, before determining the target print page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed, it is also necessary to determine whether the template data is pre-configured according to the following template configuration information. The template configuration information includes odd and even page template configuration data and special page configuration data. If the following template configuration information exists, the target print page number identifier for each record can be determined according to the paging configuration information and the data to be printed.

[0082] S103. Split the data to be printed according to the target print page number identifiers of each record, to obtain multiple pages to be printed and the print identifiers of each printed page.

[0083] Among them, each page to be printed may include multiple records.

[0084] Optionally, the print identifier may include a page number mark, an odd-even mark, and a special mark. Then, the print identifier may be, for example, a normal odd identifier, a normal even identifier, a special odd identifier, or a special even identifier. Among them, the normal odd identifier and the normal even identifier indicate the identifiers of records that do not include special fields, and the special odd identifier and the special even identifier indicate the identifiers of records that include special fields.

[0085] S104. Print each page to be printed according to the page number printing configuration information of the requesting device and the print identifiers of each page to be printed.

[0086] Optionally, the above page number printing configuration information may be pre-configured for each requesting device on the printing device. The same page number printing configuration information may be applied to one requesting device, or may also be applied to multiple requesting devices.

[0087] Optionally, the page number printing configuration information may include the configuration information of the print template, and may include the odd-even page template and the special page template. Among them, the odd-even page template includes the odd page template and the even page template, and the special page template indicates the special page template corresponding to the special field. Exemplarily, for the requesting device A, the page number printing configuration information is pre-configured for the requesting device A. In this page number printing configuration information: normal odd pages are printed using print template 1, normal even pages are printed using print template 3, special odd pages are printed using print template 2, and special even pages are printed using print template 4. Correspondingly, during printing, normal odd pages will be printed in the format of print template 1, normal even pages will be printed in the format of print template 3, and so on.

[0088] In this embodiment, by receiving the data to be printed sent by the requesting device; determining the target print page number identifiers of each record according to the paging configuration information of the requesting device and the data to be printed; splitting the data to be printed according to the target print page number identifiers of each record, to obtain multiple pages to be printed and the print identifiers of each printed page; and printing each page to be printed according to the page number printing configuration information of the requesting device and the print identifiers of each page to be printed. By paging the data to be printed according to the paging configuration information, it is possible to implement paging the data to be printed into pages to be printed in different formats, and printing the paged pages to be printed can meet the requirement that the printed pages are in different formats for different pages.

[0089] Optionally, determining the target print page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed in step S102 may include:

[0090] Optionally, determining the initial print page number identifier for each record according to the parity configuration information of the requesting device and the data to be printed, where the parity configuration information is used to indicate the number of records in each page after printing, that is, the number of lines in each page; specifically, performing the first paging on the data to be printed according to the parity configuration information of the requesting device and the data to be printed using a preset method, the initial print page number identifier for each record can be determined, and the initial print page number identifier may include the page number mark and the parity mark of the page where each record is located after paging.

[0091] Optionally, after the first paging, if there is special configuration information of the requesting device, adjusting the initial print page number identifier of at least one record according to the special configuration information to obtain the target print page number identifier for each record, where the target print page number identifier of the adjusted record includes a special print mark, and at least one of the adjusted records indicates that the record includes a special field.

[0092] Optionally for the special page template, if there is special configuration information of the requesting device, adjusting the initial print page number identifier of at least one record according to the special configuration information to obtain the target print page number identifier for each record. Specifically, each record in the data to be printed containing the special field can be found according to the primary key value of the preset special field, the records in the data to be printed are sorted, the records not containing the special field are sorted first, the records containing the special field are sorted later, and the records containing the special field are adjusted again. Specifically, the parity mark of the records containing the special field is adjusted.

[0093] Exemplarily, if the number of records in each page in the parity configuration information is 25, then according to the parity configuration information and the data to be printed, the initial print page number identifier for each record determined is that the initial page number identifier for records 1 - 25 is 1 and a normal odd mark, and the initial page number identifier for records 26 - 50 is 2 and a normal even mark, as Figure 2 shown Figure 2A schematic diagram for determining the initial print page number identifier provided by an embodiment of the present application; if there is special configuration information, and the second and third records contain special fields, then the second and third records are sorted after the remaining records without special fields in sequence. Then, the target print page number identifiers of the first record and the 4th - 27th records in the data to be printed are adjusted to 1 and ordinary odd markers, and the target print page number identifiers of the 28th - 52nd records are adjusted to 2 and ordinary even markers. For the second and third records, adjust the parity markers in the initial print page number identifiers of the second and third records. If each record with a special field in the special configuration information is on a separate page, and the special fields contained in the second and third records are different, then the target print page number identifier of the second record is adjusted to an odd page and includes a special print marker, such as odd and special 1. Then, odd and special 1 is identified as a special odd identifier. The target print page number identifier of the third record is adjusted to an even page and includes a special print marker, such as even and special 2. Then, even and special 2 is a special even identifier, as Figure 3 shown Figure 3 A schematic diagram for determining the target print page number identifier provided by an embodiment of the present application.

[0094] Optionally, before determining the initial print page number identifier of each record according to the parity configuration information of the requesting device and the data to be printed, it may further include: determining whether there is parity page configuration template data of the requesting device. If there is parity page configuration template data, it indicates that the data to be printed needs to be paged and calculated according to odd and even pages; if there is no parity page configuration template data, it may continue to determine whether there is special page template configuration data of the requesting device.

[0095] Optionally, after the first paging calculation, that is, after the odd - even page paging calculation, it may continue to determine whether there is special page template configuration data of the requesting device. Specifically, it can be determined whether there is special page template configuration data by retrieving a preset configuration table. If there is special page template configuration data, it indicates that the data to be printed includes special fields and requires a second paging; if there is no special page template configuration data, it indicates that the printed data does not include special fields, and the data to be printed after the first paging does not require a second paging, and can directly print the data to be printed according to the initial print page number identifier after the first paging.

[0096] Optionally, if there is no odd-even page configuration template data, continue to determine whether there is special page template configuration data for the requesting device. At this time, if there is special page template configuration data, special pagination calculation can be performed on the data to be printed; if there is no special page template configuration data, it means that the data to be printed does not require odd-even page pagination calculation nor special page pagination calculation, and the default ordinary template can be matched for printing the data to be printed.

[0097] To more clearly show the implementation steps of the above specific embodiments, through Figure 4 describe each step in the above specific embodiments, Figure 4 which is a schematic flowchart of another data source pagination printing method provided by an embodiment of the present application, as Figure 4 shown:

[0098] S201. Receive the data to be printed sent by the requesting device.

[0099] S202. Determine whether there is an odd-even page template configuration. If there is, execute the following step S203; if not, execute the following step S204.

[0100] Among them, to determine whether there is an odd-even page template configuration, specifically, it can be determined by retrieving whether there is odd-even page template configuration data in the configuration table. The odd-even page template configuration data is pre-set in the template configuration. If the odd-even page template configuration data is pre-set, it means that odd-even page pagination calculation is required; if the odd-even page template configuration data is not pre-set, it means that odd-even page pagination calculation is not required.

[0101] S203. Perform odd-even page pagination calculation on the data to be printed.

[0102] Optionally, after performing odd-even page pagination calculation on the data to be printed, continue to determine whether there is a special page template configuration, and then execute S204.

[0103] S204. Determine whether there is a special page template configuration. If there is a special page template configuration, execute the following step S205; if there is an odd-even page configuration and no special page template configuration, execute S206; if there is no odd-even page template configuration and no special page template configuration, execute the following step S207.

[0104] Among them, to determine whether there is a special page template configuration, specifically, it can be determined by retrieving whether there is special page template configuration data in the configuration table. The special page template configuration data is pre-set in the template configuration. If the special page template configuration data is pre-set, it means that special page pagination calculation is required; if the special page template configuration data is not pre-set, it means that special page pagination calculation is not required.

[0105] Optionally, if there is no odd-even page configuration in step S202 above, then step S204 is executed to determine whether there is a special page configuration. If there is a special page configuration, then the following step S205 is executed to perform a special page pagination calculation on the data to be printed, that is, only a special pagination calculation needs to be performed on the data to be printed, and the data to be printed after the special pagination is printed. If there is no special page configuration, it means that there is no odd-even page configuration in the data to be printed, nor is there a special page configuration, then the data to be printed is directly printed by matching the default printing template, that is, no odd-even page pagination calculation is performed, nor is a special page pagination calculation performed.

[0106] Optionally, if there is an odd-even page configuration in step S202 above, that is, after step S203 is completed, step S204 is executed to determine whether there is a special page configuration. If there is a special page configuration, then the following step S205 is executed, that is, after performing an odd-even page pagination calculation on the data to be printed, a special pagination calculation needs to be performed again to obtain the data to be printed after two pagination calculations and print the data to be printed after the two pagination calculations. If there is no special page configuration, then the data to be printed after the odd-even page calculation pagination in S203 is directly printed.

[0107] S205. Perform a special page pagination calculation on the data to be printed.

[0108] S206. Match the corresponding printing template for the paginated data to be printed and print it.

[0109] Optionally, if there is an odd-even page configuration and no special page configuration, then the data to be printed after pagination in S203 is printed. If there is no odd-even page configuration and there is a special page configuration, the data to be printed after special pagination in S205 is printed. If there is both an odd-even page configuration and a special page configuration, then the data to be printed after two pagination calculations is printed.

[0110] S207. Match the default printing template for the data to be printed and print it.

[0111] Optionally, if there is no odd-even page configuration and no special page configuration, then the default printing template is assigned to the data to be printed and printed.

[0112] In this embodiment, by performing pagination calculations, odd-even pagination calculations, and special pagination calculations on the data to be printed, each record of the data to be printed can be paginated, so as to achieve a data format for each page to be printed, and the data to be printed is paginated into multiple pages to be printed with different formats.

[0113] Optionally, determining the initial print page number identifier for each record based on the parity configuration information of the requesting device and the data to be printed may include:

[0114] Optionally, determine the total number of records in the data to be printed, calculate the ratio of the total number of records to the number of records per page in the paging configuration information to obtain the total number of pages.

[0115] Exemplarily, if the total number of records in the data to be printed is 100 and the number of records per page in the paging configuration information is 25, the calculated total number of pages is 4 pages, namely the first page, the second page, the third page, and the fourth page.

[0116] Optionally, mark the initial print page number identifier for each record of the data to be printed according to odd and even pages. Specifically, if the total number of records in the data to be printed is 100 as described above and the total number of pages obtained after paging calculation is 4 pages, then the initial print identifiers for records 1 - 25 are 1 and a common odd mark, the initial print identifiers for records 25 - 50 are 2 and a common even mark, the initial print identifiers for records 50 - 75 are 3 and a common odd mark, and the initial print identifiers for records 75 - 100 are 4 and a common even mark.

[0117] Optionally, splitting the data to be printed according to the target print identifier of each record to obtain multiple pages to be printed and the print identifiers of each page to be printed may include:

[0118] Optionally, split out multiple records with the same target print page number identifier from the data to be printed, and combine these multiple records into a page to be printed. During the combination process, it is also necessary to combine according to the parity configuration information and the special configuration information. For example, for each record without special fields, combine each record without special fields into a page to be printed according to the number of records per page in the parity configuration information; for each record containing special fields, combine each record containing special fields into a page to be printed according to the number of records per page in the special configuration information.

[0119] Exemplarily, through Figure 5 to represent a schematic diagram of splitting the data to be printed, as Figure 5 shown, if among the records without special fields, there are 25 records with the target print page number identifier being a common odd page number identifier and 25 records with the target print page number identifier being a common even page number identifier, and the number of records per page in the parity configuration information is 25, then combine the 25 records with the target print page number identifier being a common odd identifier into a page to be printed, and combine the 25 records with the target print page number identifier being a common even identifier into a page to be printed.

[0120] If there are 2 records containing special fields, the target printing identifiers of these 2 records are odd and special 1, even and special 2 respectively. Here, special 1 and special 2 are used to indicate that the special fields in these 2 records are different and are determined according to the primary key values of the special fields included in each record. And in the special configuration information, each record containing special fields is set to start a new page, that is, the number of records per page is 1. Then, the records with the target printing page number identifier marked as odd and special 1 are used as the records in a page to be printed, and the records with the target printing page number identifier marked as even and special 2 are used as the records in a page to be printed.

[0121] Optionally, according to the target printing page number identifiers of each record in each page to be printed, the printing identifier of the page to be printed is obtained.

[0122] In this embodiment, by combining multiple records with the same target printing page number identifier into a page to be printed, it is possible to have one printing format for each page to be printed, and the formats of different pages to be printed can be different, realizing different formats for odd and even pages and independent pagination for special data.

[0123] Optionally, the above-mentioned obtaining the printing identifier of the page to be printed according to the target printing page number identifiers of each record in each page to be printed may include:

[0124] Optionally, if the target printing page number identifier of the record in the page to be printed includes a special printing mark and the target printing page number identifier is used to indicate an odd page number, then determine that the printing mark of the page to be printed is odd and the special printing mark. Exemplarily, for the target printing page number identifier such as odd and special 1 above, the printing identifier of the page to be printed is odd and special 1.

[0125] Optionally, if the target printing page number identifier of the record in the page to be printed includes a special printing mark and the target printing page number identifier is used to indicate an even page number, then determine that the printing mark of the page to be printed is even and the special printing mark. Exemplarily, for the target printing page number identifier such as even and special 2 above, the printing identifier of the page to be printed is even and special 2.

[0126] Optionally, if the target printing page number identifier of the record in the page to be printed does not include a special printing mark and the target printing page number identifier is used to indicate an odd page number, then determine that the printing identifier of the page to be printed is a normal odd printing identifier.

[0127] Optionally, if the target printing page number identifier of the record in the page to be printed does not include a special printing mark and the target printing page number identifier is used to indicate an even page number, then determine that the printing identifier of the page to be printed is a normal even printing identifier.

[0128] Optionally, printing each page to be printed according to the page number printing configuration information of the requesting device and the printing identifiers of each page to be printed may include:

[0129] Determine the printing templates corresponding to each page to be printed according to the page number printing configuration information of the requesting device and the printing identifiers of each page to be printed. Exemplarily, as Figure 5 shown, if the printing identifier of the page to be printed is an odd number and a special printing mark, and the printing templates corresponding to different pages to be printed with special printing marks are also different, then the printing template corresponding to the page to be printed with a special odd identifier of odd and special 1 can be printing template 2; if the printing identifier of the page to be printed is an even number and a special even identifier of special 2, the printing template corresponding to the page to be printed can be printing template 4; if the printing identifier of the page to be printed is a common odd number, the printing template corresponding to the page to be printed is printing template 1; if the printing identifier of the page to be printed is a common even number, the printing template corresponding to the page to be printed is printing template 3.

[0130] Optionally, print the page to be printed based on the printing template.

[0131] In this embodiment, by determining the printing templates corresponding to each page to be printed according to the printing identifiers of each page to be printed, it is possible to accurately print the pages to be printed with different formats according to the corresponding printing templates, and it is possible to flexibly configure the printing templates by page and batch-match the printing templates for the pages, simplifying the subsequent printing operation steps.

[0132] Optionally, the above-mentioned printing the page to be printed based on the printing template may include:

[0133] Optionally, print the page to be printed with an odd printing identifier and an odd and special printing identifier based on the printing template, and print the page to be printed with an even printing identifier and an even and special printing identifier based on the printing template.

[0134] Optionally, for duplex printing on a single-sided printer, first print the pages to be printed with an odd printing identifier and an odd and special printing identifier. After batch printing is completed, the printer can prompt the user to turn the paper over and feed it. After the user turns the paper over and feeds it and confirms to continue printing, then print the pages to be printed with an even printing identifier and an even and special printing identifier.

[0135] In this embodiment, by batch-printing and duplex-printing the pages to be printed according to different printing identifiers, it is possible to meet the requirement of printing different formats for different pages, and at the same time, it is possible to simplify the printing operation steps and avoid the risk of missing or misprinting content.

[0136] Figure 6Schematic diagram of an apparatus for a data source printing method provided in an embodiment of this application, as Figure 6 shown, the apparatus includes:

[0137] A receiving module 301, configured to receive the data to be printed sent by a requesting device, where the data to be printed includes multiple records;

[0138] A determining module 302, configured to determine a target printing page number identifier for each record according to the paging configuration information of the requesting device and the data to be printed, where the target printing page number identifier is used to indicate the page number of the page where the record is located after printing, and the page numbers include: odd page numbers and even page numbers, and the paging configuration information includes parity configuration information and special configuration information;

[0139] A splitting module 303, configured to split the data to be printed according to the target printing page number identifier of each record, to obtain multiple pages to be printed and the printing identifier of each page to be printed;

[0140] A printing module 304, configured to print each page to be printed according to the page number printing configuration information of the requesting device and the printing identifier of each page to be printed.

[0141] Optionally, the determining module 302 is specifically configured to:

[0142] Determine an initial printing page number identifier for each record according to the parity configuration information of the requesting device and the data to be printed, where the parity configuration information is used to indicate the number of records in each page after printing;

[0143] If there is special configuration information of the requesting device, then adjust the initial printing page number identifier of at least one record according to the special configuration information to obtain the target printing page number identifier of each record, where the target printing page number identifier of the adjusted record includes a special printing mark.

[0144] Optionally, the determining module 302 is specifically configured to:

[0145] Determine the total number of records of the data to be printed;

[0146] Calculate the ratio of the total number of records to the number of records in each page in the paging configuration information to obtain the total number of pages and the odd pages and even pages of the data to be printed;

[0147] Mark an initial printing page number identifier for each record of the data to be printed according to the odd pages and even pages.

[0148] Optionally, the splitting module 303 is specifically configured to:

[0149] Split multiple records with the same target print page number identifier from the data to be printed, and combine the multiple records into a page to be printed;

[0150] Obtain the print identifier of the page to be printed according to the target print page number identifiers of the records in the page to be printed.

[0151] Optionally, the splitting module 303 is specifically configured to:

[0152] If the target print page number identifier of the record in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the page to be printed is an odd number and the special print mark;

[0153] If the target print page number identifier of the record in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the page to be printed is an even number and the special print mark;

[0154] If the target print page number identifier of the record in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the page to be printed is an odd print identifier;

[0155] If the target print page number identifier of the record in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the page to be printed is an even print identifier.

[0156] Optionally, the printing module 304 is specifically configured to:

[0157] Determine the print template corresponding to each page to be printed according to the page number printing configuration information of the requesting device and the print identifiers of each page to be printed;

[0158] Print the page to be printed based on the print template.

[0159] Optionally, the printing module 304 is specifically configured to:

[0160] Print the page to be printed with an odd print identifier and an odd and special print identifier based on the print template;

[0161] Print the page to be printed with an even print identifier and an even and special print identifier based on the print template.

[0162] Figure 7 It is a structural block diagram of an electronic device 700 provided by an embodiment of the present application, as Figure 5As shown, the electronic device may include: a processor 401 and a memory 402.

[0163] Optionally, it may further include a bus 403. Among them, the memory 402 is used to store machine-readable instructions executable by the processor 401 (for example, Figure 4 the execution instructions corresponding to the receiving module, determining module, splitting module, and printing module in the device in

[0164] When the electronic device 400 runs, the processor 401 communicates with the memory 402 through the bus 403. When the machine-readable instructions are executed by the processor 401, the method steps in the above method embodiments are executed.

[0165] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described system and device can refer to the corresponding processes in the method embodiments, which will not be elaborated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation. Also, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some communication interfaces. The indirect coupling or communication connection of the device or module can be in an electrical, mechanical, or other form.

[0166] In addition, in each embodiment of the present application, each functional unit can be integrated into one processing unit, or each unit can physically exist independently, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0167] The above are only the specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application.

Claims

1. A data source printing method, characterized in that, The method includes: Receiving print data to be printed sent by a requesting device, where the print data to be printed includes multiple records; Determining a target print page number identifier for each record according to the pagination configuration information of the requesting device and the print data to be printed, where the target print page number identifier is used to indicate the page number of the page where the record is located after printing, and the page numbers include: odd page numbers and even page numbers, and the pagination configuration information includes parity configuration information and special configuration information; Splitting the print data to be printed according to the target print page number identifier of each record to obtain multiple pages to be printed and the print identifier of each page to be printed; Printing each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed; The determining a target print page number identifier for each record according to the pagination configuration information of the requesting device and the print data to be printed includes: Determining an initial print page number identifier for each record according to the parity configuration information of the requesting device and the print data to be printed, where the parity configuration information is used to indicate the number of records in each page after printing; If there is special configuration information of the requesting device, adjusting the initial print page number identifier of at least one record according to the special configuration information to obtain the target print page number identifier of each record, where the target print page number identifier of the adjusted record includes a special print mark.

2. The data source printing method according to claim 1, wherein The determining an initial print page number identifier for each record according to the parity configuration information of the requesting device and the print data to be printed includes: Determining the total number of records in the print data to be printed; Calculating the ratio of the total number of records to the number of records in each page in the pagination configuration information to obtain the total number of pages and the odd and even pages of the print data to be printed; Marking an initial print page number identifier for each record of the print data to be printed according to the odd and even pages.

3. The data source printing method according to claim 1, characterized in that, The splitting the print data to be printed according to the target print page number identifier of each record to obtain multiple pages to be printed and the print identifier of each page to be printed includes: Splitting multiple records with the same target print page number identifier from the print data to be printed, and combining the multiple records into one page to be printed; Obtaining the print identifier of the page to be printed according to the target print page number identifier of each record in the page to be printed.

4. The data source printing method according to claim 3, wherein The obtaining the print identifier of the page to be printed according to the target print page number identifier of each record in the page to be printed includes: If the target print page number identifier of the record in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an odd page number, determining the print identifier of the page to be printed as an odd number and a special print mark; If the target print page number identifier of the record in the page to be printed includes a special print mark and the target print page number identifier is used to indicate an even page number, determining the print identifier of the page to be printed as an even number and a special print mark; If the target print page number identifier recorded in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an odd page number, determine that the print identifier of the page to be printed is an odd print identifier; If the target print page number identifier recorded in the page to be printed does not include a special print mark and the target print page number identifier is used to indicate an even page number, determine that the print identifier of the page to be printed is an even print identifier.

5. The data source printing method according to claim 1, wherein Said printing each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed includes: Determine the print template corresponding to each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed; Print the page to be printed based on the print template.

6. The data source printing method according to claim 5, wherein Printing the page to be printed based on the print template includes: Print the page to be printed with an odd print identifier and an odd and special print identifier based on the print template; Print the page to be printed with an even print identifier and an even and special print identifier based on the print template.

7. A data source printing device, characterized in that, Includes: A receiving module, configured to receive the data to be printed sent by the requesting device, where the data to be printed includes multiple records; A determining module, configured to determine the target print page number identifier of each record according to the paging configuration information of the requesting device and the data to be printed, where the target print page number identifier is used to indicate the page number of the page where the record is located after printing, and the page numbers include: odd page numbers and even page numbers, and the paging configuration information includes odd-even configuration information and special configuration information; A splitting module, configured to split the data to be printed according to the target print page number identifier of each record to obtain multiple pages to be printed and the print identifier of each page to be printed; A printing module, configured to print each page to be printed according to the page number printing configuration information of the requesting device and the print identifier of each page to be printed; The determining module is specifically configured to: Determine the initial print page number identifier of each record according to the odd-even configuration information of the requesting device and the data to be printed, where the odd-even configuration information is used to indicate the number of records in each page after printing; If there is special configuration information of the requesting device, adjust the initial print page number identifier of at least one record according to the special configuration information to obtain the target print page number identifier of each record, where the target print page number identifier of the adjusted record includes a special print mark.

8. An electronic device, characterized in that, Includes a memory and a processor, the memory stores a computer program executable by the processor, and when the processor executes the computer program, it implements the steps of the data source printing method according to any one of claims 1-6 above.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is run by the processor, it executes the steps of the data source printing method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Data printing method and device and computer storage medium

    CN112199056A