Cable intelligent cargo allocation implementation method and device based on genetic algorithm and priority queue
Through the introduction of genetic algorithms and priority queue technology in the cable distribution system, the problem of low efficiency of traditional artificial distribution has been solved, and a more efficient cable distribution solution generation has been achieved.
Patent Information
- Application Number
- CN202411935060.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-12-26
AI Technical Summary
In the prior art, cable distribution still relies on traditional manual methods, resulting in low automation and inefficiency.
采用基于遗传算法和优先队列的方法,通过获取订单信息、确定搜索空间参数、生成初始种群、评估优先队列、迭代优化,最终生成电缆配货信息。
Improve the output efficiency of the cable distribution scheme, and achieve a higher degree of automation and a better distribution plan.
Smart Images

Figure CN119378931A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence genetic algorithm technology, and in particular to a method and device for realizing intelligent cable distribution based on genetic algorithm and priority queue. Background Art
[0002] The rapid development of information technology has brought new development opportunities to the traditional manufacturing industry. In recent years, the digitalization and intelligent transformation of the cable industry has attracted much attention. For example, in the current research on cables, designers have done the following: (1) Cable collision detection method based on distance field and sweep and pruning algorithm; (2) Cable path planning based on improved ant colony algorithm; (3) Practical application of particle swarm algorithm in common problems in the cable industry such as curve fitting, equation solving and optimization; (4) In order to solve the problem of low efficiency and high missed detection rate of manual detection of cable surface defects, it is proposed to realize online high-speed detection based on machine vision; (5) A discrete Jaya algorithm is proposed for the optimization problem of cable production scheduling, which minimizes the maximum completion time based on single-column encoding and left-shift encoding strategy; (6) A comprehensive solution for intelligent cable arrangement detection based on machine vision, etc.
[0003] However, existing research mainly focuses on cable design, production and testing, and research on cable distribution automation is still in its infancy. At present, the industry still generally adopts the traditional manual distribution method. Limited by the salesperson's data retrieval and processing capabilities, distribution has become one of the key bottlenecks in cable sales and inventory optimization management. Cable companies have a strong practical demand for improving distribution efficiency and optimizing distribution plans. The development of an intelligent distribution system has important practical significance. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for realizing intelligent cable distribution based on genetic algorithm and priority queue, aiming to solve the problem that the conventional manual distribution method is still commonly used for cable distribution in the prior art, resulting in low automation and low efficiency in obtaining cable distribution information based on order information.
[0005] In a first aspect, an embodiment of the present invention provides a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue, which includes: In response to the cable intelligent distribution instruction, obtaining current order information corresponding to the cable intelligent distribution instruction; If it is determined that the cable segmentation requirement information in the current order information is not a null value, determining a search space parameter based on the cable segmentation requirement information and the acquired cable inventory data; If it is determined that the search space parameter exceeds a preset search space parameter threshold, generating a current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and a preset initial population generation strategy; Determine a current priority queue corresponding to the current initial population based on a preset value assessment strategy and the cable inventory data; Based on the preset genetic algorithm model, the current initial population is iterated for a preset target number of rounds to obtain the current target population, and in each iteration, the current priority queue corresponding to the current target population is determined based on the value assessment strategy and the cable inventory data, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue; wherein the total number of population individuals included in the current priority queue is the total number of preset queue elements; Current cable distribution information corresponding to the current order information is generated based on the current target priority queue.
[0006] In a second aspect, an embodiment of the present invention further provides a device for realizing intelligent cable distribution based on a genetic algorithm and a priority queue, which includes: A current order information acquisition unit, configured to respond to the cable intelligent distribution instruction and acquire current order information corresponding to the cable intelligent distribution instruction; A search space parameter acquisition unit, configured to determine a search space parameter based on the cable segmentation requirement information and the acquired cable inventory data if it is determined that the cable segmentation requirement information in the current order information is not a null value; A current initial population generating unit, configured to generate a current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and a preset initial population generating strategy if it is determined that the search space parameter exceeds a preset search space parameter threshold; A current priority queue acquisition unit, configured to determine a current priority queue corresponding to the current initial population based on a preset value assessment strategy and the cable inventory data; A genetic iteration unit, used for iterating the current initial population for a preset target number of rounds based on a preset genetic algorithm model to obtain a current target population, and determining a current priority queue corresponding to the current target population based on the value assessment strategy and the cable inventory data in each iteration, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue; wherein the total number of population individuals included in the current priority queue is the total number of preset queue elements; The current cable distribution information generating unit is used to generate the current cable distribution information corresponding to the current order information based on the current target priority queue.
[0007] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0008] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method described in the first aspect above can be implemented.
[0009] The embodiment of the present invention provides a method and device for realizing intelligent cable distribution based on genetic algorithm and priority queue, the method comprising: in response to an intelligent cable distribution instruction, obtaining current order information corresponding to the intelligent cable distribution instruction; if it is determined that the current order information includes cable segmentation demand information, determining a search space parameter based on the cable segmentation demand information and the acquired cable inventory data; if it is determined that the search space parameter exceeds a preset search space parameter threshold, generating a current initial population corresponding to the current order information based on the cable segmentation demand information included in the current order information and a preset initial population generation strategy; determining a search space parameter based on a preset value evaluation strategy and cable inventory data ... Determine the current priority queue corresponding to the current initial population; iterate the current initial population for a preset target number of rounds based on the preset genetic algorithm model to obtain the current target population, and determine the current priority queue corresponding to the current target population based on the value assessment strategy and cable inventory data in each iteration, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds are completed, and the current priority queue is obtained as the current target priority queue; based on the current target priority queue, the current cable distribution information corresponding to the current order information is generated. The embodiment of the present invention determines and recommends the optimal distribution plan by combining the genetic algorithm and the priority queue, and uses the priority queue to maintain the optimal distribution plan set, which can effectively improve the output efficiency of the cable distribution plan. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0011] Figure 1 A schematic diagram of an application scenario of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 2 A schematic flow chart of a method for implementing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 3 A schematic diagram of a sub-process of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 4 A schematic diagram of another sub-process of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 5A schematic diagram of another sub-process of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 6 A schematic diagram of another sub-process of the method for realizing intelligent cable distribution based on genetic algorithm and priority queue provided in an embodiment of the present invention; Figure 7 A schematic block diagram of a device for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided in an embodiment of the present invention; Figure 8 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0012] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0013] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0014] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0015] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0016] Please also refer to Figure 1 and Figure 2 ,in Figure 1 Schematic diagram of a scenario of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue according to an embodiment of the present invention. Figure 2 FIG. 1 is a flow chart of a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided by an embodiment of the present invention. Figure 1As shown, the cable intelligent distribution implementation method based on genetic algorithm and priority queue provided in the embodiment of the present invention is applied to the server 10, and the server 10 is communicatively connected with the user terminal 20.
[0017] like Figure 2 As shown, the method includes the following steps S110-S160.
[0018] S110. In response to the cable intelligent distribution instruction, obtain current order information corresponding to the cable intelligent distribution instruction.
[0019] In this embodiment, the technical solution is described with the server as the execution subject. Users who have the demand for intelligent cable distribution can use the user terminal to establish a communication connection with the server and after logging into the intelligent cable distribution implementation system in the server, the user terminal can trigger the generation of an intelligent cable distribution instruction and send the intelligent cable distribution instruction to the server, and at the same time send the current order information corresponding to the intelligent cable distribution instruction.
[0020] The current order information at least includes the specification model, required length, segmentation requirements and other information of the required cables; it should be noted that if there is a specific segmentation requirement, the segmentation requirement is the specific number of segments, the segmentation length of each segment and other information; if there is no segmentation requirement, the segmentation requirement is a null value. When the server receives the current order information, the cable intelligent distribution processing process can be performed based on the cable intelligent distribution realization system in the server to obtain the final cable distribution processing result.
[0021] S120: If it is determined that the cable segmentation requirement information in the current order information is not a null value, a search space parameter is determined based on the cable segmentation requirement information and the acquired cable inventory data.
[0022] In this embodiment, if it is determined that the cable segmentation requirement information in the current order information is not a null value, it means that the current order has a segmentation requirement, and at this time, the cable inventory data acquired and stored in the server can also be combined to determine the search space parameters corresponding to the cable segmentation requirement information. The cable inventory data includes a plurality of cable inventory sub-data, and each cable inventory sub-data includes at least information such as the specification model of the cable, the cable length, the manufacturing date, and the warehouse where the cable is located.
[0023] In one embodiment, if Figure 3 As shown, the step S120 of determining the search space parameters based on the cable segmentation requirement information and the acquired cable inventory data includes: S121, sorting each cable inventory sub-data in the cable inventory data in ascending order of cable length to obtain sorted cable inventory data; S122, obtaining the i-th segmentation requirement sub-information in the cable segmentation requirement information; wherein the initial value of i is 1; S123, determining the i-th candidate cable inventory sub-data set corresponding to the i-th segment demand sub-information according to the sorted cable inventory data, determining the i-th segment demand index range corresponding to the i-th candidate cable inventory sub-data set, and determining the i-th segment available inventory quantity based on the i-th segment demand index range; S124. If it is determined that i does not exceed N and the i-1th search space parameter obtained does not exceed the preset search space parameter threshold, then the i-1th search space parameter is multiplied by the i-1th segment available inventory quantity to obtain the i-th search space parameter, i is incremented by 1 to update the value of i, and the step of obtaining the i-th segment demand sub-information in the cable segment demand information is returned; wherein N is the total number of segment demand sub-information included in the cable segment demand information, the i-1th search space parameter is the result obtained by continuously multiplying the available inventory quantity of the 1st segment to the available inventory quantity of the i-1th segment, and the 0th search space parameter is equal to 1; S125. If it is determined that i exceeds N and the obtained i-1th search space parameter does not exceed the preset search space parameter threshold, obtain the Nth search space parameter and use it as the search space parameter; S126, if it is determined that i does not exceed N and the obtained i-1th search space parameter exceeds the preset search space parameter threshold, then i is incremented by 1 to update the value of i, and the step of obtaining the i-th segmentation requirement sub-information in the cable segmentation requirement information is returned to execute; S127. If it is determined that i exceeds N and the acquired historical search space parameter exceeds the preset search space parameter threshold, the historical search space parameter is used as the search space parameter; wherein the historical space parameter is the search space parameter that exceeds the preset search space parameter threshold for the first time.
[0024] In this embodiment, when there is a segmentation requirement for the cable procurement object corresponding to the current order information, the cable inventory data can be searched using the specification model and the required length of the cable of this specification model as the retrieval condition to quickly determine several candidate cable inventory sub-data that meet the specification model requirements and have a cable length greater than or equal to the shortest required segment length.
[0025] For example, the cable inventory data includes cable inventory sub-data for cables of the same specification and model as mentioned above. For example, the 7 cable inventory sub-data included in the cable inventory data correspond to cable lengths of 100, 5, 200, 3, 500, 1000 and 1 (all in m), respectively. The cable inventory data are sorted in ascending order of cable length, and the sorted cable inventory data are 1, 3, 5, 100, 200, 500 and 1000. Taking the 1st to 4th segment demand sub-information in the cable segment demand information as an example, the first segment demand sub-information obtained corresponds to 2m, then the first candidate cable inventory sub-data set determined from the sorted cable inventory data and the first segment demand sub-information is {3,5,100,200,500,1000}, the first segment demand index range is [1,6] (determined by the index value of 1 in the sorted cable inventory data being 0), and the available inventory quantity of the first segment is 6. Similarly, referring to the above process, when the second segment demand sub-information corresponds to 50m, the second candidate cable inventory sub-dataset is {100,200,500,1000}, the second segment demand index range is [3,6], and the second segment available inventory quantity is 4; when the third segment demand sub-information corresponds to 50m, the third candidate cable inventory sub-dataset is {100,200,500,1000}, the third segment demand index range is [3,6], and the third segment available inventory quantity is 4; when the fourth segment demand sub-information corresponds to 400m, the fourth candidate cable inventory sub-dataset is {500,1000}, the fourth segment demand index range is [5,6], and the fourth segment available inventory quantity is 2. For example, after obtaining the available inventory quantity of the fourth segment as 2, the third search space parameter has been determined to be 6*4*4=96 based on the available inventory quantity of the first segment to the available inventory quantity of the third segment and continuous multiplication, and after determining that the third search space parameter 96 does not exceed the preset search space parameter threshold, the third search space parameter 96 can be multiplied by the available inventory quantity of the fourth segment 2 to obtain the fourth search space parameter 192. For another example, after obtaining the available inventory quantity of the fourth segment as 2, the third search space parameter has been determined to be 6*4*4=96 based on the available inventory quantity of the first segment to the available inventory quantity of the third segment and continuous multiplication, and after determining that the third search space parameter 96 has exceeded the preset search space parameter threshold, no new search space parameter is obtained at this time, and the next segment demand sub-information in the cable segment demand information is directly obtained and its corresponding segment demand index range and segment available inventory quantity are determined.Of course, the above example is only to illustrate the process of obtaining the search space parameters. In the specific implementation, the cable inventory sub-data in the cable inventory data and the segment demand sub-information included in the cable segment demand information are not limited to the data in the above example. It can be seen that the overall search volume of the current order information in the cable inventory data can be quickly determined by the above method, so as to determine whether to use the genetic algorithm model to determine the final target population and the corresponding priority queue for the current order information.
[0026] S130: If it is determined that the search space parameter exceeds a preset search space parameter threshold, a current initial population corresponding to the current order information is generated based on the cable segmentation requirement information included in the current order information and a preset initial population generation strategy.
[0027] In this embodiment, if it is determined that the search space parameter exceeds the preset search space parameter threshold, it means that the overall search volume of the current order information in the cable inventory data is large. At this time, if it is still based on the conventional evaluation method, the system will need to process a large amount of data and time complexity. In order to improve data processing efficiency, a genetic algorithm model can be used in this application to determine the final target population and the corresponding priority queue for the current order information. Specifically, the corresponding current initial population is generated based on the cable segmentation demand information included in the current order information and the preset initial population generation strategy. For example, still referring to the above example, after determining the 1st candidate cable inventory sub-dataset to the Nth candidate cable inventory sub-dataset for the cable segmentation demand information, and correspondingly determining the 1st segmentation demand index range to the Nth segmentation demand index range, an index value can be selected from the 1st segmentation demand index range to the Nth segmentation demand index range to form a population individual; then, multiple population individuals are generated again according to the initial population generation strategy to form the current initial population. It can be seen that based on the above method, the current initial population can be quickly generated based on the cable segmentation demand information included in the current order information.
[0028] In one embodiment, if Figure 4 As shown, step S130 includes: S131, obtaining a population size value corresponding to the initial population generation strategy; S132. Generate the current initial population based on the initial population generation strategy and the 1st segment demand index range to the Nth segment demand index range corresponding to the cable segment demand information; wherein the total number of population individuals included in the current initial population is the same as the population size value; when generating a population individual based on the initial population generation strategy, randomly select an index value from the 1st segment demand index range to the Nth segment demand index range respectively, and form a population individual.
[0029] In this embodiment, still referring to the above example, after determining that the first segment demand index range is [1,6], the second segment demand index range is [3,6], the third segment demand index range is [3,6], and the fourth segment demand index range is [5,6], based on the initial population generation strategy, the index value 1 is randomly selected from the first segment demand index range, the index value 4 is randomly selected from the second segment demand index range, the index value 5 is randomly selected from the third segment demand index range, and the index value 6 is randomly selected from the fourth segment demand index range. Then, the above 4 index values can form a population individual and be [1, 4, 5,6]. Referring to the above method of generating a population individual, (population size value-1) population individuals are generated to form the current initial population. It can be seen that through the above method, the current initial population can be quickly determined based on the initial population generation strategy and the cable segment demand information.
[0030] S140: Determine a current priority queue corresponding to the current initial population based on a preset value assessment strategy and the cable inventory data.
[0031] In this embodiment, in combination with the preset value assessment strategy in the cable intelligent distribution implementation system, each time a value assessment value corresponding to a population individual in the current initial population is determined, it is judged whether there is a duplicate in the current priority queue and the value assessment value is compared with the various population individuals stored in the current priority queue, and then it is determined whether to add it to the current priority queue to update the current priority queue. Because the total capacity of the population individuals contained in the current priority queue (i.e., the total number of preset queue elements) is pre-set, after the initialization creation in the current priority queue, the capacity corresponding to the total number of preset queue elements is first stored, and non-repeating population individuals are obtained from the current initial population. For example, if the total number of preset queue elements is 10, at least the first 10 population individuals are first obtained from the current initial population, and after determining in turn that the corresponding distribution plans with the existing population individuals in the current priority queue are different and calculating the value evaluation value of each population individual, the corresponding population individuals are directly added to the current priority queue; after the current priority queue has stored 10 population individuals, it is then necessary to determine whether the population individual to be determined is repeated in the current priority queue and compare the value evaluation value with the various population individuals stored in the current priority queue, and then determine whether to add it to the current priority queue to update the current priority queue. As long as there is a new population individual that does not have a duplicate in the current priority queue and its corresponding value evaluation value is less than the value evaluation value of the population individual in the current priority queue, it is necessary to replace the population individual with the largest value evaluation value in the current priority queue with the new population individual, so as to achieve timely update of the current priority queue. The value evaluation strategy is used to determine the value evaluation value corresponding to each population individual in the current initial population. When judging whether the distribution plans corresponding to two population individuals are the same, you can refer to the following example. For example, one of the population individuals corresponds to [1, 4, 5,6], and the other population individual corresponds to [1, 5, 4,6]. The second segment demand sub-information and the third segment demand sub-information both correspond to 50m. The second segment demand sub-information corresponds to index value 4 in the first population individual and the second segment demand sub-information corresponds to index value 5 in the second population individual. The third segment demand sub-information corresponds to index value 5 in the first population individual and the third segment demand sub-information corresponds to index value 4 in the second population individual. At this time, the distribution plans corresponding to the two population individuals can be regarded as the same distribution plans.
[0032] In one embodiment, if Figure 5 As shown, step S140 includes: S141, initializing and creating a current priority queue based on the total number of elements in the preset queue; wherein the number of individuals of the population stored in the initialized current priority queue is 0, and the upper limit number of individuals of the population that can be stored in the current priority queue is the total number of elements in the preset queue; S142, obtaining the jth population individual in the current initial population; wherein the initial value of j is 1; S143, inputting the candidate distribution plan corresponding to the j-th population individual into the value evaluation value calculation model corresponding to the value evaluation strategy to obtain the value evaluation value corresponding to the j-th population individual; S144. If it is determined that j does not exceed the total number of elements in the preset queue, and there is no population individual with the same distribution plan as the j-th population individual in the current priority queue, then the j-th population individual is added to the corresponding queue position of the current priority queue based on the corresponding value evaluation value to update the current priority queue; S145. If it is determined that j does not exceed the total number of elements in the preset queue, and there is a population individual with the same distribution plan as the jth population individual in the current priority queue, then the step of increasing j by 1 to update the value of j is executed; S146. If it is determined that j exceeds the total number of elements in the preset queue, there is no population individual with the same distribution plan as the j-th population individual in the current priority queue, and it is determined that there is a population individual in the current priority queue whose corresponding value assessment value is greater than the value assessment value corresponding to the j-th population individual, then the population individual with the largest value assessment value in the current priority queue is removed from the current priority queue, and the j-th population individual is added to the current priority queue to update the current priority queue; S147, if it is determined that j exceeds the total number of elements in the preset queue, and there is a population individual with the same distribution plan as the jth population individual in the current priority queue, then the step of increasing j by 1 to update the value of j is executed; S148, increment j by 1 to update the value of j; S149, if it is determined that j does not exceed P, return to the step of obtaining the jth population individual in the current initial population; wherein P is the population size value corresponding to the initial population generation strategy; S1410: If it is determined that j exceeds P, the current priority queue is obtained.
[0033] In this embodiment, still referring to the above example, the population individual [1, 4, 5, 6] is used as the first population individual in the current initial population. The corresponding candidate cable inventory sub-data are first determined from the sorted cable inventory data in combination with the four index values included in the population individual, such as index value 1 corresponds to the candidate cable inventory sub-data ranked second in the sorted cable inventory data, index value 4 corresponds to the candidate cable inventory sub-data ranked fifth in the sorted cable inventory data, index value 5 corresponds to the candidate cable inventory sub-data ranked sixth in the sorted cable inventory data, and index value 6 corresponds to the candidate cable inventory sub-data ranked seventh in the sorted cable inventory data. After determining each of the above four candidate cable inventory sub-data, the cable specification model, cable length, manufacturing date, warehouse location and other information specifically included in each candidate cable inventory sub-data can also be obtained. At this time, the following formula corresponding to the value assessment strategy is obtained: (1) Among them, F in formula (1) 仓库数量 represents the warehouse dimension value evaluation value corresponding to a population individual to be evaluated in the current initial population (for example, if the jth population individual in the current initial population has been obtained in step S141, then F 仓库数量 represents the warehouse dimension value evaluation value of the jth population individual), and at this time, F 仓库数量 =α 仓库数量 * (Number of warehouses – 1) to determine F 仓库数量 , α 仓库数量 is a first preset weight coefficient with a value greater than 0, and the number of warehouses is the number of warehouses obtained by counting the corresponding warehouses in the candidate cable inventory sub-data corresponding to each index value in the population individual to be evaluated; F 电缆数量 represents the cable quantity dimension value evaluation value corresponding to a population individual to be evaluated in the current initial population, and F 电缆数量 = α 电缆数量 * (number of cables – 1), α 电缆数量 is the second preset weight coefficient (which is greater than 0), and the number of cables is obtained by removing the total number of data items of the candidate cable inventory sub-data corresponding to each index value in the current population individual to be evaluated, and then counting them. For example, in the above example, if the four index values of the population individual [1, 4, 5, 6] are all different, the number of cables = 4; for another example, if the population individual [1, 4, 4, 6] has another example, the number of cables = 3; F 制造日期 represents the manufacturing date dimension value assessment value corresponding to a population individual currently to be assessed in the current initial population, and F 制造日期 = -α 制造日期 *Average storage age, α制造日期 is the third preset weight coefficient (which is greater than 0), and the average inventory age is obtained by first obtaining the candidate cable inventory sub-data corresponding to each index value in the current population individual to be evaluated and removing duplicates to obtain a candidate cable inventory sub-data set (for example, if there are at least two identical index values in the current population individual to be evaluated, it means that it corresponds to the same inventory cable, and at this time, deduplication processing is performed to retain only the candidate cable inventory sub-data corresponding to one index value), and then calculating the average inventory age corresponding to each candidate cable inventory sub-data in the candidate cable inventory sub-data set; for example, if the candidate cable inventory sub-data corresponding to an index value in the current population individual to be evaluated is known and its corresponding manufacturing date is also known, then the inventory age corresponding to the index value can be obtained by subtracting the manufacturing date from the current system date, and the average inventory age of the population individual can be obtained by obtaining the inventory age corresponding to each index value in the population individual in the same way and then taking the average value; F 长度 represents the cable length dimension value evaluation value corresponding to a population individual to be evaluated in the current initial population, and F 长度i = α 长度i * g(Li), F 长度 =F 长度1 +F 长度2 +……+F 长度N, The value range of i is 1 to N (N represents the total number of index values included in a population individual). 长度i First, determine whether there is a situation in which the index value in the population individuals corresponds to the same stock cable (that is, whether there are multiple index values in the population individuals to be evaluated that are equal to the same index value). If the above situation exists, it is necessary to combine the stock cables corresponding to the same index values to obtain a merged stock cable (the F corresponding to the same index values 长度i The required cable lengths corresponding to the multiple identical index values are summed up, and then subtracted from the cable lengths in the candidate cable inventory sub-data corresponding to the identical index value to obtain a current length difference. When the current length difference is determined to be greater than 0, the α corresponding to the merged inventory cable is 长度i are all set to a maximum positive value. When the current length difference is determined to be less than 0, the α corresponding to the inventory cable is merged. 长度i is still set to be a preset weight coefficient with a value greater than 0 (wherein, when it is determined that the current length difference is less than 0 and the absolute value of the current length difference belongs to the preset remaining cable zero line length interval, then α 长度i is set to a larger positive value; when it is determined that the current length difference is less than 0 and the absolute value of the current length difference does not belong to the preset remaining cable zero line length interval, then α 长度i Set to a small positive value), and when the current length difference is determined to be equal to 0, the α corresponding to the inventory cable is merged长度i Set to a preset weight coefficient with a negative value, and at this time g(Li)=1; for the case where each index value of the population individual corresponds to a different inventory cable, each index value corresponds to α 长度i The acquisition process is similar to the above process, except that the deduplication process is omitted; when the length difference is not 0, g(Li) is always obtained by subtracting the required cable length corresponding to the i-th index value in the current population individual to be evaluated from the cable length in the candidate cable inventory sub-data corresponding to the i-th index value and finding the absolute value; Fitness represents the value evaluation value corresponding to a population individual to be evaluated in the current initial population. After determining the value evaluation value corresponding to the population individual, such as the value evaluation value corresponding to the jth population individual, based on the above formula (1), it is possible to determine whether there is a duplicate in the current priority queue and compare the value evaluation value with the population individual with the current maximum value evaluation value in the current priority queue, and then determine whether to add it to the current priority queue to update the current priority queue. It can be seen that in each subsequent iteration process, as long as there is a new population individual that does not have a duplicate in the current priority queue and its corresponding value evaluation value is less than the corresponding value evaluation value of the population individual with the maximum value evaluation value in the current priority queue, it is necessary to replace the corresponding population individual in the current priority queue with the new population individual, so as to achieve timely update of the current priority queue. Among them, after evaluating a population individual from the four sub-dimensions of warehouse dimension, cable quantity dimension, manufacturing date dimension and cable length dimension, the value evaluation value of the population individual is calculated in combination with formula (1). The smaller the value assessment value of the individual in the population, the better the cable distribution plan corresponding to the individual in the population. Specifically, the smaller the value assessment value of the warehouse dimension in the value assessment value of the individual in the population, the more convenient the distribution scheduling is. The smaller the value assessment value of the cable quantity dimension, the priority is given to using the same inventory cable in the cable distribution plan to facilitate picking. The smaller the value assessment value of the manufacturing date dimension, the priority is given to using inventory cables with longer inventory age in the cable distribution plan to avoid inventory backlogs with long inventory age. The smaller the value assessment value of the cable length dimension, the priority is given to using short inventory in the cable distribution plan to avoid out-of-stock of long orders. At the same time, it is required to avoid the generation of odd lines as much as possible.
[0034] Moreover, in this application, a data structure in the form of a priority queue is used to store the population individuals that meet the conditions (one population individual corresponds to one cable distribution plan), which is usually implemented using a binary heap. The time complexity of the insertion and deletion operations is O(logKK1), where KK1 is the number of elements in the queue. When searching for the largest or smallest KK2 elements in a list of length MM1 (such as when MM1 is equal to Ntotal in the above example), the time complexity of using a priority queue is O(MM1logKK2), while the time complexity of direct sorting is O(MM1log MM1), and when KK2 is much smaller than MM1, the data structure in the form of a priority queue is more efficient. Among them, KK1, KK2 and MM1 are all positive integers.
[0035] S150. Based on a preset genetic algorithm model, the current initial population is iterated for a preset target number of rounds to obtain a current target population, and in each iteration, a current priority queue corresponding to the current target population is determined based on the value assessment strategy and the cable inventory data, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue.
[0036] The total number of individuals in the current priority queue is the total number of preset queue elements.
[0037] In this embodiment, after step S140 or steps S141-S1410 corresponding to its specific embodiment are executed, it is deemed that the current priority queue corresponding to the current initial population is determined in the first round of the entire iteration process (wherein the maximum total number of stored population individuals is the total number of elements in the preset queue, and the current priority queue is initialized only in the first round, and in the subsequent iterations, the population individuals therein are continuously updated based on the deduplication principle and the value assessment value comparison principle), which cannot be directly used to determine the current cable distribution information, and it is also necessary to combine the genetic algorithm model to perform the preset target number of rounds on the current initial population. Iterate to obtain the current target population, and continuously update the population individuals included in the current priority queue based on the new round of current target population in each round of iteration. The updating principle is that if there is no population individual identical to the new population individual in the current priority queue, and it is determined that the value evaluation value corresponding to the population individual in the current priority queue is greater than the value evaluation value corresponding to the new population individual, then the new population individual in the current target population is added to the current priority queue, and the population individual with the largest value evaluation value in the current priority queue is removed from the current priority queue, thereby realizing the continuous updating of the current priority queue in the process of generating the current target population through multiple rounds of iterations.
[0038] In one embodiment, if Figure 6 As shown, step S150 includes: S151, obtaining the genetic operator of the genetic algorithm model and the K-1th current target population, performing corresponding selection, crossover and mutation processing on the K-1th current target population according to the genetic operator of the genetic algorithm model, to obtain the Kth current target population; wherein the initial value of K is 1, and the 0th current target population is the current initial population; S152, determining the Kth current priority queue corresponding to the Kth current target population based on a preset value assessment strategy, the K-1th current priority queue and the cable inventory data; wherein the 0th current priority queue is the current priority queue corresponding to the current initial population; S153, increment K by 1 to update the value of K; S154, if it is determined that K does not exceed DD, then return to the step of obtaining the genetic operator of the genetic algorithm model and the K-1th current target population, performing corresponding selection, crossover and mutation processing on the K-1th current target population according to the genetic operator of the genetic algorithm model, and obtaining the Kth current target population; wherein DD represents the preset target number of rounds; S155. If it is determined that K exceeds the preset target number of rounds, the DDth current priority queue is obtained and used as the current target priority queue.
[0039] In this embodiment, by using the genetic algorithm model to iterate the current initial population for a preset target number of rounds, natural selection and genetic mechanisms can be simulated to iteratively evolve a current target population with better fitness from the current initial population. In the current target population obtained in each iteration, not only can the value evaluation value of the population individual be evaluated according to the value evaluation strategy, but also a new population can be generated through operations such as selection, crossover and mutation.
[0040] Among them, when the Kth current priority queue corresponding to the Kth current target population is determined based on the preset value evaluation strategy, the K-1th current priority queue and the cable inventory data, if there is no population individual with the same distribution plan as the new population individual in the K-1th current priority queue, and it is determined that there is a population individual in the K-1th current priority queue whose corresponding value evaluation value is greater than the value evaluation value corresponding to the new population individual, then the new population individual in the Kth current target population is added to the K-1th current priority queue, and the population individual with the largest value evaluation value in the K-1th current priority queue is removed from the current priority queue, and the final Kth current priority queue is obtained after the Kth round of iteration is completed, so as to continuously update the current priority queue during the process of generating the current target population through multiple rounds of iterations.
[0041] S160. Generate current cable distribution information corresponding to the current order information based on the current target priority queue.
[0042] In this embodiment, after the current initial population is iterated for a preset target number of rounds based on the genetic algorithm model and the current target priority queue is determined, each population individual in the current target priority queue represents a cable distribution plan, and the candidate cable inventory sub-data corresponding to each index value in each population individual is also known. After obtaining each population individual included in the current target priority queue and the candidate cable inventory sub-data corresponding to each population individual, they are listed and displayed in a table, and multiple current cable distribution information corresponding to the current order information can be formed. It can be seen that based on the above method, the current cable distribution information that is easy to display intuitively can be quickly obtained.
[0043] In one embodiment, after step S110, the method further includes: If it is determined that the cable segmentation requirement information in the current order information is empty, then the first current target priority queue is determined based on the ascending sorting result corresponding to the difference between the cable length of each candidate cable inventory sub-data in the cable inventory data and the required cable length in the current order information; wherein the cable lengths of the candidate cable inventory sub-data corresponding to the current order information in the cable inventory data are all greater than or equal to the required cable length in the current order information; if in the first current target priority queue there are multiple candidate cable inventory sub-data whose cable lengths have the same difference with the required cable length in the current order information, then the multiple candidate cable inventory sub-data are sorted in ascending order according to their manufacturing dates. sequence; if the difference between the cable length of the candidate cable inventory sub-data and the required cable length in the current order information belongs to the preset remaining cable length interval and the number of candidate cable inventory sub-data stored in the first current target priority queue is the total number of preset queue elements, the corresponding candidate cable inventory sub-data will not be added to the first current target priority queue; if the difference between the cable length of the candidate cable inventory sub-data and the required cable length in the current order information belongs to the preset remaining cable length interval and the number of candidate cable inventory sub-data stored in the first current target priority queue does not exceed the total number of preset queue elements, the corresponding candidate cable inventory sub-data will be added to the first current target priority queue; Current cable distribution information corresponding to the current order information is generated based on the first current target priority queue.
[0044] In this embodiment, if it is determined that the cable segmentation requirement information in the current order information is empty, it means that there is no segmentation requirement for the cable procurement object corresponding to the current order information. At this time, the first current target priority queue is determined directly in combination with the cable inventory data in the server. For example, taking a specification model and the required length of the cable of the specification model in the current order information as search conditions, a number of candidate cable inventory sub-data that meet the specification model requirements and whose cable length is greater than or equal to the required length are obtained in the cable inventory data, and the cable length of each candidate cable inventory sub-data in the cable inventory data (i.e., the cable inventory length) is subtracted from the required cable length corresponding to the current order information to determine the remaining cable length of each candidate cable inventory sub-data relative to the required cable length, and the candidate cable inventory sub-data are sorted in ascending order according to their corresponding remaining cable lengths, and the corresponding number of candidate cable inventory sub-data are selected from the above sorting results in combination with the total number of candidate cable inventory sub-data that can be accommodated in the current target priority queue to obtain the first current target priority queue to avoid long order out-of-stock; when the remaining cable length obtained by subtracting the required cable length corresponding to the current order information from the cable length of multiple candidate cable inventory sub-data is the same, the above multiple candidate cable inventory sub-data are also sorted in order of manufacturing date, with the earlier manufacturing date ranking first. It should be noted that if the remaining cable length obtained by subtracting the required cable length corresponding to the current order information from the cable length of the candidate cable inventory sub-data belongs to the preset remaining cable length interval (the preset remaining cable length interval can be flexibly set according to the actual needs of the user), although the value of the remaining cable length is small, it is still considered to have a zero line, and this type of candidate cable inventory sub-data is directly arranged at the back of the sorting result. After completing the above sorting, the first current target priority sub-queue corresponding to the current order information can be obtained.
[0045] Afterwards, the current cable distribution information corresponding to the current order information is generated based on the first current target priority queue. The process of generating the current cable distribution information corresponding to the current order information based on the current target priority queue can be referred to, and will not be repeated here. It can be seen that based on the above method, when the current order information does not include the cable segmentation requirement information, the current cable distribution information can be quickly obtained by combining the cable required length and cable inventory data in the current order information.
[0046] In one embodiment, after step S120, the method further includes: If it is determined that the search space parameter does not exceed the preset search space parameter threshold, determining a second current target priority queue corresponding to the current order information based on the cable segmentation demand information included in the current order information, the value assessment strategy and the cable inventory data; The current cable distribution information corresponding to the current order information is generated based on the second current target priority queue.
[0047] In this embodiment, if it is determined that the search space parameter does not exceed the preset search space parameter threshold, it means that the overall search volume of the current order information in the cable inventory data is not large. At this time, when the value assessment strategy and the cable inventory data are combined to obtain the second current target priority queue corresponding to the cable segmentation demand information included in the current order information, the specific process is similar to the process of obtaining the current priority queue in step S140, except that there is no need to initially generate a current initial population based on the cable segmentation demand information, but a method of traversing all individuals is adopted.
[0048] Afterwards, the current cable distribution information corresponding to the current order information is generated based on the second current target priority queue. The process of generating the current cable distribution information corresponding to the current order information based on the current target priority queue can be referred to, and will not be repeated here. It can be seen that based on the above method, when the search space parameter does not exceed the preset search space parameter threshold, the current cable distribution information can be quickly obtained by combining the cable segmentation demand information, value assessment strategy and cable inventory data included in the current order information.
[0049] It can be seen that the embodiment of the method determines and recommends the optimal distribution plan by combining the genetic algorithm and the priority queue, and uses the priority queue to maintain the optimal distribution plan set, which can effectively improve the output efficiency of the cable distribution plan.
[0050] Figure 7 1 is a schematic block diagram of a device for realizing intelligent cable distribution based on a genetic algorithm and a priority queue provided by an embodiment of the present invention. Figure 7 As shown, corresponding to the above-mentioned cable intelligent distribution method based on genetic algorithm and priority queue, the present invention also provides a cable intelligent distribution device 100 based on genetic algorithm and priority queue. The cable intelligent distribution device 100 based on genetic algorithm and priority queue includes a unit for executing the above-mentioned cable intelligent distribution method based on genetic algorithm and priority queue. Figure 7 The cable intelligent distribution implementation device 100 based on genetic algorithm and priority queue includes: a current order information acquisition unit 110, a search space parameter acquisition unit 120, a current initial population generation unit 130, a current priority queue acquisition unit 140, a genetic iteration unit 150 and a current cable distribution information generation unit 160.
[0051] The current order information acquisition unit 110 is used to respond to the cable intelligent distribution instruction and acquire the current order information corresponding to the cable intelligent distribution instruction.
[0052] The search space parameter acquisition unit 120 is configured to determine the search space parameters based on the cable segmentation requirement information and the acquired cable inventory data if it is determined that the cable segmentation requirement information in the current order information is not a null value.
[0053] The current initial population generating unit 130 is used to generate a current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and a preset initial population generating strategy if it is determined that the search space parameter exceeds a preset search space parameter threshold.
[0054] The current priority queue acquisition unit 140 is used to determine the current priority queue corresponding to the current initial population based on a preset value evaluation strategy and the cable inventory data.
[0055] The genetic iteration unit 150 is used to iterate the current initial population for a preset target number of rounds based on a preset genetic algorithm model to obtain a current target population, and determine the current priority queue corresponding to the current target population based on the value assessment strategy and the cable inventory data in each iteration, and the population individuals included in the current priority queue after each iteration are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue.
[0056] The current cable distribution information generating unit 160 is configured to generate the current cable distribution information corresponding to the current order information based on the current target priority queue.
[0057] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned cable intelligent distribution implementation device based on genetic algorithm and priority queue and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0058] It can be seen that the embodiment of the device can effectively improve the output efficiency of the cable distribution plan by combining the genetic algorithm and the priority queue to determine and recommend the optimal distribution plan, and use the priority queue to maintain the optimal distribution plan set.
[0059] The above-mentioned cable intelligent distribution realization device based on genetic algorithm and priority queue can be realized in the form of a computer program. The computer program can be used in Figure 8 Runs on the computer device shown.
[0060] See also Figure 8 , Figure 8The present invention is a schematic block diagram of a computer device provided by an embodiment of the present invention. The computer device integrates any one of the cable intelligent distribution implementation devices based on genetic algorithm and priority queue provided by an embodiment of the present invention.
[0061] See also Figure 8 The computer device includes a processor 402 , a memory and a network interface 405 connected via a system bus 401 , wherein the memory may include a storage medium 403 and an internal memory 404 .
[0062] The storage medium 403 can store an operating system 4031 and a computer program 4032. The computer program 4032 includes program instructions, and when the program instructions are executed, the processor 402 can execute a method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue.
[0063] The processor 402 is used to provide computing and control capabilities to support the operation of the entire computer device.
[0064] The internal memory 404 provides an environment for the operation of the computer program 4032 in the storage medium 403. When the computer program 4032 is executed by the processor 402, the processor 402 can execute the above-mentioned cable intelligent distribution implementation method based on genetic algorithm and priority queue.
[0065] The network interface 405 is used to communicate with other devices over the network. Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0066] The processor 402 is used to run a computer program 4032 stored in the memory to implement the method for realizing intelligent cable distribution based on genetic algorithm and priority queue as described in any of the above examples.
[0067] It should be understood that in the embodiment of the present invention, the processor 402 may be a central processing unit (CPU), and the processor 402 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0068] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0069] Therefore, the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue as described in any of the above examples.
[0070] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.
[0071] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0072] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0073] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0074] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0075] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for realizing intelligent cable distribution based on genetic algorithm and priority queue, characterized in that: include: In response to the cable intelligent distribution instruction, obtaining current order information corresponding to the cable intelligent distribution instruction; If it is determined that the cable segmentation requirement information in the current order information is not a null value, determining a search space parameter based on the cable segmentation requirement information and the acquired cable inventory data; If it is determined that the search space parameter exceeds a preset search space parameter threshold, generating a current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and a preset initial population generation strategy; Determine a current priority queue corresponding to the current initial population based on a preset value assessment strategy and the cable inventory data; Based on a preset genetic algorithm model, the current initial population is iterated for a preset target number of rounds to obtain a current target population, and in each iteration, a current priority queue corresponding to the current target population is determined based on the value assessment strategy and the cable inventory data, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue; wherein the total number of population individuals included in the current priority queue is the total number of preset queue elements; Current cable distribution information corresponding to the current order information is generated based on the current target priority queue.
2. The method according to claim 1, characterized in that The determining of search space parameters based on the cable segmentation requirement information and the acquired cable inventory data includes: Sorting each cable inventory sub-data in the cable inventory data in ascending order of cable length to obtain sorted cable inventory data; Obtaining the i-th segmentation requirement sub-information in the cable segmentation requirement information; wherein the initial value of i is 1; Determine the i-th candidate cable inventory sub-data set corresponding to the i-th segment demand sub-information according to the sorted cable inventory data, determine the i-th segment demand index range corresponding to the i-th candidate cable inventory sub-data set, and determine the i-th segment available inventory quantity based on the i-th segment demand index range; If it is determined that i does not exceed N and the i-1th search space parameter obtained does not exceed the preset search space parameter threshold, then the i-1th search space parameter is multiplied by the i-1th segment available inventory quantity to obtain the i-th search space parameter, i is incremented by 1 to update the value of i, and the step of obtaining the i-th segment demand sub-information in the cable segment demand information is returned; wherein N is the total number of segment demand sub-information included in the cable segment demand information, the i-1th search space parameter is the result obtained by continuously multiplying the available inventory quantity of the 1st segment to the available inventory quantity of the i-1th segment, and the 0th search space parameter is equal to 1; If it is determined that i exceeds N and the obtained i-1th search space parameter does not exceed the preset search space parameter threshold, then obtaining the Nth search space parameter and using it as the search space parameter; If it is determined that i does not exceed N and the obtained i-1th search space parameter exceeds the preset search space parameter threshold, i is incremented by 1 to update the value of i, and the step of obtaining the i-th segmentation requirement sub-information in the cable segmentation requirement information is returned to execute; If it is determined that i exceeds N and the acquired historical search space parameter exceeds the preset search space parameter threshold, the historical search space parameter is used as the search space parameter; wherein the historical space parameter is the search space parameter that exceeds the preset search space parameter threshold for the first time.
3. The method according to claim 2, characterized in that The generating of the current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and the preset initial population generation strategy includes: Obtaining a population size value corresponding to the initial population generation strategy; Based on the initial population generation strategy and the 1st segment demand index range to the Nth segment demand index range corresponding to the cable segment demand information, the current initial population is generated; wherein the total number of population individuals included in the current initial population is the same as the population size value; when a population individual is generated based on the initial population generation strategy, an index value is randomly selected from the 1st segment demand index range to the Nth segment demand index range respectively, and a population individual is formed.
4. The method according to claim 2, characterized in that: The determining of the current priority queue corresponding to the current initial population based on the preset value assessment strategy and the cable inventory data includes: Initialize and create a current priority queue based on the total number of elements in the preset queue; wherein the number of individuals of the population stored in the initialized current priority queue is 0, and the upper limit number of individuals of the population that can be stored in the current priority queue is the total number of elements in the preset queue; Obtain the jth population individual in the current initial population; wherein the initial value of j is 1; Inputting the candidate distribution plan corresponding to the j-th population individual into the value evaluation value calculation model corresponding to the value evaluation strategy to obtain the value evaluation value corresponding to the j-th population individual; If it is determined that j does not exceed the total number of elements in the preset queue, and there is no population individual with the same distribution plan as the j-th population individual in the current priority queue, then the j-th population individual is added to the corresponding queue position of the current priority queue based on the corresponding value evaluation value to update the current priority queue; If it is determined that j does not exceed the total number of elements in the preset queue, and there is a population individual with the same distribution plan as the jth population individual in the current priority queue, then the step of increasing j by 1 to update the value of j is executed; If it is determined that j exceeds the total number of elements in the preset queue, there is no population individual with the same distribution plan as the j-th population individual in the current priority queue, and it is determined that there is a population individual in the current priority queue whose corresponding value assessment value is greater than the value assessment value corresponding to the j-th population individual, then the population individual with the largest value assessment value in the current priority queue is removed from the current priority queue, and the j-th population individual is added to the current priority queue to update the current priority queue; If it is determined that j exceeds the total number of elements in the preset queue, and there is a population individual with the same distribution plan as the jth population individual in the current priority queue, then the step of increasing j by 1 to update the value of j is executed; Increment j by 1 to update the value of j; If it is determined that j does not exceed P, then return to the step of obtaining the jth population individual in the current initial population; wherein P is the population size value corresponding to the initial population generation strategy; If it is determined that j exceeds P, the current priority queue is obtained.
5. The method according to claim 2, characterized in that: The current initial population is iterated for a preset target number of rounds based on the preset genetic algorithm model to obtain the current target population, and in each iteration, a current priority queue corresponding to the current target population is determined based on the value assessment strategy and the cable inventory data, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue, including: Obtaining the genetic operator of the genetic algorithm model and the K-1th current target population, performing corresponding selection, crossover and mutation processing on the K-1th current target population according to the genetic operator of the genetic algorithm model, to obtain the Kth current target population; wherein the initial value of K is 1, and the 0th current target population is the current initial population; Determine the Kth current priority queue corresponding to the Kth current target population based on the preset value assessment strategy, the K-1th current priority queue and the cable inventory data; wherein the 0th current priority queue is the current priority queue corresponding to the current initial population; Increment K by 1 to update the value of K; If it is determined that K does not exceed DD, then return to the step of obtaining the genetic operator of the genetic algorithm model and the K-1th current target population, and perform corresponding selection, crossover and mutation processing on the K-1th current target population according to the genetic operator of the genetic algorithm model to obtain the Kth current target population; wherein DD represents the preset target number of rounds; If it is determined that K exceeds the preset target number of rounds, the DDth current priority queue is obtained and used as the current target priority queue.
6. The method according to claim 1, characterized in that After the step of obtaining the current order information corresponding to the cable intelligent distribution instruction in response to the cable intelligent distribution instruction, the method further includes: If it is determined that the cable segmentation requirement information in the current order information is empty, then the first current target priority queue is determined based on the ascending sorting result corresponding to the difference between the cable length of each candidate cable inventory sub-data in the cable inventory data and the required cable length in the current order information; wherein the cable lengths of the candidate cable inventory sub-data corresponding to the current order information in the cable inventory data are all greater than or equal to the required cable length in the current order information; if in the first current target priority queue there are multiple candidate cable inventory sub-data whose cable lengths have the same difference with the required cable length in the current order information, then the multiple candidate cable inventory sub-data are sorted in ascending order according to their manufacturing dates. sequence; if the difference between the cable length of the candidate cable inventory sub-data and the required cable length in the current order information belongs to the preset remaining cable length interval and the number of candidate cable inventory sub-data stored in the first current target priority queue is the total number of preset queue elements, the corresponding candidate cable inventory sub-data will not be added to the first current target priority queue; if the difference between the cable length of the candidate cable inventory sub-data and the required cable length in the current order information belongs to the preset remaining cable length interval and the number of candidate cable inventory sub-data stored in the first current target priority queue does not exceed the total number of preset queue elements, the corresponding candidate cable inventory sub-data will be added to the first current target priority queue; Current cable distribution information corresponding to the current order information is generated based on the first current target priority queue.
7. The method according to claim 1, characterized in that After the step of determining the search space parameter based on the cable segmentation requirement information and the acquired cable inventory data if it is determined that the cable segmentation requirement information in the current order information is not a null value, the method further includes: If it is determined that the search space parameter does not exceed the preset search space parameter threshold, determining a second current target priority queue corresponding to the current order information based on the cable segmentation demand information included in the current order information, the value assessment strategy and the cable inventory data; The current cable distribution information corresponding to the current order information is generated based on the second current target priority queue.
8. A device for realizing intelligent cable distribution based on genetic algorithm and priority queue, characterized in that: include: A current order information acquisition unit, configured to respond to the cable intelligent distribution instruction and acquire current order information corresponding to the cable intelligent distribution instruction; A search space parameter acquisition unit, configured to determine a search space parameter based on the cable segmentation requirement information and the acquired cable inventory data if it is determined that the cable segmentation requirement information in the current order information is not a null value; A current initial population generating unit, configured to generate a current initial population corresponding to the current order information based on the cable segmentation requirement information included in the current order information and a preset initial population generating strategy if it is determined that the search space parameter exceeds a preset search space parameter threshold; A current priority queue acquisition unit, configured to determine a current priority queue corresponding to the current initial population based on a preset value assessment strategy and the cable inventory data; A genetic iteration unit, used for iterating the current initial population for a preset target number of rounds based on a preset genetic algorithm model to obtain a current target population, and determining a current priority queue corresponding to the current target population based on the value assessment strategy and the cable inventory data in each iteration, and after each iteration, the population individuals included in the current priority queue are the preferred population individuals among all the population individuals obtained in all the current iterated rounds, and the iteration is stopped after the preset target number of rounds of iteration is completed, and the current priority queue is obtained as the current target priority queue; wherein the total number of population individuals included in the current priority queue is the total number of preset queue elements; The current cable distribution information generating unit is used to generate the current cable distribution information corresponding to the current order information based on the current target priority queue.
9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method for realizing intelligent cable distribution based on genetic algorithm and priority queue as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor, the method for realizing intelligent cable distribution based on a genetic algorithm and a priority queue as described in any one of claims 1 to 7 can be implemented.
Citation Information
Patent Citations
Cable process flow card generation method and device and computer readable storage medium
CN111985797A
Method and device for determining line loss model parameters of electric energy meter and electronic equipment
CN115935828A
Logistics order analysis method, apparatus and device, and storage medium
CN117952397A
Warehouse management method based on cloud platform
CN118373113A
Search result output method and apparatus, computer device and readable storage medium
WO2022262849A1
Cited By
Moving cable production speed intelligent control method and system based on automation
CN119784107A
An intelligent control method and system for the production speed of motion cables based on automation
CN119784107B
Cable distribution method and device based on genetic algorithm
CN120124992A