Parking space distribution method and device based on niche genetic algorithm, equipment and medium
The parking space allocation method is constructed by using a niche genetic algorithm, which solves the problem that the genetic algorithm is prone to falling into local optimal solutions in parking space allocation, and improves the reliability and utilization rate of parking space allocation.
Patent Information
- Application Number
- CN202511001423.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-09-23
AI Technical Summary
Existing genetic algorithms are prone to fall into local optimal solutions in parking space allocation, resulting in insufficient reliability of parking space allocation schemes and low parking space utilization.
A niche genetic algorithm is used to construct a first population of multiple reservation information, perform iterative operations, and perform crossover and mutation operations within the niche to maintain population diversity, avoid local optimal solutions and premature convergence, and improve the reliability of parking space allocation.
It effectively avoids local optimal solutions, improves the reliability and utilization of parking space allocation, and ensures the efficient use of parking spaces.
Smart Images

Figure CN120688831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a parking space allocation method, device, equipment and medium based on a niche genetic algorithm. Background Art
[0002] Currently, public parking spaces in residential complexes are limited. With the increasing adoption of property management systems, property management companies are providing owner-side applications such as property apps or mini-programs. Owners can reserve parking spaces online and use devices like smart ground locks to ensure parking access for their vehicles within the reserved time period. However, each owner's parking needs vary, and when proactively reserving a parking space, most owners typically simply select a space based on their desired time period. When multiple owners make reservations, it's easy for the reserved time periods to become fragmented, leaving many unused time periods unavailable for other owners, leading to low parking space utilization.
[0003] Related technologies have introduced genetic algorithms for parking space allocation. These algorithms collect multiple parking reservations and construct multiple first populations. Each first individual in the first population corresponds to a mapping between a vehicle and a parking space. Through operations such as mutation and crossover, the final parking space allocation solution is obtained. However, conventional genetic algorithms can only optimize for a single objective and are prone to falling into local optimal solutions during iterations, leading to premature convergence and unreliable parking space allocation solutions. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a parking space allocation method, apparatus, device, and medium based on a niche genetic algorithm. The method can automatically allocate parking spaces based on the niche genetic algorithm, thereby increasing the diversity of the population and improving the reliability of parking space allocation.
[0005] In a first aspect, an embodiment of the present invention provides a parking space allocation method based on a niche genetic algorithm, comprising:
[0006] Constructing a first population based on a plurality of reservation information, wherein each reservation information corresponds to a target vehicle, the first population includes a plurality of first individuals, and one first individual includes candidate parking spaces allocated to all target vehicles;
[0007] Performing multiple iterative operations based on the first population to obtain a target population, determining a target individual with the highest fitness value in the target population, and assigning a target parking space to each of the target vehicles based on the target individual, wherein the fitness value is used to indicate the time utilization rate of all the candidate parking spaces;
[0008] The iterative operation includes:
[0009] determining the fitness value of each of the first individuals, and selecting a plurality of the first individuals from the first population to form a second population;
[0010] Determining individual similarities between every two of the first individuals in the second population, generating a plurality of niches in the second population based on the individual similarities, and performing crossover and mutation operations on each of the first individuals in the niches to obtain a plurality of second individuals, wherein each niche includes at least two of the first individuals;
[0011] The next iterative operation is performed based on the second population composed of the second individuals.
[0012] According to some embodiments of the present invention, the reservation information further includes a reservation time period, and the reservation time period includes an arrival time period and a departure time period. The constructing a first population based on the plurality of reservation information includes:
[0013] determining a plurality of available parking spaces, wherein each of the available parking spaces includes at least one available time period;
[0014] Based on any of the reservation information, determine a candidate time period from all the available time periods, and determine the available parking space corresponding to the candidate time period as the candidate parking space, wherein a first start time of the candidate time period is not later than the arrival time period, and a first end time of the candidate time period is not earlier than the departure time period;
[0015] Constructing a first entity based on the reservation information of all the determined candidate parking spaces;
[0016] The candidate parking spaces corresponding to the respective reservation information are re-determined to construct a new first entity, wherein at least one reservation information in two different first entities corresponds to a different candidate parking space.
[0017] According to some embodiments of the present invention, determining the fitness value of each first individual includes:
[0018] Determining, based on any of the first entities and based on the candidate time periods corresponding to the respective reservation information, a total idle time and a total parking time of the first entity;
[0019] Determining a maximum idle time, a minimum idle time, a maximum parking time, and a minimum parking time of the first individual based on the arrival time periods and the departure time periods corresponding to all the reservation information;
[0020] Determining an idle objective function value based on the total idle time, the maximum idle time, and the minimum idle time;
[0021] determining a parking objective function value based on the total parking time, the maximum parking time, and the minimum parking time;
[0022] The fitness value of the first entity is determined based on the idle objective function value and the parking objective function value.
[0023] According to some embodiments of the present invention, screening out a plurality of first individuals from the first population includes:
[0024] Performing non-dominated sorting on the first individuals in the first population to obtain a plurality of target fronts, wherein each target front includes a plurality of sorted first individuals;
[0025] Based on any frontier, a target congestion degree of each first entity is determined based on the idle objective function value and the parking objective function value, and a plurality of first entities are screened out in descending order based on the target congestion degrees.
[0026] According to some embodiments of the present invention, determining the target congestion degree of each first object based on the idle objective function value and the parking objective function value includes:
[0027] Based on any pair of adjacent two first objects, a difference between the idle objective function values is determined as a first function difference, and a difference between the parking objective function values is determined as a second function difference;
[0028] Determining a first upper limit value having a maximum value and a first lower limit value having a minimum value among the plurality of idle objective function values, and determining a second upper limit value having a maximum value and a second lower limit value having a minimum value among the plurality of parking objective function values;
[0029] Based on any first function difference, determining a corresponding first congestion degree according to the first upper limit and the first lower limit;
[0030] Based on any second function difference, determining a corresponding second congestion degree according to the second upper limit and the second lower limit;
[0031] The sum of the first congestion degree and the second congestion degree is determined as the target congestion degree of the corresponding front.
[0032] According to some embodiments of the present invention, screening out the plurality of first individuals in descending order based on the target congestion degree includes:
[0033] Determine the ranking of each target frontier obtained by the non-dominated sort as the corresponding frontier level;
[0034] obtaining a target quantity preset for each of the frontier levels;
[0035] Based on any of the target frontiers, based on the target quantity, and according to the target congestion degree, a plurality of the first individuals are screened out from high to low.
[0036] According to some embodiments of the present invention, determining the individual similarity between every two of the first individuals in the second population includes:
[0037] Based on any of the first individuals, a coding unit is constructed based on each of the target vehicles and the corresponding candidate parking spaces, and the plurality of coding units are arranged into individual codes based on the order of the reservation time periods from early to late, wherein the plurality of coding units for the same reservation time period are sorted based on the preset sequence numbers of the candidate parking spaces;
[0038] Based on any two of the first individuals, the individual similarity is determined according to the similarity of the individual codes.
[0039] In a second aspect, an embodiment of the present invention provides a parking space allocation device based on a microhabitat genetic algorithm, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the parking space allocation method based on the microhabitat genetic algorithm as described in the first aspect above.
[0040] In a third aspect, an embodiment of the present invention provides an electronic device comprising the parking space allocation device based on the niche genetic algorithm as described in the second aspect above.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the parking space allocation method based on the niche genetic algorithm as described in the first aspect above.
[0042] According to an embodiment of the present invention, a parking space allocation method based on a niche genetic algorithm has at least the following beneficial effects: constructing a first population based on multiple reservation information, wherein each reservation information corresponds to a target vehicle, the first population includes multiple first individuals, and one first individual includes candidate parking spaces allocated to all target vehicles; performing multiple iterative operations based on the first population to obtain a target population, determining a target individual with the highest fitness value in the target population, and allocating a target parking space to each target vehicle based on the target individual, wherein the fitness value is used to indicate the time utilization rate of all candidate parking spaces; wherein the iterative operation includes: determining the fitness value of each first individual, screening multiple first individuals from the first population to form a second population; determining the individual similarity between each two first individuals in the second population, generating multiple niches in the second population based on the individual similarities, performing crossover and mutation operations on each first individual in the niche to obtain multiple second individuals, wherein each niche includes at least two first individuals; and performing the next iterative operation based on the second population composed of the second individuals. According to the technical solution of the embodiment of the present invention, multiple microhabitats can be constructed in the second population of the next generation, and cross-mutation can be independently performed in each microhabitat to explore better individuals, maintain the diversity of the population, effectively avoid the occurrence of local optimal solutions and premature convergence, and improve the reliability of parking space allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a schematic diagram of population iteration provided by one embodiment of the present invention;
[0044] Figure 2 is a flow chart of a parking space allocation method based on a niche genetic algorithm provided by another embodiment of the present invention;
[0045] Figure 3 is a complete flow chart of a parking space allocation method based on a niche genetic algorithm provided by another embodiment of the present invention;
[0046] Figure 4 It is a structural diagram of a parking space allocation device based on a niche genetic algorithm provided by another embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0048] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on the present invention.
[0049] In the description of the present invention, "several" means one or more, "many" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. The use of "first" and "second" in the description is solely for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, implicitly specifying the number of the indicated technical features, or implicitly specifying the order of the indicated technical features.
[0050] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, and connecting should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0051] The following explains some terms in this embodiment:
[0052] Diversity-based Niche Genetic Algorithm (DBNGA): This is a variant of an evolutionary algorithm specifically designed for solving multimodal optimization problems. Its core concept is to mimic the concept of "niche" in nature, where multiple ecological niches exist within the same environment, allowing different species (corresponding to solutions in the algorithm) to coexist and evolve to a state adapted to their specific environment (corresponding to the local or global optimal solution in the solution space).
[0053] Non-dominated sorting is one of the core techniques in multi-objective evolutionary algorithms (MOEAs), used to solve multi-objective optimization problems (MOPs). Its core idea is to hierarchically sort the population based on the superiority (dominance) of the solutions, thereby guiding the search toward a true Pareto front while maintaining population diversity.
[0054] Individual similarity is a core concept in evolutionary algorithms, particularly diversity-based algorithms such as niche genetic algorithms and multi-objective optimization algorithms. It quantifies the degree of similarity or proximity between two solutions (individuals) in a population. It is a key factor in maintaining population diversity, partitioning niches, preventing premature convergence, and maintaining a uniform distribution of solutions across multiple objectives.
[0055] Crowding: A core concept in evolutionary algorithms used to quantify the local density of individuals in the solution space or target space. It is one of the key mechanisms for maintaining population diversity. The core idea is to penalize individuals in crowded areas and reward those in sparse areas, thereby guiding the population to be widely distributed in the solution space or evenly distributed in the target space.
[0056] The embodiment of the present invention provides a parking space allocation method, apparatus, device and medium based on a niche genetic algorithm, wherein the parking space allocation method based on the niche genetic algorithm includes: constructing a first population based on a plurality of reservation information, wherein each reservation information corresponds to a target vehicle, the first population includes a plurality of first individuals, and one first individual includes candidate parking spaces allocated to all the target vehicles; performing multiple iterative operations based on the first population to obtain a target population, determining the target individual with the highest fitness value in the target population, and allocating a target parking space to each target vehicle based on the target individual, wherein the fitness value The value is used to indicate the time utilization rate of all the candidate parking spaces; wherein, the iterative operation includes: determining the fitness value of each of the first individuals, screening out multiple first individuals from the first population to form a second population; determining the individual similarity between every two of the first individuals in the second population, generating multiple microhabitats in the second population based on the individual similarity, performing crossover operations and mutation operations on each of the first individuals in the microhabitats to obtain multiple second individuals, wherein each microhabitat includes at least two of the first individuals; executing the next iterative operation based on the second population composed of the second individuals. According to the technical solution of the embodiment of the present invention, multiple microhabitats can be constructed in the second population of the next generation, and crossover and mutation can be performed independently in each microhabitat to explore better individuals, maintain the diversity of the population, effectively avoid the occurrence of local optimal solutions and premature convergence, and improve the reliability of parking space allocation.
[0057] The technical solutions of the embodiments of the present invention are further described below based on the accompanying drawings.
[0058] Reference Figure 2 , Figure 2A flowchart of a parking space allocation method based on a niche genetic algorithm is provided in an embodiment of the present invention. The parking space allocation method based on a niche genetic algorithm includes but is not limited to the following steps:
[0059] S10: construct a first group based on a plurality of reservation information, wherein each reservation information corresponds to a target vehicle, and the first group includes a plurality of first individuals, and one first individual includes candidate parking spaces allocated to all target vehicles.
[0060] It should be noted that this embodiment can be applied to property management systems. Owners can enter reservation information on the relevant page of the property APP or mini program. The reservation information may include information such as the target vehicle, reservation time period, and whether a charging parking space is required. This embodiment does not limit the specific content of the reservation information and can be adjusted according to actual needs.
[0061] It should be noted that one reservation information can be used in multiple parking space allocation operations. As long as the target vehicle corresponding to the reservation information has not started to use the target parking space for parking when the parking space allocation operation is executed, it will be determined as the reservation information for executing the parking space allocation operation.
[0062] It should be noted that the property management system can obtain all reservation information according to a preset allocation strategy. The allocation strategy can be a periodic strategy or a real-time strategy. The periodic strategy is to set multiple preset time points in the property management system. At each preset time point, all reservation information is obtained and the parking space allocation method of this embodiment is executed once. The real-time strategy is to trigger the parking space allocation method of this embodiment once after each reservation information is obtained. For reservation information that is not newly obtained, if the newly allocated target parking space is the same as the previously obtained target parking space, there is no need to send notification information to the owner again, thereby avoiding unnecessary repeated reminders.
[0063] For example, if the allocation strategy is a periodic strategy and reservation information A's reservation time period is between 8:00 and 12:00, when the parking space allocation method is executed at 6:00, reservation information A will be applied. When the parking space allocation method is executed at 7:00, even though reservation information A has already been executed once to obtain a corresponding target parking space, other owners may have submitted new reservation information between 6:00 and 7:00, and the optimal parking space allocation solution may have changed. Therefore, reservation information A will still be used to execute the parking space allocation method of this embodiment at 7:00. When the parking space allocation method is executed at 8:00, since the target car corresponding to reservation information A has already been parked in the target parking space assigned at 7:00, no parking space allocation is involved and reservation information A is no longer applied. If the allocation strategy is a real-time strategy, the parking space allocation method is executed once for each reservation information obtained. Historically accumulated reservation information can be referred to the periodic strategy described above and will not be repeated here.
[0064] It should be noted that the first population in this embodiment includes multiple first individuals, each of which records the candidate parking spaces allocated to each target vehicle. Two first individuals may have at least one different candidate parking space allocated to a target vehicle. Each first individual corresponds to a parking space allocation solution, and the final target individual is actually the target allocation solution for each target vehicle. When constructing the first population, the number of first individuals can be determined based on actual needs, ensuring that the processing time of the iterative operation meets the aforementioned allocation strategy.
[0065] For example, Figure 1 As shown, the first group includes M individuals (M is an integer greater than 2), among which individual 1 allocates parking space 1 to vehicle 1. Taking the non-overlapping reservation time periods of vehicle 2 and vehicle 3 as an example, parking space 2 is allocated to vehicle 2 and vehicle 3. Individual 2 allocates parking space 2 to vehicle 1, parking space 3 to vehicle 2, and parking space 4 to vehicle 3, and so on. Different individuals only need to have different candidate parking spaces for at least one target parking space allocation. For example, in individuals 3 and 4, the candidate parking spaces corresponding to vehicle 1 and vehicle 2 are the same, but vehicle 3 is allocated parking space 6 and parking space 7 respectively, so they can be determined as different individuals.
[0066] S20, performing multiple iterations based on the first population to obtain a target population, determining a target individual with the highest fitness value in the target population, and assigning a target parking space to each target vehicle based on the target individual, wherein the fitness value is used to indicate the time utilization rate of all candidate parking spaces;
[0067] The iterative operations include:
[0068] S21, determining the fitness value of each first individual, and selecting multiple first individuals from the first population to form a second population;
[0069] S22, determining the individual similarity between each two first individuals in the second population, generating a plurality of niches in the second population based on the individual similarities, performing a crossover operation and a mutation operation on each first individual in the niche to obtain a plurality of second individuals, wherein each niche includes at least two first individuals;
[0070] S23, performing the next iterative operation based on the second population composed of the second individuals.
[0071] It should be noted that the first population in this embodiment is the initial population. The first population is used as the starting point of the genetic algorithm. The next generation obtained by performing one iterative operation on the first population is the second population. The next generation obtained by performing the next iterative operation on the second population is the third population. And so on. After performing multiple iterative operations, the target population is finally obtained. The condition for stopping the iterative operation can be reaching a preset number of iterations or satisfying a preset convergence condition. Those skilled in the art are familiar with how to set the conditions for stopping the iteration of the genetic algorithm, and will not go into details here.
[0072] It should be noted that after obtaining the target population, those skilled in the art are familiar with how to determine the fitness value of each individual, and determine the individual with the highest fitness value as the target individual. Since the target individual actually corresponds to the parking space allocation plan, the target parking space corresponding to each target vehicle is recorded in the target individual, and parking spaces can be allocated according to the target individual. For example, the corresponding target parking space is sent to the owner account of each target vehicle, so that the owner can park according to the target parking space. There is no limitation on the operations after the parking space allocation.
[0073] It is worth noting that this embodiment uses the time utilization rate as the fitness value, and can select the target individual with the highest time utilization rate from the target individuals as the parking space allocation scheme, so that the time utilization rate of each target parking space is the highest, that is, the idle time is the shortest and the parking time is the longest, effectively improving the reliability of parking space allocation.
[0074] It should be noted that in the iterative operation, the fitness value of each first individual is first determined. The first individual includes the allocation of multiple target vehicles, and the reservation time period must be entered or selected when making a reservation. The occupation time and idle time of a candidate parking space can be determined based on the reservation time period of each target parking space allocated to the candidate parking space, thereby determining the sum of the occupation time and the idle time of all candidate parking spaces, and then determining the time utilization rate and the corresponding fitness value of the first individual. Multiple first individuals can be screened out from the first population based on the fitness value, such as eliminating the first individual with a lower fitness value. Other related calculations can also be performed based on the fitness value to screen out the next generation of the second population from the first population.
[0075] It should be noted that the second population is the next generation of the first population, and the initial individual in the second population is the first individual. This embodiment is based on DBNGA, so it is necessary to first determine the individual similarity between every two first individuals in the second population. The individual similarity is used to characterize the similarity of parking space allocation. A microhabitat is generated with multiple first individuals with high individual similarity, for example Figure 1As shown, the parking spaces of vehicle 1 and vehicle 2 of individual 3 and individual 4 are the same, and only vehicle 3 is different. Therefore, the similarity between individual 3 and individual 4 is relatively high, and a similarity threshold can be set as a condition for classifying them into the same microhabitat. When the individual similarity is greater than or equal to the similarity threshold, the corresponding two first individuals can be classified into the same microhabitat.
[0076] It should be noted that, compared to performing crossover and mutation operations on a population-by-population basis, this embodiment independently performs crossover and mutation operations within a niche. This allows for the exploration of more parking space allocation solutions per niche, avoiding rapid convergence or becoming trapped in a local optimum. An optimal solution is consistently found in each niche, resulting in a number of optimal solutions equal to the number of small increases and decreases. This allows for the isolation of data between niches to ensure population diversity. Mutation and crossover operations are common in genetic algorithms, and the specific principles behind these operations will not be elaborated upon here.
[0077] For example, Figure 1 As shown, in the second population, taking the example of individuals 1 and 2 forming niche 1-1, and individuals 3 and M forming niche 2-1, within niche 1-1, crossover and mutation operations are performed on individuals 1 and 2, and within niche 2-1, crossover and mutation operations are performed on individuals 3 and M. Crossover and mutation operations are not performed on individuals 1, 2, 3, and M together. The use of multiple niches ensures population diversity, and individuals from different niches do not crossover or mutate. Cross-compilation is performed only between individuals with high similarity, reducing the degree of individual variation within a single iteration, thereby slowing convergence and ensuring the reliability of the target population.
[0078] It should be noted that after each iteration, steps S21-S23 are re-executed in the next generation population. For example, multiple second individuals are selected from the second population to construct a third population. In the third population, the individual similarity of each second individual is determined and a new niche is constructed. Crossover and mutation operations are performed in the new niche. Therefore, after obtaining the target population, the number of niches may be different from that of the second population, and the individual combination within the niche may also be different. For example, Figure 1 As shown, after executing X iteration operations (X is an integer greater than 3), individual 3 has a higher individual similarity with individual 1 based on the exchange operation and mutation operation, so the niche 1-X includes individual 1 and individual 3, the niche 2-X includes individual 2 and individual M, and so on.
[0079] In addition, in one embodiment, referring to Figure 3 The reservation information also includes a reservation time period, which includes an arrival time period and a departure time period. Step S10 specifically includes but is not limited to the following steps:
[0080] S11, determining a plurality of available parking spaces, wherein each available parking space includes at least one available time period;
[0081] S12, based on any reservation information, determining a candidate time period from the available time periods, and determining the available parking space corresponding to the candidate time period as the candidate parking space, wherein the first start time of the candidate time period is not later than the arrival time period, and the first end time of the candidate time period is not earlier than the departure time period;
[0082] S13, constructing a first entity based on the reservation information of all confirmed candidate parking spaces;
[0083] S14, re-determining the candidate parking spaces corresponding to each reservation information, and constructing a new first body, wherein at least one reservation information in two different first bodies corresponds to a different candidate parking space.
[0084] It should be noted that the available parking spaces are parking spaces that can be reserved in the property management system. Since a reservation system is adopted, any parking space that is not currently in use can be determined as an available parking space. Referring to the description of the above embodiment, even if a parking space has been determined as a candidate parking space, new reservation information may still be added to trigger parking space allocation before it is actually used. Therefore, the target parking space that has not been used will also be determined as an available parking space.
[0085] It should be noted that the available time period for each available parking space can be set based on actual conditions. For example, some public parking spaces are available all day, so the entire 24-hour period can be determined as the available time period. Some shared parking spaces provided by owners are only available during certain time periods. For example, an owner provides a personal parking space for others to use during working hours from 8:00 to 18:00, and this time period is determined as the available time period. The reservation time period includes the arrival time period and the departure time period. If the reservation time period only includes the arrival time and the departure time, it is easy to fail to match due to the shortage of available parking spaces, reducing parking space utilization and owner experience. This embodiment improves the matching flexibility of candidate parking spaces through range-based time selection, thereby improving the utilization rate of candidate parking spaces.
[0086] It should be noted that when constructing an individual, this embodiment allocates candidate parking spaces one by one for each reservation information. The same available parking space can be allocated to multiple reservation information, as long as the reservation time periods do not conflict. Based on a reservation information, the available time periods of the current available parking space are traversed according to the reservation time period. If the arrival time period intersects with the available time period, and the departure time period also intersects with the available time period, the reservation time period can be determined as a candidate time period. The first starting time of the candidate time period must be no later than the arrival time period, and the first ending time must be no earlier than the departure time period.
[0087] It is worth noting that the candidate time periods can be flexibly changed before the individual construction is completed. When the available time periods are met, the candidate time periods of one appointment information can be adjusted based on the other appointment information. The first start time of the other appointment information can be advanced or delayed within the corresponding arrival time period, and the first end time can be advanced or delayed within the corresponding departure time period, so that both appointment information can be assigned to the candidate time period.
[0088] For example, Figure 1 As shown, the reservation time period of vehicle 2 can be [(8:00, 8:30), (10:00, 11:00)], and the reservation time period of vehicle 3 can be [(9:30, 10:30), (11:30, 12:00)]. When the available time period of parking space 2 is [8:00, 12:00], the candidate time period obtained when allocating based on vehicle 2 is [8:00, 11:00]. When allocating based on vehicle 3, since the arrival time period of vehicle 3 conflicts with the first end time of vehicle 2, but it is detected that the departure time period of vehicle 2 can avoid the needs of vehicle 3, the first end time of vehicle 2 is moved forward. Finally, the candidate time period of vehicle 2 is [8:00, 10:00], and the candidate time period of vehicle 3 is [10:00, 12:00], or the candidate time period of vehicle 2 is [8:00, 10:30], and the candidate time period of vehicle 3 is [10:30, 12:00].
[0089] It should be noted that after completing the allocation of all reservation information one by one, the constructed plan will be determined as the first individual. When constructing another first individual, the same principle can be repeated. It is necessary to ensure that the allocation plan of at least one target vehicle between every two first individuals is different. For example, in the above example of vehicle 2 and vehicle 3, different candidate parking spaces can be assigned to vehicle 2 or vehicle 3 so that individual 1 and individual 2 belong to different parking space allocation plans.
[0090] In addition, in one embodiment, referring to Figure 3 In step S21, the fitness value of each first individual is determined, which specifically includes but is not limited to the following steps:
[0091] S211, based on any first individual and based on the candidate time periods corresponding to the respective reservation information, determining the total idle time and total parking time of the first individual;
[0092] S212, determining the maximum idle time, minimum idle time, maximum parking time, and minimum parking time of the first individual based on the arrival time periods and departure time periods corresponding to all reservation information;
[0093] S213, determining an idle objective function value based on the total idle time, the maximum idle time, and the minimum idle time;
[0094] S214, determining a parking objective function value based on the total parking time, the maximum parking time, and the minimum parking time;
[0095] S215, determining the fitness value of the first individual based on the idle objective function value and the parking objective function value.
[0096] It should be noted that the fitness value of this embodiment is used to characterize the time utilization rate. The time utilization rate is not for one candidate parking space, but for all candidate parking spaces. Available parking spaces that have not been determined as candidate parking spaces are not included in the calculation range. The higher the fitness value of this embodiment, the longer the parking time of the assigned candidate parking space and the shorter the idle time, thereby making the utilization rate of the candidate parking space higher. The technical solution of this embodiment is not to use as many available parking spaces as possible, but to improve the utilization rate of a single parking space. In the case of tight parking space resources, it can ensure that each candidate parking space can be maximized by improving the utilization rate of a single parking space, increase the number of target vehicles that can use parking spaces, and improve the owner experience.
[0097] It should be noted that in order to quantify the above-mentioned time utilization, this embodiment introduces two objective functions, one objective function is the idle objective function, which is used to measure the idle time, and the other objective function is the parking objective function, which is used to measure the parking time. In order to calculate the function value of each first body under the above-mentioned two objective functions, it is necessary to determine the total idle time and total parking time of each first body. The total parking time can be determined based on the candidate time period after each target vehicle is assigned a candidate parking space, and then the total idle time can be obtained by subtracting the total parking time from the time corresponding to the available time period of the candidate parking space.
[0098] It should be noted that, according to the description of the above embodiment, after each target vehicle is allocated, the first starting time and the first ending time of the candidate time period can be adjusted if there is redundancy in the available time period. Based on this, this embodiment determines the minimum idle time and maximum parking time corresponding to the maximized parking time of each target vehicle, and the maximum idle time and minimum parking time corresponding to the minimized parking time based on the arrival time period and the departure time period.
[0099] It should be noted that the calculation formula of the idle objective function value in this embodiment is: The calculation formula of the parking objective function value is: Among them, f1 is the idle objective function value, f2 is the parking objective function value, T1 is the total idle time, T MAX1 is the maximum idle time, T MIN1 is the minimum idle time, TMAX2 is the maximum parking time, T MIN2 The minimum parking time.
[0100] It should be noted that when calculating the fitness value, weight values are set for the idle objective function value and the parking objective function value respectively, and the weighted sum is obtained by the following formula: A = w1 × f1 + w2 × f2, where w1 is the weight of the idle objective function value, w2 is the weight of the parking objective function value, and w1 + w2 = 1 is satisfied.
[0101] For example, Figure 1 As shown, taking individual 1 in the first group as an example, the available time periods of parking spaces 1 and 2 are both [8:00, 12:00], and the total available time is 240+240=480 minutes. Vehicle 1 arrives in [8:00, 8:30] and leaves in [10:30, 11:00]. Vehicle 2 arrives in [9:00, 9:30] and leaves in [11:30, 12:00]. The candidate time periods allocated to parking space 1 are [8:30-10:30] and [9:00-12:00], respectively. The total parking time can be determined to be 120+1 80 = 300 minutes, the total idle time is 180 minutes, and the maximum parking time adopts the maximum range of each preset time period, that is, vehicle 1 is [8:00, 11:00], vehicle 2 is [9:00, 12:00], the maximum parking time is 180 + 180 = 360 minutes, and the corresponding minimum idle time is 120 minutes; similarly, the maximum idle time is determined by the minimum range of each preset time period, that is, vehicle 1 is [8:30, 10:30], vehicle 2 is [9:30, 11:30], the corresponding minimum parking time is 120 + 120 = 240 minutes, and the corresponding maximum idle time is 240 minutes. Substituting into the above formula, we get: Taking w1 as 0.3 and w2 as 0.7 as an example, the fitness value A can be determined as A=0.3×0.5+0.7*0.5=0.5.
[0102] In addition, in one embodiment, referring to Figure 3 In step S21, a plurality of first individuals are screened out from the first population, specifically including but not limited to the following steps:
[0103] S216, performing non-dominated sorting on the first individuals in the first population to obtain multiple target fronts, wherein each target front includes multiple sorted first individuals;
[0104] S217, based on any frontier, based on the idle objective function value and the parking objective function value, determine the target congestion of each first body, and screen out multiple first bodies in descending order based on the target congestion.
[0105] It should be noted that, according to the aforementioned principles, non-dominated sorting can effectively distinguish the superiority relationships between different solutions in a multi-objective optimization scenario. Those skilled in the art are familiar with how to perform non-dominated sorting on individuals within a population. This embodiment does not improve upon the principles of non-dominated sorting and will not be repeated here. Because non-dominated sorting can sort individuals based on the superiority relationships between them, this embodiment utilizes non-dominated sorting to group multiple first individuals with similar superiority relationships into a target frontier, thereby ensuring that the superiority of the first individuals within each target frontier is relatively close.
[0106] It should be noted that, based on the aforementioned concept of crowding, crowding is an indirect measure of the local density of an individual. That is, the higher the crowding of an individual, the larger the crowding distance, the lower the local density, and the individual is in a sparse area. Because individuals in dense areas are highly similar, this embodiment requires selecting individuals from sparse areas as much as possible to ensure individual diversity. Therefore, this embodiment calculates the target crowding for each first individual in each frontier and then selects multiple first individuals from high to low based on the target crowding. This ensures that the retained first individuals are more likely to come from the coefficient area, resulting in greater differences between individuals and maximizing diversity in subsequent operations.
[0107] In addition, in one embodiment, referring to Figure 3 In step S217, the target congestion degree of each first individual is determined based on the idle objective function value and the parking objective function value, specifically including but not limited to the following steps:
[0108] S2171, based on any pair of two adjacent first bodies, determining a difference in idle objective function values as a first function difference, and determining a difference in parking objective function values as a second function difference;
[0109] S2172, determining a first upper limit value having a maximum value and a first lower limit value having a minimum value among the plurality of idle objective function values, and determining a second upper limit value having a maximum value and a second lower limit value having a minimum value among the plurality of parking objective function values;
[0110] S2173: Based on any first function difference, determine a corresponding first congestion degree according to a first upper limit and a first lower limit;
[0111] S2174: Based on any second function difference, determine a corresponding second congestion degree according to a second upper limit and a second lower limit;
[0112] S2175 , determining the sum of the first congestion degree and the second congestion degree as the target congestion degree of the corresponding front.
[0113] It should be noted that the first individual is obtained through non-dominated sorting, which can reflect the degree of excellence between individuals. The excellence of two adjacent first individuals is relatively similar. If the target crowding is high, the two are in different spatial areas. On the contrary, the two are in the same dense area. Therefore, selecting the first individual with a higher target crowding can ensure that the first individual comes from different sparse areas and improve the diversity of the population.
[0114] It should be noted that the target congestion in this embodiment is based on the idle objective function value and the parking objective function value. Since the target congestion is calculated based on the two adjacent first individuals, the number of idle objective function values and parking objective function values is 2. For reference, this embodiment takes the idle objective function value with the largest value among the individuals as the first upper limit value, and the smallest as the first lower limit value. Similarly, the second upper limit value and the second lower limit value are determined according to the parking objective function value. The calculation method of the idle objective function value and the parking objective function value refers to the description of the above embodiment and will not be repeated here.
[0115] It should be noted that the congestion calculation formula in this embodiment is as follows: Where N is the number of objective functions. In this embodiment, N=2, f m (i) is the function value of the i-th individual in the m-th type of objective function, is the upper limit value of the mth type objective function, is the lower limit value of the mth type objective function, for example, m = 1 corresponds to the idle objective function value, then Characterizes the idle objective function value of the i-th individual, f m (i)-f m (i-1) is the first function difference,
[0116] is the first upper limit value, is the first lower limit value. Similarly, m=2 corresponds to the parking objective function value, then f m (i) represents the parking objective function value of the i-th individual, f m (i)-f m (i-1) is the second function difference, is the second upper limit value, is the second lower limit value.
[0117] In addition, in one embodiment, referring to Figure 3 In step S217, a plurality of first individuals are selected based on the target congestion degree in descending order, specifically including but not limited to the following steps:
[0118] S2176, determining the ranking of each target frontier obtained by the non-dominated sorting as a corresponding frontier level;
[0119] S2177, obtaining the target quantity preset for each frontier level;
[0120] S2178, based on any target front, based on the number of targets, multiple first individuals are screened out according to the target congestion from high to low.
[0121] It should be noted that, according to the description of the above embodiment, the target frontier is obtained based on the non-dominated sorting, so the target frontiers are also ordered. This embodiment uses the sorting of the target frontier as the frontier level. The higher the frontier level, the better the corresponding first individual. Therefore, although this embodiment needs to construct microhabitats in different target frontiers to ensure population diversity, in order to improve the rationality of parking space allocation, when screening the first individual, this embodiment retains more first individuals in the target frontier with a higher frontier level and retains fewer first individuals in the target frontier with a lower frontier level. This can ensure the diversity of the population and retain as many excellent individuals as possible, ensuring that the final target individual is a more reasonable allocation scheme. Therefore, this embodiment sets a ratio for each frontier level, and then determines the number of targets of different frontier levels based on the total number of first individuals, and then screens from high to low according to the target congestion.
[0122] For example, there are 3 frontier levels with proportions of 50%, 30% and 20%. When the first population has 20 individuals, frontier 1 has 5 individuals, frontier 2 has 8 individuals, and frontier 3 has 7 individuals, if half of the individuals are retained in each generation, the number of the first individuals in the second population is 10, 5 individuals are retained in frontier 1, 3 individuals with the highest target crowding are selected in frontier 2, and 2 individuals with the highest target crowding are selected in frontier 3.
[0123] In addition, in one embodiment, referring to Figure 3 In step S22, the individual similarity between each two first individuals in the second population is determined, specifically including but not limited to the following steps:
[0124] S221: Based on any first individual, a coding unit is constructed based on each target vehicle and its corresponding candidate parking space, and multiple coding units are arranged into individual codes based on the order of reservation time periods from early to late, wherein multiple coding units in the same reservation time period are sorted based on the preset sequence numbers of the candidate parking spaces;
[0125] S222: Based on any two first individuals, determine individual similarity according to similarity of individual codes.
[0126] It should be noted that this embodiment divides the microhabitats according to individual similarities in each target frontier. This embodiment uses the similarity of individual codes as the specific quantification of individual similarities. When constructing the first individual, the target vehicle and the candidate parking space are constructed into coding units, for example Figure 1 As shown in , the two coding units are (vehicle 1, parking space 1) and (vehicle 2, parking space 2). After obtaining the unit elements, they are arranged in order from early to late according to the reservation time period, so that the coding units are arranged into an ordered array. This array is used as the individual code of the first individual. If the coding units in the same time period are the same, the two individuals can be similar. At the same time, multiple coding units in the same reservation time period are sorted based on the preset serial number of the candidate parking space, for example Figure 1 As shown, if (Vehicle 1, Parking Space 1) and (Vehicle 2, Parking Space 2) correspond to the same reservation time period, Parking Space 1 is ranked first because its preset sequence number is earlier. After obtaining the individual code of each first individual, the individual similarity of the two first individuals can be determined based on the similarity of the individual codes, that is, the ratio of the number of identical coding units in the two individual codes to the total number of coding units.
[0127] like Figure 4 As shown, Figure 4 The present invention also provides a parking space allocation device based on a niche genetic algorithm, including:
[0128] The processor 401 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0129] The memory 402 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 402 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 402 and is called by the processor 401 to execute the parking space allocation method based on the niche genetic algorithm of the embodiments of this application.
[0130] Input / output interface 403, used to implement information input and output;
[0131] Communication interface 404, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0132] Bus 405 , which transmits information between various components of the device (e.g., processor 401 , memory 402 , input / output interface 403 , and communication interface 404 );
[0133] The processor 401 , the memory 402 , the input / output interface 403 and the communication interface 404 are connected to each other in communication within the device via a bus 405 .
[0134] An embodiment of the present application further provides an electronic device, comprising the parking space allocation device based on the niche genetic algorithm as described above.
[0135] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned parking space allocation method based on the niche genetic algorithm is implemented.
[0136] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory optionally includes a memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0137] Those skilled in the art will appreciate that all or some of the steps and systems in the method disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include computer storage media (or non-transitory media) and communication media (or temporary media). As known to those skilled in the art, the term computer storage media is included in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data) and is volatile and non-volatile, removable, and non-removable. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory, or other memory technology, CD-ROM, digital versatile disks (DVD), or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage, or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0138] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above implementation. Those skilled in the art can also make various equivalent modifications or substitutions under the shared conditions that do not violate the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A parking space allocation method based on a niche genetic algorithm, characterized in that: include: Constructing a first population based on a plurality of reservation information, wherein each reservation information corresponds to a target vehicle, the first population includes a plurality of first individuals, and one first individual includes candidate parking spaces allocated to all target vehicles; Performing multiple iterative operations based on the first population to obtain a target population, determining a target individual with the highest fitness value in the target population, and assigning a target parking space to each of the target vehicles based on the target individual, wherein the fitness value is used to indicate the time utilization rate of all the candidate parking spaces; The iterative operation includes: determining the fitness value of each of the first individuals, and selecting a plurality of the first individuals from the first population to form a second population; Determining individual similarities between every two of the first individuals in the second population, generating a plurality of niches in the second population based on the individual similarities, and performing crossover and mutation operations on each of the first individuals in the niches to obtain a plurality of second individuals, wherein each niche includes at least two of the first individuals; The next iterative operation is performed based on the second population composed of the second individuals.
2. The parking space allocation method based on niche genetic algorithm according to claim 1, characterized in that: The reservation information further includes a reservation time period, and the reservation time period includes an arrival time period and a departure time period. The step of constructing a first population based on the plurality of reservation information includes: determining a plurality of available parking spaces, wherein each of the available parking spaces includes at least one available time period; Based on any of the reservation information, determine a candidate time period from all the available time periods, and determine the available parking space corresponding to the candidate time period as the candidate parking space, wherein a first start time of the candidate time period is not later than the arrival time period, and a first end time of the candidate time period is not earlier than the departure time period; Constructing a first entity based on the reservation information of all the determined candidate parking spaces; The candidate parking spaces corresponding to the respective reservation information are re-determined to construct a new first entity, wherein at least one reservation information in two different first entities corresponds to a different candidate parking space.
3. The parking space allocation method based on niche genetic algorithm according to claim 2, characterized in that: The determining of the fitness value of each of the first individuals includes: Determining, based on any one of the first entities and based on the candidate time periods corresponding to the respective reservation information, a total idle time and a total parking time of the first entity; Determining a maximum idle time, a minimum idle time, a maximum parking time, and a minimum parking time of the first individual based on the arrival time periods and the departure time periods corresponding to all the reservation information; Determining an idle objective function value based on the total idle time, the maximum idle time, and the minimum idle time; determining a parking objective function value based on the total parking time, the maximum parking time, and the minimum parking time; The fitness value of the first entity is determined based on the idle objective function value and the parking objective function value.
4. The parking space allocation method based on niche genetic algorithm according to claim 3, characterized in that: Screening out a plurality of the first individuals from the first population includes: Performing non-dominated sorting on the first individuals in the first population to obtain a plurality of target fronts, wherein each target front includes a plurality of sorted first individuals; Based on any frontier, a target congestion degree of each first entity is determined based on the idle objective function value and the parking objective function value, and a plurality of first entities are screened out in descending order based on the target congestion degrees.
5. The parking space allocation method based on niche genetic algorithm according to claim 4, characterized in that: The determining of the target congestion degree of each first object based on the idle objective function value and the parking objective function value includes: Based on any pair of adjacent two first objects, a difference between the idle objective function values is determined as a first function difference, and a difference between the parking objective function values is determined as a second function difference; Determining a first upper limit value having a maximum value and a first lower limit value having a minimum value among the plurality of idle objective function values, and determining a second upper limit value having a maximum value and a second lower limit value having a minimum value among the plurality of parking objective function values; Based on any first function difference, determining a corresponding first congestion degree according to the first upper limit and the first lower limit; Based on any second function difference, determining a corresponding second congestion degree according to the second upper limit and the second lower limit; The sum of the first congestion degree and the second congestion degree is determined as the target congestion degree of the corresponding front.
6. The parking space allocation method based on niche genetic algorithm according to claim 4, characterized in that: The selecting the plurality of first individuals based on the target congestion degree in descending order includes: Determine the ranking of each target frontier obtained by the non-dominated sort as the corresponding frontier level; obtaining a target quantity preset for each of the frontier levels; Based on any of the target frontiers, based on the target quantity, and according to the target congestion degree, a plurality of the first individuals are screened out from high to low.
7. The parking space allocation method based on niche genetic algorithm according to claim 2, characterized in that: Determining the individual similarity between every two of the first individuals in the second population includes: Based on any of the first individuals, a coding unit is constructed based on each of the target vehicles and the corresponding candidate parking spaces, and the plurality of coding units are arranged into individual codes based on the order of the reservation time periods from early to late, wherein the plurality of coding units for the same reservation time period are sorted based on the preset sequence numbers of the candidate parking spaces; Based on any two of the first individuals, the individual similarity is determined according to the similarity of the individual codes.
8. A parking space allocation device based on a niche genetic algorithm, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the parking space allocation method based on the niche genetic algorithm as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: Including the parking space allocation device based on the niche genetic algorithm as described in claim 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the parking space allocation method based on the niche genetic algorithm according to any one of claims 1 to 7.
Citation Information
Patent Citations
Parking space reservation distribution method based on time sequence constraint condition
CN117789511A
Supermarket truck special parking space sharing method, device, equipment and medium
CN118522176A
Parking system based on parking resource sharing reservation management and guiding device thereof
CN119626023A