Digital electronic invoice processing method and device

By slicing and key encapsulating the initial data of digital electronic invoices, generating storage packages and decrypting key packages, the problem of low security in the transmission of digital electronic invoices is solved, and data encryption processing and secure transmission are realized.

CN118965424APending Publication Date: 2024-11-15CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410970209.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing digital electronic invoice processing methods are not encrypted during the transmission process, resulting in low security and data leakage and property losses.

Method used

By obtaining the initial data of the digital electronic invoice, slicing process generates a data separation code, segmenting it into multiple data subsets, and encapsulating it using real keys and camouflage keys to generate storage packages and decryption key packages to ensure that the data is Encryption processing during transmission.

Benefits of technology

It improves the security of digital electronic invoices during transmission, prevents data leakage, ensures encrypted processing of data during transmission, and solves the problem of low security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965424A_ABST
    Figure CN118965424A_ABST
Patent Text Reader

Abstract

The invention discloses a digital electronic invoice processing method and device. The method comprises the following steps: acquiring a digital electronic invoice, and determining initial data corresponding to the digital electronic invoice; performing slicing processing on the initial data to obtain data separation codes, performing segmentation processing on the initial data according to the data separation codes to obtain x data subsets, and storing each data subset to a real key corresponding to the data subset to obtain x target keys; determining y camouflage keys, determining a digital electronic invoice storage packet according to the x target keys and the y camouflage keys, and performing packaging processing on the initial data, the length of each data subset and the data separation code to obtain a decryption key packet; and sending the digital electronic invoice storage packet and the decryption key packet to decryption side equipment. According to the method and the device, the technical problem of relatively low security in a transmission process due to the fact that the digital electronic invoice is not encrypted in the transmission process of the digital electronic invoice in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data encryption technology, and more specifically, to a method and device for processing digital electronic invoices. Background Art

[0002] Digital electronic invoices (abbreviated as digital electronic invoices) refer to invoices that are generated, transmitted, stored and managed electronically. Compared with traditional paper invoices, they have the following characteristics and advantages: Electronic processing: Digital electronic invoices exist entirely in electronic form and can be generated, transmitted and managed through computer systems or special software without the need for paper media; Real-time and efficiency: Digital electronic invoices can be generated and transmitted in real time, which speeds up the settlement and reimbursement process and improves the efficiency of business processing; Cost saving: Compared with paper invoices, digital electronic invoices save the costs of printing, mailing, storage and other links, which has cost advantages for both enterprises and individuals; Environmental friendliness: Reducing the use of paper and printed materials is conducive to reducing the impact on the environment and is in line with the concept of sustainable development; Data accuracy: Digital electronic invoices are generated and managed through electronic systems, which can reduce human errors and improve the accuracy and integrity of data. In actual applications, digital electronic invoices are usually generated and managed through a dedicated electronic invoice platform or system, with security features such as digital signatures, timestamps, and anti-tampering to ensure the authenticity and legality of invoices. In addition, the specifications and requirements for digital electronic invoices may vary from country to country, and they need to be operated and managed in accordance with local laws, regulations and relevant standards.

[0003] However, in the relevant digital electronic invoice processing method, the digital electronic invoice is only compressed and transmitted, and is not encrypted. If the digital electronic invoice is not sent to the corresponding recipient, it will lead to data leakage and cause property loss.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method and device for processing digital electronic invoices, so as to at least solve the technical problem that the digital electronic invoices are not encrypted during the transmission process of the related technology, resulting in low security during the transmission process.

[0006] According to one aspect of an embodiment of the present application, a method for processing digital electronic invoices is provided, including: obtaining a digital electronic invoice, determining initial data corresponding to the digital electronic invoice; slicing the initial data to obtain a data separation code, and segmenting the initial data according to the data separation code to obtain x data subsets, where x is a positive integer; obtaining a real key corresponding to each data subset to obtain x real keys, storing each data subset to the real key corresponding to it to obtain x target keys; determining y camouflage keys, determining a digital electronic invoice storage package according to the x target keys and the y camouflage keys, and encapsulating the initial data, the length of each data subset and the data separation code to obtain a decryption key package, where y is a positive integer greater than 1; sending the digital electronic invoice storage package and the decryption key package to a decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0007] Optionally, the initial data is sliced ​​to obtain a data separation code, including: obtaining a random length of a data slice based on which the initial data is sliced; determining a target length of the data slice based on the random length and a preset value; determining a position of the data slice in the initial data based on the target length; and generating a data separation code based on the position of the data slice in the initial data, wherein the data separation code includes: position information of the position of the data separation code and length information of the data subset where the data separation code is located.

[0008] Optionally, according to the target length, determining the position of the data slice in the initial data includes: determining the initial length of the initial data; filling the target length into a first blank grid to obtain a first grid, wherein the first grid is used to store the target length; filling the initial length into a second blank grid to obtain a second grid, wherein the second grid is used to store the initial length; aligning the first character in the first grid with the first character in the second grid, and after the alignment, reading the data slices in the first grid, wherein the number of data slices is m, and m is a positive integer; when the last character of the u-th data slice is read , determine the uth position corresponding to the last character of the uth data slice, record the uth position, search for the uth position in the second grid, and determine the uth position as the uth position of the data slice in the initial data, where u is a positive integer less than m; when the last character of the mth data slice is read, determine the mth position corresponding to the last character of the mth data slice, record the mth position, search for the mth position in the second grid, and determine the mth position as the mth position of the data slice in the initial data; determine the position of the data slice in the initial data according to the uth position and the mth position in the second grid.

[0009] Optionally, the mth position is determined as the data slice after the mth position in the initial data, and the method also includes: determining whether there is a target character in the second grid, wherein the target character is the character after the mth position; if the target character exists in the second grid, obtaining the target length of the target character; generating random characters of the target length, and filling the random characters of the target length after the mth position in the first grid; determining the first target position of the last character of the random characters of the target length, and recording the first target position, searching for the first target position in the second grid, and determining the first target position as the first target position of the data slice in the initial data; determining the position of the data slice in the initial data according to the uth position, the mth position and the first target position in the second grid.

[0010] Optionally, determining a target length of the data slice according to the random length and a preset value includes: determining the target length of the data slice by the following formula: Among them, D i is the target length of the i-th data slice, k is the preset value, D j is the random length of the j-th data slice, i, j∈[1,n], n is a positive integer.

[0011] Optionally, determining y camouflage keys includes: obtaining the length of each real key, and determining a first total length of x real keys based on the length of each real key; subtracting the total length from the length of initial data to obtain a target value; randomly generating camouflage keys, obtaining a second total length of the camouflage keys, and determining the number of camouflage keys based on the target value and the second total length; when the number of camouflage keys is not a positive integer, repeatedly performing the operations of randomly generating camouflage keys and determining the number of camouflage keys until the number of camouflage keys is a positive integer.

[0012] Optionally, determining the initial data corresponding to the digital electronic invoice includes: determining the invoice type of the digital electronic invoice, wherein the invoice type includes at least one of the following: ordinary electronic invoice, value-added tax electronic invoice, catering service electronic invoice, e-commerce electronic invoice, transportation electronic invoice, machinery and equipment electronic invoice and customized electronic invoice; determining the initial data corresponding to the invoice type, wherein the length of the initial data of different invoice types is different.

[0013] Optionally, determining a digital electronic invoice storage package based on x target keys and y camouflage keys includes: determining a second target position of a data separation code in the initial data; filling the x target keys into a preset grid based on the second target position to obtain a first target grid; filling the y camouflage keys into the first target grid to obtain a second target grid, wherein the length of the second target grid is the same as the length of the initial data; and determining the digital electronic invoice storage package based on the second target grid.

[0014] According to another aspect of the embodiment of the present application, a digital electronic invoice processing method is also provided, including: a decryption side device receives a digital electronic invoice storage package and a decryption key package sent by an encrypted object, wherein the digital electronic invoice storage package and the decryption key package are obtained according to the above digital electronic invoice processing method; the position of a target key in the digital electronic invoice storage package is determined according to a data separation code in the decryption key package, and the target key is extracted according to the position of the target key in the digital electronic invoice storage package; the initial data of the digital electronic invoice and the length of each of the x data subsets obtained by segmenting the initial data of the digital electronic invoice are input into the target key to obtain decrypted data; each data subset is placed at the position of a data slice to obtain a digital electronic invoice.

[0015] According to another aspect of the embodiment of the present application, a digital electronic invoice processing device is also provided, including: a first acquisition module, used to acquire a digital electronic invoice and determine the initial data corresponding to the digital electronic invoice; a processing module, used to slice the initial data to obtain a data separation code, and segment the initial data according to the data separation code to obtain x data subsets, where x is a positive integer; a second acquisition module, used to acquire a real key corresponding to each data subset to obtain x real keys, and store each data subset to the real key corresponding to it to obtain x target keys; a determination module, used to determine y disguised keys, determine a digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, where y is a positive integer greater than 1; a sending module, used to send the digital electronic invoice storage package and the decryption key package to a decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0016] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, the storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the above digital electronic invoice processing method.

[0017] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above digital electronic invoice processing method is executed when the program is run.

[0018] According to another aspect of the embodiments of the present application, a computer program is also provided, wherein the computer program implements the above digital electronic invoice processing method when executed by a processor.

[0019] According to another aspect of the embodiments of the present application, a computer program product is also provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above digital electronic invoice processing method is implemented.

[0020] In the embodiment of the present application, a digital electronic invoice is obtained to determine the initial data corresponding to the digital electronic invoice; the initial data is sliced ​​to obtain a data separation code, and the initial data is segmented according to the data separation code to obtain x data subsets, where x is a positive integer; the real key corresponding to each data subset is obtained to obtain x real keys, and each data subset is stored in the real key corresponding to it to obtain x target keys; y disguised keys are determined, and a digital electronic invoice storage package is determined according to the x target keys and the y disguised keys, and the initial data, the length of each data subset and the data separation code are encapsulated to obtain a decryption key package, where y is a positive integer greater than 1; the digital electronic invoice storage package and the decryption key package are sent to a decryption side device, where the decryption side device is used to decrypt the digital electronic invoice according to the decryption key package. The invoice storage package is decrypted to obtain a digital electronic invoice. Different data separation codes are set to segment the digital electronic invoice into different lengths, and the data separation code is generated randomly, thereby improving the encryption level of the digital electronic invoice. A data subset is stored in a real key, and the real key is placed at the position where the data separation code is cut. If the specific information of the data separation code is not obtained, the position of the real key cannot be locked, and the digital electronic invoice cannot be decrypted, thereby ensuring that data will not be leaked. The purpose of encrypting the digital electronic invoice during the transmission of the digital electronic invoice is achieved, thereby achieving the technical effect of improving the security of the digital electronic invoice during the transmission process, and further solving the technical problem of low security during the transmission process due to the fact that the relevant technology does not encrypt the digital electronic invoice during the transmission of the digital electronic invoice. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0022] Figure 1 is a flow chart of a digital electronic invoice processing method according to an embodiment of the present application;

[0023] Figure 2 is a flow chart of a method for obtaining a data separation code according to an embodiment of the present application;

[0024] Figure 3is a flow chart of a method for determining a position of a data slice in initial data according to an embodiment of the present application;

[0025] Figure 4 is a flow chart of another method for determining the position of a data slice in initial data according to an embodiment of the present application;

[0026] Figure 5 is a flow chart of a method for determining y camouflage keys according to an embodiment of the present application;

[0027] Figure 6 is a flow chart of a method for determining a digital electronic invoice storage package according to an embodiment of the present application;

[0028] Figure 7 is a flow chart of another digital electronic invoice processing method according to an embodiment of the present application;

[0029] Figure 8 is a structural diagram of a digital electronic invoice processing device according to an embodiment of the present application;

[0030] Fig. 9 It is a hardware structure block diagram of a computer terminal of a digital electronic invoice processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution 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. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] According to an embodiment of the present application, a method embodiment of a digital electronic invoice processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0034] Figure 1 is a flow chart of a digital electronic invoice processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0035] Step S102, obtaining the digital electronic invoice and determining the initial data corresponding to the digital electronic invoice.

[0036] According to some optional embodiments of the present application, determining the initial data corresponding to the digital electronic invoice can be achieved by the following method:

[0037] Determine the invoice type of the digital electronic invoice, wherein the invoice type includes at least one of the following: ordinary electronic invoice, value-added tax electronic invoice, catering service electronic invoice, e-commerce electronic invoice, transportation electronic invoice, machinery and equipment electronic invoice, and customized electronic invoice;

[0038] Initial data corresponding to the invoice type is determined, wherein the length of the initial data of different invoice types is different.

[0039] It is understandable that the initial data of electronic invoices of different invoice types are different, so the length of the initial data of different invoice types is different. For example, the initial data of electronic invoices includes the following information: 1. Information of the issuer: including detailed information of the issuer such as company name, tax number, address, telephone number, bank account, etc. 2. Information of the recipient: including the name, tax number, address, telephone number, etc. of the purchaser. 3. Information of goods or services: description, quantity, unit price, tax classification code, etc. of goods or services. 4. Amount information: total amount, tax rate, tax amount, final amount payable, etc. of goods or services. 5. Invoice date: specific date when the invoice is issued. 6. Invoice number: unique identification number of each invoice. 7. Remarks: may include additional instructions for the transaction, promotional information, etc. 8. Payment information: payment method, payment status, etc. 9. Verification code or QR code: encrypted information or QR code used to verify the authenticity of the electronic invoice.

[0040] Step S104, slicing the initial data to obtain a data separation code, and segmenting the initial data according to the data separation code to obtain x data subsets, where x is a positive integer.

[0041] Figure 2This is a flow chart of a method for obtaining a data separation code according to an embodiment of the present application. In step S104, the initial data is sliced ​​to obtain a data separation code, which can be achieved by the following method:

[0042] Step S201, obtaining a random length of a data slice based on which initial data is sliced.

[0043] Step S202, determining a target length of the data slice according to the random length and a preset value.

[0044] Preferably, the target length of the data slice can be determined by the following formula:

[0045]

[0046] Among them, D i is the target length of the i-th data slice, k is the preset value, D j is the random length of the j-th data slice, i, j∈[1,n], n is a positive integer.

[0047] It is understandable that in order to improve confidentiality, when slicing the initial data of the digital electronic invoice, it is necessary to determine the cutting position of the slice. If the length of each cut is the same, confidentiality will be reduced. If one cutting position is cracked, all cutting positions will be determined.

[0048] Therefore, this embodiment introduces a preset value (preset fixed value) to improve confidentiality, and introduces a random length of data slices to make each cut length different. The following is an example using binary. If k is 011111001, the first data slice random length D j Take 011101101, then for k and D j By summing, the position of the first data slice D1 can be determined. The position of the second data slice D2 is not only the sum of k and the random length of the first data slice, but also the random length of the second data slice. In this way, it is not only ensured that the lengths of the data subsets are different, but also that the position of the second data slice cannot be determined based on the random length of the first data slice.

[0049] Step S203: determining the position of the data slice in the initial data according to the target length.

[0050] Figure 3 is a flow chart of a method for determining the position of a data slice in initial data according to an embodiment of the present application. Figure 3 As shown, step S203 can be implemented by the following method.

[0051] Step S301, determining the initial length of the initial data.

[0052] Step S302, filling the target length into the first blank grid to obtain a first grid, wherein the first grid is used to store the target length.

[0053] Step S303, filling the second blank grid with the initial length to obtain a second grid, where the second grid is used to store the initial length.

[0054] That is, the target length of the data slice and the initial length of the initial data are respectively placed in two empty grids to obtain a first grid and a second grid, the first grid stores the target length, and the second grid stores the initial length.

[0055] Step S304, aligning the first character in the first grid with the first character in the second grid, and after the alignment, reading and processing the data slices in the first grid, wherein the number of data slices is m, and m is a positive integer.

[0056] Step S305, when the last character of the u-th data slice is read, determine the u-th position corresponding to the last character of the u-th data slice, record the u-th position, search for the u-th position in the second grid, and determine the u-th position as the u-th position of the data slice in the initial data, where u is a positive integer less than m.

[0057] Step S306, when the last character of the mth data slice is read, determine the mth position corresponding to the last character of the mth data slice, record the mth position, search the mth position in the second grid, and determine the mth position as the mth position of the data slice in the initial data.

[0058] Step S307: Determine the position of the data slice in the initial data according to the u-th position and the m-th position in the second grid.

[0059] That is to say, the first characters of the first grid and the second grid are aligned, the first grid is read and processed, and when the last character of the preset length of the first data slice is read, a mark is made at the same position of the second grid to determine the position of the first data slice, and the preset length of the second data slice is read and processed to determine the position of the second data slice.

[0060] For example, assuming that m=2, when the last character of the first data slice is read, the first position corresponding to the last character of the first data slice is determined, and the first position is recorded, the first position is searched in the second grid, and the first position is determined as the first position of the data slice in the initial data; when the last character of the second data slice is read, the second position corresponding to the last character of the second data slice is determined, and the second position is recorded, the second position is searched in the second grid, and the second position is determined as the second position of the data slice in the initial data; based on the first position and the second position in the second grid, the position of the data slice in the initial data is determined.

[0061] Step S204: Generate a data separation code according to the position of the data slice in the initial data, wherein the data separation code includes: position information of the position where the data separation code is located and length information of the data subset where the data separation code is located.

[0062] Figure 4 is a flow chart of another method for determining the position of a data slice in initial data according to an embodiment of the present application. Figure 4 As shown, after the mth position is determined as the mth position of the data slice in the initial data, the following steps may be performed:

[0063] Step S401, determining whether there is a target character in the second grid, wherein the target character is the character after the mth position.

[0064] Step S402: when the target character exists in the second grid, obtain the target length of the target character.

[0065] Step S403, generating random characters of the target length, and filling the random characters of the target length after the mth position of the first grid.

[0066] Step S404, determine the first target position of the last character of the random character of the target length, record the first target position, search for the first target position in the second grid, and determine the first target position as the first target position of the data slice in the initial data.

[0067] Step S405 , determining the position of the data slice in the initial data according to the u-th position, the m-th position and the first target position in the second grid.

[0068] That is, determine whether there is a character (target character) after the second position in the second grid; if the target character exists in the second grid, obtain the target length of the target character; generate random characters of the target length, and fill the random characters of the target length after the second position in the first grid; determine the first target position of the last character of the random characters of the target length, and record the first target position, search for the first target position in the second grid, and determine the first target position as the first target position of the data slice in the initial data; determine the position of the data slice in the initial data according to the first position, the second position and the first target position in the second grid.

[0069] In short, when the last character in the second grid is read, there are still characters in the first grid, and the end of the second grid is filled with special characters one by one until the data slice in the first grid has the same preset length, the position of the last data slice is determined, and the reading process is terminated;

[0070] It is understandable that the position of the data slice is n groups, but the initial length of the initial data of the digital electronic invoice is limited. Therefore, after reading the last character of the digital electronic invoice, the preset length of the data slice has not been read to the end, and special characters are added to the digital electronic invoice until the last character of the preset length of the data slice is read, and this position is used as the last data slice position. The subsequent preset lengths of data slices are all discarded. When decrypting the digital invoice, you only need to delete the special characters to completely restore the digital electronic invoice.

[0071] Step S106, obtaining the real key corresponding to each data subset to obtain x real keys, and storing each data subset to the real key corresponding thereto to obtain x target keys.

[0072] Step S108, determine y disguised keys, determine the digital electronic invoice storage package based on x target keys and y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, where y is a positive integer greater than 1.

[0073] It should be noted that garbled data is stored in the disguised key.

[0074] Figure 5 is a flow chart of a method for determining y camouflage keys according to an embodiment of the present application. Figure 5 As shown, y camouflage keys can be determined by the following method:

[0075] Step S501, obtaining the length of each real key, and determining a first total length of x real keys according to the length of each real key.

[0076] Step S502, subtract the total length from the length of the initial data to obtain a target value.

[0077] Step S503: randomly generate a disguised key, obtain a second total length of the disguised key, and determine the number of the disguised keys according to the target value and the second total length.

[0078] Step S504: when the number of camouflage keys is not a positive integer, the operations of randomly generating camouflage keys and determining the number of camouflage keys are repeatedly performed until the number of camouflage keys is a positive integer.

[0079] In other words, first determine the data length of the real key and the number of real keys to determine the total data length of all real keys. Second, perform a difference between the initial length and the total data length of all real keys to obtain the remaining data length. Finally, determine the data length of the disguised key and divide the data length of the disguised key by the remaining data length to obtain the number of disguised keys. If the number of disguised keys is not an integer, change the data length of the disguised key until the number of disguised keys is an integer.

[0080] It is worth noting that if the number of disguised keys is not an integer, the grid cannot be completely filled, resulting in the real key not being in the specified position, making the data separation code irrelevant to the real key, and making the subsequent decryption process more complicated.

[0081] Figure 6 is a flow chart of a method for determining a digital electronic invoice storage package according to an embodiment of the present application, such as Figure 6 In step S108, the digital electronic invoice storage package is determined according to the x target keys and the y disguised keys, which can be achieved by the following method:

[0082] Step S601, determining a second target position of the data separation code in the initial data.

[0083] Step S602: fill x target keys into a preset grid according to the second target position to obtain a first target grid.

[0084] Step S603: Fill the y camouflage keys into the first target grid to obtain a second target grid, wherein the length of the second target grid is the same as the length of the initial data.

[0085] Step S604: Determine a digital electronic invoice storage package according to the second target grid.

[0086] In short, by randomly placing the real key and the disguised key into a grid with the same length as the initial data, the location information of the real key can be determined, and then the digital invoice storage package can be obtained.

[0087] Step S110, sending the digital electronic invoice storage package and the decryption key package to the decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0088] The decryption side device determines the location of the real key in the digital invoice storage package based on the data separation code. The initial data length and the data subset length are input into the real key, the real key is decrypted, and the decrypted data is obtained. The decrypted data is decompressed to obtain the data subset. The data subset is placed at the corresponding position according to the data slice position and the data subset length to obtain the complete digital invoice.

[0089] It is worth noting that the real key and the disguised key are placed according to the location information of the data separation code, and the data separation code is randomly generated according to the data slice calculation model, which is random and unreasonable. Therefore, the real key is also random and unreasonable. Only by obtaining the generation rules of the data slice calculation model can the data separation code be cracked. Therefore, even if an unrelated person obtains the digital invoice storage package, he cannot obtain the digital invoice.

[0090] According to the above steps, the digital electronic invoice is obtained to determine the initial data corresponding to the digital electronic invoice; the initial data is sliced ​​to obtain a data separation code, and the initial data is segmented according to the data separation code to obtain x data subsets, where x is a positive integer; the real key corresponding to each data subset is obtained to obtain x real keys, and each data subset is stored in the real key corresponding to it to obtain x target keys; y disguised keys are determined, and the digital electronic invoice storage package is determined according to the x target keys and the y disguised keys, and the initial data, the length of each data subset and the data separation code are encapsulated to obtain a decryption key package, where y is a positive integer greater than 1; the digital electronic invoice storage package and the decryption key package are sent to A decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice. The digital electronic invoice is segmented into different lengths by setting different data separation codes, and the data separation code is generated randomly, thereby improving the encryption level of the digital electronic invoice. A data subset is stored in a real key, and the real key is placed at the position where the data separation code is cut. If the specific information of the data separation code is not obtained, the position of the real key cannot be locked, and the digital electronic invoice cannot be decrypted, thereby ensuring that the data will not be leaked, achieving the purpose of encrypting the digital electronic invoice during the transmission of the digital electronic invoice, thereby achieving the technical effect of improving the security of the digital electronic invoice during the transmission process.

[0091] Figure 7is a flow chart of another digital electronic invoice processing method according to an embodiment of the present application. Figure 7 As shown, the method includes the following steps.

[0092] Step S701: The decryption side device receives the digital electronic invoice storage package and the decryption key package sent by the encryption object, wherein the digital electronic invoice storage package and the decryption key package are based on Figure 1 The digital electronic invoice processing method shown is obtained.

[0093] Step S702, determining the location of the target key in the digital electronic invoice storage package according to the data separation code in the decryption key package, and extracting the target key according to the location of the target key in the digital electronic invoice storage package.

[0094] Step S703, input the initial data of the digital electronic invoice and the length of each of the x data subsets obtained by segmenting the initial data of the digital electronic invoice into the target key to obtain decrypted data.

[0095] Step S704, placing each data subset at the position of the data slice to obtain a digital electronic invoice.

[0096] That is, the decryption side device determines the position of the real key in the digital invoice storage package according to the data separation code. The initial data length and the data subset length are input into the real key, the real key is decrypted, and the decrypted data is obtained. The decrypted data is decompressed to obtain the data subset. The data subset is placed at the corresponding position according to the data slice position and the data subset length to obtain the complete digital invoice.

[0097] It is worth noting that the real key and the disguised key are placed according to the location information of the data separation code, and the data separation code is randomly generated according to the data slice calculation model, which is random and unreasonable. Therefore, the real key is also random and unreasonable. Only by obtaining the generation rules of the data slice calculation model can the data separation code be cracked. Therefore, even if an unrelated person obtains the digital invoice storage package, he cannot obtain the digital invoice.

[0098] It should be noted that Figure 7 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0099] Figure 8 is a structural diagram of a digital electronic invoice processing device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:

[0100] The first acquisition module 80 is used to acquire the digital electronic invoice and determine the initial data corresponding to the digital electronic invoice.

[0101] The processing module 82 is used to perform slicing processing on the initial data to obtain a data separation code, and to perform segmentation processing on the initial data according to the data separation code to obtain x data subsets, where x is a positive integer.

[0102] The second acquisition module 84 is used to acquire the real key corresponding to each data subset to obtain x real keys, and store each data subset to the real key corresponding thereto to obtain x target keys.

[0103] The determination module 86 is used to determine y disguised keys, determine the digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, wherein y is a positive integer greater than 1.

[0104] The sending module 88 is used to send the digital electronic invoice storage package and the decryption key package to the decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0105] Optionally, the processing module 82 is also used to perform the following steps: obtain a random length of a data slice based on which the initial data is sliced; determine a target length of the data slice based on the random length and a preset value; determine a position of the data slice in the initial data based on the target length; generate a data separation code based on the position of the data slice in the initial data, wherein the data separation code includes: position information of the data separation code and length information of the data subset where the data separation code is located.

[0106] Optionally, the processing module 82 is further used to perform the following steps: determining an initial length of the initial data; filling a first blank grid with a target length to obtain a first grid, wherein the first grid is used to store the target length; filling a second blank grid with the initial length to obtain a second grid, wherein the second grid is used to store the initial length; aligning the first character in the first grid with the first character in the second grid, and after the alignment, reading and processing the data slices in the first grid, wherein the number of data slices is m, and m is a positive integer; when the last character of the uth data slice is read, determining the uth data slice; The u-th position corresponding to the last character of u data slices is determined, and the u-th position is recorded, the u-th position is searched in the second grid, and the u-th position is determined as the u-th position of the data slice in the initial data, where u is a positive integer less than m; when the last character of the m-th data slice is read, the m-th position corresponding to the last character of the m-th data slice is determined, and the m-th position is recorded, the m-th position is searched in the second grid, and the m-th position is determined as the m-th position of the data slice in the initial data; according to the u-th position and the m-th position in the second grid, the position of the data slice in the initial data is determined.

[0107] Optionally, the processing module 82 is also used to determine the mth position as the data slice after the mth position in the initial data, and perform the following steps: determine whether there is a target character in the second grid, wherein the target character is the character after the mth position; if the target character exists in the second grid, obtain the target length of the target character; generate random characters of the target length, and fill the random characters of the target length after the mth position in the first grid; determine the first target position of the last character of the random characters of the target length, and record the first target position, search for the first target position in the second grid, and determine the first target position as the first target position of the data slice in the initial data; determine the position of the data slice in the initial data according to the uth position, the mth position and the first target position in the second grid.

[0108] Optionally, the processing module 82 is further configured to perform the following steps: determining a target length of the data slice by using the following formula: Among them, D i is the target length of the i-th data slice, k is the preset value, D j is the random length of the j-th data slice, i, j∈[1,n], n is a positive integer.

[0109] Optionally, the determination module 86 is further used to perform the following steps: obtain the length of each real key, and determine the first total length of x real keys based on the length of each real key; perform a subtraction process on the total length and the length of the initial data to obtain a target value; randomly generate a disguised key, obtain a second total length of the disguised key, and determine the number of disguised keys based on the target value and the second total length; when the number of disguised keys is not a positive integer, repeat the operation of randomly generating a disguised key and determining the number of disguised keys until the number of disguised keys is a positive integer.

[0110] Optionally, the first acquisition module 80 is also used to perform the following steps: determine the invoice type of the digital electronic invoice, wherein the invoice type includes at least one of the following: ordinary electronic invoice, value-added tax electronic invoice, catering service electronic invoice, e-commerce electronic invoice, transportation electronic invoice, machinery and equipment electronic invoice and customized electronic invoice; determine the initial data corresponding to the invoice type, wherein the length of the initial data of different invoice types is different.

[0111] Optionally, the determination module 86 is further used to perform the following steps: determine a second target position of the data separation code in the initial data; fill x target keys into a preset grid according to the second target position to obtain a first target grid; fill y disguised keys into the first target grid to obtain a second target grid, wherein the length of the second target grid is the same as the length of the initial data; and determine a digital electronic invoice storage package according to the second target grid.

[0112] It should be noted that the above Figure 8 The modules in the embodiment may be program modules (e.g., a set of program instructions for implementing a specific function) or hardware modules. For the latter, they may be expressed in the following forms, but are not limited thereto: the expression form of the above modules is a processor, or the functions of the above modules are implemented by a processor.

[0113] It should be noted that Figure 8 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0114] Fig. 9 The hardware structure block diagram of a computer terminal for implementing a digital electronic invoice processing method is shown. Fig. 9As shown, the computer terminal 90 may include one or more (902a, 902b, ..., 902n are used to illustrate) processors 902 (the processor 902 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 904 for storing data, and a transmission module 906 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.

[0115] It should be noted that the one or more processors 902 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 90. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0116] The memory 904 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the digital electronic invoice processing method in the embodiment of the present application. The processor 902 executes various functional applications and data processing by running the software programs and modules stored in the memory 904, that is, the above-mentioned digital electronic invoice processing method is realized. The memory 904 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 904 may further include a memory remotely arranged relative to the processor 902, and these remote memories may be connected to the computer terminal 90 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0117] The transmission module 906 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 90. In one example, the transmission module 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 906 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0118] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 90 .

[0119] It should be noted that, in some optional embodiments, the above Fig. 9 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Fig. 9 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0120] It should be noted that Fig. 9 The computer terminal shown is used to execute Figure 1 The digital electronic invoice processing method shown in the figure, therefore the relevant explanations and instructions in the execution method of the above command are also applicable to the electronic device and will not be repeated here.

[0121] An embodiment of the present application further provides a non-volatile storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above digital electronic invoice processing method.

[0122] A program for a non-volatile storage medium to perform the following functions: obtaining a digital electronic invoice, determining initial data corresponding to the digital electronic invoice; slicing the initial data to obtain a data separation code, and segmenting the initial data according to the data separation code to obtain x data subsets, wherein x is a positive integer; obtaining a real key corresponding to each data subset to obtain x real keys, storing each data subset to the real key corresponding thereto to obtain x target keys; determining y disguised keys, determining a digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulating the initial data, the length of each data subset and the data separation code to obtain a decryption key package, wherein y is a positive integer greater than 1; sending the digital electronic invoice storage package and the decryption key package to a decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0123] An embodiment of the present application also provides an electronic device, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above digital electronic invoice processing method is executed when the program is running.

[0124] The processor is used to run a program that performs the following functions: obtain a digital electronic invoice, determine the initial data corresponding to the digital electronic invoice; slice the initial data to obtain a data separation code, and segment the initial data according to the data separation code to obtain x data subsets, where x is a positive integer; obtain the real key corresponding to each data subset to obtain x real keys, store each data subset to the real key corresponding to it, to obtain x target keys; determine y disguised keys, determine a digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, where y is a positive integer greater than 1; send the digital electronic invoice storage package and the decryption key package to a decryption side device, where the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

[0125] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0126] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0127] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0129] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0130] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0131] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0132] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing digital electronic invoices, characterized in that: include: Obtaining a digital electronic invoice and determining initial data corresponding to the digital electronic invoice; Slicing the initial data to obtain a data separation code, and segmenting the initial data according to the data separation code to obtain x data subsets, where x is a positive integer; Obtaining a real key corresponding to each of the data subsets to obtain x real keys, and storing each of the data subsets to the real key corresponding thereto to obtain x target keys; Determine y disguised keys, determine a digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, wherein y is a positive integer greater than 1; The digital electronic invoice storage package and the decryption key package are sent to a decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

2. The method according to claim 1, characterized in that The initial data is sliced ​​to obtain a data separation code, including: Obtaining a random length of a data slice based on which the initial data is sliced; Determining a target length of the data slice according to the random length and a preset value; Determining the position of the data slice in the initial data according to the target length; The data separation code is generated according to the position of the data slice in the initial data, wherein the data separation code includes: position information of the position of the data separation code and length information of the data subset where the data separation code is located.

3. The method according to claim 2, characterized in that Determining the position of the data slice in the initial data according to the target length includes: Determining an initial length of the initial data; Filling the target length into a first blank grid to obtain a first grid, wherein the first grid is used to store the target length; Filling the initial length into a second blank grid to obtain a second grid, where the second grid is used to store the initial length; Aligning the first character in the first grid with the first character in the second grid, and after the alignment, reading the data slices in the first grid, wherein the number of the data slices is m, and m is a positive integer; When the last character of the u-th data slice is read, determine the u-th position corresponding to the last character of the u-th data slice, record the u-th position, search for the u-th position in the second grid, and determine the u-th position as the u-th position of the data slice in the initial data, where u is a positive integer less than m; When the last character of the m-th data slice is read, determine the m-th position corresponding to the last character of the m-th data slice, record the m-th position, search for the m-th position in the second grid, and determine the m-th position as the m-th position of the data slice in the initial data; The position of the data slice in the initial data is determined according to the u-th position and the m-th position in the second grid.

4. The method according to claim 3, characterized in that The m-th position is determined as the data slice after the m-th position in the initial data, the method further comprising: Determine whether a target character exists in the second grid, wherein the target character is a character after the m-th position; When the target character exists in the second grid, obtaining a target length of the target character; Generate random characters of the target length, and fill the first grid with the random characters of the target length after the mth position; Determine a first target position of the last character of the random character of the target length, record the first target position, search for the first target position in the second grid, and determine the first target position as the first target position of the data slice in the initial data; The position of the data slice in the initial data is determined according to the u-th position, the m-th position and the first target position in the second grid.

5. The method according to claim 2, characterized in that: Determining a target length of the data slice according to the random length and a preset value includes: The target length of the data slice is determined by the following formula: Among them, D i is the target length of the i-th data slice, k is the preset value, D j is the random length of the j-th data slice, i, j∈[1,n], n is a positive integer.

6. The method according to claim 1, characterized in that Determine y camouflage keys, including: Obtaining the length of each of the real keys, and determining a first total length of the x real keys according to the length of each of the real keys; Subtract the total length from the length of the initial data to obtain a target value; randomly generating the camouflage key, obtaining a second total length of the camouflage key, and determining the number of the camouflage keys according to the target value and the second total length; When the number of the camouflage keys is not a positive integer, the operations of randomly generating the camouflage keys and determining the number of the camouflage keys are repeatedly performed until the number of the camouflage keys is a positive integer.

7. The method according to claim 1, characterized in that Determining the initial data corresponding to the digital electronic invoice, including: Determining the invoice type of the digital electronic invoice, wherein the invoice type includes at least one of the following: ordinary electronic invoice, value-added tax electronic invoice, catering service electronic invoice, e-commerce electronic invoice, transportation electronic invoice, mechanical equipment electronic invoice and customized electronic invoice; The initial data corresponding to the invoice type is determined, wherein the lengths of the initial data of different invoice types are different.

8. The method according to claim 1, characterized in that According to the x target keys and the y disguised keys, a digital electronic invoice storage package is determined, including: Determining a second target position of the data separation code in the initial data; According to the second target position, filling the x target keys into a preset grid to obtain a first target grid; Filling y of the disguised keys into the first target grid to obtain a second target grid, wherein the length of the second target grid is the same as the length of the initial data; The digital electronic invoice storage package is determined according to the second target grid.

9. A method for processing digital electronic invoices, characterized in that: include: The decryption side device receives the digital electronic invoice storage package and the decryption key package sent by the encryption object, wherein the digital electronic invoice storage package and the decryption key package are obtained according to the digital electronic invoice processing method according to any one of claims 1 to 7; Determine the location of the target key in the digital electronic invoice storage package according to the data separation code in the decryption key package, and extract the target key according to the location of the target key in the digital electronic invoice storage package; Inputting the initial data of the digital electronic invoice and the length of each of the x data subsets obtained by segmenting the initial data of the digital electronic invoice into the target key to obtain decrypted data; Each of the data subsets is placed at the position of the data slice to obtain the digital electronic invoice.

10. A digital electronic invoice processing device, characterized in that: include: A first acquisition module, used to acquire a digital electronic invoice and determine initial data corresponding to the digital electronic invoice; A processing module, used for slicing the initial data to obtain a data separation code, and segmenting the initial data according to the data separation code to obtain x data subsets, where x is a positive integer; A second acquisition module is used to acquire a real key corresponding to each of the data subsets to obtain x real keys, and store each of the data subsets in the real key corresponding thereto to obtain x target keys; A determination module, used to determine y disguised keys, determine a digital electronic invoice storage package according to the x target keys and the y disguised keys, and encapsulate the initial data, the length of each data subset and the data separation code to obtain a decryption key package, wherein y is a positive integer greater than 1; The sending module is used to send the digital electronic invoice storage package and the decryption key package to the decryption side device, wherein the decryption side device is used to decrypt the digital electronic invoice storage package according to the decryption key package to obtain the digital electronic invoice.

11. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the digital electronic invoice processing method described in any one of claims 1 to 8 or the digital electronic invoice processing method described in claim 9.

12. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein when the program is run, the digital electronic invoice processing method described in any one of claims 1 to 8 or the digital electronic invoice processing method described in claim 9 is executed.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the digital electronic invoice processing method described in any one of claims 1 to 8 or the digital electronic invoice processing method described in claim 9.