CN109858698B - Vehicle supply and demand optimization method, device, equipment and storage medium for target area - Google Patents

Vehicle supply and demand optimization method, device, equipment and storage medium for target area Download PDF

Info

Publication number
CN109858698B
CN109858698B CN201910099847.2A CN201910099847A CN109858698B CN 109858698 B CN109858698 B CN 109858698B CN 201910099847 A CN201910099847 A CN 201910099847A CN 109858698 B CN109858698 B CN 109858698B
Authority
CN
China
Prior art keywords
vehicles
hexagonal
users
vehicle
target area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910099847.2A
Other languages
Chinese (zh)
Other versions
CN109858698A (en
Inventor
赵懿
石宽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fabu Technology Co Ltd
Original Assignee
Hangzhou Fabu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fabu Technology Co Ltd filed Critical Hangzhou Fabu Technology Co Ltd
Priority to CN201910099847.2A priority Critical patent/CN109858698B/en
Publication of CN109858698A publication Critical patent/CN109858698A/en
Application granted granted Critical
Publication of CN109858698B publication Critical patent/CN109858698B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a vehicle supply and demand optimization method, a vehicle supply and demand optimization device, vehicle supply and demand optimization equipment and a vehicle supply and demand optimization storage medium, wherein the geographic range of a target area in a spherical hexagonal geographic grid system is obtained, and the geographic range is formed by hexagonal areas in the spherical hexagonal grid system; the vehicle quantity and the user quantity in each hexagonal area are obtained according to a pre-constructed index tree, the total number of vehicles and the total number of users in the geographic range are counted according to the vehicle quantity and the user quantity in each hexagonal area, whether the target area achieves vehicle supply and demand balance or not is judged, and vehicle supply and demand optimization is carried out according to the judgment result. The method can realize the rapid statistics of the number of vehicles and the number of users in the target area, and the statistics of the number of vehicles and the number of users in the target area is realized without judging whether all vehicles and all users maintained by the vehicle management platform are positioned in the target area, so that the efficiency of vehicle supply and demand optimization in the target area is improved.

Description

Vehicle supply and demand optimization method, device, equipment and storage medium for target area
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for optimizing vehicle supply and demand in a target area.
Background
People usually choose to take a taxi when going out in life, or reserve vehicles through a network car booking platform, and the convenience of going out is continuously improved. In order to facilitate traveling of users in different areas and improve vehicle operation profits, the vehicle management platform generally needs to adjust supply and demand of vehicles in different areas.
In the prior art, when optimizing the supply and demand of vehicles in a target area, the number of vehicles in the target area and the number of users required by the vehicles in the area are generally required to be obtained, and then the number of vehicles and the number of users are compared to allocate the vehicles. When the number of vehicles and the number of users in the target area are counted, the positions of all vehicles and the positions of users maintained by the vehicle management platform are generally required to be obtained, then which vehicles and users are located in the target area are sequentially judged, and then counting is performed, so that the counting efficiency of the number of vehicles and the number of users in the target area is low, and the efficiency of vehicle supply and demand optimization in the target area is further reduced.
Disclosure of Invention
The invention provides a vehicle supply and demand optimization method, a vehicle supply and demand optimization device, vehicle supply and demand optimization equipment and a storage medium for a target area, so that the number of vehicles and the number of users in the target area can be rapidly counted, and the vehicle supply and demand optimization efficiency of the target area can be improved.
The first aspect of the invention provides a vehicle supply and demand optimization method for a target area, which comprises the following steps:
acquiring the geographical range of a target area in a spherical hexagonal geographical grid system, wherein the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system;
acquiring the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree, wherein the index tree is constructed according to the unit address codes of bottom layer hexagons of all vehicles and all users in a spherical hexagonal geographic grid system, the root node of the index tree is the top layer hexagonal node of the spherical hexagonal geographic grid system, the leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons comprise vehicle information and user information in the area corresponding to the bottom layer hexagons;
and counting the total number of vehicles and the total number of users in the geographic range according to the number of the vehicles and the number of the users in each hexagonal area, judging whether the target area reaches the vehicle supply and demand balance, and optimizing the vehicle supply and demand according to the judgment result.
A second aspect of the present invention provides a vehicle supply and demand optimization apparatus for a target area, including:
the acquisition module is used for acquiring the geographic range of a target area in a spherical hexagonal geographic grid system, wherein the geographic range is formed by hexagonal areas in the spherical hexagonal grid system;
the statistical module is used for acquiring the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree, wherein the index tree is constructed according to the unit address codes of bottom layer hexagons of all vehicles and all users in a spherical hexagonal geographic grid system, the root node of the index tree is a top layer hexagonal node of the spherical hexagonal geographic grid system, the leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons comprise vehicle information and user information in the area corresponding to the bottom layer hexagons; counting the total number of vehicles and the total number of users in the geographic range according to the number of vehicles and the number of users in each hexagonal area;
and the control module is used for judging whether the target area reaches the vehicle supply and demand balance or not and optimizing the vehicle supply and demand according to the judgment result.
A third aspect of the present invention is to provide a vehicle supply and demand optimization apparatus of a target area, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
A fourth aspect of the present invention is to provide a computer-readable storage medium comprising:
a computer program stored thereon;
which when executed by a processor implements the method according to the first aspect.
According to the vehicle supply and demand optimization method, device, equipment and storage medium for the target area, the geographical range of the target area in the spherical hexagonal geographical grid system is obtained, and the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system; the vehicle quantity and the user quantity in each hexagonal area are obtained according to a pre-constructed index tree, the total number of vehicles and the total number of users in the geographic range are counted according to the vehicle quantity and the user quantity in each hexagonal area, whether the target area achieves vehicle supply and demand balance or not is judged, and vehicle supply and demand optimization is carried out according to the judgment result. The method can realize the rapid statistics of the number of vehicles and the number of users in the target area, and the statistics of the number of vehicles and the number of users in the target area is realized without judging whether all vehicles and all users maintained by the vehicle management platform are positioned in the target area, so that the efficiency of vehicle supply and demand optimization in the target area is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of a truncated icosahedron-based spherical hexagonal geographic grid system;
FIG. 2 is an expanded view of an initial mesh of a truncated icosahedron-based spherical hexagonal geographic grid system;
FIG. 3 is a table of longitude and latitude coordinates corresponding to the centers of the respective faces of FIG. 2;
FIG. 4 is a schematic diagram of a hierarchical subdivision of a hexagonal mesh;
FIG. 5 is a schematic diagram of encoding a hexagonal lattice;
FIG. 6 is a schematic diagram of a hexagonal symmetric coordinate system;
FIG. 7 is a flowchart of a method for optimizing vehicle supply and demand for a target area according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a geographic extent of a target area in a spherical hexagonal geographic grid system;
FIG. 9 is a schematic diagram of an index tree;
FIG. 10 is a flowchart of a method for optimizing vehicle demand and supply for a target area according to another embodiment of the present invention;
FIG. 11 is a block diagram of a vehicle demand and supply optimization apparatus for a target area according to an embodiment of the present invention;
fig. 12 is a block diagram of a vehicle supply and demand optimization device of a target area according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The vehicle supply and demand optimization method for the target area is based on a spherical hexagonal geographic grid system, wherein the spherical hexagonal geographic grid system is a truncated icosahedron spherical hexagonal geographic grid system, the truncated icosahedron comprises 20 regular hexagons and 12 regular pentagons as shown in figure 1, firstly, a truncated regular icosahedron inscribed with the earth can be constructed, and the position of the truncated regular icosahedron relative to the earth is determined; then, the truncated regular icosahedron is unfolded into planes, the unfolded picture and the longitude and latitude corresponding to the center of each plane can be shown in fig. 2 and fig. 3, and the planes are hierarchically split by regular use of regular hexagons with the aperture of 3 (namely, as shown in fig. 4, the area of the nth-level hexagon is 3 times that of the (n + 1) th-level hexagon), wherein the hierarchy can be determined according to actual requirements; and finally, mapping the meshes of all layers onto the spherical surface by utilizing the inverse transform of polyhedral projection (such as the inverse transform of Schneider isometric projection) to complete the construction of the spherical hexagonal meshes.
More specifically, the hierarchical subdivision of the expansion plane is to use a plane composed of 20 regular hexagons and 12 regular pentagons as an initial mesh, and obtain a mesh of a next level with a smaller resolution through subdivision. Wherein, the layer subdivision can be carried out on the unfolding plane according to the subdivision rules as follows: dividing the pentagon of the initial grid to the central point along one vertex, and then dividing the pentagon along the cut to form a hexagon without one corner; only generating 1 hexagonal grid of the next level by 20 hexagonal grids in the initial grid; generating 1 unfilled corner hexagonal grid at the next layer by the center of the unfilled corner hexagonal grid, and generating 5 hexagonal grids at the next layer by five vertexes; if the center of the hexagonal grid is consistent with that of the hexagonal grid of the previous layer, 7 hexagonal grids of the next layer can be generated; if the center of the hexagonal lattice coincides with the vertices of the hexagonal lattice of the previous level, only 1 hexagonal lattice of the next level is generated.
Furthermore, after subdivision is completed, address coding is required to be carried out on the spherical hexagonal grids, and the address coding has integrity, uniqueness and hierarchy. Specifically, the initially expanded hexagon is divided into a central unit and vertex units, then a generation rule is determined, 6 vertex sub-units of the lower layer are generated at the vertices of the hexagon of the central parent unit of each layer, and 1 central sub-unit of the lower layer is generated at the center; and generating a central child unit at the hexagonal center of the vertex parent unit of each layer, wherein in the next-layer subdivision, all the central child units become central parent units, and all the vertex child units become vertex parent units. Generating the rule graph as shown in fig. 5, the encoding scheme may adopt the following scheme: first, the units of different layers are represented by sequentially arranged numbers (code elements), and the address code form of the nth layer is a1a2…an(ai0,1,2,3,4,5,6), and the initial layer hexagonal address code is recorded as 0; second, the central child unit is coded by adding 0 after the address code of its parent unit, and in the vertex child unit, the vertex child unit at the right side (odd level) or the lower right side (even level) of the parent unit is coded by adding 1 after the address code of the parent unit, and then the remaining 5 vertex child unit codes are sequentially added by 2,3,4,5,6 after the address code of the parent unit in a counterclockwise order, and fig. 5 shows an example of the first three layers of codes.
The hierarchical relationship of the grid system can be established by carrying out address coding on grid units, the grid system can organize and express spatial data more conveniently through the address coding, in order to embody the hierarchical characteristics, the units of different layers are expressed by adopting numbers (code elements) which are sequentially arranged, and the formed code element sequence becomes a unit address code. For example, the mesh cell generated by the initial subdivision (n ═ 1) is denoted as a1The cells on the second layer may be denoted as a1a2The cells on the third level are denoted as a1a2a3The cells on the bottom layer are denoted as a1a2a3…aN(N is the maximum subdivision level).
Based on the spherical hexagonal geographic grid system, the adjacent retrieval and hierarchical search of grid cells and a geographic coordinate and spherical hexagonal grid code conversion scheme can be realized. The conversion of the geographic coordinates and the spherical hexagonal grid codes can convert longitude and latitude coordinates or Cartesian geodesic coordinates into unit address codes.
First, a Hexagonal symmetric coordinate system (symmetric Hexagonal Frame) as shown in fig. 6 is constructed, in which coordinate axes in three directions of u, v, and w are defined, and coordinate values (u, v, w) of an arbitrary grid center in the coordinate system, which are also called grid coordinate codes, have a relationship of u + v + w ═ 0, while maintaining symmetry of the Hexagonal network. By establishing a hexagonal lattice coordinate system, a relation is established between the grid cell address code and the Cartesian coordinate by utilizing the grid coordinate code. The origin of coordinates of a cartesian coordinate system is located at the center of the central grid unit, and in the cartesian coordinate system, assuming that the side length of the grid unit is 1, three basis vectors (m) are established with the center of the grid unit as the coordinate center1,m2,m3),m1=(1,0),
Figure BDA0001965418160000051
Figure BDA0001965418160000052
And multiplying the base vector group by the grid coordinate code under the coordinate system to express any plane coordinate point.
For any point P on the spherical surface, the longitude and latitude are (B, L), the maximum subdivision level of the spherical hexagonal grid is N, and the unit address code of the point P can be obtained through the following basic ideas:
1. firstly, by using Schneider projection transformation, the number a of the uppermost layer initial grid where the point P is located can be obtained from the longitude and latitude (B, L)1And the point P corresponds to cartesian coordinates (x, y) in a plane;
2. if point P is among the 12 pentagonal cells of the truncated icosahedron, a is because the pentagonal cell subdivision only produces one pentagonal cell2…an. Are all set to 0, so the address code a is a10…0;
3. If the point P is in the mesh cells of the hexagonal cell subdivision, solving the address code recursion according to the maximum subdivision level N;
4. for the coordinate of the point P in the level i, the distance from the coordinate point to the coordinate origin and the azimuth angle can be utilized to calculate the grid cell where the point P falls in the hexagonal symmetric coordinate system and the address code element a thereofi. If ai-1Is 0, then aiThe code element of (1) is 0,1,, 6, if ai-1 Not 0, then the middle grid ai Take 0, symbols a of the surrounding six gridsiThe solving mode of the value is the same as the hierarchical retrieval of the grid unit;
5. subtracting the coordinate position of the grid unit from the coordinate position to obtain a new point P coordinate (x, y) in the recursive hexagonal symmetric coordinate system;
6. repeating the steps 4 and 5 until the subdivision level i is larger than N; and all the symbols aiThe combination of the connections is the unit address code of point P.
The vehicle supply and demand optimization process for the target area is described in detail below with reference to specific embodiments.
Fig. 7 is a flowchart of a method for optimizing vehicle supply and demand in a target area according to an embodiment of the present invention. The embodiment provides a vehicle supply and demand optimization method for a target area, which comprises the following specific steps:
s101, acquiring the geographical range of a target area in a spherical hexagonal geographical grid system, wherein the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system.
In this embodiment, first, a geographical range of a target area to be subjected to supply and demand optimization in a spherical hexagonal geographical grid system is obtained, as shown in fig. 8, where the geographical range is formed by middle-level hexagons and/or bottom-level hexagons in the spherical hexagonal geographical grid system, and each hexagonal area jointly forms the geographical range of the target area.
S102, acquiring the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree;
the index tree is constructed according to unit address codes of bottom layer hexagons of all vehicles and all users in the spherical hexagonal geographic grid system, the root node of the index tree is a top layer hexagon node of the spherical hexagonal geographic grid system, the leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons comprise vehicle information and user information located in a corresponding area of the bottom layer hexagons.
In this embodiment, it is required to construct an index tree in advance, where the index tree is as shown in fig. 9, where the index tree is constructed according to the unit address codes of the bottom layer hexagons of all vehicles and all users (which may be users required by a utility vehicle) maintained by a vehicle management platform (e.g., a network car reservation platform) in a spherical hexagonal geographic grid system, where a root node of the index tree is any top layer hexagon node of the spherical hexagonal geographic grid system, leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons include vehicle information and user information located in a corresponding area of the bottom layer hexagons, specifically, for example, as shown in fig. 9, the maximum subdivision level is 4, and if the unit address code of a certain vehicle is a1a2a3a4Then the root node of the index tree is a1The intermediate node is in turn a2、a3The last leaf node is a4Then the vehicle information of the vehicle is stored in the leaf node a4In (1). When the vehicle supply and demand optimization of the target area needs to be performed, the number of vehicles and the number of users in each hexagonal area in the geographic range of the target area are counted according to the index tree to obtain the number of vehicles and the number of users, for example, if a certain hexagonal area is a bottom-layer hexagon, namely corresponds to one leaf node, the number of vehicles and the number of users included in the leaf node can be directly counted; for another example, if a certain hexagonal region is a middle-level hexagon, that is, corresponds to one middle node, the number of vehicles and the number of users included in all leaf nodes taking the middle node as a root are counted.
S103, counting the total number of vehicles and the total number of users in the geographic range according to the number of vehicles and the number of users in each hexagonal area, judging whether the target area reaches vehicle supply and demand balance, and optimizing vehicle supply and demand according to the judgment result.
In this embodiment, after counting the number of vehicles and the number of users in each hexagonal area within the geographic range of the target area, summarizing the number of vehicles and the number of users in the target area to obtain the total number of vehicles and the total number of users in the target area, and then optimizing the supply and demand of the vehicles according to the total number of vehicles and the total number of users, specifically, optimizing the supply and demand of the vehicles by using the following process:
s1031, obtaining the ratio of the total number of vehicles in the geographic range to the total number of users;
s1032 is performed if the ratio is greater than 1, and S1033 is performed if the ratio is less than 1.
S1032, if the ratio is larger than 1, sending an assignment command of leaving the target area to the vehicles in the target area according to the ratio;
and S1033, if the ratio is smaller than 1, sending an assignment command for entering the target area to vehicles in other areas according to the ratio.
In the embodiment, the ratio of the total number of the vehicles to the total number of the users is obtained to judge whether the balance of the supply and demand of the vehicles is achieved, if the ratio is greater than 1, the vehicles in the target area are more than the quantity required by the users, and therefore some vehicles can be assigned to leave the target area; if the ratio is less than 1, it indicates that the number of vehicles in the target area is less than the number required by the user, and therefore some vehicles in other areas can be assigned to enter the target area, thereby promoting the balance of supply and demand of the vehicles, obtaining more profits, and facilitating the trip of the user. Furthermore, since the vehicles and users in the target area may change in real time, and there may be some fluctuation in supply and demand, the embodiment may further set a first threshold (greater than 1), and assign some vehicles to leave the target area when the ratio is greater than the first threshold; likewise, a second threshold (less than 1) may be further set, and some vehicles in other zones may be assigned to enter the target zone when the ratio is less than the second threshold. The assigned policy may be to select a vehicle closer to the boundary of the target area, or to adopt other assigned policies, which are not described herein again.
According to the vehicle supply and demand optimization method for the target area, the geographical range of the target area in the spherical hexagonal geographical grid system is obtained, and the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system; the vehicle quantity and the user quantity in each hexagonal area are obtained according to a pre-constructed index tree, the total number of vehicles and the total number of users in the geographic range are counted according to the vehicle quantity and the user quantity in each hexagonal area, whether the target area achieves vehicle supply and demand balance or not is judged, and vehicle supply and demand optimization is carried out according to the judgment result. The method of the embodiment can realize the rapid statistics of the number of vehicles and the number of users in the target area, and does not need to judge whether all vehicles and all users maintained by the vehicle management platform are located in the target area to realize the statistics of the number of vehicles and the number of users in the target area, thereby improving the efficiency of vehicle supply and demand optimization in the target area.
Based on the above embodiment, the geographical range is composed of middle-level hexagons and/or bottom-level hexagons in the spherical hexagonal grid system, and the encoding set HS ═ HS of the hexagons included in the geographical range can be obtained first1,hs2,...,hsPP is the number of hexagons.
Further, the step S102 of obtaining the number of vehicles and the number of users in each hexagonal area according to the pre-constructed index tree includes:
for any hexagonal area, if the hexagonal area is a bottom-layer hexagon, counting the number of vehicles and the number of users in corresponding leaf nodes according to the index tree;
and if the hexagonal area is a middle-level hexagon, traversing all leaf nodes taking a middle node corresponding to the hexagonal area as a root node according to the index tree, and counting the number of vehicles and the number of users in the leaf nodes.
In this embodiment, if a certain hexagonal region is a bottom-layer hexagon, that is, corresponds to one leaf node, the number of vehicles and the number of users included in the leaf node can be directly counted; if a certain hexagonal region is a middle-level hexagon, that is, corresponds to one middle node, the number of vehicles and the number of users included in all leaf nodes taking the middle node as a root are counted.
Specifically, in this embodiment, the statistics of the number of vehicles and the number of users in the hexagonal area can be performed through the following procedures:
1、p=0,car=0,user=0;
2. p is P +1, and if P > P, end;
3. hexagonal region hSpThe number of the layers is q, and the code is a1a2a3…aqAnd the index tree corresponding to the top layer hexagon is T, and the following operations are carried out:
3.1, let k equal 0, a0=0;
3.2, k is k +1, and if k is greater than q, jumping to the step 2;
3.3 if index tree T k-1 level ak-1The coding node has no code of akJumping to the step 2 by the child node;
3.4 if k ═ q, then let the layer code be akThe node of (2) is root, and the number of vehicles and the number of users in all leaf nodes taking the root as a root node are counted;
3.5, jumping to the step 3.2.
Through the process, the number of vehicles and the number of users in the hexagonal area can be rapidly and automatically counted, and the efficiency of vehicle supply and demand optimization in the target area is further improved conveniently.
On the basis of the above embodiment, as shown in fig. 10, the method further provides a process for constructing an index tree, which is specifically as follows:
s201, acquiring longitude and latitude information of all vehicles and longitude and latitude information of all users.
In this embodiment, longitude and latitude information of all vehicles and all users (which may be users required by the utility vehicle) maintained by the vehicle management platform (e.g. the network appointment platform) may be obtained first, where the longitude and latitude information of the vehicle may beThe longitude and latitude information of the user can be acquired from the mobile terminal of the user through the acquisition of the positioning system installed on the vehicle, for example, the longitude and latitude information of the position where the mobile terminal is located can be uploaded when the user makes a vehicle reservation through the mobile terminal, and the longitude and latitude information can also be uploaded at regular time by the vehicle and the user. In this embodiment, the longitude and latitude information of the vehicle may be recorded as a set CL ═ CL1,cl2,...,clmRecording the latitude and longitude information of the user as a set PL ═ PL1,pl2,...,pln}。
S202, acquiring unit address codes of bottom layer hexagons of all vehicles in the spherical hexagonal geographic grid system according to the longitude and latitude information of all vehicles, and acquiring unit address codes corresponding to the bottom layer hexagons of all users in the spherical hexagonal geographic grid system according to the longitude and latitude information of all users.
In this embodiment, the foregoing method for converting longitude and latitude into unit address codes may be adopted, and certainly, the method is not limited to this conversion method, and is not described herein again. In this embodiment, the unit address code corresponding to the vehicle may be obtained and recorded as the vehicle geographic grid code set CG ═ { CG1,cg2,...cgm}; after the unit address code corresponding to the user is obtained, recording the unit address code as a user geography grid coding set PG ═ PG1,pg2,...pgm}。
S203, the index tree is constructed according to the acquired unit address codes, wherein each leaf node at least comprises one vehicle or one user, and corresponding vehicle information and/or user information are stored in the corresponding leaf nodes.
In this embodiment, if all the bottom-layer hexagonal areas included in a certain top-layer hexagon at least include one vehicle or one user, the index tree is a seven-branch tree; however, not all the bottom-layer hexagonal regions at least include one vehicle or one user, and therefore, for a region without a vehicle and a user, a corresponding node is not created, that is, each leaf node in the finally constructed index tree in the embodiment at least includes one vehicle or one user. Further, if it is determined that a certain vehicle or user is located in a certain bottom layer hexagon, corresponding vehicle information or user information is stored in a leaf node corresponding to the bottom layer hexagon.
Specifically, in this embodiment, the obtaining may construct an index tree (a seven-way tree) for each top-level hexagon through the following process:
1. checking each geocode in CG and PG sets, and adding the codes belonging to the top layer hexagon into the set A;
2. recording the top grid code as 0, the number of the root node layers is 0, and the code is 0;
3. for each geocode a ═ a in A1a2a3…aNThe following operations are carried out:
3.1, let k equal 0, a0=0;
3.2, making k equal to k +1, and finishing tree building if k is more than N;
3.3, e.g. layer a of k-1 of fruit treek-1Coding node Z has no coding of akCreates a node code a for Z at layer kkThe child node of (2);
3.4, if k is not equal to N, skipping to the step 3.2;
3.5, if a belongs to CG, recording corresponding vehicle information at the node; and if a belongs to the PG, recording corresponding user information in the node. Jump to step 3.2.
In this embodiment, storing the corresponding vehicle information and/or user information in the corresponding leaf node may specifically include:
respectively constructing an attribute binary group (CarNum, UserNum) for each vehicle and user, wherein the CarNum is 1, the UserNum is 0 for the vehicle, and the UserNum is 1 for the user;
the binary of the vehicle and/or the binary of the user are stored into the corresponding leaf nodes.
That is, in the above 3.5, if a belongs to CG, the node attribute of CarNum ═ 1 and UserNum ═ 0 are recorded; if a belongs to PG, the node attribute of CarNum ═ 0 and UserNum ═ 1 are recorded.
Accordingly, counting the number of vehicles and the number of users included in the leaf node may include:
and calculating the sum of attribute binary groups of all vehicles and/or users in the leaf node, recording the obtained sum of CarNum as the number of vehicles in the leaf node, and recording the obtained sum of UserNum as the number of users in the leaf node.
In this embodiment, attribute binary groups of the leaf nodes are summed, so that rapid statistics of the number of vehicles and the number of users included in the leaf nodes can be simultaneously achieved, and workload is reduced.
On the basis of the above embodiment, since the positions of the vehicle and the user are changed in real time, the index tree can be updated in real time. Specifically, for example, when the position of a certain vehicle or user changes and changes from one bottom hexagonal region to another bottom hexagonal region, the index tree is updated. The change of the bottom layer hexagonal area can be judged by a positioning system of a vehicle or a user mobile terminal, and can also be judged by a vehicle management platform after receiving longitude and latitude information uploaded by the vehicle or the user in real time.
It should be noted that, in the above embodiment, the coordinates of all vehicles and all users in the cartesian coordinate system may also be acquired, and the coordinates may also be converted into the unit address codes corresponding to the bottom layer hexagons, so as to perform the above process.
Fig. 11 is a structural diagram of a vehicle supply and demand optimization device of a target area according to an embodiment of the present invention. The vehicle supply and demand optimization device for the target area provided in this embodiment may execute the processing flow provided by the vehicle supply and demand optimization method for the target area, as shown in fig. 11, the vehicle supply and demand optimization device 30 for the target area includes an obtaining module 31, a statistical module 32, and a control module 33.
An obtaining module 31, configured to obtain a geographic range of a target area in a spherical hexagonal geographic grid system, where the geographic range is formed by hexagonal areas in the spherical hexagonal geographic grid system;
the statistical module 32 is configured to obtain the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree, where the index tree is constructed according to the unit address codes of bottom layer hexagons to which all vehicles and all users belong in a spherical hexagonal geographic grid system, a root node of the index tree is a top layer hexagonal node of the spherical hexagonal geographic grid system, leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons include vehicle information and user information located in an area corresponding to the bottom layer hexagons; counting the total number of vehicles and the total number of users in the geographic range according to the number of vehicles and the number of users in each hexagonal area;
and the control module 33 is configured to determine whether the target area reaches the vehicle supply and demand balance, and perform vehicle supply and demand optimization according to the determination result.
Further, the geographic range is formed by middle-level hexagons and/or bottom-level hexagons in the spherical hexagonal grid system;
the statistics module 32 is configured to:
for any hexagonal area, if the hexagonal area is a bottom-layer hexagon, counting the number of vehicles and the number of users in corresponding leaf nodes according to the index tree;
and if the hexagonal area is a middle-level hexagon, traversing all leaf nodes taking a middle node corresponding to the hexagonal area as a root node according to the index tree, and counting the number of vehicles and the number of users in the leaf nodes.
Further, the apparatus further includes an index tree construction module configured to:
acquiring longitude and latitude information of all vehicles and longitude and latitude information of all users;
acquiring unit address codes of bottom layer hexagons of all vehicles in the spherical hexagonal geographic grid system according to the longitude and latitude information of all vehicles, and acquiring unit address codes corresponding to the bottom layer hexagons of all users in the spherical hexagonal geographic grid system according to the longitude and latitude information of all users;
and constructing the index tree according to the acquired unit address code, wherein each leaf node at least comprises one vehicle or one user, and storing corresponding vehicle information and/or user information into the corresponding leaf node.
Further, the index tree building module is configured to:
respectively constructing an attribute binary group (CarNum, UserNum) for each vehicle and user, wherein the CarNum is 1, the UserNum is 0 for the vehicle, and the UserNum is 1 for the user;
the binary of the vehicle and/or the binary of the user are stored into the corresponding leaf nodes.
Further, the statistic module 32 is configured to:
and calculating the sum of attribute binary groups of all vehicles and/or users in the leaf node, recording the obtained sum of CarNum as the number of vehicles in the leaf node, and recording the obtained sum of UserNum as the number of users in the leaf node.
Further, the control module 33 is configured to:
acquiring the ratio of the total number of vehicles and the total number of users in the geographic range;
if the ratio is larger than 1, sending an assignment command of leaving the target area to the vehicles in the target area according to the ratio;
and if the ratio is less than 1, sending an assignment command for entering the target area to vehicles in other areas according to the ratio.
The vehicle supply and demand optimization device of the target area provided by the embodiment of the present invention may be specifically configured to execute the method embodiments provided in fig. 7 and fig. 10, and specific functions are not described herein again.
According to the vehicle supply and demand optimization device for the target area, the geographical range of the target area in the spherical hexagonal geographical grid system is obtained, and the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system; the vehicle quantity and the user quantity in each hexagonal area are obtained according to a pre-constructed index tree, the total number of vehicles and the total number of users in the geographic range are counted according to the vehicle quantity and the user quantity in each hexagonal area, whether the target area achieves vehicle supply and demand balance or not is judged, and vehicle supply and demand optimization is carried out according to the judgment result. According to the embodiment, the vehicle quantity and the user quantity in the target area can be rapidly counted, all vehicles and all users maintained by the vehicle management platform do not need to be judged whether to be located in the target area to count the vehicle quantity and the user quantity in the target area, and the vehicle supply and demand optimization efficiency of the target area is improved.
Fig. 12 is a schematic structural diagram of a vehicle supply and demand optimization device of a target area according to an embodiment of the present invention. The vehicle supply and demand optimization device of the target area provided by the embodiment of the present invention may execute the processing procedure provided by the vehicle supply and demand optimization method of the target area, as shown in fig. 12, the vehicle supply and demand optimization device 90 of the target area includes a memory 91, a processor 92, a computer program, and a communication interface 93; wherein the computer program is stored in the memory 91 and is configured to be executed by the processor 92 for the vehicle supply and demand optimization method of the target area as described in the above embodiments.
The vehicle supply and demand optimization device of the target area in the embodiment shown in fig. 12 can be used for executing the technical solution of the above method embodiment, and the implementation principle and the technical effect are similar, and are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium on which a computer program is stored, the computer program being executed by a processor to implement the vehicle supply and demand optimization method for the target area described in the above embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A method for optimizing supply and demand for a vehicle in a target area, comprising:
acquiring the geographical range of a target area in a spherical hexagonal geographical grid system, wherein the geographical range is formed by hexagonal areas in the spherical hexagonal geographical grid system;
acquiring the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree, wherein the index tree is constructed according to the unit address codes of bottom layer hexagons of all vehicles and all users in a spherical hexagonal geographic grid system, the root node of the index tree is the top layer hexagonal node of the spherical hexagonal geographic grid system, the leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons comprise vehicle information and user information in the area corresponding to the bottom layer hexagons;
counting the total number of vehicles and the total number of users in the geographic range according to the number of the vehicles and the number of the users in each hexagonal area, judging whether the target area reaches the vehicle supply and demand balance, and optimizing the vehicle supply and demand according to the judgment result;
wherein the geographic scope is formed by middle-level hexagons and/or bottom-level hexagons in the spherical hexagonal grid system;
the acquiring the number of vehicles and the number of users in each hexagonal area according to the pre-constructed index tree comprises the following steps:
for any hexagonal area, if the hexagonal area is a bottom-layer hexagon, counting the number of vehicles and the number of users in corresponding leaf nodes according to the index tree;
if the hexagonal area is a middle-level hexagon, traversing all leaf nodes taking a middle node corresponding to the hexagonal area as a root node according to the index tree, and counting the number of vehicles and the number of users in the leaf nodes; the method further comprises the following steps:
acquiring longitude and latitude information of all vehicles and longitude and latitude information of all users;
acquiring unit address codes of bottom layer hexagons of all vehicles in the spherical hexagonal geographic grid system according to the longitude and latitude information of all vehicles, and acquiring unit address codes corresponding to the bottom layer hexagons of all users in the spherical hexagonal geographic grid system according to the longitude and latitude information of all users;
constructing the index tree according to the acquired unit address code, wherein each leaf node at least comprises a vehicle or a user;
respectively constructing an attribute binary group (CarNum, UserNum) for each vehicle and user, wherein the CarNum is 1, the UserNum is 0 for the vehicle, and the UserNum is 1 for the user;
the binary of the vehicle and/or the binary of the user are stored into the corresponding leaf nodes.
2. The method of claim 1, wherein counting the number of vehicles and the number of users included in a leaf node comprises:
and calculating the sum of attribute binary groups of all vehicles and/or users in the leaf node, recording the obtained sum of CarNum as the number of vehicles in the leaf node, and recording the obtained sum of UserNum as the number of users in the leaf node.
3. The method according to claim 1 or 2, wherein the judging whether the target area reaches the vehicle supply and demand balance and the vehicle supply and demand optimization according to the judgment result comprise:
acquiring the ratio of the total number of vehicles and the total number of users in the geographic range;
if the ratio is larger than 1, sending an assignment command of leaving the target area to the vehicles in the target area according to the ratio;
and if the ratio is less than 1, sending an assignment command for entering the target area to vehicles in other areas according to the ratio.
4. A vehicle supply and demand optimization apparatus for a target area, comprising:
the acquisition module is used for acquiring the geographic range of a target area in a spherical hexagonal geographic grid system, wherein the geographic range is formed by hexagonal areas in the spherical hexagonal grid system;
the statistical module is used for acquiring the number of vehicles and the number of users in each hexagonal area according to a pre-constructed index tree, wherein the index tree is constructed according to the unit address codes of bottom layer hexagons of all vehicles and all users in a spherical hexagonal geographic grid system, the root node of the index tree is a top layer hexagonal node of the spherical hexagonal geographic grid system, the leaf nodes of the index tree are bottom layer hexagons, and the bottom layer hexagons comprise vehicle information and user information in the area corresponding to the bottom layer hexagons; counting the total number of vehicles and the total number of users in the geographic range according to the number of vehicles and the number of users in each hexagonal area;
the control module is used for judging whether the target area reaches the vehicle supply and demand balance or not and optimizing the vehicle supply and demand according to the judgment result;
the geographic range is formed by middle-level hexagons and/or bottom-level hexagons in the spherical hexagonal grid system;
the statistics module is configured to:
for any hexagonal area, if the hexagonal area is a bottom-layer hexagon, counting the number of vehicles and the number of users in corresponding leaf nodes according to the index tree;
if the hexagonal area is a middle-level hexagon, traversing all leaf nodes taking a middle node corresponding to the hexagonal area as a root node according to the index tree, and counting the number of vehicles and the number of users in the leaf nodes; the apparatus further comprises an index tree construction module configured to:
acquiring longitude and latitude information of all vehicles and longitude and latitude information of all users;
acquiring unit address codes of bottom layer hexagons of all vehicles in the spherical hexagonal geographic grid system according to the longitude and latitude information of all vehicles, and acquiring unit address codes corresponding to the bottom layer hexagons of all users in the spherical hexagonal geographic grid system according to the longitude and latitude information of all users;
constructing the index tree according to the acquired unit address code, wherein each leaf node at least comprises one vehicle or one user, and storing corresponding vehicle information and/or user information into the corresponding leaf node; the index tree building module is used for:
respectively constructing an attribute binary group (CarNum, UserNum) for each vehicle and user, wherein the CarNum is 1, the UserNum is 0 for the vehicle, and the UserNum is 1 for the user;
the binary of the vehicle and/or the binary of the user are stored into the corresponding leaf nodes.
5. The apparatus of claim 4, wherein the statistics module is configured to:
and calculating the sum of attribute binary groups of all vehicles and/or users in the leaf node, recording the obtained sum of CarNum as the number of vehicles in the leaf node, and recording the obtained sum of UserNum as the number of users in the leaf node.
6. The apparatus of claim 4 or 5, wherein the control module is configured to:
acquiring the ratio of the total number of vehicles and the total number of users in the geographic range;
if the ratio is larger than 1, sending an assignment command of leaving the target area to the vehicles in the target area according to the ratio;
and if the ratio is less than 1, sending an assignment command for entering the target area to vehicles in other areas according to the ratio.
7. A vehicle supply and demand optimization apparatus for a target area, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-3.
8. A computer-readable storage medium, having stored thereon a computer program;
the computer program, when executed by a processor, implementing the method of any one of claims 1-3.
CN201910099847.2A 2019-01-31 2019-01-31 Vehicle supply and demand optimization method, device, equipment and storage medium for target area Active CN109858698B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910099847.2A CN109858698B (en) 2019-01-31 2019-01-31 Vehicle supply and demand optimization method, device, equipment and storage medium for target area

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910099847.2A CN109858698B (en) 2019-01-31 2019-01-31 Vehicle supply and demand optimization method, device, equipment and storage medium for target area

Publications (2)

Publication Number Publication Date
CN109858698A CN109858698A (en) 2019-06-07
CN109858698B true CN109858698B (en) 2022-02-15

Family

ID=66897285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910099847.2A Active CN109858698B (en) 2019-01-31 2019-01-31 Vehicle supply and demand optimization method, device, equipment and storage medium for target area

Country Status (1)

Country Link
CN (1) CN109858698B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112529279A (en) * 2020-12-02 2021-03-19 北京嘀嘀无限科技发展有限公司 Method, device, computer equipment and medium for generating order receiving guidance information
CN112597262A (en) * 2020-12-30 2021-04-02 广州海格星航信息科技有限公司 Industry address serial number generation method and device based on spatial grid
CN115914170A (en) * 2022-09-30 2023-04-04 哈尔滨工业大学 Network routing addressing method based on geographic grid coding
CN116187722A (en) * 2023-04-26 2023-05-30 北京快成科技有限公司 Car dispatching method and system based on supply and demand quantity

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014016880A1 (en) * 2012-07-23 2014-01-30 三菱電機株式会社 Vehicle-mounted information device and server
CN102903236A (en) * 2012-10-22 2013-01-30 杭州九树网络科技有限公司 System and method for acquiring and scheduling taxi passenger source information in real time
CN103985247B (en) * 2014-04-24 2016-08-24 北京嘀嘀无限科技发展有限公司 Taxi Transport capacity dispatching system based on city chauffeur demand distribution density
CN104574959B (en) * 2014-12-24 2017-02-01 中国科学院自动化研究所 System and method for predicting supply and demand states of taxis in airports
CN105761482B (en) * 2016-05-10 2018-06-26 北京交通大学 The real-time reserving method of taxi and system based on fairness
CN106485372A (en) * 2016-11-28 2017-03-08 中兴软创科技股份有限公司 The assessment of public bus network fitted out vehicles amount and optimization method and system
CN108010306B (en) * 2017-08-16 2019-06-04 北京嘀嘀无限科技发展有限公司 Transport capacity dispatching method, Transport capacity dispatching system and server

Also Published As

Publication number Publication date
CN109858698A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN109858698B (en) Vehicle supply and demand optimization method, device, equipment and storage medium for target area
Snickars et al. A minimum information principle: Theory and practice
Roy et al. Citylife: a study of cellular automata in urban dynamics
US20200371506A1 (en) Configuration-based optimization method of automated assembly and production of circuit breaker
Dobrin A review of properties and variations of Voronoi diagrams
CN112634448B (en) Universal construction method for space grid driven by global discrete point cloud system
CN112862176B (en) Public service facility site selection method and device
CN116384157B (en) Land utilization change simulation method
CN111797093B (en) Discrete global grid structure generation method and rapid unit positioning method
CN109992640A (en) Determination method and device, equipment and the storage medium of position grid
CN111598359B (en) Logistics station site selection method and system
CN111898750A (en) Neural network model compression method and device based on evolutionary algorithm
CN114066184A (en) Area coverage assessment method and device and electronic equipment
CN109885638B (en) Three-dimensional space indexing method and system
CN110852547B (en) Public service facility grading method based on position data and clustering algorithm
CN111881115A (en) Database coordination optimization method based on big data dynamic planning
Maleki et al. Many‐objective land use planning using a hypercube‐based NSGA‐III algorithm
CN116151439A (en) Method for selecting site and rescuing material reserve station in city
CN110428164A (en) A kind of operation of power networks state monitoring method, device, equipment and readable storage medium storing program for executing
CN110533764B (en) Fractal quadtree texture organization method for building group
WO2021101992A1 (en) Methods, systems and media for generative urban design where maps are generated using fractals
Asprone et al. Assessment of urban ecosystem resilience using the efficiency of hybrid social-physical complex networks
CN115001559B (en) User terminal distribution model construction method suitable for satellite network
CN110765562B (en) Automatic target net rack generation method based on multi-source information and multi-constraint
CN115242796B (en) Task scheduling method for cloud-edge-end scene

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant