Multi-e-commerce platform invoice centralized processing method and system
Through data aggregation from multiple e-commerce platforms and self-supervised learning of the Transformer large model, the problems of low efficiency and insufficient accuracy in cross-platform invoice processing have been solved, and real-time and efficient invoice processing and feedback have been achieved, reducing maintenance costs and improving consumer experience.
Patent Information
- Application Number
- CN202510675530.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-05-23
AI Technical Summary
In the existing technology, invoice processing on multiple e-commerce platforms has problems such as cross-platform data fragmentation, low processing efficiency, high complexity in tax classification code matching, high maintenance costs, and insufficient real-time invoicing results.
Through API and RPA data collection methods, we can achieve the aggregation and standardized processing of data from multiple e-commerce platforms, use the large model of Transformer architecture to perform semantic encoding matching for self-supervised learning, build a real-time feedback mechanism, generate electronic invoices and asynchronously feedback status.
It realizes the centralized processing of invoicing data on multiple platforms, improves processing efficiency and accuracy, reduces manual maintenance costs, ensures data consistency and real-time performance, and enhances consumer experience.
Smart Images

Figure CN120743989A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of invoice processing on e-commerce platforms, and in particular to a method and system for centralized processing of invoices on multiple e-commerce platforms. Background Art
[0002] At present, when consumers submit invoice applications on different e-commerce platforms, each e-commerce platform handles the invoice requests independently. The data on multiple platforms are fragmented, and invoice requests cannot be processed uniformly across platforms. The scattered data leads to redundant processing processes and low efficiency in invoice data processing on multiple platforms. In addition, the data submitted by consumers on multiple e-commerce platforms is not unified. The company's finance department needs to log in to the backend of each e-commerce platform separately to view the relevant information of the consumer's invoice application, which makes business operations complicated and the processing efficiency is relatively low.
[0003] When matching tax classification codes in invoice processing, businesses typically map codes based on keyword matching or manually pre-set rules (such as regular expressions). However, due to the diversity and semantic complexity of product names (e.g., "apple" can correspond to fruit or electronics), matching product tax classification codes is highly complex. Traditional methods rely on manually maintained code mapping tables, which are costly and error-prone when dealing with a wide variety of products, resulting in insufficient keyword matching accuracy. Traditional NLP-based code matching solutions use word segmentation and TF-IDF algorithms to extract product keywords and match them against a code database. However, these solutions lack contextual semantic understanding and result in matching accuracy rates below 70%. Some e-commerce platforms use pre-set rules to match tax codes (e.g., mapping the keyword "mobile phone" to the code "1090412"). However, single-platform invoicing systems cannot aggregate data across platforms. Furthermore, code matching relies on manual rules, which require manual intervention and high maintenance costs. These rules also struggle to cover the diversity of product names (e.g., "Xiaomi 14utral" requires manual mapping to the code "mobile communication device").
[0004] In addition, the feedback of corporate invoicing results relies on manual feedback or the interface provided by the platform, which is not real-time enough. The invoicing results lag behind the synchronization of e-commerce platform data, and the delay can be up to several hours or even days. After the invoice is issued, it cannot be sent back to the original platform in real time, affecting the consumer experience and the platform reconciliation efficiency. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to design a method and system for centralized processing of invoices on multiple e-commerce platforms, realize the aggregation and centralized processing of invoicing data on multiple platforms, and improve the efficiency of invoicing processing on multiple platforms; through intelligent analysis of commodity semantics by large models, automatically match tax classification codes, improve matching accuracy, and reduce manual maintenance costs; build a real-time feedback mechanism for invoicing results to ensure data consistency, improve platform reconciliation efficiency, and enhance consumer experience.
[0006] The present invention provides a method for centralized processing of invoices on multiple e-commerce platforms, comprising the following steps:
[0007] S1. Pull invoicing request information from consumers across multiple e-commerce platforms using the e-commerce platform's API and RPA data collection methods.
[0008] S2. Convert the data format of invoicing request information from multiple e-commerce platforms into a unified format (e.g., JSON format), including: synchronizing the data of the invoicing 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 requesting invoices from different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating the information into a standard JSON message structure;
[0009] This invention solves the compatibility issues of heterogeneous data through multi-platform data aggregation and standardization. A lightweight adapter is developed for each data platform to support automatic identification of protocols (HTTP / SFTP) and formats (JSON / XML). Data on consumer invoicing applications from different e-commerce platforms is obtained through the e-commerce platform's open API interface and RPA technology. Lightweight adapters are configured for different acquisition methods and different e-commerce platforms to parse the fields required by the business. The parsed fields are uniformly formatted, denoised, and filtered, and finally output as standard data.
[0010] S3, based on the Transformer architecture (such as DeepSeek), uses self-supervised learning methods to pre-train a large model for semantic encoding matching;
[0011] Large-scale model-driven semantic coding matching: Codes are dynamically generated based on product context, eliminating the need for manual rule table maintenance. Standard data is uniformly input into the large-scale model, which then performs semantic understanding and extracts semantic features based on the input data, outputting the corresponding tax classification code for the product. The large-scale model also continuously learns based on new data (such as updates to the tax bureau's product coding database and data from existing store invoices).
[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 the invoicing status through a message queue (such as Kafka), support failure retries and idempotence verification, and ensure data consistency.
[0013] Furthermore, the self-supervised learning method in step S3 includes:
[0014] S31. De-noise and filter the invoicing request information data, remove special characters, filter low-quality text (such as store names, event logos, etc.), unify capitalization, perform word segmentation, and extract word stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to the training progress.
[0015] S32: Construct a multi-task objective for 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 sentences other than positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs further apart;
[0016] S33. Optimize the loss function using 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 from the first 10% of the steps to the peak value. Analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight.
[0017] S34. Verify the performance of large models through downstream tasks and verify data efficiency through small sample learning;
[0018] S35. Collect and use the commodity and service tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
[0019] Furthermore, the method of 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 supervision loss is designed according to the classification task. The function of the supervision loss is:
[0023] ;
[0024] Among them, y true (one-hot encoding) is the true label, y pred is the model prediction probability, L is the cross-entropy loss (Cross-Entropy Loss);
[0025] S354. Optimize model parameters by gradient descent method, including:
[0026] Use the AdamW optimizer and set an initial learning rate and weight decay coefficient, where 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 coefficient is 0.01);
[0027] After obtaining the loss value through forward calculation, the gradient of the loss with respect to the model parameters is calculated using the chain rule;
[0028] Update the trainable parameters according to the optimizer rule: , calculate the gradient of the loss function with respect to the parameters through back propagation; is the updated trainable parameter, is the trainable parameter before updating, Indicates the direction of parameter adjustment;
[0029] Where η is the learning rate, which decays according to the cosine strategy with each training round;
[0030] S355. Evaluate the classification accuracy and F1 value of the large model. The F1 value is used to balance precision and recall, avoiding the problem of one metric being too high while the other is too low.
[0031] Furthermore, the semantic matching process in the large model for implementing semantic coding matching in step S3 includes:
[0032] Input a product name (such as "Huawei Mate60 5G"), and the large model outputs a semantic vector. Calculate the cosine similarity between the semantic vector and the description of each category in the encoding library.
[0033] The cosine value of the angle between two semantic vectors in space is calculated, and the similarity between the two semantic vectors is measured by cosine similarity. The expression of cosine similarity is:
[0034]
[0035] Among them, A and B are two vectors to be compared (such as the embedding vector of the product name and the embedding vector of the tax classification description); A i 、B i are 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||, ||B|| are the moduli (Euclidean norms) of vectors A and B respectively;
[0038] θ is the angle between vectors A and B;
[0039] The code with the highest similarity is returned (e.g., "1090505010000000000: mobile communication device"). The confidence threshold mechanism for the similarity is: if the highest similarity is <90%, the manual review process is triggered.
[0040] The present invention also provides a system for centralized processing of invoices on multiple e-commerce platforms, which implements the method for centralized processing of invoices on multiple e-commerce platforms as described above, including:
[0041] Data collection module: This module is used to obtain invoicing request information from consumers on multiple e-commerce platforms through the e-commerce platform's API and RPA data collection methods.
[0042] Data standardization module: This module is used to convert the data format of invoicing request information from multiple e-commerce platforms into a unified format. This module includes: synchronizing the invoicing 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 on different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating it into a standard JSON message structure;
[0043] Tax code matching large model module: This module is used to pre-train a large model for semantic code matching using self-supervised learning based on the Transformer architecture.
[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; asynchronously transmits invoicing status through the message queue, supports failure retry and idempotence verification, and ensures data consistency.
[0045] Furthermore, the tax code matching model module includes:
[0046] Data preprocessing submodule: This module is used to denoise and filter invoicing request information, remove special characters, filter low-quality text, unify capitalization, perform word segmentation, and extract stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to training progress.
[0047] Self-supervised task design submodule: This module is used to construct mask prediction and contrastive learning multi-task objectives, predict the probability distribution of masked words, generate positive samples through back-translation and synonym replacement, randomly sample sentences other than positive samples as negative samples, and use InfoNCE loss to close the distance between positive sample pairs and push away negative sample pairs.
[0048] Model pre-training submodule: This module is used to optimize the loss function using 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, warm up the learning rate by linearly increasing the number of steps from the first 10% to the peak value, analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight.
[0049] Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and verify data efficiency through small sample learning;
[0050] Fine-tuning model submodule: used to collect and use the goods and services tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
[0051] Furthermore, the fine-tuning model submodule includes:
[0052] Data preparation unit: used to construct tax classification and annotation datasets;
[0053] Adjust model structure unit: used to add task adaptation layer on top of pre-trained model;
[0054] Define the loss function unit: used to design the supervision loss according to the classification task through the task adaptation layer;
[0055] Backpropagation and parameter update unit: used to optimize model parameters through gradient descent method.
[0056] Furthermore, the back propagation and parameter updating unit includes:
[0057] Optimizer selection subunit: used to use the AdamW optimizer, set the initial learning rate and weight decay coefficient, and the initial learning rate is lower than the learning rate in the pre-training stage;
[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 calculation;
[0059] Parameter update subunit: used to update trainable parameters according to the optimizer rules;
[0060] Model validation subunit: used to evaluate the classification accuracy and F1 value indicators of large models.
[0061] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for centralized processing of invoices on multiple e-commerce platforms as described above.
[0062] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the program, the steps of the method for centralized processing of invoices on multiple e-commerce platforms as described above are implemented.
[0063] Compared with the prior art, the present invention has the following beneficial effects:
[0064] The method and system for centralized processing of invoices on multiple e-commerce platforms provided by the present invention solve the compatibility problem of heterogeneous data through multi-platform data aggregation and standardized processing; use the coding matching mode of large-model semantic analysis to achieve dynamic and accurate coding mapping through deep semantic understanding, solving the semantic ambiguity, rigid rules and high maintenance cost problems of traditional methods; through real-time access to new data from the business system, upgrade conditions are triggered, and parameters are fine-tuned based on the pre-trained model instead of training from scratch, and the model service framework is used to load the new model without interrupting the service; the model is automatically upgraded, reducing manual maintenance and lowering maintenance costs; based on the "Goods and Services Tax Classification Code Table" issued by the State Administration of Taxation and the company's historical invoicing data, fine-tuning is performed to provide matching accuracy; the real-time asynchronous feedback mechanism is adopted to improve the feedback efficiency, effectively improving the invoice processing efficiency of multiple e-commerce platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Various other advantages and benefits will become apparent to those skilled in the art by reading the following detailed description of the preferred embodiment.The accompanying drawings are only for the purpose of illustrating the preferred embodiment and are not to be considered as limiting the present invention.
[0066] In the attached figure:
[0067] Figure 1 This is a flow chart of a method for centralized processing of invoices on multiple e-commerce platforms according to an embodiment of the present invention;
[0068] Figure 2 Flowchart of the self-supervised learning method according to an embodiment of the present invention;
[0069] Figure 3 A flow chart of a method for fine-tuning a model according to an embodiment of the present invention;
[0070] Figure 4 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of systems and products consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0072] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses 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 only used to distinguish information of the same type from each other. 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 "at the time of" or "when" or "in response to determining."
[0074] The embodiments of the present invention are described in further detail below.
[0075] The embodiment of the present invention provides a method for centralized processing of invoices on multiple e-commerce platforms. Figure 1 As shown, the following steps are included:
[0076] S1. Pull invoicing request information from consumers across multiple e-commerce platforms using the e-commerce platform's API and RPA data collection methods.
[0077] S2. Convert the data format of invoicing request information from multiple e-commerce platforms into a unified format (e.g., JSON format), including: synchronizing the data of the invoicing 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 requesting invoices from different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating the information into a standard JSON message structure;
[0078] In this embodiment, the extracted message is as follows:
[0079]
[0080] This embodiment addresses the compatibility issues of heterogeneous data by aggregating and standardizing data across multiple platforms. A lightweight adapter is developed for each data platform, supporting automatic identification of protocols (HTTP / SFTP) and formats (JSON / XML). Data on consumer invoicing applications from different e-commerce platforms is obtained through the platform's open APIs and RPA technology. Lightweight adapters are configured for different acquisition methods and platforms to parse the fields required by the business. The parsed fields are uniformly formatted, de-noised, and filtered, ultimately outputting standardized data.
[0081] The multi-platform data aggregation and standardization process is as follows:
[0082] 1. Multi-source data access → 2. Dynamic structure analysis → 3. Semantic alignment → 4. Unified standardization → 5. Quality verification → 6. Output standard data.
[0083] S3, based on the Transformer architecture, uses self-supervised learning methods to pre-train a large model for semantic encoding matching;
[0084] The self-supervised learning method includes the following steps (such as Figure 2 shown):
[0085] S31. De-noise and filter the invoicing request information data, remove special characters, filter low-quality text (including store names, event logos, etc.), unify capitalization, perform word segmentation, and extract word stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to the training progress.
[0086] S32: Construct a multi-task objective for 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 sentences other than positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs further apart;
[0087] S33. Optimize the loss function using the Transformer backbone network, configure the optimization strategy, and pre-train the large model using the AdamW optimization algorithm. Set the learning rate and weight decay coefficient to 2e-5~3e-4, and the weight decay coefficient to 0.01. Preheat the learning rate by linearly increasing the number of steps from 10% to the peak value. Analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight.
[0088] S34. Verify the performance of large models through downstream tasks and verify data efficiency through small sample learning;
[0089] S35. Collect and use the commodity and service tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
[0090] The method of fine-tuning the model includes the following steps (such as Figure 3 shown):
[0091] S351. Construct a tax classification labeling dataset (input text → tax code label);
[0092] S352. Add a task adaptation layer (classification head) on top of the pre-trained model.
[0093] S353. Through the task adaptation layer, a supervision loss is designed according to the classification task. The function of the supervision loss is:
[0094] ;
[0095] Among them, y true is the true label, y pred is the model prediction probability, L is the cross entropy loss;
[0096] S354. Optimize model parameters by gradient descent method, including:
[0097] Use the AdamW optimizer and set the initial learning rate and weight decay coefficient. The initial learning rate is lower than the learning rate in the pre-training phase. The initial learning rate is set to 1e-5 to 1e-4, and the weight decay coefficient is 0.01.
[0098] After obtaining the loss value through forward calculation, the gradient of the loss with respect to the model parameters is calculated using the chain rule;
[0099] Update the trainable parameters according to the optimizer rule: , calculate the gradient of the loss function with respect to the parameters through back propagation; is the updated trainable parameter, is the trainable parameter before updating, Indicates the direction of parameter adjustment;
[0100] Where η is the learning rate, which decays according to the cosine strategy with each training round;
[0101] S355. Evaluate the classification accuracy and F1 value indicators of the large model.
[0102] In this embodiment, the large model training data example is as follows:
[0103] Input: Product name "Huawei Mate60 5G";
[0104] Output: Code "1090505990000000000" (mobile communication device).
[0105] The semantic matching process includes:
[0106] Input a product name (such as "Huawei Mate60 5G"), and the large model outputs a semantic vector. Calculate the cosine similarity between the semantic vector and the description of each category in the encoding library.
[0107] The cosine value of the angle between two semantic vectors in space is calculated, and the similarity between the two semantic vectors is measured by cosine similarity. The expression of cosine similarity is:
[0108]
[0109] Among them, A and B are two vectors to be compared (such as the embedding vector of the product name and the embedding vector of the tax classification description); A i 、B i are the values of vectors A and B in the i-th dimension respectively;
[0110] A⋅B is the vector dot product (inner product);
[0111] ||A||, ||B|| are the moduli (Euclidean norms) of vectors A and B respectively;
[0112] θ is the angle between vectors A and B;
[0113] The code with the highest similarity is returned (e.g., "1090505010000000000: mobile communication device"). The confidence threshold mechanism for the similarity is: if the highest similarity is <90%, the manual review process is triggered.
[0114] 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 invoicing records and user feedback), and verify the integrity of the data (such as product names). 150,000 new invoicing data items were added that month, triggering the upgrade conditions. Parameters were fine-tuned based on the pre-trained model instead of training from scratch. Model servitization frameworks (such as TensorFlow Serving and TorchServe) were used to load the new model without interrupting service, thereby achieving automatic upgrade of the large model.
[0115] Semantic code matching driven by a large model: Codes are dynamically generated based on the product context, eliminating the need for manual rule table maintenance. Standard data is uniformly input into the large model, which then performs semantic understanding and extracts semantic features based on the input data, outputting the corresponding tax classification code for the product. The large model also continuously learns based on new data (such as updates to the tax bureau's product code database and data from existing store invoices). The practical application of this large model in this embodiment includes the following process:
[0116] 1. Enter the product context, which includes text such as product name, description, and specifications.
[0117] 2. Extract semantic features from the commodity context, perform semantic understanding and code generation based on the semantic features, and output the tax classification code;
[0118] 3. Continuously learn new data and dynamically adapt to policy changes and new product types.
[0119] A hybrid audit mechanism is adopted, combining model confidence thresholds and manual intervention to balance efficiency and accuracy.
[0120] 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 the invoicing status through a message queue (such as Kafka), support failure retries and idempotence verification, and ensure data consistency.
[0121] In this embodiment, centralized invoicing and return includes the following processes:
[0122] 1. After receiving the invoice request, it enters the message queue. Without waiting for the invoice to be completed, it immediately returns "Acceptance Success" and a unique serial number (such as UUID);
[0123] 2. Pull the invoicing request from the message queue and execute the invoicing operation;
[0124] 3. After the invoicing is completed, the successful invoicing result is sent to the return message queue, the return request is pulled from the return message queue, the return action is executed, and the result is stored in the database for subsequent query and verification.
[0125] The present invention also provides a system for centralized processing of invoices on multiple e-commerce platforms, which implements the method for centralized processing of invoices on multiple e-commerce platforms as described above, including:
[0126] Data collection module: This module is used to obtain invoicing request information from consumers on multiple e-commerce platforms through the e-commerce platform's API and RPA data collection methods.
[0127] Data standardization module: This module is used to convert the data format of invoicing request information from multiple e-commerce platforms into a unified format. This module includes: synchronizing the invoicing 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 on different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating it into a standard JSON message structure;
[0128] Tax code matching large model module: This module is used to pre-train a large model for semantic code matching using self-supervised learning based on the Transformer architecture.
[0129] The tax code matching model module includes:
[0130] Data preprocessing submodule: This module is used to denoise and filter invoicing request information, remove special characters, filter low-quality text, unify capitalization, perform word segmentation, and extract stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to training progress.
[0131] Self-supervised task design submodule: This module is used to construct mask prediction and contrastive learning multi-task objectives, predict the probability distribution of masked words, generate positive samples through back-translation and synonym replacement, randomly sample sentences other than positive samples as negative samples, and use InfoNCE loss to close the distance between positive sample pairs and push away negative sample pairs.
[0132] Model pre-training submodule: This module is used to optimize the loss function using 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, warm up the learning rate by linearly increasing the number of steps from the first 10% to the peak value, analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight.
[0133] Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and verify data efficiency through small sample learning;
[0134] Fine-tuning model submodule: used to collect and use the goods and services tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
[0135] The fine-tuning model submodules include:
[0136] Data preparation unit: used to construct tax classification and annotation datasets;
[0137] Adjust model structure unit: used to add task adaptation layer on top of pre-trained model;
[0138] Define the loss function unit: used to design the supervision loss according to the classification task through the task adaptation layer;
[0139] Backpropagation and parameter update unit: used to optimize model parameters through gradient descent method.
[0140] The back propagation and parameter update unit includes:
[0141] Optimizer selection subunit: used to use the AdamW optimizer, set the initial learning rate and weight decay coefficient, and the initial learning rate is lower than the learning rate in the pre-training stage;
[0142] 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 calculation;
[0143] Parameter update subunit: used to update trainable parameters according to the optimizer rules;
[0144] Model validation subunit: used to evaluate the classification accuracy and F1 value indicators of large models.
[0145] 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; asynchronously transmits invoicing status through the message queue, supports failure retry and idempotence verification, and ensures data consistency.
[0146] In this embodiment, the performance indicators of the multi-e-commerce platform invoice centralized processing system are:
[0147] Daily processing capacity: 1 million invoicing requests;
[0148] Encoding matching time: average 200ms / item.
[0149] Data transmission is encrypted using HTTPS + national encryption algorithm;
[0150] Privacy protection is achieved by desensitizing consumers’ sensitive information (such as mobile phone numbers).
[0151] An embodiment of the present invention further provides a computer device, Figure 4 This is a schematic diagram of the structure of a computer device provided by 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 multi-e-commerce platform invoice centralized processing method provided in the above embodiment; wherein the input system 23, the output system 24, the memory 22 and the processor 21 can be connected by a bus or other means, Figure 4 The bus connection is taken as an example.
[0152] The memory 22 is a readable and writable storage medium of a computing device, which can be used to store software programs and computer executable programs, such as the program instructions corresponding to the method for centralized processing of invoices on multiple e-commerce platforms described in an embodiment of the present invention. The memory 22 may mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required for a function; the data storage area can store data created based on the use of the device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 22 may further include a memory remotely located relative to the processor 21, and these remote memories may be connected to the device 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.
[0153] The input system 23 may be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device; the output system 24 may include display devices such as a display screen.
[0154] The processor 21 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 22, that is, realizes the above-mentioned method for centralized processing of invoices from multiple e-commerce platforms.
[0155] The computer device provided above can be used to execute the method for centralized processing of invoices on multiple e-commerce platforms provided in the above embodiment, and has corresponding functions and beneficial effects.
[0156] An embodiment of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the multi-e-commerce platform invoice centralized processing method provided in the above embodiment. The storage medium is any of various types of memory devices or storage devices, including: installation media, such as CD-ROM, floppy disk or tape system; 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 (such as hard disk or optical storage); registers or other similar types of memory elements; the storage medium may also include other types of memory or a combination thereof; in addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, the second computer system being connected to the first computer system via a network (such as the Internet); the second computer system may provide program instructions to the first computer for execution. The storage medium includes two or more storage media that can reside in different locations (for example, in different computer systems connected via a network). The storage medium can store program instructions (for example, specifically implemented as a computer program) that can be executed by one or more processors.
[0157] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present invention is not limited to the method for centralized processing of invoices on multiple e-commerce platforms as described in the above embodiment, and can also execute related operations in the method for centralized processing of invoices on multiple e-commerce platforms provided in any embodiment of the present invention.
[0158] Thus far, the technical solutions of the present invention have been described in conjunction with 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 may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.
[0159] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for centralized processing of invoices on multiple e-commerce platforms, characterized in that: The following steps are involved: S1. Pull invoicing request information from consumers across multiple e-commerce platforms using the e-commerce platform's API and RPA data collection methods. S2. Convert the data format of invoicing request information from multiple e-commerce platforms into a unified format, including: synchronizing the data of the invoicing 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 requesting invoices from different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating them into a standard JSON message structure; S3, based on the Transformer architecture, uses self-supervised learning methods to pre-train a large model for semantic encoding matching; 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 the invoicing status through the message queue, support failure retry and idempotence verification, and ensure data consistency.
2. The method for centralized processing of invoices on multiple e-commerce platforms according to claim 1, characterized in that: The self-supervised learning method of step S3 includes: S31. De-noise and filter the invoicing request information data, remove special characters, filter low-quality text, unify capitalization, perform word segmentation, and extract stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to the training progress. S32: Construct a multi-task objective for mask prediction and contrastive learning to predict the probability distribution of masked words; generate positive samples through back-translation and synonym replacement; randomly sample sentences other than positive samples as negative samples; use InfoNCE loss to bring positive sample pairs closer and push negative sample pairs further apart; S33. Optimize the loss function using 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, and warm up the learning rate by linearly increasing it from the first 10% of the steps to the peak value. Analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight. S34. Verify the performance of large models through downstream tasks and verify data efficiency through small sample learning; S35. Collect and use the commodity and service tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
3. The method for centralized processing of invoices on multiple e-commerce platforms according to claim 2, characterized in that: The method for fine-tuning the model in step S35 includes: S351. Construct tax classification annotation dataset; S352. Add a task adaptation layer on top of the pre-trained model; S353. Through the task adaptation layer, a supervision loss is designed according to the classification task. The function of the supervision loss is: ; Among them, y true is the true label, y pred is the model prediction probability, L is the cross entropy loss; S354. Optimize model parameters by gradient descent method, including: Use the AdamW optimizer and set the initial learning rate and weight decay coefficient. The initial learning rate is lower than the learning rate in the pre-training phase. After obtaining the loss value through forward calculation, the gradient of the loss with respect to the model parameters is calculated using the chain rule; Update the trainable parameters according to the optimizer rule: , calculate the gradient of the loss function with respect to the parameters through back propagation; Where η is the learning rate, which decays according to the cosine strategy with each training round; is the updated trainable parameter, is the trainable parameter before updating, Indicates the direction of parameter adjustment; S355. Evaluate the classification accuracy and F1 value indicators of the large model.
4. The method for centralized processing of invoices on multiple e-commerce platforms according to claim 1, characterized in that: The semantic matching process in the large model for achieving 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 description of each category in the encoding library; Calculate the cosine value of the angle between two semantic vectors in space, and measure the similarity of the two semantic vectors by cosine similarity. The expression of cosine similarity is: ; Among them, A and B are two vectors to be compared; A i 、B i are the values of vectors A and B in the i-th dimension respectively; A·B is the vector dot product; ||A||, ||B|| are the moduli of vectors A and B respectively; θ is the angle between vectors A and B; The code with the highest similarity is returned. The confidence threshold mechanism of the similarity is: if the highest similarity is <90%, the manual review process is triggered.
5. A system for centralized processing of invoices on multiple e-commerce platforms, which implements the method for centralized processing of invoices on multiple e-commerce platforms as described in any one of claims 1 to 4, characterized in that: include: Data collection module: This module is used to obtain invoicing request information from consumers on multiple e-commerce platforms through the e-commerce platform's API and RPA data collection methods. Data standardization module: This module is used to convert the data format of invoicing request information from multiple e-commerce platforms into a unified format. This module includes: synchronizing the invoicing 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 on different e-commerce platforms based on electronic tax invoicing requirements and the business data returned by the e-commerce platforms, and integrating it into a standard JSON message structure; Tax code matching large model module: This module is used to pre-train a large model for semantic code matching using self-supervised learning based on the Transformer architecture. 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; asynchronously transmits invoicing status through the message queue, supports failure retry and idempotence verification, and ensures data consistency.
6. The multi-e-commerce platform invoice centralized processing system according to claim 5 is characterized in that: The tax code matching model module includes: Data preprocessing submodule: This module is used to denoise and filter invoicing request information, remove special characters, filter low-quality text, unify capitalization, perform word segmentation, and extract stems; clean unlabeled data and generate dynamic masks; select key areas to mask based on attention weights or gradients; and adjust the mask ratio according to training progress. Self-supervised task design submodule: This module is used to construct mask prediction and contrastive learning multi-task objectives, predict the probability distribution of masked words, generate positive samples through back-translation and synonym replacement, randomly sample sentences other than positive samples as negative samples, and use InfoNCE loss to close the distance between positive sample pairs and push away negative sample pairs. Model pre-training submodule: This module is used to optimize the loss function using 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, warm up the learning rate by linearly increasing the number of steps from the first 10% to the peak value, analyze the loss curve, monitor the loss convergence of each task, and adjust the learning rate or weight. Evaluation and tuning submodule: used to verify the performance of large models through downstream tasks and verify data efficiency through small sample learning; Fine-tuning model submodule: used to collect and use the goods and services tax classification code table issued by the State Administration of Taxation and the company's historical invoicing data to fine-tune the model.
7. The multi-e-commerce platform invoice centralized processing system according to claim 6 is characterized in that: The fine-tuning model submodule includes: Data preparation unit: used to construct tax classification and annotation dataset; Adjust model structure unit: used to add task adaptation layer on top of pre-trained model; Define the loss function unit: used to design the supervision loss according to the classification task through the task adaptation layer; Backpropagation and parameter update unit: used to optimize model parameters through gradient descent method.
8. The multi-e-commerce platform invoice centralized processing system according to claim 7 is characterized in that: The back propagation and parameter updating unit includes: Optimizer selection subunit: used to use the AdamW optimizer, set the initial learning rate and weight decay coefficient, and the initial learning rate is lower than the learning rate in the pre-training stage; 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 calculation; Parameter update subunit: used to update trainable parameters according to the optimizer rules; Model verification subunit: used to evaluate the classification accuracy and F1 value indicators of large models.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, the steps of the method for centralized processing of invoices on multiple e-commerce platforms as described in any one of claims 1 to 4 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for centralized processing of invoices on multiple e-commerce platforms as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Invoice commodity name classification method and device
CN114219038A
Big language model-based invoice information extraction and invoicing category judgment method
CN118781621A
Commodity information processing and querying method and system
CN119377433A
Commodity name intelligent code mapping method and system based on pre-training model
CN119719779A
Intelligent invoicing method and system based on finance and tax industry large model
CN119963276A