Article distribution method and device
Technical Field
The application relates to the technical field of automation, in particular to an article distribution method and device.
Background
At present, with the continuous development of scientific technology, more and more unmanned technologies begin to be popularized, wherein the unmanned selling technology is one of the best-known unmanned technologies. However, in practice, it is found that in the current unmanned vehicle distribution method, the unmanned vehicles generally distribute the corresponding goods in turn according to the task order, so that the goods are accurately delivered. However, the current sequential delivery method often requires a lot of time for delivering the goods, which results in a great reduction in the efficiency of delivering the goods.
Disclosure of Invention
An object of the embodiments of the present application is to provide an article distribution method and apparatus, which can automatically add a distribution task, thereby improving the efficiency of goods distribution.
In a first aspect, an embodiment of the present application provides an article distribution method, which is applied to an unmanned device, and the method includes:
acquiring an initial starting point and end point set according to an initial task, and calculating an initial consumption value according to the initial starting point and end point set;
receiving a temporary task, acquiring a temporary starting point and end point set according to the temporary task, and calculating according to the initial starting point and end point set and the temporary starting point and end point set to obtain a comprehensive average consumption value;
and determining an article distribution path from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the comprehensive average consumption value.
In the implementation process, in the execution process of the article distribution method applied to the unmanned equipment, the starting point and the end point of the initial task can be extracted preferentially according to the received initial task, and the time consumed by the unmanned equipment for distributing the articles or the distance required to travel is calculated according to the starting point and the end point of the initial task; then, the method receives other temporary tasks again on the basis of the initial task, and comprehensively calculates the starting point of the temporary task, the end point of the temporary task, the starting point of the initial task and the end point of the initial task to obtain a time-consuming average value or a distance average value based on the number of tasks; and then judging whether the average consumed time is less than the time consumed by the initial task (or judging whether the average distance is less than the distance required to be traveled by the initial task) or not, so that when the judgment result is yes, a shortest article distribution route is generated according to the starting point of the initial task, the end point of the initial task, the starting point of the temporary task and the end point of the temporary task. By implementing the embodiment, whether a new article distribution task can be added or not can be automatically judged in real time in the process of article distribution by the unmanned equipment, and the new article distribution task is automatically added when the judgment result is yes, so that the unmanned equipment can add the new distribution task under the condition of not influencing the efficiency of the current distribution task, the article distribution capability of the unmanned equipment is improved, and the convenience and the comprehensive efficiency of the unmanned equipment for article distribution are improved.
Further, the step of calculating an initial consumption value according to the initial starting point and end point set comprises:
extracting an initial starting point and an initial end point which are included in the initial starting point and end point set;
and calculating according to the initial starting point and the initial end point to obtain an initial consumption value.
In the implementation process, in the process of calculating the initial consumption value according to the initial starting point and end point set, the method can preferentially extract the initial starting point and the initial end point in the initial starting point and end point set, then calculate the shortest path according to the initial starting point and the initial end point to obtain the required time value or the shortest path for article distribution according to the shortest path, and determine the required time value or the shortest path as the initial consumption value. Therefore, by implementing the implementation mode, the shortest path can be automatically planned according to the task starting point and the task end point of the initial task after the initial task is acquired, and the time consumption value and the distance consumption value of the shortest path are determined after the planning is finished, so that the initial consumption value is minimum and accurate, a judgment basis is provided for subsequent judgment, the judgment accuracy of whether the temporary task is inserted or not is improved, and the goods distribution capacity and the goods distribution comprehensive efficiency are effectively improved.
Further, the step of calculating according to the initial starting point and end point set and the temporary starting point and end point set to obtain a comprehensive average consumption value includes:
extracting a temporary starting point set and a temporary end point set which are included in the temporary starting point and end point set;
calculating a first average consumption value according to the initial starting point and the temporary starting point set, and calculating a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set and the temporary end point set;
taking the sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value.
In the implementation process, the method preferentially extracts the temporary starting point set and the temporary end point set included in the temporary starting point and end point set in the process of obtaining the comprehensive average consumption value by calculating according to the initial starting point and end point set and the temporary starting point and end point set; when a plurality of temporary tasks exist, the temporary starting points and the temporary end points are correspondingly increased, so that a temporary starting point set consisting of a plurality of temporary starting points and a temporary end point set consisting of a plurality of temporary end points are formed; after the temporary starting point set and the temporary end point set are obtained, the method can also determine that the ratio of the shortest paths formed by all the starting points to the total number of tasks is a first average consumption value according to the initial starting point and the temporary starting point set, and then determine that the ratio of the shortest paths formed by all the end points and the last starting point to the total number of tasks is a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set and the temporary end point set; and then taking the sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value. Therefore, by implementing the implementation mode, the average distance consumption value can be obtained according to the first average consumption value corresponding to the starting point set and the second average consumption value corresponding to the end point set, so that the starting point is connected with the starting point, and the end point is connected with the end point, the circulation process of the starting point and the end point again is avoided, the continuous circulation between the starting point and the end point can be avoided by the article distribution route based on the average distance consumption value, and the article distribution efficiency is ensured.
Further, the step of determining the item distribution route from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the integrated average consumption value comprises:
judging whether the comprehensive average consumption value is not larger than the initial consumption value or not;
if so, combining the initial starting point and end point set and the temporary starting point and end point set to obtain a combined starting point and end point set;
and determining an article delivery path according to the combination starting point and end point set.
In the implementation process, in the process of determining the goods distribution route from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the comprehensive average consumption value, the method can preferentially judge whether the comprehensive average consumption value is less than or equal to the initial consumption value; when the comprehensive average consumption value is smaller than or equal to the initial consumption value, combining the initial starting point and end point set and the temporary starting point and end point set to obtain a combined starting point and end point set; and then acquiring the shortest article distribution route according to all the starting and finishing points. Therefore, by implementing the embodiment, whether the article distribution path includes the temporary task or not can be determined according to the size relationship between the initial consumption value and the comprehensive average consumption value, so that the method can ensure that the average consumption value of the article distribution path is minimum, and the article distribution capacity and efficiency are improved as much as possible.
Further, the step of calculating a first average consumption value according to the initial starting point and the temporary starting point set, and calculating a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set, and the temporary end point set includes:
determining a task quantity value according to the initial starting point and end point set and the temporary starting point and end point set;
determining a first minimum total consumption value among all nodes according to the initial starting point and the temporary starting point set, and taking the ratio of the first minimum total consumption value to the task quantity value as a first average consumption value;
acquiring a last starting point corresponding to the first minimum total consumption value from the initial starting point and the temporary starting point set;
and determining a second minimum total consumption value among all nodes according to the last starting point, the initial end point and the temporary end point set, and taking the ratio of the second minimum total consumption value to the task quantity value as a second average consumption value.
In the implementation process, in the process of calculating a first average consumption value according to the initial starting point and the temporary starting point set and calculating a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set and the temporary end point set, the method can preferentially determine the task quantity value according to the initial starting point end point set and the temporary starting point end point set; then determining a first minimum total consumption value among all nodes according to the initial starting point and the temporary starting point set, and taking the ratio of the first minimum total consumption value to the task quantity value as a first average consumption value; then, acquiring a last starting point corresponding to the first minimum total consumption value from the initial starting point and the temporary starting point set; and determining a second minimum total consumption value among all nodes according to the last starting point, the initial end point and the temporary end point set, and taking the ratio of the second minimum total consumption value to the task quantity value as a second average consumption value. Therefore, by implementing the implementation mode, the average measurement can be determined according to the task quantity value, so that the first average consumption value and the second average consumption value can be accurately acquired, the subsequent judgment can be more accurate and stable, and the finally acquired article distribution path is accurate.
A second aspect of an embodiment of the present application provides an article dispensing device, including:
the acquisition unit is used for acquiring an initial starting point and end point set according to the initial task;
the first calculation unit is used for calculating an initial consumption value according to the initial starting point and end point set;
the receiving unit is used for receiving the temporary task and acquiring a temporary starting point and end point set according to the temporary task;
the second calculation unit is used for calculating according to the initial starting point and end point set and the temporary starting point and end point set to obtain a comprehensive average consumption value;
and the distribution path determining unit is used for determining an article distribution path from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the comprehensive average consumption value.
In the implementation process, the article distribution device may obtain an initial starting point and end point set according to an initial task through the obtaining unit; calculating an initial consumption value according to the initial starting point and end point set by a first calculating unit; then receiving the temporary task through a receiving unit and acquiring a temporary starting point and end point set according to the temporary task; after the initial starting point and end point set and the temporary starting point and end point set are obtained, calculating according to the initial starting point and end point set and the temporary starting point and end point set through a second calculating unit to obtain a comprehensive average consumption value; and finally, determining the delivery path of the goods from the initial starting point and end point set and the temporary starting point and end point set by a delivery path determining unit according to the initial consumption value and the comprehensive average consumption value. By implementing the embodiment, the article delivery device can realize accurate acquisition of the article delivery path through the cooperative work of the plurality of units, and the article delivery device can also improve the working quality and the working efficiency through respective targeted work of the plurality of units, so that the accurate article delivery path is obtained; on the other hand, by implementing the embodiment, whether a new article distribution task can be added or not can be automatically judged in real time in the process of article distribution by the unmanned equipment, and the new article distribution task is automatically added when the judgment result is yes, so that the unmanned equipment can add the new distribution task under the condition of not influencing the efficiency of the current distribution task, the article distribution capability of the unmanned equipment is improved, and the convenience and the comprehensive efficiency of the unmanned equipment for article distribution are improved.
Further, the first calculation unit includes:
the first subunit is used for extracting an initial starting point and an initial end point which are included in the initial starting point and end point set;
and the second subunit is used for calculating according to the initial starting point and the initial end point to obtain an initial consumption value.
In the implementation process, the first calculating unit may extract an initial starting point and an initial end point included in the initial starting point and end point set by the first sub-unit; and then, calculating according to the initial starting point and the initial end point by the second subunit to obtain an initial consumption value. Therefore, by implementing the implementation mode, the shortest path can be automatically planned according to the task starting point and the task end point of the initial task after the initial task is acquired, and the time consumption value and the distance consumption value of the shortest path are determined after the planning is finished, so that the initial consumption value is minimum and accurate, a judgment basis is provided for subsequent judgment, the judgment accuracy of whether the temporary task is inserted or not is improved, and the goods distribution capacity and the goods distribution comprehensive efficiency are effectively improved.
Further, the second calculation unit includes:
a third subunit, configured to extract a temporary starting point set and a temporary end point set that are included in the temporary starting point and end point set;
a fourth subunit, configured to calculate a first average consumption value according to the initial starting point and the temporary starting point set, calculate a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set, and the temporary end point set, and use a sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value.
In the implementation process, the second calculation unit may extract the temporary starting point set and the temporary end point set included in the temporary starting point and end point set through the third subunit; and then, calculating a first average consumption value according to the initial starting point and the temporary starting point set by the fourth subunit, calculating a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set and the temporary end point set, and taking the sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value. Therefore, by implementing the implementation mode, the average distance consumption value can be obtained according to the first average consumption value corresponding to the starting point set and the second average consumption value corresponding to the end point set, so that the starting point is connected with the starting point, and the end point is connected with the end point, the circulation process of the starting point and the end point again is avoided, the continuous circulation between the starting point and the end point can be avoided by the article distribution route based on the average distance consumption value, and the article distribution efficiency is ensured.
A third aspect of the embodiments of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the article distribution method according to any one of the first aspect of the embodiments of the present application.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions execute the article distribution method according to any one of the first aspect of the embodiments of the present application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flow chart of an article distribution method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of another article distribution method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an article dispensing device according to an embodiment of the present disclosure;
FIG. 4 is a schematic view of another article dispensing device according to an embodiment of the present disclosure;
fig. 5 is a schematic view of an undirected authorization of an article distribution node according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating an article distribution method according to an embodiment of the present disclosure. The article distribution method can be applied to an application scene that the unmanned equipment distributes the articles, and specifically, the article distribution method can judge whether a new parallel task can be added or not in the process that the unmanned equipment has an initial task and distributes the articles according to the initial task, so that the article distribution can continuously and parallelly process a plurality of tasks. Therefore, in the implementation scene, the method can judge whether to add the new task to the article distribution by calculating whether the total average distribution time is increased by the starting point and the end point of the new task, so that the new task is selectively added to the article distribution process, and the purpose of improving the article distribution efficiency is achieved through the operation of simultaneously distributing a plurality of tasks. Wherein, the article distribution method comprises:
s101, acquiring an initial starting point and end point set according to the initial task, and calculating an initial consumption value according to the initial starting point and end point set.
In this embodiment, the initial task is a task in which the unmanned aerial device is performing article delivery.
In this embodiment, the starting task may be a plurality of item distribution tasks, wherein each item distribution task has a starting point and an ending point; it can be seen that the tasks are a general term of the goods delivery tasks, and the number of the goods delivery tasks cannot be limited.
In this embodiment, the initial starting point and ending point set corresponds to one or more article distribution tasks, and when the initial task refers to having one article distribution task, the initial starting point and ending point set will only have one initial starting point and one initial ending point.
In this embodiment, the initial consumption value may be a time consumption value or a distance consumption value calculated according to the initial starting point and ending point set.
For example, the initial starting point and end point set includes only one item delivery task having an initial starting point and an initial end point, where the initial consumption value may be a distance value from the initial starting point to the initial end point of the drone; it may also be the time that the drone needs to spend from an initial starting point to an initial ending point.
In this embodiment, the initial consumption value is a minimum consumption value calculated according to the initial starting point and end point set.
For example, the initial starting point and end point set includes only one item distribution task having an initial starting point and an initial end point, wherein the initial consumption value may be a minimum distance value or a minimum time value between the initial starting point and the initial end point.
S102, receiving the temporary task, acquiring a temporary starting point and end point set according to the temporary task, and calculating according to the initial starting point and end point set and the temporary starting point and end point set to obtain a comprehensive average consumption value.
In this embodiment, the provisional task is used to refer to other tasks that the drone may receive during the performance of the initial task.
In this embodiment, the provisional task may include one or more article distribution tasks, for which the provisional task does not limit the number of article distribution tasks.
In this embodiment, the temporary starting point and end point set corresponds to a temporary task, specifically, the temporary task may include one or more article distribution tasks, and each article distribution task includes a temporary starting point and a temporary end point; it can be seen that the number of the temporary starting points and the temporary ending points included in the set of temporary starting points and the temporary ending points is determined by the number of the article distribution tasks, and when there is only one article distribution task, the set of temporary starting points and the temporary ending points includes one temporary starting point and one temporary ending point.
In this embodiment, the initial starting point and end point set and the temporary starting point and end point set may include an initial starting point, an initial end point, a temporary starting point and a temporary end point, and thus the integrated average consumption value may be a ratio of a shortest path connecting the initial starting point, the initial end point, the temporary starting point and the temporary end point to the number of the goods distribution tasks.
In this embodiment, the integrated average consumption value is used to represent a time or distance value that is consumed by all tasks after the initial task and the provisional task are combined together.
And S103, determining an article distribution route from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the comprehensive average consumption value.
In this embodiment, whether a new article distribution route needs to be determined is determined according to the magnitude relationship between the initial consumption value and the integrated average consumption value.
In this embodiment, the initial consumption value being greater than the integrated average consumption value indicates that the efficiency of article distribution is improved; otherwise, the efficiency of the goods distribution is equal or reduced.
In this embodiment, the process of determining the article distribution route from the initial starting point and end point set and the temporary starting point and end point set may be understood as a process of determining the shortest article distribution route according to all the starting points and all the end points.
In this embodiment, the main body of the method may be a computing device such as a computer and a server for controlling the unmanned aerial vehicle, and this embodiment is not limited at all.
In this embodiment, the execution subject of the method may also be a smart device such as a smart phone and a tablet for controlling the unmanned device, which is not limited in this embodiment.
In this embodiment, the main execution body of the method may also be an unmanned device body.
It can be seen that, with the article distribution method described in fig. 1, the starting point and the end point of the initial task can be preferentially extracted according to the received initial task, and the time consumed for the unmanned equipment to distribute the articles or the distance to be traveled can be calculated according to the starting point and the end point of the initial task; then, the method receives other temporary tasks again on the basis of the initial task, and comprehensively calculates the starting point of the temporary task, the end point of the temporary task, the starting point of the initial task and the end point of the initial task to obtain a time-consuming average value or a distance average value based on the number of tasks; and then judging whether the average consumed time is less than the time consumed by the initial task (or judging whether the average distance is less than the distance required to be traveled by the initial task) or not, so that when the judgment result is yes, a shortest article distribution route is generated according to the starting point of the initial task, the end point of the initial task, the starting point of the temporary task and the end point of the temporary task. By implementing the embodiment, whether a new article distribution task can be added or not can be automatically judged in real time in the process of article distribution by the unmanned equipment, and the new article distribution task is automatically added when the judgment result is yes, so that the unmanned equipment can add the new distribution task under the condition of not influencing the efficiency of the current distribution task, the article distribution capability of the unmanned equipment is improved, and the convenience and the comprehensive efficiency of the unmanned equipment for article distribution are improved.
Example 2
Referring to fig. 2, fig. 2 is a schematic flow chart of another article distribution method according to an embodiment of the present application. The flow diagram of the item distribution method depicted in fig. 2 is modified from the flow diagram of the item distribution method depicted in fig. 1. In this embodiment, all the starting points and the end points described in the method can be simplified into nodes on a graph, a connection line between two nodes is used for expressing that a road exists between the starting point and the end point, and a corresponding consumption value (the consumption value is a minimum consumption value) is marked on the connection line, wherein the consumption value can be a distance consumption value or a time consumption value; based on this mapping method, the method can preferentially determine a distribution task map formed by all the starting points and the end points, and then execute the following method in the distribution task map (unauthorized directed map). Wherein, the article distribution method comprises:
s201, acquiring an initial starting point and end point set according to the initial task, and extracting an initial starting point and an initial end point which are included in the initial starting point and end point set.
In this embodiment, four data lists may be preset in the method, two of the data lists are applied in the method, and the other two data lists are used for filling the starting point and the ending point of the task of delivering unadopted goods by the method.
In this embodiment, the four data lists can be respectively understood as: the starting point list and the end point list which participate in the determination of the item delivery path in the method, and the starting point list and the end point list which do not participate in the determination of the item delivery path in the method are applied to the subsequent execution process of the method, namely, when the method is circulated again after the execution process of the method. When the method is circulated again after the method is executed, the start point list and the end point list that have not participated in the determination of the article distribution path last time will be determined as the start point list and the end point list that participated in the determination of the article distribution path this time. It can be seen that the method can have four data lists.
In the present embodiment, the four data lists described above can be initialized for flushing processing when initially used.
And S202, calculating according to the initial starting point and the initial end point to obtain an initial consumption value.
In this embodiment, when the unmanned vehicle receives an initial task and acquires an initial start point and an initial end point, an initial consumption value T _ curr is calculated, which is equal to a distance value or a time value between the initial start point and the initial end point.
In the embodiment of the present application, when the unmanned vehicle performs article distribution, the unmanned vehicle may move at a constant speed, and the initial consumption value may be represented as a distance value between the initial starting point and the initial ending point, or may be represented as a time value used when the unmanned vehicle moves from the initial starting point to the initial ending point.
In this embodiment, when the unmanned vehicle reaches any initial starting point or initial ending point, the corresponding starting point data or ending point data may be deleted from the data list, so as to facilitate subsequent loop calculation and application.
S203, receiving the temporary task and acquiring a temporary starting point and end point set according to the temporary task.
In this embodiment, a new task request may be accepted during the course of the task of delivering articles by the unmanned aerial vehicle.
In this embodiment, the new task request includes a temporary start point and end point set.
And S204, extracting a temporary starting point set and a temporary end point set which are included in the temporary starting point and end point set.
In this embodiment, the temporary starting point set does not include the initial starting point, and the temporary end point set does not include the initial end point.
In this embodiment, the starting point list in the data list may include an initial starting point and a temporary starting point set; the endpoint list may include an initial endpoint and a set of temporary endpoints.
S205, calculating a first average consumption value according to the initial starting point and the temporary starting point set, and calculating a second average consumption value according to the initial starting point, the initial end point, the temporary starting point set and the temporary end point set.
As an alternative embodiment, the step of calculating the first average consumption value according to the initial starting point and the temporary starting point set, and the step of calculating the second average consumption value according to the initial starting point, the initial ending point, the temporary starting point set and the temporary ending point set may include:
determining a task quantity value according to the initial starting point and end point set and the temporary starting point and end point set;
determining a first minimum total consumption value among all nodes according to the initial starting point and the temporary starting point set, and taking the ratio of the first minimum total consumption value to the task quantity value as a first average consumption value;
acquiring a last starting point corresponding to the first minimum total consumption value from the initial starting point and the temporary starting point set;
and determining a second minimum total consumption value among all nodes according to the last starting point, the initial end point and the temporary end point set, and taking the ratio of the second minimum total consumption value to the task quantity value as a second average consumption value.
By implementing the implementation mode, the average measurement can be determined according to the task quantity value, so that the first average consumption value and the second average consumption value can be accurately acquired, the subsequent judgment can be more accurate and stable, and the finally acquired article distribution path is accurate.
In this embodiment, the first minimum total consumption value is the shortest path or the minimum time consumption between all the starting points; the second minimum total consumption value is the shortest path or minimum time consumption between all end points and the last starting point.
In this embodiment, the number of tasks is N, the first minimum total consumption value is T _ start, the second minimum total consumption value is T _ end, and the first average consumption value may be T _ start/N and the second average consumption value T _ end/N.
And S206, taking the sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value.
In this embodiment, the integrated average consumption value is T _ start/N + T _ end/N.
Referring to fig. 5, fig. 5 is a schematic view illustrating an undirected ownership of an article distribution node according to an embodiment of the present application. As shown in fig. 5, point S is taken as the initial starting point, points D and C represent the temporary starting point of each temporary task, point E represents the initial end point, and points a and B represent the temporary end point of each temporary task, in fig. 5, a connection line between nodes represents that two nodes can be reached, and a weight between nodes may represent a distance value or a time value.
As can be seen from fig. 5, if the initial consumption value T _ curr is a distance value or a time value from the point S to the point E, the initial consumption value T _ curr between S and E can be calculated to be 8 according to the weight value;
firstly, determining the number N of tasks to be 3, that is, one initial task and two temporary tasks, and then, determining the shortest path combination between the starting points by using the initial starting point (point S) as the starting point, and according to the undirected weighted schematic diagram shown in fig. 5, knowing that the shortest path combination between the starting points is S-D-C, then calculating the first minimum total consumption value according to the weight between the nodes shown in fig. 5:
a first minimum consumption total value T _ start of 2+2 of 4;
similarly, the shortest path combination between the end points using C as the starting point is determined by using the last point C in the path combination S-D-C as the starting point, and as can be seen from fig. 5, the shortest path combination between the end points is C-a-B-E, and then the second minimum total consumption value can be calculated according to the weight between the nodes shown in fig. 5:
the second minimum consumption total value T _ end is 2+2+2 is 6;
further, it can be calculated according to the above formula:
the first average consumption value T _ start/N4/3;
a second average consumption value T _ end/N6/3 2;
and finally, calculating the comprehensive average consumption value according to the calculation formula of the comprehensive average consumption value:
the integrated average consumption value is 4/3+2 10/3 ≈ 3.33.
S207, judging whether the comprehensive average consumption value is not greater than the initial consumption value, if so, executing steps S208-S209; if not, the flow is ended.
In this embodiment, the process may be understood as determining whether T _ start/N + T _ end/N is not greater than T _ curr. If so, indicating that the average time of the path is shorter, and adding a new task to the current task process; otherwise, a new task cannot be added, and the starting point and the ending point of the new task can be correspondingly filled by referring to the two additional data lists.
Taking the undirected weighted graph shown in fig. 5 as an example, the initial consumption value T _ curr is calculated to be 8; the integrated average consumption value is 4/3+2 is 10/3 and is approximately equal to 3.33; it may be judged that the integrated average consumption value is not greater than the initial consumption value, and steps S208 to S209 may be performed.
And S208, combining the initial starting point and end point set and the temporary starting point and end point set to obtain a combined starting point and end point set.
In this embodiment, the process may be understood as a summary operation of the start and end points of all the article distribution tasks.
And S209, determining an article delivery route according to the combination starting point and end point set.
In this embodiment, the article delivery route is an optimal route calculated from the start points and the end points of all the article delivery tasks, that is, a new cruising route that the unmanned aerial vehicle will use.
It can be seen that, by implementing the article distribution method described in fig. 2, it can be automatically determined whether a new article distribution task can be added in real time in the process of article distribution by the unmanned device, and when the determination result is yes, the new article distribution task is automatically added, so that the unmanned device can add the new distribution task without affecting the efficiency of the current distribution task, thereby improving the article distribution capability of the unmanned device, and improving the convenience and the comprehensive efficiency of the unmanned device for article distribution.
Example 3
Referring to fig. 3, fig. 3 is a schematic structural diagram of an article dispensing device according to an embodiment of the present application. Wherein, this article dispensing device includes:
an obtaining unit 310, configured to obtain an initial starting point and end point set according to an initial task;
a first calculating unit 320, configured to calculate an initial consumption value according to the initial starting point and end point set;
a receiving unit 330, configured to receive the temporary task and obtain a set of temporary starting points and end points according to the temporary task;
the second calculating unit 340 is configured to calculate according to the initial starting point and end point set and the temporary starting point and end point set to obtain a comprehensive average consumption value;
a distribution path determining unit 350, configured to determine an article distribution path from the initial starting point and end point set and the temporary starting point and end point set according to the initial consumption value and the integrated average consumption value.
In this embodiment, for the explanation of the article dispensing device, reference may be made to the description in embodiment 1 or embodiment 2, and details of this embodiment are not repeated.
It can be seen that, with the article dispensing device described in fig. 3, accurate acquisition of an article dispensing path can be achieved through cooperative work of the plurality of units, and the article dispensing device can also improve work quality and work efficiency through respective targeted work of the plurality of units, so that an accurate article dispensing path is obtained; on the other hand, by implementing the embodiment, whether a new article distribution task can be added or not can be automatically judged in real time in the process of article distribution by the unmanned equipment, and the new article distribution task is automatically added when the judgment result is yes, so that the unmanned equipment can add the new distribution task under the condition of not influencing the efficiency of the current distribution task, the article distribution capability of the unmanned equipment is improved, and the convenience and the comprehensive efficiency of the unmanned equipment for article distribution are improved.
Example 4
Referring to fig. 4, fig. 4 is a schematic structural view of another article dispensing device according to an embodiment of the present application. The schematic illustration of the article dispensing device depicted in FIG. 4 is modified from the schematic illustration of the article dispensing device depicted in FIG. 3. Wherein the first calculating unit 320 includes:
a first subunit 321, configured to extract an initial starting point and an initial end point included in the initial starting point and end point set;
and a second sub-unit 322, configured to perform a calculation according to the initial starting point and the initial ending point to obtain an initial consumption value.
As an alternative implementation, the second computing unit 340 includes:
a third subunit 341, configured to extract a temporary starting point set and a temporary end point set that are included in the temporary starting point and end point set;
a fourth subunit 342, configured to calculate a first average consumption value according to the initial starting point and the temporary starting point set, calculate a second average consumption value according to the initial starting point, the initial ending point, the temporary starting point set, and the temporary ending point set, and take a sum of the first average consumption value and the second average consumption value as a comprehensive average consumption value.
As an alternative embodiment, the delivery path determining unit 350 includes:
a fifth sub-unit 351, configured to determine whether the integrated average consumption value is not greater than the initial consumption value;
a sixth subunit 352, configured to combine the initial starting point and end point set and the temporary starting point and end point set to obtain a combined starting point and end point set when the integrated average consumption value is not greater than the initial consumption value;
a seventh sub-unit 353, configured to determine an item delivery path according to the combination starting point and ending point set.
As an alternative implementation, the fourth sub-unit 342 may specifically be configured to determine a task quantity value according to the initial starting point and end point set and the temporary starting point and end point set; determining a first minimum total consumption value among all nodes according to the initial starting point and the temporary starting point set, and taking the ratio of the first minimum total consumption value to the task quantity value as a first average consumption value; acquiring a last starting point corresponding to the first minimum total consumption value from the initial starting point and the temporary starting point set; and determining a second minimum total consumption value among all nodes according to the last starting point, the initial end point and the temporary end point set, and taking the ratio of the second minimum total consumption value to the task quantity value as a second average consumption value.
In this embodiment, for the explanation of the article dispensing device, reference may be made to the description in embodiment 1 or embodiment 2, and details of this embodiment are not repeated.
It can be seen that, with the article distribution device described in fig. 4, it can be automatically determined whether a new article distribution task can be added in real time during the process of article distribution by the unmanned device, and when the determination result is yes, the new article distribution task is automatically added, so that the unmanned device can add the new distribution task without affecting the efficiency of the current distribution task, thereby improving the article distribution capability of the unmanned device, and improving the convenience and the comprehensive efficiency of the unmanned device for article distribution.
An embodiment of the present application provides an electronic device, including a memory and a processor, where the memory is used to store a computer program, and the processor runs the computer program to make the electronic device execute the article distribution method in embodiment 1 or embodiment 2 of the present application.
An embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions, and when the computer program instructions are read and executed by a processor, the computer program instructions execute the article distribution method in any one of embodiment 1 or embodiment 2 of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.