High-concurrency and high-availability digital-to-electronic invoice issuing method and system

By using local caching queues and offline processing, the response latency and interruption issues of invoice issuance in high-concurrency scenarios are resolved, realizing a high-concurrency and highly available digital invoice issuance method, and improving the stability and efficiency of the system.

CN121639299APending Publication Date: 2026-03-10YGSOFT INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies suffer from issues such as response latency, interruption risk, delayed quota allocation, processing team congestion, and low business fault tolerance in high-concurrency scenarios, especially in large-scale high-concurrency business scenarios, leading to delays and interruptions in the invoicing process.

Method used

By storing invoice number segments in a local database and pre-allocating them to a cache queue, obtaining taxpayers' available credit limits and generating multi-format files, detecting network status and storing files offline when there are network anomalies, the system reduces reliance on the tax bureau's enterprise platform and achieves local caching and offline processing.

Benefits of technology

It improves the response time for invoice requests, enhances processing efficiency during peak periods, avoids queue congestion, ensures the stability and reliability of the settlement process, and supports offline invoicing to cope with network instability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639299A_ABST
    Figure CN121639299A_ABST
Patent Text Reader

Abstract

The invention discloses a high-concurrency and high-availability digital-to-electronic invoice issuing method and system, and belongs to the technical field of invoice issuing, and the method comprises the steps: obtaining an invoice number segment through the docking of a tax bureau and an enterprise platform, storing the invoice number segment to a local database, and then pre-distributing the invoice number segment to a local cache queue; based on the obtained taxpayer information, obtaining the available amount of the invoice of the taxpayer, and verifying the invoicing amount and the available amount of the invoice of the taxpayer; and a multi-format layout file is generated by using the pre-generated template, the invoice number segment and the invoicing data, if the network state is network abnormity, the multi-format layout file is stored in a local database, and after the network state is recovered to network normal, the multi-format layout file is uploaded to a tax bureau and entertainment enterprise platform. According to the method and the device, the database pressure is reduced, the response time of the invoicing request is improved, the processing efficiency of the response limit in the business peak period is improved, the multi-format layout file is generated in advance according to the pre-generation template, the generation time is shortened, and queue blockage caused by real-time conversion in a high-concurrency scene is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of invoice issuance technology, specifically relating to a high-concurrency, highly available digital invoice issuance method and system. Background Technology

[0002] With the development of digital technology, electronic invoices have become a core component of modern enterprise financial and tax management. Electronic invoices are a type of electronic invoice that is fully digitized, nationally unified invoice numbers, intelligently granted invoice amounts, and circulated through tax digital accounts. They are characterized by high efficiency, convenience, and environmental friendliness. Currently, enterprises often use the Tax Bureau's "LeQi" platform to issue electronic invoices, thereby automating the basic invoice issuance process and improving the efficiency of financial and tax processing. The Tax Bureau's "LeQi" platform is a digital tax service platform developed by the State Taxation Administration.

[0003] However, when dealing with large-scale and high-concurrency business scenarios, the use of the tax bureau's enterprise platform to issue digital invoices also has corresponding shortcomings, including: (1) Response delay and interruption risk: When allocating number segments, the existing system usually obtains the invoice ID by directly reading and writing to the database. However, under high concurrency requests, the database load surges, which can easily cause database failures, resulting in delays in the response of invoice requests. When the database crashes or times out due to excessive load, it will cause the ID allocation service to be interrupted; (2) Delay in quota allocation: In the existing technology, the query, deduction and synchronous update of quota information mostly rely on real-time interaction. When the business enters the peak period, a large number of invoice requests trigger quota verification, which can easily cause delays in quota allocation due to network delays or system busyness, blocking the invoice process and causing the invoice process to stagnate; (3) Processing team obstruction Sai: Existing invoices, as formatted documents, usually refer to electronic documents presented in a fixed format. The generation of formatted documents is usually a real-time synchronous processing mode. After receiving the invoice request, the invoice data is parsed and rendered to quickly generate multiple formats such as xml, pdf and odf. The process is time-consuming. In high-concurrency scenarios, a large number of file generation tasks will be piled up in the processing queue, resulting in serious queue blockage. (4) Low business fault tolerance: The current invoicing system is a strong online mode, used to interact with the data of the tax bureau's enterprise platform in real time. When the network is unstable or interrupted, it is impossible to complete the application, issuance and transmission of invoices, resulting in a complete interruption of the invoicing business. In high-frequency invoicing scenarios such as large supermarkets and logistics, business delays caused by network problems will directly affect the company's operational efficiency and customer satisfaction.

[0004] Therefore, how to provide an effective technical solution to address the problems of response delay, interruption risk, quota allocation lag, processing team blockage, and low business fault tolerance in existing technologies has become an urgent problem to be solved in existing technologies. Summary of the Invention

[0005] The purpose of this invention is to provide a high-concurrency, high-availability digital invoice issuance method and system to solve the above-mentioned problems existing in the prior art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for issuing high-concurrency and high-availability digital invoices, including: Connect to the tax bureau's Leqi platform to obtain invoice number segments, store the invoice number segments in the local database, and pre-allocate the invoice number segments in the local database to the local cache queue so that invoice number segments can be allocated from the local cache queue when issuing invoices; Obtain invoice data, which includes taxpayer information and invoice amount. Based on the taxpayer information, connect to the tax bureau's Leqi platform to obtain the taxpayer's available invoice amount. Verify the invoice amount and the taxpayer's available invoice amount. If the verification is successful, store the taxpayer's available invoice amount in the local database. A pre-generated template is generated based on the pre-acquired layout file specifications, and then the pre-generated template is used to generate multi-format layout files based on invoice number ranges and invoicing data. Check the network status. If the network status is normal, upload the multi-format files to the Tax Bureau's LeQi platform. If the network status is abnormal, store the multi-format files in the local database and upload them to the Tax Bureau's LeQi platform after the network status returns to normal.

[0007] In one possible design, the system connects to the tax bureau's enterprise platform to obtain invoice number segments, stores these segments in a local database, and pre-allocates the invoice number segments from the local database to a local cache queue. This allows for the allocation of invoice number segments from the local cache queue during invoicing. This includes: The system connects with the tax bureau's enterprise platform at the preset first connection time to obtain invoice number ranges and stores these ranges in the local database. Pre-allocate invoice number segments from the local database to the local cache queue, and compare the number of invoice number segments in the local cache queue based on a preset number segment allocation threshold; If the number of invoice number segments in the local cache queue is greater than the preset number segment allocation threshold, then an invoice number segment will be allocated from the local cache queue when issuing an invoice. If the number of invoice number segments in the local cache queue is less than the preset number segment allocation threshold, the system will connect to the tax bureau's enterprise platform again to obtain new invoice number segments. The system will then update the invoice number segments in the local cache queue based on the new invoice number segments, so that the updated invoice number segments can be allocated from the local cache queue when issuing invoices.

[0008] In one possible design, the taxpayer's available invoice quota is obtained by connecting to the tax bureau's enterprise information platform. The invoice amount and the taxpayer's available invoice quota are then verified. If the verification passes, the taxpayer's available invoice quota is stored in a local database, including: At the preset second connection time, the taxpayer's credit limit is obtained by connecting with the tax bureau's Leqi platform based on the taxpayer's information. The taxpayer's credit limit includes the cumulative download credit limit, the credit limit used for invoicing, and the credit limit returned. The taxpayer's available invoice limit is calculated based on the cumulative downloaded credit limit, the credit limit used for invoicing, and the credit limit returned. The invoice amount is compared with the taxpayer's available invoice amount. If the invoice amount is less than the taxpayer's available invoice amount, the taxpayer's available invoice amount is stored in the local database. If the invoice amount exceeds the taxpayer's available invoice amount, the system will connect to the tax bureau's enterprise platform again to obtain a new cumulative download credit limit. Based on the new cumulative download credit limit, the taxpayer's available invoice amount will be updated and stored in the local database.

[0009] In one possible design, a pre-generated template is generated based on a pre-acquired layout document specification, including: The system connects to the tax bureau's enterprise platform to obtain the format document specifications. The format document specifications are then parsed to obtain fixed fields, dynamic fields, and layout styles. The fixed fields include the invoice code and the location of the tax bureau's seal, while the dynamic fields include the amount and the buyer's name. A static invoice template is generated based on fixed fields, dynamic fields, and layout styles. Then, the dynamic fields in the static invoice template are converted into dynamic field placeholders to obtain a pre-generated template.

[0010] In one possible design, a pre-generated template is used to generate multi-format layout files based on invoice number ranges and invoicing data, including: The pre-generated template is pre-rendered to obtain an intermediate format template, which is a style file of the pre-generated template in the webpage. The intermediate format template is then stored in a local cache server. When issuing an invoice, an intermediate format template is loaded from the local cache server, and a multi-format layout file is generated based on the intermediate format template, the invoice number range, and the invoice data. The multi-format layout file includes an XML format layout file, a PDF format layout file, and an ODF format layout file.

[0011] In one possible design, if the network status is normal, the multi-format files are uploaded to the Tax Bureau's Enterprise Platform; if the network status is abnormal, the multi-format files are stored in a local database, and after the network status recovers, the multi-format files are uploaded to the Tax Bureau's Enterprise Platform, including: If the network status is normal, the correctness of the multi-format files will be verified. If the verification passes, the multi-format files will be uploaded to the tax bureau's business platform. If the network status is abnormal, the correctness of the multi-format layout file is checked. If the check passes, the multi-format layout file is stored in the local database. The network status is detected according to the preset detection time interval. When the network status recovers from abnormal to normal, the multi-format files are uploaded to the tax bureau's business platform.

[0012] Secondly, this invention provides a high-concurrency, high-availability digital invoice issuance system, including a number segment pre-allocation module, a quota pre-caching module, a format file pre-generation module, and an offline processing module. The number segment pre-allocation module, the quota pre-caching module, and the offline processing module are all communicatively connected to the format file pre-generation module. The number segment pre-allocation module is used to connect to the tax bureau's Leqi platform to obtain invoice number segments, store the invoice number segments in the local database, and pre-allocate the invoice number segments in the local database to the local cache queue so that invoice number segments can be allocated from the local cache queue when issuing invoices. The quota pre-caching module is used to obtain invoice data, which includes taxpayer information and invoice amount. Based on the taxpayer information, it connects to the tax bureau's enterprise platform to obtain the taxpayer's available invoice quota and verifies the invoice amount and the taxpayer's available invoice quota. If the verification is successful, the taxpayer's available invoice quota is stored in the local database. The format file pre-generation module is used to obtain the invoice number segment corresponding to the local cache queue in the number segment pre-allocation module and the invoicing data of the quota pre-caching module, generate a pre-generation template based on the pre-obtained format file specifications, and use the pre-generation template to generate multi-format format files based on the invoice number segment and invoicing data, and send the multi-format format files to the offline processing module. The offline processing module is used to detect the network status. If the network status is normal, the multi-format files are uploaded to the Tax Bureau's Leqi platform. If the network status is abnormal, the multi-format files are stored in the local database. After the network status is restored to normal, the multi-format files are uploaded to the Tax Bureau's Leqi platform.

[0013] Thirdly, the present invention provides a high-concurrency, high-availability digital invoice issuing device, comprising a memory, a processor, and a transceiver connected in sequence and communication, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the high-concurrency, high-availability digital invoice issuing method as described in the first aspect above.

[0014] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the high-concurrency, high-availability digital invoice issuance method as described in the first aspect above.

[0015] Fifthly, the present invention provides a computer program product containing instructions that, when the instructions are executed on a computer, cause the computer to perform the high-concurrency, high-availability digital invoice issuance method as described in the first aspect above.

[0016] The beneficial effects of this invention are as follows: This invention discloses a high-concurrency and high-availability digital invoice issuance method and system. First, by connecting to the tax bureau's enterprise platform, invoice number segments are stored in a local database, and the invoice number segments in the local database are pre-allocated to a local cache queue so that invoice number segments can be directly allocated from the local cache queue when issuing invoices. Then, invoice data is obtained, and the taxpayer's available invoice amount is obtained by connecting to the tax bureau's enterprise platform based on the taxpayer information in the invoice data. The invoice amount and the taxpayer's available invoice amount in the invoice data are verified. If the verification is successful, the taxpayer's available invoice amount is stored in the local database. A pre-generated template is generated based on the pre-obtained format file specifications. Using the pre-generated template, multi-format format files are generated based on the invoice number segments and invoice data. The network status is checked. If the network status is normal, the multi-format format files are uploaded to the tax bureau's enterprise platform. If the network status is abnormal, the multi-format format files are stored in the local database, and after the network status recovers to normal, the multi-format format files are uploaded to the tax bureau's enterprise platform. This invention pre-allocates invoice number segments from the local database to a local cache queue, changing the single database retrieval mode, reducing database pressure, and improving the response time for invoice requests. Simultaneously, by pre-caching taxpayer invoice availability in the local database and dynamically updating the available invoice amount, it directly calls the available taxpayer invoice amount from the local database for allocation during network latency or system congestion, improving the processing efficiency of response amounts during peak business periods. Furthermore, by pre-parsing the format file specifications to generate pre-generated templates and generating multi-format format files in advance based on these templates, it improves generation time and avoids queue blocking during real-time conversion in high-concurrency scenarios. This invention supports local storage of invoice data, which is automatically synchronized to the tax bureau's enterprise platform when the network recovers, enabling offline invoicing, ensuring the normal operation of the settlement process, and facilitating application and promotion. Attached Figure Description

[0017] Figure 1 A flowchart of a high-concurrency, high-availability digital invoice issuance method provided in an embodiment of the present invention; Figure 2 A block diagram of a high-concurrency, high-availability digital invoice issuance system provided in this embodiment of the invention; Figure 3 This is a structural block diagram of a high-concurrency, high-availability digital invoice issuing device provided in an embodiment of the present invention. Detailed Implementation

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.

[0019] It should be understood that although the terms first, second, etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of the invention.

[0020] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.

[0021] Example: like Figure 1 As shown, the first aspect of this embodiment provides a high-concurrency, high-availability method for issuing digital invoices, which can be executed, but is not limited to, by a computer device or virtual machine with certain computing resources, such as a personal computer or smartphone, or by a virtual machine; the method for issuing digital invoices includes, but is not limited to, the following steps: S1. Connect to the tax bureau's Leqi platform to obtain invoice number segments, store the invoice number segments in the local database, and pre-allocate the invoice number segments in the local database to the local cache queue so that invoice number segments can be allocated from the local cache queue when issuing invoices; Furthermore, in step S1, the system connects to the tax bureau's enterprise platform to obtain invoice number segments, stores these segments in a local database, and pre-allocates the invoice number segments from the local database to a local cache queue so that invoice number segments can be allocated from the local cache queue when issuing invoices. This includes: S11. Connect with the tax bureau's enterprise platform at the preset first connection time to obtain the invoice number range and store the invoice number range in the local database; S12. Pre-allocate the invoice number segments in the local database to the local cache queue, and compare the number of invoice number segments in the local cache queue based on the preset number segment allocation threshold; S13. If the number of invoice number segments in the local cache queue is greater than the preset number segment allocation threshold, then an invoice number segment is allocated from the local cache queue when issuing an invoice. S14. If the number of invoice number segments in the local cache queue is less than the preset number segment allocation threshold, then connect to the tax bureau's enterprise platform again to obtain new invoice number segments, and update the invoice number segments in the local cache queue based on the new invoice number segments, so that the updated invoice number segments can be allocated from the local cache queue when issuing invoices.

[0022] It should be noted that the Tax Bureau's Enterprise Platform mentioned in this embodiment is a digital platform provided by the State Taxation Administration to eligible enterprises, offering tax-related services such as digital electronic invoices with open rules and unified standards through direct connection between the tax system and the enterprise's own information system. Since the tax bureau generates invoice number segments annually, the preset first connection time in this embodiment is the beginning of each year, that is, connecting to the Tax Bureau's Enterprise Platform at the beginning of each year to obtain a batch of invoice number segments. Here, the invoice number segment refers to the range of consecutive invoice numbers allocated to the enterprise by the tax bureau, and each invoice number segment is a group of invoice numbers. The local cache queue adopts a local Redis queue. Redis (Remote Dictionary Server) is an open-source in-memory data storage system that has both database and middleware characteristics. It is often used in caching and message queue scenarios. It has data persistence capabilities, supports multiple data structure storage, and can also be used as a caching layer to reduce database pressure. In this embodiment, the preset number segment allocation threshold is 5000. Enterprises can set it themselves according to their business needs, and no specific limitation is made here. The preset number segment allocation threshold is used to represent the minimum number of invoices.

[0023] Furthermore, in steps S13 and S14, the number of remaining invoice number segments in the local cache queue is compared with the preset number segment allocation threshold. The calculation expression for the number of remaining invoice number segments is: number of remaining invoice number segments = number of obtained invoice number segments - number of invoice number segments already issued and used. The invoice number segments already issued and used can be obtained through the usage records in the local database.

[0024] In practice, at the beginning of each year, a batch of invoice number segments are obtained from the tax bureau's enterprise platform. These segments are stored in a local database, and pre-allocated to a local cache queue. A preset allocation threshold is used to compare the number of invoice number segments in the local cache queue. If the number of remaining segments in the local cache queue exceeds the threshold, it is considered sufficient, and invoice number segments can be directly retrieved from the local cache queue during invoicing, thus reducing database access pressure. A master-slave failover strategy is used to ensure reliable and stable allocation of invoice number segments. If the number of remaining segments in the local cache queue is less than the threshold, a new set of invoice number segments is obtained from the tax bureau's enterprise platform. For example, this is 5000 segments, but this can be adjusted based on actual needs. The newly obtained segments update the local database and cache queue. Invoices are then issued locally using the updated segments and uploaded to the tax bureau's enterprise platform to complete the invoicing process.

[0025] S2. Obtain invoice data, which includes taxpayer information and invoice amount. Based on the taxpayer information, connect to the tax bureau's enterprise platform to obtain the taxpayer's available invoice amount. Verify the invoice amount and the taxpayer's available invoice amount. If the verification is successful, store the taxpayer's available invoice amount in the local database. The invoicing data also includes product information and tax amount.

[0026] In a preferred embodiment, step S2 involves obtaining the taxpayer's available invoice quota based on the taxpayer information from the tax bureau's enterprise information platform, and verifying the invoice amount and the taxpayer's available invoice quota. If the verification passes, the taxpayer's available invoice quota is stored in the local database, including: S21. At the preset second connection time, the taxpayer's credit limit is obtained by connecting with the tax bureau's Leqi platform based on the taxpayer's information. The taxpayer's credit limit includes the cumulative download credit limit, the credit limit used for invoicing, and the credit limit returned. S22. Calculate the taxpayer's available invoice amount based on the cumulative download credit limit, the credit limit used for invoicing, and the credit limit returned; S23. Compare the invoice amount with the taxpayer's available invoice amount. If the invoice amount is less than the taxpayer's available invoice amount, store the taxpayer's available invoice amount in the local database. S24. If the invoice amount exceeds the taxpayer's available invoice amount, then connect to the tax bureau's enterprise platform again to obtain a new cumulative download credit limit, update the taxpayer's available invoice amount based on the new cumulative download credit limit, and store the updated taxpayer's available invoice amount in the local database.

[0027] It should be noted that the second connection time is preset to the beginning of each month. In step S21, at the beginning of each month, the taxpayer's credit limit is obtained by connecting with the tax bureau's enterprise platform based on the taxpayer information according to the preset download ratio. The download ratio here is set by the user, and in this embodiment it is 80%, which can be modified according to the actual situation. Therefore, the cumulative download credit limit is the total credit limit downloaded in the current month, the credit limit used for invoicing is the credit limit after the taxpayer has used the invoice, and the returned credit limit is the credit limit returned after the invoice was not successfully issued. The calculation expression for the taxpayer's available invoice credit limit is: taxpayer's available invoice credit limit = cumulative download credit limit - credit limit used for invoicing - returned credit limit.

[0028] Furthermore, we will reconnect with the tax bureau's enterprise platform to obtain a new cumulative credit limit, including: when the invoice amount exceeds the taxpayer's available invoice limit, downloading 50% of the remaining taxpayer credit limit, that is, downloading another 50% from the remaining 20% ​​taxpayer credit limit. If, after downloading 50% of the remaining taxpayer credit limit, the invoice amount is still greater than the taxpayer's available invoice limit after the second download, then the remaining taxpayer credit limit will be downloaded in its entirety.

[0029] In practice, if the invoice amount is less than the taxpayer's available invoice credit, it is determined that the taxpayer's available invoice credit is sufficient. The taxpayer's available invoice credit is then stored in the local database, reducing the number of interactions with the tax bureau's enterprise platform due to insufficient credit. At the same time, a local caching mechanism is used for the taxpayer's available invoice credit to reduce frequent interactions with the database, effectively improving invoicing efficiency and reducing the interaction pressure between internal and external networks. If the invoice amount is greater than the taxpayer's available invoice credit, it is determined that the taxpayer's available invoice credit is insufficient. The system will automatically connect to the tax bureau's enterprise platform to obtain a new cumulative download credit limit to ensure that the taxpayer's available invoice credit is greater than or equal to the invoice amount. The taxpayer's available invoice credit is then verified to ensure that the credit is sufficient for subsequent invoicing processing.

[0030] S3. Generate a pre-generated template based on the pre-acquired layout file specifications, and use the pre-generated template to generate multi-format layout files based on invoice number ranges and invoicing data; Specifically, in step S3, a pre-generated template is generated based on the pre-acquired layout document specifications, including: S31. Connect to the tax bureau's enterprise platform to obtain the format document specifications, parse the format document specifications to obtain fixed fields, dynamic fields and layout styles. The fixed fields include the invoice code and the location of the tax bureau's seal, and the dynamic fields include the amount and the buyer's name. S32. Generate a static invoice template based on fixed fields, dynamic fields, and layout styles, and convert the dynamic fields in the static invoice template into dynamic field placeholders to obtain a pre-generated template.

[0031] In specific implementation, the format file specification in this embodiment is a format and content specification specific to invoices. That is, the pre-generated template is an invoice template containing dynamic field placeholders. By replacing the dynamic field placeholders, the issued invoice can be obtained.

[0032] Furthermore, in step S3, a pre-generated template is used to generate a multi-format layout file based on the invoice number range and invoicing data, including: S33. Pre-render the pre-generated template to obtain an intermediate format template, wherein the intermediate format template is a style file of the pre-generated template in the webpage, and store the intermediate format template in a local cache server; S34. When issuing an invoice, load the intermediate format template in the local cache server, and generate a multi-format layout file based on the intermediate format template, the invoice number range, and the invoice data. The multi-format layout file includes an XML format layout file, a PDF format layout file, and an ODF format layout file.

[0033] It should be noted that the pre-generated template is a style file composed of HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets). Invoice number ranges and invoicing data can be filled into the intermediate format template to obtain multi-format layout files.

[0034] S4. Check the network status. If the network status is normal, upload the multi-format files to the Tax Bureau's Leqi platform. If the network status is abnormal, store the multi-format files in the local database and upload them to the Tax Bureau's Leqi platform after the network status returns to normal.

[0035] Specifically, in step S4, if the network status is normal, the multi-format files are uploaded to the Tax Bureau's Enterprise Platform; if the network status is abnormal, the multi-format files are stored in the local database, and after the network status returns to normal, the multi-format files are uploaded to the Tax Bureau's Enterprise Platform, including: S41. If the network status is normal, then perform a correctness check on the multi-format file. If the check passes, then upload the multi-format file to the tax bureau's business platform. S42. If the network status is abnormal, perform a correctness check on the multi-format layout file. If the check passes, store the multi-format layout file in the local database. S43. Detect the network status according to the preset detection time interval. When the network status recovers from abnormal to normal, upload the multi-format files to the tax bureau's enterprise platform.

[0036] It should be noted that the accuracy verification specifically includes comparing the multi-format files with the invoicing data according to the pre-set verification rules to ensure that the content in the multi-format files is correct. The pre-set verification rules can be exemplified by verifying the taxpayer's information to ensure that the information is correct. This embodiment does not specifically limit this.

[0037] like Figure 2 As shown, the second aspect of this embodiment provides a high-concurrency, high-availability digital invoice issuance system, including a number segment pre-allocation module, a quota pre-caching module, a format file pre-generation module, and an offline processing module. The number segment pre-allocation module, the quota pre-caching module, and the offline processing module are all communicatively connected to the format file pre-generation module. The number segment pre-allocation module is used to connect to the tax bureau's Leqi platform to obtain invoice number segments, store the invoice number segments in the local database, and pre-allocate the invoice number segments in the local database to the local cache queue so that invoice number segments can be allocated from the local cache queue when issuing invoices. The quota pre-caching module is used to obtain invoice data, which includes taxpayer information, and to obtain the taxpayer's available invoice quota by connecting to the tax bureau's Leqi platform based on the taxpayer information, and to store the taxpayer's available invoice quota in the local database. The format file pre-generation module is used to obtain the invoice number segment corresponding to the local cache queue in the number segment pre-allocation module and the invoicing data of the quota pre-caching module, generate a pre-generation template based on the pre-obtained format file specifications, and use the pre-generation template to generate multi-format format files based on the invoice number segment and invoicing data, and send the multi-format format files to the offline processing module. The offline processing module is used to detect the network status. If the network status is normal, the multi-format files are uploaded to the Tax Bureau's Leqi platform. If the network status is abnormal, the multi-format files are stored in the local database. After the network status is restored to normal, the multi-format files are uploaded to the Tax Bureau's Leqi platform.

[0038] Furthermore, the format document pre-generation module is also used to directly obtain invoice data, connect to the tax bureau's Leqi platform based on the invoice data, and upload the structured data information of the invoice to obtain the invoice results.

[0039] The working process, working details and technical effects of the high-concurrency and high-availability digital invoice issuance system provided in the second aspect of this embodiment can be found in the high-concurrency and high-availability digital invoice issuance method described in the first aspect, and will not be repeated here.

[0040] like Figure 3 As shown, the third aspect of this embodiment provides a high-concurrency, high-availability digital invoice issuing device, including a memory, a processor, and a transceiver connected in sequence. The memory stores a computer program, the transceiver sends and receives messages, and the processor reads the computer program and executes the high-concurrency, high-availability digital invoice issuing method as described in the first aspect. Specifically, the memory may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; the processor may include, but is not limited to, an STM32F105 series microprocessor. Furthermore, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0041] The working process, working details and technical effects of the aforementioned computer equipment provided in the third aspect of this embodiment can be found in the high-concurrency and high-availability digital invoice issuance method described in the first aspect, and will not be repeated here.

[0042] The fourth aspect of this embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the high-concurrency, high-availability digital invoice issuance method described in the first aspect is performed. The computer-readable storage medium refers to a carrier for storing data, and may include, but is not limited to, computer-readable storage media such as floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0043] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be found in the high-concurrency and high-availability digital invoice issuance method described in the first aspect, and will not be repeated here.

[0044] The fifth aspect of this embodiment provides a computer program product, including a computer program or instructions, which, when executed by a computer, are used to implement the high-concurrency, high-availability digital invoice issuance method as described in the first aspect.

[0045] The working process, working details and technical effects of the aforementioned computer program product provided in this embodiment can be found in the high-concurrency and high-availability digital invoice issuance method described in the first aspect, and will not be repeated here.

[0046] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A high-concurrency and high-availability digital electronic invoice issuing method, characterized in that, The method comprises the following steps: acquiring an invoice number segment from a tax bureau platform, storing the invoice number segment in a local database, and pre-allocating the invoice number segment in the local database to a local cache queue to allocate the invoice number segment from the local cache queue when invoicing; acquiring invoicing data, wherein the invoicing data comprises taxpayer information and invoicing amount, and obtaining a taxpayer invoice available amount from the tax bureau platform based on the taxpayer information, and verifying the invoicing amount and the taxpayer invoice available amount, and if the verification is passed, storing the taxpayer invoice available amount in the local database; generating a pre-generated template based on a pre-acquired format file specification, and using the pre-generated template to generate multi-format format files based on the invoice number segment and the invoicing data; detecting a network state, and if the network state is normal, uploading the multi-format format files to the tax bureau platform, and if the network state is abnormal, storing the multi-format format files in the local database, and after the network state recovers to normal, uploading the multi-format format files to the tax bureau platform.

2. The high-concurrency and high-availability digital electronic invoice issuing method according to claim 1, characterized in that, The method of acquiring an invoice number segment from a tax bureau platform, storing the invoice number segment in a local database, and pre-allocating the invoice number segment in the local database to a local cache queue to allocate the invoice number segment from the local cache queue when invoicing, comprises the following steps: acquiring an invoice number segment from a tax bureau platform at a preset first connection time, and storing the invoice number segment in a local database; pre-allocating the invoice number segment in the local database to a local cache queue, and comparing the number of invoice number segments in the local cache queue based on a preset number segment allocation threshold; if the number of invoice number segments in the local cache queue is greater than the preset number segment allocation threshold, allocating the invoice number segment from the local cache queue when invoicing; if the number of invoice number segments in the local cache queue is less than the preset number segment allocation threshold, acquiring a new invoice number segment from the tax bureau platform again, updating the invoice number segment in the local cache queue based on the new invoice number segment, and allocating the updated invoice number segment from the local cache queue when invoicing.

3. The high-concurrency and high-availability digital electronic invoice issuing method according to claim 1, characterized in that, The method of obtaining a taxpayer invoice available amount from a tax bureau platform based on taxpayer information, and verifying the invoicing amount and the taxpayer invoice available amount, and if the verification is passed, storing the taxpayer invoice available amount in the local database, comprises the following steps: at a preset second connection time, acquiring a taxpayer credit limit from the tax bureau platform based on the taxpayer information, wherein the taxpayer credit limit comprises a cumulative download credit limit, an invoicing used credit limit, and a returned credit limit; calculating the taxpayer invoice available amount according to the cumulative download credit limit, the invoicing used credit limit, and the returned credit limit; comparing the invoicing amount and the taxpayer invoice available amount, and if the invoicing amount is less than the taxpayer invoice available amount, storing the taxpayer invoice available amount in the local database; if the invoicing amount is greater than the taxpayer invoice available amount, acquiring a new cumulative download credit limit from the tax bureau platform again, updating the taxpayer invoice available amount based on the new cumulative download credit limit, and storing the updated taxpayer invoice available amount in the local database.

4. The high-concurrency and high-availability digital electronic invoice issuing method according to claim 1, characterized in that, The method of generating a pre-generated template based on a pre-acquired format file specification comprises the following steps: The tax bureau happy enterprise platform is connected to obtain a format file specification, the format file specification is analyzed, fixed fields, dynamic fields and layout styles are obtained, the fixed fields include invoice code and tax bureau seal position, the dynamic fields include amount and buyer name; Based on the fixed field, the dynamic field and the layout style, a static invoice template is generated, and the dynamic field in the static invoice template is converted into a dynamic field placeholder to obtain a pre-generated template.

5. The high-concurrency and high-availability digital electronic invoice issuing method according to claim 4, characterized in that, Using the pre-generated template, a multi-format format file is generated based on the invoice number segment and the invoice data, including: The pre-generated template is pre-rendered to obtain an intermediate format template, which is a style file of the pre-generated template in a web page, and the intermediate format template is stored in a local cache server; When invoicing, the intermediate format template in the local cache server is loaded, and a multi-format format file is generated based on the intermediate format template, the invoice number segment and the invoice data, the multi-format format file including xml format, pdf format and odf format.

6. The high-concurrency and high-availability digital electronic invoice issuing method according to claim 1, characterized in that, If the network state is normal, the multi-format format file is uploaded to the tax bureau happy enterprise platform, if the network state is abnormal, the multi-format format file is stored in the local database, and when the network state recovers to normal, the multi-format format file is uploaded to the tax bureau happy enterprise platform, including: If the network state is normal, the multi-format format file is uploaded to the tax bureau happy enterprise platform, if the network state is abnormal, the multi-format format file is stored in the local database, and when the network state recovers to normal, the multi-format format file is uploaded to the tax bureau happy enterprise platform, including: According to the preset detection time interval, the network state is detected, when the network state recovers from abnormal to normal, the multi-format format file is uploaded to the tax bureau happy enterprise platform. Including number segment pre-allocation module, quota pre-caching module, format file pre-generation module and offline processing module, the number segment pre-allocation module, the quota pre-caching module and the offline processing module are in communication connection with the format file pre-generation module:

7. A high-concurrency and high-availability digital electronic invoice issuing system for implementing the method of any one of claims 1-6, characterized in that, The number segment pre-allocation module is used to connect the tax bureau happy enterprise platform to obtain the invoice number segment, store the invoice number segment in the local database, and pre-allocate the invoice number segment in the local cache queue in the local database to allocate the invoice number segment from the local cache queue when invoicing; The quota pre-caching module is used to obtain invoice data, the invoice data including taxpayer information and invoice amount, and connect the tax bureau happy enterprise platform based on the taxpayer information to obtain the taxpayer invoice available quota, and check the invoice amount and the taxpayer invoice available quota, if the check is passed, the taxpayer invoice available quota is stored in the local database; The format file pre-generation module is used to obtain the invoice number segment corresponding to the local cache queue in the number segment pre-allocation module and the invoice data of the quota pre-caching module, generate a pre-generated template based on the pre-obtained format file specification, use the pre-generated template to generate a multi-format format file based on the invoice number segment and the invoice data, and send the multi-format format file to the offline processing module; ​ The offline processing module is configured to detect a network state, upload the multi-format version format file to the tax bureau platform if the network state is normal, and store the multi-format version format file in a local database if the network state is abnormal, and upload the multi-format version format file to the tax bureau platform after the network state returns to normal.

8. A high-concurrency and high-availability digital electronic invoice issuing device, characterized in that, The computer program or the instruction realizes the high-concurrency and high-availability electronic invoice issuing method as claimed in any one of claims 1-6 when executed by a computer.

9. A computer program product comprising computer programs or instructions, characterized in that, The computer program or the instruction realizes the high-concurrency and high-availability electronic invoice issuing method as claimed in any one of claims 1-6 when executed by a computer.