Pork pig intelligent distribution method and device based on anchor point clustering and priority rule optimization
The intelligent pig distribution method optimized by anchor point clustering and priority rules solves the matching accuracy and efficiency problems of traditional pig distribution methods in complex scenarios, and realizes efficient and flexible pig distribution scheduling.
Patent Information
- Application Number
- CN202510714873.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-10-17
AI Technical Summary
Traditional pig distribution methods rely on manual experience, are difficult to adapt to complex scheduling scenarios, cannot identify similarities between pens, and have a single order priority design, resulting in large weight deviations and low transportation efficiency. The system is prone to falling into local optimality or matching failure.
An anchor clustering model is introduced to construct the pen structure, a multi-factor priority sorting strategy is designed, and batch greedy scheduling is combined with mixed integer programming optimization solution to optimize the intelligent pig distribution through anchor clustering and priority rules.
It improves the matching accuracy and overall system efficiency of pig distribution scheduling, enhances business responsiveness, adapts to scheduling flexibility and robustness in complex scenarios, and ensures the efficient completion of pen clearing tasks.
Smart Images

Figure CN120806403A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of livestock breeding management and intelligent scheduling, and particularly relates to a piglet intelligent distribution method and device based on anchor point clustering and priority rule optimization. BACKGROUND
[0002] With the continuous improvement of the intensification and informatization level of the livestock breeding industry, the meat pig delivery link puts forward higher requirements for the transportation efficiency and matching accuracy. The traditional distribution method often relies on manual experience judgment and can only roughly allocate based on the estimated average weight or the order of the stalls, which lacks systematicness and adjustability and is difficult to adapt to the complex scheduling scenarios in reality. At present, some breeding enterprises have tried to introduce a simple rule engine to assist decision-making, but there are still many deficiencies. For example, in the case of multiple orders being issued at the same time, there are cleaning tasks, and customers have requirements for vehicle grades or road carrying grades, the traditional method is difficult to consider all the constraints, often leading to scattered stall selection and large weight deviation, thereby affecting the transportation efficiency and customer satisfaction. At the same time, the existing method generally lacks the modeling ability of the similarity between stalls and cannot identify grouping strategies with structural characteristics. In addition, the priority rule design of the order is relatively single, usually only considering the static weight ordering, ignoring the influence of multiple factors such as cleaning urgency, breeder distribution and transportation resources. In the dynamic scheduling process, if the change of stall availability or the lack of cleaning stall resources cannot be responded in time, the system is easy to fall into local optimum or matching failure. Therefore, in order to improve the intelligent level of the piglet distribution scheduling and enhance the adaptability and robustness of the algorithm in complex scenarios, the application introduces anchor point clustering modeling, multi-factor priority ordering mechanism and greedy solving strategy of mixed integer programming, and proposes a piglet intelligent distribution method which can automatically identify stall structure, reasonably arrange distribution order and meet the actual constraints such as cleaning and priority. SUMMARY
[0003] The main purpose of the application is to overcome the shortcomings and deficiencies of the prior art, provide a piglet intelligent distribution method and device based on anchor point clustering and priority rule optimization, construct the stall structure by introducing the anchor point clustering model, design the multi-factor priority ordering strategy, and combine the batch greedy scheduling and mixed integer programming optimization solution, realize efficient intelligent distribution scheduling under complex constraints, improve the matching weight accuracy, cleaning task completion rate and overall scheduling efficiency of the system, and thus improve the intelligent level and business response ability of the piglet delivery process.
[0004] In order to achieve the above purpose, the application adopts the following technical scheme:
[0005] In a first aspect, the application provides a piglet intelligent distribution method based on anchor point clustering and priority rule optimization, comprising the following steps:
[0006] Obtaining farm site sample and order data, obtaining dataset of standardized data structure;
[0007] Selecting site anchor points from the dataset, calculating the distance between site samples and site anchor points, and constructing a sample-anchor distance bipartite graph;
[0008] Inputting the sample-anchor distance bipartite graph into the pre-established CDBG clustering model, and generating site clustering results by minimizing the objective function with a balance parameter;
[0009] According to the order cleaning marker, priority score and road and vehicle level matching, a multi-factor priority sorting rule is constructed, and the priority sorting rule is used to score all orders, and the higher the score, the higher the priority of the order;
[0010] A batch greedy strategy is adopted for scheduling, and a target order is selected from the current order with the highest priority in each round of scheduling, and available sites are selected according to the site clustering results, a mixed integer programming model is constructed, and the model is optimized and solved in each round of scheduling to minimize the weight deviation of the distribution, and the site allocation is completed;
[0011] Based on the site allocation result, a distribution table containing order and site pairing results is output.
[0012] As a preferred technical solution, in the process of obtaining site information and order data, the following steps are further included:
[0013] A standardized data structure in a unified format is constructed, wherein the site sample field includes estimated average weight, cleaning marker, number of sites, farmer information and road level, and the order field includes demand quantity, average weight target, vehicle level, cleaning priority marker and priority score;
[0014] Data sources are loaded from spreadsheets, database interfaces or structured APIs to realize rapid deployment and data integration of the system.
[0015] As a preferred technical solution, the sample-anchor distance bipartite graph is constructed as follows:
[0016] A certain number of sites are randomly selected as anchor points to obtain a site anchor point matrix M;
[0017] The distance between all site sample matrix X and site anchor point matrix M is calculated by matrix expansion method, and the distance calculation method is automatically selected according to the dimension of site data:
[0018] When the dimension is less than 10, the Euclidean square distance calculation method is used;
[0019] When the dimension is 10-50, the Manhattan distance calculation method is used;
[0020] Cosine distance calculation method is used when the dimension is greater than 50.
[0021] As a preferred technical solution, the distance calculation mode includes three distance measurement modes of Euclidean square distance, Manhattan distance or cosine distance.
[0022] The Euclidean square distance calculation method is represented as:
[0023]
[0024] The Manhattan distance calculation method is represented as:
[0025]
[0026] The cosine distance calculation method is represented as:
[0027]
[0028] Wherein, x i represents the feature vector of the i-th field sample, m j represents the feature vector of the j-th field anchor point, D ij represents the distance between them.
[0029] As a preferred technical solution, the optimization objective function of the CDBG clustering model is:
[0030]
[0031] Wherein, Ind represents the indication matrix, F represents the all-field-cluster indication matrix, G represents the anchor field-cluster indication matrix, D represents the sample-anchor distance bipartite graph, and λ is the adjustable balance parameter; By adjusting the balance parameter size, the trade-off between clustering compactness and clustering balance is realized.
[0032] As a preferred technical solution, the priority sorting rule is specifically:
[0033] Let the clear column mark of the j-th order be c j , wherein the clear column is 1, otherwise 0, the vehicle level is v j , the target road level is r j , the system given vehicle-road matching function is δ(v j , r j ) ∈ {0, 1}, the priority score is s j , then the order of the order is:
[0034] Score j = γ1·c j + γ1·δ(v j , r j )+ γ3·sj
[0035] wherein γ1, γ2, γ3 are weight coefficients satisfying γ1+γ2+γ3=1; G(v j ,r j ) = 1 indicates that the vehicle level matches the road level, otherwise 0; the higher the score, the higher the ranking, and the priority is scheduled.
[0036] As a preferred technical solution, the optimization solution is performed in each round of scheduling to minimize the distribution body weight deviation, specifically:
[0037] Let the lane estimated average weight be w i , the order demand average weight be d j , the lane distribution head number be an integer variable q ij , and the lane whether being used by an order be a binary variable x ij , the optimization objective function is defined as:
[0038]
[0039] wherein Q j represents the target distribution quantity of order j, α is the lane use penalty coefficient, and β is the distribution reward coefficient; the objective function is composed of three parts, which are the body weight error term, the lane use penalty term and the distribution quantity reward term, and then the whole is normalized to ensure the fairness of cross-order comparison, and combined with multiple constraints such as clear lane priority, vehicle level matching, distribution up and down floating range to build an optimization model.
[0040] As a preferred technical solution, when the clear lane storage quantity is insufficient to meet the order demand, non-clear lane is used for supplementary distribution, specifically:
[0041] First, a set C of all lanes marked as clear is formed, the sum S C of available storage is counted, and the current order minimum acceptable distribution quantity is denoted as Q min ;
[0042] When S C <Q min , a new candidate lane set R is formed by dynamically enabling non-clear lanes, and C∪R is used as the feasible matching space;
[0043] To reduce the body weight deviation and maintain matching consistency, the supplementary distribution is preferentially performed in the lanes in the same cluster as set C, that is, the lanes i satisfying cluster(i)∈cluster(C) are preferentially selected, so as to reduce the search space and enhance the distribution stability.
[0044] In a second aspect, the application provides a pig intelligent distribution system based on anchor point clustering and priority rule optimization, which is applied to the pig intelligent distribution method based on anchor point clustering and priority rule optimization and comprises a data preprocessing module, a distance bipartite graph construction module, an anchor point clustering module, an order priority evaluation module, a greedy scheduling module and a result output module.
[0045] The data preprocessing module is configured to obtain farm site samples and order data and obtain a data set in a standardized data structure.
[0046] The distance bipartite graph construction module is configured to select site anchors from the data set, calculate a distance matrix between the site samples and the site anchors, and construct a sample-anchor distance bipartite graph.
[0047] The anchor point clustering module is configured to input the sample-anchor distance bipartite graph into a pre-established CDBG clustering model, minimize an objective function with a balance parameter, and generate a site clustering result.
[0048] The order priority evaluation module is configured to construct a multi-factor priority sorting rule according to order cleaning markers, priority scores and road and vehicle level matching conditions, score the orders using the priority sorting rule, and the higher the score, the higher the priority.
[0049] The greedy scheduling module is configured to adopt a batch greedy strategy for scheduling, select a target order from the order with the highest priority in each round of scheduling, filter available sites in combination with the site clustering result, construct a mixed integer programming model, optimize and solve the model in each round of scheduling to minimize the distribution weight deviation, and complete site allocation.
[0050] The result output module is configured to output a distribution table containing order and site pairing results based on the site allocation result.
[0051] In a third aspect, the application provides an electronic device, which comprises:
[0052] at least one processor; and
[0053] a memory communicatively connected to the at least one processor; wherein
[0054] the memory stores computer program instructions executable by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to execute the pig intelligent distribution method based on anchor point clustering and priority rule optimization.
[0055] Compared with the prior art, the application has the following advantages and beneficial effects:
[0056] 1. This invention introduces the anchor-based distance bipartite graph clustering model CDBG to cluster the sample structure of the pens before pens are allocated. During the scheduling phase, candidate pens can be searched only among pens in the same cluster, reducing the problem scale and the search space, effectively improving weight matching accuracy and overall system efficiency.
[0057] 2. The present invention constructs comprehensive sorting rules in the order processing stage, and combines multiple factors such as clearance marks, priority scores, vehicle grades and road grades for sorting, ensuring that important tasks are scheduled first during actual operations. At the same time, dynamic sorting is used to adapt to business changes, thereby enhancing the flexibility and robustness of the scheduling strategy.
[0058] 3. The present invention adopts a scheduling strategy based on group greed, constructs a mixed integer programming model for orders of the same priority in each round, and selects the orders with the optimal current objective function for solution in each round. This not only reduces the system burden but also improves the scheduling consistency, making the distribution results more efficient and controllable.
[0059] 4. This invention constructs a mixed integer programming model with minimizing weight error as the core goal, introduces slot usage penalty items and cargo distribution reward items, and supports multiple practical rules such as order fluctuations, slot clearance constraints, and vehicle grade matching. It can generate feasible and high-quality optimal solutions under multiple constraints and is suitable for complex real-world scenarios.
[0060] 5. When the inventory of cleared slots is insufficient, the present invention allows the automatic activation of non-cleared slots for replenishment, and gives priority to selecting slots from samples in the same cluster as the cleared slots for distribution, ensuring the continuity and consistency of distribution, and enhancing the system's scheduling adaptability to extreme scenarios and emergencies.
[0061] 6. The present invention adopts a modular architecture design, which includes multiple functional modules such as data preprocessing, anchor clustering, priority evaluation, greedy scheduling and result output. The interfaces between each module are clear and logically independent. It supports fast loading of data sources from spreadsheets, databases or structured APIs, which is convenient for integration into farm scheduling systems or intelligent distribution platforms, and has good engineering deployment adaptability and maintainability. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0063] Figure 1 This is an overall flow chart of the intelligent pork distribution method based on anchor point clustering and priority rule optimization according to an embodiment of the present invention;
[0064] Figure 2 The figure is a calculation structure of sample-anchor distance bipartite graph of an embodiment of the present application.
[0065] Figure 3 The figure is a model structure of CDBG clustering model of an embodiment of the present application.
[0066] Figure 4 The figure is a decision flow chart of order priority ranking rule of an embodiment of the present application.
[0067] Figure 5 The figure is a scheduling strategy block diagram of greedy scheduling and mixed integer programming solution of an embodiment of the present application.
[0068] Figure 6 The figure is a replenishment strategy schematic diagram when the column field is insufficient of an embodiment of the present application.
[0069] Figure 7 The figure is a block diagram of intelligent distribution system of pigs based on anchor clustering and priority rule optimization of an embodiment of the present application.
[0070] Figure 8 The figure is a structure schematic diagram of an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0071] In order to make the personnel in the art better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without creative labor are within the scope of protection of the present application.
[0072] In the present application, the phrase "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. The person skilled in the art explicitly and implicitly understands that the embodiments described in the present application can be combined with other embodiments.
[0073] Please refer to Figure 1 In an embodiment of the present application, an intelligent distribution method of pigs based on anchor clustering and priority rule optimization is provided, comprising the following steps:
[0074] (1) Obtain the data of farm column sample and order to obtain a data set of standardized data structure.
[0075] Further, the column sample and order data are specifically:
[0076] The column sample field includes estimated average weight, number of stalls, empty stall marker, farmer number, and road grade, etc.
[0077] The order sample field includes order number, demand quantity, target average weight, vehicle grade, and priority score, etc.
[0078] Further, the system supports loading data sources from Excel files, database interfaces, or structured APIs, and uniformly cleaning the input data format.
[0079] (2) Select several anchor points from the column samples of the data set, construct a sample-anchor distance matrix, and form a sample-anchor distance bipartite graph based on the distance matrix, wherein the sample-anchor distance matrix is constructed based on the distance between the column samples and the anchor points, and the sample-anchor distance bipartite graph is formed based on the sample-anchor distance matrix.
[0080] Further, as shown in Figure 2 , the sample-anchor distance matrix is constructed based on the distance between the column samples and the anchor points, and the sample-anchor distance bipartite graph is formed based on the sample-anchor distance matrix, specifically:
[0081] The distance between all column sample matrices X and column anchor matrices M is calculated using matrix expansion, supporting three distance measurement methods: Euclidean square distance, Manhattan distance, or cosine distance.
[0082] The Euclidean square distance is represented as:
[0083]
[0084] The Manhattan distance is represented as:
[0085]
[0086] The cosine distance is represented as:
[0087]
[0088] where x i is the feature vector of the i-th column sample, m j is the feature vector of the j-th column anchor, and D ij is the distance between them.
[0089] The batch distance evaluation between samples and anchors is completed uniformly through vectorization operation; when the column data dimension is less than 10, the Euclidean square distance is used to efficiently reflect the geometric difference; when the column data dimension is between 10 and 50, the Manhattan distance is preferred to enhance the robustness of coordinate deviation; when the column data dimension is higher than 50, the cosine distance is used to reduce the distance degradation problem in high-dimensional space and focus on directional information.
[0090] (3) Please refer toFigure 3 The sample-anchor distance bipartite graph is input into an anchor clustering model CDBG for clustering, the CDBG model is optimized based on minimization of an objective function, and a column cluster division result is output.
[0091] Further, the objective function of the CDBG model is:
[0092]
[0093] Wherein, Ind represents an indication matrix, F represents all column-cluster indication matrices, G represents anchor column-cluster indication matrices, D represents a sample-anchor distance bipartite graph, and λ is an adjustable balance parameter; by adjusting the balance parameter size, a trade-off between clustering compactness and cluster balancing can be achieved.
[0094] It can be understood that the obtained clustering result is input as prior information into a scheduling model, and only available columns in the cluster matched with the current order are screened in each round of scheduling, thereby significantly reducing the feasible search space.
[0095] (4) Please refer to Figure 4 , priority ranking rules are constructed according to the column clearing marks, priorities, vehicle levels and road level matching conditions of orders, and all orders are sorted.
[0096] Further, the priority ranking rules are specifically:
[0097] Let the column clearing mark of the jth order be c j (1 if clearing the column, otherwise 0), the vehicle level be v j , the target road level be r j , the vehicle-road matching function given by the system be δ(v j , r j ) ∈ {0, 1}, and the priority score be s j , then the sorting score of the order is:
[0098] Score j = γ1·c j + γ2·δ(v j , r j )+ γ3·s j
[0099] Wherein, γ1, γ2, γ3 are weight coefficients, satisfying γ1+ γ2+ γ3=1; δ(v j , r j )=1 indicates that the vehicle level and the road level match, otherwise 0; the higher the score, the higher the order, and the order is preferentially scheduled; the sorting result is used as the input order basis of the greedy scheduling.
[0100] (5) Please refer to Figure 5, a batch greedy strategy is adopted for scheduling, a target order is selected from the order with the highest priority in each round of scheduling, available fields are screened in combination with clustering results, a mixed integer programming model is constructed, and in each round of scheduling, optimization is solved with the objective of minimizing the delivery weight deviation.
[0101] Further, the optimization solving with the objective of minimizing the delivery weight deviation in each round of scheduling is specifically:
[0102] Let the estimated average weight of the field be w i , the average weight of the order demand be d j , the field delivery head be an integer variable q ij , and whether the field is used by the order be a binary variable x ij , the optimization objective function is defined as:
[0103]
[0104] Where Q j represents the target delivery quantity of order j, a is the field use penalty coefficient, and β is the delivery reward coefficient; the objective function is composed of three parts, which are the weight error term, the field use penalty term and the delivery quantity reward term, then the whole is normalized to ensure the fairness of cross-order comparison, and multiple constraints such as clear field priority, vehicle level matching, delivery floating range, etc. can be combined to construct the optimization model.
[0105] Further, the system first forms a set C of all fields marked as clear, and counts the sum S C of the available storage number of the fields min ;
[0106] When S C <Q min , the system will dynamically enable non-clear field to form a new candidate field set R, and take C∪R as the feasible matching space;
[0107] To reduce the weight deviation and maintain the consistency of matching, priority is given to supplementing in the fields in the same cluster as set C, that is, priority is given to selecting from the field i that satisfies cluster(i)∈cluster(C), so as to reduce the search space and enhance the stability of delivery.
[0108] (6) Please refer to Figure 6 , based on the field allocation result, a delivery table containing order and field pairing results is output, recording order number, matched field, allocated quantity and estimated weight, etc. fields, which are used for subsequent scheduling or generating a shipping order.
[0109] Further, the delivery table containing order and field pairing results based on the field allocation result is specifically:
[0110] The system records the matching field, the allocated number of heads and the estimated weight of each order into a structured allocation table, and generates a scheduling log containing the order processing status and each round of selection process, facilitating system auditing and subsequent scheduling docking.
[0111] Based on the same idea as the intelligent pig meat allocation method based on anchor point clustering and priority rule optimization in the above embodiment, the application also provides an intelligent pig meat allocation system based on anchor point clustering and priority rule optimization, which can be used to execute the intelligent pig meat allocation method based on anchor point clustering and priority rule optimization. For the convenience of description, only the parts related to the embodiments of the application are shown in the structural schematic diagram of the intelligent pig meat allocation system based on anchor point clustering and priority rule optimization, and those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and can include more or fewer components than the illustrated, or combine certain components, or different component arrangements.
[0112] Please refer to Figure 7 In another embodiment of the present application, an intelligent pig meat allocation system based on anchor point clustering and priority rule optimization 100 is provided, which comprises a data preprocessing module 101, a distance bipartite graph construction module 102, an anchor point clustering module 103, an order priority evaluation module 104, a greedy scheduling module 105 and a result output module 106.
[0113] The data preprocessing module 101 is configured to obtain farm site sample and order data, and obtain a data set in a standardized data structure.
[0114] The distance bipartite graph construction module 102 is configured to select a site anchor point from the data set, calculate a distance matrix between the site sample and the site anchor point, and construct a sample-anchor distance bipartite graph.
[0115] The anchor point clustering module 103 is configured to input the sample-anchor distance bipartite graph into a pre-established CDBG clustering model, and generate a site clustering result by minimizing an objective function with a balance parameter.
[0116] The order priority evaluation module 104 is configured to construct a multi-factor priority sorting rule according to the order clearing mark, the priority score and the road and vehicle grade matching condition, and score the orders using the priority sorting rule, wherein the higher the score, the higher the priority.
[0117] The greedy scheduling module 105 is configured to adopt a batch greedy strategy for scheduling, select a target order from the order with the highest priority in each round of scheduling, filter available sites in combination with the site clustering result, construct a mixed integer programming model, and optimize and solve the model in each round of scheduling to minimize the allocation weight deviation, and complete site allocation.
[0118] The result output module 106 is configured to output a delivery table containing order and field pairing results based on the field allocation results.
[0119] It should be noted that the intelligent pork delivery system based on anchor point clustering and priority rule optimization of the present application corresponds to the intelligent pork delivery method based on anchor point clustering and priority rule optimization of the present application. The technical features and advantages described in the embodiment of the intelligent pork delivery method based on anchor point clustering and priority rule optimization are applicable to the embodiment of the intelligent pork delivery system based on anchor point clustering and priority rule optimization. For specific content, please refer to the description in the method embodiment of the present application. Here, no further description is given, and this is hereby declared.
[0120] In addition, in the embodiment of the intelligent pork delivery system based on anchor point clustering and priority rule optimization of the above-mentioned embodiment, the logical division of each program module is only illustrative. In actual application, the above-mentioned function allocation can be completed by different program modules according to the needs, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the intelligent pork delivery system based on anchor point clustering and priority rule optimization is divided into different program modules to complete all or part of the functions described above.
[0121] Please refer to Figure 8 In one embodiment, an electronic device implementing the intelligent pork delivery method based on anchor point clustering and priority rule optimization is provided. The electronic device 200 can include a first processor 201, a first memory 202, and a bus. It can also include a computer program stored in the first memory 202 and executable on the first processor 201, such as an intelligent pork delivery program based on anchor point clustering and priority rule optimization 203.
[0122] The first memory 202 includes at least one type of readable storage medium, such as flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 202 can be an internal storage unit of the electronic device 200, such as a mobile hard disk of the electronic device 200. In other embodiments, the first memory 202 can also be an external storage device of the electronic device 200, such as a plug-in mobile hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Further, the first memory 202 can include both an internal storage unit and an external storage device of the electronic device 200. The first memory 202 can be used to store application software and various data installed in the electronic device 200, such as the code of the intelligent meat and pig distribution program 203 based on anchor point clustering and priority rule optimization, and can also be used to temporarily store data that has been output or will be output.
[0123] The first processor 201 can be composed of an integrated circuit in some embodiments, such as a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same function or different functions, including one or more combinations of central processing units (CPU), microprocessors, digital processing chips, graphics processors, and various control chips, etc. The first processor 201 is the control unit of the electronic device, which connects various components of the entire electronic device through various interfaces and lines, and executes various functions and processes data of the electronic device 200 by running or executing programs or modules stored in the first memory 202 and calling data stored in the first memory 202.
[0124] Figure 8 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 8 The structure shown does not constitute a limitation on the electronic device 200, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0125] The intelligent meat and pig distribution program 203 based on anchor point clustering and priority rule optimization stored in the first memory 202 of the electronic device 200 is a combination of a plurality of instructions, which, when running in the first processor 201, can achieve:
[0126] Obtain the farm site sample and order data, and obtain the dataset of standardized data structure;
[0127] Select the site anchor point from the dataset, calculate the distance between the site sample and the site anchor point, and construct a sample-anchor distance bipartite graph;
[0128] Input the sample-anchor distance bipartite graph into the pre-established CDBG clustering model, minimize the objective function with a balance parameter, and generate the site clustering result;
[0129] According to the order clearing marker, the priority score and the road and vehicle level matching condition, a multi-factor priority sorting rule is constructed, and all orders are scored by using the priority sorting rule, and the order with higher score corresponds to higher priority;
[0130] A batch greedy strategy is adopted for scheduling, a target order is selected from the order with the highest priority in each round of scheduling, available sites are screened in combination with the site clustering result, a mixed integer programming model is constructed, and optimization solving is performed in each round of scheduling to minimize the delivery weight deviation, and site allocation is completed;
[0131] Based on the site allocation result, a delivery table containing order and site pairing result is output.
[0132] Further, the modules / units of the electronic device 200 are implemented in the form of software function units and sold or used as independent products, which can be stored in a non-volatile computer readable storage medium. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0134] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0135] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited to the above embodiments, and any changes, modifications, substitutions, combinations and simplifications made without departing from the spirit and principles of the present application shall be equivalent replacement methods and shall be within the scope of protection of the present application.
Claims
1. An intelligent pig distribution method based on anchor point clustering and priority rule optimization, characterized by: The steps include: Obtain farm pen samples and order data to obtain a data set with a standardized data structure; Select column anchors from the dataset, calculate the distance between column samples and column anchors, and construct a bipartite graph of sample-anchor distances; Input the sample-anchor distance bipartite graph into a pre-established CDBG clustering model, and generate a column clustering result by minimizing an objective function with a balance parameter; Based on order clearance marks, priority scores, and road and vehicle grade matching, a multi-factor prioritization rule is constructed. All orders are scored using the prioritization rule. Orders with higher scores have higher priorities. A batch greedy strategy is used for scheduling. In each round of scheduling, the target order is selected from the current order with the highest priority. Available slots are screened based on the slot clustering results. A mixed integer programming model is constructed. In each round of scheduling, an optimization solution is performed with the goal of minimizing the weight deviation of the allocated goods to complete the slot allocation. Based on the column allocation results, a distribution table containing order and column pairing results is output.
2. The intelligent pork distribution method based on anchor point clustering and priority rule optimization according to claim 1 is characterized in that: The process of obtaining field information and order data also includes the following steps: Build a standardized data structure with a unified format. The sample pen fields include estimated average weight, clearance mark, number of animals on hand, farmer information, and road grade. The order fields include required quantity, average weight target, vehicle grade, clearance priority mark, and priority score. Load data sources from spreadsheets, database interfaces, or structured APIs for rapid system deployment and data integration.
3. The intelligent pork distribution method based on anchor point clustering and priority rule optimization according to claim 1 is characterized in that: The construction of the sample-anchor distance bipartite graph is specifically as follows: Randomly select a certain number of columns as anchor points to obtain the column anchor point matrix M; The distance calculation between all column sample matrices X and column anchor matrix M is performed using matrix expansion. The distance calculation method is automatically selected according to the dimension of the column data: When the dimension is less than 10, the Euclidean square distance calculation method is used; When the dimension is 10-50, the Manhattan distance calculation method is used; When the dimension is greater than 50, the cosine distance calculation method is used.
4. The method for intelligently distributing pork based on anchor point clustering and priority rule optimization according to claim 3 is characterized in that: Distance calculation methods include three distance metrics: Euclidean square distance, Manhattan distance, or cosine distance; Among them, the Euclidean square distance calculation method is expressed as: Among them, the Manhattan distance calculation method is expressed as: Among them, the cosine distance calculation method is expressed as: Among them, x i Represents the feature vector of the i-th column sample, m j The feature vector representing the j-th column anchor point, D ij Indicates the distance between the two.
5. The intelligent pork distribution method based on anchor point clustering and priority rule optimization according to claim 1 is characterized in that: The optimization objective function of the CDBG clustering model is: Where Ind represents the indicator matrix, F represents the all-field-cluster indicator matrix, G represents the anchor field-cluster indicator matrix, D represents the sample-anchor distance bipartite graph, and λ is an adjustable balance parameter. By adjusting the balance parameter, a trade-off is achieved between clustering compactness and clustering balance.
6. The method for intelligently distributing pork based on anchor point clustering and priority rule optimization according to claim 1, characterized in that: The priority sorting rules are specifically as follows: Let the clearing mark of the jth order be c j , where clear is 1, otherwise 0, and the vehicle level is v j , the target road grade is r j , the system gives the vehicle-road matching function as δ(v j ,r j )∈{0,1}, the priority score is s j , then the ranking score of the order is: Score j =γ1·c j +γ2·δ(v j ,r j )+γ3·s j Among them, γ1, γ2, γ3 are weight coefficients, satisfying γ1+γ2+γ3=1; δ(v j ,r C )=1 indicates that the vehicle grade matches the road grade, otherwise it is 0; the higher the score, the higher the ranking and the priority in scheduling.
7. The intelligent pork distribution method based on anchor point clustering and priority rule optimization according to claim 1 is characterized in that: In each round of scheduling, the optimization solution is performed with the goal of minimizing the weight deviation of the goods, specifically: Let the estimated average weight of the column be w i , the average order demand weight is d j , the number of column matching heads is an integer variable q ij , whether the field is used by the order as a binary variable x ij , the optimization objective function is defined as: Among them, Q j represents the target delivery quantity for order j, α is the slot usage penalty coefficient, and β is the delivery reward coefficient. The objective function consists of three parts: weight error term, slot usage penalty term, and delivery quantity reward term. The overall function is then normalized to ensure fairness in cross-order comparisons. An optimization model is constructed by combining multiple constraints such as slot clearance priority, vehicle grade matching, and delivery upper and lower floating range.
8. The method for intelligent pork distribution based on anchor point clustering and priority rule optimization according to claim 1 is characterized in that: When the stock quantity in the cleared bin is insufficient to meet the order demand, the non-cleared bin will be used for replenishment, specifically: First, all the pens marked as cleared are formed into a set C, and the sum of the available pens S is counted. j , the minimum acceptable delivery quantity for the current order is Q min ; When S C min When , the non-cleared columns are dynamically enabled to form a new candidate column set R, and C∪R is used as the feasible matching space; In order to reduce weight deviation and maintain matching consistency, priority is given to supplementing the columns in the same cluster as set C, that is, priority is given to selecting from column i that satisfies cluster(i)∈cluster(C), so as to narrow the search space and enhance the stability of cargo distribution.
9. Intelligent pig distribution system based on anchor point clustering and priority rule optimization, characterized by: The method for intelligent pig distribution based on anchor point clustering and priority rule optimization as described in any one of claims 1 to 8 comprises: a data preprocessing module, a distance bipartite graph construction module, an anchor point clustering module, an order priority evaluation module, a greedy scheduling module, and a result output module; The data preprocessing module is used to obtain farm pen samples and order data to obtain a data set with a standardized data structure; The distance bipartite graph construction module is used to select column anchor points from the data set, calculate the distance matrix between column samples and column anchor points, and construct a sample-anchor distance bipartite graph; The anchor point clustering module is used to input the sample-anchor point distance bipartite graph into a pre-established CDBG clustering model, and generate a column clustering result by minimizing an objective function with a balance parameter; The order priority evaluation module is used to construct a multi-factor priority sorting rule based on the order clearance mark, priority score and road and vehicle grade matching, and use the priority sorting rule to score the order. The higher the score, the higher the priority corresponding to the order; The greedy scheduling module is used to schedule using a batch greedy strategy. In each round of scheduling, the target order is selected from the order with the highest current priority. The available slots are screened based on the slot clustering results. A mixed integer programming model is constructed. In each round of scheduling, an optimization solution is performed with the goal of minimizing the weight deviation of the goods to complete the slot allocation. The result output module is used to output a distribution table including order and column matching results based on the column allocation results.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the intelligent pig distribution method based on anchor point clustering and priority rule optimization as described in any one of claims 1 to 8.