Genetic algorithm-based product allocation method, equipment, and storage medium

By using a genetic algorithm-based product allocation method and optimizing it with binary encoding, the problem of product allocation that is difficult to satisfy multiple constraints simultaneously in existing technologies has been solved, resulting in more competitive product delivery.

CN119515271BActive Publication Date: 2025-12-02SHENZHEN WEIAIZHIYUN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411510805.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-12-02
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

Existing product distribution schemes based on genetic algorithms struggle to meet multiple constraints simultaneously, making it impossible to select more competitive product distribution solutions.

Method used

By using a genetic algorithm-based commodity allocation method, commodity data, feature distribution, and weight parameters are determined, converted into binary codes, an initial allocation scheme library is constructed, evaluation criteria are defined, and the optimal solution is generated through selection, crossover, and mutation operations.

Benefits of technology

This effectively filters out product delivery solutions that simultaneously meet multiple constraints and are more competitive, thus improving the optimization effect of the distribution plan.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515271B_ABST
    Figure CN119515271B_ABST
Patent Text Reader

Abstract

This application discloses a product allocation method, device, and storage medium based on a genetic algorithm, belonging to the field of computer science and technology. The method involves determining the product data to be configured in the system, the target configuration quantity, product feature distribution, and corresponding weight parameters; converting the product configuration scheme into binary-coded product combinations and constructing an initial allocation scheme library; defining evaluation criteria to assess the fitness of each scheme based on product feature distribution and weight parameters; performing genetic algorithm optimization to select the scheme with the highest fitness from the final allocation scheme library as the optimal solution. This invention effectively solves the problem of how to select more competitive products that simultaneously meet multiple feature constraints for delivery to stores.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer science and technology, and in particular to a commodity distribution method, device and storage medium based on genetic algorithms. Background Technology

[0002] Warehouses employ different distribution logics for each product to meet regular market demand. In related technologies, stores typically consider optimal market demand as a constraint when selecting a distribution plan. However, a single characteristic can only satisfy the sales volume under the current constraint, not the delivery of more competitive products to the store. Therefore, when product characteristics are complex, insufficient consideration of multiple constraints can lead to the inability to select more competitive products from the distribution plan. Summary of the Invention

[0003] The main purpose of this application is to provide a commodity allocation method based on genetic algorithms, which aims to solve the technical problem that existing commodity allocation schemes based on genetic algorithms are difficult to satisfy multiple constraints at the same time and have poor optimization effects.

[0004] To achieve the above objectives, this application proposes a commodity allocation method based on a genetic algorithm. The method includes: determining the commodity data to be allocated in the system, the target allocation quantity, the commodity feature distribution, and the corresponding weight parameters; converting the commodity allocation scheme into binary-coded commodity combinations and constructing an initial allocation scheme library; defining evaluation criteria and evaluating the fitness of each scheme based on the commodity feature distribution and weight parameters; performing genetic algorithm optimization and selecting the scheme with the highest fitness from the final allocation scheme library as the optimal solution. In one embodiment, the step of converting the commodity allocation scheme into binary-coded commodity combinations and constructing an initial allocation scheme library, where each scheme represents a possible allocation strategy, includes:

[0005] Based on preset encoding rules, the product distribution plan is encoded into binary combinations of products;

[0006] The initial distribution scheme library is constructed based on the binary sequence corresponding to the product combination.

[0007] In one embodiment, the step of encoding the product distribution plan into binary product combinations based on preset encoding rules includes:

[0008] Based on the preset coding rules, the quantity of goods corresponding to the goods distribution plan is determined;

[0009] Based on the product categories present in the quantity of products, the binary sequence is determined to be the product combination.

[0010] In one embodiment, the step of constructing the initial distribution scheme library based on the binary sequence corresponding to the product combination includes:

[0011] Based on the distribution plan library corresponding to the product combination, determine the product quantity corresponding to the distribution plan library;

[0012] Based on the quantity of goods and preset rules, the combination of goods is adjusted to construct the initial distribution scheme library.

[0013] In one embodiment, the step of defining the evaluation criteria for the distribution plan and evaluating the initial distribution plan based on the product characteristic distribution and the weight parameters includes:

[0014] Based on the characteristic distribution of the goods, the initial similarity of the distribution scheme is determined;

[0015] If the initial similarity is not less than a preset threshold, the product similarity of the product features is multiplied by the corresponding weight parameters to obtain the total fitness of the product allocation scheme.

[0016] In one embodiment, the step of generating a first allocation plan library by taking the initial allocation plan library as input and performing selection, crossover, and mutation operations includes:

[0017] Based on the fitness of the aforementioned distribution scheme, two distribution schemes from the initial distribution scheme library are selected;

[0018] By performing crossover and variation operations on the two aforementioned distribution schemes, a first distribution scheme library is determined.

[0019] In one embodiment, after the step of performing crossover and variation operations on the two distribution schemes to determine the first distribution scheme library, the method further includes:

[0020] Based on preset iteration conditions, the crossover and mutation operations are performed on at least two of the first distribution schemes in the distribution scheme library to determine the target distribution scheme library.

[0021] In one embodiment, the step of selecting the most suitable distribution plan from the target distribution plan library as the target distribution plan includes:

[0022] The fitness of the target distribution scheme is calculated based on the similarity of the product feature distribution in the target distribution scheme library.

[0023] The target allocation plan is determined based on the fitness ranking order.

[0024] In addition, to achieve the above objectives, this application also proposes a commodity distribution device based on a genetic algorithm, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the commodity distribution method based on a genetic algorithm as described above.

[0025] In addition, to achieve the above objectives, this 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, it implements the steps of the commodity allocation method based on genetic algorithm as described above.

[0026] This application proposes a product allocation method, device, and storage medium based on a genetic algorithm. It determines at least two initial allocation schemes based on a preset product dimension. The product dimension includes: determining the product data to be configured in the system, the target configuration quantity, product feature distribution, and weight parameters; converting the product allocation schemes into binary-coded product combinations and constructing an initial allocation scheme library, where each initial allocation scheme represents a possible allocation strategy; defining evaluation criteria for the allocation schemes and evaluating the initial allocation schemes based on the product feature distribution and weight parameters; using the initial allocation scheme library as input, generating a first allocation scheme library through selection, crossover, and mutation operations; repeating step S4 until a termination condition is met, such as reaching the maximum number of iterations or finding a target allocation scheme library that meets a preset fitness threshold; and selecting the allocation scheme with the highest fitness from the target allocation scheme library as the optimal solution. Based on this application's product allocation method based on a genetic algorithm, the problem of how to select more competitive products that simultaneously meet multiple feature constraints for delivery to stores is effectively solved. Attached Figure Description

[0027] Figure 1 This is a flowchart illustrating an embodiment of the commodity allocation method based on genetic algorithms in this application.

[0028] Figure 2 This is a flowchart illustrating Embodiment 2 of the commodity allocation method based on genetic algorithms in this application;

[0029] Figure 3 This is a flowchart illustrating Embodiment 3 of the commodity allocation method based on genetic algorithms in this application;

[0030] Figure 4 This is a flowchart illustrating Embodiment 4 of the commodity allocation method based on genetic algorithms in this application;

[0031] Figure 5 This is a flowchart illustrating Embodiment 5 of the commodity allocation method based on genetic algorithms in this application;

[0032] Figure 6 This is a schematic diagram of the hardware operating environment involved in the commodity distribution method based on genetic algorithms in the embodiments of this application. Detailed Implementation

[0033] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0034] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0035] The main solution of this application embodiment is as follows: Determine the product data to be configured in the system, the target configuration quantity, product feature distribution, and weight parameters; convert the product allocation scheme into binary-coded product combinations and construct an initial allocation scheme library, where each initial allocation scheme represents a possible allocation strategy; define the evaluation criteria for the allocation scheme, and evaluate the initial allocation scheme based on the product feature distribution and the weight parameters; use the initial allocation scheme library as input, and generate a first allocation scheme library through selection, crossover, and mutation operations; repeatedly execute crossover and mutation operations for iteration until a termination condition is met, such as reaching the maximum number of iterations or finding a target allocation scheme library that meets a preset fitness threshold; select the allocation scheme with the highest fitness from the target allocation scheme library as the optimal solution. Warehouses have different allocation logic for each product to meet regular market demand. In related technologies, stores typically consider optimal market demand as a constraint when selecting allocation schemes, but a single feature can only satisfy the sales volume of the current constraint, not the delivery of more competitive products to the store. Therefore, in cases of complex product feature distribution, insufficient consideration of multiple constraints leads to the inability to select more competitive products from the allocation schemes.

[0036] This application proposes a commodity allocation method based on genetic algorithms, which can solve the problem of inefficiency in manually summarizing data and adjusting allocation plans.

[0037] It should be noted that the executing entity in this embodiment can be a goods distribution system, a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of performing the above functions. The following description uses a goods distribution system as an example to illustrate this embodiment and the subsequent embodiments.

[0038] Based on this, Embodiment 1 of this application provides a commodity allocation method based on a genetic algorithm, referring to... Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the commodity allocation method based on genetic algorithms in this application.

[0039] In this embodiment, the commodity allocation method based on genetic algorithm includes steps S1 to S6:

[0040] Step S1: Determine the product data to be configured in the system, the number of target configurations, the product feature distribution, and the weight parameters.

[0041] It should be noted that the product data to be configured refers to the detailed information of the products considered during the order fulfillment process, such as product ID, name, description, category, and price. The target configuration quantity refers to the total number or target of product combinations to be achieved during the order fulfillment process. Product characteristics refer to the various attributes or features of a product, and the distribution of these characteristics among all products. These can include series, shape, material, style, price, etc., while the product characteristic distribution represents the frequency and diversity of different characteristics in the product set. The weight parameter is a numerical value assigned to each characteristic, used to represent the relative importance in the order fulfillment decision.

[0042] As an optional implementation method, necessary product information is extracted from the enterprise's database, the product information is cleaned and verified, the current inventory level and historical sales data are extracted to determine the target configuration quantity, and the initial product weight parameters are determined for different product attributes.

[0043] For example, if a company wants to obtain the quantity of goods to be configured in the system, it retrieves the goods information from the ERP system database, including name, description, price, inventory quantity, size, color, etc. After cleaning and verification, it determines the historical sales data and current inventory level, and then organizes the data into a unified format for analysis to determine the target configuration quantity. At the same time, it determines the initial weight parameters for different attributes of the goods, such as size, color, style, etc.

[0044] S2: Convert the product allocation plan into a binary-coded product combination and build an initial allocation plan library, where each initial allocation plan represents a possible allocation strategy.

[0045] It should be noted that the binary encoding refers to the binary encoding rules, which only contain "0" and "1". The binary encoding order can be from left to right or from right to left; this product distribution system does not restrict the binary encoding order. The initial distribution scheme library merges the product combinations generated by the binary encoding, with each combination representing a distribution scheme.

[0046] As an alternative implementation, converting a product allocation scheme into binary-coded product combinations involves representing each product as a binary number, where "1" indicates the product is selected for allocation, and "0" indicates it is not selected. This process first requires determining the total number of products, then assigning a binary bit to each product. Next, based on the allocation strategy, each product is either selected or not selected, resulting in a series of binary codes, each representing a unique allocation scheme. All allocation schemes are then compiled into a set, constructing an initial allocation scheme library.

[0047] For example, a bookstore has 10 different books available for distribution, and the bookstore needs to allocate books for a new store. In the binary coding process, each book is assigned a number from 1 to 10. The bookstore then decides which books to distribute based on factors such as popularity and seasonal demand. For instance, if the bookstore decides to distribute books numbered 1, 3, 5, and 7, the binary code for this distribution plan would be "1010101000," where each number corresponds to a book, 1 indicates selection, and 0 indicates no selection. The bookstore can also set up an initial distribution plan library containing 100 different plans. These plans may be based on different selection criteria, such as book category, author, price range, or target customer group. For example, the first plan in the library might be "1010101000," representing the distribution of books numbered 1, 3, 5, and 7; while the second plan might be "1111011100," representing the distribution of books numbered 1, 2, 3, 4, 6, 7, and 8. This initial distribution plan library provides bookstores with a variety of distribution options.

[0048] S3: Define the evaluation criteria for the distribution plan, and evaluate the initial distribution plan based on the product characteristic distribution and the weight parameters.

[0049] It should be noted that the product characteristic distribution and weight parameters are derived from information such as product diversity, inventory turnover rate, customer satisfaction, and profit maximization. Therefore, the initial distribution plan can be evaluated by combining the evaluation criteria under these parameters.

[0050] As an optional implementation, the distribution of product features in each scheme is analyzed by product feature distribution and weight parameters, and the score of each scheme is calculated according to preset weight parameters, thereby evaluating the feasibility of each scheme based on the distribution of product features and weight parameters.

[0051] For example, when evaluating a delivery plan, three characteristics are considered: product functionality, brand awareness, and price range. Based on market research, each characteristic is weighted: functionality accounts for 40%, brand awareness for 30%, and price range for 30%. Therefore, when evaluating a delivery plan containing 10 different vehicle models, the total score is calculated based on the distribution of each model across these three characteristics and then weighted accordingly.

[0052] S4: Using the initial allocation scheme library as input, generate the first allocation scheme library through selection, crossover, and mutation operations.

[0053] As an optional implementation, after determining the initial allocation scheme library, the initial allocation schemes that do not meet the preset fitness threshold can be selectively subjected to operations such as selection, crossover, and mutation.

[0054] S5: Repeat step S4 until the termination condition is met, such as reaching the maximum number of iterations or finding a target packing scheme library that meets the preset fitness threshold.

[0055] S6: Select the best-fitting distribution plan from the target distribution plan library as the optimal solution.

[0056] It's important to note that crossover in genetic algorithms simulates a part of the biological reproduction process by exchanging certain parts of the parent schemes. The goal is to generate new combinations, potentially containing better allocation strategies. Mutation involves randomly altering certain parts of the selected allocation schemes, introducing new genetic diversity. This helps the algorithm escape local optima and explore a wider solution space. The termination condition is the maximum number of iterations or the algorithm reaching the target solution. Fitness is a metric used to measure the quality of an allocation scheme; higher fitness indicates that the allocation scheme better meets the target demand.

[0057] As an optional implementation, an initial distribution scheme library is used as input. The first generation of distribution scheme library is generated through the three core operations of the genetic algorithm: selection, crossover, and mutation. The genetic algorithm is repeatedly executed until a predefined termination condition is found, which can be reaching the maximum number of iterations or finding a distribution scheme that meets a preset fitness threshold. When the iteration stops, the distribution scheme with the highest fitness is selected from the final distribution scheme library as the optimal solution.

[0058] For example, after generating 100 binary schemes for a jewelry store, the fitness of each scheme is calculated, and the 20 schemes with the highest fitness are selected as the iterations of the genetic algorithm. A single-point crossover method is used to exchange some parts between two schemes to generate new schemes. At the same time, a mutation operation is performed on a single scheme to introduce new genetic diversity and generate the first generation of distribution scheme library. If the first generation of distribution scheme library does not meet the preset termination condition, the iteration count can be 100 times. Then, the genetic algorithm continues to iterate on the first generation of distribution scheme library until the preset number of 100 iterations is met to obtain the target distribution scheme. At this time, there can be multiple target distribution schemes. Then, the fitness of the target distribution schemes is calculated, and the distribution scheme with the highest fitness is output as the optimal solution.

[0059] In this embodiment, by collecting and analyzing detailed information about the goods to be allocated, the allocation plan is converted into binary code to construct an initial plan library. Then, evaluation criteria are defined, and the fitness of the initial plan is evaluated using product features and weight parameters. Next, through selection, crossover, and mutation operations using a genetic algorithm, a first-generation allocation plan library is generated from the initial plan library. This library is iteratively optimized until the maximum number of iterations is reached or a plan that meets a preset fitness threshold is found. Finally, the plan with the highest fitness is selected from the target plan library as the optimal solution. This solution best meets market demand and business objectives, representing the best allocation strategy. The entire process simulates natural selection, iteratively evolving the best allocation plan.

[0060] Based on Embodiment 1, Embodiment 2 of this application proposes a commodity allocation method based on a genetic algorithm, referring to... Figure 2 , Figure 2 This is a flowchart illustrating Embodiment 2 of the commodity allocation method based on genetic algorithms in this application. Step S2 includes steps A21 to A22:

[0061] Step A21: Based on preset encoding rules, the product distribution plan is encoded into binary product combinations.

[0062] It should be noted that in this embodiment, the preset encoding rule is that "1" usually indicates that a certain product is selected for distribution, while "0" indicates that the product is not selected. Each bit in the binary sequence corresponds to a specific product or category.

[0063] Optionally, step A21 includes steps B21 to B22:

[0064] Step B21: Based on the preset coding rules, determine the quantity of goods corresponding to the goods distribution plan.

[0065] Step B22: Based on the product categories present in the product quantity, determine the binary sequence as the product combination.

[0066] As an optional implementation, the number of "1"s representing selected items is counted. Each "1" represents a selected item, which yields the quantity of items in the distribution plan. Further analysis of the item category distribution allows for the determination of the specific item combination represented by the binary sequence.

[0067] For example, a bookstore might use a binary coding system to manage its merchandise distribution plan. Four different book categories—comics, science, history, and art—would be categorized, with each category assigned a unique binary bit, from left to right: comics (bit 1), science (bit 2), history (bit 3), and art (bit 4). A possible distribution plan might have a binary code of "1010," meaning that books in the comics and history categories are selected, while books in the science and art categories are not. This demonstrates that the distribution plan can be associated with the binary code.

[0068] Step A22: Construct the initial distribution scheme library based on the binary sequence corresponding to the product combination.

[0069] It should be noted that a binary sequence is a character sequence derived from binary encoding, representing an associated distribution plan.

[0070] Optionally, step A22 includes steps B23 to B24:

[0071] Step B23: Based on the distribution plan library corresponding to the product combination, determine the quantity of products corresponding to the distribution plan library.

[0072] Step B24: Based on the quantity of goods and preset rules, adjust the combination of goods to construct the initial distribution plan library.

[0073] As an optional implementation, each distribution plan in the plan library is parsed, and a product combination of length N is generated for each plan based on the number of products available, where N is the total number of available products. For each product combination, each product is assigned 0 or 1 based on empirical rules or historical data analysis, where 1 indicates that the product is selected and 0 indicates that it is not selected. An adjustment probability is introduced to increase the diversity of the distribution plan library. That is, during the process of generating product combinations, the values ​​of some products are changed from 0 to 1 or from 1 to 0 with a certain probability, thereby constructing the initial distribution plan library.

[0074] In this embodiment, the product allocation scheme is encoded into binary product combinations, that is, the specific product selection is converted into a format that can be efficiently processed by a computer, so as to be managed and optimized through automated methods; an initial allocation scheme library is constructed based on the binary sequences corresponding to these product combinations, generating a diverse set of potential allocation schemes, which facilitates the unified processing of feasible allocation schemes.

[0075] Based on any of the above embodiments, Embodiment 3 of this application proposes a commodity allocation method based on a genetic algorithm, referring to... Figure 3 , Figure 3 This is a flowchart illustrating Embodiment 3 of the commodity allocation method based on genetic algorithms in this application. Step S3 includes steps A31 to A32:

[0076] Step A31: Determine the initial similarity of the distribution scheme based on the characteristic distribution of the goods.

[0077] It should be noted that the initial similarity is a preliminary evaluation of the distribution plan. Based on the degree of matching between the distribution of product characteristics and the preset target or market demand, the distribution plan is initially scored for similarity.

[0078] As an alternative implementation, the frequency distribution of each feature in the distribution plan is calculated, and a similarity score is given to the target distribution.

[0079] As an alternative implementation, cluster analysis is used to compare the distribution plan with a set of known distribution plans with high similarity.

[0080] For example, a clothing store needs to adjust its merchandise distribution plan. First, it collects data on popular colors for the current season and finds that blue and green are the most popular. Then, the retailer examines the distribution of blue and green clothing in its distribution plan. If 60% of the clothing in the distribution plan is blue or green, and the target market demand is 70%, the retailer can calculate an initial similarity score, such as 0.86 (60 / 70). This score indicates that the current distribution plan has some degree of match with market demand, but there is still room for improvement.

[0081] Step A32: If the initial similarity is not less than a preset threshold, multiply the product feature similarity with the corresponding weight parameter and sum the results to obtain the total fitness corresponding to the product allocation scheme.

[0082] As an alternative implementation, a weighted average sum can be used to obtain the overall fitness of the product allocation plan. First, the similarity between the characteristics of each product in the allocation plan and the market demand or target characteristics is assessed. Then, based on the importance of each characteristic, corresponding weight parameters are assigned to them. Next, the similarity of each product characteristic is multiplied by its corresponding weight parameter to obtain the weighted similarity of each characteristic. Finally, the weighted similarities of all characteristics are summed to obtain the overall fitness of the allocation plan.

[0083] A feasible formula for calculating the total fitness S:

[0084]

[0085] Where S represents the overall fitness of the product allocation scheme, Sd represents the similarity of the main dimensions, T represents the preset threshold, Wi represents the weight parameter of the i-th feature, and Si represents the similarity of the i-th feature. That is, if the similarity Sd of the main features is less than T, the overall fitness is 0; if the similarity Sd of the main features is greater than or equal to T, the overall fitness S is the sum of the products of the similarities Si of all features and their corresponding weights Wi.

[0086] For example, in an electronics store, market research determined the weight parameters for four key characteristics: brand awareness (30%), technological innovation (25%), user reviews (30%), and price competitiveness (15%). One distribution plan includes multiple electronic products. First, the similarity of these products across the four characteristics is evaluated: brand awareness 0.8, technological innovation 0.7, user reviews 0.9, and price competitiveness 0.6. Since the initial similarity of the distribution plan exceeds a preset threshold, the overall fitness is calculated. Then, the similarity of each characteristic is multiplied by its corresponding weight to obtain a weighted similarity (0.8 0.3 + 0.7 0.25 + 0.9 0.3 + 0.6 0.15): brand awareness 0.24, technological innovation 0.175, user reviews 0.27, and price competitiveness 0.09. Finally, these weighted similarities are summed to obtain the overall fitness of the distribution plan, which is 0.775.

[0087] In this embodiment, the initial similarity is determined by comparing the distribution of product characteristics in the allocation plan with the distribution of market demand characteristics, thereby assessing the initial adaptability of the allocation plan. If the initial similarity reaches or exceeds a preset threshold, it indicates that the allocation plan is sufficiently matched with the market in terms of basic characteristics. Subsequently, the total fitness is calculated by multiplying the similarity of product characteristics by the corresponding weight parameters and summing them, which can comprehensively reflect the adaptability and importance of the allocation plan in various key characteristics.

[0088] Based on any of the above embodiments, Embodiment 4 of this application proposes a commodity allocation method based on a genetic algorithm, referring to... Figure 4 , Figure 4 This is a flowchart illustrating Embodiment 4 of the commodity allocation method based on genetic algorithms in this application. Step S4 includes steps A41 to A42:

[0089] Step A41: Select two distribution schemes from the initial distribution scheme library based on the fitness of the distribution scheme.

[0090] Step A42: Perform crossover and variation operations on the two distribution schemes to determine the first distribution scheme library.

[0091] As an optional implementation, based on the fitness of known distribution schemes, the two with the highest fitness are selected as distribution schemes for cross-operation. By selecting a cross point in the binary codes of the two schemes and then swapping the codes on both sides of that point, two new descendant schemes are generated, which together with the remaining distribution schemes constitute a new first distribution scheme library.

[0092] For example, there are five distribution schemes and their fitness scores: Scheme 1 (fitness 92), Scheme 2 (fitness 85), Scheme 3 (fitness 95), Scheme 4 (fitness 88), and Scheme 5 (fitness 90). The two schemes with the highest fitness are selected for cross-operation, i.e., Scheme 3 and Scheme 1 are selected. Then, cross-operation is performed on Scheme 3 and Scheme 1. If the code corresponding to Scheme 3 is "11101001100" and the code corresponding to Scheme 1 is "10101011001", after cross-operation on the second and seventh bits, the codes of the two new descendant schemes generated may be "10101011100" and "11101001001". These schemes are then merged with the uncrossed distribution schemes to form the first distribution scheme library.

[0093] As another optional implementation, based on the fitness level of the known distribution schemes, a corresponding mutation priority is set for each scheme, the mutation priority is normalized, and a single distribution scheme is selected according to probability for mutation operation. The mutation is performed on the coding part inside the scheme to obtain a new descendant scheme, which is then put back into the first distribution scheme library.

[0094] It's important to note that high-fitness formulations need low mutation probabilities because high-fitness formulations typically possess superior gene combinations that contribute to high fitness in the current environment. For these formulations, we generally aim to pass on these superior gene combinations to the next generation; therefore, we tend to reduce their mutation probabilities to preserve these desirable genetic traits. In this embodiment, a lower mutation priority is assigned to high-fitness formulations to reduce their mutation probabilities.

[0095] For example, there are four distribution schemes and their fitness scores: Scheme 1 (fitness 10), Scheme 2 (fitness 20), Scheme 3 (fitness 30), and Scheme 4 (fitness 40), with corresponding mutation priorities of (4, 3, 2, 1,). Mutations with higher priorities are given priority. These mutation priorities are normalized to obtain the corresponding mutation probabilities: Scheme 1 (0.4), Scheme 2 (0.3), Scheme 3 (0.2), and Scheme 4 (0.1). Then, mutation operations are performed on the selected schemes. If the code corresponding to Scheme 3 is "101010101010", mutations occur at the third and eighth positions, generating a new descendant scheme "100010111010". The distribution schemes that have undergone mutation operations are merged with the unmutated distribution schemes to form the first distribution scheme library.

[0096] Optionally, after step A42, step B41 may also be included:

[0097] Step B41: Perform the crossover and mutation operations on at least two of the first distribution schemes in the first distribution scheme library based on preset iteration conditions to determine the target distribution scheme library.

[0098] It should be noted that the preset iteration condition refers to the termination condition for exiting the genetic algorithm loop. In this embodiment, it can be the maximum number of iterations, or it can be that a preset threshold condition is met before reaching the maximum number of iterations, such as the fitness reaching the target value, thus exiting the loop. The target allocation scheme library consists of one or more allocation schemes that meet the preset iteration condition.

[0099] As an optional implementation, a high-fitness allocation scheme from the first allocation scheme library is selected as the parent scheme based on the fitness evaluation criteria. Then, two allocation schemes are selected for crossover operations to generate new descendant schemes, or a mutation operation is performed on a certain allocation scheme. The descendant schemes from the crossover and mutation operations are then combined with the remaining schemes to form a new allocation scheme library. This process continues until a preset iteration condition is met, such as reaching the maximum number of iterations, thereby determining that the allocation schemes that meet the preset threshold constitute the target allocation scheme library.

[0100] For example, the constructed first distribution scheme library contains 10 different distribution schemes, each corresponding to a binary code representing different product combinations. At this point, the highest fitness among the distribution schemes is 75, the preset maximum number of iterations is 20, and the fitness threshold is 90. Since the distribution schemes have not yet met the preset iteration conditions, crossover and mutation operations continue to be performed on the first distribution scheme library. If, by the fifteenth iteration, there exists at least one distribution scheme with a fitness greater than 90, the loop is exited, and the target distribution scheme library that meets the preset fitness threshold is output. If the preset fitness threshold is still not met by the maximum number of iterations, the second distribution scheme library, which has finished its iteration, is used as input for further crossover and mutation operations until the target distribution scheme library is output.

[0101] In this embodiment, by selecting two initial allocation schemes with high fitness and performing crossover and mutation operations, and iterating according to preset conditions, the mechanism of natural selection and genetic variation is simulated. Through iterative evolution, the overall fitness of the allocation scheme is gradually improved, generating allocation schemes that are more adapted to market demands, thereby determining the target allocation scheme library.

[0102] Based on any of the above embodiments, Embodiment 5 of this application proposes a commodity allocation method based on a genetic algorithm, referring to... Figure 5 , Figure 5 This is a flowchart illustrating Embodiment 4 of the commodity allocation method based on genetic algorithms in this application. Step S6 includes steps A61 to A62:

[0103] Step A61: Calculate the fitness of the target distribution scheme based on the similarity of the product feature distribution in the target distribution scheme library.

[0104] Step A62: Determine the target delivery plan based on the fitness ranking order.

[0105] It should be noted that the fitness of the distribution plan is calculated to reflect the degree of matching between the distribution plan and the distribution of product characteristics.

[0106] As an optional implementation, based on the product feature distribution of the target market or customer demand, the product feature distribution of each distribution plan in the target distribution plan library is analyzed. Then, the similarity between the product feature distribution of each distribution plan and the target feature distribution is quantitatively calculated, which can be done using the cosine similarity formula. It should be noted that cosine similarity is a method used to calculate the similarity of angles between two non-zero vectors. Finally, based on the similarity calculation results and preset weight parameters, the fitness of each distribution plan is calculated. According to the order of the calculated fitness, the distribution plan with the highest fitness is selected as the target distribution plan output.

[0107] The feasible formula for calculating similarity is:

[0108]

[0109] Where W is the cosine similarity, and T c Let S be the target feature distribution vector. c Let T be the characteristic distribution vector of the distribution scheme. c ·S c The dot product of two feature distribution vectors, ||T c || is the magnitude of the target feature distribution vector, ||S c || represents the modulus of the characteristic distribution vector of the distribution scheme.

[0110] For example, to optimize its product allocation plan, a clothing store first determines the target feature distribution through market research as follows: color (50% light, 30% neutral, dark) and style (60% casual, 20% formal, 20% sporty). Then, it analyzes a product allocation plan from the target allocation plan library, whose product feature distribution is: color (40% light, 40% neutral, 20% dark) and style (50% casual, 30% formal, 20% sporty). Next, it uses the cosine similarity formula to calculate the similarity between the color and style feature distributions of this allocation plan and the target feature distribution. The two color feature distribution vectors are: T... c (0.5, 0.3, 0.2), S c Given the values ​​(0.4, 0.4, 0.2), the cosine similarity of the color feature in this allocation scheme is calculated to be 0.9, and the cosine similarity of the style feature is 0.7. If the preset feature weights for color and style are 60% and 40% respectively, the overall fitness of this allocation scheme can be calculated as: (0.9 * 0.6) + (0.7 * 0.4) = 0.84. After calculating the overall fitness of all allocation schemes, the allocation scheme with the highest overall fitness is selected as the target allocation scheme.

[0111] In this embodiment, by quantifying the degree of matching between each distribution plan and the target customer's needs, the similarity between the product feature distribution in the distribution plan and the target feature distribution is calculated, and the similarity is converted into fitness scores and sorted. This quickly identifies the distribution plan that best meets market demand, ensuring that the selected distribution plan can maximize the satisfaction of market demand and expected requirements.

[0112] This application provides a commodity distribution device based on a genetic algorithm. The commodity distribution device based on a genetic algorithm 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 to enable the at least one processor to execute the commodity distribution method based on the genetic algorithm in the first embodiment described above.

[0113] The following is for reference. Figure 6 This document illustrates a structural diagram of a goods distribution device based on a genetic algorithm, suitable for implementing embodiments of this application. The goods distribution device based on a genetic algorithm in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The illustrated product distribution equipment based on genetic algorithms is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0114] like Figure 6 As shown, the commodity distribution equipment based on genetic algorithms may include a processing unit 1001 (e.g., a core processor, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the commodity distribution equipment based on genetic algorithms. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the genetic algorithm-based goods distribution equipment to communicate wirelessly or wiredly with other devices to exchange data. Although a genetic algorithm-based goods distribution equipment with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0115] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0116] The commodity distribution equipment based on genetic algorithms provided in this application, employing the commodity distribution method based on genetic algorithms in the above embodiments, can solve the technical problems of commodity distribution based on genetic algorithms. Compared with the prior art, the beneficial effects of the commodity distribution equipment based on genetic algorithms provided in this application are the same as those of the commodity distribution method based on genetic algorithms provided in the above embodiments, and other technical features of this commodity distribution equipment based on genetic algorithms are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0117] It should be understood that the various parts disclosed in this application can be implemented using 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 suitable manner in one or more embodiments or examples.

[0118] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0119] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the commodity allocation method based on genetic algorithm in the above embodiments.

[0120] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. 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 conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0121] The aforementioned computer-readable storage medium may be included in a commodity distribution device based on a genetic algorithm; or it may exist independently and not be assembled into a commodity distribution device based on a genetic algorithm.

[0122] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a genetic algorithm-based goods distribution device, enable the genetic algorithm-based goods distribution device to: determine the goods data to be configured in the system, the target configuration quantity, the distribution of goods characteristics, and the corresponding weight parameters; convert the goods configuration scheme into binary-coded goods combinations and construct an initial distribution scheme library; define evaluation criteria and evaluate the fitness of each scheme based on the distribution of goods characteristics and weight parameters; perform genetic algorithm optimization and select the scheme with the highest fitness from the final distribution scheme library as the optimal solution.

[0123] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0125] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0126] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described commodity allocation method based on genetic algorithms, thereby solving the technical problem of commodity allocation based on genetic algorithms. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the commodity allocation method based on genetic algorithms provided in the above embodiments, and will not be repeated here.

[0127] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A commodity allocation method based on a genetic algorithm, characterized in that, The commodity allocation method based on genetic algorithms includes: S1: Determine the product data to be configured in the system, the target configuration quantity, the product feature distribution, and the weight parameters. The product data to be configured refers to the detailed information of the products considered in the order fulfillment process, including product ID, name, description, category, and price. The target configuration quantity refers to the total number of product combinations that need to be achieved in the order fulfillment process. Product features refer to the various attributes or characteristics of the products and the distribution of these features among all products, including series, shape, material, style, and price. The product feature distribution represents the frequency of different features in the product set. The weight parameters are the values ​​assigned to each feature. S2: Convert the product allocation plan into a binary-coded product combination and build an initial allocation plan library, where each initial allocation plan represents an allocation strategy; S3: Define the evaluation criteria for the distribution plan, and evaluate the initial distribution plan based on the product characteristic distribution and the weight parameters; S4: Using the initial allocation scheme library as input, generate the first allocation scheme library through selection, crossover and mutation operations; S5: Repeat step S4 until the termination condition is met. The termination condition is reaching the maximum number of iterations or finding a target allocation scheme library that meets the preset fitness threshold. S6: Select the best-fitting distribution plan from the target distribution plan library as the optimal solution; S3 includes: The initial similarity of the distribution scheme is determined based on the degree of matching between the product's characteristic distribution and the preset target or market demand. If the initial similarity is not less than a preset threshold, the product similarity of the goods features is multiplied by the corresponding weight parameters and summed to obtain the total fitness corresponding to the goods allocation scheme. The formula for calculating the total fitness S is as follows: S represents the overall fitness of the product allocation scheme, Sd represents the similarity of the main dimension, T represents the preset threshold, Wi represents the weight parameter of the i-th feature, and Si represents the similarity of the i-th feature. S6 includes: The fitness of the target distribution scheme is calculated based on the similarity of the product feature distribution in the target distribution scheme library. The target allocation plan is determined based on the fitness ranking order.

2. The commodity allocation method based on genetic algorithm as described in claim 1, characterized in that, The steps of converting the product allocation scheme into binary-coded product combinations and constructing an initial allocation scheme library, where each scheme represents a possible allocation strategy, include: Based on preset encoding rules, the product distribution plan is encoded into binary combinations of products; The initial distribution scheme library is constructed based on the binary sequence corresponding to the product combination.

3. The commodity allocation method based on genetic algorithm as described in claim 2, characterized in that, The step of encoding the product distribution plan into binary product combinations based on preset encoding rules includes: Based on the preset coding rules, the quantity of goods corresponding to the goods distribution plan is determined; Based on the product categories present in the quantity of products, the binary sequence is determined to be the product combination.

4. The commodity allocation method based on genetic algorithm as described in claim 2, characterized in that, The step of constructing the initial distribution plan library based on the binary sequence corresponding to the product combination includes: Based on the distribution plan library corresponding to the product combination, determine the product quantity corresponding to the distribution plan library; Based on the quantity of goods and preset rules, the combination of goods is adjusted to construct the initial distribution scheme library.

5. The commodity allocation method based on genetic algorithm as described in claim 1, characterized in that, The step of generating a first allocation plan library by taking the initial allocation plan library as input and performing selection, crossover, and mutation operations includes: Based on the fitness of the aforementioned distribution scheme, two distribution schemes from the initial distribution scheme library are selected; By performing crossover and variation operations on the two aforementioned distribution schemes, a first distribution scheme library is determined.

6. The commodity allocation method based on genetic algorithm as described in claim 5, characterized in that, After the step of performing cross-comparison and variation operations on the two distribution schemes to determine the first distribution scheme library, the method further includes: Based on preset iteration conditions, the crossover and mutation operations are performed on at least two of the first distribution schemes in the distribution scheme library to determine the target distribution scheme library.

7. A commodity distribution device based on a genetic algorithm, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the commodity allocation method based on a genetic algorithm as described in any one of claims 1 to 6.

8. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the commodity allocation method based on a genetic algorithm as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Replenishment order generation method, device, equipment and storage medium

    CN111080206A