An electrical invoice visualization method and device, computer equipment and storage medium
By parsing the structured data of digital invoices to generate a visual page and merging the QR code, the problem of digital invoices not being able to be viewed directly is solved, enabling fast and convenient display of invoice information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YGSOFT INC
- Filing Date
- 2023-07-31
- Publication Date
- 2026-05-05
AI Technical Summary
The existing digital invoices are delivered as XML files, and the invoice content cannot be viewed directly. Users need to go to the tax bureau's website for visualization, which makes the process complicated and time-consuming.
By receiving visualization instructions from digital invoices, parsing structured data to obtain node information, generating page configuration information, and merging QR codes, a visual page display of digital invoices is achieved.
It enables rapid visualization of structured electronic invoices, improving user convenience and viewing efficiency while saving time.
Smart Images

Figure CN116975141B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, computer equipment, and storage medium for visualizing digital invoices. Background Technology
[0002] Fully digitized electronic invoices (referred to as digital invoices) do not require application but have the same legal effect as paper invoices, effectively preventing invoice fraud while greatly increasing the convenience of issuing invoices.
[0003] The VAT invoice integrated service platform provided by the tax authorities offers downloads of various formats of electronic invoices, including PDF (Powder Diffraction File), OFD (Open Fixed-layout Document), and XML (Extensible Markup Language). PDF format electronic invoices are primarily used as paper printouts for reimbursement and accounting purposes, and do not support verification of the validity of the invoice seal and electronic signature. OFD format electronic invoices are electronic vouchers for reimbursement and accounting archiving; their format is identical to PDF, but the validity of the invoice seal and electronic signature on OFD format invoices requires verification using a dedicated VAT electronic invoice reader, a complex process. XML format electronic invoices contain structured invoice data, including digital signatures, and their signature validity can be verified without specialized software; therefore, XML format electronic invoices are used for reimbursement and accounting archiving.
[0004] However, existing digital invoices are delivered as XML files, but the invoice content cannot be viewed directly in the XML file. Users need to go to the tax bureau's website to view the visualized invoice content, which is complicated and time-consuming, affecting the user experience. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, computer device, and storage medium for visualizing digital invoices, so as to solve the problem that structured digital invoice data cannot be visualized in the prior art.
[0006] To address the aforementioned technical problems, this application provides a method for visualizing digital invoices, the method comprising:
[0007] Receive visualization instructions for digital invoices, obtain structured digital invoice data according to the visualization instructions, parse the nodes of the structured digital invoice data, and obtain several displayable node information;
[0008] The visualization page format is determined according to the visualization instructions, and corresponding page configuration information is generated according to the visualization page format.
[0009] Obtain target node information from the displayable node information, and obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the associated information;
[0010] A digital invoice visualization page is generated using the displayable node information and the page configuration information, and the QR code is displayed in the target position on the visualization page.
[0011] Furthermore, the step of generating a digital invoice visualization page using the displayable node information and the page configuration information includes:
[0012] Obtain the page display element tags from the page configuration information, and determine the final display node information from the displayable node information using the page display element tags;
[0013] Based on the final displayed node information, determine whether to adjust the page configuration information. If so, adjust the page configuration information and generate a visualization page for the digital invoice based on the final displayed node information and the adjusted page configuration information. Otherwise, directly generate a visualization page for the digital invoice based on the final displayed node information and the page configuration information.
[0014] Furthermore, the step of determining whether to adjust the page configuration information based on the finally displayed node information includes:
[0015] Obtain the purchase and sales details from the final displayed node information, determine its display range on the visualization page based on the purchase and sales details, and determine whether the display range exceeds the pre-configured display range in the page configuration information. If so, adjust the page configuration information; otherwise, do not adjust it.
[0016] Furthermore, the step of determining the display scope of the purchase and sales details on the visualization page includes:
[0017] Obtain the display row height, column width, character space width, and font size information of the purchase and sales details;
[0018] Determine which purchase and sales details can be displayed on a new line in the purchase and sales details. Based on the display row height and column width, determine whether each purchase and sales detail that can be displayed on a new line needs to be displayed on a new line. If it needs to be displayed on a new line, then display it on a new line to obtain the final display height and the first display range.
[0019] Based on the character space width and font size information, the character space width and font size of the non-wrapable purchase and sales details are adjusted to obtain the second display area;
[0020] The display range of the purchase and sales details on the visualization page is determined based on the first display range and the second display range.
[0021] Furthermore, the step of obtaining the associated information of the digital invoice and generating a QR code based on the target node information and the associated information includes:
[0022] Extract the taxpayer's coding information from the displayable node information, dynamically obtain the tax bureau's seal based on the coding information, obtain the association information of the digital invoice, and generate a QR code based on the target node information and the tax bureau's seal.
[0023] Furthermore, after generating the visualization page for the digital invoice, the method further includes:
[0024] Save the address of the visualization page that displays the QR code, or generate and save an access QR code based on the address of the visualization page that displays the QR code, so that target users can view the visualization page through the address or the access QR code.
[0025] To address the aforementioned technical problems, this application also provides a digital invoice visualization device, comprising:
[0026] The node information acquisition module is used to receive visualization instructions for digital invoices, acquire structured digital invoice data according to the visualization instructions, parse the nodes of the structured digital invoice data, and obtain several displayable node information.
[0027] The configuration information acquisition module is used to determine the visualization page format according to the visualization instructions and generate corresponding page configuration information according to the visualization page format.
[0028] The QR code generation module is used to obtain target node information from the displayable node information and obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the associated information;
[0029] The visualization page generation module is used to generate a digital invoice visualization page using the displayable node information and the page configuration information, and to merge and display the QR code at the target position on the visualization page.
[0030] Furthermore, when the visualization page generation module generates a digital invoice visualization page using the displayable node information and the page configuration information, it is specifically used for:
[0031] Obtain the page display element tags from the page configuration information, and determine the final display node information from the displayable node information using the page display element tags; determine whether to adjust the page configuration information based on the final display node information; if so, adjust the page configuration information, and generate a visualization page for the digital invoice based on the final display node information and the adjusted page configuration information; otherwise, directly generate a visualization page for the digital invoice based on the final display node information and the page configuration information.
[0032] To address the aforementioned technical problems, this application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the digital invoice visualization method described above.
[0033] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the digital invoice visualization method described above.
[0034] Compared with the prior art, the embodiments of this application have the following main advantages:
[0035] This application embodiment obtains node information of structured digital invoice data, generates page configuration information according to the required visualization page format, generates a QR code based on the target node information and the associated information, and generates a visualization page based on the node information, page configuration information and QR code, thereby enabling users to quickly view invoice information of digital invoices presented in structured data, improving convenience and saving time. Attached Figure Description
[0036] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0038] Figure 2 This is a flowchart of an embodiment of the digital invoice visualization method according to this application;
[0039] Figure 3 yes Figure 2 A flowchart of an embodiment of step S24;
[0040] Figure 4 yes Figure 3 A flowchart of an embodiment of step S32;
[0041] Figure 5 yes Figure 4 A flowchart of an embodiment of step S41;
[0042] Figure 6 This is a schematic diagram of the structure of one embodiment of the digital invoice visualization device according to this application;
[0043] Figure 7 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0045] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0046] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0047] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0048] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0049] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0050] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0051] It should be noted that the digital invoice visualization method provided in this application embodiment is generally executed by a server, and correspondingly, the digital invoice visualization device is generally set in the server.
[0052] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0053] Continue to refer to Figure 2 A flowchart illustrating an embodiment of a method for visualizing digital invoices according to this application is shown. The method for visualizing digital invoices includes the following steps S21 to S24:
[0054] Step S21: Receive the visualization instruction of the digital invoice, obtain the structured digital invoice data according to the visualization instruction, parse the nodes of the structured digital invoice data, and obtain several displayable node information.
[0055] In this step, the visualization command for the digital invoice can be initiated by the user or automatically triggered by the server providing the digital invoice visualization service. The structured digital invoice data is digital invoice data in XML format. By parsing the data nodes in the XML file, several node information that can be used for visualization can be obtained. This node information includes various information on the invoice, such as the invoice name, invoice code and number, number of copies and purpose (purchase and sales details), invoice date, stamp, etc.
[0056] Step S22: Determine the visualization page format according to the visualization instructions, and generate corresponding page configuration information according to the visualization page format;
[0057] In this step, the visualization page formats include PDF and OFD. For different formats, the corresponding page building plugin can be used to generate page configuration information.
[0058] For OFD format, different elements of images and text have corresponding display tags, such as MediaFile for images and TextCode for text. When generating page configuration information, the page building plugin Freemark can be used to define variable names. The variable names are placed in the tags to form a configuration file, and various digital content objects such as text and images are fixed in the layout according to certain rules. In subsequent step S24, Freemark can be used to uniformly replace the tags in the configuration file to generate a visual page.
[0059] For PDF format, an HTML page can be generated first. Specifically, the HTML page provides different display elements such as text and tables. Combined with CSS styles, the information on the electronic invoice is drawn into a page that meets the layout requirements. Then, the ITextRenderer provided by the page building plugin IText is used to convert the HTML page into a PDF file.
[0060] Step S23: Obtain target node information from the displayable node information and obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the associated information.
[0061] In this embodiment, the QR code mainly includes key invoice information, which is dynamically generated based on the current digital invoice. The target node information is the key invoice information in the displayable node information, while the associated information mainly refers to the tax bureau's seal.
[0062] Accordingly, in some embodiments, the step of obtaining the association information of the digital invoice and generating a QR code based on the target node information and the association information includes: extracting the taxpayer's coding information from the displayable node information; dynamically obtaining the tax bureau seal based on the coding information to obtain the association information of the digital invoice; and generating a QR code based on the target node information and the tax bureau seal. The generated QR code will contain a tax bureau icon in the middle to improve the identification of the invoice's source. For different types of digital invoices, the tax bureau seal will be dynamically switched according to the tax bureau code. Each taxpayer has a corresponding tax bureau code, and the second to fifth digits of the tax bureau code are the regional code. By pre-obtaining tax bureau seals from different regions and naming the seals according to the regional codes, when generating the QR code, the taxpayer is obtained based on the parsed node information, and the corresponding tax bureau code is searched to obtain the specified tax bureau seal.
[0063] Step S24: Generate a digital invoice visualization page using the displayable node information and the page configuration information, and merge and display the QR code at the target position on the visualization page.
[0064] In this step, the visual page and QR code can be overlaid using the Java built-in object Graphics2D to generate the final display page.
[0065] In some embodiments, such as Figure 3 As shown, the step of generating a digital invoice visualization page using the displayable node information and the page configuration information includes:
[0066] Step S31: Obtain the page display element tags in the page configuration information, and determine the final displayed node information from the displayable node information through the page display element tags; in this step, specifically, the name matching the page display element tags is searched from the node information through the page display element tags to determine the final displayed node information.
[0067] Step S32: Determine whether to adjust the page configuration information based on the final displayed node information. If yes, proceed to step S33; otherwise, proceed to step S34.
[0068] Step S33: Adjust the page configuration information and generate a visual page for the digital invoice based on the final displayed node information and the adjusted page configuration information.
[0069] Step S34: Generate a visualization page for the digital invoice based on the final displayed node information and the page configuration information.
[0070] For step S32, as Figure 4 As shown, the step of determining whether to adjust the page configuration information based on the finally displayed node information includes:
[0071] Step S41: Obtain the purchase and sales details in the final displayed node information, and determine its display range on the visualization page based on the purchase and sales details;
[0072] Step S42: Determine whether the display range exceeds the pre-configured display range in the page configuration information. If yes, proceed to step S43; otherwise, proceed to step S44.
[0073] Step S43 adjusts the page configuration information;
[0074] Step S44: Do not adjust the page configuration information. Different digital invoices have different purchase and sales details, so their display range will vary. Therefore, to ensure complete visualization, the configuration file can be adjusted according to the actual display range to improve the visualization effect.
[0075] In some embodiments, for step S41, such as Figure 5 As shown, the step of determining the display scope of the purchase and sales details on the visualization page includes:
[0076] Step S51: Obtain the display row height, column width, character space width, and font size information of the purchase and sales details;
[0077] Step S52: Determine which purchase and sales details can be displayed on a new line in the purchase and sales details. Based on the display row height and column width, determine whether each purchase and sales detail that can be displayed on a new line needs to be displayed on a new line. If so, display it on a new line to obtain the final display height and the first display range.
[0078] Step S53: Adjust the character space and font size of the non-wrapable purchase and sales details according to the character space width and font size information to obtain the second display area;
[0079] Step S54: Determine the display range of the purchase and sales details on the visualization page based on the first display range and the second display range.
[0080] In this embodiment, for steps S51 and S52, regarding the display row height, for standard layout documents, the height of each row of invoice purchase and sales details is fixed at 4.5 units. Some column widths are also fixed units; for example, the item name length is fixed at 37 units, with Chinese characters occupying 3.175 units and non-Chinese characters occupying 1.5875 units each. The final number of rows to be displayed for the purchase and sales name is determined through calculation. For the display column width, each column width is also fixed; for example, the item name length is fixed at 37 units, and the specification / model length is 24 units, with Chinese characters occupying 3.175 units and non-Chinese characters occupying 1.5875 units each. The total length occupied by the current content can be obtained, thus dividing and displaying it on separate lines. Combined with the total number of purchase and sales details, the total number of rows in the current invoice is determined to obtain the height of the purchase and sales details area, thus obtaining the first display range. This first display range determines the total height of the visualized electronic invoice.
[0081] Regarding the character placement width, setting an unreasonable character width can lead to excessive character spacing or character overlap. The system identifies whether a character is Chinese or not based on its Unicode encoding, setting the width to 3.175 units for Chinese characters and 1.5875 units for each non-Chinese character. For the font size, since the total number of digits for unit price and quantity is limited to a maximum of 17, including the decimal point (maximum length 18), and each column width is 25 units, with numbers occupying 1.5875 units, the maximum display size is 15 digits. Exceeding 15 digits will result in incomplete display and character overlap. If the total content length is less than or equal to 15 digits, the font size is 3.175; if it exceeds 15 digits, the font size is set to 2.8222. By combining adjustments to the character placement width and font size, a second display area can be achieved.
[0082] The above steps enable automatic line breaks and downward expansion of the height of multiple purchase and sales details on digital invoices, as well as dynamic adaptation of the width of Chinese characters, letters, numbers, and other content in the digital invoice information and dynamic automatic adjustment of font size.
[0083] In some embodiments, after generating the visualization page for digital invoices, the method further includes: saving the address of the visualization page that integrates the QR code or generating and saving an access QR code based on the address of the visualization page that integrates the QR code, so that target users can view the visualization page through the address or the access QR code. This step enables rapid distribution of the visualization page and access from multiple clients, improving user viewing efficiency.
[0084] Compared with the prior art, the embodiments of this application have the following main advantages:
[0085] This application embodiment obtains node information of structured digital invoice data, generates page configuration information according to the required visualization page format, generates a QR code based on the target node information and the associated information, and generates a visualization page based on the node information, page configuration information and QR code, thereby enabling users to quickly view invoice information of digital invoices presented in structured data, improving convenience and saving time.
[0086] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0087] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0088] Further reference Figure 6 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a digital invoice visualization device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0089] like Figure 6 As shown, the digital invoice visualization device described in this embodiment includes: a node information acquisition module 601, a configuration information acquisition module 602, a QR code generation module 603, and a visualization page generation module 604. Wherein:
[0090] The node information acquisition module 601 is used to receive visualization instructions for digital invoices, acquire structured digital invoice data according to the visualization instructions, parse the nodes of the structured digital invoice data, and obtain several displayable node information; the configuration information acquisition module 602 is used to determine the visualization page format according to the visualization instructions, and generate corresponding page configuration information according to the visualization page format; the QR code generation module 603 is used to acquire target node information from the displayable node information, acquire the association information of the digital invoice, and generate a QR code according to the target node information and the association information; the visualization page generation module 604 is used to generate a digital invoice visualization page through the displayable node information and the page configuration information, and merge and display the QR code at the target position of the visualization page.
[0091] In some embodiments, when the visualization page generation module 604 generates a digital invoice visualization page using the displayable node information and the page configuration information, it is specifically configured to: obtain page display element tags in the page configuration information; determine the final displayable node information from the displayable node information using the page display element tags; determine whether to adjust the page configuration information based on the final displayable node information; if so, adjust the page configuration information; and generate a digital invoice visualization page based on the final displayable node information and the adjusted page configuration information; otherwise, directly generate a digital invoice visualization page based on the final displayable node information and the page configuration information.
[0092] In some embodiments, when the visualization page generation module 604 determines whether to adjust the page configuration information based on the final displayed node information, it is specifically used to: obtain the purchase and sales details in the final displayed node information, determine its display range on the visualization page based on the purchase and sales details, determine whether the display range exceeds the pre-configured display range in the page configuration information, and if so, adjust the page configuration information; otherwise, do not adjust it.
[0093] In some embodiments, when the visualization page generation module 604 determines the display range of the purchase and sales details on the visualization page, it is specifically used to: obtain the display row height, column width, character space width, and font size information of the purchase and sales details; determine the purchase and sales details that can be displayed on a new line, and determine whether each purchase and sales detail that can be displayed on a new line needs to be displayed on a new line based on the display row height and column width. If so, display it on a new line to obtain the final display height and obtain a first display range; adjust the character space width and font size of the purchase and sales details that cannot be displayed on a new line based on the character space width and font size information to obtain a second display range; and determine the display range of the purchase and sales details on the visualization page based on the first display range and the second display range.
[0094] In some embodiments, when the QR code generation module 603 obtains the associated information of the digital invoice and generates a QR code based on the target node information and the associated information, it is specifically used to: extract the taxpayer's coding information from the displayable node information, dynamically obtain the tax bureau's seal based on the coding information, obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the tax bureau's seal.
[0095] In some embodiments, after generating the visualization page of the digital invoice, the visualization page generation module 604 is further configured to: save the address of the visualization page that combines and displays the QR code, or generate and save an access QR code based on the address of the visualization page that combines and displays the QR code, so that the target user can view the visualization page through the address or the access QR code.
[0096] When the above modules perform related operations, the specific technical content involved in each operation can be referred to the relevant content in the above method embodiments, which will not be elaborated here.
[0097] Compared with the prior art, the embodiments of this application have the following main advantages:
[0098] This application embodiment obtains node information of structured digital invoice data, generates page configuration information according to the required visualization page format, generates a QR code based on the target node information and the associated information, and generates a visualization page based on the node information, page configuration information and QR code, thereby enabling users to quickly view invoice information of digital invoices presented in structured data, improving convenience and saving time.
[0099] To address the aforementioned technical problems, this application also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the digital invoice visualization method described above, and achieves the corresponding technical effects.
[0100] Please refer to the details. Figure 7 , Figure 7 This is a basic structural block diagram of the computer device in this embodiment. The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected via a system bus. It should be noted that only the computer device 7 with components 71-73 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0101] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0102] The memory 71 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 71 may be an internal storage unit of the computer device 7, such as the hard disk or memory of the computer device 7. In other embodiments, the memory 71 may also be an external storage device of the computer device 7, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 7. Of course, the memory 71 may also include both the internal storage unit and its external storage device of the computer device 7. In this embodiment, the memory 71 is typically used to store the operating system and various application software installed on the computer device 7, such as the program code of the digital invoice visualization method. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or will be output.
[0103] In some embodiments, the processor 72 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 72 is typically used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run program code stored in the memory 71 or process data, for example, to run the program code of the digital invoice visualization method.
[0104] The network interface 73 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 7 and other electronic devices.
[0105] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program that can be executed by at least one processor to perform the steps of the above-described digital invoice visualization method, thereby achieving the corresponding technical effects.
[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0107] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for visualizing digital invoices, characterized in that, The method includes: Receive visualization instructions for digital invoices, obtain structured digital invoice data according to the visualization instructions, parse the nodes of the structured digital invoice data, and obtain several displayable node information; The visualization page format is determined according to the visualization instructions, and corresponding page configuration information is generated according to the visualization page format. Obtain target node information from the displayable node information, and obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the associated information; A digital invoice visualization page is generated using the displayable node information and the page configuration information, and the QR code is displayed in the target position on the visualization page. The step of generating a digital invoice visualization page using the displayable node information and the page configuration information includes: Obtain the page display element tags from the page configuration information, and determine the final display node information from the displayable node information using the page display element tags; Based on the final displayed node information, determine whether to adjust the page configuration information. If so, adjust the page configuration information and generate a visualization page for the digital invoice based on the final displayed node information and the adjusted page configuration information. Otherwise, directly generate a visualization page for the digital invoice based on the final displayed node information and the page configuration information. The step of determining whether to adjust the page configuration information based on the final displayed node information includes: obtaining the purchase and sales details in the final displayed node information, determining its display range on the visualization page based on the purchase and sales details, determining whether the display range exceeds the pre-configured display range in the page configuration information, and if so, adjusting the page configuration information; otherwise, not adjusting it.
2. The method for visualizing digital invoices according to claim 1, characterized in that, The step of determining the display scope of the purchase and sales details on the visualization page includes: Obtain the display row height, column width, character space width, and font size information of the purchase and sales details; Determine which purchase and sales details can be displayed on a new line in the purchase and sales details. Based on the display row height and column width, determine whether each purchase and sales detail that can be displayed on a new line needs to be displayed on a new line. If it needs to be displayed on a new line, then display it on a new line to obtain the final display height and the first display range. Based on the character space width and font size information, the character space width and font size of the non-wrapable purchase and sales details are adjusted to obtain the second display area; The display range of the purchase and sales details on the visualization page is determined based on the first display range and the second display range.
3. The method for visualizing digital invoices according to claim 1, characterized in that, The step of obtaining the associated information of the digital invoice and generating a QR code based on the target node information and the associated information includes: Extract the taxpayer's coding information from the displayable node information, dynamically obtain the tax bureau's seal based on the coding information, obtain the association information of the digital invoice, and generate a QR code based on the target node information and the tax bureau's seal.
4. The method for visualizing digital invoices according to claim 1, characterized in that, After generating the visualization page for digital invoices, the method further includes: Save the address of the visualization page that displays the QR code, or generate and save an access QR code based on the address of the visualization page that displays the QR code, so that target users can view the visualization page through the address or the access QR code.
5. A digital invoice visualization device, characterized in that, include: The node information acquisition module is used to receive visualization instructions for digital invoices, acquire structured digital invoice data according to the visualization instructions, parse the nodes of the structured digital invoice data, and obtain several displayable node information. The configuration information acquisition module is used to determine the visualization page format according to the visualization instructions and generate corresponding page configuration information according to the visualization page format. The QR code generation module is used to obtain target node information from the displayable node information and obtain the associated information of the digital invoice, and generate a QR code based on the target node information and the associated information; A visualization page generation module is used to generate a digital invoice visualization page using the displayable node information and the page configuration information, and to merge and display the QR code at the target position on the visualization page; Specifically, when the visualization page generation module generates a digital invoice visualization page using the displayable node information and the page configuration information, it is used for: Obtain the page display element tags from the page configuration information, and determine the final display node information from the displayable node information using the page display element tags; Based on the final displayed node information, determine whether to adjust the page configuration information. If so, adjust the page configuration information and generate a visualization page for the digital invoice based on the final displayed node information and the adjusted page configuration information. Otherwise, directly generate a visualization page for the digital invoice based on the final displayed node information and the page configuration information. And when the visualization page generation module determines whether to adjust the page configuration information based on the final displayed node information, it is specifically used for: Obtain the purchase and sales details from the final displayed node information, determine its display range on the visualization page based on the purchase and sales details, and determine whether the display range exceeds the pre-configured display range in the page configuration information. If so, adjust the page configuration information; otherwise, do not adjust it.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the digital invoice visualization method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the digital invoice visualization method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Intelligent ticket forming model visual display system
CN111881313A
Electronic invoice generation method, device and storage medium
CN112085543A