A multi-ec-platform invoice centralized processing method and system
By aggregating data from multiple e-commerce platforms and using the self-supervised learning of the Transformer large model, the problems of low efficiency and accuracy in cross-platform invoice processing have been solved. This has enabled efficient and accurate tax classification code matching and real-time invoice feedback, thereby improving the overall efficiency and accuracy of invoice processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JINCAI SHUKE (BEIJING) INFORMATION TECH CO LTD
- Filing Date
- 2025-05-23
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, invoice processing across multiple e-commerce platforms suffers from problems such as data fragmentation, low processing efficiency, high complexity in matching tax classification codes, high manual maintenance costs, and insufficient real-time invoicing results.
Invoice request information from multiple e-commerce platforms is aggregated using API and RPA data collection methods. A large model based on the Transformer architecture is used for self-supervised learning semantic encoding matching to generate tax classification codes. The invoice status is asynchronously returned via a message queue, supporting failure retries and idempotency verification.
It enables centralized processing of invoice data from multiple platforms, improving processing efficiency, reducing manual maintenance costs, enhancing matching accuracy and real-time performance, and ensuring data consistency and consumer experience.
Smart Images

Figure CN120743989B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of e-commerce platform invoice processing technology, and more specifically, to a method and system for centralized processing of invoices from multiple e-commerce platforms. Background Technology
[0002] Currently, when consumers submit invoice requests on different e-commerce platforms, each platform processes the requests independently. This data fragmentation across platforms makes it impossible to process invoice requests uniformly across platforms. The scattered data leads to redundant processing flows and low efficiency in processing invoice data across multiple platforms. Furthermore, the data submitted by consumers on different e-commerce platforms is not consistent, requiring corporate finance departments to log into the backend of each e-commerce platform separately to view relevant information about consumer invoice requests, resulting in complex business operations and relatively low processing efficiency.
[0003] For tax classification code matching in invoice processing, enterprises typically map codes based on keyword matching or manually preset rules (such as regular expressions). However, due to the diversity and semantic complexity of product names (e.g., "apple" may correspond to fruit or electronic products), the complexity of matching product tax classification codes is high. Traditional methods rely on manual maintenance of code mapping tables, which is costly and error-prone when there are many types of products, resulting in insufficient keyword matching accuracy. Traditional NLP-based code matching schemes use word segmentation and TF-IDF algorithms to extract product keywords and match them with a code library, but they lack sufficient understanding of contextual semantics, resulting in a matching accuracy of less than 70%. Some e-commerce platforms use preset rules to match tax codes (e.g., the keyword "mobile phone" is mapped to code "1090412"), but a single platform's invoicing system cannot aggregate data across platforms, and code matching relies on manual rules, requiring manual intervention for rule maintenance, which is costly and difficult to cover the diversity of product names (e.g., "**14utral" needs to be manually mapped to the "mobile communication device" code).
[0004] Furthermore, the return of invoice results by enterprises relies on manual transmission or interfaces provided by the platform, which is not real-time. The synchronization between invoice results and e-commerce platform data is delayed, with delays of several hours or even days. Invoices cannot be returned to the original platform in real time after issuance, affecting consumer experience and platform reconciliation efficiency. Summary of the Invention
[0005] Therefore, the purpose of this invention is to design a method and system for centralized processing of invoices from multiple e-commerce platforms, thereby realizing the aggregation and centralized processing of invoice data from multiple platforms and improving the efficiency of invoice processing on multiple platforms; through intelligent analysis of product semantics using a large model, automatically matching tax classification codes to improve matching accuracy and reduce manual maintenance costs; and to construct a real-time feedback mechanism for invoice results to ensure data consistency, improve platform reconciliation efficiency, and enhance the consumer experience.
[0006] This invention provides a method for centralized processing of invoices from multiple e-commerce platforms, comprising the following steps:
[0007] S1. Use the API and RPA data collection methods of e-commerce platforms to retrieve invoice request information from consumers on multiple e-commerce platforms;
[0008] S2. Convert the data format of invoice request information from multiple e-commerce platforms into a unified format (such as JSON format), including: synchronizing the invoice request information pulled from multiple e-commerce platforms; extracting the invoice header, order number, invoice amount, product name, quantity, and unit price information of consumers applying for invoices from different e-commerce platforms according to the electronic tax invoice requirements and the business data returned by the e-commerce platforms, and integrating them into a standard JSON message.
[0009] This invention solves the compatibility problem of heterogeneous data through multi-platform data aggregation and standardized processing. A lightweight adapter is developed for each data platform, supporting automatic recognition of protocols (HTTP / SFTP) and formats (JSON / XML). Data on consumer invoicing requests from different e-commerce platforms is obtained through their open API interfaces and RPA technology. Lightweight adapters are configured for different acquisition methods and e-commerce platforms to parse the fields required by the business logic. The parsed fields are then uniformly formatted, denoised, and filtered, ultimately outputting labeled data.
[0010] S3. Based on the Transformer architecture (such as deepseek), a large model for semantic encoding matching is pre-trained using self-supervised learning methods.
[0011] Large-scale model-driven semantic coding matching: Codes are dynamically generated based on product context, eliminating the need for manual maintenance of rule tables. Standard data is uniformly input into the large-scale model, which performs semantic understanding and extracts semantic features based on the input data, outputting the corresponding tax classification code for the product. Simultaneously, the large-scale model continuously learns from new data (updated tax bureau product code database, invoiced data from stores, etc.).
[0012] S4. Connect to the Golden Tax System's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; asynchronously transmit invoicing status via message queue (such as Kafka), support failure retries and idempotency checks to ensure data consistency.
[0013] Furthermore, the self-supervised learning method in step S3 includes:
[0014] S31. Denoise and filter the invoice request information data, remove special characters, filter low-quality text (such as store names, activity logos, etc.), unify capitalization, segment words, and extract word stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; adjust the mask ratio according to the training progress.
[0015] S32. Construct a multi-task objective of mask prediction and contrastive learning to predict the probability distribution of masked words (cross-entropy loss); generate positive samples through back translation and synonym replacement; randomly sample other sentences besides the positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart.
[0016] S33. Optimize the loss function through the Transformer backbone network, configure the optimization strategy, pre-train the large model using the AdamW optimization algorithm, set the learning rate and weight decay coefficient (preferably, the learning rate is 2e-5~3e-4, and the weight decay coefficient is 0.01), and warm up the learning rate by linearly increasing it to the peak value in the first 10% of the steps, analyze the loss curve, monitor the convergence of the loss of each task, and adjust the learning rate or weights.
[0017] S34. Verify the performance of the large model through downstream tasks and verify the data efficiency through small sample learning.
[0018] S35. Collect and use the commodity and service tax classification code table issued by the State Taxation Administration and the enterprise's historical invoicing data to fine-tune the model.
[0019] Furthermore, the method for fine-tuning the model in step S35 includes:
[0020] S351. Construct a tax classification labeling dataset (input text → tax code label).
[0021] S352. Add a task adaptation layer (such as a classification head) on top of the pre-trained model.
[0022] S353. Through the task adaptation layer, a supervised loss is designed based on the classified task. The functional expression of the supervised loss is:
[0023] ;
[0024] Among them, y true (One-hot encoding) represents the true label, y pred L represents the model's predicted probability, and L represents the cross-entropy loss.
[0025] S354. Optimize model parameters using gradient descent, including:
[0026] Using the AdamW optimizer, set an initial learning rate and a weight decay factor, wherein the initial learning rate is lower than the learning rate in the pre-training phase (preferably, the initial learning rate is set to 1e-5 to 1e-4, and the weight decay factor is 0.01).
[0027] After obtaining the loss value through forward computation, the gradient of the loss with respect to the model parameters is calculated using the chain rule.
[0028] Update trainable parameters according to optimizer rules: The gradient of the loss function with respect to the parameters is calculated through backpropagation; For the updated trainable parameters, These are the trainable parameters before the update. Indicates the direction of parameter adjustment;
[0029] Where η is the learning rate, which decays with each training round according to a cosine strategy;
[0030] S355. Evaluate the classification accuracy and F1 score of the large model. The F1 score is used to balance precision and recall, avoiding the problem of one metric being too high and the other too low.
[0031] Furthermore, the semantic matching process in the large model for implementing semantic encoding matching in step S3 includes:
[0032] Input a product name (e.g., "**Mate60 5G"), and the large model outputs a semantic vector; calculate the cosine similarity between the semantic vector and the descriptions of each category in the encoding library;
[0033] Calculate the cosine of the angle between two semantic vectors in space, and use cosine similarity to measure the similarity between the two semantic vectors. The expression for cosine similarity is:
[0034]
[0035] Where A and B are two vectors to be compared (e.g., the embedding vector of the product name and the embedding vector of the tax classification description); A i B i Let A and B be the values of vectors A and B in the i-th dimension, respectively.
[0036] A⋅B is the vector dot product (inner product);
[0037] ||A|| and ||B|| are the magnitudes (Euclidean norms) of vectors A and B, respectively.
[0038] θ is the angle between vectors A and B;
[0039] Return the code with the highest similarity (e.g., "1090505010000000000: Mobile communication device"). The confidence threshold mechanism for similarity is: if the highest similarity is <90%, a manual review process is triggered.
[0040] This invention also provides a centralized invoice processing system for multiple e-commerce platforms, which executes the centralized invoice processing method for multiple e-commerce platforms as described above, including:
[0041] Data acquisition module: Used to retrieve invoice request information from consumers across multiple e-commerce platforms using APIs and RPA data acquisition methods.
[0042] Data standardization module: This module is used to convert the data format of invoice request information from multiple e-commerce platforms into a unified format. This includes: synchronizing the invoice request information pulled from multiple e-commerce platforms; extracting invoice header, order number, invoice amount, product name, quantity, and unit price information from consumers applying for invoices on different e-commerce platforms based on the requirements of electronic tax invoicing and the business data returned by the e-commerce platforms; and integrating these information into a standard JSON message.
[0043] Tax Code Matching Large Model Module: This module is used to pre-train a large model for semantic code matching based on the Transformer architecture and using self-supervised learning methods.
[0044] Centralized invoicing and feedback module: Used to connect to the Golden Tax system's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; it asynchronously feedbacks the invoicing status through a message queue, supports failure retries and idempotency checks, and ensures data consistency.
[0045] Furthermore, the tax code matching large model module includes:
[0046] The data preprocessing submodule is used to denoise and filter invoice request information data, remove special characters, filter low-quality text, unify capitalization, segment words, and extract stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; and adjust the mask ratio according to the training progress.
[0047] The self-supervised task design submodule is used to construct a multi-task objective of mask prediction and contrastive learning, predict the probability distribution of masked words, generate positive samples through back translation and synonym replacement, randomly sample other sentences besides the positive samples as negative samples, and use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart.
[0048] Model pre-training submodule: Used to optimize the loss function through the Transformer backbone network, configure the optimization strategy, pre-train the large model using the AdamW optimization algorithm, set the learning rate and weight decay coefficient, linearly increase the learning rate to the peak value in the first 10% of steps for learning rate warm-up, analyze the loss curve, monitor the convergence of loss for each task, and adjust the learning rate or weights.
[0049] Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and to verify data efficiency through few-sample learning;
[0050] Fine-tuning Model Submodule: Used to collect and fine-tune the model using the commodity and service tax classification code table issued by the State Taxation Administration and the company's historical invoicing data.
[0051] Furthermore, the fine-tuning model submodule includes:
[0052] Data preparation unit: used to construct a tax classification annotation dataset;
[0053] Adjusting model structure units: used to add a task adaptation layer on top of the pre-trained model;
[0054] Define the loss function unit: used to design supervised loss based on the classification task through the task adaptation layer;
[0055] Backpropagation and parameter update unit: used to optimize model parameters using gradient descent.
[0056] Furthermore, the backpropagation and parameter update unit includes:
[0057] Optimizer selection subunit: used to set the initial learning rate and weight decay coefficient using the AdamW optimizer, wherein the initial learning rate is lower than the learning rate in the pre-training phase;
[0058] Gradient backpropagation subunit: used to calculate the gradient of the loss with respect to the model parameters using the chain rule after obtaining the loss value through forward computation;
[0059] Parameter update subunit: used to update trainable parameters according to optimizer rules;
[0060] Model validation subunit: used to evaluate the classification accuracy and F1 score of large models.
[0061] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the multi-e-commerce platform invoice centralized processing method described above.
[0062] The present invention also provides a computer device, the computer device including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the multi-e-commerce platform invoice centralized processing method described above.
[0063] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0064] The method and system for centralized processing of invoices from multiple e-commerce platforms provided by this invention solves the compatibility problem of heterogeneous data through multi-platform data aggregation and standardized processing; it uses a coding matching mode based on large-scale model semantic analysis to achieve dynamic and accurate coding mapping through deep semantic understanding, solving the problems of semantic ambiguity, rigid rules, and high maintenance costs of traditional methods; it triggers upgrade conditions by real-time access to new data from business systems, and performs parameter fine-tuning based on pre-trained models instead of training from scratch, using a model service framework to load new models without interrupting services; the model is automatically upgraded, reducing manual maintenance and lowering maintenance costs; it provides matching accuracy by fine-tuning based on the "Classification and Coding Table for Commodity and Services Tax" issued by the State Taxation Administration and the company's historical invoicing data; and it adopts a real-time asynchronous feedback mechanism to improve feedback efficiency, effectively improving the efficiency of invoice processing from multiple e-commerce platforms. Attached Figure Description
[0065] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention.
[0066] In the attached diagram:
[0067] Figure 1 This is a flowchart of a method for centralized processing of invoices from multiple e-commerce platforms according to an embodiment of the present invention;
[0068] Figure 2 This is a flowchart of a self-supervised learning method according to an embodiment of the present invention;
[0069] Figure 3 This is a flowchart of the method for fine-tuning the model according to an embodiment of the present invention;
[0070] Figure 4 This is a schematic diagram of the configuration of a computer device according to an embodiment of the present invention. Detailed Implementation
[0071] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of systems and products consistent with some aspects of this disclosure as detailed in the appended claims.
[0072] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0073] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0074] The embodiments of the present invention will be described in further detail below.
[0075] This invention provides a method for centralized processing of invoices from multiple e-commerce platforms. (See also...) Figure 1 As shown, it includes the following steps:
[0076] S1. Use the API and RPA data collection methods of e-commerce platforms to retrieve invoice request information from consumers on multiple e-commerce platforms;
[0077] S2. Convert the data format of invoice request information from multiple e-commerce platforms into a unified format (such as JSON format), including: synchronizing the invoice request information pulled from multiple e-commerce platforms; extracting the invoice header, order number, invoice amount, product name, quantity, and unit price information of consumers applying for invoices from different e-commerce platforms according to the electronic tax invoice requirements and the business data returned by the e-commerce platforms, and integrating them into a standard JSON message.
[0078] In this embodiment, the extracted message is as follows: {
[0079] "orderNo": "xxxx", / / Order number
[0080] "applyInvoiceType": "82", / / Invoice type requested
[0081] "invoiceMoney": "29.90", / / Total invoice amount
[0082] "applyTime": "2023-11-05T00:00:00", / / Application Date
[0083] "invoiceHeadType": 1, / / Header type 0-Individual 1-Enterprise
[0084] "gfmc": "xxxx", / / Buyer's Name
[0085] "gfsh": "xxxx", / / Purchaser's tax ID
[0086] "gfdz": "", / / Purchaser's address
[0087] "gfdh": "", / / Buyer's phone number
[0088] "gfyh": "", / / Buying Bank
[0089] "gfyhzh": "", / / Buyer's bank account
[0090] "openInvoiceTime":"xxxx", / / Invoice deadline
[0091] "goodsInfo": [ / / Invoice details]
[0092] {
[0093] "spec": "xxxx", / / Specifications and Models
[0094] "spbm": "xxxx", / / sku
[0095] "jshj": "29.90", / / Total including tax
[0096] "spsl": "1", / / Quantity
[0097] "hsdj": "29.90", / / Price including tax
[0098] "spmc": "xxxx" / / Product Name
[0099] } ]
[0101] }
[0102] This embodiment addresses the compatibility issues of heterogeneous data through multi-platform data aggregation and standardized processing. A lightweight adapter is developed for each data platform, supporting automatic recognition of protocols (HTTP / SFTP) and formats (JSON / XML). Data on consumer invoicing requests from different e-commerce platforms is obtained through their open API interfaces and RPA technology. Lightweight adapters are configured for different acquisition methods and e-commerce platforms to parse the fields required by the business logic. The parsed fields are then uniformly formatted, denoised, and filtered, ultimately outputting labeled data.
[0103] The multi-platform data aggregation and standardization process is as follows:
[0104] 1. Multi-source data access → 2. Dynamic structure parsing → 3. Semantic alignment → 4. Unified standardization → 5. Quality verification → 6. Output standard data.
[0105] S3. Based on the Transformer architecture, a large model for semantic encoding matching is pre-trained using a self-supervised learning method.
[0106] Self-supervised learning methods include the following steps (such as...) Figure 2 (as shown)
[0107] S31. Denoise and filter the invoice request information data, remove special characters, filter low-quality text (including store names, activity logos, etc.), unify capitalization, segment words, and extract word stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; adjust the mask ratio according to the training progress.
[0108] S32. Construct a multi-task objective of mask prediction and contrastive learning to predict the probability distribution of masked words (cross-entropy loss); generate positive samples through back translation and synonym replacement; randomly sample other sentences besides the positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart.
[0109] S33. Optimize the loss function through the Transformer backbone network, configure the optimization strategy, use the AdamW optimization algorithm to pre-train the large model, set the learning rate and weight decay coefficient, the learning rate is 2e-5~3e-4, the weight decay coefficient is 0.01, and the learning rate is increased linearly to the peak value in the first 10% of steps to warm up the learning rate, analyze the loss curve, monitor the convergence of loss for each task, and adjust the learning rate or weights.
[0110] S34. Verify the performance of the large model through downstream tasks and verify the data efficiency through small sample learning.
[0111] S35. Collect and use the commodity and service tax classification code table issued by the State Taxation Administration and the enterprise's historical invoicing data to fine-tune the model.
[0112] The method for fine-tuning the model includes the following steps (such as...) Figure 3 (as shown)
[0113] S351. Construct a tax classification labeling dataset (input text → tax code label).
[0114] S352. Add a task adaptation layer (classification head) on top of the pre-trained model.
[0115] S353. Through the task adaptation layer, a supervised loss is designed based on the classified task. The functional expression of the supervised loss is:
[0116] ;
[0117] Among them, y true For real labels, y pred L represents the model's predicted probability, and L represents the cross-entropy loss.
[0118] S354. Optimize model parameters using gradient descent, including:
[0119] Using the AdamW optimizer, set the initial learning rate and weight decay coefficient. The initial learning rate is lower than the learning rate in the pre-training stage. The initial learning rate is set to 1e-5 to 1e-4, and the weight decay coefficient is 0.01.
[0120] After obtaining the loss value through forward computation, the gradient of the loss with respect to the model parameters is calculated using the chain rule.
[0121] Update trainable parameters according to optimizer rules: The gradient of the loss function with respect to the parameters is calculated through backpropagation; For the updated trainable parameters, These are the trainable parameters before the update. Indicates the direction of parameter adjustment;
[0122] Where η is the learning rate, which decays with each training round according to a cosine strategy;
[0123] S355. Evaluate the classification accuracy and F1 score of the large model.
[0124] In this embodiment, an example of large model training data is as follows:
[0125] Input: Product name "**Mate60 5G";
[0126] Output: Encoding "1090505990000000000" (Mobile communication device).
[0127] The semantic matching process includes:
[0128] Input a product name (e.g., "**Mate60 5G"), and the large model outputs a semantic vector; calculate the cosine similarity between the semantic vector and the descriptions of each category in the encoding library;
[0129] Calculate the cosine of the angle between two semantic vectors in space, and use cosine similarity to measure the similarity between the two semantic vectors. The expression for cosine similarity is:
[0130]
[0131] Where A and B are two vectors to be compared (e.g., the embedding vector of the product name and the embedding vector of the tax classification description); A i B i Let A and B be the values of vectors A and B in the i-th dimension, respectively.
[0132] A⋅B is the vector dot product (inner product);
[0133] ||A|| and ||B|| are the magnitudes (Euclidean norms) of vectors A and B, respectively.
[0134] θ is the angle between vectors A and B;
[0135] Return the code with the highest similarity (e.g., "1090505010000000000: Mobile communication device"). The confidence threshold mechanism for similarity is: if the highest similarity is <90%, a manual review process is triggered.
[0136] In this embodiment, the large model can desensitize sensitive fields (such as mobile phone numbers and names) by accessing new data from the business system in real time (such as invoice records and user feedback), and verify the integrity of the data (such as product names). When 150,000 new invoice records are added in a month, the upgrade condition is triggered. The model performs parameter fine-tuning based on the pre-trained model instead of training from scratch. The model service framework (such as TensorFlow Serving or TorchServe) is used to load the new model without interrupting the service, thereby achieving automatic upgrade of the large model.
[0137] Large-scale model-driven semantic coding matching: Codes are dynamically generated based on product context, eliminating the need for manual maintenance of rule tables. Standard data is uniformly input into the large-scale model, which performs semantic understanding and extracts semantic features based on the input data, outputting the corresponding tax classification code for the product. Simultaneously, the large-scale model continuously learns based on new data (updated tax bureau product code database, store invoicing data, etc.). In practical applications of this large-scale model, the following process is included in the implementation examples:
[0138] 1. Enter the product context, which includes text such as product name, description, and specifications.
[0139] 2. Extract semantic features from the product context, perform semantic understanding and encoding based on these features, and output the tax classification code;
[0140] 3. Continuously learn new data and dynamically adapt to policy changes and new product types.
[0141] A hybrid review mechanism is adopted, combining model confidence thresholds with human intervention to balance efficiency and accuracy.
[0142] S4. Connect to the Golden Tax System's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; asynchronously transmit invoicing status via message queue (such as Kafka), support failure retries and idempotency checks to ensure data consistency.
[0143] In this embodiment, centralized invoicing and data transmission includes the following process:
[0144] 1. Upon receiving an invoice request, the request enters the message queue; without waiting for the invoice to be completed, it immediately returns "acceptance successful" and a unique serial number (such as UUID).
[0145] 2. Retrieve invoice requests from the message queue and execute the invoice operation;
[0146] 3. After the invoice is issued, the result of successful invoicing is sent to the return message queue. The return request is retrieved from the return message queue, the return action is executed, and the result is stored in the database for subsequent query and verification.
[0147] This invention also provides a centralized invoice processing system for multiple e-commerce platforms, which executes the centralized invoice processing method for multiple e-commerce platforms as described above, including:
[0148] Data acquisition module: Used to retrieve invoice request information from consumers across multiple e-commerce platforms using APIs and RPA data acquisition methods.
[0149] Data standardization module: This module is used to convert the data format of invoice request information from multiple e-commerce platforms into a unified format. This includes: synchronizing the invoice request information pulled from multiple e-commerce platforms; extracting invoice header, order number, invoice amount, product name, quantity, and unit price information from consumers applying for invoices on different e-commerce platforms based on the requirements of electronic tax invoicing and the business data returned by the e-commerce platforms; and integrating these information into a standard JSON message.
[0150] Tax Code Matching Large Model Module: This module is used to pre-train a large model for semantic code matching based on the Transformer architecture and using self-supervised learning methods.
[0151] The large model module for tax code matching includes:
[0152] The data preprocessing submodule is used to denoise and filter invoice request information data, remove special characters, filter low-quality text, unify capitalization, segment words, and extract stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; and adjust the mask ratio according to the training progress.
[0153] The self-supervised task design submodule is used to construct a multi-task objective of mask prediction and contrastive learning, predict the probability distribution of masked words, generate positive samples through back translation and synonym replacement, randomly sample other sentences besides the positive samples as negative samples, and use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart.
[0154] Model pre-training submodule: Used to optimize the loss function through the Transformer backbone network, configure the optimization strategy, pre-train the large model using the AdamW optimization algorithm, set the learning rate and weight decay coefficient, linearly increase the learning rate to the peak value in the first 10% of steps for learning rate warm-up, analyze the loss curve, monitor the convergence of loss for each task, and adjust the learning rate or weights.
[0155] Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and to verify data efficiency through few-sample learning;
[0156] Fine-tuning Model Submodule: Used to collect and fine-tune the model using the commodity and service tax classification code table issued by the State Taxation Administration and the company's historical invoicing data.
[0157] The fine-tuning model submodule includes:
[0158] Data preparation unit: used to construct a tax classification annotation dataset;
[0159] Adjusting model structure units: used to add a task adaptation layer on top of the pre-trained model;
[0160] Define the loss function unit: used to design supervised loss based on the classification task through the task adaptation layer;
[0161] Backpropagation and parameter update unit: used to optimize model parameters using gradient descent.
[0162] The backpropagation and parameter update unit includes:
[0163] Optimizer selection subunit: used to set the initial learning rate and weight decay coefficient using the AdamW optimizer, wherein the initial learning rate is lower than the learning rate in the pre-training phase;
[0164] Gradient backpropagation subunit: used to calculate the gradient of the loss with respect to the model parameters using the chain rule after obtaining the loss value through forward computation;
[0165] Parameter update subunit: used to update trainable parameters according to optimizer rules;
[0166] Model validation subunit: used to evaluate the classification accuracy and F1 score of large models.
[0167] Centralized invoicing and feedback module: Used to connect to the Golden Tax system's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; it asynchronously feedbacks the invoicing status through a message queue, supports failure retries and idempotency checks, and ensures data consistency.
[0168] In this embodiment, the performance indicators of the centralized invoice processing system for multiple e-commerce platforms are as follows:
[0169] Daily processing capacity: 1 million invoice requests;
[0170] Encoding matching time: average 200ms / entry.
[0171] Data transmission is encrypted using HTTPS and Chinese national cryptographic algorithms;
[0172] Privacy is protected by anonymizing sensitive consumer information (such as phone numbers).
[0173] This invention also provides a computer device. Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention; see the accompanying drawings. Figure 4 As shown, the computer device includes: an input system 23, an output system 24, a memory 22, and a processor 21; the memory 22 is used to store one or more programs; when the one or more programs are executed by the one or more processors 21, the one or more processors 21 implement the centralized invoice processing method for multiple e-commerce platforms provided in the above embodiments; wherein the input system 23, the output system 24, the memory 22, and the processor 21 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0174] The memory 22, as a read / write storage medium for computing devices, can be used to store software programs and computer-executable programs, such as the program instructions corresponding to the centralized invoice processing method for multiple e-commerce platforms described in this embodiment of the invention. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 22 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include memory remotely located relative to the processor 21, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0175] The input system 23 can be used to receive input digital or character information, and generate key signal inputs related to user settings and function control of the device; the output system 24 may include display devices such as a display screen.
[0176] The processor 21 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 22, thereby realizing the above-mentioned method for centralized processing of invoices from multiple e-commerce platforms.
[0177] The computer equipment provided above can be used to execute the centralized invoice processing method for multiple e-commerce platforms provided in the above embodiments, and has corresponding functions and beneficial effects.
[0178] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the centralized invoice processing method for multiple e-commerce platforms provided in the above embodiments. The storage medium can be any type of memory device or storage device, including: mounting media such as CD-ROM, floppy disk, or magnetic tape systems; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or combinations thereof; furthermore, the storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet); the second computer system can provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (e.g., in different computer systems connected via a network). The storage medium can store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0179] Of course, the computer-executable instructions provided in the embodiments of the present invention are not limited to the multi-e-commerce platform invoice centralized processing method described in the above embodiments, but can also execute related operations in the multi-e-commerce platform invoice centralized processing method provided in any embodiment of the present invention.
[0180] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0181] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for centralized processing of invoices from multiple e-commerce platforms, characterized in that, Includes the following steps: S1. Use the API and RPA data collection methods of e-commerce platforms to retrieve invoice request information from consumers on multiple e-commerce platforms; S2. Convert the data format of invoice request information from multiple e-commerce platforms into a unified format, including: synchronizing the invoice request information from multiple e-commerce platforms; extracting the invoice header, order number, invoice amount, product name, quantity, and unit price information of consumers applying for invoices from different e-commerce platforms based on the electronic tax invoice requirements and the business data returned by the e-commerce platforms, and integrating them into a standard JSON message. S3. Based on the Transformer architecture, a large model for semantic encoding matching is pre-trained using a self-supervised learning method. S4. Connect to the Golden Tax System's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; asynchronously transmit invoicing status via message queue, support failure retries and idempotency checks to ensure data consistency; The self-supervised learning method in step S3 includes: S31. Denoise and filter the invoice request information data, remove special characters, filter low-quality text, unify capitalization, segment words, and extract stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; adjust the mask ratio according to the training progress. S32. Construct a multi-task objective of mask prediction and contrastive learning to predict the probability distribution of masked words; generate positive samples through back translation and synonym replacement; randomly sample other sentences besides the positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart. S33. Optimize the loss function through the Transformer backbone network, configure the optimization strategy, use the AdamW optimization algorithm to pre-train the large model, set the learning rate and weight decay coefficient, linearly increase the learning rate to the peak value in the first 10% of the steps to warm up the learning rate, analyze the loss curve, monitor the convergence of loss for each task, and adjust the learning rate or weights. S34. Verify the performance of the large model through downstream tasks and verify the data efficiency through small sample learning. S35. Collect and use the commodity and service tax classification code table and enterprise historical invoicing data issued by the State Taxation Administration to fine-tune the model; The method for fine-tuning the model in step S35 includes: S351. Construct a tax classification annotation dataset; S352. Add a task adaptation layer on top of the pre-trained model; S353. Through the task adaptation layer, a supervised loss is designed based on the classified task. The functional expression of the supervised loss is: ; Among them, y true For real labels, y pred L represents the model's predicted probability, and L represents the cross-entropy loss. S354. Optimize model parameters using gradient descent, including: Using the AdamW optimizer, set an initial learning rate and weight decay factor, wherein the initial learning rate is lower than the learning rate in the pre-training phase; After obtaining the loss value through forward computation, the gradient of the loss with respect to the model parameters is calculated using the chain rule. Update trainable parameters according to optimizer rules: The gradient of the loss function with respect to the parameters is calculated through backpropagation; Where η is the learning rate, which decays with each training round according to a cosine strategy; For the updated trainable parameters, These are the trainable parameters before the update. Indicates the direction of parameter adjustment; S355. Evaluate the classification accuracy and F1 score of the large model.
2. The method for centralized processing of invoices from multiple e-commerce platforms according to claim 1, characterized in that, The semantic matching process in the large model for implementing semantic encoding matching in step S3 includes: Input the product name, and the large model outputs a semantic vector; calculate the cosine similarity between the semantic vector and the category descriptions in the encoding library; Calculate the cosine of the angle between two semantic vectors in space. The cosine similarity measures the similarity between the two semantic vectors. The expression for the cosine similarity is: ; Where A and B are two vectors to be compared; A i B i Let A and B be the values of vectors A and B in the i-th dimension, respectively. A⋅B is the dot product of vectors; ||A|| and ||B|| are the magnitudes of vectors A and B, respectively; θ is the angle between vectors A and B; Return the code with the highest similarity. The confidence threshold mechanism for similarity is: if the highest similarity is less than 90%, a manual review process is triggered.
3. A centralized invoice processing system for multiple e-commerce platforms, executing the centralized invoice processing method for multiple e-commerce platforms as described in any one of claims 1-2, characterized in that, include: Data acquisition module: Used to retrieve invoice request information from consumers across multiple e-commerce platforms using APIs and RPA data acquisition methods. Data standardization module: This module is used to convert the data format of invoice request information from multiple e-commerce platforms into a unified format. This includes: synchronizing the invoice request information pulled from multiple e-commerce platforms; extracting invoice header, order number, invoice amount, product name, quantity, and unit price information from consumers applying for invoices on different e-commerce platforms based on the requirements of electronic tax invoicing and the business data returned by the e-commerce platforms; and integrating these information into a standard JSON message. Tax Code Matching Large Model Module: This module is used to pre-train a large model for semantic code matching based on the Transformer architecture and using self-supervised learning methods. Centralized invoicing and feedback module: Used to connect to the Golden Tax system's invoicing interface to issue electronic invoices and generate electronic invoice template files in PDF or OFD format; it asynchronously feedbacks the invoicing status through a message queue, supports failure retries and idempotency checks, and ensures data consistency.
4. The centralized invoice processing system for multiple e-commerce platforms according to claim 3, characterized in that, The tax code matching large model module includes: The data preprocessing submodule is used to denoise and filter invoice request information data, remove special characters, filter low-quality text, unify capitalization, segment words, and extract stems; clean unlabeled data and generate dynamic masks; select key regions for masking based on attention weights or gradients; and adjust the mask ratio according to the training progress. The self-supervised task design submodule is used to construct a multi-task objective of mask prediction and contrastive learning, predict the probability distribution of masked words, generate positive samples through back translation and synonym replacement, randomly sample other sentences besides the positive samples as negative samples, and use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs apart. Model pre-training submodule: Used to optimize the loss function through the Transformer backbone network, configure the optimization strategy, pre-train the large model using the AdamW optimization algorithm, set the learning rate and weight decay coefficient, linearly increase the learning rate to the peak value in the first 10% of steps for learning rate warm-up, analyze the loss curve, monitor the convergence of loss for each task, and adjust the learning rate or weights. Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and to verify data efficiency through few-sample learning; Fine-tuning Model Submodule: Used to collect and fine-tune the model using the commodity and service tax classification code table issued by the State Taxation Administration and the company's historical invoicing data.
5. The multi-e-commerce platform invoice centralized processing system according to claim 4, characterized in that, The fine-tuning model submodule includes: Data preparation unit: used to construct a tax classification annotation dataset; Adjusting model structure units: used to add a task adaptation layer on top of the pre-trained model; Define the loss function unit: used to design supervised loss based on the classification task through the task adaptation layer; Backpropagation and parameter update unit: used to optimize model parameters using gradient descent.
6. The multi-e-commerce platform invoice centralized processing system according to claim 5, characterized in that, The backpropagation and parameter update unit includes: Optimizer selection subunit: used to set the initial learning rate and weight decay coefficient using the AdamW optimizer, wherein the initial learning rate is lower than the learning rate in the pre-training phase; Gradient backpropagation subunit: used to calculate the gradient of the loss with respect to the model parameters using the chain rule after obtaining the loss value through forward computation; Parameter update subunit: used to update trainable parameters according to optimizer rules; Model validation subunit: used to evaluate the classification accuracy and F1 score of large models.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the multi-e-commerce platform invoice centralized processing method according to any one of claims 1-2.
8. A computer device, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the multi-e-commerce platform invoice centralized processing method as described in any one of claims 1-2.