Target object allocation method, electronic equipment and storage medium
By filtering preset influence features, building a time series data set and training the target random forest model, and calculating the allocation number and minimum spacing of the target objects in combination with regional features, the problem of unreasonable resource allocation in the infrastructure is solved, and scientific resource management and accurate capacity prediction are achieved.
Patent Information
- Application Number
- CN202510328118.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-04
AI Technical Summary
The existing technology is difficult to accurately predict future capacity demand and reasonably allocate resources in infrastructure such as electricity, transportation, and communications, resulting in unreasonable resource allocation, especially in the judgment of capacity of tobacco retail sites, resulting in unreasonable resource allocation.
By filtering out preset influence features related to the number of target objects, building a time series data set and training the target random forest model, adjusting the prediction result interval, and calculating the allocation number and minimum spacing of the target objects with regional feature data, scientific resource allocation is achieved.
It realizes accurate prediction and reasonable allocation of target object capacity, provides a digital resource management solution, improves prediction accuracy and scientific allocation, and solves resource allocation problems in complex environments.
Smart Images

Figure CN120258871A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular, to a method for allocating target objects, an electronic device, and a storage medium. Background Art
[0002] With the development of society, the reliable operation of infrastructure such as power, transportation, and communication is crucial for the normal operation of society. However, when facing the growing demand, these systems often have difficulty in effectively predicting future capacity requirements and reasonably allocating resources. For example, in the tobacco field, when judging the capacity of tobacco retail points in a certain area, manual experience or simply based on tobacco sales is usually used for judgment, and the prediction result is not accurate enough due to large subjectivity, and there are certain challenges in dealing with capacity prediction and allocation problems in a changing environment, resulting in unreasonable resource allocation. Therefore, there is an urgent need to provide a method for allocating target objects that can accurately predict and effectively allocate. Summary of the Invention
[0003] In view of the above technical problems, the present invention provides a method for allocating target objects, an electronic device, and a storage medium, which can effectively predict and allocate the reasonable capacity of target objects.
[0004] According to a first aspect of the present invention, there is provided a method for allocating target objects, including the following steps:
[0005] Analyze and process the historical data corresponding to each preset influencing feature of each given geographical area collected, and screen out a number of target influencing features; the preset influencing feature is a feature that is preset to affect the quantity allocation of target objects.
[0006] Based on the historical data corresponding to a number of target influencing features and the corresponding quantity of target objects, construct a time series data set in a sliding window manner to train a preset random forest model to obtain a target random forest model, and adjust the prediction result interval according to the prediction results of each decision tree in the preset random forest model.
[0007] Input the data of each target influencing feature of the target geographical area collected within a preset historical time period into the target random forest model, and output the predicted quantity of target objects that meets the adjusted prediction result interval.
[0008] Based on a number of preset regional features, obtain a preset regional feature data set for each sub-geographical area within the target geographical area, and calculate the regional score of each sub-geographical area, so as to calculate the allocated quantity of target objects for each sub-geographical area according to the predicted quantity of target objects output and the weight of the regional score of each sub-geographical area.
[0009] Calculate the minimum distance between target objects in each sub - geographical area based on the location information of existing target objects in each sub - geographical area, and allocate the location of the minimum distance of the target objects according to the corresponding allocated quantity of the target objects.
[0010] According to a second aspect of the present invention, there is provided a non - transitory computer - readable storage medium storing at least one instruction or at least one program segment. The at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above - mentioned method for allocating target objects.
[0011] According to a third aspect of the present invention, there is provided an electronic device including a processor and the above - mentioned non - transitory computer - readable storage medium.
[0012] The present invention has at least the following beneficial effects:
[0013] For the method for allocating target objects according to the present invention, first, several target influencing features with strong correlation with the quantity of target objects are screened out according to the historical data corresponding to each preset influencing feature. Based on the historical data corresponding to the several target influencing features and the corresponding quantity of target objects, a time - series data set is constructed in a sliding - window manner and the model is trained, so that the model can more accurately predict future time - series data. And the prediction result interval is adjusted according to the prediction results of each decision tree, and a reasonable prediction result of the quantity of target objects can be obtained. The data of each target influencing feature of the target geographical area collected within a preset historical time period is input into the target random forest model to output the predicted quantity of target objects. According to the calculated area score of the sub - geographical area, the allocated quantity of target objects in the sub - geographical area is obtained, and the minimum allocated distance between target objects in the sub - geographical area is calculated, which can effectively predict and allocate the reasonable capacity of target objects, providing a digital solution for maintaining the cigarette retail market environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following - described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0015] Figure 1 It is a flowchart of the method for allocating target objects provided by the embodiment of the present invention;
[0016] Figure 2 It is a schematic diagram of the Pearson correlation coefficient between each preset influencing feature and the quantity of target objects. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0018] The embodiment of the present invention provides a method for allocating target objects, as Figure 1 shown, the method includes the following steps:
[0019] S100, analyze and process the historical data corresponding to each preset influence feature in each given geographical area collected, and screen out several target influence features; it can be understood that the preset influence feature is a preset influence feature dimension.
[0020] Specifically, the preset influence feature is a feature that is preset to affect the allocation of the number of target objects, where the target object refers to an object identifier for engaging in tobacco retail. For example, the preset influence feature can be the permanent population in the target geographical area, the total cigarette sales amount, the regional area, the average household gross profit, the regional GDP, the total retail sales of social consumer goods, the cigarette sales volume, the added value of the tertiary industry, and the proportion of the tertiary industry.
[0021] Specifically, in step S100, several target influence features are screened out through the following steps:
[0022] S101, perform preprocessing and normalization processing on the historical data corresponding to each preset influence feature to obtain several target data corresponding to each preset influence feature; it can be understood that the historical data corresponding to the preset influence feature includes the data corresponding to the preset influence feature in n time periods before the current time point. Preferably, one time period is one year.
[0023] Specifically, the preprocessing of the historical data corresponding to each preset influence feature includes cleaning and one-hot encoding operations on the historical data to make the obtained data suitable for model training; those skilled in the art know the specific implementation process of data preprocessing for model training, which will not be elaborated here.
[0024] S102, according to the several target data corresponding to each preset influence feature, calculate the Pearson correlation coefficient between each preset influence feature and the number of target objects in the target geographical area. In a specific implementation, several other preset influence features can also be introduced, and the Pearson correlation coefficient between the preset influence feature and the number of target objects is as Figure 2 shown.
[0025] Specifically, the Pearson correlation coefficient between any preset influencing feature and the number of target objects in the target geographical area meets the following conditions:
[0026]
[0027] where r c is the Pearson correlation coefficient between the c-th preset influencing feature and the number of target objects in the target geographical area, X i is the value corresponding to any preset influencing feature in the i-th year in the past, Y i is the number of target objects corresponding to the i-th year in the past, is the average value of the data corresponding to any preset influencing feature in n time periods before the current time point, is the average value of the number of target objects in n time periods before the current time point, and the value of i ranges from 1 to n.
[0028] S103. Select each preset influencing feature with a Pearson correlation coefficient greater than the preset Pearson correlation coefficient threshold and use them all as target influencing features; those skilled in the art set the preset Pearson correlation coefficient threshold according to actual needs. For example, 0.6.
[0029] Further, the preset Pearson correlation coefficient threshold is determined through the following steps:
[0030] S1031. According to the given initial influencing feature library, calculate the target Pearson correlation coefficient between each initial influencing feature in the initial influencing feature library and the number of target objects in the target geographical area, and obtain a number of target Pearson correlation coefficients; it can be understood that the initial influencing feature refers to a feature that is preset and may affect the allocated number of target objects. Among them, the calculation process of the Pearson correlation coefficient is prior art and will not be elaborated here.
[0031] S1032. Perform curve fitting on the number of target Pearson correlation coefficients and the number of initial influencing features corresponding to each target Pearson correlation coefficient to obtain a quantity-coefficient relationship curve function.
[0032] S1033. According to the preset influencing feature quantity threshold, determine the target Pearson correlation coefficient corresponding to the influencing feature quantity threshold based on the quantity-coefficient relationship curve function, and determine the target Pearson correlation coefficient as the preset Pearson correlation coefficient threshold.
[0033] As described above, by constructing a quantity - coefficient relationship curve function, a one - to - one correspondence between the Pearson correlation coefficient and the number of preset influencing features can be obtained, which is beneficial to determining the Pearson correlation coefficient threshold according to the required number of preset influencing features, making the setting of the threshold more reasonable, overcoming the subjective influence of people, so that the selected number of preset influencing features more meets the requirements, ensuring the rationality and reliability of the training data set, and further improving the prediction accuracy of the trained model.
[0034] S200. Based on the historical data corresponding to a number of target influencing features and the corresponding number of target objects, a time - series data set is constructed in a sliding - window manner to train a preset random forest model to obtain a target random forest model, and the prediction result interval is adjusted according to the prediction results of each decision tree in the preset random forest model.
[0035] Specifically, the time - series data set is constructed in step S200 through the following steps:
[0036] S201. According to the historical data corresponding to each target influencing feature, a number of historical sub - data sets are divided by year; it can be understood that: the data corresponding to a number of target influencing features in the same year are divided into the same sub - data set.
[0037] S202. Taking the time order from front to back as the window sliding direction, the historical sub - data set corresponding to any year and the number of target objects corresponding to the next year of the said any year are determined as a sample. For example, the input data is the data corresponding to each target influencing feature in 2013, the output is the number of target objects in 2014, and the input data and the output data are used as a sample.
[0038] S203. Based on the determined number of samples, a time - series data set is constructed; among them, the time - series data set includes a training set and a test set; it can be understood that: during training, a sub - sample set is randomly selected from a number of samples, and each sub - sample set corresponds to training a decision tree. At each node in the decision tree, the data of each target influencing feature is judged according to a pre - set condition, that is, according to the data of a number of target influencing features and the number of target objects in the sub - sample set, the decision tree is trained to realize the training of the preset random forest model. Those skilled in the art know the specific implementation process of the random forest model training, and will not be elaborated here.
[0039] Furthermore, the method further includes the following steps:
[0040] When predicting the number of target objects in the next m years, for any target influencing feature, when obtaining the training data corresponding to the j - th year of the target influencing feature, the data corresponding to the target influencing feature in the j - th year meets the following conditions:
[0041] Xj = 1 / k × (X j-1 + X j-2 + …… + X j-k ), where X j is the data corresponding to the target impact feature in the j-th year, k is the preset number of years threshold, and m > 1.
[0042] Specifically, the data corresponding to the number of target objects in the i-th year is obtained through the predicted average value of several decision trees of the preset random forest model.
[0043] Furthermore, the j-th year is any past year or any future year. For example, to predict the number of target objects in the next 5 years, when obtaining the sample data, the data of the past 1 year is obtained as the average value of the data of the past 2 - 4 years. When calculating the data of the second year in the future, the average value is calculated based on the data of the past two years and the data of the next year, where the data of the next year is the data obtained from the previous round of prediction.
[0044] As described above, by constructing a time series dataset in a sliding window manner, it is beneficial to retain the time relationship in the time series data, capture time patterns, and avoid information leakage problems in model training and evaluation. This enables the model to more accurately predict future time series data. When predicting the number of target objects in the future for multiple years, the average value of the data corresponding to the target impact feature in the previous m years can be used to calculate the value of the target impact feature in the next year, and the predicted number of target objects is used as the data for the next round of training, thereby completing the training of the model and being able to accurately predict the number of target objects in the future for multiple years.
[0045] In a specific embodiment, adjusting the prediction result interval according to the prediction results of each decision tree in the preset random forest model includes the following steps:
[0046] S210, according to the prediction results of several decision trees in the preset random forest model, extract the first preset percentile and the second preset percentile to determine the initial prediction interval.
[0047] Specifically, the prediction results of several decision trees in the preset random forest model are the prediction results obtained by training several different decision trees in turn by sampling several different sub-training sets from the input training set using bootstrap sampling, where the prediction results are expressed as follows:
[0048] Dec = {Dec1, Dec2, Dec3, ……, Dec g}}, where Dec represents the prediction results of g decision trees in the preset random forest model and are arranged in ascending order.
[0049] Further, the first preset percentile can be the 5th percentile, and the second preset percentile can be the 95th percentile. Specifically, the lower limit value and the upper limit value of the initial prediction interval respectively meet the following conditions:
[0050] Lowerbound = Dec [0.05×g] , where Lowerbound represents the lower limit value of the initial prediction interval.
[0051] Upperbound = Dec [0.95×g] , where Upperbound represents the upper limit value of the initial prediction interval.
[0052] S220. According to the change trend of the target object quantity and in combination with the historical calibration records of the preset random forest model, adjust the first preset percentile and the second preset percentile to obtain the target prediction interval, so as to complete the adjustment of the prediction result interval.
[0053] Specifically, the lower limit value of the target prediction interval is α × Lowerbound, where α is a preset first parameter factor.
[0054] Specifically, the upper limit value of the target prediction interval is β × Upperbound, where β is a preset second parameter factor.
[0055] As described above, by setting the upper and lower limit values of the percentile, the prediction results with small probability of occurrence can be excluded, the reasonable change range of the prediction results can be effectively captured, and to a certain extent, the uncertainty of the prediction can also be reflected. And by adopting the bias correction strategy and introducing parameter factors through the historical calibration records of the model, the random forest model can be finely adjusted to ensure that the final prediction interval is maintained within a reasonable range.
[0056] S300. Input the data of each target influence feature in the target geographical area collected within the preset historical time period into the target random forest model, and output the predicted quantity of the target object that meets the adjusted prediction result interval. For example, when predicting the quantity of the target object in the next year, the preset historical time period refers to the past year. After adjusting the prediction result interval of the prediction result of each decision tree output, take the average value of several prediction results within the prediction result interval to obtain the predicted quantity of the target object.
[0057] S400 obtains a preset regional feature dataset for each sub-geographical region within a target geographical region based on several preset regional features, and calculates the regional score for each sub-geographical region, so as to calculate the target object allocation quantity for each sub-geographical region according to the predicted quantity of the target object output and the weight of the regional score of each sub-geographical region; it can be understood that: the allocation of the target object quantity is performed according to the score ratio of the regional score of each sub-geographical region in the total regional score of all sub-geographical regions.
[0058] Specifically, the preset regional feature is any one of the number of retail households, the number of sales specifications, sales volume, sales amount, gross profit, gross profit margin, area, and density within the sub-geographical region.
[0059] In a specific embodiment, the regional score for each sub-geographical region is obtained through the following steps:
[0060] S401 determines the feature weight of each preset regional feature according to the preset regional feature dataset of each sub-geographical region; it can be understood that: the preset regional feature dataset includes the data corresponding to each preset regional feature.
[0061] The specific steps include:
[0062] S4011 performs positive processing on the data corresponding to each preset regional feature, and generates a feature matrix according to the processed data; it can be understood that: different types of feature data are uniformly converted into extremely large data, and then positive standardization processing of the feature matrix is performed to eliminate the influence of different dimensions.
[0063] S4012 determines any feature probability P for information entropy calculation according to the feature matrix ab ;
[0064] Specifically, P ab meets the following conditions:
[0065] P ab = Z ab / (∑ s a=1 Z ab ), where Z ab is the feature matrix, a represents the a-th sub-geographical region within the target geographical region, b represents the b-th preset regional feature, and s is the total number of sub-geographical regions within the target geographical region.
[0066] S4013 calculates the information entropy of each preset regional feature according to each feature probability.
[0067] Specifically, the information entropy of any preset regional feature meets the following conditions:
[0068] eb = -(1 / ln(s)) × (∑ s a=1 (P ab × ln(P ab ))), where e b is the information entropy of the b-th preset region feature.
[0069] S4014. Calculate the information utility value corresponding to any preset region feature according to the information entropy of any preset region feature.
[0070] Specifically, the information utility value corresponding to any preset region feature meets the following conditions:
[0071] d b = 1 - e b , where d b is the information utility value corresponding to the b-th preset region feature.
[0072] S4015. Calculate the feature weight of any preset region feature according to the information utility value corresponding to any preset region feature. The feature weight of any preset region feature meets the following conditions:
[0073] W b = d b / (∑ f b=1 d b ), where W b is the feature weight of the b-th preset region feature, and f is the number of preset region features.
[0074] S402. Construct the optimal solution and the worst solution of the feature data according to the data corresponding to each preset region feature; it can be understood that: use the TOPSIS method to construct the optimal solution and the worst solution of the feature indicators.
[0075] S403. Based on the feature weight of each preset region feature, calculate the distances between the preset region feature datasets of each sub-geographical region and the optimal solution and the worst solution of the feature data respectively, and obtain the calculation results. For example, the Euclidean distance can be used to calculate the distance.
[0076] S404. Obtain the relative closeness of each sub-geographical region according to the calculation results, and obtain the regional score of each sub-geographical region according to the relative closeness of each sub-geographical region.
[0077] As described above, by setting several preset regional features within a sub-geographical region and collecting corresponding data sets, and performing a series of processes on the collected feature data sets, the weight of each preset regional feature is also introduced to calculate the regional score of each sub-geographical region, making the obtained regional score more reasonable and accurate, thereby finding the best target object capacity allocation scheme, achieving more scientific and precise resource allocation, and at the same time solving the problem of complex capacity management.
[0078] S500. According to the position information of the existing target objects within each sub-geographical region, calculate the minimum distance between the target objects within each sub-geographical region, and perform position allocation with the minimum distance for the target objects according to the corresponding target object allocation quantity.
[0079] Specifically, the S500 step includes the following steps:
[0080] S501. For any sub-geographical region, when the number of existing target objects within the sub-geographical region is 1, set the minimum distance between the target objects within the sub-geographical region to null, and perform random position allocation according to the target object allocation quantity; it can be understood that when there are no target objects within the sub-geographical region, the minimum distance is also set to null.
[0081] S502. When the number of existing target objects within the sub-geographical region is greater than 1, calculate the distance between every two target objects within the sub-geographical region according to the longitude and latitude coordinates of each target object, and obtain a number of distances.
[0082] S503. Obtain the median distance according to the number of distances, and use the median distance as the minimum distance between the target objects within the sub-geographical region to perform position allocation with the minimum distance for the target objects according to the target object allocation quantity. For example, when an additional target object is added within the target geographical region, it is required that the updated median distance is consistent with the minimum distance.
[0083] As described above, by using the median distance within the sub-geographical region as the minimum distance, it represents the average distance between each target object within the sub-geographical region, that is, the calculated minimum grid distance. When it is required to add target objects within the sub-geographical region, it is required that the updated median distance is also the minimum distance. That is, it provides distance reference information for the position allocation of target objects and can allocate the reasonable capacity of target objects.
[0084] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one segment of program related to a method for implementing a method in the method embodiment. The at least one instruction or the at least one segment of program is loaded and executed by the processor to implement the target object allocation method provided in the above embodiment.
[0085] An embodiment of the present invention further provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0086] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.
Claims
1. A method for allocating a target object, characterized in that The method includes the following steps: Analyze and process the historical data corresponding to each preset impact feature of each given geographical area collected, and screen out several target impact features; the preset impact feature is a feature that is preset to affect the quantity allocation of target objects; Based on the historical data corresponding to several target impact features and the corresponding target object quantities, construct a time series data set in a sliding window manner to train a preset random forest model to obtain a target random forest model, and adjust the prediction result interval according to the prediction results of each decision tree in the preset random forest model; Input the data of each target impact feature of the target geographical area collected within a preset historical time period into the target random forest model, and output the predicted quantity of target objects that meet the adjusted prediction result interval; Based on several preset regional features, obtain the preset regional feature data set of each sub-geographical area within the target geographical area, and calculate the regional score of each sub-geographical area, so as to calculate the allocated quantity of target objects for each sub-geographical area according to the predicted quantity of target objects output and the weight of the regional score of each sub-geographical area; According to the position information of the existing target objects in each sub-geographical area, calculate the minimum distance between the target objects in each sub-geographical area, and perform position allocation with the minimum distance for the target objects according to the corresponding allocated quantity of target objects.
2. The allocation method of the target object according to claim 1, wherein Screen out several target impact features through the following steps: Perform preprocessing and normalization processing on the historical data corresponding to each preset impact feature to obtain several target data corresponding to each preset impact feature; According to the several target data corresponding to each preset impact feature, calculate the Pearson correlation coefficient between each preset impact feature and the quantity of target objects in the target geographical area; Screen out each preset impact feature whose corresponding Pearson correlation coefficient is greater than the preset Pearson correlation coefficient threshold and all of them are used as target impact features.
3. The allocation method of the target object according to claim 2, wherein Determine the preset Pearson correlation coefficient threshold through the following steps: S1031, according to the given initial impact feature library, calculate the target Pearson correlation coefficient between each initial impact feature in the initial impact feature library and the quantity of target objects in the target geographical area, and obtain several target Pearson correlation coefficients; S1032, perform curve fitting on the several target Pearson correlation coefficients and the quantity of the initial impact features corresponding to each target Pearson correlation coefficient to obtain a quantity-coefficient relationship curve function; S1033, according to the preset impact feature quantity threshold, determine the target Pearson correlation coefficient corresponding to the impact feature quantity threshold based on the quantity-coefficient relationship curve function, and determine the target Pearson correlation coefficient as the preset Pearson correlation coefficient threshold.
4. The allocation method of the target object according to claim 1, characterized in that Construct a time series data set through the following steps: According to the historical data corresponding to each target impact feature, divide several historical sub-data sets by year; Taking the time order from front to back as the window sliding direction, determine a sample by taking the historical sub-data set corresponding to any year and the quantity of target objects corresponding to the next year of the any year; Construct a time series data set based on the determined several samples.
5. The allocation method of the target object according to claim 1, characterized in that, The method further includes the following steps: When predicting the number of target objects in the next m years, for any target impact feature, when obtaining the training data corresponding to the j-th year of the target impact feature, the data corresponding to the target impact feature in the j-th year meets the following conditions: X j = 1 / k(X j-1 + X j-2 + …… + X j-k ), where X j is the data corresponding to the target impact feature in the j-th year, k is the preset number-of-years threshold, and m > 1.
6. The allocation method of the target object according to claim 1, characterized in that, The adjustment of the prediction result interval according to the prediction results of each decision tree in the preset random forest model includes the following steps: According to the prediction results of several decision trees in the preset random forest model, extract the first preset percentile and the second preset percentile to determine the initial prediction interval; According to the change trend of the number of target objects and in combination with the historical correction records of the preset random forest model, adjust the first preset percentile and the second preset percentile to obtain the target prediction interval, so as to complete the adjustment of the prediction result interval.
7. The allocation method of the target object according to claim 1, characterized in that The regional score of each sub-geographical area is obtained through the following steps: According to the preset regional feature data set of each sub-geographical area, determine the feature weights of each preset regional feature; Construct the optimal solution of feature data and the worst solution of feature data according to the data corresponding to each preset regional feature; Based on the feature weights of each preset regional feature, calculate the distances between the preset regional feature data sets of each sub-geographical area and the optimal solution of feature data and the worst solution of feature data respectively, and obtain the calculation results; Obtain the relative proximity of each sub-geographical area according to the calculation results, and obtain the regional score of each sub-geographical area according to the relative proximity of each sub-geographical area.
8. The allocation method of the target object according to claim 1, characterized in that The calculation of the minimum distance between target objects in each sub-geographical area according to the position information of the existing target objects in each sub-geographical area includes the following steps: For any sub-geographical area, when the number of existing target objects in the sub-geographical area is 1, set the minimum distance between target objects in the sub-geographical area to null, and perform random position allocation according to the target object allocation quantity; When the number of existing target objects in the sub-geographical area is greater than 1, calculate the distances between every two target objects in the sub-geographical area according to the longitude and latitude coordinates of each target object, and obtain several distances; Obtain the median distance according to the several distances, and use the median distance as the minimum distance between target objects in the sub-geographical area, so as to perform position allocation of the minimum distance for the target objects according to the target object allocation quantity.
9. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program is loaded and executed by the processor to implement the method for allocating target objects as described in any one of claims 1-8.
10. An electronic device, characterized in that, It includes a processor and the non-transitory computer-readable storage medium described in claim 9.