Invoice distribution method and device, equipment and storage medium
By matching equal amounts of invoice allocation methods in supply chain batch business scenarios and preprocessing data, the inefficiency problem of manually filling in invoice usage in the existing technology is solved, and the accurate and efficient allocation of invoice amounts is achieved, and the customer experience is improved.
Patent Information
- Application Number
- CN202411502782.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-03-11
AI Technical Summary
In the supply chain batch business scenario, the existing technology requires manual upload of invoices and manual filling of the amount of use of each invoice under each application, resulting in high learning costs for customers, low business processing accuracy, long time consumption, and large customer support investment, and poor overall customer experience.
A method of invoice allocation is proposed. By pre-processing data on the initial to-matching business application and the initial to-distributed invoice, a list of to-matching business application and to-distributed invoice list is obtained, traversing the to-matching business application list, matching equal amounts based on the to-distributed invoice list, determining the invoice allocation list, and updating the to-matching business application list and to-distributed invoice list based on the list, until the to-matching business application list is traversed, and the target invoice allocation result is obtained.
It realizes accurate and efficient allocation of batch business applications to the corresponding invoice amount, reduces errors and inefficiency in manual operations, and is suitable for large-scale and high-frequency trading scenarios.
Smart Images

Figure CN119599748A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data matching technology, and in particular to an invoice distribution method, device, equipment and storage medium. Background Art
[0002] In the current supply chain batch business scenario, for each business application, it is necessary to manually upload invoices and manually fill in the usage amount of each invoice under each application. The learning cost for customers to conduct batch business is high, the accuracy of business processing is low, and it requires more business time and customer support investment, resulting in a poor overall customer experience.
[0003] How to accurately and efficiently allocate batch business applications to the corresponding invoice amounts has become a problem to be solved.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide an invoice allocation method, device, equipment and storage medium, aiming to solve the technical problem of how to accurately and efficiently allocate batch business applications to the corresponding invoice amounts.
[0006] To achieve the above objectives, the present application proposes an invoice allocation method, wherein the method comprises:
[0007] Perform data preprocessing on the initial business applications to be matched and the initial invoices to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated;
[0008] Traversing the list of business applications to be matched, obtaining the current business application, and performing equal-amount matching on the current business application according to the list of invoices to be allocated to obtain an equal-amount matching result;
[0009] Determine the invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result;
[0010] The to-be-matched business application list and the to-be-allocated invoice list are updated based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
[0011] In one embodiment, the step of updating the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain the target invoice allocation result includes:
[0012] Determine the invoice splitting result according to the usage amount of the allocated invoices in the invoice allocation list;
[0013] The to-be-matched business application list and the to-be-allocated invoice list are updated according to the invoice splitting result, until the to-be-matched business application list is traversed to obtain the target invoice allocation result.
[0014] In one embodiment, the step of preprocessing the data of the initial business applications to be matched and the initial invoices to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated includes:
[0015] Filter the business applications whose target amount is a preset amount in the initial business applications to be matched, and obtain a list of business applications to be matched;
[0016] The invoices to be allocated whose available amounts in the initial invoices to be allocated are the preset amounts are filtered to obtain a list of invoices to be allocated.
[0017] In one embodiment, the step of determining the invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result includes:
[0018] When the equal-amount matching result is that there are invoices to be allocated whose available amount is equal to the amount of the current business application in the invoice list to be allocated, the invoices to be allocated with the same amount are used as the invoice allocation list of the current business application;
[0019] When the equal-amount matching result is that there is no invoice to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, the invoice list to be allocated is sorted to obtain a sorted invoice list, and the invoice allocation list of the current business application is determined from the sorted invoice list.
[0020] In one embodiment, the step of determining the invoice allocation list for the current business application from the sorted invoice list comprises:
[0021] Obtaining the integer part of the available amount of the invoice to be allocated in the sorted invoice list, and using the integer part of the available amount as the occupied amount and value of the invoice to be allocated;
[0022] The integer part of the amount of the current business application is used as the limit amount;
[0023] An invoice distribution list for the current business application is determined from the sorted invoice list according to the occupancy amount, the value amount and the limit amount.
[0024] In one embodiment, the step of determining the invoice allocation list for the current business application from the sorted invoice list according to the occupied amount, the value amount and the limit amount comprises:
[0025] determining an initial allocation invoice from the ranked invoice list based on the occupancy amount, the value amount, and the limit amount;
[0026] When the accumulated available amount of the initial allocated invoices is less than the amount of the current business application, determining a supplementary allocated invoice from the sorted invoice list;
[0027] An invoice distribution list for the current business application is determined according to the initial distribution invoice and the supplementary distribution invoice.
[0028] In one embodiment, the step of updating the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain the target invoice allocation result further includes:
[0029] Verify whether the amount of the business application in the target invoice allocation result is equal to the sum of the corresponding allocated invoice amounts, and obtain a business application abnormality verification result;
[0030] Verify whether the used amount of the allocated invoice in the target invoice allocation result is less than or equal to the available amount, and obtain an invoice anomaly verification result;
[0031] When the business application exception verification result and / or the invoice exception verification result do not meet the preset conditions, invoice allocation exception information is generated to issue an exception reminder.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes an invoice distribution device, the invoice distribution device comprising:
[0033] A data processing module is used to perform data preprocessing on the initial business applications to be matched and the initial invoices to be allocated, and obtain a list of business applications to be matched and a list of invoices to be allocated;
[0034] An equal amount matching module is used to traverse the list of business applications to be matched, obtain the current business application, and perform equal amount matching on the current business application according to the list of invoices to be allocated to obtain an equal amount matching result;
[0035] An invoice allocation module, configured to determine an invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result;
[0036] The result determination module is used to update the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
[0037] In addition, to achieve the above objectives, the present application also proposes an invoice distribution device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the invoice distribution method described above.
[0038] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the invoice distribution method described above are implemented.
[0039] In addition, to achieve the above objectives, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the invoice distribution method described above are implemented.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] Data preprocessing is performed on the initial business application to be matched and the initial invoice to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated, the list of business applications to be matched is traversed to obtain the current business application, and the current business application is matched in equal amounts according to the list of invoices to be allocated to obtain an equal amount matching result, the invoice allocation list of the current business application is determined from the list of invoices to be allocated according to the equal amount matching result, and the list of business applications to be matched and the list of invoices to be allocated are updated based on the invoice allocation list until the list of business applications to be matched is traversed to obtain the target invoice allocation result, in the invoice allocation process, after data preprocessing is performed on the imported business applications and invoices to be allocated, equal amount matching is preferentially performed on each traversed business application, and then the invoice allocation list of the business application is determined according to the equal amount matching result, to ensure that each business application can be accurately and efficiently allocated to the corresponding invoice amount, reduce errors and inefficiency in manual operations, and can be applicable to large-scale and high-frequency transaction scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A flowchart of the first embodiment of the invoice allocation method of the present application is provided;
[0045] Figure 2 A flowchart of the second embodiment of the invoice allocation method of this application is provided;
[0046] Figure 3 A flowchart of the third embodiment of the invoice allocation method of this application is provided;
[0047] Figure 4 A brief flowchart of the invoice allocation method provided in Example 2 of the present application;
[0048] Figure 5 This is a schematic diagram of the module structure of the invoice distribution device according to an embodiment of the present application;
[0049] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the invoice distribution method in the embodiment of the present application.
[0050] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0053] In the current supply chain batch business scenario, for each business application, it is necessary to manually upload invoices and manually fill in the usage amount of each invoice under each application. The learning cost for customers to conduct batch business is high, the accuracy of business processing is low, and it requires more business time and customer support investment, resulting in a poor overall customer experience.
[0054] The solution proposed in this application first matches the business application with equal amounts during the invoice allocation process, giving priority to matching with invoices of equal amounts, thereby reducing the number of invoice splits and the waste of large invoice amounts. In the supply chain batch business scenario, the automatic splitting of invoice amounts and the intelligent optimal matching with the business application amounts can be achieved.
[0055] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, invoice distribution, etc. The following takes invoice distribution as an example to illustrate this embodiment and the following embodiments.
[0056] Based on this, the present application embodiment provides an invoice allocation method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the invoice allocation method of the present application.
[0057] In this embodiment, the invoice allocation method includes steps S10 to S40:
[0058] Step S10, pre-processing the data of the initial business applications to be matched and the initial invoices to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated;
[0059] It should be noted that the initial business application to be matched refers to the batch business application information imported by the customer that has not yet been matched with the invoice. Specifically, each business application information needs to include the business application number, application date, application amount, applicant information, and business details. The initial invoice to be allocated refers to the trade background invoice information imported by the customer in batches. The trade background invoice refers to the invoice issued by the seller to the buyer based on the actual sales behavior in the transaction of goods or services. The information of each invoice to be allocated includes the invoice number, invoice date, and available credit limit, etc.
[0060] It should be understood that in order to ensure the integrity and validity of the data used in the invoice allocation process, the imported initial business applications to be matched and initial invoices to be allocated need to be preprocessed to obtain a list of business applications to be matched and a list of invoices to be allocated.
[0061] In a feasible implementation, step S10 may include: filtering business applications whose target amount is a preset amount in the initial business applications to be matched to obtain a list of business applications to be matched; filtering invoices to be allocated whose available amount is the preset amount in the initial invoices to be allocated to obtain a list of invoices to be allocated.
[0062] It should be understood that in the process of invoice allocation, in order to reduce the amount of calculation and processing time of the system, invalid business applications and data to be allocated can be filtered to obtain a list of business applications to be matched and a list of invoices to be allocated. Specifically, the preset amount is generally set to 0, because data with an amount of 0 may cause errors or confusion in the system during the matching process. If an attempt is made to match an invoice with an amount of 0 to be allocated to a business application with a non-zero amount during the invoice allocation process, it may cause a matching failure or generate an erroneous financial record.
[0063] Step S20, traversing the list of business applications to be matched, obtaining the current business application, and performing equal-amount matching on the current business application according to the list of invoices to be allocated to obtain an equal-amount matching result;
[0064] It should be understood that during the invoice allocation process, the business applications in the to-be-matched business application list will be processed cyclically. When the current business application to be matched is obtained, the to-be-allocated invoice list will be traversed first to determine whether there is an invoice in the to-be-allocated invoice list with an available amount equal to the amount of the current business application, and obtain an equal amount matching result.
[0065] It should be noted that the available amount of the invoice will be split during the invoice allocation process, and an equal amount match will be performed for each traversed business application, so that some split invoices can be matched with equal amounts, avoiding further splitting and reducing the complexity of processing the available amount of the invoice.
[0066] Step S30, determining the invoice allocation list of the current business application from the list of invoices to be allocated according to the equal-amount matching result;
[0067] It should be noted that the equal amount matching result is used to determine the number of invoices to be matched for the current business application. For the current business application where the equal amount matching result is that the available amount of the invoice matched is equal to the business application amount, the corresponding invoice allocation list is a single invoice. For the current business application where the equal amount matching result is that the available amount of the invoice matched is not equal to the business application amount, the corresponding invoice allocation list is a single invoice or multiple invoices to be split for use. Perform an equal amount matching for each business application first, and determine a single invoice or multiple invoices from the invoice list to be allocated as the invoice allocation list for the current business application based on the equal amount matching result, so that the business applications in the batch business application can be matched as much as possible, reducing the waste of invoice quotas during the invoice allocation process.
[0068] It should be understood that the invoice allocation list of the current business application at least includes the invoice number, usage amount and available amount of each invoice. For a business application with only a single invoice in the invoice allocation list, the usage amount of the business application that successfully matches the equal amount is equal to the available amount; the usage amount of the business application that fails to match the equal amount is less than the available amount. For a business application with multiple invoices in the invoice allocation list, one case is that the cumulative usage amount of multiple invoices is equal to the cumulative available amount, in which case the usage amount of each invoice should be equal to the available amount, and the other case is that the cumulative usage amount of multiple invoices is less than the cumulative available amount, in which case only one of the multiple invoices has a usage amount less than the available amount, and the usage amounts of the other invoices are equal to the available amount.
[0069] Step S40: updating the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
[0070] It should be understood that after obtaining the invoice allocation list of the current business application, the current business application will be removed from the list of business applications to be matched to obtain an updated list of business applications to be matched. Invoices whose used amounts in the invoice allocation list are equal to the available amounts will be removed from the list of invoices to be allocated to obtain an updated list of invoices to be allocated. Invoice allocation is performed on the next business application until the invoice allocation lists of all business applications are obtained, i.e., the target invoice allocation result.
[0071] In a feasible implementation manner, after step S40, steps S50 to S70 may also be included:
[0072] Step S50, verifying whether the amount of the business application in the target invoice allocation result is equal to the sum of the corresponding allocated invoice amounts, and obtaining a business application abnormality verification result;
[0073] It should be understood that the target invoice allocation result contains the invoice allocation list corresponding to each business application. The total invoice amount can be allocated by adding up the usage amount of each invoice in the invoice allocation list. When the amount of the business application is equal to the total amount of the corresponding allocated invoices, the business application abnormality check result is marked as no. When the amount of the business application is not equal to the total amount of the corresponding allocated invoices, it means that there is an omission or over-allocation in the invoice allocation process of the business application. It is necessary to remind the customer that the business application amount does not match the invoice allocation amount, and the business application abnormality check result is marked as yes.
[0074] Step S60, verifying whether the used amount of the allocated invoice in the target invoice allocation result is less than or equal to the available amount, and obtaining an invoice abnormality verification result;
[0075] It should be understood that when the amount used in the allocated invoice is less than or equal to the available amount, the invoice abnormality verification result is marked as No. When the amount used in the allocated invoice is greater than the available amount, it means that the amount used in the invoice exceeds its available amount, and the customer needs to be reminded that the invoice amount is insufficient to cover the business application amount, and the invoice abnormality verification result is marked as Yes.
[0076] Step S70, when the business application abnormality verification result and / or the invoice abnormality verification result do not meet the preset conditions, invoice allocation abnormality information is generated to issue an abnormality reminder.
[0077] It should be understood that after verifying all business application allocation amounts and all invoice usage amounts, the abnormal verification results of each business application and each invoice will be obtained. If the abnormal verification results of each business application and each invoice are marked as no, the usage amount of each invoice under each application is generated according to the target invoice allocation result. If there is a business application or invoice data with an abnormal verification result marked as yes, that is, the business application abnormal verification result and / or the invoice abnormal verification result do not meet the preset conditions, the invoice allocation abnormal information is generated to remind the customer of the abnormality.
[0078] It should be noted that the invoice allocation exception information needs to include exception type information (business application exception or invoice exception), relevant business application information (including business application number, business application number amount, allocated invoice number and allocated invoice usage amount) or invoice information (including invoice number, invoice usage amount and invoice available amount), so that customers can adjust the invoice allocation list according to the invoice allocation exception information and obtain the adjusted target invoice allocation result to ensure the accuracy and compliance of the final invoice allocation result.
[0079] The present embodiment provides an invoice allocation method, which performs data preprocessing on an initial business application to be matched and an initial invoice to be allocated to obtain a business application list to be matched and a invoice list to be allocated, traverses the business application list to be matched, obtains the current business application, performs equal-amount matching on the current business application according to the invoice list to be allocated, obtains an equal-amount matching result, determines an invoice allocation list of the current business application from the invoice list to be allocated according to the equal-amount matching result, updates the business application list to be matched and the invoice list to be allocated based on the invoice allocation list, until the business application list to be matched is traversed to obtain a target invoice allocation result, performs data preprocessing on the imported business application and the invoice to be allocated during the invoice allocation process, preferentially performs equal-amount matching on each traversed business application, and then determines the invoice allocation list of the business application according to the equal-amount matching result, thereby ensuring that each business application can be accurately and efficiently allocated to the corresponding invoice amount, reducing errors and inefficiency in manual operations, and being applicable to large-scale and high-frequency transaction scenarios.
[0080] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , step S30 also includes steps S31-S32:
[0081] Step S31, when the equal amount matching result is that there are invoices to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, the invoices to be allocated with the equal amount are used as the invoice allocation list of the current business application;
[0082] It should be understood that when the equal-amount matching result is that there are invoices to be allocated in the list of invoices to be allocated with an available amount equal to the amount of the current business application, the invoices to be allocated with the equal amount will be used as the invoice allocation list for the current business application to reduce the problem of handling the remaining amount caused by partial matching and simplify the invoice allocation process.
[0083] Specifically, the list of invoices to be allocated can be traversed to find invoices with available amounts equal to the current business application amount, and the first traversed invoice with available amounts equal to the current business application amount is used as the invoice allocation list for the current business application.
[0084] Step S32, when the equal amount matching result is that there is no invoice to be allocated with an available amount equal to the amount of the current business application in the invoice to be allocated list, sort the invoice to be allocated list to obtain a sorted invoice list, and determine the invoice allocation list of the current business application from the sorted invoice list.
[0085] It should be understood that when the equal amount matching result is that there is no invoice to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, it is necessary to obtain multiple invoices or split a single invoice to match the current business application.
[0086] It should be noted that the sorted invoice list refers to the invoice list that is sorted from the smallest to the largest available amount. When obtaining invoices from the sorted invoice list for allocation, invoices with smaller amounts will be given priority to reduce the remaining amount of large invoices and avoid wasting invoice amounts.
[0087] In a feasible implementation, the step of determining the invoice allocation list of the current business application from the sorted invoice list in step S32 may include steps A11 to A13:
[0088] Step A11, obtaining the integer part of the available amount of the invoice to be allocated in the sorted invoice list, and using the integer part of the available amount as the occupied amount and value of the invoice to be allocated;
[0089] It should be noted that in order to make the total available amount of the matched invoices as close as possible to the amount of the current business application, the number of times the invoice is split is reduced. This embodiment uses the 0-1 backpack algorithm to match the current business application with the sorted invoice list. The 0-1 backpack algorithm is used to solve the 0-1 backpack problem. The goal is to select a group of items so that the total value of the items in the backpack is maximized, and the total weight of the items in the backpack does not exceed the load-bearing limit of the backpack. Each item can only be selected once, that is, either put into the backpack completely or not.
[0090] It should be understood that the amount of invoices to be allocated corresponds to the weight of the items in the 0-1 backpack problem, and the value of invoices to be allocated corresponds to the value of the items in the 0-1 backpack problem. That is, the sum of the integer parts of the available amounts of the invoices to be allocated in the final solved invoice allocation list needs to be the largest, and the sum of the integer parts of the available amounts cannot exceed the limit amount.
[0091] In addition, it should be noted that, considering that the available amount of invoices to be allocated in the context of supply chain trade is often relatively large, if the integer part and the decimal part are comprehensively considered to match batches of business applications and invoices, a large amount of computing memory will be used in the process of solving through the 0-1 backpack algorithm, and it will take a long time. Here, the integer part of the available amount of the invoice to be allocated is taken as the occupancy and value of the invoice to be allocated for matching.
[0092] Step A12, taking the integer part of the amount of the current business application as the limit amount;
[0093] It should be understood that the limit corresponds to the load-bearing limit of the backpack in the 0-1 backpack problem, and the sum of the integer parts of the available amounts of the invoice combination finally solved cannot exceed the limit amount.
[0094] Step A13: determining the invoice allocation list for the current business application from the sorted invoice list according to the occupied amount, the value amount and the restricted amount.
[0095] It should be understood that by constraining the amount of invoices to be allocated through the 0-1 backpack algorithm, the value of the invoices to be allocated can be maximized, and the invoice combination closest to the integer part of the amount of the business application can be obtained. However, the available amount of the invoice combination obtained by the 0-1 backpack algorithm may not cover the amount of the business application. It is necessary to comprehensively consider the available amount of the invoice and the integer and decimal parts of the amount of the business application to determine the final invoice allocation list.
[0096] In a feasible implementation, step A13 may include steps B10 to B30:
[0097] Step B10, determining an initial allocation invoice from the sorted invoice list according to the occupied amount, the value amount and the limit amount;
[0098] It should be understood that the initial allocation of invoices refers to the use of a 0-1 knapsack algorithm, with the integer part of the amount of the input business application as the target value (i.e., the limit amount), and the integer part of the amount that can be occupied by the invoice as the weight (i.e., the occupied amount) and value (i.e., the value amount), to obtain the invoice combination closest to the target value.
[0099] Exemplarily, the process of determining the initial allocation invoice through the 0-1 knapsack is as follows:
[0100] When defining the problem parameters, it is necessary to determine the integer part of the amount of the business application as the target value of the backpack, obtain the number of invoices to be allocated as the number of selectable items, and determine the integer part of the amount that can be occupied by each invoice as the weight and value of the invoice to be allocated. When initializing the dynamic programming array, create an array to record the minimum weight required for the backpack to reach different values. Initialize the weight when the value is 0 to 0, indicating that the weight is 0 when there is no item. Initialize the weight of other values to infinity, indicating that the value cannot be reached when there is no item. When filling the dynamic programming array, traverse each invoice, and for each invoice, check whether its weight is suitable for the backpack load currently being considered. For each possible value, consider two cases: not selecting the current invoice and selecting the current invoice. If the current invoice is selected, the weight of the value is updated to the smaller of selecting and not selecting. In the process of finding the combination closest to the target value, after completing the traversal of all invoices, check the value corresponding to the maximum load of the backpack, that is, the maximum value that can be reached. If the maximum load cannot be reached exactly, find the invoice combination with the value closest to the maximum load. When searching for an invoice combination, start from the largest load and check which invoices are selected to reach the target value. If you need to add an invoice to get the target value, select this invoice and subtract its value from the total value. Continue this process until the value is 0.
[0101] Finally, the maximum value that can be achieved is output, and the invoice combination that achieves this maximum value is the initial allocated invoice.
[0102] Step B20, when the accumulated available amount of the initial allocated invoices is less than the amount of the current business application, determining a supplementary allocated invoice from the sorted invoice list;
[0103] It should be understood that in order to ensure that the available amount of the invoices allocated to the current business application can cover the amount of the current business application, the cumulative available amount of the initial allocated invoices and the amount of the current business application are compared by comprehensively considering the integer and decimal parts. When the cumulative available amount is less than the amount of the current business application, after removing the initial allocated invoices from the sorted invoice list, one or more invoices to be allocated are obtained from the sorted invoice list in ascending order until the cumulative available amount of the initial allocated invoices and the supplementary invoices is greater than or equal to the amount of the current business application. The supplementary invoices are referred to as the supplementary allocated invoices.
[0104] Step B30: determining the invoice allocation list of the current business application according to the initial allocation invoice and the supplementary allocation invoice.
[0105] It should be understood that the cumulative available amount of the invoice allocation list of the current business application determined based on the initial allocation invoice and the supplementary allocation invoice should be greater than or equal to the amount of the current business application. If the cumulative available amount of the invoice allocation list should be greater than the amount of the current business application, the available amount of the last supplementary invoice will be split so that the cumulative amount of the invoice allocation list is equal to the amount of the current business application.
[0106] In this embodiment, based on the equal-amount matching result, the to-be-allocated invoices with equal amounts are used as the invoice allocation list for the current business application, or the to-be-allocated invoice list is sorted to obtain a sorted invoice list, and the invoice allocation list for the current business application is determined from the sorted invoice list, which can simplify the invoice allocation process while accurately allocating invoices.
[0107] Based on the above first and second embodiments, a third embodiment of the invoice allocation method is proposed. Please refer to Figure 3 , Figure 3 This is a flow chart of the third embodiment of the invoice allocation method of the present application. Step S40 may include steps S41 to S42:
[0108] Step S41, determining the invoice splitting result according to the usage amount of the allocated invoices in the invoice allocation list;
[0109] It should be noted that the invoice allocation list contains the usage amount of each allocated invoice corresponding to the current business application. When the total available amount of the allocated invoices is greater than the current business application amount, the available amount of the allocated invoices will be split, and the available amount of the split invoice will be divided into the usage amount and the remaining available amount to obtain the invoice split result.
[0110] It should be understood that before the step of determining the result of invoice splitting according to the usage amount of the allocated invoices in the invoice allocation list, if the current business application successfully matches the list of invoices to be allocated, the total available amount of the allocated invoices is equal to the current business application amount, and the invoice does not need to be split at this time; if the current business application fails to match the list of invoices to be allocated, the list of invoices to be allocated is sorted from small to large according to the available amount, and the total available amount of the invoice combination closest to the amount of the current business application is obtained according to the 0-1 backpack algorithm, which is equal to the current business application amount, and the invoice does not need to be split. In the case where no invoice splitting is required, after obtaining the invoice allocation list, the current business application and the invoice matching the current business application are removed from the current business application and the list of invoices to be allocated, and the next current business application is obtained for matching.
[0111] In addition, it should be understood that if the current business application fails to match the amount of the invoice list to be allocated, after sorting the invoice list to be allocated according to the available amount from small to large to obtain a sorted invoice list, if the available total amount of the invoice combination closest to the amount of the current business application obtained from the sorted invoice list according to the 0-1 backpack algorithm is greater than the current business application amount, then the invoice combination obtained according to the 0-1 backpack algorithm is removed from the sorted invoice list, and the supplementary invoice allocation list is obtained in order from small to large, and the invoice obtained last in the supplementary invoice allocation list is used as the target split invoice, and the available amount of the target split invoice is split to obtain the invoice split result.
[0112] Step S42, updating the to-be-matched business application list and the to-be-allocated invoice list according to the invoice splitting result, until the to-be-matched business application list is traversed to obtain the target invoice allocation result.
[0113] It should be understood that, according to the invoice splitting result, the unsplit invoices in the allocated invoices are removed from the list of invoices to be allocated, and the remaining available amount of the split invoices in the allocated invoices is updated to obtain an updated list of invoices to be allocated, and the current business application of the matched invoice is removed from the list of business applications to be matched to obtain an updated list of business applications to be matched, and the matching process of subsequent business applications is entered until the list of business applications to be matched is traversed to obtain the target invoice allocation result, which contains the invoice allocation list of all business applications.
[0114] In this embodiment, each split invoice will enter the allocation process of the next business application. When allocating invoices for each business application, equal allocation is prioritized, so that each split invoice can be matched with equal amounts first, which can reduce the number of splits of a single invoice. The split invoices are smaller invoices obtained from the sorted invoice list, which can reduce the waste of large invoices, simplify the invoice splitting process, and achieve efficient splitting of invoice amounts in the supply chain batch business scenario.
[0115] For example, to help understand the implementation process of the invoice allocation method obtained by combining the above-mentioned embodiment 1 and embodiment 2, please refer to Figure 4 , Figure 4 A brief flowchart of an invoice allocation method is provided, specifically:
[0116] For the initial business applications to be matched and initial invoices to be allocated imported by the customer, filter the business applications with a target amount of 0 and the invoices to be allocated with an available amount of 0 to obtain a list of business applications to be matched and a list of invoices to be allocated. After traversing the list of business applications to be matched and obtaining the current business application, first match the invoices with the same amount as the current business application from the list of invoices to be allocated.
[0117] If the equal amount match is successful, the matched invoices with the same amount will be used as the invoice allocation list of the current business application, the next business application will be obtained, and the list of business applications to be matched and the list of invoices to be allocated will be updated. If the equal amount match fails, the invoice allocation for the current business application will continue, and the invoices to be allocated in the list of invoices to be allocated will be sorted from small to large according to the available amount to obtain the sorted invoice list, and the integer part of the available amount of the invoices to be allocated in the sorted invoice list and the integer part of the amount of the current business application will be obtained. The 0-1 backpack algorithm will be used to obtain the combination of the integer part of the available amount of the invoice that best matches the integer part of the amount of the current business application, and the initial allocation invoice will be obtained, and the sorted invoice list will be updated. The available amount of the initial allocation invoices obtained will be accumulated in order, and it will be determined whether the accumulated amount is less than the business application amount.
[0118] If the accumulated available amount of the initial allocated invoice is not less than the business application amount, the initial allocated invoice is used as the invoice allocation list of the current business application, the next business application is obtained, and the business application list to be matched and the invoice list to be allocated are updated. If the accumulated available amount of the initial allocated invoice is less than the business application amount, one or more invoices are obtained from the sorted invoice list in order to obtain the supplementary allocated invoice, so that the sum of the available amounts of the initial allocated invoice and the supplementary allocated invoice can cover the amount of the current business application, and the invoice is split according to the used amount of the allocated invoices in the invoice allocation list to obtain the invoice allocation list of the current business application, the next business application is obtained, and the business application list to be matched and the invoice list to be allocated are updated. After traversing the business application list to be matched to obtain the target invoice allocation list containing the invoice allocation list of all business applications, first check whether the amount of the business application in the target invoice allocation result is equal to the sum of the corresponding allocated invoice amounts, and then check whether the used amount of the allocated invoice in the target invoice allocation result is less than or equal to the available amount of the corresponding invoice to be allocated. If any of the verification results is negative, invoice allocation exception information is generated, and the customer is reminded of the exception. If both verification results are positive, the target invoice allocation result is output.
[0119] The solution proposed in this application, in the process of invoice allocation, first matches the business application with equal amount and sorts the invoice list from small to large, giving priority to matching with equal amount and small amount invoices, reducing the number of invoice splits and reducing the waste of large amount invoices. In the supply chain batch business scenario, it can realize the automatic splitting of invoice amount and the intelligent optimal matching with the business application amount.
[0120] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the invoice distribution method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0121] This application also provides an invoice distribution device, please refer to Figure 5 , the invoice distribution device comprises:
[0122] The data processing module 10 is used to perform data preprocessing on the initial business applications to be matched and the initial invoices to be allocated, and obtain a list of business applications to be matched and a list of invoices to be allocated;
[0123] The equal amount matching module 20 is used to traverse the list of business applications to be matched, obtain the current business application, and perform equal amount matching on the current business application according to the list of invoices to be allocated to obtain an equal amount matching result;
[0124] An invoice allocation module 30, configured to determine an invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result;
[0125] The result determination module 40 is used to update the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
[0126] The invoice allocation device provided by the present application adopts the invoice allocation method in the above embodiment, which can solve the technical problem of how to accurately and efficiently allocate the corresponding invoice amount to batch business applications. Compared with the prior art, the beneficial effects of the invoice allocation device provided by the present application are the same as the beneficial effects of the invoice allocation method provided by the above embodiment, and the other technical features in the invoice allocation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0127] In one embodiment, the result determination module 40 is further used to determine the invoice splitting result based on the usage amount of the allocated invoices in the invoice allocation list; update the list of business applications to be matched and the list of invoices to be allocated based on the invoice splitting result until the list of business applications to be matched is traversed to obtain the target invoice allocation result.
[0128] In one embodiment, the data processing module 10 is further used to filter the business applications whose target amount is a preset amount in the initial business applications to be matched to obtain a list of business applications to be matched; and to filter the invoices to be allocated whose available amount is the preset amount in the initial invoices to be allocated to obtain a list of invoices to be allocated.
[0129] In one embodiment, the invoice allocation module 30 is further used to, when the result of the equal-amount matching is that there are invoices to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, use the invoices to be allocated with the equal amount as the invoice allocation list for the current business application; when the result of the equal-amount matching is that there are no invoices to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, sort the invoice list to obtain a sorted invoice list, and determine the invoice allocation list for the current business application from the sorted invoice list.
[0130] In one embodiment, the invoice allocation module 30 is further used to obtain the integer part of the available amount of the invoices to be allocated in the sorted invoice list, and use the integer part of the available amount as the occupancy and value of the invoices to be allocated; use the integer part of the amount of the current business application as the limit amount; and determine the invoice allocation list of the current business application from the sorted invoice list based on the occupancy, the value and the limit amount.
[0131] In one embodiment, the invoice allocation module 30 is further used to determine the initial allocated invoice from the sorted invoice list based on the occupancy amount, the value amount and the limit amount; when the accumulated available amount of the initial allocated invoice is less than the amount of the current business application, determine the supplementary allocated invoice from the sorted invoice list; and determine the invoice allocation list of the current business application based on the initial allocated invoice and the supplementary allocated invoice.
[0132] In one embodiment, the result determination module 40 is further used to verify whether the amount of the business application in the target invoice allocation result is equal to the total amount of the corresponding allocated invoices, and obtain a business application exception verification result; verify whether the usage amount of the allocated invoices in the target invoice allocation result is less than or equal to the available amount, and obtain an invoice exception verification result; when the business application exception verification result and / or the invoice exception verification result do not meet the preset conditions, generate invoice allocation exception information and issue an exception reminder.
[0133] The present application provides an invoice distribution device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the invoice distribution method in the above-mentioned embodiment 1.
[0134] Reference below Figure 6 , which shows a schematic diagram of the structure of an invoice distribution device suitable for implementing the embodiment of the present application. The invoice distribution device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The invoice distribution device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0135] like Figure 6As shown, the invoice dispensing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the invoice dispensing device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the invoice dispensing device to communicate with other devices wirelessly or by wire to exchange data. Although the invoice dispensing device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0136] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0137] The invoice distribution device provided by the present application adopts the invoice distribution method in the above embodiment, which can solve the technical problem of how to accurately and efficiently distribute the corresponding invoice amount to batch business applications. Compared with the prior art, the beneficial effects of the invoice distribution device provided by the present application are the same as the beneficial effects of the invoice distribution method provided by the above embodiment, and the other technical features in the invoice distribution device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0138] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0140] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the invoice distribution method in the above-mentioned embodiment.
[0141] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0142] The computer-readable storage medium may be included in the invoice dispensing device; or may exist independently without being assembled into the invoice dispensing device.
[0143] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the invoice distribution device, the invoice distribution device: performs data preprocessing on the initial business application to be matched and the initial invoice to be distributed to obtain a list of business applications to be matched and a list of invoices to be distributed; traverses the list of business applications to be matched, obtains the current business application, and performs equal-amount matching on the current business application according to the list of invoices to be distributed to obtain an equal-amount matching result; determines the invoice distribution list of the current business application from the list of invoices to be distributed according to the equal-amount matching result; and updates the list of business applications to be matched and the list of invoices to be distributed based on the invoice distribution list until the list of business applications to be matched is traversed to obtain the target invoice distribution result.
[0144] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0147] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned invoice allocation method, and can solve the technical problem of how to accurately and efficiently allocate batch business applications to the corresponding invoice amounts. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the invoice allocation method provided by the above-mentioned embodiment, and will not be repeated here.
[0148] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the invoice distribution method as described above are implemented.
[0149] The computer program product provided by this application can solve the technical problem of how to accurately and efficiently allocate the corresponding invoice amounts to batch business applications. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the invoice allocation method provided by the above embodiment, which will not be repeated here.
[0150] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An invoice distribution method, characterized in that: The invoice allocation method includes: Perform data preprocessing on the initial business applications to be matched and the initial invoices to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated; Traversing the list of business applications to be matched, obtaining the current business application, and performing equal-amount matching on the current business application according to the list of invoices to be allocated to obtain an equal-amount matching result; Determine the invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result; The to-be-matched business application list and the to-be-allocated invoice list are updated based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
2. The method according to claim 1, characterized in that The step of updating the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain the target invoice allocation result includes: Determine the invoice splitting result according to the usage amount of the allocated invoices in the invoice allocation list; The to-be-matched business application list and the to-be-allocated invoice list are updated according to the invoice splitting result, until the to-be-matched business application list is traversed to obtain the target invoice allocation result.
3. The method according to claim 1, characterized in that The step of preprocessing the data of the initial business applications to be matched and the initial invoices to be allocated to obtain a list of business applications to be matched and a list of invoices to be allocated includes: Filter the business applications whose target amount is a preset amount in the initial business applications to be matched, and obtain a list of business applications to be matched; The invoices to be allocated whose available amounts in the initial invoices to be allocated are the preset amounts are filtered to obtain a list of invoices to be allocated.
4. The method according to claim 1, characterized in that The step of determining the invoice allocation list of the current business application from the list of invoices to be allocated according to the equal-amount matching result comprises: When the equal-amount matching result is that there are invoices to be allocated whose available amount is equal to the amount of the current business application in the invoice list to be allocated, the invoices to be allocated with the same amount are used as the invoice allocation list of the current business application; When the equal-amount matching result is that there is no invoice to be allocated with an available amount equal to the amount of the current business application in the invoice list to be allocated, the invoice list to be allocated is sorted to obtain a sorted invoice list, and the invoice allocation list of the current business application is determined from the sorted invoice list.
5. The method according to claim 4, characterized in that The step of determining the invoice allocation list for the current business application from the sorted invoice list comprises: Obtaining the integer part of the available amount of the invoice to be allocated in the sorted invoice list, and using the integer part of the available amount as the occupied amount and value of the invoice to be allocated; The integer part of the amount of the current business application is used as the limit amount; An invoice distribution list for the current business application is determined from the sorted invoice list according to the occupancy amount, the value amount and the limit amount.
6. The method according to claim 5, characterized in that The step of determining the invoice allocation list of the current business application from the sorted invoice list according to the occupied amount, the value amount and the limit amount comprises: determining an initial allocation invoice from the ranked invoice list based on the occupancy amount, the value amount, and the limit amount; When the accumulated available amount of the initial allocated invoices is less than the amount of the current business application, determining a supplementary allocated invoice from the sorted invoice list; An invoice distribution list for the current business application is determined according to the initial distribution invoice and the supplementary distribution invoice.
7. The method according to claim 1, characterized in that After the step of updating the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain the target invoice allocation result, the step further includes: Verify whether the amount of the business application in the target invoice allocation result is equal to the sum of the corresponding allocated invoice amounts, and obtain a business application abnormality verification result; Verify whether the used amount of the allocated invoice in the target invoice allocation result is less than or equal to the available amount, and obtain an invoice anomaly verification result; When the business application exception verification result and / or the invoice exception verification result do not meet the preset conditions, invoice allocation exception information is generated to issue an exception reminder.
8. An invoice distribution device, characterized in that: The device comprises: A data processing module is used to perform data preprocessing on the initial business applications to be matched and the initial invoices to be allocated, and obtain a list of business applications to be matched and a list of invoices to be allocated; An equal amount matching module is used to traverse the list of business applications to be matched, obtain the current business application, and perform equal amount matching on the current business application according to the list of invoices to be allocated to obtain an equal amount matching result; An invoice allocation module, configured to determine an invoice allocation list for the current business application from the list of invoices to be allocated according to the equal-amount matching result; The result determination module is used to update the to-be-matched business application list and the to-be-allocated invoice list based on the invoice allocation list until the to-be-matched business application list is traversed to obtain a target invoice allocation result.
9. An invoice distribution device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the invoice distribution method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the invoice distribution method according to any one of claims 1 to 7 are implemented.