Electronic invoice stamping method and device, electronic equipment and computer storage medium
By analyzing and parallel processing of enterprise information and page counts of multi-page electronic invoices, and generating and adding electronic stamps, the problem of low efficiency of multi-page electronic invoice stamping in the existing technology is solved, and efficient multi-page stamping operation is achieved.
Patent Information
- Application Number
- CN202411783238.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, when stamping multi-page electronic invoices, continuous stamping cannot be achieved, resulting in low stamping efficiency.
By analyzing the received stamp request, obtain the enterprise information and number of pages of the electronic invoice, and generate electronic stamps based on the enterprise information. When the number of pages is large, the electronic stamps are added to each page in parallel to generate a second electronic invoice.
It realizes continuous stamping of electronic invoices on multiple pages, and improves the efficiency of stamping of electronic invoices on multiple pages.
Smart Images

Figure CN119722203A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an electronic invoice stamping method, device, electronic device and computer storage medium. Background Art
[0002] With the popularization of e-commerce and e-government, electronic invoices have gradually replaced paper invoices and become the main form of transaction records. When electronic invoices are issued, they need to be stamped.
[0003] However, in the prior art, when stamping an electronic invoice, multiple pages of electronic invoices cannot be stamped continuously, and the stamping efficiency is low. Summary of the invention
[0004] In view of this, the embodiments of the present application provide an electronic invoice stamping method, device, electronic device and computer storage medium to at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present application, a method for stamping an electronic invoice is provided, the method comprising:
[0006] Parsing the received stamping request, and obtaining a first electronic invoice carried in the stamping request, wherein the first electronic invoice is sent by the client;
[0007] Parsing the first electronic invoice to determine the company information and the number of pages of the first electronic invoice;
[0008] Generating an electronic seal corresponding to the enterprise information according to the enterprise information;
[0009] When the number of pages is multiple, the electronic seal is added to each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0010] In some embodiments, the electronic seal includes a digital signature and an electronic seal;
[0011] The parsing of the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice includes:
[0012] The first electronic invoice is parsed to determine the enterprise information, the number of pages and the format type of the first electronic invoice;
[0013] The step of generating an electronic seal corresponding to the enterprise information according to the enterprise information includes:
[0014] According to the format type of the first electronic invoice, determining a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice;
[0015] Generating the digital signature corresponding to the enterprise information according to the target digital signature encryption algorithm;
[0016] Determining the electronic seal corresponding to the enterprise information;
[0017] The digital signature and the electronic seal are merged to generate the electronic seal.
[0018] In some embodiments, the format type includes PDF format and OFD format, and the digital signature encryption algorithm includes RSA and SM3;
[0019] Determining, according to the format type of the first electronic invoice, a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice, including:
[0020] If it is determined that the format type of the first electronic invoice is the PDF format, determine that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is the RSA;
[0021] If it is determined that the format type of the first electronic invoice is the OFD format, it is determined that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is the SM3.
[0022] In some embodiments, when the number of pages is multiple, adding the electronic stamp to each page of the first electronic invoice in parallel to generate a second electronic invoice includes:
[0023] Obtaining the enterprise information;
[0024] Determining a setting position of the electronic seal corresponding to the enterprise information;
[0025] When the number of pages is multiple, the electronic stamp is added to the set position of each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0026] In some embodiments, before generating an electronic seal corresponding to the enterprise information according to the enterprise information, the method further includes:
[0027] Obtaining each page of the first electronic invoice;
[0028] Saving each of the pages into memory;
[0029] When the number of pages is multiple, adding the electronic seal to each page of the first electronic invoice in parallel to generate a second electronic invoice includes:
[0030] When the number of pages is multiple,
[0031] The electronic invoice is stored in the electronic invoice, and the electronic seal is added to each page of the first electronic invoice to generate a second electronic invoice.
[0032] In some embodiments, before generating an electronic seal corresponding to the enterprise information according to the enterprise information, the method further includes:
[0033] Verifying the enterprise information;
[0034] When the verification is passed, the step of generating an electronic seal corresponding to the enterprise information is performed based on the enterprise information.
[0035] In some embodiments, the method further comprises:
[0036] Obtaining the second electronic invoice;
[0037] encrypting the second electronic invoice;
[0038] The encrypted second electronic invoice is sent to the client.
[0039] According to a second aspect of the embodiment of the present application, there is provided an electronic invoice stamping device, characterized in that the device comprises:
[0040] A first parsing module, configured to parse the received stamping request and obtain a first electronic invoice carried in the stamping request, wherein the first electronic invoice is sent by the client;
[0041] A second parsing module, configured to parse the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice;
[0042] A generating module, used for generating an electronic seal corresponding to the enterprise information according to the enterprise information;
[0043] The stamping module is used to add the electronic stamp to each page of the first electronic invoice in parallel to generate a second electronic invoice when the number of pages is multiple.
[0044] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, wherein the executable instruction enables the processor to perform operations corresponding to the electronic invoice stamping method as described in the first aspect.
[0045] According to a fourth aspect of the embodiments of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the electronic invoice stamping method as described in the first aspect is implemented.
[0046] According to the electronic invoice stamping method provided by the embodiment of the present application, firstly, a stamping request sent by a client is received, the stamping request is parsed, the first electronic invoice to be stamped is obtained, and the first electronic invoice is parsed to determine the enterprise information and the number of pages of the first electronic invoice, and further, based on the enterprise information, an electronic stamp corresponding to the enterprise information is generated; when the number of pages is multiple, the electronic stamp is added to each page of the first electronic invoice in parallel to generate a second electronic invoice. By stamping each page of the first electronic invoice in parallel, the present application can stamp electronic invoices with multiple pages, thereby improving the stamping efficiency of electronic invoices with multiple pages. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0048] Figure 1 A flowchart of a method for stamping an electronic invoice according to an embodiment of the present application;
[0049] Figure 2 A flowchart of a method for stamping an electronic invoice according to another embodiment of the present application;
[0050] Figure 3 A structural block diagram of a verification code generating device according to an embodiment of the present application;
[0051] Figure 4 A schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0053] The specific implementation of the embodiment of the present application is further explained below in conjunction with the accompanying drawings of the embodiment of the present application.
[0054] The present application embodiment provides an electronic invoice stamping method, which is applied to the server side. The specific steps are as follows: Figure 1 As shown, including:
[0055] S101, the server parses the received stamping request and obtains the first electronic invoice carried in the stamping request.
[0056] In an embodiment of the present application, when an electronic invoice needs to be stamped, the user will upload the electronic invoice to the client, and then the client will generate a stamping request based on the first electronic invoice, and send the stamping request to the server. The server receives the stamping request sent by the client, parses the stamping request, and determines the first electronic invoice carried in the stamping request.
[0057] In one example, when the client generates a stamping request based on the first electronic invoice, the first electronic invoice can be encrypted to obtain the stamping request to increase the security of data transmission. After receiving the encrypted stamping request, the server decrypts the stamping request to obtain the first electronic invoice.
[0058] S102, the server parses the first electronic invoice to determine the company information and the number of pages of the first electronic invoice.
[0059] In the embodiment of the present application, after receiving the first electronic invoice, the server parses the first electronic invoice to confirm the enterprise information recorded in the first electronic invoice and the number of pages of the first electronic invoice.
[0060] S103, the server generates an electronic seal corresponding to the enterprise information based on the enterprise information.
[0061] In an embodiment of the present application, after the server determines the enterprise information corresponding to the first electronic invoice, the server generates an electronic seal corresponding to the enterprise information based on the enterprise information, so as to stamp the first electronic invoice with the electronic seal.
[0062] S104: When the server determines that there are multiple pages, it adds the electronic seal to each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0063] In the embodiment of the present application, after obtaining the number of pages of the first electronic invoice, the server determines whether the first electronic invoice is a single page or multiple pages. After determining that the number of pages is multiple, the server performs the stamping operation in parallel, and adds the electronic stamp to each page of the first electronic invoice in parallel to generate the second electronic invoice. That is, the server performs the stamping operation on multiple pages of the first electronic invoice at the same time to improve the stamping efficiency.
[0064] In one example, if the server determines that the number of pages of the first electronic invoice is a single page, the server adds an electronic seal to the page of the first electronic invoice to generate a second electronic invoice.
[0065] The electronic invoice stamping method provided in the embodiment of the present application first receives a stamping request sent by a client, parses the stamping request, obtains a first electronic invoice that needs to be stamped, and parses the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice, and further generates an electronic stamp corresponding to the enterprise information based on the enterprise information; when the number of pages is multiple, the electronic stamp is added to each page of the first electronic invoice in parallel to generate a second electronic invoice. The present application can stamp electronic invoices with multiple pages by stamping each page of the first electronic invoice in parallel, thereby improving the stamping efficiency of electronic invoices with multiple pages.
[0066] Furthermore, the electronic seal of the embodiment of the present application includes a digital signature and an electronic seal, and parsing the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice may include the following steps:
[0067] S1021, the server parses the first electronic invoice to determine the enterprise information, number of pages and format type of the first electronic invoice.
[0068] In the embodiment of the present application, when the server parses the first electronic invoice, it can obtain the enterprise information and the number of pages of the first electronic invoice and also obtain the format type of the first electronic invoice. Specifically, the format type of the first electronic invoice can include PDF format and OFD format.
[0069] Generating an electronic seal corresponding to the enterprise information according to the enterprise information may include the following steps:
[0070] S1031, the server determines a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice according to the format type of the first electronic invoice.
[0071] In an embodiment of the present application, after determining the format type of the first electronic invoice, the server determines a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice from multiple encryption algorithms based on the correspondence between the format type of the first electronic invoice and the digital signature encryption algorithm.
[0072] In one example, the digital encryption algorithms may include RSA and SM3.
[0073] S1032, the server generates a digital signature corresponding to the enterprise information according to the target digital signature encryption algorithm.
[0074] In an embodiment of the present application, after determining the target digital signature encryption algorithm, the server uses the target digital signature encryption algorithm to generate a digital signature corresponding to the enterprise information.
[0075] In one example, if the server determines that the format type of the first electronic invoice is PDF, it determines that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is RSA, and generates a digital signature based on RSA; if the server determines that the format type of the first electronic invoice is OFD, it determines that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is SM3, and generates a digital signature based on SM3. Then, by determining the corresponding digital signature encryption algorithm according to the format type of the first electronic invoice, the encryption algorithm can be accurately determined, and the accuracy of generating a digital signature can be improved.
[0076] S1033, the server determines the electronic seal corresponding to the enterprise information.
[0077] In the embodiment of the present application, the server matches the electronic seal corresponding to the enterprise information in the first electronic invoice in the electronic seal library based on the enterprise information, and then can determine the electronic seal corresponding to the enterprise information.
[0078] S1034, the server integrates the digital signature and the electronic seal to generate an electronic seal.
[0079] In the embodiment of the present application, after obtaining the digital signature and the electronic seal, the server merges the digital signature and the electronic seal to generate an electronic seal, and uses the electronic seal to stamp each page of the first electronic invoice.
[0080] This application obtains the format type of the first electronic invoice by parsing the first electronic invoice, and then can select the corresponding digital signature encryption algorithm according to the format type of the first electronic invoice to generate a digital signature, and further merge the electronic seal and digital signature corresponding to the enterprise information to obtain an electronic seal, so that the digital signature of the electronic seal can be used to improve the security of the electronic invoice. Furthermore, by using the electronic seal to stamp each page of the first electronic invoice in parallel, the electronic invoice of multiple pages can be stamped, thereby improving the stamping efficiency of the electronic invoice of multiple pages.
[0081] Furthermore, in the embodiment of the present application, when there are multiple pages, adding an electronic stamp to each page of the first electronic invoice in parallel to generate a second electronic invoice may include the following steps:
[0082] S1041, the server obtains enterprise information.
[0083] In the embodiment of the present application, when stamping each page of the first electronic invoice, the corporate information of the first electronic invoice is first obtained.
[0084] S1042: The server determines the setting position of the electronic seal corresponding to the enterprise information.
[0085] In the embodiment of the present application, the server determines the set position of the electronic seal corresponding to the enterprise information based on the correspondence between the enterprise information and the position of the electronic seal. Specifically, the user can configure the position of the electronic seal in the first electronic invoice on the client. After the configuration is completed, the server binds the enterprise information and the configured position and saves them. When stamping the first electronic invoice, the server determines the set position of the electronic seal corresponding to the enterprise information based on the correspondence between the enterprise information and the position of the electronic seal.
[0086] In one example, if the server determines that the enterprise information does not have a corresponding electronic seal position, the server determines the electronic seal position as a system preset position, and uses the system preset position to add the electronic seal to each page of the first electronic invoice.
[0087] S1043, when there are multiple pages, the server adds the electronic stamp to the set position of each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0088] In the embodiment of the present application, when the server determines that there are multiple pages, the server performs stamping operations in parallel, and adds electronic stamps to set positions of each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0089] The embodiment of the present application can accurately determine the stamping position of the electronic seal based on the correspondence between the enterprise information and the set position of the electronic seal, so that the stamping operation can be performed based on user needs, thereby improving the flexibility of stamping.
[0090] Furthermore, before generating an electronic seal corresponding to the enterprise information according to the enterprise information, the embodiment of the present application may further include the following steps:
[0091] S105: The server obtains each page of the first electronic invoice.
[0092] In the embodiment of the present application, after parsing the first electronic invoice, the server obtains each page of the first electronic invoice, specifically, obtains the data recorded on each page of the first electronic invoice.
[0093] In one example, when the server obtains each page of the first electronic invoice, it can also add unique index information to each page so that different pages of the first electronic invoice can be retrieved, thereby avoiding the need to traverse each page when retrieving a specified page of the first electronic invoice, thereby improving the page access speed of the first electronic invoice.
[0094] S106, the server saves each page into memory.
[0095] In the embodiment of the present application, after obtaining each page of the first electronic invoice, the server saves each page into its own memory, so that when there are multiple pages, each page of the first electronic invoice is obtained in the memory, and the electronic stamp is added to each page of the first electronic invoice in parallel to generate the second electronic invoice. By reading the pages of the first electronic invoice in the memory, the reading speed of the first electronic invoice is improved, thereby improving the stamping efficiency.
[0096] In one example, after the server adds unique index information to each page, the server saves the page index information of the first electronic invoice in its own memory, so that when retrieving a specified page of the first electronic invoice, the index information can be quickly read in the memory to use the index information to jump to the specified interface of the first electronic invoice, thereby improving the retrieval speed of the first electronic invoice.
[0097] Furthermore, the embodiment of the present application may also include the following steps:
[0098] S107, verifying the enterprise information.
[0099] In the embodiment of the present application, after the server parses the first electronic invoice to obtain the enterprise information, it verifies the enterprise information to determine whether there is any error in the enterprise information, and generates an electronic seal corresponding to the enterprise information based on the enterprise information when the verification passes. By verifying the enterprise information, the correctness of the first electronic invoice can be identified, and then the stamping of the first electronic invoice with errors can be avoided, thereby improving the accuracy of the stamping.
[0100] Furthermore, the embodiment of the present application may also include the following steps:
[0101] S108: The server obtains the second electronic invoice.
[0102] In the embodiment of the present application, after generating the second electronic invoice, the server obtains the generated second electronic invoice.
[0103] S109, the server encrypts the second electronic invoice.
[0104] In the embodiment of the present application, the server obtains a pre-stored encryption algorithm and encrypts the second electronic invoice to ensure the security of the second electronic invoice.
[0105] S110, the server sends the encrypted second electronic invoice to the client.
[0106] In the embodiment of the present application, after completing the encryption of the second electronic invoice, the server sends the second electronic invoice to the client to complete the stamping of the first electronic invoice.
[0107] Furthermore, the present application embodiment provides another electronic invoice stamping method, the specific steps are as follows: Figure 2 As shown, including:
[0108] The server parses the received stamping request, obtains the first electronic invoice carried in the stamping request, and parses the first electronic invoice to determine the enterprise information, number of pages, and format type of the first electronic invoice. After parsing the first electronic invoice to obtain the enterprise information, the server verifies the enterprise information. When the verification passes, the server determines the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice from multiple encryption algorithms based on the correspondence between the format type of the first electronic invoice and the digital signature encryption algorithm, and generates a digital signature corresponding to the enterprise information using the target digital signature encryption algorithm. Further, the server obtains each page of the first electronic invoice and saves each page to its own memory.
[0109] Based on the enterprise information, the server matches the electronic seal corresponding to the enterprise information in the first electronic invoice in the electronic seal library. After obtaining the digital signature and the electronic seal, the server merges the digital signature and the electronic seal to generate an electronic seal.
[0110] Based on the correspondence between the enterprise information and the position of the electronic seal, the server determines the set position of the electronic seal corresponding to the enterprise information. When the first electronic invoice has multiple pages, the server obtains each page of the first electronic invoice in the memory, and adds the electronic seal to the set position of each page of the first electronic invoice in parallel to generate a second electronic invoice.
[0111] The server obtains a pre-stored encryption algorithm, encrypts the second electronic invoice, and sends the second electronic invoice to the client to complete the stamping of the first electronic invoice.
[0112] The electronic invoice stamping method of this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a mobile phone, a PAD, etc.) and a PC, etc.
[0113] Furthermore, the present application provides an electronic invoice stamping device, specifically Figure 3 As shown, the device comprises:
[0114] The first parsing module 301 is used to parse the received stamping request and obtain the first electronic invoice carried in the stamping request, wherein the first electronic invoice is sent by the client;
[0115] The second parsing module 302 is used to parse the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice;
[0116] The generating module 303 is used to generate an electronic seal corresponding to the enterprise information according to the enterprise information;
[0117] The stamping module 304 is used to add an electronic stamp to each page of the first electronic invoice in parallel to generate a second electronic invoice when there are multiple pages.
[0118] The electronic invoice stamping device of this embodiment is used to implement the corresponding electronic invoice stamping methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the electronic invoice stamping device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.
[0119] Reference Figure 4 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0120] like Figure 4 As shown, the electronic device may include: a processor (processor) 402, a communication interface (Communications Interface) 404, a memory (memory) 406, and a communication bus 408.
[0121] in:
[0122] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .
[0123] The communication interface 404 is used to communicate with other electronic devices or servers.
[0124] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned electronic invoice stamping method embodiment.
[0125] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0126] The processor 402 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0127] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0128] The program 410 can be specifically used to enable the processor 402 to perform the following operations: In an optional implementation, the program 410 is also used to enable the processor 402 to perform the following operations: The specific implementation of each step in the program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned electronic invoice stamping method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0129] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any electronic invoice stamping method in the above-mentioned multiple method embodiments.
[0130] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0131] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an AS IC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (for example, RAM, ROM, flash memory, etc.) that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the electronic invoice stamping method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the electronic invoice stamping method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the electronic invoice stamping method shown herein.
[0132] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0133] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A method for stamping an electronic invoice, characterized in that: The method comprises: Parsing the received stamping request, and obtaining a first electronic invoice carried in the stamping request, wherein the first electronic invoice is sent by the client; Parsing the first electronic invoice to determine the company information and the number of pages of the first electronic invoice; Generating an electronic seal corresponding to the enterprise information according to the enterprise information; When the number of pages is multiple, the electronic seal is added to each page of the first electronic invoice in parallel to generate a second electronic invoice.
2. The method according to claim 1, characterized in that: The electronic seal includes a digital signature and an electronic seal; The parsing of the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice includes: The first electronic invoice is parsed to determine the enterprise information, the number of pages and the format type of the first electronic invoice; The step of generating an electronic seal corresponding to the enterprise information according to the enterprise information includes: According to the format type of the first electronic invoice, determining a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice; Generating the digital signature corresponding to the enterprise information according to the target digital signature encryption algorithm; Determining the electronic seal corresponding to the enterprise information; The digital signature and the electronic seal are merged to generate the electronic seal.
3. The method according to claim 2, characterized in that The format types include PDF format and OFD format, and the digital signature encryption algorithms include RSA and SM3; Determining, according to the format type of the first electronic invoice, a target digital signature encryption algorithm corresponding to the format type of the first electronic invoice, including: If it is determined that the format type of the first electronic invoice is the PDF format, determine that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is the RSA; If it is determined that the format type of the first electronic invoice is the OFD format, it is determined that the target digital signature encryption algorithm corresponding to the format type of the first electronic invoice is the SM3.
4. The method according to claim 1, characterized in that: When the number of pages is multiple, adding the electronic seal to each page of the first electronic invoice in parallel to generate a second electronic invoice includes: Obtaining the enterprise information; Determining a setting position of the electronic seal corresponding to the enterprise information; When the number of pages is multiple, the electronic stamp is added to the set position of each page of the first electronic invoice in parallel to generate a second electronic invoice.
5. The method according to claim 1, characterized in that Before generating an electronic seal corresponding to the enterprise information according to the enterprise information, the method further includes: Obtaining each page of the first electronic invoice; Saving each of the pages into memory; When the number of pages is multiple, adding the electronic seal to each page of the first electronic invoice in parallel to generate a second electronic invoice includes: When the number of pages is multiple, each page of the first electronic invoice is obtained in the memory, and the electronic seal is added to each page of the first electronic invoice in parallel to generate a second electronic invoice.
6. The method according to claim 1, characterized in that Before generating an electronic seal corresponding to the enterprise information according to the enterprise information, the method further includes: Verifying the enterprise information; When the verification is passed, the step of generating an electronic seal corresponding to the enterprise information is performed based on the enterprise information.
7. The method according to claim 1, characterized in that The method further comprises: Obtaining the second electronic invoice; encrypting the second electronic invoice; The encrypted second electronic invoice is sent to the client.
8. An electronic invoice stamping device, characterized in that: The device comprises: A first parsing module, configured to parse the received stamping request and obtain a first electronic invoice carried in the stamping request, wherein the first electronic invoice is sent by the client; A second parsing module, configured to parse the first electronic invoice to determine the enterprise information and the number of pages of the first electronic invoice; A generating module, used for generating an electronic seal corresponding to the enterprise information according to the enterprise information; The stamping module is used to add the electronic stamp to each page of the first electronic invoice in parallel to generate a second electronic invoice when the number of pages is multiple.
9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the electronic invoice stamping method according to any one of claims 1-7.
10. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the electronic invoice stamping method as described in any one of claims 1 to 7.