WO2018227853A1 - Document printing apparatus, method and system and computer readable storage medium - Google Patents
Document printing apparatus, method and system and computer readable storage medium Download PDFInfo
- Publication number
- WO2018227853A1 WO2018227853A1 PCT/CN2017/108791 CN2017108791W WO2018227853A1 WO 2018227853 A1 WO2018227853 A1 WO 2018227853A1 CN 2017108791 W CN2017108791 W CN 2017108791W WO 2018227853 A1 WO2018227853 A1 WO 2018227853A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- printing
- print request
- document
- document image
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1211—Improving printing performance
- G06F3/1212—Improving printing performance achieving reduced delay between job submission and print start
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1229—Printer resources management or printer maintenance, e.g. device status, power levels
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/08—Insurance
Definitions
- the present application relates to the field of communications technologies, and in particular, to a device, a method, a system, and a computer readable storage medium for document printing.
- the printing platform has multi-thread processing capability.
- the background scans the printing platform based on each print request and waits for image generation. Each print request occupies one thread resource, and the printing platform generates a document image.
- the purpose of the present application is to provide an apparatus, method, system and computer readable storage medium for document printing, which aims to improve printing efficiency.
- the present application provides a device for printing a document, the device for printing a document comprising: a memory, a processor, and a document printed on the memory and operable on the processor
- the system when the system for printing the document is executed by the processor, implements the following steps:
- the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- the present application further provides a method for printing a document, and the method for printing the document includes:
- the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- the present application further provides a system for printing a document, the system for printing the document comprising:
- An obtaining module configured to acquire a pre-configured printing parameter of the front end, and initialize the printing parameter
- a sending module configured to send each print request to the printing platform in a single thread based on the printing parameter, and release a thread corresponding to each print request
- a polling module configured to poll the printing platform for a document image corresponding to each print request based on the printing parameter, and receive the printing sent by the printing platform after a document image request corresponding to the print request is generated Request the corresponding document image for printing.
- the present application also provides a computer readable storage medium on which a system for document printing is stored, and when the system for printing the document is executed by a processor, the steps are as follows:
- the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- the beneficial effects of the present application are as follows: After the print request is sent to the printing platform in a single thread form, the thread corresponding to each print request is released, and the document image is obtained by polling the print background.
- subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks.
- the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
- FIG. 1 is a schematic diagram of an optional application environment of each embodiment of the present application.
- FIG. 2 is a schematic diagram showing the hardware architecture of an embodiment of the apparatus for printing a document in FIG. 1;
- FIG. 3 is a schematic flow chart of an embodiment of a method for printing a document according to the present application.
- FIG. 4 is a schematic diagram of the refinement process of step S3 shown in FIG. 3.
- FIG. 1 is a schematic diagram of an optional application environment of each embodiment of the present application.
- the present application is applicable to an application environment including, but not limited to, a device for printing a document 1, a printing platform 2, and a network 3.
- the device 1 for printing the document is a device capable of automatically performing numerical calculation and/or information processing according to an instruction set or stored in advance.
- the device 1 for printing the document may be a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet PC), a PMP (Portable Multimedia Player), a navigation device, or the like.
- Mobile devices, as well as fixed terminals such as digital TVs, desktop computers, notebooks, servers, and the like.
- the network 3 may be an intranet, an Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, Wireless or wired networks such as 5G networks, Bluetooth, Wi-Fi, etc.
- the printing platform 2 is respectively communicably connected to the one or more devices 1 for printing the documents through the network 3.
- FIG. 2 is a schematic diagram of an optional hardware architecture of the device 1 for printing a document in FIG. 1.
- the device 1 for printing a document may include, but is not limited to, a communication certificate through a system bus.
- FIG. 2 only shows the device 1 with document printing of the components 10-13, but it should be understood that not all of the illustrated components are required to be implemented, and more or less can be implemented instead. Component.
- the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), and a random access memory (RAM). , static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
- the memory 11 may be an internal storage unit of the device 1 for printing the document, such as the hard disk or memory of the device 1 for printing the document.
- the memory 11 may also be an external storage device of the device 1 for printing the document, for example, a plug-in hard disk provided on the device 1 of the document printing, and a smart memory card (Smart Media Card) , SMC), Secure Digital (SD) card, Flash Card, etc.
- the memory 11 can also include both the internal storage unit of the device 1 for printing the document and its external storage device.
- the memory 11 is generally used to store an operating system of the device 1 installed in the document printing and various types of application software, such as program code of the system 10 for printing the document.
- the memory 11 can also be used for Temporarily store various types of data that have been output or will be output.
- the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
- the processor 12 is typically used to control the overall operation of the device 1 for printing the document, such as performing control and processing associated with data interaction or communication with the printing platform 2.
- the processor 12 is configured to run program code or processing data stored in the memory 11, such as the system 10 that runs the document printing.
- the network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the device 1 for printing the document and other electronic devices.
- the network interface 13 is mainly used to connect the printing platform 2 to one or more of the device 1 for printing the document through the network 3 to establish a data transmission channel and a communication connection.
- the document printing system 10 includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement the information recommendation method of various embodiments of the present application; And the at least one computer readable instruction may be divided into different logic modules according to different functions implemented by the various parts thereof.
- the embodiment includes an obtaining module, a sending module, and a polling module.
- Step S1 acquiring a pre-configured print parameter of the front end, and initializing the print parameter
- the printing parameters include thread access control parameters, print polling interval time, and maximum polling times, wherein the thread access control parameter represents a thread access control state, and the thread access control parameters include single-threaded access control and multi-thread access control.
- the front end can configure the thread access control state as single-threaded access control or multi-threaded access control;
- the print polling interval is the interval of polling the printing platform, the interval time is, for example, 2 minutes;
- the maximum number of polling times is printing The maximum number of times the platform polls, for example, 5 times.
- Step S2 after each print request is sent to the printing platform in a single thread form based on the printing parameter, releasing a thread corresponding to each print request;
- one or more print requests can be sent to the printing platform at a time, and a print request can also be sent to the printing platform multiple times.
- the thread access control parameter configured in the front end is single-threaded access control, so that each print request can be sent to the printing platform in a single thread form, that is, each print request occupies one thread, and each print request is sent to the printing platform. , release the thread corresponding to each print request.
- the subsequent print request may continue to make a request to the printing platform with the released thread, without waiting for the printing platform to generate a document image, so that the utilization of the thread is maximized.
- Step S3 polling the printing platform for the document image corresponding to each print request based on the printing parameter, and receiving the print request sent by the printing platform after the document image request corresponding to the print request is generated.
- the document image corresponding to each print request is polled to the printing platform, and the document image corresponding to each print request is polled based on the configured print polling interval time and the maximum number of polling times.
- the single-threaded access control is performed. Therefore, the polling request is performed for each thread, and the polling control is performed based on the print polling interval time and the maximum number of polling times, and the configured polling interval time is performed.
- the polling control achieves the effect of reducing the burden on the system.
- the polling control is performed by the maximum number of polling times. When the maximum number of polling times is exceeded, the polling is no longer performed, so that the document image corresponding to the print request is obtained by other means. .
- the thread corresponding to each print request is released, and the document image is obtained by polling the print background.
- subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks.
- the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
- the method specifically includes:
- Step S31 querying the printing platform for the document image corresponding to each print request, and analyzing whether the document image corresponding to the print request is not returned based on the query result.
- the inquiry result may be identification information, for example, identification information “0” and “1”, wherein “0” represents that there is no returning document image, and “1” represents that there is no unreturned document image.
- the print platform returns the document image and returns it to the front end.
- Step S32 if no, the front end receives the document image corresponding to the print request sent by the printing platform.
- Step S33 if yes, when the request time of the print request reaches the print polling interval time (for example, 2 minutes), the number of queries corresponding to the print request of the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to The preset maximum number of polls (for example, 5 times).
- the print polling interval time for example, 2 minutes
- step S34 if the counted number of queries is less than or equal to the preset maximum number of polling times, the request for acquiring the current generation status of the document image corresponding to the print request is initiated to the printing platform to obtain a single corresponding to the print request.
- the current generation status of the image includes an ungenerated state and a generated state.
- Step S35 If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
- the printer when the document image corresponding to each print request is polled to the printing platform, the printer can be controlled by querying the printing platform for the document image corresponding to each print request, by printing the polling interval time and the maximum number of polling times. Quickly obtain the document image corresponding to the print request, and reduce the burden on the system. And improve the experience.
- the method further includes:
- step S36 if the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
- the print request corresponding to the preset maximum number of polling times is interrupted, and the query is no longer performed, that is, the polling is no longer performed, and the pop-up message prompts the user to retry, for example, a retry dialog box is popped up for the user to retry ( That is, resend the print request).
- a retry dialog box is popped up for the user to retry ( That is, resend the print request).
- the print request that is greater than the preset maximum number of polling times is interrupted, and the print request that does not generate the corresponding document image is prevented from being polled for a long time, thereby reducing the system load.
- the method further includes: if the current generation status of the document image corresponding to the print request is not generated. In the state, the time when the print request interval time reaches the print polling interval time is the start time enters the waiting state, and when the waiting time reaches the next print polling interval time, the process returns to the step S33 to the step S36, Until the front end receives the document image corresponding to the print request sent by the printing platform.
- the following steps are further performed: generating a page corresponding to the document image, and clearing a document image corresponding to the generated page.
- the number of queries that are counted in the print counter is printed.
- a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
- the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
- FIG. 3 is a schematic flowchart of a method for printing a document of the present application, and the method for printing the document includes the following steps:
- Step S1 acquiring a pre-configured print parameter of the front end, and initializing the print parameter
- the printing parameters include thread access control parameters, print polling interval time, and maximum polling times, wherein the thread access control parameter represents a thread access control state, and the thread access control parameters include single-threaded access control and multi-thread access control.
- the front end can configure the thread access control state as single-threaded access control or multi-threaded access control;
- the print polling interval is the interval of polling the printing platform, the interval time is, for example, 2 minutes;
- the maximum number of polling times is printing Platform The maximum number of polls, for example, 5 times.
- Step S2 after each print request is sent to the printing platform in a single thread form based on the printing parameter, releasing a thread corresponding to each print request;
- one or more print requests can be sent to the printing platform at a time, and a print request can also be sent to the printing platform multiple times.
- the thread access control parameter configured in the front end is single-threaded access control, so that each print request can be sent to the printing platform in a single thread form, that is, each print request occupies one thread, and each print request is sent to the printing platform. , release the thread corresponding to each print request.
- the subsequent print request may continue to make a request to the printing platform with the released thread, without waiting for the printing platform to generate a document image, so that the utilization of the thread is maximized.
- Step S3 polling the printing platform for the document image corresponding to each print request based on the printing parameter, and receiving the print request sent by the printing platform after the document image request corresponding to the print request is generated.
- the document image corresponding to each print request is polled to the printing platform, and the document image corresponding to each print request is polled based on the configured print polling interval time and the maximum number of polling times.
- the single-threaded access control is performed. Therefore, the polling request is performed for each thread, and the polling control is performed based on the print polling interval time and the maximum number of polling times, and the configured polling interval time is performed.
- the polling control achieves the effect of reducing the burden on the system.
- the polling control is performed by the maximum number of polling times. When the maximum number of polling times is exceeded, the polling is no longer performed, so that the document image corresponding to the print request is obtained by other means. .
- the thread corresponding to each print request is released, and the document image is obtained by polling the print background.
- subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks.
- the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
- the method further includes: generating a page corresponding to the document image, and clearing a number of queries counted by the print request corresponding to the document image of the generated page in the print counter.
- a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
- the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
- the step S3 includes:
- Step S31 querying the printing platform for the document image corresponding to each print request, and analyzing whether the document image corresponding to the print request is not returned based on the query result.
- the inquiry result may be identification information, for example, identification information “0” and “1”, wherein “0” represents that there is no returning document image, and “1” represents that there is no unreturned document image.
- the print platform returns the document image and returns it to the front end.
- Step S32 if no, the front end receives the document image corresponding to the print request sent by the printing platform.
- Step S33 if yes, when the request time of the print request reaches the print polling interval time (for example, 2 minutes), the number of queries corresponding to the print request of the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to The preset maximum number of polls (for example, 5 times).
- the print polling interval time for example, 2 minutes
- step S34 if the counted number of queries is less than or equal to the preset maximum number of polling times, the request for acquiring the current generation status of the document image corresponding to the print request is initiated to the printing platform to obtain a single corresponding to the print request.
- the current generation status of the image includes an ungenerated state and a generated state.
- Step S35 If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
- the printer when the document image corresponding to each print request is polled to the printing platform, the printer can be controlled by querying the printing platform for the document image corresponding to each print request, by printing the polling interval time and the maximum number of polling times. Quickly obtain the document image corresponding to the print request, reduce the system load, and improve the user experience.
- the step S3 further includes:
- step S36 if the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
- the print request corresponding to the preset maximum number of polling times is interrupted, and the query is no longer performed, that is, the polling is no longer performed, and the pop-up message prompts the user to retry, for example, a retry dialog box is popped up for the user to retry ( That is, resend the print request).
- a retry dialog box is popped up for the user to retry ( That is, resend the print request).
- the print request that is greater than the preset maximum number of polling times is interrupted, and the print request that does not generate the corresponding document image is prevented from being polled for a long time, thereby reducing the system load.
- the step S3 is advanced.
- the step includes: if the current generation state of the document image corresponding to the print request is an ungenerated state, the time when the print request interval time reaches the print polling interval time is the start time enters the waiting state, and the waiting time is When the next print polling interval time is reached, the process returns to step S33 to step S36 until the front end receives the document image corresponding to the print request sent by the printing platform.
- the method for printing the document further includes: generating a page corresponding to the document image, and clearing a print request corresponding to the document image of the generated page in the print counter. The number of statistical queries.
- a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
- the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
- the present application also provides a computer readable storage medium storing a system for document printing on a computer readable storage medium, the steps of the method for implementing the above-described document printing when the system of the document printing is executed by the processor .
- the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
- Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Development Economics (AREA)
- General Business, Economics & Management (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
A document printing apparatus (1), method and system and a computer readable storage medium, the document printing apparatus (1) comprising: a memory (11), a processor (12) and a document printing system (12) stored in the memory (11) and capable of operating on the processor (12). The document printing system, when run by the processor, performs the following steps: acquiring printing parameters pre-configured by a front end and initializing the printing parameters (S1); sending printing requests in a single thread form to a printing platform on the basis of the printing parameters, and releasing threads corresponding to the printing requests (S2); and polling document images corresponding to the printing requests to the printing platform on the basis of the printing parameters, and receiving the document images corresponding to the printing requests which are sent by the printing platform after generation of the document images corresponding to the printing requests is requested, thereby carrying out printing (S3). According to the present technical solution, the maximum utilization rate of the threads may be ensured, the situation of accumulating a large amount of printing tasks will not occur, and the printing efficiency is high.
Description
优先权申明Priority claim
本申请基于巴黎公约申明享有2017年06月12日递交的申请号为CN201710440289.2、名称为“单证打印的装置、方法及计算机可读存储介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application is based on the priority of the Paris Convention, which is entitled to the Chinese Patent Application No. CN201710440289.2, entitled "Device, Method and Computer Readable Storage Media for Document Printing", filed on June 12, 2017, the Chinese Patent Application The overall content is incorporated herein by reference.
本申请涉及通信技术领域,尤其涉及一种单证打印的装置、方法、系统及计算机可读存储介质。The present application relates to the field of communications technologies, and in particular, to a device, a method, a system, and a computer readable storage medium for document printing.
近年来,随着保险业务的飞速发展,保险公司日均处理保单量也越来越大。对于每一种保单,从出单到承保需要为客户打印报价单、投保单、告知单以及保单等各类单证,大量的打印任务给打印平台带来较大压力。现有技术中,打印平台具有多线程处理能力,在打印时,由后台基于每条打印请求对打印平台进行轮询并等待影像生成,每一打印请求占用一个线程资源,打印平台生成单证影像需要一定时间,在生成单证影像后打印请求才不会占用线程,这样在高并发的业务场景下,容易造成线程堵塞的情况,导致大量打印任务积压,打印平台负担较重,打印效率低。In recent years, with the rapid development of insurance business, insurance companies are increasingly processing the daily amount of insurance policies. For each type of policy, from the billing to the underwriting, customers need to print various quotations such as quotations, insurance policies, notices and insurance policies. A large number of printing tasks bring great pressure to the printing platform. In the prior art, the printing platform has multi-thread processing capability. When printing, the background scans the printing platform based on each print request and waits for image generation. Each print request occupies one thread resource, and the printing platform generates a document image. It takes a certain period of time to print the request after the document image is generated, so that the thread does not occupy the thread, which is likely to cause thread clogging in a high concurrent business scenario, resulting in a large number of print tasks, a heavy burden on the printing platform, and low printing efficiency.
发明内容Summary of the invention
本申请的目的在于提供一种单证打印的装置、方法、系统及计算机可读存储介质,旨在提高打印效率。The purpose of the present application is to provide an apparatus, method, system and computer readable storage medium for document printing, which aims to improve printing efficiency.
为实现上述目的,本申请提供一种单证打印的装置,所述单证打印的装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的单证打印的系统,所述单证打印的系统被所述处理器执行时实现如下步骤:To achieve the above object, the present application provides a device for printing a document, the device for printing a document comprising: a memory, a processor, and a document printed on the memory and operable on the processor The system, when the system for printing the document is executed by the processor, implements the following steps:
S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.
S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;S2, after each print request is sent to the printing platform in a single thread based on the printing parameter, releasing a thread corresponding to each print request;
S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
为实现上述目的,本申请还提供一种单证打印的方法,所述单证打印的方法包括:To achieve the above object, the present application further provides a method for printing a document, and the method for printing the document includes:
S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.
S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平
台后,释放各打印请求对应的线程;S2, sending, according to the printing parameter, each print request to the print flat in a single thread form
After the station, release the thread corresponding to each print request;
S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
为实现上述目的,本申请还提供一种单证打印的系统,所述单证打印的系统包括:To achieve the above objective, the present application further provides a system for printing a document, the system for printing the document comprising:
获取模块,用于获取前端预先配置的打印参数,初始化所述打印参数;An obtaining module, configured to acquire a pre-configured printing parameter of the front end, and initialize the printing parameter;
发送模块,用于基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;a sending module, configured to send each print request to the printing platform in a single thread based on the printing parameter, and release a thread corresponding to each print request;
轮询模块,用于基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。a polling module, configured to poll the printing platform for a document image corresponding to each print request based on the printing parameter, and receive the printing sent by the printing platform after a document image request corresponding to the print request is generated Request the corresponding document image for printing.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有单证打印的系统,所述单证打印的系统被处理器执行时实现步骤:The present application also provides a computer readable storage medium on which a system for document printing is stored, and when the system for printing the document is executed by a processor, the steps are as follows:
S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.
S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;S2, after each print request is sent to the printing platform in a single thread based on the printing parameter, releasing a thread corresponding to each print request;
S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
本申请的有益效果是:本申请以单线程的形式将打印请求发送给打印平台后,释放各打印请求对应的线程,通过轮询打印后台的方式获取单证影像。在高并发的业务场景下,后续的打印可以利用已经释放的线程进行请求,而不必等待打印请求生成对应的单证影像后才进行请求,保证线程的最大利用率,不会出现大量打印任务积压的情况,使得打印平台始终保持最大事务处理能力,打印效率高。The beneficial effects of the present application are as follows: After the print request is sent to the printing platform in a single thread form, the thread corresponding to each print request is released, and the document image is obtained by polling the print background. In a high-concurrency business scenario, subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks. In this case, the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
图1为本申请各个实施例一可选的应用环境示意图;1 is a schematic diagram of an optional application environment of each embodiment of the present application;
图2是图1中单证打印的装置一实施例的硬件架构的示意图;2 is a schematic diagram showing the hardware architecture of an embodiment of the apparatus for printing a document in FIG. 1;
图3为本申请单证打印的方法一实施例的流程示意图;3 is a schematic flow chart of an embodiment of a method for printing a document according to the present application;
图4为图3所示步骤S3的细化流程示意图。FIG. 4 is a schematic diagram of the refinement process of step S3 shown in FIG. 3.
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都
属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts are
It is within the scope of this application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions of "first", "second" and the like in the present application are for the purpose of description only, and are not to be construed as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Thus, features defining "first" or "second" may include at least one of the features, either explicitly or implicitly. In addition, the technical solutions between the various embodiments may be combined with each other, but must be based on the realization of those skilled in the art, and when the combination of the technical solutions is contradictory or impossible to implement, it should be considered that the combination of the technical solutions does not exist. Nor is it within the scope of protection required by this application.
参阅图1,是本申请各个实施例一可选的应用环境示意图。FIG. 1 is a schematic diagram of an optional application environment of each embodiment of the present application.
在本实施例中,本申请可应用于包括,但不仅限于,单证打印的装置1、打印平台2、网络3的应用环境中。其中,所述单证打印的装置1是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。所述单证打印的装置1可以是移动电话、智能电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、导航装置等等的可移动设备,以及诸如数字TV、台式计算机、笔记本、服务器等等的固定终端。所述网络3可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。其中,所述打印平台2中通过所述网络3分别与一个或多个所述单证打印的装置1通信连接。In the present embodiment, the present application is applicable to an application environment including, but not limited to, a device for printing a document 1, a printing platform 2, and a network 3. The device 1 for printing the document is a device capable of automatically performing numerical calculation and/or information processing according to an instruction set or stored in advance. The device 1 for printing the document may be a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet PC), a PMP (Portable Multimedia Player), a navigation device, or the like. Mobile devices, as well as fixed terminals such as digital TVs, desktop computers, notebooks, servers, and the like. The network 3 may be an intranet, an Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, Wireless or wired networks such as 5G networks, Bluetooth, Wi-Fi, etc. The printing platform 2 is respectively communicably connected to the one or more devices 1 for printing the documents through the network 3.
参阅图2,是图1中单证打印的装置1一可选的硬件架构的示意图,本实施例中,单证打印的装置1可包括,但不仅限于,可通过系统总线相互通信连接单证打印的系统10、存储器11、处理器12、网络接口13。需要指出的是,图2仅示出了具有组件10-13的单证打印的装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。2 is a schematic diagram of an optional hardware architecture of the device 1 for printing a document in FIG. 1. In this embodiment, the device 1 for printing a document may include, but is not limited to, a communication certificate through a system bus. Printed system 10, memory 11, processor 12, network interface 13. It should be noted that FIG. 2 only shows the device 1 with document printing of the components 10-13, but it should be understood that not all of the illustrated components are required to be implemented, and more or less can be implemented instead. Component.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器11可以是所述单证打印的装置1的内部存储单元,例如该单证打印的装置1的硬盘或内存。在另一些实施例中,所述存储器11也可以是所述单证打印的装置1的外部存储设备,例如该单证打印的装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,所述存储器11还可以既包括所述单证打印的装置1的内部存储单元也包括其外部存储设备。本实施例中,所述存储器11通常用于存储安装于所述单证打印的装置1的操作系统和各类应用软件,例如所述单证打印的系统10的程序代码等。此外,所述存储器11还可以用于
暂时地存储已经输出或者将要输出的各类数据。The memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), and a random access memory (RAM). , static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like. In some embodiments, the memory 11 may be an internal storage unit of the device 1 for printing the document, such as the hard disk or memory of the device 1 for printing the document. In other embodiments, the memory 11 may also be an external storage device of the device 1 for printing the document, for example, a plug-in hard disk provided on the device 1 of the document printing, and a smart memory card (Smart Media Card) , SMC), Secure Digital (SD) card, Flash Card, etc. Of course, the memory 11 can also include both the internal storage unit of the device 1 for printing the document and its external storage device. In this embodiment, the memory 11 is generally used to store an operating system of the device 1 installed in the document printing and various types of application software, such as program code of the system 10 for printing the document. Furthermore, the memory 11 can also be used for
Temporarily store various types of data that have been output or will be output.
所述处理器12在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器12通常用于控制所述单证打印的装置1的总体操作,例如执行与所述打印平台2进行数据交互或者通信相关的控制和处理等。本实施例中,所述处理器12用于运行所述存储器11中存储的程序代码或者处理数据,例如运行所述单证打印的系统10等。The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used to control the overall operation of the device 1 for printing the document, such as performing control and processing associated with data interaction or communication with the printing platform 2. In this embodiment, the processor 12 is configured to run program code or processing data stored in the memory 11, such as the system 10 that runs the document printing.
所述网络接口13可包括无线网络接口或有线网络接口,该网络接口13通常用于在所述单证打印的装置1与其他电子设备之间建立通信连接。本实施例中,所述网络接口13主要用于通过所述网络3将所述打印平台2与一个或多个所述单证打印的装置1相连,以建立数据传输通道和通信连接。The network interface 13 may comprise a wireless network interface or a wired network interface, which is typically used to establish a communication connection between the device 1 for printing the document and other electronic devices. In this embodiment, the network interface 13 is mainly used to connect the printing platform 2 to one or more of the device 1 for printing the document through the network 3 to establish a data transmission channel and a communication connection.
所述单证打印的系统10包括至少一个存储在存储器11中的计算机可读指令,该至少一个计算机可读指令可被处理器器12执行,以实现本申请各实施例的信息推荐的方法;以及,该至少一个计算机可读指令依据其各部分所实现的功能不同,可被划为不同的逻辑模块,本实施例包括获取模块、发送模块及轮询模块。The document printing system 10 includes at least one computer readable instruction stored in the memory 11, the at least one computer readable instruction being executable by the processor 12 to implement the information recommendation method of various embodiments of the present application; And the at least one computer readable instruction may be divided into different logic modules according to different functions implemented by the various parts thereof. The embodiment includes an obtaining module, a sending module, and a polling module.
其中,上述单证打印的系统10被所述处理器12执行时实现如下步骤:Wherein, the above-mentioned document printing system 10 is executed by the processor 12 to implement the following steps:
步骤S1,获取前端预先配置的打印参数,初始化所述打印参数;Step S1, acquiring a pre-configured print parameter of the front end, and initializing the print parameter;
本实施例中,打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,其中,线程访问控制参数代表线程访问控制状态,线程访问控制参数包括单线程访问控制及多线程访问控制,前端可以将线程访问控制状态配置为单线程访问控制或多线程访问控制;打印轮询间隔时间为向打印平台轮询的间隔时间,该间隔时间例如为2分钟;最大轮询次数为向打印平台轮询的最大次数,该最大次数例如为5次。In this embodiment, the printing parameters include thread access control parameters, print polling interval time, and maximum polling times, wherein the thread access control parameter represents a thread access control state, and the thread access control parameters include single-threaded access control and multi-thread access control. The front end can configure the thread access control state as single-threaded access control or multi-threaded access control; the print polling interval is the interval of polling the printing platform, the interval time is, for example, 2 minutes; the maximum number of polling times is printing The maximum number of times the platform polls, for example, 5 times.
在实施过程中,在打印之前,可以在前端提供的配置操作界面上进行操作,分别配置线程访问控制参数、打印轮询间隔时间、最大轮询次数。可将配置后的线程访问控制参数、打印轮询间隔时间、最大轮询次数发送给打印平台,供打印平台对打印请求进行相关处理,然后调用打印计数器刷新页面,并展示打印进度条。In the implementation process, before printing, you can operate on the configuration operation interface provided by the front end, respectively configure thread access control parameters, print polling interval time, and maximum polling times. The configured thread access control parameters, the print polling interval time, and the maximum number of polling times can be sent to the printing platform for the printing platform to process the print request, and then the print counter is called to refresh the page, and the print progress bar is displayed.
步骤S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;Step S2, after each print request is sent to the printing platform in a single thread form based on the printing parameter, releasing a thread corresponding to each print request;
本实施例中,一次可以向打印平台发送一个或多个打印请求,还可多次向打印平台发送打印请求。在前端配置的线程访问控制参数为单线程访问控制,这样可将各打印请求以单线程的形式发送给打印平台,即每一打印请求占用一个线程,将各打印请求发送给所述打印平台后,释放各打印请求对应的线程。In this embodiment, one or more print requests can be sent to the printing platform at a time, and a print request can also be sent to the printing platform multiple times. The thread access control parameter configured in the front end is single-threaded access control, so that each print request can be sent to the printing platform in a single thread form, that is, each print request occupies one thread, and each print request is sent to the printing platform. , release the thread corresponding to each print request.
其中,在释放各打印请求对应的线程后,后续的打印请求可以以释放的线程向打印平台继续进行请求,不需要等待打印平台生成单证影像,使得线程的利用率最大化。
After the thread corresponding to each print request is released, the subsequent print request may continue to make a request to the printing platform with the released thread, without waiting for the printing platform to generate a document image, so that the utilization of the thread is maximized.
步骤S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。Step S3, polling the printing platform for the document image corresponding to each print request based on the printing parameter, and receiving the print request sent by the printing platform after the document image request corresponding to the print request is generated. Document images for printing.
本实施例中,向打印平台轮询各打印请求对应的单证影像,包括基于所配置的打印轮询间隔时间、最大轮询次数来轮询各打印请求对应的单证影像。本实施例为单线程访问控制,因此,对于每一线程对应的打印请求进行轮询,并基于打印轮询间隔时间、最大轮询次数进行轮询的控制,通过配置的打印轮询间隔时间进行轮询控制,达到减轻系统负担的效果,通过最大轮询次数进行轮询控制,当超过该最大轮询次数时,不再进行轮询,以便采用其他的方式获取到打印请求对应的单证影像。In this embodiment, the document image corresponding to each print request is polled to the printing platform, and the document image corresponding to each print request is polled based on the configured print polling interval time and the maximum number of polling times. In this embodiment, the single-threaded access control is performed. Therefore, the polling request is performed for each thread, and the polling control is performed based on the print polling interval time and the maximum number of polling times, and the configured polling interval time is performed. The polling control achieves the effect of reducing the burden on the system. The polling control is performed by the maximum number of polling times. When the maximum number of polling times is exceeded, the polling is no longer performed, so that the document image corresponding to the print request is obtained by other means. .
与现有技术相比,本实施例以单线程的形式将打印请求发送给打印平台后,释放各打印请求对应的线程,通过轮询打印后台的方式获取单证影像。在高并发的业务场景下,后续的打印可以利用已经释放的线程进行请求,而不必等待打印请求生成对应的单证影像后才进行请求,保证线程的最大利用率,不会出现大量打印任务积压的情况,使得打印平台始终保持最大事务处理能力,打印效率高。Compared with the prior art, in this embodiment, after the print request is sent to the printing platform in a single thread form, the thread corresponding to each print request is released, and the document image is obtained by polling the print background. In a high-concurrency business scenario, subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks. In this case, the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
在一优选的实施例中,在上述图2的实施例的基础上,所述单证打印的系统10被所述处理器12执行实现所述步骤S3时,具体包括:In a preferred embodiment, on the basis of the foregoing embodiment of FIG. 2, when the system 10 for printing the document is executed by the processor 12 to implement the step S3, the method specifically includes:
步骤S31,向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像。其中,询问结果可以是标识信息,例如为标识信息“0”及“1”,其中“0”代表有未返回单证影像,“1”代表没有未返回单证影像。打印平台生成单证影像后将其返回至前端。Step S31, querying the printing platform for the document image corresponding to each print request, and analyzing whether the document image corresponding to the print request is not returned based on the query result. The inquiry result may be identification information, for example, identification information “0” and “1”, wherein “0” represents that there is no returning document image, and “1” represents that there is no unreturned document image. The print platform returns the document image and returns it to the front end.
步骤S32,若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像。Step S32, if no, the front end receives the document image corresponding to the print request sent by the printing platform.
步骤S33,若是,则在所述打印请求的请求时间达到打印轮询间隔时间(例如2分钟)时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数(例如5次)。Step S33, if yes, when the request time of the print request reaches the print polling interval time (for example, 2 minutes), the number of queries corresponding to the print request of the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to The preset maximum number of polls (for example, 5 times).
步骤S34,若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态。其中,单证影像的当前生成状态包括未生成状态及已生成状态。In step S34, if the counted number of queries is less than or equal to the preset maximum number of polling times, the request for acquiring the current generation status of the document image corresponding to the print request is initiated to the printing platform to obtain a single corresponding to the print request. The current generation status of the image. The current generation status of the document image includes an ungenerated state and a generated state.
步骤S35,若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。Step S35: If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
本实施例在向打印平台轮询各打印请求对应的单证影像时,通过向打印平台询问每一打印请求对应的单证影像、通过打印轮询间隔时间及最大轮询次数进行控制,从而能快速获取打印请求对应的单证影像,减轻系统负担,
并提高使用体验。In the embodiment, when the document image corresponding to each print request is polled to the printing platform, the printer can be controlled by querying the printing platform for the document image corresponding to each print request, by printing the polling interval time and the maximum number of polling times. Quickly obtain the document image corresponding to the print request, and reduce the burden on the system.
And improve the experience.
在一优选的实施例中,所述单证打印的系统10被所述处理器12执行实现所述步骤S3时,进一步包括:In a preferred embodiment, when the system 10 of the document printing is executed by the processor 12 to implement the step S3, the method further includes:
步骤S36,若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。In step S36, if the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
本实施例对于大于预设的最大轮询次数对应的打印请求进行中断,不再进行询问,即不再进行轮询,弹出信息提示用户重试,例如弹出重试对话框,供用户重试(即重新发送打印请求)。这种情况通常为个别打印请求因长时间等待而打印失败,提示用户重试即可,不会影响其他的打印请求对应的打印任务。In this embodiment, the print request corresponding to the preset maximum number of polling times is interrupted, and the query is no longer performed, that is, the polling is no longer performed, and the pop-up message prompts the user to retry, for example, a retry dialog box is popped up for the user to retry ( That is, resend the print request). In this case, it is usually that the individual print request fails to print due to long wait, and the user is prompted to retry, and the print task corresponding to other print requests is not affected.
本实施例中断大于预设的最大轮询次数的打印请求,防止未生成对应单证影像的打印请求长时间轮询,减轻系统负担。In this embodiment, the print request that is greater than the preset maximum number of polling times is interrupted, and the print request that does not generate the corresponding document image is prevented from being polled for a long time, thereby reducing the system load.
在一优选的实施例中,所述单证打印的系统10被所述处理器12执行实现所述步骤S3时,进一步包括:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待状态,并在等待时间达到下一打印轮询间隔时间时,返回执行所述步骤S33至步骤S36,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。In a preferred embodiment, when the system 10 of the document printing is executed by the processor 12 to implement the step S3, the method further includes: if the current generation status of the document image corresponding to the print request is not generated. In the state, the time when the print request interval time reaches the print polling interval time is the start time enters the waiting state, and when the waiting time reaches the next print polling interval time, the process returns to the step S33 to the step S36, Until the front end receives the document image corresponding to the print request sent by the printing platform.
在一优选的实施例中,所述单证打印的系统10被所述处理器12执行时,还实现如下步骤:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。In a preferred embodiment, when the system 10 for printing the document is executed by the processor 12, the following steps are further performed: generating a page corresponding to the document image, and clearing a document image corresponding to the generated page. The number of queries that are counted in the print counter is printed.
本实施例中,在有打印请求对应的单证影像请求生成后,生成打印页面,该打印页面可以在前端显示,例如PDF格式的打印页面,用户在打印页面当点击“打印”按钮即可进行打印。In this embodiment, after the document image request corresponding to the print request is generated, a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
另外,将已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数清除,不再对该打印请求的询问次数进行统计,该打印请求完成打印。In addition, the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
如图3所示,图3为本申请单证打印的方法一实施例的流程示意图,该单证打印的方法包括以下步骤:As shown in FIG. 3, FIG. 3 is a schematic flowchart of a method for printing a document of the present application, and the method for printing the document includes the following steps:
步骤S1,获取前端预先配置的打印参数,初始化所述打印参数;Step S1, acquiring a pre-configured print parameter of the front end, and initializing the print parameter;
本实施例中,打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,其中,线程访问控制参数代表线程访问控制状态,线程访问控制参数包括单线程访问控制及多线程访问控制,前端可以将线程访问控制状态配置为单线程访问控制或多线程访问控制;打印轮询间隔时间为向打印平台轮询的间隔时间,该间隔时间例如为2分钟;最大轮询次数为向打印平台
轮询的最大次数,该最大次数例如为5次。In this embodiment, the printing parameters include thread access control parameters, print polling interval time, and maximum polling times, wherein the thread access control parameter represents a thread access control state, and the thread access control parameters include single-threaded access control and multi-thread access control. The front end can configure the thread access control state as single-threaded access control or multi-threaded access control; the print polling interval is the interval of polling the printing platform, the interval time is, for example, 2 minutes; the maximum number of polling times is printing Platform
The maximum number of polls, for example, 5 times.
在实施过程中,在打印之前,可以在前端提供的配置操作界面上进行操作,分别配置线程访问控制参数、打印轮询间隔时间、最大轮询次数。可将配置后的线程访问控制参数、打印轮询间隔时间、最大轮询次数发送给打印平台,供打印平台对打印请求进行相关处理,然后调用打印计数器刷新页面,并展示打印进度条。In the implementation process, before printing, you can operate on the configuration operation interface provided by the front end, respectively configure thread access control parameters, print polling interval time, and maximum polling times. The configured thread access control parameters, the print polling interval time, and the maximum number of polling times can be sent to the printing platform for the printing platform to process the print request, and then the print counter is called to refresh the page, and the print progress bar is displayed.
步骤S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;Step S2, after each print request is sent to the printing platform in a single thread form based on the printing parameter, releasing a thread corresponding to each print request;
本实施例中,一次可以向打印平台发送一个或多个打印请求,还可多次向打印平台发送打印请求。在前端配置的线程访问控制参数为单线程访问控制,这样可将各打印请求以单线程的形式发送给打印平台,即每一打印请求占用一个线程,将各打印请求发送给所述打印平台后,释放各打印请求对应的线程。In this embodiment, one or more print requests can be sent to the printing platform at a time, and a print request can also be sent to the printing platform multiple times. The thread access control parameter configured in the front end is single-threaded access control, so that each print request can be sent to the printing platform in a single thread form, that is, each print request occupies one thread, and each print request is sent to the printing platform. , release the thread corresponding to each print request.
其中,在释放各打印请求对应的线程后,后续的打印请求可以以释放的线程向打印平台继续进行请求,不需要等待打印平台生成单证影像,使得线程的利用率最大化。After the thread corresponding to each print request is released, the subsequent print request may continue to make a request to the printing platform with the released thread, without waiting for the printing platform to generate a document image, so that the utilization of the thread is maximized.
步骤S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。Step S3, polling the printing platform for the document image corresponding to each print request based on the printing parameter, and receiving the print request sent by the printing platform after the document image request corresponding to the print request is generated. Document images for printing.
本实施例中,向打印平台轮询各打印请求对应的单证影像,包括基于所配置的打印轮询间隔时间、最大轮询次数来轮询各打印请求对应的单证影像。本实施例为单线程访问控制,因此,对于每一线程对应的打印请求进行轮询,并基于打印轮询间隔时间、最大轮询次数进行轮询的控制,通过配置的打印轮询间隔时间进行轮询控制,达到减轻系统负担的效果,通过最大轮询次数进行轮询控制,当超过该最大轮询次数时,不再进行轮询,以便采用其他的方式获取到打印请求对应的单证影像。In this embodiment, the document image corresponding to each print request is polled to the printing platform, and the document image corresponding to each print request is polled based on the configured print polling interval time and the maximum number of polling times. In this embodiment, the single-threaded access control is performed. Therefore, the polling request is performed for each thread, and the polling control is performed based on the print polling interval time and the maximum number of polling times, and the configured polling interval time is performed. The polling control achieves the effect of reducing the burden on the system. The polling control is performed by the maximum number of polling times. When the maximum number of polling times is exceeded, the polling is no longer performed, so that the document image corresponding to the print request is obtained by other means. .
与现有技术相比,本实施例以单线程的形式将打印请求发送给打印平台后,释放各打印请求对应的线程,通过轮询打印后台的方式获取单证影像。在高并发的业务场景下,后续的打印可以利用已经释放的线程进行请求,而不必等待打印请求生成对应的单证影像后才进行请求,保证线程的最大利用率,不会出现大量打印任务积压的情况,使得打印平台始终保持最大事务处理能力,打印效率高。Compared with the prior art, in this embodiment, after the print request is sent to the printing platform in a single thread form, the thread corresponding to each print request is released, and the document image is obtained by polling the print background. In a high-concurrency business scenario, subsequent printing can use the released thread to make a request without waiting for the print request to generate the corresponding document image, so as to ensure the maximum utilization of the thread, and there is no backlog of printing tasks. In this case, the printing platform always maintains the maximum transaction processing capability and the printing efficiency is high.
优选地,在步骤S3之后还包括:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。Preferably, after step S3, the method further includes: generating a page corresponding to the document image, and clearing a number of queries counted by the print request corresponding to the document image of the generated page in the print counter.
本实施例中,在有打印请求对应的单证影像请求生成后,生成打印页面,该打印页面可以在前端显示,例如PDF格式的打印页面,用户在打印页面当点击“打印”按钮即可进行打印。
In this embodiment, after the document image request corresponding to the print request is generated, a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
另外,将已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数清除,不再对该打印请求的询问次数进行统计,该打印请求完成打印。In addition, the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
在一优选的实施例中,如图4所示,在上述图3的实施例的基础上,所述步骤S3包括:In a preferred embodiment, as shown in FIG. 4, based on the foregoing embodiment of FIG. 3, the step S3 includes:
步骤S31,向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像。其中,询问结果可以是标识信息,例如为标识信息“0”及“1”,其中“0”代表有未返回单证影像,“1”代表没有未返回单证影像。打印平台生成单证影像后将其返回至前端。Step S31, querying the printing platform for the document image corresponding to each print request, and analyzing whether the document image corresponding to the print request is not returned based on the query result. The inquiry result may be identification information, for example, identification information “0” and “1”, wherein “0” represents that there is no returning document image, and “1” represents that there is no unreturned document image. The print platform returns the document image and returns it to the front end.
步骤S32,若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像。Step S32, if no, the front end receives the document image corresponding to the print request sent by the printing platform.
步骤S33,若是,则在所述打印请求的请求时间达到打印轮询间隔时间(例如2分钟)时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数(例如5次)。Step S33, if yes, when the request time of the print request reaches the print polling interval time (for example, 2 minutes), the number of queries corresponding to the print request of the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to The preset maximum number of polls (for example, 5 times).
步骤S34,若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态。其中,单证影像的当前生成状态包括未生成状态及已生成状态。In step S34, if the counted number of queries is less than or equal to the preset maximum number of polling times, the request for acquiring the current generation status of the document image corresponding to the print request is initiated to the printing platform to obtain a single corresponding to the print request. The current generation status of the image. The current generation status of the document image includes an ungenerated state and a generated state.
步骤S35,若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。Step S35: If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
本实施例在向打印平台轮询各打印请求对应的单证影像时,通过向打印平台询问每一打印请求对应的单证影像、通过打印轮询间隔时间及最大轮询次数进行控制,从而能快速获取打印请求对应的单证影像,减轻系统负担,并提高使用体验。In the embodiment, when the document image corresponding to each print request is polled to the printing platform, the printer can be controlled by querying the printing platform for the document image corresponding to each print request, by printing the polling interval time and the maximum number of polling times. Quickly obtain the document image corresponding to the print request, reduce the system load, and improve the user experience.
在一优选的实施例中,如图4所示,所述步骤S3进一步包括:In a preferred embodiment, as shown in FIG. 4, the step S3 further includes:
步骤S36,若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。In step S36, if the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
本实施例对于大于预设的最大轮询次数对应的打印请求进行中断,不再进行询问,即不再进行轮询,弹出信息提示用户重试,例如弹出重试对话框,供用户重试(即重新发送打印请求)。这种情况通常为个别打印请求因长时间等待而打印失败,提示用户重试即可,不会影响其他的打印请求对应的打印任务。In this embodiment, the print request corresponding to the preset maximum number of polling times is interrupted, and the query is no longer performed, that is, the polling is no longer performed, and the pop-up message prompts the user to retry, for example, a retry dialog box is popped up for the user to retry ( That is, resend the print request). In this case, it is usually that the individual print request fails to print due to long wait, and the user is prompted to retry, and the print task corresponding to other print requests is not affected.
本实施例中断大于预设的最大轮询次数的打印请求,防止未生成对应单证影像的打印请求长时间轮询,减轻系统负担。In this embodiment, the print request that is greater than the preset maximum number of polling times is interrupted, and the print request that does not generate the corresponding document image is prevented from being polled for a long time, thereby reducing the system load.
在一优选的实施例中,在上述图4的实施例的基础上,所述步骤S3进
一步包括:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待状态,并在等待时间达到下一打印轮询间隔时间时,返回执行所述步骤S33至步骤S36,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。In a preferred embodiment, based on the embodiment of FIG. 4 above, the step S3 is advanced.
The step includes: if the current generation state of the document image corresponding to the print request is an ungenerated state, the time when the print request interval time reaches the print polling interval time is the start time enters the waiting state, and the waiting time is When the next print polling interval time is reached, the process returns to step S33 to step S36 until the front end receives the document image corresponding to the print request sent by the printing platform.
在一优选的实施例中,所述单证打印的方法在步骤S3之后还包括:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。In a preferred embodiment, after the step S3, the method for printing the document further includes: generating a page corresponding to the document image, and clearing a print request corresponding to the document image of the generated page in the print counter. The number of statistical queries.
本实施例中,在有打印请求对应的单证影像请求生成后,生成打印页面,该打印页面可以在前端显示,例如PDF格式的打印页面,用户在打印页面当点击“打印”按钮即可进行打印。In this embodiment, after the document image request corresponding to the print request is generated, a print page is generated, and the print page can be displayed on the front end, for example, a print page in a PDF format, and the user can click the “print” button on the print page. print.
另外,将已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数清除,不再对该打印请求的询问次数进行统计,该打印请求完成打印。In addition, the number of queries counted in the print counter of the print request corresponding to the document image of the generated page is cleared, and the number of inquiry times of the print request is no longer counted, and the print request is completed.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有单证打印的系统,所述单证打印的系统被处理器执行时实现上述的单证打印的方法的步骤。The present application also provides a computer readable storage medium storing a system for document printing on a computer readable storage medium, the steps of the method for implementing the above-described document printing when the system of the document printing is executed by the processor .
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are merely for the description, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, The optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods described in various embodiments of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
The above is only a preferred embodiment of the present application, and is not intended to limit the scope of the patent application, and the equivalent structure or equivalent process transformations made by the specification and the drawings of the present application, or directly or indirectly applied to other related technical fields. The same is included in the scope of patent protection of this application.
Claims (20)
- 一种单证打印的装置,其特征在于,所述单证打印的装置包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的单证打印的系统,所述单证打印的系统被所述处理器执行时实现如下步骤:A device for printing a document, characterized in that the device for printing a document comprises: a memory, a processor, and a system for storing a document printed on the memory and operable on the processor, The system for document printing is implemented by the processor to implement the following steps:S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;S2, after each print request is sent to the printing platform in a single thread based on the printing parameter, releasing a thread corresponding to each print request;S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- 根据权利要求1所述的单证打印的装置,其特征在于,所述单证打印的系统被所述处理器执行时,还实现如下步骤:The apparatus for printing a document according to claim 1, wherein when the system for printing the document is executed by the processor, the following steps are further implemented:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。Generating a page corresponding to the document image, and clearing the number of queries counted by the print request corresponding to the document image of the generated page in the print counter.
- 根据权利要求1所述的单证打印的装置,其特征在于,所述打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,所述单证打印的系统被所述处理器执行实现所述步骤S3时,具体包括:The apparatus for printing a document according to claim 1, wherein said printing parameter comprises a thread access control parameter, a print polling interval time, a maximum number of polling times, and said document printing system is said processor When the step S3 is implemented, the method specifically includes:S31,向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像;S31, querying the printing platform for a document image corresponding to each print request, and analyzing, according to the query result, whether there is a document image that does not return the print request corresponding to the print request;S32,若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像;S32, if not, receiving, by the front end, a document image corresponding to the print request sent by the printing platform;S33,若是,则在所述打印请求的请求时间达到打印轮询间隔时间时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数;S33. If yes, when the request time of the print request reaches the print polling interval time, the number of queries corresponding to the print request counted by the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to a preset maximum polling. frequency;S34,若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态;S34, if the counted number of queries is less than or equal to a preset maximum number of polling times, initiate a request for acquiring a current generation state of the document image corresponding to the print request to the printing platform, to obtain a document corresponding to the print request. The current generation state of the image;S35,若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S35. If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
- 根据权利要求3所述的单证打印的装置,其特征在于,所述单证打印的系统被所述处理器执行实现所述步骤S3时,进一步包括:The device for printing a document according to claim 3, wherein when the system for printing the document is executed by the processor to implement the step S3, the method further comprises:S36,若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。S36. If the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
- 根据权利要求3或4所述的单证打印的装置,其特征在于,所述单证打印的系统被所述处理器执行实现所述步骤S3时,进一步包括:The device for printing a document according to claim 3 or 4, wherein when the system for printing the document is executed by the processor to implement the step S3, the method further comprises:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待 状态,并在等待时间达到下一打印轮询间隔时间时,返回执行所述步骤S33,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。If the current generation state of the document image corresponding to the print request is an ungenerated state, the time at which the print request interval reaches the print polling interval time is the start time and waits When the waiting time reaches the next print polling interval time, the process returns to step S33 until the front end receives the document image corresponding to the print request sent by the printing platform.
- 一种单证打印的方法,其特征在于,所述单证打印的方法包括:A method for printing a document, characterized in that the method for printing the document comprises:S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;S2, after each print request is sent to the printing platform in a single thread based on the printing parameter, releasing a thread corresponding to each print request;S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- 根据权利要求6所述的单证打印的方法,其特征在于,所述步骤S3之后还包括:The method of claim printing according to claim 6, wherein the step S3 further comprises:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。Generating a page corresponding to the document image, and clearing the number of queries counted by the print request corresponding to the document image of the generated page in the print counter.
- 根据权利要求6所述的单证打印的方法,其特征在于,所述打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,所述步骤S3包括:The method for printing a document according to claim 6, wherein the printing parameter comprises a thread access control parameter, a print polling interval time, and a maximum number of polling times, and the step S3 comprises:S31,向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像;S31, querying the printing platform for a document image corresponding to each print request, and analyzing, according to the query result, whether there is a document image that does not return the print request corresponding to the print request;S32,若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像;S32, if not, receiving, by the front end, a document image corresponding to the print request sent by the printing platform;S33,若是,则在所述打印请求的请求时间达到打印轮询间隔时间时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数;S33. If yes, when the request time of the print request reaches the print polling interval time, the number of queries corresponding to the print request counted by the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to a preset maximum polling. frequency;S34,若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态;S34, if the counted number of queries is less than or equal to a preset maximum number of polling times, initiate a request for acquiring a current generation state of the document image corresponding to the print request to the printing platform, to obtain a document corresponding to the print request. The current generation state of the image;S35,若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S35. If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
- 根据权利要求8所述的单证打印的方法,其特征在于,所述步骤S3进一步包括:The method of claim printing according to claim 8, wherein the step S3 further comprises:S36,若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。S36. If the counted number of queries is greater than the preset maximum number of polling times, the print request corresponding to the preset maximum number of polling times is interrupted, and the pop-up message prompts the user to retry.
- 根据权利要求8或9所述的单证打印的方法,其特征在于,所述步骤S3进一步包括:The method of printing a document according to claim 8 or 9, wherein the step S3 further comprises:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待状态,并在等待时间达到下一打印轮询间隔时间时,返回执行所述步骤S33,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。 If the current generation state of the document image corresponding to the print request is an ungenerated state, the time when the print request interval time reaches the print polling interval time is the start time enters the waiting state, and the waiting time reaches the next time. When the polling interval is printed, the process returns to step S33 until the front end receives the document image corresponding to the print request sent by the printing platform.
- 一种单证打印的系统,其特征在于,所述单证打印的系统包括:A system for printing a document, characterized in that the system for printing the document comprises:获取模块,用于获取前端预先配置的打印参数,初始化所述打印参数;An obtaining module, configured to acquire a pre-configured printing parameter of the front end, and initialize the printing parameter;发送模块,用于基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;a sending module, configured to send each print request to the printing platform in a single thread based on the printing parameter, and release a thread corresponding to each print request;轮询模块,用于基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。a polling module, configured to poll the printing platform for a document image corresponding to each print request based on the printing parameter, and receive the printing sent by the printing platform after a document image request corresponding to the print request is generated Request the corresponding document image for printing.
- 根据权利要求11所述的单证打印的系统,其特征在于,所述单证打印的系统还包括:清除模块,用于生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。The system for printing a document according to claim 11, wherein the system for printing a document further comprises: a clearing module, configured to generate a page corresponding to the document image, and clear a document image of the generated page. The number of queries counted by the corresponding print request in the print counter.
- 据权利要求11所述的单证打印的系统,其特征在于,所述打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,所述轮询模块具体用于:向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像;若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像;若是,则在所述打印请求的请求时间达到打印轮询间隔时间时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数;若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态;若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。The system for printing a document according to claim 11, wherein the printing parameter comprises a thread access control parameter, a print polling interval time, and a maximum number of polling times, and the polling module is specifically configured to: The printing platform queries the document image corresponding to each print request, and analyzes whether the document image corresponding to the print request is not returned based on the query result; if not, the front end receives the print request sent by the printing platform. If the request time of the print request reaches the print polling interval time, the number of queries corresponding to the print request of the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to a predetermined one. The maximum number of polling times; if the counted number of queries is less than or equal to the preset maximum number of polling times, the request for acquiring the current generation status of the document image corresponding to the print request is initiated to the printing platform to obtain the corresponding print request. The current generation status of the document image; if the current generation status of the document image corresponding to the print request is To the state, by receiving the front end of the printing platform sends the document print request corresponding to an image to be printed.
- 据权利要求13所述的单证打印的系统,其特征在于,所述轮询模块进一步用于:若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。The system for printing a document according to claim 13, wherein the polling module is further configured to: if the counted number of queries is greater than a preset maximum number of polls, interrupting is greater than a preset maximum polling The print request corresponding to the number of times, the pop-up message prompts the user to try again.
- 据权利要求13或14所述的单证打印的系统,其特征在于,所述轮询模块进一步用于:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待状态,并在等待时间达到下一打印轮询间隔时间时,返回并触发获取打印计数器统计的所述打印请求对应的询问次数的操作,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。The system for printing a document according to claim 13 or 14, wherein the polling module is further configured to: if the current generation state of the document image corresponding to the print request is an ungenerated state, The time when the request time of the print request reaches the print polling interval time is the start time enters the waiting state, and when the waiting time reaches the next print polling interval time, the query corresponding to the print request for obtaining the print counter statistics is returned and triggered. The operation of the number of times until the front end receives the document image corresponding to the print request sent by the printing platform.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有单证打印的系统,所述单证打印的系统被处理器执行时实现步骤:A computer readable storage medium, wherein the computer readable storage medium stores a system for document printing, and the system for executing the document printing is implemented by a processor:S1,获取前端预先配置的打印参数,初始化所述打印参数;S1. Acquire a pre-configured print parameter of the front end, and initialize the print parameter.S2,基于所述打印参数将各打印请求以单线程的形式发送给所述打印平台后,释放各打印请求对应的线程;S2, after each print request is sent to the printing platform in a single thread based on the printing parameter, releasing a thread corresponding to each print request;S3,基于所述打印参数向所述打印平台轮询各打印请求对应的单证影像,在有打印请求对应的单证影像请求生成后,接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。 S3, the document image corresponding to each print request is polled to the printing platform based on the print parameter, and after the document image request corresponding to the print request is generated, the single print request corresponding to the print request is received. Document the image for printing.
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述单证打印的系统被所述处理器执行时,还实现如下步骤:生成所述单证影像对应的页面,清除已生成页面的单证影像对应的打印请求在所述打印计数器中统计的询问次数。The computer readable storage medium according to claim 16, wherein when the system for printing the document is executed by the processor, the method further comprises the steps of: generating a page corresponding to the document image, and clearing the generated The number of queries counted in the print counter for the print request corresponding to the document image of the page.
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述打印参数包括线程访问控制参数、打印轮询间隔时间、最大轮询次数,所述单证打印的系统被所述处理器执行实现所述步骤S3时,具体包括:The computer readable storage medium of claim 16, wherein the print parameters include thread access control parameters, a print polling interval, a maximum number of polls, and the system for printing the document is by the processor When the step S3 is implemented, the method specifically includes:S31,向所述打印平台询问每一打印请求对应的单证影像,并基于询问结果分析是否有未返回所述打印请求对应的单证影像;S31, querying the printing platform for a document image corresponding to each print request, and analyzing, according to the query result, whether there is a document image that does not return the print request corresponding to the print request;S32,若否,则由前端接收所述打印平台发送的所述打印请求对应的单证影像;S32, if not, receiving, by the front end, a document image corresponding to the print request sent by the printing platform;S33,若是,则在所述打印请求的请求时间达到打印轮询间隔时间时,获取打印计数器统计的所述打印请求对应的询问次数,判断所统计的询问次数是否小于等于预设的最大轮询次数;S33. If yes, when the request time of the print request reaches the print polling interval time, the number of queries corresponding to the print request counted by the print counter is obtained, and it is determined whether the counted number of queries is less than or equal to a preset maximum polling. frequency;S34,若所统计的询问次数小于等于预设的最大轮询次数,则向打印平台发起获取所述打印请求对应的单证影像的当前生成状态的请求,以获取所述打印请求对应的单证影像的当前生成状态;S34, if the counted number of queries is less than or equal to a preset maximum number of polling times, initiate a request for acquiring a current generation state of the document image corresponding to the print request to the printing platform, to obtain a document corresponding to the print request. The current generation state of the image;S35,若所述打印请求对应的单证影像的当前生成状态为已生成状态,则由前端接收所述打印平台发送的所述打印请求对应的单证影像,以进行打印。S35. If the current generation state of the document image corresponding to the print request is the generated state, the front end receives the document image corresponding to the print request sent by the printing platform to perform printing.
- 根据权利要求18所述的计算机可读存储介质,其特征在于,所述单证打印的系统被所述处理器执行实现所述步骤S3时,进一步包括:S36,若所统计的询问次数大于预设的最大轮询次数,则中断大于预设的最大轮询次数对应的打印请求,弹出信息提示用户重试。The computer readable storage medium according to claim 18, wherein when the system for printing the document is executed by the processor to implement the step S3, the method further comprises: S36, if the counted number of queries is greater than If the maximum number of polling times is set, the print request corresponding to the preset maximum number of polling times is interrupted, and a pop-up message prompts the user to retry.
- 根据权利要求18或19所述的计算机可读存储介质,其特征在于,所述单证打印的系统被所述处理器执行实现所述步骤S3时,进一步包括:若所述打印请求对应的单证影像的当前生成状态为未生成状态,则以所述打印请求的请求时间达到打印轮询间隔时间的时刻为开始时刻进入等待状态,并在等待时间达到下一打印轮询间隔时间时,返回执行所述步骤S33,直至前端接收到所述打印平台发送的所述打印请求对应的单证影像。 The computer readable storage medium according to claim 18 or 19, wherein the system for printing the document is executed by the processor to implement the step S3, further comprising: if the print request corresponds to a single If the current generation state of the image is an ungenerated state, the time when the print request interval reaches the print polling interval time is the start time enters the waiting state, and when the waiting time reaches the next print polling interval time, the image is returned. The step S33 is performed until the front end receives the document image corresponding to the print request sent by the printing platform.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710440289.2A CN107678701A (en) | 2017-06-12 | 2017-06-12 | Device, method and the computer-readable recording medium of document printing |
CN2017104402892 | 2017-06-12 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018227853A1 true WO2018227853A1 (en) | 2018-12-20 |
Family
ID=61134041
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/108791 WO2018227853A1 (en) | 2017-06-12 | 2017-10-31 | Document printing apparatus, method and system and computer readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107678701A (en) |
WO (1) | WO2018227853A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109783142B (en) * | 2018-12-21 | 2021-02-12 | 福建新大陆支付技术有限公司 | Multithreading synchronization method based on POS machine and POS machine |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101409642A (en) * | 2008-11-21 | 2009-04-15 | 深圳市华冠电气有限公司 | Data service system, data service center and administrative operation method |
CN102866866A (en) * | 2011-07-05 | 2013-01-09 | 富士施乐株式会社 | Information processing apparatus and method, printing system |
CN103631540A (en) * | 2012-08-27 | 2014-03-12 | 上海博路信息技术有限公司 | Method for sharing equipment printing machine |
US9600216B2 (en) * | 2004-07-22 | 2017-03-21 | Ca, Inc. | System and method for managing jobs in heterogeneous environments |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7234139B1 (en) * | 2000-11-24 | 2007-06-19 | Catharon Productions, Inc. | Computer multi-tasking via virtual threading using an interpreter |
JP2013205968A (en) * | 2012-03-27 | 2013-10-07 | Sharp Corp | Server system, print system, and printer |
-
2017
- 2017-06-12 CN CN201710440289.2A patent/CN107678701A/en active Pending
- 2017-10-31 WO PCT/CN2017/108791 patent/WO2018227853A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9600216B2 (en) * | 2004-07-22 | 2017-03-21 | Ca, Inc. | System and method for managing jobs in heterogeneous environments |
CN101409642A (en) * | 2008-11-21 | 2009-04-15 | 深圳市华冠电气有限公司 | Data service system, data service center and administrative operation method |
CN102866866A (en) * | 2011-07-05 | 2013-01-09 | 富士施乐株式会社 | Information processing apparatus and method, printing system |
CN103631540A (en) * | 2012-08-27 | 2014-03-12 | 上海博路信息技术有限公司 | Method for sharing equipment printing machine |
Also Published As
Publication number | Publication date |
---|---|
CN107678701A (en) | 2018-02-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11855858B2 (en) | Systems and methods for providing notifications of changes in a cloud-based file system | |
WO2019205371A1 (en) | Server, message allocation method, and storage medium | |
US8407530B2 (en) | Server reachability detection | |
WO2019061991A1 (en) | Multi-element universal model platform modeling method, electronic device, and computer readable storage medium | |
WO2018223941A1 (en) | Device and method for issuing multiple insurance policies and computer readable storage medium | |
CN113383303B (en) | Reducing CPU overhead per I/O by queuing and batching read requests and read completion notifications | |
CN111291292A (en) | Page rendering method and device, terminal equipment and storage medium | |
CN104378435A (en) | Method for transmitting file between browser of computing device and mobile terminal | |
WO2019169763A1 (en) | Electronic apparatus, service system risk control method, and storage medium | |
CN111586140A (en) | Data interaction method and server | |
CN110333916B (en) | Request message processing method, device, computer system and readable storage medium | |
WO2018227853A1 (en) | Document printing apparatus, method and system and computer readable storage medium | |
CN113032070A (en) | Host image intercepting method and device and related components | |
AU2018403361A1 (en) | Data transmission | |
US20160112525A1 (en) | Distribution control device and method for same, push distribution system, and storage medium | |
CN107783920B (en) | System, method and computer program for communicating between a software driver and a baseboard management controller | |
CN110008261B (en) | External change detection | |
WO2019001271A1 (en) | Open platform device, method for obtaining policy number, and computer readable storage medium | |
WO2022028189A1 (en) | Screen projection method and apparatus, electronic device, and computer readable storage medium | |
CN107632893B (en) | Message queue processing method and device | |
CN113079152B (en) | Data transmission method, device and medium | |
US9659041B2 (en) | Model for capturing audit trail data with reduced probability of loss of critical data | |
CN111858084B (en) | Data transmission method and device, electronic equipment and storage medium | |
US20160364190A1 (en) | Information processing apparatus and control method by request processing module operating on information processing apparatus | |
US20120137313A1 (en) | Framework for system communication for handling data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17913895 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 08/07/2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17913895 Country of ref document: EP Kind code of ref document: A1 |