A method for selecting a distribution center for rural e-commerce logistics

By combining data visualization, deep learning and reinforcement learning methods, the location selection of distribution centers is optimized, and the problems of high transportation and transportation costs and low efficiency in distribution centers are solved in rural areas, achieving a more efficient and accurate distribution center location. choose.

CN114022069BActive Publication Date: 2024-12-06SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111277102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-12-06
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

The existing distribution center site selection method has problems such as high transportation and transportation costs and low distribution efficiency in rural areas, especially due to poor local optimization capabilities and lack of global information processing.

Method used

Combined with data visualization, deep learning and reinforcement learning, by preprocessing data, establishing cost calculation models, visualizing data, building deep networks and reinforcement learning modules, optimize the location of the distribution center to reduce transportation and transportation costs and improve distribution efficiency.

Benefits of technology

It realizes the rapid and accurate search of the best distribution center location, reduces the transportation and transportation costs of the distribution process, improves the distribution efficiency, and is better than the solution speed and accuracy of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114022069B_ABST
    Figure CN114022069B_ABST
Patent Text Reader

Abstract

The present invention provides a distribution center site selection method for rural e-commerce logistics. The method uses ViT and A2C as the basic distribution center site selection method, and establishes a relatively complete cost calculation model to better evaluate the advantages and disadvantages of distribution center site selection, thereby ensuring the efficiency and accuracy of distribution center site selection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of site selection for distribution centers of e-commerce logistics, and more specifically, to a method for site selection for distribution centers of rural e-commerce logistics. Background Art

[0002] In recent years, with the popularization of the Internet in rural areas and towns, the craze for online shopping has gradually begun to spread and heat up. More and more farmers will not only buy daily necessities through the Internet, but also increase their sales channels through the Internet platform. However, the current development of the rural e-commerce logistics industry is not enough to keep up with the growing demand for online shopping. For example, most rural areas have a series of problems such as unreasonable distribution centers, backward infrastructure construction such as roads, and imperfect logistics systems. A good distribution center site selection can greatly reduce the traffic and transportation costs of the distribution process, reduce time costs and improve distribution efficiency, and plays a key role in the development of rural e-commerce logistics. The present invention is oriented to the infrastructure construction of rural e-commerce logistics, and mainly solves the problem of site selection for distribution centers in rural e-commerce logistics.

[0003] A distribution center is defined as a logistics node in the logistics supply chain. Its main functions include cargo deployment (collection, processing, sorting, picking, and distribution) and planning and organizing the delivery of goods to downstream users. The rationality of the location of a distribution center affects the timeliness and economic benefits of logistics. Therefore, efficient and reasonable search for distribution centers has become a widespread issue. At present, the location selection methods of distribution centers can be roughly divided into the following two categories: (1) discrete location selection method; (2) continuous location selection method. Discrete location selection method can quickly solve the problem by discretely processing the solution target. Commonly used methods include exhaustive method, greedy method, hill climbing method, simulated annealing algorithm, genetic algorithm and ant colony algorithm. Since the discrete location selection method needs to adopt certain rules to cut the target domain, its solution results largely depend on the granularity of the rules; the continuous location selection method uses the sum of the construction cost of the distribution center and the distribution cost as the objective function, and uses different methods to solve the parameters of the minimized objective function. Commonly used methods include differential evolution (DE) algorithm, particle swarm optimization (PSO) algorithm, covariance matrix adaptive evolution strategy (CMA-ES) algorithm, etc. These optimization algorithms have a fairly fast speed of approaching the optimal solution and can effectively optimize the location of the distribution center, but because their essence is still based on sampling, their local optimization ability is poor.

[0004] Based on the above problems, the present invention provides a distribution center location selection algorithm that combines data visualization, deep learning and reinforcement learning, which is used to quickly and accurately find the best location of the distribution center. The algorithm uses data visualization to represent global information, and uses a deep neural network to learn the positional relationship between points and the weight information of the points under the global situation. Using this information, the solution effect of reinforcement learning is better than the above-mentioned location selection method that does not use global information. In addition, the knowledge learned by deep learning and reinforcement learning models is empirical. In the context of solving several location selection problems, it can use the learned parameters to quickly solve the problem, and the speed is better than the above-mentioned location selection method. Summary of the invention

[0005] The present invention provides a method for selecting a distribution center site for rural e-commerce logistics. The address selected by this method can significantly reduce the traffic and transportation costs of the distribution process, reduce the time cost and improve the distribution efficiency.

[0006] In order to achieve the above technical effects, the technical solution of the present invention is as follows:

[0007] A method for selecting a distribution center for rural e-commerce logistics includes the following steps:

[0008] S1: Preprocess the dataset used;

[0009] S2: Using the data obtained in step S1 to establish a cost calculation model;

[0010] S3: Visualize the data obtained in step S1;

[0011] S4: For the data graph obtained in step S3, a deep network module is built to extract its features;

[0012] S5: For the features of the data graph obtained in step S4, build a reinforcement learning module and use the features as input, and output the distribution center address set A of coordinates that minimize the cost C.

[0013] Furthermore, the specific process of step S1 is:

[0014] S11: filtering the record rows of the address field in the data set, removing the record rows with empty addresses in the address field, marking the record rows with mixed addresses in the address field, and retaining the record rows with correct addresses in the address field;

[0015] S12: converting the address field in the data set into longitude and latitude coordinates, using a scripting language to call the address resolution API provided by the network map, batch converting the longitude and latitude coordinates of the address field and adding them to the longitude and latitude fields of the data set;

[0016] S13: filter the record rows of the longitude and latitude coordinate fields in the data set, remove the records whose longitude and latitude coordinates are offset beyond the region boundary in the record rows marked in S11, and perform special processing on all other records whose longitude and latitude coordinates are offset beyond the region boundary—randomly generate longitude and latitude coordinates within the region boundary to replace the offset coordinates parsed by the API;

[0017] S14: Coefficientize the fields related to delivery difficulty in the data set, and coefficientize the fields such as weight and business type of the data set, that is, divide the data into segments according to the data value range of this field, and set corresponding weights. In addition, add a field to indicate traffic difficulty according to different road conditions, and set different difficulty coefficients.

[0018] Furthermore, the process of step S2 is:

[0019] The cost calculation of distribution is mainly composed of two parts: one is the time spent by the staff on the given route, which is recorded as the travel time; the other is the time spent by the staff on the delivery operation at the work site, which is recorded as the delivery time; the travel time involves three factors: the distance, travel speed, weight and traffic difficulty of the given route; the delivery time involves the number of packages and the business type coefficient, and these coefficients are converted into hours using expert consultation and experience estimation; the given route is solved by the TSP solver concord, and the Manhattan distance is used to calculate the distance;

[0020] Let the set of all distribution centers be A = {a1, a2, ..., a i ,...}, the set of staff in each distribution center is W = {w1,w2,...,w i ,...}, the set of all the places that the staff needs to deliver in one day, including the distribution center, is P = {p1,p2,...,p i ,...}, let the given optimal path be R. Since the staff needs to return to the distribution center after delivery, |P|+1=|R|, and the cost formula is as follows:

[0021]

[0022] Point p and point q belong to the same set P, and point q is the next neighbor of p in the optimal path R, d pq is the Manhattan distance between point p and point q, V pq is the moving speed of the staff between point p and point q, which is calculated by formula (2):

[0023]

[0024] Among them, t pqIt represents the traffic difficulty coefficient of the path from point p to point q. The traffic difficulty coefficient of a specific path can be set in different ways. v is the standard speed when the traffic difficulty is 1, which is set to 15km / h here.

[0025] The goal of the problem is to find a set A = {a1, a2, ..., a i ,...}, that is, select the appropriate addresses of |A| distribution centers to minimize the cost and C.

[0026] Furthermore, the process of step S3 is:

[0027] The color of each point is colored according to the weight of the items that need to be delivered to the distribution location. The darker the color, the heavier the item. Suppose the size of the visualized image is w*h, where w is the width of the image and h is the height of the image. The visualized image is called a data graph.

[0028] Furthermore, in step S4, the visual self-attention transform network ViT is used to learn the relationship between each point. The self-attention mechanism of the visual self-attention transform network ViT is shown in formula (3):

[0029]

[0030] Using three trainable parameter matrices W q , W k and W v Multiply the input image matrix to get the query vector Q, key vector K and value vector V respectively. Use Q and K T Multiply them to calculate their similarity, and finally multiply them with V to get their scores. d is the dimension of vector Q. The division here is to control the variance of the data and avoid the vanishing gradient during the back propagation process.

[0031] In the Visual Self-Attention Transformer Network ViT model, the image of size w*h is not directly used as input, but the image is first divided into N patches of size p*q, where N = w*h / p 2 , respectively, stitch together the pixels of all channels of each patch, and then use formula (3) to perform self-attention calculation. This process can extract the features of the data graph. During the network training process, the visual self-attention transformation network ViT will gradually pay attention to the relationship between each point in the image and the characteristics of color depth. The gradient loss function used for network back propagation will be given in step S5;

[0032] The specific process of step S4 is:

[0033] S31: Divide the data image into 24 100*100 patches, concatenate all pixels of each patch, and reduce the dimension to 10000*1. Then input each patch into a linear network to reduce its dimension to 256. Position encoding is performed on these vectors after dimension reduction, that is, position information is added to these vectors in sequence.

[0034] S32: The vector obtained in S31 is input into the Transformer for self-attention calculation. The Transformer includes a stack of 6 encoders. Each encoder consists of a self-attention layer and a feedforward layer. When the vector is input into the encoder, it first enters the linear network in the self-attention layer to obtain three vectors Q, K, and V. The intermediate result is calculated using formula (3). In the feedforward layer of the encoder, the intermediate result and the vector obtained in S31 are added as input to obtain the self-attention code. The self-attention code and the intermediate result calculated by formula (3) are added as the input of the next encoder until the sixth encoder outputs the final self-attention code.

[0035] S33: The self-attention code obtained in S32 is input into the linear network layer to obtain the final feature vector.

[0036] Further, in step S5, reinforcement learning includes five basic elements, namely, Environment, Agent, State, Action and Reward; Agent interacts with Environment by selecting Action through the current State, after which Agent will get Reward, and State will also change due to the action; the data graph in step S4 is taken as Environment, and the data graph features and the position of Agent are taken as State; the distribution center is taken as Agent, and the Actions it takes are moving to the east, west, south, north, southwest, northwest, southeast and northeast and staying still, a total of 9 actions; Reward is obtained by taking the inverse of the result calculated by formula (1). The network architecture used by the reinforcement learning module is the dominant action review algorithm A2C, which is derived from the action review algorithm AC. Like AC, A2C uses the policy gradient, that is, the reward of the trajectory is used to adjust the probability of the trajectory appearing. The policy gradient of A2C is as shown in formula (4):

[0037]

[0038] t represents the time step, s t represents the environmental state at time t, i.e., the data graph feature extracted in step S4, a trepresents the action selected at time t, π θ (a t |s t ) means in state s t Take action a t The probability of A t =r t +γV(s t-1 )-V(s t ) represents the advantage function, where r t represents the reward obtained at time t, γ is the discount factor, V(s t ) represents the state s t The expected return value under is used to measure the state, that is, the location of the distribution center. It can be seen that if A t If it is greater than 0, it means action a t Better than the average action, otherwise worse than the average action; Using formula (4) to update the gradient of the deep network module and the reinforcement learning module will better extract features and make the actions taken by the agent better and better; The network architecture of A2C consists of two parts, one is the Actor, which is used to select strategies; the other is the Critic, which is used to evaluate the expected reward value under a certain state and the environment state s t Inputting the Actor module will get action a t , input the Critic module to get the state s t The expected return value V(s t );

[0039] The specific process of step S5 is:

[0040] S51: For the feature vector output in step S4, input it to the Actor network and the Critic network to obtain the probability vector and expected reward value of each action. Both networks are composed of multi-layer perceptrons (MLPs). The probability vector of the action is normalized using the Softmax function, and the action with the highest probability is selected for output;

[0041] S52: For the action outputted by S51, execute the action to change the coordinates of the distribution center, calculate the cost of the new distribution center location by equation (1), and take the opposite of the cost as the reward;

[0042] S53: For the reward output in S52 and the expected return value obtained in S51, use them as r t and V(s t ), combined with the action probability vector in S51, use formula (4) to calculate the gradient and perform gradient descent on the network.

[0043] Preferably, p and q are both 100; w is 600, and h is 400.

[0044] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0045] The basic feature of the present invention is that it uses ViT and A2C as the basis for the distribution center site selection method, and at the same time establishes a relatively complete cost calculation model to better evaluate the advantages and disadvantages of the distribution center site selection, thereby ensuring the efficiency and accuracy of the distribution center site selection. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION

[0047] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0048] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0049] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0050] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0051] like Figure 1 As shown, a method for selecting a distribution center for rural e-commerce logistics includes the following steps:

[0052] S1: Preprocess the dataset used;

[0053] S2: Using the data obtained in step S1 to establish a cost calculation model;

[0054] S3: Visualize the data obtained in step S1;

[0055] S4: For the data graph obtained in step S3, a deep network module is built to extract its features;

[0056] S5: For the features of the data graph obtained in step S4, build a reinforcement learning module and use the features as input, and output the distribution center address set A of coordinates that minimize the cost C.

[0057] The specific process of step S1 is:

[0058] S11: filtering the record rows of the address field in the data set, removing the record rows with empty addresses in the address field, marking the record rows with mixed addresses in the address field, and retaining the record rows with correct addresses in the address field;

[0059] S12: converting the address field in the data set into longitude and latitude coordinates, using a scripting language to call the address resolution API provided by the network map, batch converting the longitude and latitude coordinates of the address field and adding them to the longitude and latitude fields of the data set;

[0060] S13: filter the record rows of the longitude and latitude coordinate fields in the data set, remove the records whose longitude and latitude coordinates are offset beyond the region boundary in the record rows marked in S11, and perform special processing on all other records whose longitude and latitude coordinates are offset beyond the region boundary—randomly generate longitude and latitude coordinates within the region boundary to replace the offset coordinates parsed by the API;

[0061] S14: Coefficientize the fields related to delivery difficulty in the data set, and coefficientize the fields such as weight and business type of the data set, that is, divide the data into segments according to the data value range of this field, and set corresponding weights. In addition, add a field to indicate traffic difficulty according to different road conditions, and set different difficulty coefficients.

[0062] The process of step S2 is:

[0063] The cost calculation of distribution is mainly composed of two parts: one is the time spent by the staff on the given route, which is recorded as the travel time; the other is the time spent by the staff on the delivery operation at the work site, which is recorded as the delivery time; the travel time involves three factors: the distance, travel speed, weight and traffic difficulty of the given route; the delivery time involves the number of packages and the business type coefficient, and these coefficients are converted into hours using expert consultation and experience estimation; the given route is solved by the TSP solver concord, and the Manhattan distance is used to calculate the distance;

[0064] Let the set of all distribution centers be A = {a1, a2, ..., a i ,...}, the set of staff in each distribution center is W = {w1,w2,...,w i ,...}, the set of all the places that the staff needs to deliver in one day, including the distribution center, is P = {p1,p2,...,p i ,...}, let the given optimal path be R. Since the staff needs to return to the distribution center after delivery, |P|+1=|R|, and the cost formula is as follows:

[0065]

[0066] Point p and point q belong to the same set P, and point q is the next neighbor of p in the optimal path R, d pq is the Manhattan distance between point p and point q, V pqis the moving speed of the staff between point p and point q, which is calculated by formula (2):

[0067]

[0068] Among them, t pq It represents the traffic difficulty coefficient of the path from point p to point q. The traffic difficulty coefficient of a specific path can be set in different ways. v is the standard speed when the traffic difficulty is 1, which is set to 15km / h here.

[0069] The goal of the problem is to find a set A = {a1, a2, ..., a i ,...}, that is, select the appropriate addresses of |A| distribution centers to minimize the cost and C.

[0070] The process of step S3 is:

[0071] The color of each point is colored according to the weight of the items that need to be delivered to the distribution location. The darker the color, the heavier the item. Suppose the size of the visualized image is w*h (in this implementation, w is 600 and h is 400), where w is the width of the image and h is the height of the image. The visualized image is called a data graph.

[0072] Furthermore, in step S4, the visual self-attention transform network ViT is used to learn the relationship between each point. The self-attention mechanism of the visual self-attention transform network ViT is shown in formula (3):

[0073]

[0074] Using three trainable parameter matrices W q , W k and W v Multiply the input image matrix to get the query vector Q, key vector K and value vector V respectively. Use Q and K T Multiply them to calculate their similarity, and finally multiply them with V to get their scores. d is the dimension of vector Q. The division here is to control the variance of the data and avoid the vanishing gradient during the back propagation process.

[0075] In the ViT model, the image of size w*h is not directly used as input, but the image is first divided into N patches of size p*q (in this embodiment, p and q are both 100), where N = w*h / p 2, respectively, stitch together the pixels of all channels of each patch, and then use formula (3) to perform self-attention calculation. This process can extract the features of the data graph. During the network training process, the visual self-attention transformation network ViT will gradually pay attention to the relationship between each point in the image and the characteristics of color depth. The gradient loss function used for network back propagation will be given in step S5;

[0076] The specific process of step S4 is:

[0077] S31: Divide the data image into 24 100*100 patches, concatenate all pixels of each patch, and reduce the dimension to 10000*1. Then input each patch into a linear network to reduce its dimension to 256. Position encoding is performed on these vectors after dimension reduction, that is, position information is added to these vectors in sequence.

[0078] S32: The vector obtained in S31 is input into the Transformer for self-attention calculation. The Transformer includes a stack of 6 encoders. Each encoder consists of a self-attention layer and a feedforward layer. When the vector is input into the encoder, it first enters the linear network in the self-attention layer to obtain three vectors Q, K, and V. The intermediate result is calculated using formula (3). In the feedforward layer of the encoder, the intermediate result and the vector obtained in S31 are added as input to obtain the self-attention code. The self-attention code and the intermediate result calculated by formula (3) are added as the input of the next encoder until the sixth encoder outputs the final self-attention code.

[0079] S33: The self-attention code obtained in S32 is input into the linear network layer to obtain the final feature vector.

[0080] In step S5, reinforcement learning includes five basic elements, namely, Environment, Agent, State, Action and Reward; Agent interacts with Environment by selecting Action through the current State. After the interaction, Agent will get Reward, and State will also change due to the action; the data graph in step S4 is used as Environment, and the data graph features and the position of Agent are used as State; the distribution center is used as Agent, and the actions it takes are moving to the east, west, south, north, southwest, northwest, southeast and northeast and staying still, a total of 9 actions; Reward is obtained by taking the opposite number of the result calculated by formula (1). The network architecture used by the reinforcement learning module is the dominant action-critic algorithm A2C, which is derived from the action-critic algorithm AC. Like AC, A2C uses the policy gradient, that is, the reward of the trajectory is used to adjust the probability of the trajectory. The policy gradient of A2C is as follows:

[0081]

[0082] t represents the time step, s t represents the environmental state at time t, i.e., the data graph feature extracted in step S4, a t represents the action selected at time t, π θ (a t |s t ) means in state s t Take action a t The probability of A t =r t +γV(s t-1 )-V(s t ) represents the advantage function, where r t represents the reward obtained at time t, γ is the discount factor, V(s t ) represents the state s t The expected return value under is used to measure the state, that is, the location of the distribution center. It can be seen that if A t If it is greater than 0, it means action a t Better than the average action, otherwise worse than the average action; Using formula (4) to update the gradient of the deep network module and the reinforcement learning module will better extract features and make the actions taken by the agent better and better; The network architecture of A2C consists of two parts, one is the Actor, which is used to select strategies; the other is the Critic, which is used to evaluate the expected reward value under a certain state and the environment state s tInputting the Actor module will get action a t , input the Critic module to get the state s t The expected return value V(s t );

[0083] The specific process of step S5 is:

[0084] S51: For the feature vector output in step S4, input it to the Actor network and the Critic network respectively to obtain the probability vector and expected reward value of each action. Both networks are composed of multi-layer perceptrons MLP. The probability vector of the action is normalized using the Softmax function, and the action with the largest probability is selected for output;

[0085] S52: For the action outputted by S51, execute the action to change the coordinates of the distribution center, calculate the cost of the new distribution center location by equation (1), and take the opposite of the cost as the reward;

[0086] S53: For the reward output in S52 and the expected return value obtained in S51, use them as r t and V(s t ), combined with the action probability vector in S51, use formula (4) to calculate the gradient and perform gradient descent on the network.

[0087] The same or similar reference numerals correspond to the same or similar components;

[0088] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present patent.

[0089] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for selecting a distribution center for rural e-commerce logistics, characterized in that: The following steps are involved: S1: Preprocess the dataset used; The specific process of step S1 is: S11: filtering the record rows of the address field in the data set, removing the record rows with empty addresses in the address field, marking the record rows with mixed addresses in the address field, and retaining the record rows with correct addresses in the address field; S12: converting the address field in the data set into longitude and latitude coordinates, using a scripting language to call the address resolution API provided by the network map, batch converting the longitude and latitude coordinates of the address field and adding them to the longitude and latitude fields of the data set; S13: Filter the record rows of the longitude and latitude coordinate fields in the data set, remove the records whose longitude and latitude coordinates are offset beyond the region boundary in the record rows marked in S11, and perform special processing on all other records whose longitude and latitude coordinates are offset beyond the region boundary—randomly generate longitude and latitude coordinates within the region boundary to replace the offset coordinates parsed by the API; S14: Coefficientize the fields related to delivery difficulty in the data set, and coefficientize the weight and business type fields of the data set, that is, segment according to the data value range of this field, and set corresponding weights. In addition, add a field to indicate traffic difficulty according to different road conditions, and also set different difficulty coefficients; S2: Use the data obtained in step S1 to establish a cost calculation model; The process of step S2 is: The cost calculation of distribution is mainly composed of two parts: one is the time spent by the staff on the given route, which is recorded as the travel time; the other is the time spent by the staff on the delivery operation at the work site, which is recorded as the delivery time; the travel time involves three factors: the distance, travel speed, weight and traffic difficulty of the given route; the delivery time involves the number of packages and the business type coefficient, and these coefficients are converted into hours using expert consultation and experience estimation; the given route is solved by the TSP solver concord, and the Manhattan distance is used to calculate the distance; The set of all distribution centers is , the set of staff in each distribution center is , the set of all locations that the staff needs to deliver in one day is , let the given optimal path be , because the staff need to return to the distribution center after delivery, , the cost formula is as follows: (1) Points p and q belong to the same Collection, and point is the optimal path R The next neighbor of For point and Point The Manhattan distance between For point and Point The moving speed of the staff between the two locations is calculated by formula (2): (2) in, Indicates from Click to move to The traffic difficulty coefficient of the path between the points. The traffic difficulty coefficient of a specific path can be set in different ways. is the standard speed when the traffic difficulty is 1, which is set here ; The goal of the problem is to obtain the equation (1) under the above definition. The smallest set , that is, choose the appropriate The address of the distribution center makes the cost and Minimum; S3: Visualize the data obtained in step S1; The process of step S3 is: Color each point according to the weight of the items to be delivered at the delivery location. The darker the color, the heavier the item. Suppose the size of the visualized image is ,in is the width of the image, is the height of the image, and the visualized image is called a data graph; S4: For the data graph obtained in step S3, a deep network module is built to extract its features; In step S4, a visual self-attention transform network ViT is used to learn the relationship between each point. The self-attention mechanism of the visual self-attention transform network ViT is shown in formula (3): (3) Using three trainable parameter matrices , and Multiply the input image matrix to get the query vector , the key vector Sum value vector ,use and Multiply them to calculate their similarity, and finally Multiply them together to find their scores, For vector The dimension of , the division here is to control the variance of the data and avoid the gradient disappearance during the back propagation process; In the Visual Self-Attention Transformation Network ViT model, it is not directly Instead of taking a picture of size directly as input, the picture is first divided into N pieces of size Patch, where , respectively, stitch together the pixels of all channels of each patch, and then use formula (3) to perform self-attention calculation. This process can extract the features of the data graph. During the network training process, the visual self-attention transformation network ViT will gradually pay attention to the relationship between each point in the image and the color depth features. The gradient loss function used for network back propagation will be given in step S5; The specific process of step S4 is: S31: Divide the data image into 24 100*100 patches, concatenate all pixels of each patch, and reduce the dimension to 10000*1. Then input each patch into a linear network to reduce its dimension to 256. Position encoding is performed on these vectors after dimension reduction, that is, position information is added to these vectors in sequence. S32: The vector obtained in S31 is input into the Transformer for self-attention calculation. The Transformer includes a stack of 6 encoders. Each encoder consists of a self-attention layer and a feedforward layer. When the vector is input into the encoder, it first enters the linear network in the self-attention layer to obtain three vectors Q, K, and V. The intermediate result is calculated using formula (3). In the feedforward layer of the encoder, the intermediate result and the vector obtained in S31 are added as input to obtain the self-attention code. The self-attention code and the intermediate result calculated by formula (3) are added as the input of the next encoder until the sixth encoder outputs the final self-attention code. S33: input the self-attention code obtained in S32 into the linear network layer to obtain the final feature vector; S5: Build a reinforcement learning module to obtain the distribution center address set with the coordinates that make the cost calculation model output the minimum cost ; In step S5, reinforcement learning includes five basic elements, namely, Environment, Agent, State, Action and Reward; Agent interacts with Environment by selecting Action through the current State. After the interaction, Agent will get Reward, and State will also change due to the action; the data graph in step S4 is used as Environment, and the data graph features and the position of Agent are used as State; the distribution center is used as Agent, and the Actions it takes are moving to the east, west, south, north, southwest, northwest, southeast and northeast and staying still, a total of 9 actions; Reward is obtained by taking the opposite number of the result calculated by formula (1). The network architecture used by the reinforcement learning module is the dominant action review algorithm A2C, which is derived from the action review algorithm AC. Like AC, A2C uses the policy gradient, that is, the reward of the trajectory is used to adjust the probability of the trajectory appearing. The policy gradient of A2C is as shown in formula (4): (4) represents the time step, Represents at time The environmental state under the condition is the data graph feature extracted in step S4, Representative time Next, select the action. Indicates in status Take action The probability of represents the advantage function, where Represents at time The rewards received are: is the discount factor, Represents in state The expected return value under this condition is used to measure the quality of this state, that is, the location of the distribution center. It can be seen that if If it is greater than 0, it means action Better than the average action, otherwise worse than the average action; using formula (4) to update the gradients of the two networks, the deep network module and the reinforcement learning module, will better extract features and make the actions taken by the agent better and better; The A2C network architecture consists of two parts: Actor, which is used to select strategies; Critic, which is used to evaluate the expected return value under a certain state. Input Actor module will get action , input the Critic module to get the status The expected return value under ; The specific process of step S5 is: S51: For the feature vector output in step S4, input it to the Actor network and the Critic network respectively to obtain the probability vector and expected reward value of each action. Both networks are multi-layer perceptrons MLP. The probability vector of the action is normalized using the Softmax function, and the action with the largest probability is selected for output; S52: For the action output by S51, execute the action to change the coordinates of the distribution center, calculate the cost of the new distribution center location by equation (1), and use the opposite of the cost as the reward; S53: For the reward output in S52 and the expected return value obtained in S51, use them as and , combined with the action probability vector in S51, use formula (4) to calculate the gradient and perform gradient descent on the network.

2. The method for selecting a distribution center for rural e-commerce logistics according to claim 1 is characterized in that: Said is 600, is 400.