Many-to-many matching method for bills and order lines
By combining rule filtering and natural language processing technology, the cumulative model and reorder model are used to calculate the comprehensive matching scores between bills and order lines, the complexity problem of many-to-many matching between bills and order lines in traditional financial management is solved, and the matching is improved Accuracy and efficiency.
Patent Information
- Application Number
- CN202411143201.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology is difficult to effectively solve the many-to-many matching problem between notes and order lines in traditional financial management and supply chain automation, resulting in cumbersome manual processing and error-prone, which affects data accuracy.
Rule filtering and natural language processing technology are used to calculate the comprehensive matching scores of bills and order lines through the combination of invoice analysis, preprocessing, accumulation model and rearrangement model to achieve many-to-many matching between bills and order lines.
It significantly improves the accuracy and efficiency of matching bills with order lines, ensures the uniqueness and accuracy of matching results, and reduces the cumbersomeness of manual filling.
Smart Images

Figure CN119130683A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information technology, and in particular to a many-to-many matching method between bills and order lines. Background Art
[0002] With the continuous evolution of national fiscal and taxation policies, the use of electronic invoices and digital bills has become increasingly popular, which has put forward new requirements for financial management and supply chain automation. In the traditional financial management and supplier bill processing process, manual processing is usually adopted. When submitting bills, one order has multiple order lines, and one invoice also has multiple line details. A large amount of information needs to be filled in manually, which is not only time-consuming and labor-intensive, but also prone to errors, affecting the accuracy of financial data. When checking the bill with the order line, there are differences between the project name and specification model of the bill and the material description of the order line, and there is a many-to-many problem between bills and order lines, that is, one order line has multiple bills, or one bill corresponds to multiple order lines. Most of the existing automated matching methods are limited to a single bill type or simple information comparison, and lack automated methods for many-to-many matching of bills and order lines in complex scenarios.
[0003] To address the above issues, the existing many-to-many matching method between bills and order lines is implemented through rule filtering combined with natural language processing technology. This method parses electronic invoices of different formats and converts them into structured bill data to facilitate matching with order lines. Rule filtering is performed according to predefined business rules, and a text semantic matching model is used to predict the matching similarity between bills and order lines, and the matching results are post-processed. Many-to-many matching is performed based on a hybrid matching method of rules and models to improve the accuracy and efficiency of matching between bills and order lines. Summary of the invention
[0004] In order to solve the above problem, the present invention proposes a many-to-many matching method of invoices and order lines, and the specific steps are as follows:
[0005] Step S1, invoice parsing: parsing key information for electronic invoices of different formats, and directly reading data for structured electronic invoices;
[0006] Step S2, pre-processing of bills and order lines to be matched: the conversion names of fields with the same meaning are unified, and the item name and specification model of the bill are merged into the same field, namely, invoice description, to facilitate matching with the material description content of the order line;
[0007] Step S3, rule filtering bills: in the submitted bill data, filter out the bill line data with the same unit name as the order line to be matched;
[0008] Step S4, many-to-many matching of bills and order lines: For bills that meet the set conditions, the cumulative model is designed to sum the values, and the rearrangement model is used to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill. The comprehensive matching score is calculated according to the weight ratio by combining the cumulative model and the rearrangement model scores, and the scores are sorted in descending order;
[0009] Step S5, post-processing of matching results: check whether the matching results meet the optimal matching strategy, that is, ensure that the number of invoices matched to an order is the largest; in addition, deduplicate the matched bill data and take the first one or more bills to ensure the uniqueness and accuracy of the matching results.
[0010] Furthermore, in step S1, the key information of the electronic invoices of different formats is parsed, including the invoice number, invoice date, invoice price, invoice tax, price and tax total, item name and specification model; for the structured electronic invoice, the data is directly read, and the invoice parsing method is as follows:
[0011] Invoice format recognition: perform format recognition on electronic invoice files to determine whether they are ofd, xml, images or other electronic formats; perform optical character recognition on invoices in unstructured image formats and convert them into editable text formats;
[0012] Key information location: using the fixed layout features of invoices, determine the location of key information on the invoice through visual inspection or machine learning methods; using template matching technology to identify the location of fixed fields such as invoice number, invoice date, invoice price, invoice tax, price and tax total, item name and specification model;
[0013] Extract key information: extract key information from the invoice text based on the positioning results. For structured data, such as electronic invoices in XML or JSON format, directly parse the corresponding tags or key-value pairs; for unstructured data, use regular expressions to extract the required information;
[0014] Data structured output converts the extracted key information into a unified data structure to facilitate subsequent order line data matching.
[0015] Furthermore, the bill and the order line to be matched are pre-processed respectively as described in step S2. Specifically, the structured bill data description after the invoice is parsed contains the buyer's name, seller's name, buyer's taxpayer identification number, seller's taxpayer identification number, invoice number, invoicing date, total amount, total tax amount, item name, specification model, unit, quantity, unit price, amount, tax rate / levy rate, tax amount, remarks, invoicer, and invoice description fields; the material description content of the order line to be matched contains the order number, order line item number, material name, supplier name, unit of measurement, quantity, unit price and submission date fields.
[0016] Furthermore, the specific method of bill preprocessing is:
[0017] The conversion names of fields with the same meaning are unified. For fields with the same meaning but different names in bills, standardization is performed to ensure the consistency of field names;
[0018] Check whether each field is missing and fill in the missing value with an empty character;
[0019] Standardize date, numeric and character format data respectively, convert different date or string formats of the invoice date field into a unified date format, convert the total amount, total tax amount, quantity, unit price, amount, tax rate / levy rate, and tax amount into numeric format, replace the empty string in the field with 0, and convert other field information into string format;
[0020] Remove punctuation marks, English brackets, Chinese brackets, and leading and trailing spaces from the buyer's name and seller's name fields;
[0021] Combine the item name and specification model into the invoice description field to facilitate matching with the material description content of the order line.
[0022] Furthermore, the specific method for preprocessing the order line to be matched is as follows:
[0023] The conversion names of fields with the same meaning are unified, and the fields with the same meaning are converted to the same field name using name mapping;
[0024] Standardize date, numeric and character format data respectively. Convert different date or character string formats of the submitted date field to a unified date format. Convert the order line number, quantity and unit price to numeric format. Replace the empty string in the field with 0. Convert other field information to string format.
[0025] Remove punctuation marks, English and Chinese brackets, and leading and trailing spaces from the Supplier Name field.
[0026] Furthermore, step S3 applies the preset matching rules to filter out the bill line data whose seller name matches the supplier name in the order line, excludes all bill line data whose unit names do not match, and narrows the search scope of the subsequent matching process; the filtered bill data is output as input for the next matching process.
[0027] Furthermore, in step S4, the many-to-many matching of bills and order lines is performed by combining the multi-dimensional information of the bills with preset condition matching and text content semantic understanding, and combining the numerical data and text semantic similarity scores through weight coefficients. Specifically, the many-to-many matching method of bills and order lines is as follows:
[0028] Condition preset, determine the conditions that need to be met during the matching process;
[0029] The cumulative model is designed to sum the values of the bills that meet the preset conditions. The calculation formula is as follows:
[0030]
[0031] Among them, x i is all possible values of the random variable X, that is, all the conditions are assumed, P(X = x i ) is x i Satisfy a certain preset condition, S a is the cumulative model score;
[0032] The semantic similarity calculation of the rearrangement model is as follows:
[0033]
[0034] Where q is the order line material description, t is the bill invoice description, V(q) and V(t) are the text feature vectors of the order line material description and the bill invoice description, respectively, V(q)·V(t) represents the dot product of the two vectors, ||V(q)|| and ||V(t)|| represent the Euclidean norm of the vector, respectively, S r Score the rearrangement model;
[0035] The comprehensive matching score is calculated by combining the cumulative model and the rearrangement model scores, and the comprehensive matching score is calculated according to the weight ratio. The calculation formula is as follows:
[0036] S=w1·S a +w2·S r
[0037] Among them, w1 and w2 are weight coefficients, S a is the cumulative model score, S r is the rearrangement model score, S is the comprehensive matching score;
[0038] The matching results are sorted and output, and the matching tickets are sorted in descending order according to the comprehensive matching scores.
[0039] Furthermore, the matching result post-processing in step S5 is specifically performed as follows:
[0040] Matching result statistics: summarize all the matching pairs of invoices and order lines obtained through the preliminary matching process, and for each order line, count the number of matching invoices;
[0041] Optimal matching condition setting: setting the optimal matching conditions, such as ensuring that each order line matches as many invoices as possible, or each invoice matches as many order lines as possible;
[0042] Optimal matching strategy test: for each order line, check whether the current matching result meets the optimal matching condition. If there are multiple order lines matching the same invoice, further analysis is required to determine whether the condition of the largest number is met.
[0043] Adjust the matching results. If the current matching results do not meet the optimal matching conditions, make adjustments and reallocate invoices to ensure that the number of invoices matched to each order line is maximized.
[0044] The matching results are output, and the matched bill data is deduplicated to ensure that each order line has only a unique invoice match. The first one or more bills are retained, and the final matching results that have been verified, adjusted and deduplicated are output.
[0045] The present invention also provides a bill and order line many-to-many matching system, comprising an invoice parsing unit, a bill and order line to be matched pre-processing unit, a rule filtering bill unit, a bill and order line many-to-many matching unit, a matching result post-processing unit and a system database;
[0046] The invoice parsing unit parses key information from electronic invoices of different formats, and can directly read data from structured electronic invoices. The electronic invoice parsing processes electronic invoices of different formats into structures to facilitate matching of order line data.
[0047] The preprocessing unit of the bill and the order line to be matched unifies the conversion names of fields with the same meaning, fills in the empty contents of the bill and the order line to be matched, and standardizes the date, value and character format data. In addition, the punctuation marks, English brackets and Chinese brackets and leading and trailing spaces in the unit name field are removed, and the item name and specification model of the bill are merged into the same field, namely, the invoice description, so as to facilitate matching with the material description content of the order line;
[0048] The rule filtering bill unit selects bill line data with the same unit name as the order line to be matched from the submitted bill data, so as to narrow the matching scope and improve the matching efficiency;
[0049] The many-to-many matching unit for bills and order lines designs a cumulative model value summation for bills that meet the set conditions, uses a rearrangement model to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill, combines the cumulative model and the rearrangement model scores, calculates the comprehensive matching score according to the weight ratio, and sorts them in descending order;
[0050] The matching result post-processing unit verifies whether the matching result complies with the optimal matching strategy, that is, ensures that the number of invoices matched to one order is the largest. In addition, the matched invoice data is deduplicated and the first one or more invoices are selected to ensure the uniqueness and accuracy of the matching result.
[0051] The database stores the structured data of the invoice parsing and the bills matched by the order lines.
[0052] The present invention further provides a storage medium of computer-readable instructions, on which a computer program is stored. The computer-readable instructions are executed by a processor to implement the steps of many-to-many matching of bills and order lines.
[0053] In summary, the present invention provides a method for many-to-many matching of bills and order lines. Through many-to-many matching of bills and order lines, a hybrid matching method based on rules and models is used to narrow the invoice matching range by using rule matching, and the cumulative model and the rearrangement model are combined. Numerical and text semantic information are comprehensively considered, and the matching accuracy and reliability are significantly improved. Through automated parsing, preprocessing, rule filtering, intelligent matching and post-processing, the problems of cumbersome manual filling and incomplete information comparison are solved, and the accuracy and work efficiency of matching bills and order lines are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flowchart of the steps of a method for many-to-many matching of bills and order lines;
[0055] Figure 2 The system framework diagram of a many-to-many matching method between bills and order lines is shown in FIG. DETAILED DESCRIPTION
[0056] In order to more clearly and completely describe the technical solutions in the embodiments of the present invention, the present invention is further described in detail below in conjunction with the drawings in the embodiments. The specific embodiments described in the present invention, as well as other embodiments based on the present invention, all belong to the protection scope of the present invention.
[0057] The purpose of the present invention is to provide a method, system and storage medium for many-to-many matching of bills and order lines, which can narrow the invoice matching range by using rule matching based on rule and model hybrid matching method, combine the cumulative model with the rearrangement model, comprehensively consider numerical and text semantic information, and significantly improve the accuracy and reliability of matching. Through automatic parsing, preprocessing, rule filtering, intelligent matching and post-processing, the problems of cumbersome manual filling and incomplete information comparison are solved, and the accuracy and work efficiency of matching bills and order lines are improved.
[0058] like Figure 1 The steps of a many-to-many matching method of bills and order lines of the present invention are as follows:
[0059] Step S1: Invoice parsing: parse out key information from electronic invoices of different formats. For structured electronic invoices, data can be directly read. Electronic invoice parsing structures electronic invoices of different formats to facilitate order line data matching.
[0060] Step S2: Pre-process the bill and the order line to be matched, unify the conversion names of fields with the same meaning, and merge the item name and specification model of the bill into the same field, namely the invoice description, to facilitate matching with the material description content of the order line.
[0061] Step S3: filter bills by rules. In the submitted bill data, filter out the bill line data with the same unit name as the order line to be matched, so as to narrow the matching scope and improve the matching efficiency.
[0062] Step S4: Many-to-many matching of bills and order lines. For bills that meet the set conditions, the cumulative model value is designed to sum. The reordering model is used to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill. Combined with the cumulative model and the reordering model scores, the comprehensive matching score is calculated according to the weight ratio and sorted in descending order.
[0063] Step S5: Post-processing of the matching results to check whether the matching results meet the optimal matching strategy, that is, to ensure that the number of invoices matched to an order is the largest. In addition, the matched bill data is deduplicated and the first one or more bills are taken to ensure the uniqueness and accuracy of the matching results.
[0064] In step S1, the invoice parsing process parses the invoice number, invoice date, invoice price, invoice tax, price and tax total, project name, specification model and other key information according to the invoice format. For structured electronic invoices, data can be directly read. Electronic invoice parsing processes electronic invoices of different formats into structures to facilitate matching of order line data. The invoice parsing method is as follows:
[0065] S101: Invoice format recognition: Perform format recognition on the electronic invoice file to determine whether it is ofd, xml, image or other electronic formats. Perform optical character recognition on the invoice in unstructured image format and convert it into an editable text format.
[0066] S102: Positioning key information: using the fixed layout features of the invoice, determine the location of key information on the invoice through visual inspection or machine learning methods. Use template matching technology to identify the location of fixed fields such as invoice number, invoice date, invoice price, invoice tax, price and tax total, item name and specification model.
[0067] S103: Extract key information: extract key information from the invoice text based on the positioning results. For structured data, such as electronic invoices in XML or JSON format, directly parse the corresponding tags or key-value pairs; for unstructured data, use regular expressions to extract the required information.
[0068] S104: Data structured output, converting the extracted key information into a unified data structure to facilitate subsequent order line data matching.
[0069] In actual applications, after the invoice parsing in step S1, the bill data of different formats are converted into structured data. The parsed bill data table 1 shows some key information:
[0070] Table 1
[0071]
[0072] In step S2, the bill and the order line to be matched are preprocessed respectively. The structured bill data after the invoice is parsed in step S1 contains the buyer's name, seller's name, buyer's taxpayer identification number, seller's taxpayer identification number, invoice number, invoice date, total amount, total tax amount, item name, specification model, unit, quantity, unit price, amount, tax rate / levy rate, tax amount, remarks, invoice issuer, and invoice description fields. The order line to be matched contains the order number, order line item number, material name, supplier name, unit of measurement, quantity, unit price, and submission date fields. The preprocessing methods for the bill and the order line to be matched are as follows:
[0073] S201: Specific methods for bill preprocessing:
[0074] The conversion names of fields with the same meaning are unified. The names of fields with the same meaning in invoices of different industries are slightly different. For fields with the same meaning but different names in the bills, standardization is performed to ensure the consistency of the field names;
[0075] Check whether each field is missing and fill in the missing value with an empty character;
[0076] Standardize date, numeric and character format data respectively, convert different date or string formats of the invoice date field into a unified date format, convert the total amount, total tax amount, quantity, unit price, amount, tax rate / levy rate, and tax amount into numeric format, replace the empty string in the field with 0, and convert other field information into string format;
[0077] Remove punctuation marks, English brackets, Chinese brackets, and leading and trailing spaces from the buyer's name and seller's name fields;
[0078] Combine the item name and specification model into the invoice description field to facilitate matching with the material description content of the order line.
[0079] In actual application, after the bill data is pre-processed in step S201, the invoice number, invoice date, invoice description, quantity, unit price and seller name are shown in Table 2:
[0080] Table 2
[0081]
[0082] S202: Specific method for preprocessing order lines to be matched:
[0083] The conversion names of fields with the same meaning are unified. There are differences in the naming of data fields in order lines of different businesses or industries. The name mapping method is used to convert the fields with the same meaning into the same field name;
[0084] Standardize date, numeric and character format data respectively. Convert different date or character string formats of the submitted date field to a unified date format. Convert the order line number, quantity and unit price to numeric format. Replace the empty string in the field with 0. Convert other field information to string format.
[0085] Remove punctuation marks, English and Chinese brackets, and leading and trailing spaces from the Supplier Name field.
[0086] In actual applications, after the order line data to be matched is pre-processed in step S202, examples of the order number, order line item number, material name, unit of measure, quantity, unit price, supplier name and submission date fields are shown in Table 3.
[0087] Table 3
[0088]
[0089] Further, in step S3, the preset matching rules are applied to filter out the bill line data whose seller name matches the supplier name in the order line, exclude all bill line data whose unit names do not match, and narrow the search scope of the subsequent matching process. The filtered bill data is output as the input of the next matching process.
[0090] Furthermore, in step S4, the bills and order lines are matched in a many-to-many manner, and the multi-dimensional information of the bills is combined to perform preset condition matching and text content semantic understanding, and the numerical data and text semantic similarity scores are combined through weight coefficients to improve the accuracy and reliability of the matching. The many-to-many matching method of bills and order lines is as follows:
[0091] S401: Condition preset, determine the conditions that need to be met during the matching process, such as whether the bill note contains the order number, whether the bill issue date is within the specified range of the order line submission date, and whether the quantity of the bill is equal to that of the order line.
[0092] S402: Design a cumulative model to sum the values of the bills that meet the preset conditions. The calculation formula is as follows:
[0093]
[0094] Among them, x i is all possible values of the random variable X, that is, all the conditions are assumed, P(X = x i ) is x i Satisfy a certain preset condition, S a is the cumulative model score.
[0095] S403: Calculate semantic similarity of the rearrangement model. The formula for calculating the semantic similarity score between the material description of the matching order line and the invoice description of the bill using the rearrangement model is as follows:
[0096]
[0097] Where q is the order line material description, t is the bill invoice description, V(q) and V(t) are the text feature vectors of the order line material description and the bill invoice description, respectively, V(q)·V(t) represents the dot product of the two vectors, ||V(q)|| and ||V(t)|| represent the Euclidean norm of the vector, respectively, S r Score the rearrangement model.
[0098] S404: Calculate the comprehensive matching score. Combine the cumulative model and the rearrangement model scores and calculate the comprehensive matching score according to the weight ratio. The calculation formula is as follows:
[0099] S=w1·S a +w2·S r
[0100] Among them, w1 and w2 are weight coefficients, S a is the cumulative model score, S r is the rearrangement model score, and S is the comprehensive matching score.
[0101] S405: sorting and outputting the matching results, sorting the matching bills in descending order of comprehensive matching scores.
[0102] In actual applications, after many-to-many matching of bills and order lines in step S4, the order lines to be matched will have 0 or more bill matching results. If the material description of the order line to be matched is W900 D500 H2000 office cabinet, the unit is group, the quantity is 2, the unit price is 1301, the supplier name is a certain city office furniture Co., Ltd., and the submission date is 2022-12-10, the matching results are shown in Table 4:
[0103] Table 4
[0104]
[0105] Furthermore, in step S5, the matching result is post-processed. After the many-to-many matching of bills and order lines in step S4, the output result may not be the best matching result. Due to the complex matching scenario of bills and order lines, the matching result needs to be verified and adjusted. The specific processing method is as follows:
[0106] S501: Matching result statistics, summarizing all matching pairs of invoices and order lines obtained through the preliminary matching process. For each order line, count the number of matching invoices.
[0107] S502: Setting the optimal matching conditions, setting the optimal matching conditions, such as ensuring that each order line matches as many invoices as possible, or each invoice matches as many order lines as possible.
[0108] S503: Optimal matching strategy test, for each order line, check whether the current matching result meets the optimal matching condition. If there are multiple order lines matching the same invoice, further analysis is required to determine whether the condition of the largest number is met.
[0109] S504: Matching result adjustment: if the current matching result does not meet the optimal matching condition, necessary adjustments are made, such as reallocating invoices to ensure that the number of invoices matched to each order line is maximized.
[0110] S505: Output the matching results, perform deduplication processing on the matched bill data, ensure that each order line has only one unique invoice to match, retain the first one or more bills, and output the final matching results after verification, adjustment and deduplication.
[0111] In order to implement the above-mentioned many-to-many matching method of bills and order lines, the present invention also includes a many-to-many matching system of bills and order lines.
[0112] like Figure 2 The framework diagram of a many-to-many matching system of bills and order lines is shown, and the system includes an invoice parsing unit, a bill and order line preprocessing unit to be matched, a rule filtering bill unit, a many-to-many matching unit of bills and order lines, a matching result post-processing unit and a system database.
[0113] The invoice parsing unit parses key information from electronic invoices of different formats, and can directly read data from structured electronic invoices. The electronic invoice parsing processes electronic invoices of different formats into structures to facilitate matching of order line data.
[0114] The preprocessing unit for the bill and the order line to be matched unifies the conversion names of fields with the same meaning, fills in the empty contents of the bill and the order line to be matched, and standardizes the date, value and character format data. In addition, it removes punctuation marks, English brackets and Chinese brackets and leading and trailing spaces in the unit name field, and merges the item name and specification model of the bill into the same field, namely the invoice description, to facilitate matching with the material description content of the order line.
[0115] The rule filtering bill unit selects bill line data with the same unit name as the order line to be matched from the submitted bill data, so as to narrow the matching scope and improve the matching efficiency.
[0116] The many-to-many matching unit of bills and order lines designs a cumulative model value summation for bills that meet the set conditions. The rearrangement model is used to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill. Combined with the scores of the cumulative model and the rearrangement model, the comprehensive matching score is calculated according to the weight ratio and sorted in descending order.
[0117] The matching result post-processing unit checks whether the matching result meets the optimal matching strategy, that is, to ensure that the number of invoices matched to an order is the largest. In addition, the matched bill data is deduplicated and the first one or more bills are taken to ensure the uniqueness and accuracy of the matching result.
[0118] The database stores the structured data of the invoice parsing and the bills matched by the order lines.
[0119] In an embodiment, a storage medium of computer-readable instructions is provided, on which a computer program is stored, and the readable instructions are executed by a processor to implement the steps of the method for many-to-many matching of bills and order lines: invoice parsing, preprocessing of bills and order lines to be matched, rule filtering of bills, many-to-many matching of bills and order lines, and finally post-processing of matching results.
[0120] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above-described implementation modes. Within the scope of the present invention and the protection scope of the claims in this field, other forms of embodiments all belong to the protection scope of the present invention.
Claims
1. A many-to-many matching method between bills and order lines, characterized in that: The specific steps of this method are as follows: Step S1, invoice parsing: parsing key information for electronic invoices of different formats, and directly reading data for structured electronic invoices; Step S2, pre-processing of bills and order lines to be matched: the conversion names of fields with the same meaning are unified, and the item name and specification model of the bill are merged into the same field, namely, invoice description, to facilitate matching with the material description content of the order line; Step S3, rule filtering bills: in the submitted bill data, filter out the bill line data with the same unit name as the order line to be matched; Step S4, many-to-many matching of bills and order lines: For bills that meet the set conditions, the cumulative model is designed to sum the values, and the rearrangement model is used to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill. The comprehensive matching score is calculated according to the weight ratio by combining the cumulative model and the rearrangement model scores, and the scores are sorted in descending order; Step S5, post-processing of matching results: check whether the matching results meet the optimal matching strategy, that is, ensure that the number of invoices matched to an order is the largest; in addition, deduplicate the matched bill data and take the first one or more bills to ensure the uniqueness and accuracy of the matching results.
2. A method for many-to-many matching of bills and order lines according to claim 1, characterized in that: Step S1 parses the key information of electronic invoices of different formats, including invoice number, invoice date, invoice price, invoice tax, price and tax total, item name and specification model; for structured electronic invoices, directly read the data, and the invoice parsing method is as follows: Invoice format recognition: perform format recognition on electronic invoice files to determine whether they are ofd, xml, images or other electronic formats; perform optical character recognition on invoices in unstructured image formats and convert them into editable text formats; Key information location: using the fixed layout features of invoices, determine the location of key information on the invoice through visual inspection or machine learning methods; using template matching technology to identify the location of fixed fields such as invoice number, invoice date, invoice price, invoice tax, price and tax total, item name and specification model; Extract key information: extract key information from the invoice text based on the positioning results. For structured data, such as electronic invoices in XML or JSON format, directly parse the corresponding tags or key-value pairs; for unstructured data, use regular expressions to extract the required information; Data structured output converts the extracted key information into a unified data structure to facilitate subsequent order line data matching.
3. A many-to-many matching method of bills and order lines according to claim 1, characterized in that: As described in step S2, the bill and the order line to be matched are preprocessed respectively. Specifically, the structured bill data description after the invoice is parsed contains the buyer's name, seller's name, buyer's taxpayer identification number, seller's taxpayer identification number, invoice number, invoice date, total amount, total tax amount, item name, specification model, unit, quantity, unit price, amount, tax rate / levy rate, tax amount, remarks, invoice issuer, and invoice description fields; the material description content of the order line to be matched contains the order number, order line item number, material name, supplier name, unit of measurement, quantity, unit price and submission date fields.
4. A many-to-many matching method of bills and order lines according to claim 3, characterized in that: The specific method of bill preprocessing is as follows: The conversion names of fields with the same meaning are unified. For fields with the same meaning but different names in bills, standardization is performed to ensure the consistency of field names; Check whether each field is missing and fill in the missing value with an empty character; Standardize date, numeric and character format data respectively, convert different date or string formats of the invoice date field into a unified date format, convert the total amount, total tax amount, quantity, unit price, amount, tax rate / levy rate, and tax amount into numeric format, replace the empty string in the field with 0, and convert other field information into string format; Remove punctuation marks, English brackets, Chinese brackets, and leading and trailing spaces from the buyer's name and seller's name fields; Combine the item name and specification model into the invoice description field to facilitate matching with the material description content of the order line.
5. A many-to-many matching method of bills and order lines according to claim 3, characterized in that: The specific method for preprocessing the order lines to be matched is as follows: The conversion names of fields with the same meaning are unified, and the fields with the same meaning are converted to the same field name using name mapping; Standardize date, numeric and character format data respectively. Convert different date or character string formats of the submitted date field to a unified date format. Convert the order line number, quantity and unit price to numeric format. Replace the empty string in the field with 0. Convert other field information to string format. Remove punctuation marks, English and Chinese brackets, and leading and trailing spaces from the Supplier Name field.
6. A method for many-to-many matching of bills and order lines according to claim 1, characterized in that: In step S3, the preset matching rules are applied to filter out the bill line data whose seller name matches the supplier name in the order line, exclude all bill line data whose unit names do not match, and narrow the search scope of the subsequent matching process; the filtered bill data is output as input for the next matching process.
7. A many-to-many matching method of bills and order lines according to claim 1, characterized in that: In step S4, the many-to-many matching of bills and order lines is performed by combining the multi-dimensional information of the bills with preset condition matching and text content semantic understanding, and combining the numerical data and text semantic similarity scores through weight coefficients. Specifically, the many-to-many matching method of bills and order lines is as follows: Condition preset, determine the conditions that need to be met during the matching process; The cumulative model is designed to sum the values of the bills that meet the preset conditions. The calculation formula is as follows: Among them, x i is all possible values of the random variable X, that is, all the conditions are assumed, P(X = x i ) is x i Satisfy a certain preset condition, S a is the cumulative model score; The semantic similarity calculation of the rearrangement model is as follows: Where q is the order line material description, t is the bill invoice description, V(q) and V(t) are the text feature vectors of the order line material description and the bill invoice description, respectively, V(q)·V(t) represents the dot product of the two vectors, ||V(q)|| and ||V(t)|| represent the Euclidean norm of the vector, respectively, S r Score the rearrangement model; The comprehensive matching score is calculated by combining the cumulative model and the rearrangement model scores, and the comprehensive matching score is calculated according to the weight ratio. The calculation formula is as follows: S=w1·S a +w2·S r Among them, w1 and w2 are weight coefficients, S a is the cumulative model score, S r is the rearrangement model score, S is the comprehensive matching score; The matching results are sorted and output, and the matching tickets are sorted in descending order according to the comprehensive matching scores.
8. A many-to-many matching method of bills and order lines according to claim 1, characterized in that: The matching result post-processing in step S5 is specifically performed as follows: Matching result statistics: summarize all the matching pairs of invoices and order lines obtained through the preliminary matching process, and for each order line, count the number of matching invoices; Optimal matching condition setting: setting the optimal matching conditions, such as ensuring that each order line matches as many invoices as possible, or each invoice matches as many order lines as possible; Optimal matching strategy test: for each order line, check whether the current matching result meets the optimal matching condition. If there are multiple order lines matching the same invoice, further analysis is required to determine whether the condition of the largest number is met. Adjust the matching results. If the current matching results do not meet the optimal matching conditions, make adjustments and reallocate invoices to ensure that the number of invoices matched to each order line is maximized. The matching result is output, and the matched bill data is deduplicated to ensure that each order line has only a unique invoice match. The first one or more bills are retained, and the final matching result after verification, adjustment and deduplication is output.
9. A many-to-many matching system of bills and order lines, characterized in that: It includes an invoice parsing unit, a pre-processing unit for bills and order lines to be matched, a rule filtering bill unit, a many-to-many matching unit for bills and order lines, a matching result post-processing unit and a system database; The invoice parsing unit parses key information from electronic invoices of different formats, and can directly read data from structured electronic invoices. The electronic invoice parsing processes electronic invoices of different formats into structures to facilitate matching of order line data. The preprocessing unit of the bill and the order line to be matched unifies the conversion names of fields with the same meaning, fills in the empty contents of the bill and the order line to be matched, and standardizes the date, value and character format data. In addition, the punctuation marks, English brackets and Chinese brackets and leading and trailing spaces in the unit name field are removed, and the item name and specification model of the bill are merged into the same field, namely, the invoice description, so as to facilitate matching with the material description content of the order line; The rule filtering bill unit selects bill line data with the same unit name as the order line to be matched from the submitted bill data, so as to narrow the matching scope and improve the matching efficiency; The many-to-many matching unit for bills and order lines designs a cumulative model value summation for bills that meet the set conditions, uses a rearrangement model to calculate the semantic similarity score between the material description of the order line to be matched and the invoice description of the bill, combines the cumulative model and the rearrangement model scores, calculates the comprehensive matching score according to the weight ratio, and sorts them in descending order; The matching result post-processing unit verifies whether the matching result complies with the optimal matching strategy, that is, ensures that the number of invoices matched to one order is the largest. In addition, the matched invoice data is deduplicated and the first one or more invoices are selected to ensure the uniqueness and accuracy of the matching result. The database stores the structured data of the invoice parsing and the bills matched by the order lines.
10. A storage medium of computer-readable instructions, wherein a computer program is stored on the storage medium of computer-readable instructions, and the computer program is executed by a processor to implement the steps of many-to-many matching of bills and order lines.
Citation Information
Patent Citations
Electronic invoice full face information extraction method and system
CN115171143A
Intelligent business data matching method and system and storage medium
CN117407726A
Automatic invoice checking and transaction account checking system
CN118014747A
