Automatic Bill of Materials Disassembly Method, Device, Computer Equipment and Storage Medium
Through the automatic order disassembly method, the information of the initial order to be disassembled is split and grouped, sub-orders are formed and the discount amount is calculated, which solves the problem that it is difficult for manual labor to quickly calculate the highest discount order disassembly plan and realizes efficient order disassembly calculation.
Patent Information
- Application Number
- CN202311721298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2043-12-14
AI Technical Summary
In the ladder full discount promotion, it is difficult to quickly calculate the highest discounted order solution when purchasing multiple items, especially when there are a large number of items, the calculation complexity and time cost increase significantly.
Through the automatic order disassembly method, the first order is disassembly of the product information to be disassembly, the products with the best price are disassembly separately, and the remaining products are disassembly. If the quantity of products is too large, grouping and arrangement will form a sub-order, calculate the total amount and the discount amount in parallel, and finally determine the order-breaking plan with the largest discount amount.
It realizes a quick calculation of the highest discount for multiple items in the ladder-reduction activities, reducing the time and complexity of manual calculations and improving efficiency.
Smart Images

Figure CN117934072B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to computers, and more specifically to an automatic order splitting method, device, computer device, and storage medium. Background Art
[0002] With the rapid development of the Internet, it has become increasingly common for users to shop and settle accounts through online trading platforms. Online transactions related to people's lives are increasing, ranging from a single meal or drink to large home furnishings.
[0003] In some e-commerce platforms, stepped full reduction promotional activities often occur. For example, for furniture merchants, the price of a single item is relatively high, and such promotional activities generally do not set a limit on the number of times each person can participate. Because when purchasing multiple high-value items, if the merchant sets a limit, the buyer can ask relatives and friends to place orders on their behalf to avoid the limit. Therefore, merchants generally control the discount rate of the stepped full reduction activity and do not limit the number of coupons per person. When a user purchases such high-value items and is not satisfied with the discount amount, they may contact the merchant's pre-sales customer service staff and request to split the order to obtain a higher discount. At this time, the pre-sales customer service needs to manually calculate the order splitting plan and the discount amount. For stepped discount promotional activities, when the number of purchased items is large, the number of order splitting plans increases in a Bell series. When the number of items is large, it is almost impossible for manual calculation to obtain the highest discount.
[0004] Therefore, it is necessary to design a new method to achieve automatic order splitting to quickly calculate the order splitting plan with the highest discount for multiple items in a stepped full reduction activity. Summary of the Invention
[0005] The purpose of the present invention is to overcome the defects of the prior art and provide an automatic order splitting method, device, computer device, and storage medium.
[0006] To achieve the above purpose, the present invention adopts the following technical solutions: The automatic order splitting method includes:
[0007] Obtain initial order splitting commodity information;
[0008] Regarding the commodities in the initial order splitting commodity information whose prices meet the first set condition as separate orders to obtain a first order splitting result;
[0009] Remove the commodity information involved in the first order splitting result from the initial order splitting commodity information to obtain second order splitting commodity information;
[0010] Judge whether the quantity of the second order splitting commodity information is greater than a set value;
[0011] When the quantity of the second goods information to be split is greater than the set value, group the second goods information to be split to obtain a grouping result;
[0012] Perform permutation and combination on the goods in each group of the grouping result to form sub-orders;
[0013] Calculate the total amount and the preferential amount of each sub-order;
[0014] Summarize all sub-order information to obtain a summary result;
[0015] Determine the splitting plan with the largest preferential amount according to the summary result to obtain a target order;
[0016] Push the target order.
[0017] A further technical solution thereof is that the first set condition includes that the price is greater than the highest preferential amount.
[0018] A further technical solution thereof is that the grouping of the second goods information to be split to obtain a grouping result includes:
[0019] Sort the second goods information to be split in descending order of price to obtain a sorting result;
[0020] Group the sorting result in the way of high price matching low price until all the second goods information to be split falls into one of the groups to obtain a grouping result.
[0021] A further technical solution thereof is that the calculation of the total amount and the preferential amount of each sub-order includes:
[0022] Set a counter with an initial value of zero;
[0023] When a piece of goods in a sub-order is put into the set to be calculated, the counter is incremented by one, and recursive calculation is performed. Remove the goods information put into the set to be calculated, the counter is incremented by one, and then recursive calculation is performed again. Repeat the recursive operation until the value of the timer is equal to the number of goods in the sub-order to obtain the total amount of all sub-orders;
[0024] Compare the total amount of all sub-orders with the stepped preferential to calculate the preferential amount of each sub-order.
[0025] A further technical solution thereof is that the determination of the splitting plan with the largest preferential amount according to the summary result to obtain a target order includes:
[0026] Determine all splitting plans of the summary result and determine the preferential amounts corresponding to all splitting plans;
[0027] Determine the splitting order plan with the largest corresponding preferential amount among all splitting order plans to obtain the target order.
[0028] The present invention also provides an automatic order splitting device, including:
[0029] An information acquisition unit, configured to acquire initial goods information to be split.
[0030] A first order splitting unit, configured to take the goods in the initial goods information to be split whose prices meet the first set condition as separate orders to obtain a first order splitting result.
[0031] A removal unit, configured to remove the goods information involved in the first order splitting result from the initial goods information to be split to obtain second goods information to be split.
[0032] A judgment unit, configured to judge whether the quantity of the second goods information to be split is greater than a set value.
[0033] A grouping unit, configured to group the second goods information to be split when the quantity of the second goods information to be split is greater than the set value to obtain a grouping result.
[0034] A combination unit, configured to perform permutation and combination on the goods in each group of the grouping result to form sub-orders.
[0035] A calculation unit, configured to calculate the total amount and preferential amount of each sub-order.
[0036] A summary unit, configured to summarize all sub-order information to obtain a summary result.
[0037] A determination unit, configured to determine the order splitting plan with the largest preferential amount according to the summary result to obtain the target order.
[0038] A push unit, configured to push the target order.
[0039] Its further technical solution is that: the grouping unit includes:
[0040] A sorting subunit, configured to sort the second goods information to be split in descending order of price to obtain a sorting result.
[0041] A grouping subunit, configured to group the sorting result in a way of matching high prices with low prices until all the second goods information to be split falls into one of the groups to obtain a grouping result.
[0042] Its further technical solution is that: the calculation unit includes:
[0043] A setting subunit, configured to set a counter with an initial value of zero.
[0044] A recursive calculation subunit, which is used to increment a counter by one when an item in a sub-order is placed in a set to be calculated, perform recursive calculation, remove the item information placed in the set to be calculated, increment the counter by one, and then perform another recursive calculation. The recursive operation is repeated until the value of the timer is equal to the number of items in the sub-order, so as to obtain the total amount of all sub-orders.
[0045] A comparison subunit, which is used to compare the total amount of all sub-orders with the stepped discount to calculate the discount amount of each sub-order.
[0046] The present invention also provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the above-mentioned method is implemented.
[0047] The present invention also provides a storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.
[0048] The beneficial effect of the present invention compared with the prior art is that: through the first split of the initial item information to be split, the item with the best price is separately split out, and then the remaining item information is split. If the quantity is too large before splitting, it is first grouped, and then the items in the group are arranged and combined to form multiple sub-orders. The total amount and discount amount are calculated in parallel, and then the sub-orders are arranged and combined to determine the most preferential split plan, realizing automatic splitting, so as to quickly calculate the most preferential split plan for multiple items in the stepped full reduction activity.
[0049] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 It is a schematic diagram of the application scenario of the automatic splitting method provided by the embodiment of the present invention;
[0052] Figure 2 It is a schematic flowchart of the automatic splitting method provided by the embodiment of the present invention;
[0053] Figure 3 It is a schematic sub-flowchart of the automatic splitting method provided by the embodiment of the present invention;
[0054] Figure 4 Schematic diagram of a sub - process of the automatic order - splitting method provided by an embodiment of the present invention;
[0055] Figure 5 Schematic diagram of a sub - process of the automatic order - splitting method provided by an embodiment of the present invention;
[0056] Figure 6 Schematic block diagram of the automatic order - splitting device provided by an embodiment of the present invention;
[0057] Figure 7 Schematic block diagram of the grouping unit of the automatic order - splitting device provided by an embodiment of the present invention;
[0058] Figure 8 Schematic block diagram of the calculation unit of the automatic order - splitting device provided by an embodiment of the present invention;
[0059] Figure 9 Schematic block diagram of the determination unit of the automatic order - splitting device provided by an embodiment of the present invention;
[0060] Figure 10 Schematic block diagram of the computer device provided by an embodiment of the present invention. Detailed implementation manners
[0061] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0062] It should be understood that when used in this specification and the appended claims, the terms "comprises" and "comprising" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0063] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0064] It should be further understood that the term " / and" as used in this specification of the present invention and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0065] Please refer toFigure 1 and Figure 2 , Figure 1 is a schematic diagram of an application scenario of the automatic order splitting method provided by an embodiment of the present invention. Figure 2 is a schematic flowchart of the automatic order splitting method provided by an embodiment of the present invention. The automatic order splitting method is applied to a server. The server interacts with a terminal to obtain initial merchandise information to be split, that is, the merchandise information involved in what the user needs to purchase or needs to combine. From this information, first select the merchandise that does not need to be split, that is, the merchandise whose price has already reached the maximum discount. After that, if the quantity of the remaining merchandise is large, group them first, then perform permutations and combinations of sub-orders for each group, calculate the total amount and discount amount of the sub-orders, then assemble the sub-orders in an orderly manner to form multiple order splitting plans, further determine the most favorable plan among the order splitting plans to form a target plan, and achieve automatic order splitting to quickly calculate the most favorable order splitting plan for multiple pieces of merchandise in a stepped full reduction activity.
[0066] Figure 2 is a flowchart of the automatic order splitting method provided by an embodiment of the present invention. As Figure 2 shown, the method includes the following steps S110 to S150.
[0067] S110. Obtain initial merchandise information to be split.
[0068] In this embodiment, the initial merchandise information to be split refers to the merchandise information specified by the user terminal, such as the merchandise to be purchased, etc.
[0069] S120. Treat the merchandise in the initial merchandise information to be split whose price meets the first set condition as a separate order to obtain a first order splitting result.
[0070] In this embodiment, the first set condition includes that the price is greater than the maximum discount amount.
[0071] The first order splitting result refers to an order that separately contains the merchandise whose price meets the first set condition.
[0072] Specifically, for a certain piece of merchandise whose price is greater than the maximum stepped discount, it can be directly used as a separate order without being combined with other merchandise, because this piece of merchandise can already enjoy the maximum stepped discount, and adding any additional other merchandise cannot obtain a greater discount. However, these additional merchandise may obtain a greater discount strength when added to other orders. After excluding the merchandise higher than the highest step, the remaining merchandise is subjected to order splitting matching calculation. For each piece of merchandise less participating in the order splitting matching, the subsequent calculation amount can be reduced several times, which can significantly reduce the time of manual calculation and improve efficiency.
[0073] S130. Remove the product information involved in the first split order result from the initial product information to be split to obtain the second product information to be split.
[0074] In this embodiment, the second product information to be split refers to the remaining other product information after removing the product information involved in the first split order result.
[0075] S140. Determine whether the quantity of the second product information to be split is greater than a set value.
[0076] In this embodiment, the set value is 10, and of course, it can also be set to other values according to the actual situation.
[0077] S150. When the quantity of the second product information to be split is greater than the set value, group the second product information to be split to obtain a grouping result.
[0078] In this embodiment, the grouping result means splitting into multiple groups for parallel processing according to a set method to improve processing efficiency.
[0079] In one embodiment, please refer to Figure 3 , the above step S150 may include steps S151 to S152.
[0080] S151. Sort the second product information to be split in descending order of price to obtain a sorting result.
[0081] In this embodiment, the sorting result refers to the result formed by sorting the second product information to be split in descending order of price.
[0082] S152. Group the sorting result in the way of matching high prices with low prices until all the second product information to be split falls into one of the groups to obtain a grouping result.
[0083] In order to reduce the calculation amount and improve the calculation speed, an advanced grouping method can be used to divide all the products that need to be split and matched into several groups, with a maximum of 10 products in each group. Each group is split and matched separately, and then the discounts of all groups are aggregated to obtain the discount amount of all products; of course, the quantity of each group here can be determined according to the actual situation. The products that need to be split and matched refer to the second product information to be split.
[0084] For example, in order to obtain a higher discount as much as possible, 5 products with the lowest prices and 5 products with the highest prices can be grouped together, and then these 10 products are excluded. The remaining products are grouped in the same way. Through advanced grouping, there are at most 10 products in each group. Therefore, even if the user buys 100 products and divides them into 10 groups, the calculation can be completed within a few seconds.
[0085] S160. Perform permutations and combinations on the products in each group of the grouping result to form sub-orders.
[0086] In this embodiment, a sub-order refers to multiple orders for each group formed by performing permutations and combinations on the products in each group.
[0087] For example: within each group, for all products that need to participate in order splitting and matching, assuming there are n products, then the number of sub-orders that can be formed by these n products is 2 n -1. The total amount of each sub-order is matched with the tiered discount to calculate the discount amount of this sub-order. Record the total amount and its discount amount of all sub-orders for subsequent use.
[0088] Calculation method of the number of sub-orders: Each sub-order can have 1, 2,..., n products. Therefore, the number of sub-orders is
[0089] S170. Calculate the total amount and discount amount of each sub-order.
[0090] In one embodiment, please refer to Figure 4 , the above step S170 may include steps S171 to S173.
[0091] S171. Set a counter with an initial value of zero.
[0092] S172. When a product in a sub-order is placed in the set to be calculated, increment the counter by one, perform recursive calculation, remove the product information placed in the set to be calculated, increment the counter by one, and then perform another recursive calculation. Repeat the recursive operation until the value of the timer is equal to the number of products in the sub-order to obtain the total amount of all sub-orders.
[0093] Specifically, when a product in a sub-order is placed in the set to be calculated, increment the counter by one, perform recursive calculation, remove the product information placed in the set to be calculated, increment the counter by one, then place a product in the sub-order in the set to be calculated, increment the counter by one, and then perform another recursive calculation. Repeat the recursive operation until the value of the timer is equal to the number of products in the sub-order to obtain the total amount of all sub-orders.
[0094] S173. Compare the total amount of all sub-orders with the tiered discount to calculate the discount amount of each sub-order.
[0095] In this embodiment, the backtracking algorithm is used. With a counter initialized to 0, a commodity is placed into the set to be calculated, the counter is incremented by 1, and recursive calculation is performed. Then, this commodity is removed, the counter is incremented by 1, and another recursive calculation is carried out. The recursive termination condition is that the value of the timer is equal to n. By repeating this process, the total amount of all 2 n -1 sub-orders can be calculated, and by comparing the total amount with the tiered discounts, the discount amount can be calculated.
[0096] For example: There are 3 commodities: Commodity 1 costs 1 yuan, Commodity 2 costs 2 yuan, and Commodity 3 costs 3 yuan. The tiered full reduction activity rule is to subtract 1 yuan when the total is 3 yuan or more, and subtract 3 yuan when the total is 5 yuan or more. Then the calculation steps are as follows (when the counter value is equal to 3, a sub-order is generated):
[0097] The counter value is 0, commodity list: [];
[0098] Put Commodity 1 into the set;
[0099] The counter value is 1, commodity list: [1];
[0100] Put Commodity 2 into the set;
[0101] The counter value is 2, commodity list: [1, 2];
[0102] Put Commodity 3 into the set;
[0103] The counter value is 3, commodity list: [1, 2, 3]. Calculate sub-order 1, sub-order total amount: 6, discount amount: 3;
[0104] Remove Commodity 3 from the set;
[0105] The counter value is 3, commodity list: [1, 2]. Calculate sub-order 2, sub-order total amount: 3, discount amount: 1;
[0106] Remove Commodity 2 from the set;
[0107] The counter value is 2, commodity list: [1];
[0108] Put Commodity 3 into the set;
[0109] The counter value is 3, commodity list: [1, 3]. Calculate sub-order 3, sub-order total amount: 4, discount amount: 1;
[0110] Remove Commodity 3 from the set;
[0111] The counter value is 3, commodity list: [1]. Calculate sub-order 4, sub-order total amount: 1, discount amount: 0;
[0112] Remove Commodity 1 from the set;
[0113] The counter value is 1, product list: [];
[0114] Put product 2 into the set;
[0115] The counter value is 2, product list: [2];
[0116] Put product 3 into the set;
[0117] The counter value is 3, product list: [2, 3]. Calculate sub - order 5, total amount of sub - order: 5, discount amount: 3;
[0118] Remove product 3 from the set;
[0119] The counter value is 3, product list: [2]. Calculate sub - order 6, total amount of sub - order: 2, discount amount: 0;
[0120] Remove product 2 from the set;
[0121] The counter value is 2, product list: [];
[0122] Put product 3 into the set;
[0123] The counter value is 3, product list: [3]. Calculate sub - order 7, total amount of sub - order: 3, discount amount: 1.
[0124] S180. Aggregate all sub - order information to obtain an aggregated result.
[0125] In this embodiment, the aggregated result refers to the result formed after aggregating all sub - orders, the corresponding amounts, and the corresponding discount amounts together.
[0126] After step S170, a mapping relationship table of the total amount and discount amount of all sub - orders can be obtained, as shown in Table 1.
[0127] Table 1. Mapping relationship table of the total amount and discount amount of all sub - orders
[0128] Sub-order number 1 2 3 4 5 6 7 Goods in sub-order 1,2,3 1,2 1,3 1 2,3 2 3 Total amount of sub-order 6 3 4 1 5 2 3 Discount amount of sub-order 3 1 1 0 3 0 1
[0129] Among them, the total amount of sub - order 2 (product 1 and product 2) and sub - order 7 (product 3) is equal to 3, and the discount amount is 1 yuan for both.
[0130] S190. Determine the splitting - order plan with the largest discount amount according to the aggregated result to obtain the target order.
[0131] In this embodiment, the target order refers to the splitting - order plan with the largest discount amount for the entire plan.
[0132] In one embodiment, please refer to Figure 5, the above step S190 may include steps S191 to S192.
[0133] S191. Determine all the split order plans for the summary result and determine the preferential amounts corresponding to all the split order plans;
[0134] S192. Determine the split order plan with the largest preferential amount among all the split order plans to obtain the target order.
[0135] In this embodiment, each split order plan is traversed. These split order plans are formed by permutations and combinations of all the sub-orders. The sub-orders included in each split order plan have been determined in the above step S180, and the preferential amount can be directly obtained. The sum of the preferential amounts of all the sub-orders is the preferential amount of the current split order plan. Taking the maximum value among the preferential amounts of all the split order plans can calculate the maximum preferential amount of the specified commodity and the stepped preferential offer.
[0136] In this embodiment, using the backtracking algorithm, with the help of a counter with an initial value of 0, put a commodity into a certain sub-order, the counter is incremented by 1, and recursive calculation is performed. Then remove this commodity from this sub-order, take this commodity as a new sub-order, the counter is incremented by 1, and perform another recursive calculation. Then remove this sub-order. The recursive termination condition is that the value of the timer is equal to n. When the recursion is terminated, several sub-orders of this split order plan can be obtained. Sum up the amounts of all the commodities in the sub-orders, and then find the preferential amount from the data stored in the first step. The sum of the preferential amounts of all the sub-orders is the preferential amount of the current split order plan. If the preferential amount of the current split order plan is greater than the highest preferential amount of the split order plans calculated before, then set the highest preferential amount to the preferential amount of the current split order plan, and record all the sub-order information corresponding to the current split order plan; and so on, the highest preferential amounts of all Bell(n) split order plans can be calculated.
[0137] The purpose of step S170 is to store the correspondence between the total amount of the sub-order and the preferential amount of this sub-order, reducing the subsequent repeated calculation amount. Suppose there are 10 commodities, then the number of sub-orders is 1023, and the number of split order plans is 115975, which is more than 100 times larger than the number of sub-orders. There are many repeated sub-orders among these split order plans. The preferential amount of the sub-order can be quickly obtained from the mapping table of the total amount of the sub-order and the preferential amount of this sub-order stored before.
[0138] For the sake of convenience of explanation, taking the example of step S170, there are 3 commodities: commodity 1, commodity 2, and commodity 3. The price of commodity 1 is 1 yuan, the price of commodity 2 is 2 yuan, and the price of commodity 3 is 3 yuan. The stepped full reduction activity rule is to subtract 1 yuan for every 3 yuan, and subtract 3 yuan for every 5 yuan.
[0139] The calculation steps are as follows (when the counter value is equal to 3, a splitting plan is generated, and [] represents a sub-order):
[0140] The counter value is 0, and the sub-order list: [];
[0141] Put item 1 into a new sub-order;
[0142] Add the sub-order [1] to the current splitting plan;
[0143] The counter value is 1, and the sub-order list: [[1]];
[0144] Put item 2 into sub-order 1;
[0145] The counter value is 2, and the sub-order list: [[1, 2]];
[0146] Put item 3 into sub-order 1;
[0147] The counter value is 3, and the sub-order list: [[1, 2, 3]]. Calculation plan 1, sub-order 1, amount: 6, discount amount: 3, total discount amount of the current plan: 3;
[0148] Remove item 3 from the sub-order;
[0149] Put item 3 into a new sub-order;
[0150] Add the sub-order [3] to the current splitting plan;
[0151] The counter value is 3, and the sub-order list: [[1, 2], [3]]. Calculation plan 2, sub-order 1, amount: 3, discount amount: 1, sub-order 2, amount: 3, discount amount: 1, total discount amount of the current plan: 2;
[0152] Remove the sub-order [3] from the current splitting plan;
[0153] Remove item 2 from the sub-order;
[0154] Put item 2 into a new sub-order;
[0155] Add the sub-order [2] to the current splitting plan;
[0156] The counter value is 2, and the sub-order list: [[1], [2]];
[0157] Put item 3 into sub-order 1;
[0158] The counter value is 3, and the sub-order list: [[1, 3], [2]]. Calculation plan 3, sub-order 1, amount: 4, discount amount: 1, sub-order 2, amount: 2, discount amount: 0, total discount amount of the current plan: 1;
[0159] Remove product 3 from the sub - order;
[0160] Put product 3 into sub - order 2;
[0161] The counter value is 3, sub - order list: [[1], [2, 3]]. Calculate plan 4, sub - order 1, amount: 1, discount amount: 0, sub - order 2, amount: 5, discount amount: 3, total discount amount of the current plan: 3;
[0162] Remove product 3 from the sub - order;
[0163] Put product 3 into a new sub - order;
[0164] Add sub - order [3] to the current order - splitting plan;
[0165] The counter value is 3, sub - order list: [[1], [2], [3]]. Calculate plan 5, sub - order 1, amount: 1, discount amount: 0, sub - order 2, amount: 2, discount amount: 0, sub - order 3, amount: 3, discount amount: 1, total discount amount of the current plan: 1.
[0166] The relationship between the order - splitting plan and the sub - order is shown in Table 2 below.
[0167] Table 2. Relationship between the order - splitting plan and the sub - order
[0168] Split order plan number Sub-order list Total discount amount of split order plan 1 [1,2,3] 3 2 [1,2],[3] 1+1=2 3 [1,3],[2] 1+0=1 4 [1],[2,3] 0+3=3 5 [1],[2],[3] 0+0+1=1
[0169] It can be seen that the single - product sub - orders in order - splitting plans 2, 3, and 4 are the same as those in order - splitting plan 5.
[0170] The total discount amounts of order - splitting plans 1 and 4 are both 3. Any one of these two plans is the order - splitting plan with the highest discount amount.
[0171] S200. Push the target order.
[0172] S210. When the quantity of the second product information to be split is not greater than the set value, permute and combine the second product information to be split to form sub - orders, and execute step S170.
[0173] For the above - mentioned grouping, if not sensitive to the calculation amount, the maximum number of products in each group can be appropriately increased, or no pre - grouping is done, and the optimal order - splitting plan is directly calculated.
[0174] For example: A typical stepped promotion is a discount of 200 for purchases over 2000, 500 for purchases over 4000, and 800 for purchases over 6000. A user buys 3 items with prices of 7000, 3000, and 2000 respectively. At this time, the 3 items are split into two orders. The 7000-item is a separate order and enjoys a discount of 800 for purchases over 6000. The 3000-item and 2000-item are in one order and enjoy a discount of 500 for purchases over 4000. The total discount amount is 1300. The sub-order information is distributed as shown in Table 3.
[0175] Table 3. Sub-order Information
[0176] Sub-order number Goods amount in sub-order Discount amount of sub-order 1 7000 800 2 3000,2000 500
[0177] It should be noted that the user may buy multiple identical items, and these items may also get higher discounts after being split into separate orders. For example, if the user buys two 7000-yuan items and splits them into two orders, they can enjoy a discount of 1600 yuan. Therefore, when calculating, all the purchased items need to be split into individual items for calculation.
[0178] Taking 5 items as an example, the calculation method for the number of order-splitting schemes is as follows: As 1 order, there is only 1 scheme; when split into 2 orders, there are two cases, with a total of 15 schemes: 1 item as one order and the other 4 items as one order, and the number of schemes is 2 items as one order and the other 3 items as one order, and the number of schemes is When split into 3 orders, there are two cases, with a total of 25 schemes: 3 items as one order, and the other 2 items are split into two orders, and the number of schemes is 1 item as one order, choosing another two items as one order, and the remaining 2 items as one order, and the number of schemes is When split into 4 orders, choose 3 items to be split into three orders, and the remaining 2 items as one order, and the number of schemes is When split into 5 orders, there is only 1 scheme; therefore, the number of order-splitting schemes for 5 items is 1 + 15 + 25 + 10 + 1 = 52; where represents taking any 1 item from 5 items, Denote taking any 2 non-repeating items from 5 items; existing technical solutions are generally for anti-arbitrage and do not have such a way to actively calculate the maximum promotional discount of stepped full reduction; for n items split into m orders, it is the second Stirling number S(n,m); 1 ≤ m ≤ n. It can be seen from the above steps that the total number of order splitting schemes for n items is S(n,1) + S(n,2) + … + S(n,n) = Bell(n); Bell(n) represents the Bell number; each order splitting scheme will contain several sub-orders; the relationship between the number of items and the number of order splitting schemes is a Bell series relationship, as listed in Table 4 below.
[0179] Table 4. Relationship table between the number of items and the number of order splitting schemes
[0180] Number of goods pieces Sub-order quantity Split order plan quantity 1 1 1 2 3 2 3 7 5 4 15 15 5 31 52 6 63 203 7 127 877 8 255 4,140 9 511 21,147 10 1,023 115,975 11 2,047 678,570 12 4,095 4,213,597 13 8,191 27,644,437 14 16,383 190,899,322 15 32,767 1,382,958,545
[0181] Thus, it can be seen that if manual calculation is adopted, when the number of items reaches 5, the number of order splitting schemes reaches 52, and at this time, manual calculation is already quite difficult; for each additional item, the number of order splitting schemes will increase several times. When the number of items reaches 5 - 6, it is very difficult for humans to find the optimal scheme from dozens or hundreds of schemes; while the solution of the present application can be calculated quickly and accurately, that is, it can quickly calculate the maximum discount of multiple items in the stepped full reduction activity.
[0182] The above automatic order splitting method performs the first order splitting on the initial item information to be split, separates the item with the optimal price alone, and then performs order splitting on the remaining item information. If the quantity is too large before order splitting, it is first grouped, and then the items within the group are permuted and combined to form multiple sub-orders. The total amount and the discount amount are calculated in parallel, and then the sub-orders are permuted and combined to determine the most favorable order splitting scheme, realizing automatic order splitting to quickly calculate the order splitting scheme with the maximum discount of multiple items in the stepped full reduction activity.
[0183] Figure 6 is a schematic block diagram of an automatic order splitting device 300 provided by an embodiment of the present invention. As Figure 6 shown, corresponding to the above automatic order splitting method, the present invention also provides an automatic order splitting device 300. The automatic order splitting device 300 includes units for executing the above automatic order splitting method, and this device can be configured in a server. Specifically, please refer to Figure 6 , the automatic order splitting device 300 includes an information acquisition unit 301, a first order splitting unit 302, a removal unit 303, a judgment unit 304, a grouping unit 305, a combination unit 306, a calculation unit 307, a summarization unit 308, a determination unit 309, and a pushing unit 310.
[0184] An information acquisition unit 301 is configured to acquire initial goods information to be split; a first split unit 302 is configured to take the goods in the initial goods information to be split whose prices meet a first set condition as separate orders to obtain a first split result; a removal unit 303 is configured to remove the goods information involved in the first split result from the initial goods information to be split to obtain second goods information to be split; a judgment unit 304 is configured to judge whether the quantity of the second goods information to be split is greater than a set value; a grouping unit 305 is configured to, when the quantity of the second goods information to be split is greater than the set value, group the second goods information to be split to obtain a grouping result; a combination unit 306 is configured to perform permutation and combination on the goods in each group in the grouping result to form sub-orders; a calculation unit 307 is configured to calculate the total amount and preferential amount of each sub-order; a summarization unit 308 is configured to summarize all sub-order information to obtain a summarization result; a determination unit 309 is configured to determine a split plan with the largest preferential amount according to the summarization result to obtain a target order; a push unit 310 is configured to push the target order.
[0185] In one embodiment, as Figure 7 shown, the grouping unit 305 includes a sorting subunit 3051 and a grouping subunit 3052.
[0186] The sorting subunit 3051 is configured to sort the second goods information to be split in descending order of price to obtain a sorting result; the grouping subunit 3052 is configured to group the sorting result in a manner of matching high prices with low prices until all the second goods information to be split falls into one of the groups to obtain a grouping result.
[0187] In one embodiment, please refer to Figure 8 , the calculation unit 307 includes: a setting subunit 3071, a recursive calculation subunit 3072, and a comparison subunit 3073.
[0188] The setting subunit 3071 is configured to set a counter with an initial value of zero; the recursive calculation subunit 3072 is configured to, when a piece of goods in a sub-order is put into a set to be calculated, increment the counter by one, perform recursive calculation, remove the goods information put into the set to be calculated, increment the counter by one, and perform another recursive calculation, and repeat the recursive operation until the value of the timer is equal to the quantity of goods in the sub-order to obtain the total amount of all sub-orders; the comparison subunit 3073 is configured to compare the total amounts of all sub-orders with the stepped preferential offers to calculate the preferential amount of each sub-order.
[0189] In one embodiment, please refer to Figure 9, the determining unit 309 includes a first determining subunit 3091 and a second determining subunit 3092.
[0190] The first determining subunit 3091 is configured to determine all the split order schemes of the summary result and determine the preferential amounts corresponding to all the split order schemes; the second determining subunit 3092 is configured to determine the split order scheme with the largest preferential amount among all the split order schemes to obtain the target order.
[0191] It should be noted that those skilled in the art can clearly understand the specific implementation processes of the above-mentioned automatic order splitting device 300 and each unit. Reference can be made to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.
[0192] The above-mentioned automatic order splitting device 300 can be implemented in the form of a computer program, and this computer program can run on a computer device as shown in Figure 10 shown.
[0193] Please refer to Figure 10 , Figure 10 , which is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 may be a server. Among them, the server may be an independent server or a server cluster composed of multiple servers.
[0194] Refer to Figure 10 , the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501. Among them, the memory may include a non-volatile storage medium 503 and an internal memory 504.
[0195] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can be caused to execute an automatic order splitting method.
[0196] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
[0197] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute an automatic order splitting method.
[0198] The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that Figure 10The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device 500 to which the solution of this application is applied. Specifically, the computer device 500 may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0199] Among them, the processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0200] Obtain the initial information of the goods to be split; take the goods whose prices in the initial information of the goods to be split meet the first set condition as separate orders to obtain the first split result; remove the goods information involved in the first split result from the initial information of the goods to be split to obtain the second information of the goods to be split; determine whether the quantity of the second information of the goods to be split is greater than the set value; when the quantity of the second information of the goods to be split is greater than the set value, group the second information of the goods to be split to obtain a grouping result; perform permutation and combination on the goods in each group of the grouping result to form sub-orders; calculate the total amount and the preferential amount of each sub-order; summarize all sub-order information to obtain a summary result; determine the split plan with the largest preferential amount according to the summary result to obtain the target order; push the target order.
[0201] Among them, the first set condition includes that the price is greater than the maximum preferential amount.
[0202] In one embodiment, when the processor 502 implements the step of grouping the second information of the goods to be split to obtain a grouping result, the following steps are specifically implemented:
[0203] Sort the second information of the goods to be split in descending order of price to obtain a sorting result; group the sorting result in the way of matching high prices with low prices until all the second information of the goods to be split falls into one of the groups to obtain a grouping result.
[0204] In one embodiment, when the processor 502 implements the step of calculating the total amount and the preferential amount of each sub-order, the following steps are specifically implemented:
[0205] Set a counter with an initial value of zero; when a piece of goods in a sub-order is put into the set to be calculated, the counter is incremented by one, and recursive calculation is performed. Remove the goods information put into the set to be calculated, the counter is incremented by one, and then recursive calculation is performed again. Repeat the recursive operation until the value of the timer is equal to the quantity of the goods in the sub-order to obtain the total amount of all sub-orders; compare the total amount of all sub-orders with the stepped preferential amount to calculate the preferential amount of each sub-order.
[0206] In one embodiment, when the processor 502 implements the step of determining the split order plan with the largest preferential amount according to the summary result to obtain the target order, the specific implementation is as follows:
[0207] Determine all split order plans of the summary result and determine the preferential amounts corresponding to all split order plans; determine the split order plan with the largest preferential amount among all split order plans to obtain the target order.
[0208] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0209] Those of ordinary skill in the art can understand that all or part of the processes in the methods of implementing the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0210] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0211] Obtain the initial goods information to be split; take the goods in the initial goods information to be split whose prices meet the first set condition as separate orders to obtain the first split result; remove the goods information involved in the first split result from the initial goods information to be split to obtain the second goods information to be split; determine whether the quantity of the second goods information to be split is greater than the set value; when the quantity of the second goods information to be split is greater than the set value, group the second goods information to be split to obtain a grouping result, perform permutation and combination on the goods in each group in the grouping result to form sub-orders; calculate the total amount and preferential amount of each sub-order; summarize all sub-order information to obtain a summary result; determine the split plan with the largest preferential amount according to the summary result to obtain the target order; push the target order.
[0212] Among them, the first set condition includes that the price is greater than the highest preferential amount.
[0213] In one embodiment, when the processor executes the computer program to implement the step of grouping the second goods information to be split to obtain a grouping result, the following steps are specifically implemented:
[0214] Sort the second goods information to be split in descending order of price to obtain a sorting result; group the sorting result in the way of matching high prices with low prices until all the second goods information to be split falls into one of the groups to obtain a grouping result.
[0215] In one embodiment, when the processor executes the computer program to implement the step of calculating the total amount and preferential amount of each sub-order, the following steps are specifically implemented:
[0216] Set a counter with an initial value of zero; when a piece of goods in a sub-order is put into the set to be calculated, the counter is incremented by one, and recursive calculation is performed. Remove the goods information put into the set to be calculated, the counter is incremented by one, and then recursive calculation is performed again. Repeat the recursive operation until the value of the timer is equal to the quantity of goods in the sub-order to obtain the total amount of all sub-orders; compare the total amount of all sub-orders with the stepped preferential amount to calculate the preferential amount of each sub-order.
[0217] In one embodiment, when the processor executes the computer program to implement the step of determining the split plan with the largest preferential amount according to the summary result to obtain the target order, the following steps are specifically implemented:
[0218] Determine all split plans of the summary result, and determine the preferential amounts corresponding to all split plans; determine the split plan with the largest preferential amount corresponding to all split plans to obtain the target order.
[0219] The storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk, an optical disk, or other computer-readable storage media that can store program codes.
[0220] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0221] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0222] The steps in the method of the embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device of the embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0223] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0224] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. Automatic bill splitting method, characterized in that, Including: Obtain initial information of goods to be split in an order; Take the goods in the initial information of goods to be split in an order whose prices meet the first set condition as separate orders to obtain a first order splitting result; Remove the goods information involved in the first order splitting result from the initial information of goods to be split in an order to obtain second information of goods to be split in an order; Judge whether the quantity of the second information of goods to be split in an order is greater than a set value; When the quantity of the second information of goods to be split in an order is greater than the set value, group the second information of goods to be split in an order to obtain a grouping result; Perform permutation and combination on the goods in each group in the grouping result to form sub-orders; Calculate the total amount and preferential amount of each sub-order; Summarize all sub-order information to obtain a summarization result; Determine a splitting plan with the largest preferential amount according to the summarization result to obtain a target order; Push the target order; The grouping of the second information of goods to be split in an order to obtain a grouping result includes: Sort the second information of goods to be split in an order in descending order of price to obtain a sorting result; Group the sorting result in the way of matching high prices with low prices until all the second information of goods to be split in an order falls into one of the groups to obtain a grouping result.
2. The automatic bill splitting method according to claim 1, characterized in that, The first set condition includes that the price is greater than the highest preferential amount.
3. The automatic bill splitting method according to claim 1, characterized in that, The calculation of the total amount and preferential amount of each sub-order includes: Set a counter with an initial value of zero; When a piece of goods in a sub-order is put into a set to be calculated, the counter is incremented by one, recursive calculation is performed, the goods information put into the set to be calculated is removed, the counter is incremented by one, and then another recursive calculation is performed. The recursive operation is repeated until the value of the timer is equal to the quantity of goods in the sub-order to obtain the total amount of all sub-orders; Compare the total amount of all sub-orders with the stepped preferential offers to calculate the preferential amount of each sub-order.
4. The automatic bill splitting method according to claim 1, characterized in that, The determination of a splitting plan with the largest preferential amount according to the summarization result to obtain a target order includes: Determine all splitting plans of the summarization result and determine the preferential amounts corresponding to all splitting plans; Determine the splitting plan with the largest corresponding preferential amount among all splitting plans to obtain a target order.
5. Automatic bill splitting device, characterized in that, Including: An information acquisition unit for obtaining initial information of goods to be split in an order; A first order splitting unit for taking the goods in the initial information of goods to be split in an order whose prices meet the first set condition as separate orders to obtain a first order splitting result; A removal unit for removing the goods information involved in the first order splitting result from the initial information of goods to be split in an order to obtain second information of goods to be split in an order; A judgment unit for judging whether the quantity of the second information of goods to be split in an order is greater than a set value; A grouping unit for grouping the second information of goods to be split in an order when the quantity of the second information of goods to be split in an order is greater than the set value to obtain a grouping result; A combination unit for performing permutation and combination on the goods in each group in the grouping result to form sub-orders; A calculation unit for calculating the total amount and preferential amount of each sub-order; A summarization unit for summarizing all sub-order information to obtain a summarization result; A determination unit, configured to determine a split order plan with the largest preferential amount according to the summary result, so as to obtain a target order; A push unit, configured to push the target order; The grouping unit includes: A sorting subunit, configured to sort the second goods information to be split in descending order of price, so as to obtain a sorting result; A grouping subunit, configured to group the sorting result in a way of matching high prices with low prices until all the second goods information to be split falls into one of the groups, so as to obtain a grouping result.
6. The automatic bill splitting device according to claim 5, wherein, The calculation unit includes: A setting subunit, configured to set a counter with an initial value of zero; A recursive calculation subunit, configured to increment the counter by one when a piece of goods in a sub-order is put into a set to be calculated, perform recursive calculation, remove the goods information put into the set to be calculated, increment the counter by one, and then perform another recursive calculation, and repeat the recursive operation until the value of the timer is equal to the number of goods in the sub-order, so as to obtain the total amount of all sub-orders; A comparison subunit, configured to compare the total amount of all sub-orders with the tiered preferential offers, so as to calculate the preferential amount of each sub-order.
7. A computer device, wherein, The computer device includes a memory and a processor, and a computer program is stored on the memory. When the processor executes the computer program, the method described in any one of claims 1 to 4 is implemented.
8. A storage medium, wherein, The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Order-splitting settlement method, device, electronic equipment and computer-readable medium
CN109146646A
Goods collection transportation path optimization method
CN115271208A