Invoice printing method and device based on message queue and medium
By introducing message queue technology into the invoice printing system, an efficient invoice printing process is achieved, solving the problems of low efficiency and high manual operations in the existing system, and improving the work efficiency of the enterprise and the waiting experience of customers.
Patent Information
- Application Number
- CN202411840991.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-05-13
AI Technical Summary
The existing invoice printing system is inefficient and requires a lot of manual operation, which cannot adapt to the high concurrent printing needs of large motor vehicle companies, resulting in a long wait time for customers to receive invoices.
Using the invoice printing method based on the message queue, connect to the digital invoice cloud platform through the print server, generate multiple printing requests, and forward them to the corresponding request queue. The consumer thread dequeues the printing request according to the printer status, obtains the complete invoice information and pushes it to the printer for printing.
It improves invoice printing efficiency, reduces manual operations, shortens the waiting time for customers to receive invoices, and adapts to the high concurrent printing needs of large motor vehicle companies.
Smart Images

Figure CN119987689A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of invoice printing, and more specifically, to a message queue-based invoice printing method, device and medium. Background Art
[0002] The existing invoice printer methods basically adopt two methods. One is that after the invoice has been generated, it is stored in the local system and uploaded to the electronic account library of the tax bureau. The invoice issuer can manually select an invoice from the local invoice list or request an invoice from the electronic account library of the tax bureau through the network interface, and send it to the corresponding printer for invoice printing; the other is that when the invoice is not issued, the invoice issuer must first push the invoice information to the tax control disk to generate the motor vehicle invoice information, call the printing interface to generate the invoice printing information, and push it to the corresponding printer for invoice printing. In the existing printing system, one printing operation includes one invoice and one printer, which requires a lot of manual operations, low invoice printing efficiency, and long waiting time for customers to receive invoices. It cannot adapt to the invoice printing application scenarios of large motor vehicle companies with large invoice volume and high concurrency. Summary of the invention
[0003] In view of the deficiencies of the prior art, the present invention provides an invoice printing method, device and medium based on a message queue.
[0004] According to one aspect of the present invention, there is provided an invoice printing method based on a message queue, comprising:
[0005] Establishing a connection between the user's printing terminal and the digital invoice cloud platform, obtaining the generated invoice information of the printing terminal, and generating multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices;
[0006] The print server receives the print request sent by the print terminal, and forwards and stores multiple print requests into corresponding different request queues according to the printer name in the print request;
[0007] Check the status of all connected printers through the consumption thread pre-built on the print server. When the printer is idle and the corresponding request queue is not empty, select the first print request in the corresponding request queue to dequeue, and call the invoice query interface provided by the digital invoice cloud platform to obtain the complete invoice information of the print request, and generate the invoice printing information;
[0008] Push the printing information to the printer for invoice printing.
[0009] Optionally, the user's printing terminal is connected to the digital invoice cloud platform to obtain the generated invoice information of the printing terminal, including:
[0010] After establishing a connection between the printing terminal and the Digital Invoice Cloud Platform, send identity authentication information to the Digital Invoice Cloud Platform;
[0011] After the identity authentication information is passed, the generated invoice information of the printing terminal is obtained according to the printing terminal's own permissions.
[0012] Optionally, one printer corresponds to one request queue, and each request queue is assigned a consumer thread, the consumer thread is used for business processing, and,
[0013] Check the status of all connected printers through the pre-built consumer thread on the print server, including:
[0014] When the printer is idle and the corresponding request queue is empty, the consumer thread will sleep for a preset time and then recheck the status of all connected printers.
[0015] Optionally, the status of all connected printers can be checked via a pre-built consumer thread on the print server, including:
[0016] When the printer is printing, the consumer thread will sleep for a preset time and then recheck the status of all connected printers.
[0017] Optionally, the method further includes: recording an invoice printing log, and feeding back the invoice printing result information in the invoice printing log to the digital invoice cloud platform.
[0018] According to another aspect of the present invention, there is provided an invoice printing device based on a message queue, comprising:
[0019] The first generation module is used to establish a connection between the user's printing terminal and the digital electricity invoice cloud platform, obtain the generated invoice information of the printing terminal, and generate multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices;
[0020] The forwarding storage module is used to receive the print request sent by the print terminal through the print server, and forward and store multiple print requests into corresponding different request queues according to the printer name in the print request;
[0021] The second generation module is used to check the status of all connected printers through the consumption thread pre-built on the print server. When the printer is idle and the corresponding request queue is not empty, the first print request in the corresponding request queue is selected to be dequeued, and the invoice query interface provided by the digital electricity invoice cloud platform is called to obtain the complete invoice information of the print request, and generate the invoice printing information;
[0022] The printing module is used to push the printing information to the printer for invoice printing.
[0023] Optionally, the first generation module establishes a connection between the user's printing terminal and the digital electricity invoice cloud platform to obtain the generated invoice information of the printing terminal, including:
[0024] The sending submodule is used to send identity authentication information to the digital invoice cloud platform after the printing terminal is connected to the digital invoice cloud platform;
[0025] The acquisition submodule is used to obtain the generated invoice information of the printing terminal according to the printing terminal's own permissions after the identity authentication information is passed.
[0026] Optionally, one printer corresponds to one request queue, and each request queue is assigned a consumer thread, the consumer thread is used for business processing, and,
[0027] The second generation module checks the status of all connected printers through the consumer thread pre-built on the print server, and also includes:
[0028] The first checking submodule is used to recheck the status of all connected printers after the consumer thread sleeps for a preset time when the printer is idle and the corresponding request queue is empty.
[0029] Optionally, the second generation module checks the status of all connected printers through a consumption thread pre-built on the print server, and further includes:
[0030] The second checking submodule is used to recheck the status of all connected printers after the consumer thread is put to sleep for a preset time when the printer is printing.
[0031] Optionally, the device also includes: a feedback module, which is used to record the invoice printing log and feed back the invoice printing result information in the invoice printing log to the digital invoice cloud platform.
[0032] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method described in any one of the above aspects of the present invention.
[0033] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of the above aspects of the present invention.
[0034] Therefore, the invoice printing system provided by the present invention realizes efficient printing by adopting the print request production module and consumption module of the message queue on the basis of separating the invoice generation and printing functions. It is no longer limited to the mode of generating and printing one invoice at a time of the existing printing system, simplifies the invoice printing process of the enterprise, shortens the waiting time for customers to receive invoices, and improves the work efficiency of the enterprise. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:
[0036] Figure 1 It is a flowchart of an invoice printing method based on a message queue provided by an exemplary embodiment of the present invention;
[0037] Figure 2 is a schematic diagram of the system architecture of an invoice printing method based on a message queue provided by an exemplary embodiment of the present invention;
[0038] Figure 3 is another flow chart of an invoice printing method based on a message queue provided by an exemplary embodiment of the present invention;
[0039] Figure 4 It is a structural schematic diagram of an invoice printing device based on a message queue provided by an exemplary embodiment of the present invention;
[0040] Figure 5 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0041] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0042] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0043] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0044] It should also be understood that, in the embodiments of the present invention, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0045] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0046] In addition, the term "and / or" in the present invention is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.
[0047] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0048] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0049] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0050] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0051] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0052] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0053] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0054] Exemplary Methods
[0055] Figure 1 FIG. 1 is a flow chart of a message queue-based invoice printing method provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the message queue-based invoice printing method 100 includes the following steps:
[0056] Step 101, establishing a connection between the user's printing terminal and the digital electricity invoice cloud platform, obtaining the generated invoice information of the printing terminal, and generating multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices;
[0057] Step 102, receiving the print request sent by the print terminal through the print server, and forwarding and storing multiple print requests into corresponding different request queues according to the printer name in the print request;
[0058] Step 103: Check the status of all connected printers through the consumption thread pre-built on the print server. When the printer is idle and the corresponding request queue is not empty, select the first print request in the corresponding request queue to dequeue, and call the invoice query interface provided by the digital electricity invoice cloud platform to obtain the complete invoice information of the print request, and generate the invoice printing information;
[0059] Step 104, push the printing information to the printer to print the invoice.
[0060] Specifically, the present invention provides a high-performance invoice printing method based on a message queue, which can efficiently process single or batch invoice printing requests pushed by motor vehicle companies. Each print request includes the corresponding invoice number interval and printer name, which are forwarded and stored in the corresponding request queue. After the request is dequeued, the print server can query the digital invoice cloud platform once or in batches according to the type of invoice number interval it contains, return the complete motor vehicle invoice information, generate the corresponding printing information, and finally push it to the designated printer for printing. This method effectively improves the utilization rate of the printer, reduces the waiting time for printing requests in peak periods, and improves the efficiency of invoice printing.
[0061] Specifically, refer to Figure 2 As shown, the present invention includes a printing terminal, a printing server, a digital invoice cloud platform, and a printer.
[0062] The printing terminal can be a web business management system or a mobile app. The customer selects a single or multiple invoices through the printing terminal and associates them with the printer information to generate a print request, which is then sent to the queue of the print server; it supports viewing and counting the invoice information generated in the digital invoice cloud platform.
[0063] The print server includes a request production module, a request consumption module, and a request queue. The request production module can receive print requests sent by the print terminal, forward and store the print requests in different request queues according to the printer name; the request consumption module checks the status of all connected printers, selects the first print request in the request queue to dequeue when the printer is idle, and then calls the invoice query interface provided by the digital invoice cloud platform to obtain the complete invoice information, generates invoice printing information, and finally pushes it to the printer for invoice printing. The request queue is used to store the print requests sent by the print terminal, and the number of printer queues is consistent with the actual number of printers.
[0064] The Digital Invoice Cloud Platform is used to store all invoice information that has been generated by the enterprise, provide invoice list data for the printing terminal, and provide an invoice information query interface for the printing server to return complete invoice information.
[0065] The printer can be a local printer or a network printer, and can be connected to a print server to provide invoice printing functions. Multiple printers can be connected to the same print server at the same time, and each printer corresponds to a print queue.
[0066] The present invention mainly includes two processes: a print request production module and a request consumption module. Figure 3 The specific operation process is as follows:
[0067] The print request production module process is as follows:
[0068] 1) After the printing terminal establishes a connection with the digital invoice cloud platform, it sends identity authentication information to the digital invoice cloud platform. After the authentication is passed, the printing terminal can view the information of the generated invoice according to its own permissions;
[0069] 2) Customers can select a single invoice and associate it with a printer to generate a print request;
[0070] 3) You can also select multiple invoices and associate them with a printer information to generate a print request;
[0071] 4) The printing terminal connects to the print server and sends the print request to the print server.
[0072] 5) The print server forwards the print request to different print queues according to the printer name in the print request, waiting for printing.
[0073] The print request consumption module process is as follows:
[0074] 1) The print server can connect to multiple printers at the same time. One printer corresponds to one print request queue, and each request queue is assigned a consumer thread for business processing;
[0075] 2) The consumer thread first determines whether the corresponding printer is idle. If the printer is idle, it takes the first request in the print request queue. If the print queue is empty at this time, the processing thread sleeps for a period of time and then repeats step 2);
[0076] 3) When the consumer thread receives a single invoice printing request, it can obtain complete invoice information by requesting the digital invoice cloud platform once;
[0077] 4) When the consumer thread receives a batch invoice printing request, it can request the digital invoice cloud platform in batches and multiple times to obtain complete invoice information;
[0078] 5) Generate invoice printing information based on invoice information and send it to the corresponding printer for printing;
[0079] 6) Record the invoice printing log and feed back the invoice printing result information to the Digital Invoice Cloud Platform;
[0080] 7) Determine whether the system is exited. If the system continues to execute, repeat steps 2) to 6) to process the invoice printing requests of the printing terminal concurrently.
[0081] The present invention is designed to design a high-performance invoice printing method based on a message queue for a large number of invoices that have been generated and are waiting to be printed. In this method, the customer queries the invoice list and the connected printer list in the digital invoice cloud platform through various forms of printing terminals such as web pages or mobile phone apps, and then selects invoices individually or in batches and pushes them to the invoice request queue of the print server. The print server determines the status of the printer and the request queue, selects an invoice printing request from the print request queue each time, and then queries the complete motor vehicle invoice information from the digital invoice cloud platform according to the print request. After the invoice printing information is generated, it is finally pushed to the corresponding printer for printing. The invoice printing method involved in the present invention realizes the printing of multiple invoices corresponding to multiple printers respectively, improves the utilization rate of the motor vehicle enterprise's printers, and reduces the number of manual operations and the waiting time for customers to receive invoices.
[0082] The key technical points of the present invention are:
[0083] 1. Use message queues to store and process print requests sent by print terminals, decouple print terminals and print servers, and process requests asynchronously, thereby alleviating system pressure during peak hours and effectively improving system stability and invoice printing efficiency.
[0084] The print server uses a network interface to communicate and can flexibly access the enterprise's business digital invoice cloud platform. Large-volume invoices are divided into batches corresponding to multiple printers, and can be seamlessly connected to the company's various existing printing devices, improving the reusability of the printing equipment and reducing the complexity of equipment maintenance.
[0085] Therefore, the invoice printing system provided by the present invention realizes efficient printing by adopting the print request production module and consumption module of the message queue on the basis of separating the invoice generation and printing functions. It is no longer limited to the mode of generating and printing one invoice at a time of the existing printing system, simplifies the invoice printing process of the enterprise, shortens the waiting time for customers to receive invoices, and improves the work efficiency of the enterprise.
[0086] Exemplary Devices
[0087] Figure 4 FIG. 1 is a schematic diagram of the structure of an invoice printing device based on a message queue provided by an exemplary embodiment of the present invention. Figure 4 As shown, the device 400 includes:
[0088] The first generation module 410 is used to establish a connection between the user's printing terminal and the digital electricity invoice cloud platform, obtain the generated invoice information of the printing terminal, and generate multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices;
[0089] The forwarding storage module 420 is used to receive the print request sent by the print terminal through the print server, and forward and store multiple print requests into corresponding different request queues according to the printer name in the print request;
[0090] The second generation module 430 is used to check the status of all connected printers through the consumption thread pre-built on the print server. When the printer is idle and the corresponding request queue is not empty, the first print request in the corresponding request queue is selected to be dequeued, and the invoice query interface provided by the digital electricity invoice cloud platform is called to obtain the complete invoice information of the print request, and generate the invoice printing information;
[0091] The printing module 440 is used to push the printing information to the printer for invoice printing.
[0092] Optionally, the first generating module 410 establishes a connection between the user's printing terminal and the digital electricity invoice cloud platform to obtain the generated invoice information of the printing terminal, including:
[0093] The sending submodule is used to send identity authentication information to the digital invoice cloud platform after the printing terminal is connected to the digital invoice cloud platform;
[0094] The acquisition submodule is used to obtain the generated invoice information of the printing terminal according to the printing terminal's own permissions after the identity authentication information is passed.
[0095] Optionally, one printer corresponds to one request queue, and each request queue is assigned a consumer thread, the consumer thread is used for business processing, and,
[0096] The second generation module 430 checks the status of all connected printers through the consumer thread pre-built on the print server, and also includes:
[0097] The first checking submodule is used to recheck the status of all connected printers after the consumer thread sleeps for a preset time when the printer is idle and the corresponding request queue is empty.
[0098] Optionally, the second generation module 430 checks the status of all connected printers through a consumption thread pre-built on the print server, and further includes:
[0099] The second checking submodule is used to recheck the status of all connected printers after the consumer thread is put to sleep for a preset time when the printer is printing.
[0100] Optionally, the device 400 further includes: a feedback module, which is used to record an invoice printing log and feed back the invoice printing result information in the invoice printing log to the digital electricity invoice cloud platform.
[0101] Exemplary Electronic Devices
[0102] Figure 5 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. Figure 5 As shown, the electronic device 50 includes one or more processors 51 and a memory 52 .
[0103] The processor 51 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0104] The memory 52 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 51 may run the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above and / or other desired functions. In one example, the electronic device may also include: an input device 53 and an output device 54, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0105] In addition, the input device 53 may also include, for example, a keyboard, a mouse, etc.
[0106] The output device 54 can output various information to the outside. The output device 54 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto.
[0107] Of course, to simplify, Figure 5 Only some of the components related to the present invention in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application conditions.
[0108] Exemplary computer program products and computer-readable storage media
[0109] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0110] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0111] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0112] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, system or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0113] The basic principle of the present invention is described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, strengths, effects, etc. mentioned in the present invention are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present invention. In addition, the specific details disclosed above are only for the purpose of illustration and facilitation of understanding, rather than limitation, and the above details do not limit the present invention to being implemented by adopting the above specific details.
[0114] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0115] The block diagrams of the devices, systems, equipment, and systems involved in the present invention are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, systems, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.
[0116] The method and system of the present invention may be implemented in many ways. For example, the method and system of the present invention may be implemented by software, hardware, firmware or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present invention are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present invention may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
[0117] It should also be noted that in the system, device and method of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. The above description of the disclosed aspects is provided to enable any technician in the field to make or use the present invention. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined here can be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown here, but in accordance with the widest range consistent with the principles and novel features disclosed here.
[0118] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present invention to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A message queue-based invoice printing method, characterized in that: include: Establishing a connection between the user's printing terminal and the digital electricity invoice cloud platform, obtaining the generated invoice information of the printing terminal, and generating multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices; Receiving the print request sent by the print terminal through the print server, and forwarding and storing multiple print requests into corresponding different request queues according to the printer name in the print request; The status of all connected printers is checked through the consumption thread pre-built on the print server. When the printer is idle and the corresponding request queue is not empty, the first print request in the corresponding request queue is selected to be dequeued, and the invoice query interface provided by the digital electricity invoice cloud platform is called to obtain the complete invoice information of the print request, and generate invoice printing information; The printing information is pushed to the printer for invoice printing.
2. The method according to claim 1, characterized in that Establish a connection between the user's printing terminal and the digital invoice cloud platform to obtain the invoice information generated by the printing terminal, including: After establishing a connection between the printing terminal and the digital invoice cloud platform, sending identity authentication information to the digital invoice cloud platform; After the identity authentication information is passed, the generated invoice information of the printing terminal is obtained according to the printing terminal's own authority.
3. The method according to claim 1, characterized in that One printer corresponds to one request queue, and each request queue is assigned a consumer thread, which is used to perform business processing, and, Checking the status of all connected printers through the consumer thread pre-built on the print server also includes: When the printer is idle and the corresponding request queue is empty, the consumer thread is put to sleep for a preset time and then the status of all connected printers is rechecked.
4. The method according to claim 3, characterized in that Checking the status of all connected printers through the consumer thread pre-built on the print server also includes: When the printer is printing, the consumer thread is put to sleep for a preset time and then the status of all connected printers is rechecked.
5. The method according to claim 1, characterized in that Also includes: Record the invoice printing log, and feed back the invoice printing result information in the invoice printing log to the digital electricity invoice cloud platform.
6. An invoice printing device based on a message queue, characterized in that: include: A first generation module is used to establish a connection between the user's printing terminal and the digital electricity invoice cloud platform, obtain the generated invoice information of the printing terminal, and generate multiple printing requests according to the generated invoice information, wherein the printing request includes one or more invoices; A forwarding and storing module, used for receiving the print request sent by the print terminal through the print server, and forwarding and storing multiple print requests into corresponding different request queues according to the printer name in the print request; The second generation module is used to check the status of all connected printers through the consumption thread pre-built on the print server, and when the printer is idle and the corresponding request queue is not empty, select the first print request in the corresponding request queue to dequeue, and call the invoice query interface provided by the digital electricity invoice cloud platform to obtain the complete invoice information of the print request, and generate invoice printing information; The printing module is used to push the printing information to the printer for invoice printing.
7. The device according to claim 6, characterized in that The first generation module establishes a connection between the user's printing terminal and the digital electricity invoice cloud platform to obtain the generated invoice information of the printing terminal, including: A sending submodule, used to send identity authentication information to the digital invoice cloud platform after establishing a connection between the printing terminal and the digital invoice cloud platform; The acquisition submodule is used to acquire the generated invoice information of the printing terminal according to the authority of the printing terminal itself after the identity authentication information is passed.
8. The device according to claim 6, characterized in that One printer corresponds to one request queue, and each request queue is assigned a consumer thread, which is used to perform business processing, and, The second generation module checks the status of all connected printers through the consumer thread pre-built on the print server, and also includes: The checking submodule is used to recheck the status of all connected printers after the consumer thread is put to sleep for a preset time when the printer is idle and the corresponding request queue is empty.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 5.
10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
High-performance invoice printing system
CN111240608A
System and method for asynchronous tracking and quantifying of printing events
US20020113995A1