[go: up one dir, main page]

CN111222667B - Route planning method, device, equipment and storage medium - Google Patents

Route planning method, device, equipment and storage medium Download PDF

Info

Publication number
CN111222667B
CN111222667B CN201811422192.XA CN201811422192A CN111222667B CN 111222667 B CN111222667 B CN 111222667B CN 201811422192 A CN201811422192 A CN 201811422192A CN 111222667 B CN111222667 B CN 111222667B
Authority
CN
China
Prior art keywords
route
scenic spot
scenic
tour
total
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
CN201811422192.XA
Other languages
Chinese (zh)
Other versions
CN111222667A (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.)
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Liaoning 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 China Mobile Communications Group Co Ltd, China Mobile Group Liaoning Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201811422192.XA priority Critical patent/CN111222667B/en
Publication of CN111222667A publication Critical patent/CN111222667A/en
Application granted granted Critical
Publication of CN111222667B publication Critical patent/CN111222667B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/14Travel agencies

Landscapes

  • Business, Economics & Management (AREA)
  • Tourism & Hospitality (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Game Theory and Decision Science (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Development Economics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • Navigation (AREA)

Abstract

The embodiment of the invention discloses a route planning method, a device, equipment and a storage medium. The method comprises the following steps: obtaining a starting point position, an end point position, a total tour duration of a user and preference degree scores of the user for each scenic spot; determining scenic spots to be inserted and the insertion positions of the scenic spots to be inserted from scenic spots which are not covered by the current route according to the preference degree scores; calculating the tour time length corresponding to the first target route after the scenic spot to be inserted is inserted into the insertion position; if the tour time is not longer than the tour total time, inserting the scenic spot to be inserted into the insertion position; continuously inserting scenic spots; and if the tour time length is longer than the tour total time length, determining the current route as a planned route. According to the route planning method, device, equipment and storage medium, route planning is performed according to the preference degree scores of the users aiming at the scenic spots, and the planned route can meet the preference requirements of the users.

Description

路线规划方法、装置、设备及存储介质Route planning method, device, equipment and storage medium

技术领域Technical field

本发明涉及计算机技术领域,尤其涉及一种路线规划方法、装置、设备及存储介质。The present invention relates to the field of computer technology, and in particular to a route planning method, device, equipment and storage medium.

背景技术Background technique

定向问题分为传统定向问题和团队定向问题,是一类特殊的非确定性多项式困难(non-deterministic polynomial-hard,NP-hard)路径优化问题,在物流领域、旅游领域非常常见且同时也具有极大的挑战性。Orientation problems are divided into traditional orientation problems and team orientation problems. They are a special type of non-deterministic polynomial-hard (NP-hard) path optimization problems. They are very common in the fields of logistics and tourism and also have Extremely challenging.

个性化旅游路线求解优化问题可以模拟为带时间窗的定向问题(OrienteeringProblem with Time Windows,OPTW)。The optimization problem of solving personalized travel routes can be simulated as an orientation problem with time windows (OrienteeringProblem with Time Windows, OPTW).

目前,解决OPTW问题主要采用迭代局部搜索(Iterated Local Search,ILS)算法。但是采用ILS算法在规划路线的过程中,可能会排除用户偏好度较高的地点,使得规划出的路线不能满足用户的偏好要求。At present, the Iterated Local Search (ILS) algorithm is mainly used to solve the OPTW problem. However, in the process of route planning using the ILS algorithm, locations with high user preference may be excluded, making the planned route unable to meet the user's preference requirements.

发明内容Contents of the invention

本发明实施例提供一种路线规划方法、装置、设备及存储介质,能够使规划出的路线满足用户的偏好要求。Embodiments of the present invention provide a route planning method, device, equipment and storage medium, which can enable the planned route to meet the user's preference requirements.

一方面,本发明实施例提供了一种路线规划方法,方法包括:On the one hand, embodiments of the present invention provide a route planning method, which includes:

获得用户的起始点位置、终点位置、游览总时长和用户针对每一景点的偏好程度分值;Obtain the user's starting point location, end point location, total tour time and user's preference score for each attraction;

根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置;According to the preference score, from the attractions not covered by the current route from the starting point location to the end location, determine the attractions to be inserted and the insertion positions of the attractions to be inserted in the current route;

计算将待插入景点插入插入位置后的第一目标路线对应的游览时长;Calculate the tour duration corresponding to the first target route after inserting the attraction to be inserted into the insertion position;

若游览时长不大于游览总时长,则将待插入景点插入插入位置;If the tour duration is not greater than the total tour duration, the attractions to be inserted will be inserted into the insertion position;

返回根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置继续执行;Return according to the preference score, from the attractions not covered by the current route from the starting point to the end location, determine the attractions to be inserted and the attractions to be inserted will continue to be executed for the insertion position in the current route;

若游览时长大于游览总时长,将当前路线确定为规划路线。If the tour duration is greater than the total tour duration, the current route is determined as the planned route.

另一方面,本发明实施例提供了一种路径规划装置,装置包括:On the other hand, an embodiment of the present invention provides a path planning device, which includes:

获得模块,用于获得用户的起始点位置、终点位置、游览总时长和用户针对每一景点的偏好程度分值;The acquisition module is used to obtain the user's starting point location, end point location, total tour time and the user's preference score for each attraction;

第一确定模块,用于根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置;The first determination module is used to determine the attractions to be inserted and the insertion positions of the attractions to be inserted in the current route from the attractions not covered by the current route from the starting point location to the end location based on the preference score;

计算模块,用于计算将待插入景点插入插入位置后的第一目标路线对应的游览时长;A calculation module used to calculate the tour duration corresponding to the first target route after inserting the attraction to be inserted into the insertion position;

插入模块,用于若游览时长不大于游览总时长,则将待插入景点插入插入位置;并触发确定模块;The insertion module is used to insert the attraction to be inserted into the insertion position if the tour duration is not greater than the total tour duration; and trigger the determination module;

第二确定模块,用于若游览时长大于游览总时长,将当前路线确定为规划路线。The second determination module is used to determine the current route as the planned route if the tour duration is greater than the total tour duration.

再一方面,本发明实施例提供一种路线规划设备,设备包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序;In another aspect, embodiments of the present invention provide a route planning device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor;

处理器执行计算机程序时实现本发明实施例提供的路线规划方法。When the processor executes the computer program, the route planning method provided by the embodiment of the present invention is implemented.

再一方面,本发明实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现本发明实施例提供的路线规划方法。On the other hand, embodiments of the present invention provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the route planning method provided by the embodiment of the present invention is implemented.

本发明实施例的路线规划方法、装置、设备及存储介质,根据用户针对景点的偏好程度分值,来进行路线规划,能够使规划出的路线满足用户的偏好要求。The route planning method, device, equipment and storage medium of the embodiments of the present invention perform route planning based on the user's preference scores for scenic spots, so that the planned route can meet the user's preference requirements.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present invention more clearly, the drawings required to be used in the embodiments of the present invention will be briefly introduced below. For those of ordinary skill in the art, without exerting creative efforts, they can also Additional drawings can be obtained from these drawings.

图1示出了现有技术提供的路线规划的结果示意图;Figure 1 shows a schematic diagram of the results of route planning provided by the prior art;

图2示出了本发明实施例提供的路线规划方法的流程示意图;Figure 2 shows a schematic flow chart of a route planning method provided by an embodiment of the present invention;

图3示出了本发明实施例提供的路线规划方法的场景示意图;Figure 3 shows a schematic scenario diagram of the route planning method provided by an embodiment of the present invention;

图4示出了本发明实施例提供的路线优化的流程示意图;Figure 4 shows a schematic flow chart of route optimization provided by an embodiment of the present invention;

图5示出了本发明实施例提供的路线规划的结果示意图;Figure 5 shows a schematic diagram of the results of route planning provided by the embodiment of the present invention;

图6示出了本发明实施例规划出的路线的总时长与现有技术规划出的路线的总时长的对比图;Figure 6 shows a comparison diagram of the total duration of the route planned by the embodiment of the present invention and the total duration of the route planned by the prior art;

图7示出了本发明实施例规划出路线的耗时时间和现有技术规划出路线的耗时时间的对比图;Figure 7 shows a comparison of the time it takes to plan a route according to the embodiment of the present invention and the time it takes to plan a route using the prior art;

图8示出了本发明实施例提供的路线规划装置的结构示意图;Figure 8 shows a schematic structural diagram of a route planning device provided by an embodiment of the present invention;

图9示出了能够实现根据本发明实施例的路线规划方法及装置的计算设备的示例性硬件架构的结构图。FIG. 9 shows a structural diagram of an exemplary hardware architecture of a computing device capable of implementing the route planning method and apparatus according to embodiments of the present invention.

具体实施方式Detailed ways

下面将详细描述本发明的各个方面的特征和示例性实施例,为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细描述。应理解,此处所描述的具体实施例仅被配置为解释本发明,并不被配置为限定本发明。对于本领域技术人员来说,本发明可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本发明的示例来提供对本发明更好的理解。Features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are configured only to explain the invention and not to limit the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the invention by illustrating examples of the invention.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations are mutually exclusive. any such actual relationship or sequence exists between them. Furthermore, the terms "comprises," "comprises," or any other variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprising..." does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.

图1示出了现有技术提供的路线规划的结果示意图。图1中共有5个景点,5个景点分别为景点1、景点2、景点3、景点4和景点5。景点5为用户偏好程度较高的景点。由图1所示的路线规划的结果示意图中可以看出,利用现有技术规划出的路线并不包括景点5,使得规划出的路线不能满足用户的偏好要求。其中,图1路线规划的结果为:起始点位置—>景点2—>景点4—>景点1—>终点位置。Figure 1 shows a schematic diagram of the route planning results provided by the prior art. There are a total of 5 scenic spots in Figure 1, and the 5 scenic spots are scenic spots 1, 2, 3, 4 and 5 respectively. Attraction 5 is an attraction with a high degree of user preference. It can be seen from the schematic diagram of the route planning results shown in Figure 1 that the route planned using the existing technology does not include the scenic spot 5, so that the planned route cannot meet the user's preference requirements. Among them, the result of the route planning in Figure 1 is: starting point location—>attraction 2—>attraction 4—>attraction 1—>end point location.

为了解决现有技术问题,本发明实施例提供了一种路线规划方法、装置、设备及存储介质,来进行路线规划,使规划出的路线满足用户的偏好要求。下面首先对本发明实施例提供的路线规划方法进行详细说明。In order to solve the existing technical problems, embodiments of the present invention provide a route planning method, device, equipment and storage medium to perform route planning so that the planned route meets the user's preference requirements. The route planning method provided by the embodiment of the present invention is first described in detail below.

图2示出了本发明实施例提供的路线规划方法的流程示意图。路线规划方法可以包括:Figure 2 shows a schematic flowchart of a route planning method provided by an embodiment of the present invention. Route planning methods can include:

S201:获得用户的起始点位置、终点位置、游览总时长和用户针对每一景点的偏好程度分值。S201: Obtain the user's starting point location, end point location, total tour time and user's preference score for each attraction.

S202:根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置。S202: According to the preference score, determine the scenic spots to be inserted and the insertion positions of the scenic spots to be inserted in the current route from the scenic spots not covered by the current route from the starting point to the end position.

S203:计算将待插入景点插入插入位置后的第一目标路线对应的游览时长。S203: Calculate the tour duration corresponding to the first target route after inserting the scenic spot to be inserted into the insertion position.

S204:若游览时长不大于游览总时长,则将待插入景点插入插入位置,继续执行S202。S204: If the tour duration is not greater than the total tour duration, insert the attraction to be inserted into the insertion position and continue to execute S202.

S205:若游览时长大于游览总时长,将当前路线确定为规划路线。S205: If the tour duration is greater than the total tour duration, determine the current route as the planned route.

示例性的,下面结合具体的路线规划场景对本发明实施例提供的路线规划方法进行说明。By way of example, the route planning method provided by the embodiment of the present invention is described below in conjunction with a specific route planning scenario.

图3示出了本发明实施例提供的路线规划方法的场景示意图。图3所示的场景中包括10个景点,分别为景点1、景点2、……、景点9和景点10。其中,用户针对景点1、景点2、……、景点9和景点10的偏好程度分别可以为:非常想去、比较想去、比较不想去、比较不想去、一定要去、非常不想去、比较想去、非常想去、比较不想去和比较不想去。Figure 3 shows a schematic scenario diagram of the route planning method provided by an embodiment of the present invention. The scene shown in Figure 3 includes 10 scenic spots, namely scenic spots 1, 2,..., 9 and 10. Among them, the user's preferences for attractions 1, 2, ..., 9 and 10 can be respectively: very much want to go, relatively want to go, relatively don't want to go, relatively don't want to go, must go, very do not want to go, relatively Want to go, really want to go, somewhat don't want to go and relatively don't want to go.

其中,偏好程度与偏好程度分值对应关系如表1所示。Among them, the corresponding relationship between preference degree and preference degree score is shown in Table 1.

表1Table 1

偏好程度degree of preference 偏好程度分值preference score 非常不想去Don't want to go very much 11 比较不想去Don't want to go 22 比较想去Rather want to go 33 非常想去Very much want to go 44 一定要去must go MAXMAX

在本发明的一个实施例中,偏好程度分值MAX远大于其他偏好程度分值,比如,MAX为10000、1000000或20000等等。In one embodiment of the present invention, the preference score MAX is much larger than other preference scores, for example, MAX is 10000, 1000000 or 20000, etc.

相应的,基于表1,用户针对景点1、景点2、……、景点9和景点10的偏好程度分值分别为:4、3、2、2、MAX、1、3、4、2和2。Correspondingly, based on Table 1, the user's preference scores for attractions 1, 2,..., 9 and 10 are respectively: 4, 3, 2, 2, MAX, 1, 3, 4, 2 and 2 .

在本发明的一个实施例中,若用户针对某一景点未设置偏好程度,则可以将用户针对该景点的偏好程度默认为:比较想去。In one embodiment of the present invention, if the user does not set a preference level for a certain scenic spot, the user's preference level for the scenic spot can be defaulted to: I would rather like to go there.

假设用户设置的游览总时长为160分钟。Assume that the total tour duration set by the user is 160 minutes.

开始的路线为由起始点位置直接到达终点位置,即当前路线为:起始点位置—>终点位置。The starting route is from the starting point to the ending position directly, that is, the current route is: starting point position -> ending position.

假设此时根据偏好程度分值,确定出待插入景点为景点5,可以理解的是,当前的插入位置为起始点位置和终点位置之间。计算将景点5插入到起始点位置和终点位置之间后的第一目标路线:起始点位置—>景点5—>终点位置对应的游览时长,假设计算出的游览时长为100分钟,小于用户设置的游览总时长160分钟,则将景点5插入到起始点位置和终点位置之间,此时当前路线为:起始点位置—>景点5—>终点位置对应的游览时长。Assume that the scenic spot to be inserted is determined to be scenic spot 5 based on the preference score. It can be understood that the current insertion position is between the starting point position and the end position. Calculate the first target route after inserting attraction 5 between the starting point and the end location: starting point location—>attraction 5—>tour duration corresponding to the end location. Assume that the calculated tour duration is 100 minutes, which is less than the user setting The total tour duration is 160 minutes, then insert attraction 5 between the starting point and the end location. At this time, the current route is: starting point location—>attraction 5—>tour duration corresponding to the end location.

基于当前路线:起始点位置—>景点5—>终点位置,再进行景点的插入操作。Based on the current route: starting point location—>attraction 5—>end location, and then insert the attraction.

假设根据偏好程度分值,确定出待插入景点为景点1,可以理解的是,当前的插入位置可以为起始点位置和景点5之间,还可以为景点5和终点位置之间。Assume that the attraction to be inserted is determined to be attraction 1 based on the preference score. It can be understood that the current insertion position can be between the starting point position and attraction 5, or between the attraction 5 and the end position.

在本发明的一个实施例中,可以将时间消耗最小的那个位置作为景点的插入的最佳插入位置。In one embodiment of the present invention, the position with the least time consumption can be used as the best insertion position for inserting the scenic spot.

示例性的,假设在未插入景点1前,起始点位置至景点5的时间为25分钟,将景点1插入起始点位置和景点5之间后,起始点位置至景点5的时间为50分钟,则时间消耗为50-25=25分钟。For example, assuming that before attraction 1 is inserted, the time from the starting point to attraction 5 is 25 minutes. After attraction 1 is inserted between the starting point and attraction 5, the time from the starting point to attraction 5 is 50 minutes. The time consumption is 50-25=25 minutes.

假设在未插入景点1前,景点5至终点位置的时间为75分钟,将景点1插入景点5和终点位置之间后,景点5至终点位置的时间为85分钟,则时间消耗为85-75=10分钟。Assume that before attraction 1 is inserted, the time from attraction 5 to the end position is 75 minutes. After inserting attraction 1 between attraction 5 and the end position, the time from attraction 5 to the end position is 85 minutes, and the time consumption is 85-75 =10 minutes.

则将景点5和终点位置之间确定为景点1的最佳插入位置。Then the best insertion position of scenic spot 1 is determined between scenic spot 5 and the end position.

计算将景点1插入到景点5和终点位置之间后的第一目标路线:起始点位置—>景点5—>景点1—>终点位置对应的游览时长,计算出的游览时长为110分钟,小于用户设置的游览总时长160分钟,则将景点1插入到景点5和终点位置之间之间,此时当前路线为:起始点位置—>景点5—>景点1—>终点位置。Calculate the first target route after inserting scenic spot 1 between scenic spot 5 and the end location: starting point location—>attraction 5—>attraction 1—>the tour duration corresponding to the end location. The calculated tour duration is 110 minutes, which is less than If the total tour time set by the user is 160 minutes, attraction 1 will be inserted between attraction 5 and the end location. At this time, the current route is: starting point location—>attraction 5—>attraction 1—>end location.

后续的插入过程与景点1的插入过程相同,具体可参考景点1的插入过程,本发明实施例在此不对其进行赘述。The subsequent insertion process is the same as the insertion process of scenic spot 1. For details, reference can be made to the insertion process of scenic spot 1, which will not be described in detail here in the embodiment of the present invention.

在本发明的一个实施例中,根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置,可以包括:针对从由起始点位置至终点位置的当前路线未涵盖的景点中的每一景点,计算景点插入当前路线中的相邻两个景点的之间对应的时间消耗;根据时间消耗,确定景点的最小插入成本;将最小插入成本对应的相邻两个景点的之间的位置,作为景点的插入位置;针对每一景点,根据偏好程度分值和最小插入成本,计算景点的插入比率;将最高插入比率对应的景点,作为待插入景点。In one embodiment of the present invention, determining the attractions to be inserted from the attractions not covered by the current route from the starting point location to the end location according to the preference score and the insertion location of the attractions to be inserted in the current route may include : For each scenic spot not covered by the current route from the starting point to the end position, calculate the corresponding time consumption between two adjacent scenic spots inserted into the current route; determine the time consumption of the scenic spot based on the time consumption Minimum insertion cost; use the position between two adjacent attractions corresponding to the minimum insertion cost as the insertion location of the attraction; for each attraction, calculate the insertion ratio of the attraction based on the preference score and the minimum insertion cost; use the highest The scenic spots corresponding to the insertion ratio are used as the scenic spots to be inserted.

假设由起始点位置至终点位置的当前路线为:起始点位置—>景点5—>终点位置。Assume that the current route from the starting point location to the end location is: starting point location—>attraction 5—>end location.

则分别针对当前路线未涵盖的每一景点:针对景点1、景点2、景点3、景点4、景点6、景点7、景点8、景点9和景点10,计算每一景点插入到当前路线中的起始点位置和景点5之间,以及景点5和终点位置之间的时间消耗。根据时间消耗,确定景点的最小插入成本;将最小插入成本对应的相邻两个景点的之间的位置,作为景点的插入位置。Then for each scenic spot not covered by the current route: for scenic spot 1, scenic spot 2, scenic spot 3, scenic spot 4, scenic spot 6, scenic spot 7, scenic spot 8, scenic spot 9 and scenic spot 10, calculate the number of attractions inserted into the current route for each scenic spot. The time consumption between the starting point and attraction 5, and between the attraction 5 and the end location. According to the time consumption, the minimum insertion cost of the attraction is determined; the position between two adjacent attractions corresponding to the minimum insertion cost is used as the insertion location of the attraction.

在本发明的一个实施例中,可以将景点对应的最小时间消耗,作为景点的最小插入成本。In one embodiment of the present invention, the minimum time consumption corresponding to the attraction can be used as the minimum insertion cost of the attraction.

示例性的,还以上述景点1为例进行说明。Illustratively, the above scenic spot 1 is also used as an example for explanation.

景点1插入起始点位置和景点5之间对应的时间消耗为25分钟;景点1插入景点5和终点位置之间对应的时间消耗为10分钟。则最小时间消耗为10分钟,则将10分钟确定为景点1的最小插入成本。The corresponding time consumption between the starting point of attraction 1 and attraction 5 is 25 minutes; the corresponding time consumption of attraction 1 between the insertion of attraction 5 and the end position is 10 minutes. Then the minimum time consumption is 10 minutes, and 10 minutes is determined as the minimum insertion cost of attraction 1.

在本发明的一个实施例中,根据时间消耗,确定景点的最小插入成本,可以包括:若景点与相邻两个景点中的前一个景点和/或后一个景点位于同一个景点集群,将最小时间消耗与景点集群对应的景点集群参数值的比值,作为景点的最小插入成本;若景点与前一个景点和后一个景点没有位于同一个景点集群,将最小时间消耗,作为景点的最小插入成本。In one embodiment of the present invention, determining the minimum insertion cost of the scenic spot based on time consumption may include: if the scenic spot is located in the same scenic spot cluster as the previous scenic spot and/or the latter scenic spot among the two adjacent scenic spots, the minimum insertion cost The ratio of time consumption to the attraction cluster parameter value corresponding to the attraction cluster is used as the minimum insertion cost of the attraction; if the attraction is not located in the same attraction cluster as the previous attraction and the next attraction, the minimum time consumption is used as the minimum insertion cost of the attraction.

在本发明的一个实施例中,可以对景点进行聚类,形成多个景点集群。属于同一景点集群的景点之间的距离相对较近。本发明实施例并不对景点聚类的算法进行限定,任何可用的聚类算法均可应用于本发明实施例中,比如K均值(K-means)算法。In one embodiment of the present invention, scenic spots can be clustered to form multiple scenic spot clusters. Attractions belonging to the same attraction cluster are relatively close to each other. The embodiments of the present invention do not limit the algorithm for clustering scenic spots. Any available clustering algorithm can be applied to the embodiments of the present invention, such as the K-means algorithm.

本发明实施例提供的最小插入成本公式如下:The minimum insertion cost formula provided by the embodiment of the present invention is as follows:

若景点与相邻两个景点中的前一个景点和/或后一个景点位于同一个景点集群,If the attraction is located in the same attraction cluster as the previous attraction and/or the latter attraction among the two adjacent attractions,

若景点与前一个景点和后一个景点没有位于同一个景点集群,If the attraction is not located in the same attraction cluster as the previous attraction and the next attraction,

shiftClusterp=shiftp (2)shiftCluster p = shift p (2)

其中,公式(1)和公式(2)中,shiftClusterp为景点P的最小插入成本,shiftp为景点P的最小时间消耗,ClusterParamterP为景点集群参数。其中,ClusterParamterP大于1。Among them, in formula (1) and formula (2), shiftCluster p is the minimum insertion cost of attraction P, shift p is the minimum time consumption of attraction P, and ClusterParamter P is the attraction cluster parameter. Among them, ClusterParamter P is greater than 1.

本发明实施例提供的插入比率公式如下:The insertion ratio formula provided by the embodiment of the present invention is as follows:

其中,ratiop为景点P的插入比率,profitp为用户对于景点P的偏好程度分值,shiftClusterp为景点P的最小插入成本。Among them, ratio p is the insertion ratio of attraction P, profit p is the user's preference score for attraction P, and shiftCluster p is the minimum insertion cost of attraction P.

通过上述公式(1)、(2)和(3)确定待插入景点以及待插入景点的插入位置。The attraction to be inserted and the insertion position of the attraction to be inserted are determined through the above formulas (1), (2) and (3).

本发明实施例通过对景点进行聚类,在插入景点时,会优先插入位于同一景点集群内的其他景点,能够减少路线在行程上的时间消耗,同时也能够减少用户在景点集群之间的转移次数。By clustering scenic spots, the embodiment of the present invention will give priority to inserting other scenic spots located in the same scenic spot cluster when inserting scenic spots, which can reduce the time consumption of the route on the itinerary and can also reduce the transfer of users between scenic spot clusters. frequency.

通常情况下,景点有其各自对应的开放时间和关闭时间,即景点对应的时间窗,比如,对于景点1而言,其开放时间为:上午10:00至下午13:00。因此,在本发明的一个实施例中,本发明实施例提供的路线规划方法还可以包括:针对第一目标路线涵盖的每一景点,根据用户浏览景点的时长和起始时间,确定用户针对景点的游览是否满足景点的开放时间和关闭时间的要求;若针对第一目标路线涵盖的每一景点,均确定出用户针对景点的游览满足景点的开放时间和关闭时间的要求,将待插入景点插入插入位置。Usually, attractions have their own corresponding opening hours and closing times, that is, the time window corresponding to the attraction. For example, for attraction 1, its opening hours are: 10:00 am to 13:00 pm. Therefore, in one embodiment of the present invention, the route planning method provided by the embodiment of the present invention may also include: for each scenic spot covered by the first target route, determine the user's target for the scenic spot based on the duration and starting time of the user browsing the scenic spot. Whether the tour meets the requirements of the opening time and closing time of the scenic spot; if for each scenic spot covered by the first target route, it is determined that the user's tour of the scenic spot meets the requirements of the opening time and closing time of the scenic spot, the attraction to be inserted will be inserted Insert position.

示例性的,假设用户从起始点位置的出发时间为上午9:00。当前路线为:起始点位置—>景点5—>终点位置。待插入景点为景点1,待插入位置为:起始点位置和景点5之间。则第一目标路线为:起始点位置—>景点1—>景点5—>终点位置。For example, it is assumed that the user's departure time from the starting point is 9:00 am. The current route is: starting point location—>attraction 5—>end location. The scenic spot to be inserted is scenic spot 1, and the location to be inserted is: between the starting point position and scenic spot 5. Then the first target route is: starting point location—>attraction 1—>attraction 5—>end location.

由起始点位置到景点1的时长为25分钟,景点1的游览时长为35分钟。由景点1到景点5的时长为35分钟,景点5的游览时长为20分钟。则用户到达景点1的时间为9:25,预计从景点1出发的时间为10:00,用户到达景点5的时间为10:35,从景点5出发的时间为10:50。The duration from the starting point to attraction 1 is 25 minutes, and the tour time to attraction 1 is 35 minutes. The tour time from Attraction 1 to Attraction 5 is 35 minutes, and the tour time of Attraction 5 is 20 minutes. Then the time when the user arrives at attraction 1 is 9:25, and the estimated departure time from attraction 1 is 10:00. The time when the user arrives at attraction 5 is 10:35, and the time when the user departs from attraction 5 is 10:50.

假设景点1和景点5的开放时间均为上午9:00,关闭时间均为下午13:00。Assume that the opening hours of attractions 1 and 5 are both 9:00 am and the closing time is 13:00 pm.

针对景点1确定出用户针对景点1的游览满足景点1的开放时间和关闭时间的要求。For attraction 1, it is determined that the user's tour of attraction 1 meets the requirements of the opening time and closing time of attraction 1.

针对景点5确定出用户针对景点5的游览满足景点5的开放时间和关闭时间的要求。For the scenic spot 5, it is determined that the user's tour of the scenic spot 5 meets the requirements of the opening time and closing time of the scenic spot 5.

则将景点1插入到起始点位置和景点5之间,当前路线为:起始点位置—>景点1—>景点5—>终点位置。Then insert attraction 1 between the starting point position and attraction 5. The current route is: starting point location—>attraction 1—>attraction 5—>end location.

假设景点1的开放时间为上午9:00,关闭时间为上午9:30。景点5的开放时间为上午9:00,关闭时间为下午13:00。Assume that the opening time of attraction 1 is 9:00 am and the closing time is 9:30 am. Attraction 5 opens at 9:00 am and closes at 13:00 pm.

用户预计从景点1出发的时间10:00已超过景点1的关闭时间,则针对景点1确定出用户针对景点1的游览不满足景点1的开放时间和关闭时间的要求。则不插入景点1。The user's estimated departure time of 10:00 from attraction 1 has exceeded the closing time of attraction 1. Therefore, it is determined that the user's tour of attraction 1 does not meet the opening and closing time requirements of attraction 1. Then attraction 1 is not inserted.

假设景点1的开放时间为上午9:00,关闭时间为下午13:00。景点5的开放时间为上午8:40,关闭时间为上午9:40。Assume that the opening time of attraction 1 is 9:00 am and the closing time is 13:00 pm. Attraction 5 opens at 8:40am and closes at 9:40am.

用户预计从景点5出发的时间9:50已超过景点5的关闭时间,则针对景点5确定出用户针对景点5的游览不满足景点5的开放时间和关闭时间的要求。则不插入景点1。The user's expected departure time from attraction 5 at 9:50 has exceeded the closing time of attraction 5. Therefore, it is determined that the user's tour of attraction 5 does not meet the opening and closing time requirements of attraction 5. Then attraction 1 is not inserted.

再示例性的,假设景点1的开放时间为上午9:30,关闭时间为上午12:30。景点5的开放时间为上午9:00,关闭时间为下午13:00。As another example, assume that the opening time of attraction 1 is 9:30 am and the closing time is 12:30 am. Attraction 5 opens at 9:00 am and closes at 13:00 pm.

用户到达景点1的时间9:25,未到达景点1的开放时间。此时,用户可以等待5分钟。用户预计从景点1出发的时间变为10:05。用户到达景点5的时间变为10:40,从景点5出发的时间为10:55。The user arrived at attraction 1 at 9:25 and did not arrive at the opening time of attraction 1. At this point, the user can wait for 5 minutes. The user's expected departure time from attraction 1 changes to 10:05. The user's arrival time at attraction 5 becomes 10:40, and the departure time from attraction 5 is 10:55.

针对景点1确定出用户针对景点1的游览满足景点1的开放时间和关闭时间的要求。For attraction 1, it is determined that the user's tour of attraction 1 meets the requirements of the opening time and closing time of attraction 1.

针对景点5确定出用户针对景点5的游览满足景点5的开放时间和关闭时间的要求。For the scenic spot 5, it is determined that the user's tour of the scenic spot 5 meets the requirements of the opening time and closing time of the scenic spot 5.

则将景点1插入到起始点位置和景点5之间,当前路线为:起始点位置—>景点1—>景点5—>终点位置。Then insert attraction 1 between the starting point position and attraction 5. The current route is: starting point location—>attraction 1—>attraction 5—>end location.

也就是说,景点插入的条件为:插入景点后的路线的游览总时长小于用户设置的游览总时长,且插入景点后的路线涵盖的各个景点均满足各自开放时间和关闭时间的要求,即用户需在景点关闭时间之前离开。In other words, the conditions for inserting scenic spots are: the total tour time of the route after inserting the scenic spots is less than the total tour time set by the user, and each scenic spot covered by the route after inserting the scenic spots meets their respective opening and closing time requirements, that is, the user You must leave before the attraction closes.

在本发明的一个实施例中,本发明实施例提供的路线规划方法还可以包括:对规划出的路线进行优化。具体的优化过程如图4所示。图4示出了本发明实施例提供的路线优化的流程示意图。In one embodiment of the present invention, the route planning method provided by the embodiment of the present invention may further include: optimizing the planned route. The specific optimization process is shown in Figure 4. Figure 4 shows a schematic flowchart of route optimization provided by an embodiment of the present invention.

S401:将规划路线作为中间规划路线。S401: Use the planned route as the intermediate planned route.

S402:比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数。S402: Compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route with the preset maximum number of iterations without improvement.

S403:若次数等于最大迭代次数,将中间规划路线确定为最终规划路线。S403: If the number is equal to the maximum number of iterations, determine the intermediate planned route as the final planned route.

S404:若次数小于最大迭代次数,则从中间规划路线涵盖的景点中删除预设数量个景点,得到第二目标路线,并将次数加1。S404: If the number of times is less than the maximum number of iterations, delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route to obtain the second target route, and add 1 to the number of times.

S405:根据偏好程度分值,从第二目标路线未涵盖的景点中确定待插入景点和待插入景点对于第二目标路线的插入位置。S405: According to the preference score, determine the scenic spots to be inserted and the insertion positions of the scenic spots to be inserted for the second target route from the scenic spots not covered by the second target route.

S406:计算将待插入景点插入插入位置后的第三目标路线对应的游览时长。S406: Calculate the tour duration corresponding to the third target route after inserting the scenic spot to be inserted into the insertion position.

S407:若游览时长不大于游览总时长,则将待插入景点插入插入位置,继续执行S405。S407: If the tour duration is not greater than the total tour duration, insert the attraction to be inserted into the insertion position and continue to execute S405.

S408:若游览时长大于游览总时长,比较当前路线涵盖的景点的第一总偏好程度分值与中间规划路线涵盖的景点的第二总偏好程度分值。若第一总偏好程度分值不大于第二总偏好程度分值,继续执行S402。S408: If the tour duration is greater than the total tour duration, compare the first total preference score of the attractions covered by the current route with the second total preference score of the attractions covered by the intermediate planned route. If the first total preference score is not greater than the second total preference score, continue to execute S402.

S409:若第一总偏好程度分值大于第二总偏好程度分值,则将当前路线作为中间规划路线,并将次数清零;继续执行S402。S409: If the first total preference score is greater than the second total preference score, use the current route as the intermediate planned route and clear the times to zero; continue to execute S402.

S410:若第一总偏好程度分值等于第二总偏好程度分值,比较当前路线对应的第一游览总时长和中间规划路线对应的第二游览总时长。S410: If the first total preference score is equal to the second total preference score, compare the first total tour time corresponding to the current route and the second total tour time corresponding to the intermediate planned route.

S411:若第一游览总时长不大于第二游览总时长,则将当前路线作为中间规划路线,并将次数清零;继续执行S402。S411: If the total duration of the first tour is not greater than the total duration of the second tour, use the current route as the intermediate planned route and clear the times to zero; continue to execute S402.

S412:若第一游览总时长大于第二游览总时长,继续执行S402。S412: If the total duration of the first tour is greater than the total duration of the second tour, continue to execute S402.

在本发明的一个实施例中,从中间规划路线涵盖的景点中删除预设数量个景点,可以从中间规划路线涵盖的景点中删除预设数量个连续的景点。此时,可以指定删除景点的起始景点和数量,从所指定的起始景点连续删除景点。In one embodiment of the present invention, a preset number of scenic spots are deleted from the scenic spots covered by the intermediate planned route, and a preset number of consecutive scenic spots can be deleted from the scenic spots covered by the intermediate planned route. At this time, you can specify the starting attraction and number of attractions to delete, and delete attractions continuously from the specified starting attraction.

在本发明的一个实施例中,从中间规划路线涵盖的景点中删除预设数量个景点,可以从起始点位置的第一个景点开始,往后删除连续的M个景点,再从终点位置前的第一个景点开始,往前删除连续的N个景点,使M与N的和等于预设数量。In one embodiment of the present invention, to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route, you can start from the first scenic spot at the starting point position, then delete M consecutive scenic spots, and then delete the M scenic spots before the end position. Starting from the first scenic spot, delete consecutive N scenic spots forward so that the sum of M and N is equal to the preset number.

在本发明的一个实施例中,从中间规划路线涵盖的景点中删除预设数量个景点,还可以每间隔一个景点删除一个景点,若删除的景点数量不足预设数量,则从删除后得到的路线中,再每间隔一个景点删除一个景点,直到删除的景点的总数量到达预设数量。In one embodiment of the present invention, a preset number of scenic spots are deleted from the scenic spots covered by the intermediate planned route, and one scenic spot can also be deleted every other scenic spot. If the number of deleted scenic spots is less than the preset number, then the scenic spots obtained after deletion will be deleted. During the route, one attraction is deleted every other attraction until the total number of deleted attractions reaches the preset number.

下面通过具体的示例对路线优化过程进行详细说明。The route optimization process is explained in detail below with a specific example.

假设,规划路线为起始点位置—>景点1—>景点5—>终点位置,该规划路线对应的游览时长为155分钟,该规划路线涵盖的景点的总偏好程度分值为10分。预先设定的游览总时长为160分钟。从中间规划路线涵盖的景点中删除预设数量个景点的删除次数初始值为0,预设无改进的最大迭代次数为200。Assume that the planned route is the starting point location -> Attraction 1 -> Attraction 5 -> Ending location, the tour duration corresponding to the planned route is 155 minutes, and the total preference score of the attractions covered by the planned route is 10 points. The preset total tour duration is 160 minutes. The initial value of the number of deletions for deleting a preset number of scenic spots from the scenic spots covered by the intermediate planned route is 0, and the default maximum number of iterations without improvement is 200.

首先将规划路线:起始点位置—>景点1—>景点5—>终点位置作为中间规划路线。First, the planned route: starting point location—>attraction 1—>attraction 5—>end location is used as the intermediate planned route.

此时,删除次数0小于最大迭代次数200,则从中间规划路线:起始点位置—>景点1—>景点5—>终点位置中删除景点。将删除次数加1,此时,删除次数=1。At this time, if the number of deletions 0 is less than the maximum number of iterations 200, then the scenic spots will be deleted from the intermediate planned route: starting point position -> scenic spot 1 -> scenic spot 5 -> end position. Add 1 to the number of deletions. At this time, the number of deletions = 1.

对删除景点后的路线进行景点插入,其中,景点插入过程与上述景点插入过程基本相同,本发明实施例在此不对其进行赘述。Scenic spots are inserted into the route after the scenic spots are deleted, where the scenic spot insertion process is basically the same as the above-mentioned scenic spot insertion process, and will not be described in detail here in the embodiment of the present invention.

假设经过景点删除和插入后的当前路线为:起始点位置—>景点1—>景点4—>终点位置,当前路线对应的游览时长为155分钟,涵盖的景点的总偏好程度分值为13分。当前路线涵盖的景点的总偏好程度分值13分大于中间规划路线涵盖的景点的总偏好程度分值10分。则将当前路线:起始点位置—>景点1—>景点4—>终点位置作为中间规划路线,并将删除次数清零。Assume that the current route after deleting and inserting attractions is: starting point location—>attraction 1—>attraction 4—>end location. The tour duration corresponding to the current route is 155 minutes, and the total preference score of the covered attractions is 13 points. . The total preference score of the scenic spots covered by the current route is 13 points, which is greater than the total preference score of the scenic spots covered by the intermediate planned route, which is 10 points. Then the current route: starting point location -> Attraction 1 -> Attraction 4 -> Ending location will be used as the intermediate planned route, and the number of deletions will be cleared.

此时,删除次数0小于最大迭代次数200,则从中间规划路线:起始点位置—>景点1—>景点4—>终点位置中删除景点。将删除次数加1,此时,删除次数=1。At this time, if the number of deletions 0 is less than the maximum number of iterations 200, then the scenic spots will be deleted from the intermediate planned route: starting point position -> scenic spot 1 -> scenic spot 4 -> end position. Add 1 to the number of deletions. At this time, the number of deletions = 1.

对删除景点后的路线进行景点插入。假设经过景点删除和插入后的当前路线为:起始点位置—>景点2—>景点3—>终点位置,当前路线对应的游览时长为145分钟,涵盖的景点的总偏好程度分值为13分。当前路线涵盖的景点的总偏好程度分值13分等于中间规划路线涵盖的景点的偏好程度分值13分,但当前路线对应的游览时长145分钟小于中间规划路线对应的游览时长145分钟相等。则将当前路线:起始点位置—>景点2—>景点3—>终点位置作为中间规划路线,并将删除次数清零。Insert scenic spots into the route after deleting the scenic spots. Assume that the current route after deleting and inserting attractions is: starting point location—>attraction 2—>attraction 3—>end location. The tour duration corresponding to the current route is 145 minutes, and the total preference score of the covered attractions is 13 points. . The total preference score of 13 points for the attractions covered by the current route is equal to the preference score of 13 points for the attractions covered by the intermediate planned route, but the tour duration of 145 minutes corresponding to the current route is shorter than the 145 minutes of tour duration corresponding to the intermediate planned route. Then the current route: starting point location -> Attraction 2 -> Attraction 3 -> Ending location will be used as the intermediate planned route, and the number of deletions will be cleared.

此时,删除次数0小于最大迭代次数200,则从中间规划路线:起始点位置—>景点2—>景点3—>终点位置中删除景点。将删除次数加1,此时,删除次数=1。At this time, if the number of deletions 0 is less than the maximum number of iterations 200, then the scenic spots will be deleted from the intermediate planned route: starting point location—>attraction 2—>attraction 3—>end location. Add 1 to the number of deletions. At this time, the number of deletions = 1.

对删除景点后的路线进行景点插入。假设经过景点删除和插入后的当前路线为:起始点位置—>景点1—>景点7—>终点位置,当前路线对应的游览时长为150分钟,涵盖的景点的偏好程度分值为13分。当前路线涵盖的景点的总偏好程度分值13分等于中间规划路线涵盖的景点的偏好程度分值13分,但当前路线对应的游览时长150分钟大于中间规划路线对应的游览时长145分钟相等。。则中间规划路线不变还为:起始点位置—>景点2—>景点3—>终点位置。Insert scenic spots into the route after deleting the scenic spots. Assume that the current route after deleting and inserting attractions is: starting point location—>attraction 1—>attraction 7—>end location. The tour duration corresponding to the current route is 150 minutes, and the preference score of the covered attractions is 13 points. The total preference score of 13 points for the scenic spots covered by the current route is equal to the preference score of 13 points for the scenic spots covered by the intermediate planned route, but the tour time corresponding to the current route of 150 minutes is greater than the tour time of 145 minutes corresponding to the intermediate planned route. . Then the intermediate planned route remains unchanged and is: starting point location—>attraction 2—>attraction 3—>end location.

此时,删除次数1小于最大迭代次数200,则从中间规划路线:起始点位置—>景点2—>景点3—>终点位置中删除景点。将删除次数加1,此时,删除次数=2。At this time, if the number of deletions 1 is less than the maximum number of iterations 200, then the scenic spots will be deleted from the intermediate planned route: starting point location—>attraction 2—>attraction 3—>end location. Add 1 to the number of deletions. At this time, the number of deletions = 2.

对删除景点后的路线进行景点插入。假设经过景点删除和插入后的当前路线为:起始点位置—>景点2—>景点5—>终点位置,当前路线对应的游览时长为145分钟,涵盖的景点的偏好程度分值为12分。当前路线对应的游览时长145分钟等于中间规划路线对应的游览时长145分钟,但当前路线涵盖的景点的偏好程度分值12分小于中间规划路线涵盖的景点的偏好程度分值13分。则中间规划路线不变还为:起始点位置—>景点2—>景点3—>终点位置。Insert scenic spots into the route after deleting the scenic spots. Assume that the current route after deleting and inserting attractions is: starting point location—>attraction 2—>attraction 5—>end location. The tour duration corresponding to the current route is 145 minutes, and the preference score of the covered attractions is 12 points. The tour duration of 145 minutes corresponding to the current route is equal to the tour duration of 145 minutes corresponding to the intermediate planned route, but the preference score of the attractions covered by the current route of 12 points is smaller than the preference score of the attractions covered by the intermediate planned route of 13 points. Then the intermediate planned route remains unchanged and is: starting point location—>attraction 2—>attraction 3—>end location.

此时,删除次数2小于最大迭代次数200,则从中间规划路线:起始点位置—>景点2—>景点3—>终点位置中删除景点。将删除次数加1,此时,删除次数=3。对删除景点后的路线进行景点插入。At this time, if the number of deletions 2 is less than the maximum number of iterations 200, then the scenic spots will be deleted from the intermediate planned route: starting point location—>attraction 2—>attraction 3—>end location. Add 1 to the number of deletions. At this time, the number of deletions = 3. Insert scenic spots into the route after deleting the scenic spots.

若删除次数等于最大迭代次数200,则将中间规划路线确定为最终规划路线。If the number of deletions is equal to the maximum number of iterations 200, the intermediate planned route is determined as the final planned route.

示例性的,假设对于中间规划路线:起始点位置—>景点2—>景点3—>终点位置。删除次数已达200次,可以理解的是,当删除次数达到200次数,每次删除和插入景点后的路线的游览总时长均不小于中间规划路线对应的游览总时长,且每次删除和插入景点后的路线涵盖的景点的总偏好程度分值均不大于中间规划路线涵盖的景点的总偏好程度分值,此时,将中间规划路线:起始点位置—>景点2—>景点3—>终点位置确定为最终规划路线。For example, assume that for the intermediate planned route: starting point location—>attraction 2—>attraction 3—>end location. The number of deletions has reached 200 times. It is understandable that when the number of deletions reaches 200 times, the total tour time of the route after each deletion and insertion of an attraction is not less than the total tour time corresponding to the intermediate planned route, and each deletion and insertion The total preference score of the scenic spots covered by the route after the scenic spot is not greater than the total preference score of the scenic spots covered by the intermediate planned route. At this time, the intermediate planned route will be: starting point location -> scenic spot 2 -> scenic spot 3 -> The final location is determined as the final planned route.

在本发明的一个实施例中,在利用上述过程过程优化路线的过程中,可以在每经过1/4的最大迭代次数时,将用于计算景点的最小插入成本的景点集群参数进行减少。示例性的,假设景点集群参数ClusterParamter初始值为1.2。当删除次数=50时,将景点集群参数ClusterParamter减少0.1,此时,ClusterParamter=1.1。当删除次数=100时,将景点集群参数ClusterPa再减少0.1,此时,ClusterParamter=1。当删除次数=150时,将景点集群参数ClusterParamter再减少0.1,此时,ClusterParamter=0.9。In one embodiment of the present invention, in the process of optimizing the route using the above process, the scenic spot cluster parameters used to calculate the minimum insertion cost of the scenic spot can be reduced every time 1/4 of the maximum number of iterations is passed. For example, assume that the initial value of the attraction cluster parameter ClusterParamter is 1.2. When the number of deletions = 50, reduce the attraction cluster parameter ClusterParamter by 0.1. At this time, ClusterParamter = 1.1. When the number of deletions = 100, reduce the attraction cluster parameter ClusterPa by 0.1. At this time, ClusterParamter = 1. When the number of deletions = 150, reduce the attraction cluster parameter ClusterParamter by 0.1. At this time, ClusterParamter = 0.9.

也就是说,优化后的路线需要满足下述条件1或条件2。In other words, the optimized route needs to satisfy the following condition 1 or condition 2.

条件1:优化后的路线涵盖的景点的总偏好程度分值比优化前的路线涵盖的景点的总偏好程度分值高。Condition 1: The total preference score of the scenic spots covered by the optimized route is higher than the total preference score of the scenic spots covered by the pre-optimized route.

条件2:优化后的路线涵盖的景点的总偏好程度分值与优化前的路线涵盖的景点的总偏好程度分值相等。但优化后的路线对应的总游览时长比优化前的路线对应的总游览时长短。Condition 2: The total preference score of the scenic spots covered by the optimized route is equal to the total preference score of the scenic spots covered by the pre-optimized route. However, the total tour duration corresponding to the optimized route is shorter than the total tour duration corresponding to the route before optimization.

需要说明的是,条件1和条件2的前提为:优化后的路线对应的总游览时长比用户设置的游览时长短。It should be noted that the premise of Condition 1 and Condition 2 is that the total tour duration corresponding to the optimized route is shorter than the tour duration set by the user.

图5示出了本发明实施例提供的路线规划的结果示意图。Figure 5 shows a schematic diagram of the route planning results provided by the embodiment of the present invention.

图6示出了本发明实施例规划出的路线的总时长与现有技术规划出的路线的总时长的对比图。由图6可见,当用户设置的游览总时长较短时,本发明实施例规划出的路线的总时长与现有技术规划出的路线的总时长基本相同。当用户设置的游览总时长较长时,本发明实施例规划出的路线的总时长要比现有技术规划出的路线的总时长短,能够节省用户的游览时间。通常情况下,游览一个景区需要的时长基本在两个半小时以上,更有甚者,有的景区游览需要至少4、5个小时,比如,颐和园和承德避暑山庄等等。Figure 6 shows a comparison diagram of the total duration of the route planned by the embodiment of the present invention and the total duration of the route planned by the prior art. It can be seen from Figure 6 that when the total tour duration set by the user is short, the total duration of the route planned by the embodiment of the present invention is basically the same as the total duration of the route planned by the prior art. When the total duration of the tour set by the user is long, the total duration of the route planned by the embodiment of the present invention is shorter than the total duration of the route planned by the prior art, which can save the user's tour time. Under normal circumstances, the time required to visit a scenic spot is basically more than two and a half hours. What's more, some scenic spots require at least 4 or 5 hours to visit, such as the Summer Palace and Chengde Summer Resort, etc.

图7示出了本发明实施例规划出路线的耗时时间和现有技术规划出路线的耗时时间的对比图。由图7可以看出,本发明实施例规划出路线的耗时时间与现有技术规划出路线的耗时时间相差约1000毫秒(1秒),对于用户来说也是可以接受的。FIG. 7 shows a comparison of the time it takes to plan a route according to the embodiment of the present invention and the time it takes to plan a route using the prior art. It can be seen from Figure 7 that the time taken to plan a route according to the embodiment of the present invention is about 1000 milliseconds (1 second) different from the time taken to plan a route using the prior art, which is acceptable to users.

需要说明的是,上述以10个景点为例进行说明,仅为本发明的一具体实例,并不构成对本发明的限定。It should be noted that the above description using 10 scenic spots as examples is only a specific example of the present invention and does not constitute a limitation of the present invention.

本发明实施例的路线规划方法,根据用户针对景点的偏好程度分值,来进行路线规划,能够使规划出的路线满足用户的偏好要求。The route planning method of the embodiment of the present invention performs route planning based on the user's preference score for scenic spots, so that the planned route can meet the user's preference requirements.

与上述的方法实施例相对应,本发明实施例还提供一种路线规划装置。如图8所示,图8示出了本发明实施例提供的路线规划装置的结构示意图。路线规划装置可以包括:Corresponding to the above method embodiments, embodiments of the present invention also provide a route planning device. As shown in FIG. 8 , FIG. 8 shows a schematic structural diagram of a route planning device provided by an embodiment of the present invention. Route planning devices may include:

获得模块801,用于获得用户的起始点位置、终点位置、游览总时长和用户针对每一景点的偏好程度分值。The obtaining module 801 is used to obtain the user's starting point location, end point location, total tour time, and the user's preference score for each scenic spot.

第一确定模块802,用于根据偏好程度分值,从由起始点位置至终点位置的当前路线未涵盖的景点中,确定待插入景点和待插入景点对于当前路线中的插入位置。The first determination module 802 is used to determine the scenic spots to be inserted and the insertion positions of the scenic spots to be inserted in the current route from the scenic spots not covered by the current route from the starting point position to the end position according to the preference score.

计算模块803,用于计算将待插入景点插入插入位置后的第一目标路线对应的游览时长。The calculation module 803 is used to calculate the tour duration corresponding to the first target route after inserting the scenic spot to be inserted into the insertion position.

插入模块804,用于若游览时长不大于游览总时长,则将待插入景点插入插入位置;并触发第一确定模块802。The insertion module 804 is used to insert the attraction to be inserted into the insertion position if the tour duration is not greater than the total tour duration; and trigger the first determination module 802.

第二确定模块805,用于若游览时长大于游览总时长,将当前路线确定为规划路线。The second determination module 805 is used to determine the current route as the planned route if the tour duration is greater than the total tour duration.

在本发明的一个实施例中,第一确定模块802,包括:In one embodiment of the present invention, the first determination module 802 includes:

插入位置确定单元,用于针对从由起始点位置至终点位置的当前路线未涵盖的景点中的每一景点,计算景点插入当前路线中的相邻两个景点的之间对应的时间消耗;根据时间消耗,确定景点的最小插入成本;将最小插入成本对应的相邻两个景点的之间的位置,作为景点的插入位置;An insertion position determination unit is used to calculate, for each scenic spot not covered by the current route from the starting point position to the end position, the corresponding time consumption between two adjacent scenic spots inserted into the current route; according to Time consumption, determine the minimum insertion cost of the attraction; use the position between two adjacent attractions corresponding to the minimum insertion cost as the insertion location of the attraction;

待插入景点确定单元,用于针对每一景点,根据偏好程度分值和最小插入成本,计算景点的插入比率;将最高插入比率对应的景点,作为待插入景点。The scenic spot determination unit to be inserted is used to calculate the insertion ratio of the scenic spot according to the preference score and the minimum insertion cost for each scenic spot; the scenic spot corresponding to the highest insertion rate is used as the scenic spot to be inserted.

在本发明的一个实施例中,插入位置确定单元,具体用于:In one embodiment of the present invention, the position determination unit is inserted, specifically for:

若景点与相邻两个景点中的前一个景点和/或后一个景点位于同一个景点集群,将最小时间消耗与景点集群对应的景点集群参数值的比值,作为景点的最小插入成本;If an attraction is located in the same attraction cluster as the previous and/or next attraction among two adjacent attractions, the ratio of the minimum time consumption to the attraction cluster parameter value corresponding to the attraction cluster will be used as the minimum insertion cost of the attraction;

若景点与前一个景点和后一个景点没有位于同一个景点集群,将最小时间消耗,作为景点的最小插入成本。If the attraction is not located in the same attraction cluster as the previous attraction or the next attraction, the minimum time consumption will be used as the minimum insertion cost of the attraction.

在本发明的一个实施例中,本发明实施例提供的路线规划装置还包括:In one embodiment of the present invention, the route planning device provided by the embodiment of the present invention further includes:

第三确定模块,用于针对第一目标路线涵盖的每一景点,根据用户浏览景点的时长和起始时间,确定用户针对景点的游览是否满足景点的开放时间和关闭时间的要求;若针对第一目标路线涵盖的每一景点,均确定出用户针对景点的游览满足景点的开放时间和关闭时间的要求,触发插入模块。The third determination module is used to determine, for each scenic spot covered by the first target route, whether the user's tour of the scenic spot meets the requirements of the opening time and closing time of the scenic spot based on the duration and starting time of the user's browsing of the scenic spot; For each scenic spot covered by a target route, it is determined that the user's visit to the scenic spot meets the opening time and closing time requirements of the scenic spot, and the insertion module is triggered.

在本发明的一个实施例中,本发明实施例提供的路线规划装置还包括:In one embodiment of the present invention, the route planning device provided by the embodiment of the present invention further includes:

路线优化模块,用于将规划路线作为中间规划路线;Route optimization module, used to use the planned route as an intermediate planned route;

比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数;Compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route with the preset maximum number of iterations without improvement;

若次数等于最大迭代次数,将中间规划路线确定为最终规划路线;If the number is equal to the maximum number of iterations, the intermediate planned route is determined as the final planned route;

若次数小于最大迭代次数,则从中间规划路线涵盖的景点中删除预设数量个景点,得到第二目标路线,并将次数加1;If the number is less than the maximum number of iterations, delete the preset number of scenic spots from the scenic spots covered by the intermediate planned route to obtain the second target route, and add 1 to the number;

根据偏好程度分值,从第二目标路线未涵盖的景点中确定待插入景点和待插入景点对于第二目标路线的插入位置;According to the preference score, determine the scenic spots to be inserted and the insertion positions of the scenic spots to be inserted for the second target route from the scenic spots not covered by the second target route;

计算将待插入景点插入插入位置后的第三目标路线对应的游览时长;Calculate the tour duration corresponding to the third target route after inserting the attraction to be inserted into the insertion position;

若游览时长不大于游览总时长,则将待插入景点插入插入位置;If the tour duration is not greater than the total tour duration, the attractions to be inserted will be inserted into the insertion position;

返回根据偏好程度分值,从第二目标路线未涵盖的景点中确定待插入景点和待插入景点对于第二目标路线的插入位置继续执行,直至游览时长大于游览总时长;Return the preference score, determine the attractions to be inserted from the attractions not covered by the second target route, and continue to perform the insertion position of the attractions to be inserted for the second target route until the tour duration is greater than the total tour duration;

比较当前路线涵盖的景点的第一总偏好程度分值与中间规划路线涵盖的景点的第二总偏好程度分值;Compare the first overall preference score of the attractions covered by the current route with the second overall preference score of the attractions covered by the intermediate planned route;

若第一总偏好程度分值大于第二总偏好程度分值,则将当前路线作为中间规划路线,并将次数清零;返回比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数线继续执行;If the first total preference score is greater than the second total preference score, the current route will be used as the intermediate planned route and the number of times will be cleared; return to compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route. Continue execution with the preset maximum number of iterations line without improvement;

若第一总偏好程度分值等于第二总偏好程度分值,比较当前路线对应的第一游览总时长和中间规划路线对应的第二游览总时长;If the first total preference score is equal to the second total preference score, compare the first total tour time corresponding to the current route and the second total tour time corresponding to the intermediate planned route;

若第一游览总时长不大于第二游览总时长,则将当前路线作为中间规划路线,并将次数清零;返回比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数继续执行;If the total duration of the first tour is not greater than the total duration of the second tour, the current route will be used as the intermediate planned route and the number of times will be cleared to zero; return to compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route with the default Execution continues for the maximum number of iterations without improvement;

若第一游览总时长大于第二游览总时长,则返回比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数继续执行;If the total duration of the first tour is greater than the total duration of the second tour, then return to compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route with the preset maximum number of iterations without improvement and continue execution;

若第一总偏好程度分值不大于第二总偏好程度分值,则返回比较从中间规划路线涵盖的景点中删除预设数量个景点的次数与预设无改进的最大迭代次数继续执行。If the first total preference score is not greater than the second total preference score, then return to compare the number of times to delete a preset number of scenic spots from the scenic spots covered by the intermediate planned route with the preset maximum number of iterations without improvement and continue execution.

本发明实施例的路线规划装置,根据用户针对景点的偏好程度分值,来进行路线规划,能够使规划出的路线满足用户的偏好要求。The route planning device in the embodiment of the present invention performs route planning according to the user's preference score for scenic spots, so that the planned route can meet the user's preference requirements.

图9示出了能够实现根据本发明实施例的路线规划方法及装置的计算设备的示例性硬件架构的结构图。如图9所示,计算设备900包括输入设备901、输入接口902、中央处理器903、存储器904、输出接口905、以及输出设备906。其中,输入接口902、中央处理器903、存储器25 904、以及输出接口905通过总线910相互连接,输入设备901和输出设备906分别通过输入接口902和输出接口905与总线910连接,进而与计算设备900的其他组件连接。FIG. 9 shows a structural diagram of an exemplary hardware architecture of a computing device capable of implementing the route planning method and apparatus according to embodiments of the present invention. As shown in FIG. 9 , computing device 900 includes an input device 901 , an input interface 902 , a central processing unit 903 , a memory 904 , an output interface 905 , and an output device 906 . Among them, the input interface 902, the central processing unit 903, the memory 25 904, and the output interface 905 are connected to each other through the bus 910. The input device 901 and the output device 906 are connected to the bus 910 through the input interface 902 and the output interface 905 respectively, and then to the computing device. 900's other components are connected.

具体地,输入设备901接收来自外部的输入信息,并通过输入接口902将输入信息传送到中央处理器903;中央处理器903基于存储器904中存储的计算机可执行指令对输入信息进行处理以生成输出信息,将输出信息临时或者永久地存储在存储器904中,然后通过输出接口905将输出信息传送到输出设备906;输出设备906将输出信息输出到计算设备900的外部供用户使用。Specifically, the input device 901 receives input information from the outside and transmits the input information to the central processor 903 through the input interface 902; the central processor 903 processes the input information based on computer-executable instructions stored in the memory 904 to generate output. Information, the output information is temporarily or permanently stored in the memory 904, and then the output information is transmitted to the output device 906 through the output interface 905; the output device 906 outputs the output information to the outside of the computing device 900 for use by the user.

也就是说,图9所示的计算设备也可以被实现为路线规划设备,该路线规划设备可以包括:存储有计算机可执行指令的存储器;以及处理器,该处理器在执行计算机可执行指令时可以实现结合图2和图8描述的路线规划方法和装置。That is to say, the computing device shown in Figure 9 can also be implemented as a route planning device. The route planning device can include: a memory storing computer-executable instructions; and a processor, which when executing the computer-executable instructions The route planning method and device described in conjunction with Figures 2 and 8 can be implemented.

本发明实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令;该计算机程序指令被处理器执行时实现本发明实施例提供的路线规划方法。Embodiments of the present invention also provide a computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, the route planning method provided by the embodiment of the present invention is implemented.

需要明确的是,本发明并不局限于上文所描述并在图中示出的特定配置和处理。为了简明起见,这里省略了对已知方法的详细描述。在上述实施例中,描述和示出了若干具体的步骤作为示例。但是,本发明的方法过程并不限于所描述和示出的具体步骤,本领域的技术人员可以在领会本发明的精神后,作出各种改变、修改和添加,或者改变步骤之间的顺序。It is to be understood that this invention is not limited to the specific arrangements and processes described above and illustrated in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications and additions, or change the order between steps after understanding the spirit of the present invention.

以上所述的结构框图中所示的功能块可以实现为硬件、软件、固件或者它们的组合。当以硬件方式实现时,其可以例如是电子电路、专用集成电路(ASIC)、适当的固件、插件、功能卡等等。当以软件方式实现时,本发明的元素是被用于执行所需任务的程序或者代码段。程序或者代码段可以存储在机器可读介质中,或者通过载波中携带的数据信号在传输介质或者通信链路上传送。“机器可读介质”可以包括能够存储或传输信息的任何介质。机器可读介质的例子包括电子电路、半导体存储器设备、ROM、闪存、可擦除ROM(EROM)、软盘、CD-ROM、光盘、硬盘、光纤介质、射频(RF)链路,等等。代码段可以经由诸如因特网、内联网等的计算机网络被下载。The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, or the like. When implemented in software, elements of the invention are programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted over a transmission medium or communications link via a data signal carried in a carrier wave. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. Code segments may be downloaded via computer networks such as the Internet, intranets, and the like.

还需要说明的是,本发明中提及的示例性实施例,基于一系列的步骤或者装置描述一些方法或系统。但是,本发明不局限于上述步骤的顺序,也就是说,可以按照实施例中提及的顺序执行步骤,也可以不同于实施例中的顺序,或者若干步骤同时执行。It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps. That is to say, the steps may be performed in the order mentioned in the embodiments, or may be different from the order in the embodiments, or several steps may be performed simultaneously.

以上所述,仅为本发明的具体实施方式,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。应理解,本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。The above are only specific implementations of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems, modules and units can be referred to the foregoing method embodiments. The corresponding process will not be described again here. It should be understood that the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be covered. within the protection scope of the present invention.

Claims (8)

1. A method of route planning, the method comprising:
obtaining a starting point position, an end point position, a total tour duration of a user and preference degree scores of the user for each scenic spot;
determining scenery points to be inserted and the insertion positions of the scenery points to be inserted in the current route from the starting point position to the end point position according to the preference degree score;
calculating the tour time length corresponding to the first target route after the scenic spot to be inserted is inserted into the insertion position;
If the tour time is not longer than the tour total time, inserting the scenic spot to be inserted into the insertion position;
returning the preference degree score, and determining scenic spots to be inserted and the scenic spot to be inserted to be continuously executed for the insertion position in the current route from the starting point position to the end point position in scenic spots which are not covered by the current route;
if the tour time length is greater than the tour total time length, determining the current route as a planned route;
the determining, according to the preference degree score, the scenic spot to be inserted and the insertion position of the scenic spot to be inserted in the current route from the starting point position to the end point position, wherein the scenic spot is not covered by the current route, includes:
for each of the attractions not covered by the current route from the starting point location to the ending point location, calculating a corresponding time consumption between insertion of the attraction into two neighboring attractions in the current route; determining a minimum insertion cost of the attraction according to the time consumption; taking the position between two adjacent scenic spots corresponding to the minimum insertion cost as the insertion position of the scenic spot;
Calculating the insertion ratio of each scenic spot according to the preference degree score and the minimum insertion cost; taking the scenic spot corresponding to the highest insertion rate as the scenic spot to be inserted;
the insertion ratio is expressed as follows:
wherein the ratio p For the insertion ratio, profit p For the preference degree score, a shiftCluster p For the minimum insertion cost;
the determining the minimum insertion cost of the scenic spot according to the time consumption comprises the following steps:
if the scenic spot and the former scenic spot and/or the latter scenic spot in the two adjacent scenic spots are/is located in the same scenic spot cluster, the ratio of the scenic spot cluster parameter values corresponding to the scenic spot cluster with the minimum time consumption is used as the minimum insertion cost of the scenic spot;
and if the scenic spot is not located in the same scenic spot cluster with the previous scenic spot and the next scenic spot, the minimum time consumption is used as the minimum insertion cost of the scenic spot.
2. The method of claim 1, wherein prior to said inserting the point of interest to be inserted into the insertion location, the method further comprises:
for each scenic spot covered by the first target route, determining whether the tour of the scenic spot by the user meets the requirements of the opening time and the closing time of the scenic spot according to the duration and the starting time of the user for browsing the scenic spot; and if each scenic spot covered by the first target route is determined that the tour of the scenic spot by the user meets the requirements of the opening time and the closing time of the scenic spot, inserting the scenic spot to be inserted into the insertion position.
3. The method according to claim 1, wherein the method further comprises:
taking the planned route as an intermediate planned route;
comparing the number of times of deleting a preset number of scenic spots from scenic spots covered by the intermediate planning route with the preset maximum iteration number without improvement;
if the number of times is equal to the maximum iteration number, determining the intermediate planned route as a final planned route;
if the number of times is smaller than the maximum iteration number, deleting a preset number of scenic spots from scenic spots covered by the intermediate planning route to obtain a second target route, and adding 1 to the number of times;
determining scenery points to be inserted and the insertion positions of the scenery points to be inserted to the second target route from scenery points which are not covered by the second target route according to the preference degree scores;
calculating the tour time length corresponding to the third target route after the scenic spot to be inserted is inserted into the insertion position;
if the tour time is not longer than the tour total time, inserting the scenic spot to be inserted into the insertion position;
returning the score according to the preference degree, and determining scenic spots to be inserted from scenic spots which are not covered by the second target route and the insertion positions of the scenic spots to be inserted to the second target route to continue execution until the tour time is longer than the tour total time;
Comparing the first total preference degree score of the scenic spots covered by the current route with the second total preference degree score of the scenic spots covered by the middle planning route;
if the first total preference degree score is larger than the second total preference degree score, taking the current route as the middle planning route, and clearing the times; returning to the comparison, and continuously executing the times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and a preset maximum iteration time line without improvement;
if the first total preference degree score is equal to the second total preference degree score, comparing a first total tour duration corresponding to the current route with a second total tour duration corresponding to the intermediate planning route;
if the first total tour duration is not greater than the second total tour duration, taking the current route as the intermediate planning route, and clearing the times; returning to the comparison, and continuously executing the times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration times without improvement;
if the first total time length of the tour is longer than the second total time length of the tour, returning to the comparison, and continuously executing the comparison of the number of times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration number without improvement;
And if the first total preference degree score is not greater than the second total preference degree score, returning to the comparison, and continuing to execute the comparison of the number of times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration number without improvement.
4. A path planning apparatus, the apparatus comprising:
the acquisition module is used for acquiring the starting point position, the end point position, the total tour duration and the preference degree score of the user for each scenic spot;
the first determining module is used for determining scenery spots to be inserted and the insertion positions of the scenery spots to be inserted in the current route from the starting point position to the end point position according to the preference degree score;
the calculation module is used for calculating the tour time length corresponding to the first target route after the scenic spot to be inserted is inserted into the insertion position;
the inserting module is used for inserting the scenic spot to be inserted into the inserting position if the tour time is not greater than the tour total time; triggering the first determining module;
the second determining module is used for determining the current route as a planned route if the tour time length is greater than the tour total time length;
The first determining module includes:
an insertion position determining unit configured to calculate, for each of the attractions not covered by the current route from the start point position to the end point position, a corresponding time consumption between two neighboring attractions of the attraction insertion in the current route; determining a minimum insertion cost of the attraction according to the time consumption; taking the position between two adjacent scenic spots corresponding to the minimum insertion cost as the insertion position of the scenic spot;
a to-be-inserted scenic spot determining unit, configured to calculate, for each scenic spot, an insertion ratio of the scenic spot according to the preference degree score and the minimum insertion cost; taking the scenic spot corresponding to the highest insertion rate as the scenic spot to be inserted; the insertion ratio is expressed as follows:
wherein the ratio p For the insertion ratio, profit p For the preference degree score, a shiftCluster p For the minimum insertion cost;
the insertion position determining unit is specifically configured to:
if the scenic spot and the former scenic spot and/or the latter scenic spot in the two adjacent scenic spots are/is located in the same scenic spot cluster, the ratio of the scenic spot cluster parameter values corresponding to the scenic spot cluster with the minimum time consumption is used as the minimum insertion cost of the scenic spot;
And if the scenic spot is not located in the same scenic spot cluster with the previous scenic spot and the next scenic spot, the minimum time consumption is used as the minimum insertion cost of the scenic spot.
5. The apparatus of claim 4, wherein the apparatus further comprises:
the third determining module is used for determining whether the tour of the scenic spot by the user meets the requirements of the opening time and the closing time of the scenic spot according to the duration and the starting time of the user for browsing the scenic spot for each scenic spot covered by the first target route; and if each scenic spot covered by the first target route is aimed at, determining that the requirement of the opening time and the closing time of the scenic spot is met by the user for the sightseeing of the scenic spot, and triggering an inserting module.
6. The apparatus of claim 4, wherein the apparatus further comprises:
the route optimization module is used for taking the planned route as an intermediate planned route;
comparing the number of times of deleting a preset number of scenic spots from scenic spots covered by the intermediate planning route with the preset maximum iteration number without improvement;
if the number of times is equal to the maximum iteration number, determining the intermediate planned route as a final planned route;
If the number of times is smaller than the maximum iteration number, deleting a preset number of scenic spots from scenic spots covered by the intermediate planning route to obtain a second target route, and adding 1 to the number of times;
determining scenery points to be inserted and the insertion positions of the scenery points to be inserted to the second target route from scenery points which are not covered by the second target route according to the preference degree scores;
calculating the tour time length corresponding to the third target route after the scenic spot to be inserted is inserted into the insertion position;
if the tour time is not longer than the tour total time, inserting the scenic spot to be inserted into the insertion position;
returning the score according to the preference degree, and determining scenic spots to be inserted from scenic spots which are not covered by the second target route and the insertion positions of the scenic spots to be inserted to the second target route to continue execution until the tour time is longer than the tour total time;
comparing the first total preference degree score of the scenic spots covered by the current route with the second total preference degree score of the scenic spots covered by the middle planning route;
if the first total preference degree score is larger than the second total preference degree score, taking the current route as the middle planning route, and clearing the times; returning to the comparison, and continuously executing the times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and a preset maximum iteration time line without improvement;
If the first total preference degree score is equal to the second total preference degree score, comparing a first total tour duration corresponding to the current route with a second total tour duration corresponding to the intermediate planning route;
if the first total tour duration is not greater than the second total tour duration, taking the current route as the intermediate planning route, and clearing the times; returning to the comparison, and continuously executing the times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration times without improvement;
if the first total time length of the tour is longer than the second total time length of the tour, returning to the comparison, and continuously executing the comparison of the number of times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration number without improvement;
and if the first total preference degree score is not greater than the second total preference degree score, returning to the comparison, and continuing to execute the comparison of the number of times of deleting the preset number of scenic spots from scenic spots covered by the intermediate planning route and the preset maximum iteration number without improvement.
7. A route planning device, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor;
A route planning method according to any one of claims 1 to 3 when the processor executes the computer program.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements a route planning method according to any of claims 1 to 3.
CN201811422192.XA 2018-11-27 2018-11-27 Route planning method, device, equipment and storage medium Active CN111222667B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811422192.XA CN111222667B (en) 2018-11-27 2018-11-27 Route planning method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811422192.XA CN111222667B (en) 2018-11-27 2018-11-27 Route planning method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111222667A CN111222667A (en) 2020-06-02
CN111222667B true CN111222667B (en) 2023-09-19

Family

ID=70806264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811422192.XA Active CN111222667B (en) 2018-11-27 2018-11-27 Route planning method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111222667B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541021B (en) * 2020-12-10 2024-05-03 北京百度网讯科技有限公司 Route evaluation method, scenic spot tour estimated time length calculation method and device
CN112465176B (en) * 2020-12-10 2022-05-10 南京领行科技股份有限公司 Driving route planning method and device
CN113689025B (en) * 2021-07-08 2023-12-01 湖南中惠旅智能科技有限责任公司 Scenic spot playing item planning method and system based on electronic map
CN113869558A (en) * 2021-09-03 2021-12-31 云南腾云信息产业有限公司 Route recommendation method and device, computer equipment and storage medium
JP2024030810A (en) * 2022-08-25 2024-03-07 トヨタ自動車株式会社 Driving route generation device, driving route generation method, driving route generation program
CN116878484A (en) * 2023-07-11 2023-10-13 深圳特为科创信息技术有限公司 A route navigation method and system based on big data

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1871499A (en) * 2003-09-30 2006-11-29 株式会社建伍 Guide route search device and guide route search method
CN101236095A (en) * 2008-03-06 2008-08-06 倚天资讯股份有限公司 Navigation System
TW200936988A (en) * 2008-02-19 2009-09-01 E Ten Information Sys Co Ltd Navigation system, method of automatically planning trip itinerary, computer readable recording media with stored program and computer program product with stored program
CN104036441A (en) * 2013-03-06 2014-09-10 中兴通讯股份有限公司 Tourist guide system and tourist guide method
WO2016044855A1 (en) * 2014-09-19 2016-03-24 Arris Enterprises, Inc. Systems and methods for street level routing
CN106447097A (en) * 2016-09-20 2017-02-22 北京工业大学 Method for inquiring limited longest frequent path
CN107025495A (en) * 2015-12-17 2017-08-08 Sap欧洲公司 The complexity for determining the route for carrying containers is reduced based on user's selection
CN107704508A (en) * 2017-08-31 2018-02-16 北京空间飞行器总体设计部 The data fusion and data digging method of polymorphic type magnanimity extraterrestrial target data
CN107748937A (en) * 2017-11-03 2018-03-02 哈尔滨工业大学 A kind of ratio section preference guiding multiobiective decision optimum method based on MOEAD
CN107832872A (en) * 2017-10-19 2018-03-23 金华航大北斗应用技术有限公司 Dynamic programming method for scenic spot route
CN108108847A (en) * 2017-12-29 2018-06-01 合肥工业大学 A kind of paths planning method of electric business logistics last one kilometer dispatching

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1871499A (en) * 2003-09-30 2006-11-29 株式会社建伍 Guide route search device and guide route search method
TW200936988A (en) * 2008-02-19 2009-09-01 E Ten Information Sys Co Ltd Navigation system, method of automatically planning trip itinerary, computer readable recording media with stored program and computer program product with stored program
CN101236095A (en) * 2008-03-06 2008-08-06 倚天资讯股份有限公司 Navigation System
CN104036441A (en) * 2013-03-06 2014-09-10 中兴通讯股份有限公司 Tourist guide system and tourist guide method
WO2016044855A1 (en) * 2014-09-19 2016-03-24 Arris Enterprises, Inc. Systems and methods for street level routing
CN107025495A (en) * 2015-12-17 2017-08-08 Sap欧洲公司 The complexity for determining the route for carrying containers is reduced based on user's selection
CN106447097A (en) * 2016-09-20 2017-02-22 北京工业大学 Method for inquiring limited longest frequent path
CN107704508A (en) * 2017-08-31 2018-02-16 北京空间飞行器总体设计部 The data fusion and data digging method of polymorphic type magnanimity extraterrestrial target data
CN107832872A (en) * 2017-10-19 2018-03-23 金华航大北斗应用技术有限公司 Dynamic programming method for scenic spot route
CN107748937A (en) * 2017-11-03 2018-03-02 哈尔滨工业大学 A kind of ratio section preference guiding multiobiective decision optimum method based on MOEAD
CN108108847A (en) * 2017-12-29 2018-06-01 合肥工业大学 A kind of paths planning method of electric business logistics last one kilometer dispatching

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"机场接送服务中基于协作的车次分配与调度方法研究";许争争;《中国博士学位论文全文数据库工程科技Ⅱ辑》;20170315;第C031-13页 *

Also Published As

Publication number Publication date
CN111222667A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111222667B (en) Route planning method, device, equipment and storage medium
US8681635B2 (en) Computer-implemented systems and methods for planning a route
US9892532B2 (en) Apparatus and method for generating a shortest-path tree in a graph
US10404576B2 (en) Constrained shortest path determination in a network
CN102506849B (en) Method for finding the shortest path with constraints
CN107687859A (en) Most short method for searching based on A star algorithms
TW201700955A (en) Path planning method and device
CN107196858A (en) A kind of k solving the shortest path methods for considering polymorphic type constraint
KR20150145169A (en) Method and apparatus for determining reachable area based on road network
CN110146072A (en) A kind of paths planning method, server and readable storage medium storing program for executing
US9674083B2 (en) Path calculation order deciding method, program and calculating apparatus
CN114091763B (en) Route planning method, device, readable medium and electronic device
JP5391322B2 (en) Route calculation method, program, and calculation device
CN113992259B (en) Method for constructing time slot resource expansion graph
CN107332770A (en) One kind must be through a routed path system of selection
CN110247805B (en) Method and device for identifying propagation key nodes based on K-shell decomposition
CN113347083B (en) Network path determination and switching method, device, equipment, medium and program product
CN113987995A (en) Wiring scheme determination method and device, electronic equipment and storage medium
CN112807682A (en) Path searching method, terminal and computer readable storage medium
CN106034266B (en) Optical route generation method and device
US20130010643A1 (en) Method and apparatus for loop path search in mesh network
CN110278154B (en) Routing node position optimization method and device and terminal equipment
JP5506538B2 (en) Route calculation method, apparatus and program
CN116679712B (en) Efficient exploration decision-making method for indoor environment robot based on generalized voronoi diagram
CN115406459B (en) Path determination method, path determination device, nonvolatile storage medium and computer equipment

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