CN114817696A - Feature acquisition, route sorting method, device, electronic device and storage medium - Google Patents
Feature acquisition, route sorting method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN114817696A CN114817696A CN202110121899.2A CN202110121899A CN114817696A CN 114817696 A CN114817696 A CN 114817696A CN 202110121899 A CN202110121899 A CN 202110121899A CN 114817696 A CN114817696 A CN 114817696A
- Authority
- CN
- China
- Prior art keywords
- road segment
- route
- segment combination
- combination
- transition probability
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2462—Approximate or statistical queries
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Probability & Statistics with Applications (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Remote Sensing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明实施例提供了一种特征获取、路线排序方法、装置、电子设备及存储介质。特征获取方法包括:获取待处理路线,所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;针对每个路段组合,获取当前路段组合对应的转移概率,所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。本发明实施例中转移概率能够体现两个相接路段之间的关联性,体现从前一路段转移到后一路段的可能性,因此,基于转移概率计算得到的路线特征更加准确。
Embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for feature acquisition and route sorting. The feature acquisition method includes: acquiring a to-be-processed route, the to-be-processed route includes a plurality of road segments connected in sequence, and every two road segments connected in sequence form a road segment combination; for each road segment combination, acquiring the transition corresponding to the current road segment combination probability, the transition probability corresponding to the current road segment combination is used to indicate the probability of transferring from the previous road segment in the current road segment combination to the latter road segment in the current road segment combination; based on the transition probability corresponding to each road segment combination, Calculate the route feature corresponding to the to-be-processed route. In the embodiment of the present invention, the transition probability can reflect the correlation between two adjacent road sections, and the possibility of transferring from the previous road section to the next road section. Therefore, the route feature calculated based on the transition probability is more accurate.
Description
技术领域technical field
本发明涉及数据处理技术领域,特别是涉及一种特征获取、路线排序方法、装置、电子设备及存储介质。The present invention relates to the technical field of data processing, and in particular, to a method, device, electronic device and storage medium for feature acquisition and route sorting.
背景技术Background technique
随着电子地图技术的不断发展,电子地图业务为人们提供了极大的便利。用户输入起点和终点,电子地图可以自动生成多条路线,并为用户进行路线推荐。With the continuous development of electronic map technology, electronic map services have provided people with great convenience. The user inputs the starting and ending points, and the electronic map can automatically generate multiple routes and recommend routes for the user.
在路线推荐过程中,需要获取路线的路线特征进行分析。目前,在获取路线的路线特征的过程中,通常是先获取路线中包含的每个路段的属性,比如道路等级、路段长度等属性;然后基于路线中包含的每个路段的属性统计计算得到该路线的路线特征,比如路线长度、直行路长、转弯数等特征。In the process of route recommendation, it is necessary to obtain the route features of the route for analysis. At present, in the process of obtaining the route features of a route, the attributes of each road section included in the route, such as road grade, road length and other attributes, are usually obtained first; Route characteristics of the route, such as route length, straight road length, number of turns, etc.
但是,上述路线特征获取方式中,主要是基于独立的路段属性进行统计计算,获取到的路线特征的准确性较低。However, in the above method for obtaining route features, statistical calculation is mainly performed based on independent road segment attributes, and the accuracy of the obtained route features is low.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,提出了本发明实施例以便提供一种克服上述问题或者至少部分地解决上述问题的一种特征获取、路线排序方法、装置、电子设备及存储介质。In view of the above problems, embodiments of the present invention are proposed to provide a feature acquisition, route sorting method, apparatus, electronic device, and storage medium that overcome the above problems or at least partially solve the above problems.
第一方面,本发明实施例公开了一种特征获取方法,包括:In a first aspect, an embodiment of the present invention discloses a feature acquisition method, including:
获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;Obtain a route to be processed; the route to be processed includes a plurality of road segments connected in sequence, and every two road segments connected in sequence form a road segment combination;
针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;For each road segment combination, the transition probability corresponding to the current road segment combination is obtained; the transition probability corresponding to the current road segment combination is used to indicate the transition from the previous road segment in the current road segment combination to the next one in the current road segment combination. the probability of a road segment;
基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。Based on the transition probability corresponding to each road segment combination, the route feature corresponding to the to-be-processed route is calculated.
可选地,所述基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征,包括:基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征;和/或,基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征。Optionally, calculating the route feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment includes: calculating the sequence statistical feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment. ; and/or, based on the transition probability corresponding to each road segment combination, calculate the likelihood probability feature corresponding to the route to be processed.
可选地,所述基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征,包括:计算所述各路段组合对应的转移概率的统计值,将所述统计值作为所述待处理路线对应的序列统计特征;其中,所述统计值包括以下至少之一:最大值、最小值、中位数、平均值、标准差。Optionally, calculating the sequence statistical features corresponding to the route to be processed based on the transition probabilities corresponding to the combinations of each road segment includes: calculating a statistical value of the transition probability corresponding to the combination of the various road segments, and using the statistical value As the sequence statistical feature corresponding to the route to be processed; wherein, the statistical value includes at least one of the following: maximum value, minimum value, median, average value, and standard deviation.
可选地,所述基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征,包括:计算所述各路段组合对应的转移概率的乘积,将所述乘积作为所述待处理路线对应的似然概率特征。Optionally, calculating the likelihood probability feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment includes: calculating the product of the transition probability corresponding to the combination of each road segment, and using the product as Likelihood probability feature corresponding to the route to be processed.
可选地,所述获取当前路段组合对应的转移概率,包括:从预先存储的各候选路段组合对应的转移概率中,查询所述当前路段组合对应的转移概率;其中,所述各候选路段组合对应的转移概率,是基于历史路线的相关数据统计得到。Optionally, the acquiring the transition probability corresponding to the current road segment combination includes: querying the transition probability corresponding to the current road segment combination from the pre-stored transition probabilities corresponding to each candidate road segment combination; wherein, each candidate road segment combination The corresponding transition probability is obtained by statistics based on the relevant data of the historical route.
可选地,所述各候选路段组合对应的转移概率通过如下方式得到:将历史路线中,顺序相接的每两个候选路段组成一个候选路段组合;针对每个候选路段组合,统计当前候选路段组合中的前一候选路段在所述历史路线中出现的第一总次数,以及统计所述当前候选路段组合在所述历史路线中出现的第二总次数;基于所述第一总次数与所述第二总次数,计算所述当前候选路段组合对应的转移概率。Optionally, the transition probability corresponding to each candidate road segment combination is obtained in the following manner: every two candidate road segments connected in sequence in the historical route form a candidate road segment combination; for each candidate road segment combination, count the current candidate road segments. The first total number of times the previous candidate road segment in the combination appears in the historical route, and the second total number of times that the current candidate road segment combination appears in the historical route is counted; based on the first total number of times and all The second total number of times is used to calculate the transition probability corresponding to the current candidate road segment combination.
第二方面,本发明实施例公开了一种路线排序方法,包括:In a second aspect, an embodiment of the present invention discloses a method for sorting routes, including:
获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;Obtain a route to be processed; the route to be processed includes a plurality of road segments connected in sequence, and every two road segments connected in sequence form a road segment combination;
针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;For each road segment combination, the transition probability corresponding to the current road segment combination is obtained; the transition probability corresponding to the current road segment combination is used to indicate the transition from the previous road segment in the current road segment combination to the next one in the current road segment combination. the probability of a road segment;
基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征;Calculate the route feature corresponding to the to-be-processed route based on the transition probability corresponding to each road segment combination;
基于所述待处理路线对应的路线特征进行路线排序。Route sorting is performed based on route features corresponding to the routes to be processed.
第三方面,本发明实施例公开了一种特征获取装置,包括:In a third aspect, an embodiment of the present invention discloses a feature acquisition device, including:
第一获取模块,用于获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;a first obtaining module, configured to obtain a route to be processed; the route to be processed includes a plurality of road segments connected in sequence, and each two road segments connected in sequence constitutes a road segment combination;
第二获取模块,用于针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;The second acquiring module is configured to acquire, for each road segment combination, the transition probability corresponding to the current road segment combination; the transition probability corresponding to the current road segment combination is used to indicate the transition from the previous road segment in the current road segment combination to the The probability of the next road segment in the current road segment combination;
第一计算模块,用于基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。The first calculation module is configured to calculate the route feature corresponding to the to-be-processed route based on the transition probability corresponding to each road segment combination.
可选地,所述第一计算模块包括:第一特征计算单元,用于基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征;和/或,第二特征计算单元,用于基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征。Optionally, the first calculation module includes: a first feature calculation unit, configured to calculate the sequence statistical feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment; and/or, a second feature A calculation unit, configured to calculate the likelihood probability feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination.
可选地,所述第一特征计算单元,具体用于计算所述各路段组合对应的转移概率的统计值,将所述统计值作为所述待处理路线对应的序列统计特征;其中,所述统计值包括以下至少之一:最大值、最小值、中位数、平均值、标准差。Optionally, the first feature calculation unit is specifically configured to calculate the statistical value of the transition probability corresponding to the combination of each road segment, and use the statistical value as the sequence statistical feature corresponding to the route to be processed; wherein, the Statistical values include at least one of the following: maximum, minimum, median, mean, standard deviation.
可选地,所述第二特征计算单元,具体用于计算所述各路段组合对应的转移概率的乘积,将所述乘积作为所述待处理路线对应的似然概率特征。Optionally, the second feature calculating unit is specifically configured to calculate the product of the transition probabilities corresponding to the combinations of each road segment, and use the product as the likelihood probability feature corresponding to the route to be processed.
可选地,所述第二获取模块,具体用于从预先存储的各候选路段组合对应的转移概率中,查询所述当前路段组合对应的转移概率;其中,所述各候选路段组合对应的转移概率,是基于历史路线的相关数据统计得到。Optionally, the second obtaining module is specifically configured to query the transition probability corresponding to the current road segment combination from the pre-stored transition probabilities corresponding to each candidate road segment combination; wherein, the transition corresponding to each candidate road segment combination The probability is based on the statistics of the relevant data of the historical route.
可选地,所述各候选路段组合对应的转移概率通过如下模块得到:确定模块,用于将历史路线中,顺序相接的每两个候选路段组成一个候选路段组合;统计模块,用于针对每个候选路段组合,统计当前候选路段组合中的前一候选路段在所述历史路线中出现的第一总次数,以及统计所述当前候选路段组合在所述历史路线中出现的第二总次数;第二计算模块,用于基于所述第一总次数与所述第二总次数,计算所述当前候选路段组合对应的转移概率。Optionally, the transition probability corresponding to each candidate road segment combination is obtained by the following modules: a determination module, used for forming a candidate road segment combination for every two candidate road segments connected in sequence in the historical route; a statistics module, used for For each candidate road segment combination, count the first total number of times the previous candidate road segment in the current candidate road segment combination appears in the historical route, and count the second total number of times the current candidate road segment combination appears in the historical route ; a second calculation module, configured to calculate the transition probability corresponding to the current candidate road segment combination based on the first total number of times and the second total number of times.
第四方面,本发明实施例公开了一种路线排序装置,包括:In a fourth aspect, an embodiment of the present invention discloses a route sorting device, including:
第三获取模块,用于获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;The third obtaining module is used to obtain the route to be processed; the route to be processed includes a plurality of road segments connected in sequence, and every two road segments connected in sequence form a road segment combination;
第四获取模块,用于针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;The fourth obtaining module is configured to obtain, for each road segment combination, the transition probability corresponding to the current road segment combination; the transition probability corresponding to the current road segment combination is used to indicate the transition from the previous road segment in the current road segment combination to the The probability of the next road segment in the current road segment combination;
第三计算模块,用于基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征;a third calculation module, configured to calculate the route feature corresponding to the to-be-processed route based on the transition probability corresponding to each road segment combination;
排序模块,用于基于所述待处理路线对应的路线特征进行路线排序。A sorting module, configured to sort the routes based on the route features corresponding to the routes to be processed.
第五方面,本发明实施例公开了一种电子设备,包括:一个或多个处理器;和其上存储有指令的一个或多个机器可读介质;当所述指令由所述一个或多个处理器执行时,使得所述处理器执行如上任一项所述的特征获取方法,或者,执行如上所述的路线排序方法。In a fifth aspect, an embodiment of the present invention discloses an electronic device, comprising: one or more processors; and one or more machine-readable media on which instructions are stored; When executed by each processor, the processor is caused to execute the feature acquisition method described in any one of the above, or execute the route sorting method described above.
第六方面,本发明实施例公开了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上任一项所述的特征获取方法,或者,实现如上所述的路线排序方法。In a sixth aspect, an embodiment of the present invention discloses a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the feature acquisition method described in any of the above, or implements the above-mentioned feature acquisition method. Route sorting method.
本发明实施例中,获取待处理路线,待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;针对每个路段组合,获取当前路段组合对应的转移概率;基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。由此可知,本发明实施例中,由于当前路段组合对应的转移概率用于指示从当前路段组合中的前一路段转移到当前路段组合中的后一路段的概率,转移概率能够体现两个相接路段之间的关联性,体现从前一路段转移到后一路段的可能性,因此基于转移概率计算得到的路线特征更加准确。In the embodiment of the present invention, a to-be-processed route is obtained, the to-be-processed route includes a plurality of road segments connected in sequence, and every two road segments connected in sequence form a road segment combination; for each road segment combination, the transition probability corresponding to the current road segment combination is obtained ; Calculate the route feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination. It can be seen from this that, in the embodiment of the present invention, since the transition probability corresponding to the current road segment combination is used to indicate the probability of transitioning from the previous road segment in the current road segment combination to the latter road segment in the current road segment combination, the transition probability can reflect the two phases. The correlation between the connecting sections reflects the possibility of transferring from the previous section to the next section, so the route features calculated based on the transition probability are more accurate.
附图说明Description of drawings
图1是本发明实施例的一种特征获取方法的步骤流程图。FIG. 1 is a flowchart of steps of a feature acquisition method according to an embodiment of the present invention.
图2是本发明实施例的一种转移概率获取方法的步骤流程图。FIG. 2 is a flow chart of steps of a method for obtaining transition probability according to an embodiment of the present invention.
图3是本发明实施例的一种路段的示意图。FIG. 3 is a schematic diagram of a road section according to an embodiment of the present invention.
图4是本发明实施例的另一种特征获取方法的步骤流程图。FIG. 4 is a flowchart of steps of another feature acquisition method according to an embodiment of the present invention.
图5是本发明实施例的一种路线排序方法的步骤流程图。FIG. 5 is a flow chart of steps of a route sorting method according to an embodiment of the present invention.
图6是本发明实施例的一种特征获取装置的结构框图。FIG. 6 is a structural block diagram of a feature acquisition apparatus according to an embodiment of the present invention.
图7是本发明实施例的另一种特征获取装置的结构框图。FIG. 7 is a structural block diagram of another feature acquisition apparatus according to an embodiment of the present invention.
图8是本发明实施例的一种路线排序装置的结构框图。FIG. 8 is a structural block diagram of a route sorting apparatus according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
路线特征的挖掘对电子地图业务具有重要意义。比如,在路线推荐过程中,先召回多条路线,再对召回的路线进行排序。在路线排序过程中,可以基于路线的路线特征进行排序。本发明实施例的特征获取方法、路线排序方法可以应用于各种具有路线规划需求的业务。比如,外卖配送业务中的路线规划,打车业务中的路线规划,共享单车、共享电车业务中的路线规划,等等。本发明实施例可以应用于具有路线规划功能的服务端。比如,地图业务的服务端等。The mining of route features is of great significance to the electronic map business. For example, in the route recommendation process, multiple routes are recalled first, and then the recalled routes are sorted. During the route sorting process, the sorting can be performed based on the route characteristics of the routes. The feature acquisition method and the route sorting method in the embodiments of the present invention can be applied to various services with route planning requirements. For example, route planning in food delivery business, route planning in taxi-hailing business, route planning in shared bicycle and shared tram business, and so on. The embodiments of the present invention can be applied to a server with a route planning function. For example, the server of the map business, etc.
下面,通过以下各实施例进行详细说明。Hereinafter, detailed description will be given through the following examples.
参照图1,示出了本发明实施例的一种特征获取方法的步骤流程图。Referring to FIG. 1 , a flowchart of steps of a feature acquisition method according to an embodiment of the present invention is shown.
如图1所示,特征获取方法可以包括以下步骤:As shown in Figure 1, the feature acquisition method may include the following steps:
步骤101,获取待处理路线。
待处理路线可以为具有路线特征挖掘需求的路线。比如,在路线推荐业务中,先召回路线,再对召回的路线进行排序,排序后选取排序在前的部分路线进行推荐。其中,召回的每条路线可以作为一条待推荐路线。The to-be-processed route can be a route with route feature mining requirements. For example, in the route recommendation business, the routes are recalled first, and then the recalled routes are sorted. After sorting, some routes in the top order are selected for recommendation. Among them, each recalled route can be used as a route to be recommended.
待处理路线中可以包含顺序相接的多个路段(Link),每个路段可以用该路段对应的路段标识(Link ID)进行表示,因此一条待处理路线由一段有序的路段标识组成。本发明实施例中,将顺序相接的每两个路段组成一个路段组合,因此一个路段组合中包含两个有序的路段标识。The to-be-processed route may contain multiple links (Links) connected in sequence, and each link can be represented by a link ID (Link ID) corresponding to the link. Therefore, a to-be-processed route consists of an ordered segment of link IDs. In the embodiment of the present invention, every two road segments connected in sequence are formed into a road segment combination, so a road segment combination includes two ordered road segment identifiers.
步骤102,针对每个路段组合,获取当前路段组合对应的转移概率。
其中,当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率。The transition probability corresponding to the current road segment combination is used to indicate the probability of transitioning from the previous road segment in the current road segment combination to the latter road segment in the current road segment combination.
步骤103,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。Step 103: Calculate the route feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination.
待处理路线中的每个路段组合对应一个转移概率,基于各路段组合对应的转移概率,可以计算得到待处理路线对应的路线特征。比如,路线特征可以包括从基于各路段组合对应的转移概率选取的具有代表性的数值(比如最大值、最小值、中位数等),路线特征也可以包括各路段组合对应的转移概率经过统计计算后得到的数值,等等。Each road segment combination in the route to be processed corresponds to a transition probability, and based on the transition probability corresponding to each road segment combination, the route feature corresponding to the to-be-processed route can be calculated. For example, the route feature may include representative values (such as the maximum value, minimum value, median, etc.) selected from the transition probabilities corresponding to each road segment combination, and the route feature may also include the statistical transition probability corresponding to each road segment combination. The value obtained after the calculation, and so on.
本发明实施例中,由于当前路段组合对应的转移概率用于指示从当前路段组合中的前一路段转移到当前路段组合中的后一路段的概率,转移概率能够体现两个相接路段之间的关联性,体现从前一路段转移到后一路段的可能性,因此基于转移概率计算得到的路线特征更加准确。In this embodiment of the present invention, since the transition probability corresponding to the current road segment combination is used to indicate the probability of transitioning from the previous road segment in the current road segment combination to the latter road segment in the current road segment combination, the transition probability can reflect the difference between the two adjacent road segments. The correlation of , reflects the possibility of transferring from the previous section to the next section, so the route features calculated based on the transition probability are more accurate.
考虑到现有技术中的路线特征主要源于原始的路段属性,没有充分利用业务侧所积累的大量历史路线的相关数据,并且没有利用到路段序列级别的特征。因此,本发明实施例中,可以预先基于大量的历史路线相关数据,统计得到各路段组合对应的转移概率信息,能够充分地利用业务所积累的历史路线数据,以提高路线特征的准确性。Considering that the route features in the prior art are mainly derived from the original road segment attributes, the large amount of historical route related data accumulated on the service side is not fully utilized, and the road segment sequence level features are not utilized. Therefore, in the embodiment of the present invention, the transition probability information corresponding to each road segment combination can be obtained by statistics based on a large amount of historical route related data in advance, and the historical route data accumulated by the business can be fully utilized to improve the accuracy of route features.
参照图2,示出了本发明实施例的一种转移概率获取方法的步骤流程图。Referring to FIG. 2 , a flowchart of steps of a method for acquiring transition probability according to an embodiment of the present invention is shown.
如图2所示,转移概率获取方法可以包括以下步骤:As shown in Figure 2, the transition probability acquisition method may include the following steps:
步骤201,将历史路线中,顺序相接的每两个候选路段组成一个候选路段组合。Step 201: In the historical route, every two candidate road segments connected in sequence form a candidate road segment combination.
获取大量历史路线。比如,历史路线可以为外卖配送路线、网约车路线、共享单车路线、共享电车路线,等等。针对每种类型的历史路线可以单独进行分析。Get tons of historical routes. For example, historical routes can be takeaway delivery routes, online car-hailing routes, shared bicycle routes, shared tram routes, and so on. A separate analysis can be performed for each type of historical route.
一条历史路线中包含顺序相接的多个候选路段,因此一条历史路线由一段有序的候选路段标识所构成,每个候选路段标识代表所经过的特定路段。针对每条历史路线,将该条历史路线包含的从头到尾顺序相接的每两个候选路段组成一个候选路段组合。A historical route contains multiple candidate road segments connected in sequence, so a historical route is composed of a sequence of candidate road segment identifiers, each candidate road segment identifier represents a specific road segment passed through. For each historical route, every two candidate road segments connected in sequence from the beginning to the end included in the historical route form a candidate road segment combination.
比如,一条历史路线包含的有序的候选路段标识可以为[747084859,747084847,762429485,747084864,747084846,747084862,747084860,747084867,57216329,762429480,747084851,57216328,747084854,667768651,667768650,57197633,762429491,747099272,747099270]。因此,从该历史路线中,可以得到的候选路段组合包括:(747084859,747084847)、(747084847,762429485)、(762429485,747084864)、(747084864,747084846)、(747084846,747084862)、(747084862,747084860)、(747084860,747084867)、(747084867,57216329)、(57216329,762429480)、(762429480,747084851)、(747084851,57216328)、(57216328,747084854)、(747084854,667768651)、(667768651,667768650)、(667768650,57197633)、(57197633,762429491)、(762429491,747099272)、(747099272,747099270)。比如,一条历史路线包含的有序的候选路段标识可以为[747084859,747084847,762429485,747084864,747084846,747084862,747084860,747084867,57216329,762429480,747084851,57216328,747084854,667768651,667768650,57197633,762429491, 747099272, 747099270]. Therefore, from this historical route, the candidate road segment combinations that can be obtained include: (747084859, 747084847), (747084847, 762429485), (762429485, 747084864), (747084864, 747084847), (747084846, 74708462868), (874708462868), 8 )、(747084860,747084867)、(747084867,57216329)、(57216329,762429480)、(762429480,747084851)、(747084851,57216328)、(57216328,747084854)、(747084854,667768651)、(667768651,667768650)、 (667768650, 57197633), (57197633, 762429491), (762429491, 747099272), (747099272, 747099270).
步骤202,针对每个候选路段组合,统计当前候选路段组合中的前一候选路段在所述历史路线中出现的第一总次数,以及统计所述当前候选路段组合在所述历史路线中出现的第二总次数。
步骤203,基于所述第一总次数与所述第二总次数,计算所述当前候选路段组合对应的转移概率。
在实现中,可以计算当前候选路段组合在所述历史路线中出现的第二总次数,除以当前候选路段组合中的前一候选路段在所述历史路线中出现的第一总次数,将得到的商作为当前候选路段组合对应的转移概率。当前候选路段组合对应的转移概率,用于指示从所述当前候选路段组合中的前一候选路段转移到所述当前路段组合中的后一候选路段的概率。In implementation, the second total number of times the current candidate road segment combination appears in the historical route can be calculated, and divided by the first total number of times the previous candidate road segment in the current candidate road segment combination appears in the historical route, to obtain The quotient of is the transition probability corresponding to the current candidate road segment combination. The transition probability corresponding to the current candidate road segment combination is used to indicate the probability of transitioning from a previous candidate road segment in the current candidate road segment combination to a subsequent candidate road segment in the current road segment combination.
比如,针对候选路段组合(Linki,Linkj),统计候选路段Linki在全部历史路线中出现的总次数,记为C(Linki);统计候选路段组合(Linki,Linkj)在全部历史路线中出现的总次数,记为C(Linki,Linkj)。因此,可以通过如下公式一计算候选路段组合(Linki,Linkj)对应的转移概率P(Linkj|Linki),也即从Linki转移到Linkj的概率:For example, for the candidate link combination (Link i , Link j ), count the total number of times the candidate link Link i appears in all historical routes, denoted as C(Link i ) ; The total number of occurrences in the historical route, denoted as C(Link i , Link j ). Therefore, the transition probability P(Link j | Link i ) corresponding to the candidate link combination (Link i , Link j ) can be calculated by the following formula 1, that is, the transition probability from Link i to Link j :
下面,以图3所示的路段为例进行说明。图3是本发明实施例的一种路段的示意图。如图3所示,以link_0作为前一路段,与其相邻接的路段分别有link_1、link_2、link_3、link_4,则link_0所在的路段组合可以包括(link_0,link_1),(link_0,link_2),(link_0,link_3),(link_0,link_4)。因此,针对link_0所在的每个路段组合,分别计算得到该组合对应的转移概率。比如,(link_0,link_1)对应的转移概率为0.3277,(link_0,link_2)对应的转移概率为0.1434,(link_0,link_3)对应的转移概率为0.5210,(link_0,link_4)对应的转移概率为0.0079。需要说明的是,图3只是用于举例说明,并不作为对本发明实施例的限制。The following description will be given by taking the road section shown in FIG. 3 as an example. FIG. 3 is a schematic diagram of a road section according to an embodiment of the present invention. As shown in Figure 3, taking link_0 as the previous road section, and the adjacent road sections are link_1, link_2, link_3, and link_4 respectively, then the combination of road sections where link_0 is located can include (link_0, link_1), (link_0, link_2), ( link_0, link_3), (link_0, link_4). Therefore, for each road segment combination where link_0 is located, the transition probability corresponding to the combination is calculated separately. For example, the transition probability corresponding to (link_0, link_1) is 0.3277, the transition probability corresponding to (link_0, link_2) is 0.1434, the transition probability corresponding to (link_0, link_3) is 0.5210, and the transition probability corresponding to (link_0, link_4) is 0.0079. It should be noted that FIG. 3 is only used for illustration and is not intended to limit the embodiments of the present invention.
在通过图2所示的方法,基于历史路线的相关数据统计得到每个候选路段组合对应的转移概率后,可以存储各候选路段组合对应的转移概率,以便后续在获取路线特征的过程中,可以从存储的各候选路段组合对应的转移概率中,查询所需的路段组合对应的转移概率。After obtaining the transition probability corresponding to each candidate road segment combination through the method shown in FIG. 2 and statistics based on the relevant data of the historical route, the transition probability corresponding to each candidate road segment combination can be stored, so that in the process of obtaining the route characteristics in the subsequent process, it is possible to From the stored transition probabilities corresponding to each candidate road segment combination, query the transition probability corresponding to the required road segment combination.
可选地,存储方式可以包括但不限于,表格存储方式、索引存储方式、KV(key-value,键值对)存储方式等。比如,可以以候选路段组合包含的有序的候选路段标识为key,以候选路段组合对应的转移概率作为value,存储至KV类型的存储器中,等等。Optionally, the storage method may include, but is not limited to, a table storage method, an index storage method, a KV (key-value, key-value pair) storage method, and the like. For example, the ordered candidate road segment identifiers included in the candidate road segment combination may be used as the key, and the transition probability corresponding to the candidate road segment combination may be used as the value, and stored in a KV type memory, and so on.
参照图4,示出了本发明实施例的另一种特征获取方法的步骤流程图。Referring to FIG. 4 , a flowchart of steps of another feature acquisition method according to an embodiment of the present invention is shown.
如图4所示,特征获取方法可以包括以下步骤:As shown in Figure 4, the feature acquisition method may include the following steps:
步骤401,获取待处理路线。
步骤402,针对每个路段组合,从预先存储的各候选路段组合对应的转移概率中,查询所述当前路段组合对应的转移概率。
由于通过上述图2所示的转移概率获取方法,对历史路线的相关数据进行分析,统计得到每个候选路段组合对应的转移概率,并存储各候选路段组合对应的转移概率。因此,针对待处理路线中的每个路段组合,可以从预先存储的各候选路段组合对应的转移概率中,查询所述当前路段组合对应的转移概率。Through the method for obtaining the transition probability shown in FIG. 2, the relevant data of the historical route is analyzed, the transition probability corresponding to each candidate road segment combination is obtained by statistics, and the transition probability corresponding to each candidate road segment combination is stored. Therefore, for each road segment combination in the route to be processed, the transition probability corresponding to the current road segment combination can be queried from the pre-stored transition probabilities corresponding to each candidate road segment combination.
比如,如果采用表格存储方式存储各候选路段组合对应的转移概率,则针对每个候选路段组合,记录该候选路段组合对应的转移概率存储的行数、列数。因此,按照该候选路段组合对应的转移概率存储的行数、列数,查询该候选路段组合对应的转移概率。For example, if the transition probability corresponding to each candidate road segment combination is stored in a table storage manner, for each candidate road segment combination, the number of rows and columns of the transition probability storage corresponding to the candidate road segment combination is recorded. Therefore, according to the number of rows and columns stored in the transition probability corresponding to the candidate road segment combination, the transition probability corresponding to the candidate road segment combination is queried.
再比如,如果采用索引存储方式存储各候选路段组合对应的转移概率,则针对每个候选路段组合,建立该候选路段组合对应的转移概率存储的索引。因此,按照候选路段组合对应的转移概率存储的索引,查询候选路段组合对应的转移概率。For another example, if the transition probability corresponding to each candidate road segment combination is stored in an index storage manner, then for each candidate road segment combination, an index for storing the transition probability corresponding to the candidate road segment combination is established. Therefore, according to the index stored in the transition probability corresponding to the candidate road segment combination, the transition probability corresponding to the candidate road segment combination is queried.
再比如,如果采用KV存储方式存储各候选路段组合对应的转移概率,则针对每个候选路段组合,以该候选路段组合包含的有序的候选路段标识为key,查询对应的value,即为该候选路段组合对应的转移概率。For another example, if the KV storage method is used to store the transition probability corresponding to each candidate road segment combination, then for each candidate road segment combination, the ordered candidate road segment identifiers included in the candidate road segment combination are used as the key, and the corresponding value is queried. The transition probability corresponding to the candidate road segment combination.
步骤403,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。Step 403: Calculate the route feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination.
在一种可选实施方式中,路线特征包括序列统计特征。因此,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征的过程可以包括:基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征。In an optional embodiment, the route features include sequence statistics. Therefore, the process of calculating the route feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment may include: calculating the sequence statistical feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment.
在一种可选实施方式中,路线特征包括似然概率特征。因此,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征的过程可以包括:基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征。In an optional embodiment, the route features include likelihood probability features. Therefore, the process of calculating the route feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment may include: calculating the likelihood probability feature corresponding to the route to be processed based on the transition probability corresponding to the combination of each road segment.
在一种可选实施方式中,路线特征包括序列统计特征和似然概率特征。因此,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征的过程可以包括:基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征和似然概率特征。In an optional embodiment, the route features include sequence statistics features and likelihood probability features. Therefore, the process of calculating the route feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination may include: based on the transition probability corresponding to each road segment combination, calculating the sequence statistical features and similarities corresponding to the to-be-processed route. probabilistic features.
基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征的过程,可以包括:计算所述各路段组合对应的转移概率的统计值,将所述统计值作为所述待处理路线对应的序列统计特征。其中,所述统计值可以包括以下至少之一:最大值、最小值、中位数、平均值、标准差。The process of calculating the sequence statistical features corresponding to the route to be processed based on the transition probabilities corresponding to the combinations of each road segment may include: calculating a statistical value of the transition probability corresponding to the combination of each road segment, and using the statistical value as the Sequence statistics corresponding to the route to be processed. Wherein, the statistical value may include at least one of the following: maximum value, minimum value, median, average value, and standard deviation.
基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征的过程,可以包括:计算所述各路段组合对应的转移概率的乘积,将所述乘积作为所述待处理路线对应的似然概率特征。The process of calculating the likelihood probability feature corresponding to the route to be processed based on the transition probabilities corresponding to the combinations of each road segment may include: calculating a product of the transition probabilities corresponding to the combinations of each road segment, and using the product as the to-be-processed route The likelihood probability feature corresponding to the processing route.
比如,一条待处理路线包含的路段序列为[Link0,Link1,Link2,Link3,Link4,Link5],因此该待处理路线对应的路段组合可以包括(Link0,Link1)、(Link1,Link2)、(Link2,Link3)、(Link3,Link4)、(Link4,Link5)。获取得到(Link0,Link1)对应的转移概率为p01,(Link1,Link2)对应的转移概率为p12,(Link2,Link3)对应的转移概率为p23,(Link3,Link4)对应的转移概率为p34,(Link4,Link5)对应的转移概率为p45,因此,该条待处理路线对应的转移概率的序列为[p01,p12,p23,p34,p45]。For example, the sequence of road segments contained in a route to be processed is [Link 0 , Link 1 , Link 2 , Link 3 , Link 4 , Link 5 ], so the combination of road segments corresponding to the route to be processed may include (Link 0 , Link 1 ), (Link 1 ,Link 2 ), (Link 2 ,Link 3 ), (Link 3 ,Link 4 ), (Link 4 ,Link 5 ). The transition probability corresponding to (Link 0 , Link 1 ) is obtained as p 01 , the transition probability corresponding to (Link 1 , Link 2 ) is p 12 , the transition probability corresponding to (Link 2 , Link 3 ) is p 23 , (Link 3 ) , Link 4 ) corresponds to the transition probability p 34 , (Link 4 , Link 5 ) corresponds to the transition probability p 45 , therefore, the sequence of transition probabilities corresponding to the route to be processed is [p 01 ,p 12 ,p 23 , p 34 , p 45 ].
针对转移概率序列,统计其中的最大值、最小值、中位数、平均值、标准差这5个数值特征中的至少一个,作为该待处理路线的序列统计特征。For the transition probability sequence, at least one of the five numerical features of the maximum value, the minimum value, the median, the average value, and the standard deviation is counted as the sequence statistical feature of the route to be processed.
最大值为max(p01,p12,p23,p34,p45);The maximum value is max(p 01 ,p 12 ,p 23 ,p 34 ,p 45 );
最小值为min(p01,p12,p23,p34,p45);The minimum value is min(p 01 , p 12 , p 23 , p 34 , p 45 );
中位数为median(p01,p12,p23,p34,p45);The median is median(p 01 ,p 12 ,p 23 ,p 34 ,p 45 );
平均值为mean(p01,p12,p23,p34,p45);The mean is mean(p 01 ,p 12 ,p 23 ,p 34 ,p 45 );
标准差为std(p01,p12,p23,p34,p45)。The standard deviation is std(p 01 , p 12 , p 23 , p 34 , p 45 ).
将一条待处理路线对应的路段序列看作一个一阶马尔科夫链,因此,针对转移概率序列,计算其中全部转移概率的乘积,得到该条待处理路线的似然概率特征。似然概率特征为p=p01×p12×p23×p34×p45。The road segment sequence corresponding to a route to be processed is regarded as a first-order Markov chain. Therefore, for the transition probability sequence, the product of all transition probabilities in the sequence is calculated to obtain the likelihood probability feature of the route to be processed. The likelihood probability feature is p=p 01 ×p 12 ×p 23 ×p 34 ×p 45 .
本发明实施例中,基于历史路线的相关数据,挖掘出路线中各路段组合的转移概率,从而为路线特征的获取提供依据,将基于路线中各路段组合对应的概率计算得到的序列统计特征和似然概率特征,作为路线对应的路线特征,该路线特征能够更加准确地体现路线的相关信息。在涉及到互联网地图的业务中,均能采用本发明实施例的方法进行历史路线数据的挖掘以及路线特征的计算。In the embodiment of the present invention, based on the relevant data of the historical route, the transition probability of the combination of each road section in the route is mined, so as to provide a basis for the acquisition of the route feature, and the sequence statistical features calculated based on the probability corresponding to the combination of each road section in the route are combined with Likelihood probability feature, as a route feature corresponding to a route, the route feature can more accurately reflect the relevant information of the route. In the business involving the Internet map, the method of the embodiment of the present invention can be used to mine historical route data and calculate route features.
参照图5,示出了本发明实施例的一种路线排序方法的步骤流程图。Referring to FIG. 5 , a flowchart of steps of a route sorting method according to an embodiment of the present invention is shown.
如图5所示,路线排序方法可以包括以下步骤:As shown in Figure 5, the route sorting method may include the following steps:
步骤501,获取待处理路线。
所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合。The route to be processed includes a plurality of road segments connected in sequence, and every two road segments connected in sequence constitute a road segment combination.
步骤502,针对每个路段组合,获取当前路段组合对应的转移概率。
所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率。The transition probability corresponding to the current road segment combination is used to indicate the probability of transitioning from a previous road segment in the current road segment combination to a subsequent road segment in the current road segment combination.
步骤503,基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。Step 503: Calculate the route feature corresponding to the route to be processed based on the transition probability corresponding to each road segment combination.
步骤504,基于所述待处理路线对应的路线特征进行路线排序。Step 504: Perform route ranking based on route features corresponding to the to-be-processed routes.
在路线推荐的应用场景中,先针对用户输入的起点和终点召回路线,再对召回的路线进行排序。在路线排序的过程中,需要基于路线的路线特征进行排序。因此,路线特征的准确性,能够影响路线的排序结果的准确性。由于路线排序过程中,最终输出的每一条路线也由路段序列所构成,因此从历史路线中挖掘路段间的关系(如路段间的转移概率特征)用于计算路线特征,能对最终的排序结果产生正向收益。In the application scenario of route recommendation, the route is first recalled according to the starting point and end point input by the user, and then the recalled routes are sorted. In the process of route sorting, it is necessary to sort based on the route features of the routes. Therefore, the accuracy of route features can affect the accuracy of route ranking results. Since in the process of route sorting, each route that is finally output is also composed of a sequence of road segments, so the relationship between road segments (such as the transition probability feature between road segments) is excavated from the historical route to calculate the route features, which can be used to calculate the final ranking result. generate positive returns.
在一种可选实施方式中,可以预先训练排序模型。可选地,在排序模型的训练过程中,针对样本路线,可以按照本发明实施例的特征获取方法获取样本路线对应的路线特征(如上述的序列统计特正、似然概率特征等)。比如,获取样本路线,样本路线包含顺序相接的多个样本路段,顺序相接的每两个样本路段组成一个样本路段组合;针对每个样本路段组合,获取当前样本路段组合对应的转移概率,基于各样本路段组合对应的转移概率,计算所述样本路线对应的路线特征。基于该样本路线对应的路线特征对排序模型进行训练,从而提高排序模型的排序精度。需要说明的是,在训练过程中,还可以加入样本路线的其他路线特征,比如路线长度、直行路长、转弯数等特征进行训练。In an alternative embodiment, the ranking model may be pre-trained. Optionally, in the training process of the ranking model, for the sample route, the route feature corresponding to the sample route (such as the above-mentioned sequence statistic feature, likelihood probability feature, etc.) can be obtained according to the feature acquisition method of the embodiment of the present invention. For example, to obtain a sample route, the sample route includes multiple sample road segments connected in sequence, and every two sample road segments connected in sequence form a sample road segment combination; for each sample road segment combination, the transition probability corresponding to the current sample road segment combination is obtained, Based on the transition probability corresponding to each sample road segment combination, the route feature corresponding to the sample route is calculated. The sorting model is trained based on the route features corresponding to the sample route, thereby improving the sorting accuracy of the sorting model. It should be noted that during the training process, other route features of the sample route, such as route length, straight road length, and number of turns, can also be added for training.
在路线排序过程中,基于所述待处理路线对应的路线特征,利用排序模型对待处理路线进行排序。比如,针对每个待处理路线,将该待处理路线的路线特征作为排序模型的输入,得到排序模型输出的该待处理路线的排序得分,按照各待处理路线的排序得分确定待处理路线的排序顺序。In the route sorting process, based on the route characteristics corresponding to the routes to be processed, a sorting model is used to sort the routes to be processed. For example, for each route to be processed, the route feature of the route to be processed is used as the input of the ranking model, the ranking score of the route to be processed output by the ranking model is obtained, and the ranking of the route to be processed is determined according to the ranking score of each route to be processed. order.
比如,排序模型可以为LambdaMART(Multiple Additive Regression Tree,多元加性回归树)模型等。For example, the sorting model may be a LambdaMART (Multiple Additive Regression Tree) model, or the like.
本发明实施例中,在路线排序过程中,通过增加本发明实施例计算出来的路线特征,能够有效提高排序的准确率。In the embodiment of the present invention, during the route sorting process, by adding the route features calculated by the embodiment of the present invention, the accuracy of the sorting can be effectively improved.
参照图6,示出了本发明实施例的一种特征获取装置的结构框图。Referring to FIG. 6 , a structural block diagram of a feature acquisition apparatus according to an embodiment of the present invention is shown.
如图6所示,特征获取装置可以包括以下模块:As shown in Figure 6, the feature acquisition device may include the following modules:
第一获取模块601,用于获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;The first obtaining
第二获取模块602,用于针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;The second obtaining
第一计算模块603,用于基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。The
参照图7,示出了本发明实施例的另一种特征获取装置的结构框图。Referring to FIG. 7 , a structural block diagram of another feature acquisition apparatus according to an embodiment of the present invention is shown.
如图7所示,特征获取装置可以包括以下模块:As shown in Figure 7, the feature acquisition device may include the following modules:
第一获取模块701,用于获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;The first obtaining
第二获取模块702,用于针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;The second obtaining
第一计算模块703,用于基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征。The
可选地,所述第一计算模块703包括:第一特征计算单元7031,用于基于所述各路段组合对应的转移概率,计算所述待处理路线对应的序列统计特征;和/或,第二特征计算单元7032,用于基于所述各路段组合对应的转移概率,计算所述待处理路线对应的似然概率特征。Optionally, the
可选地,所述第一特征计算单元7031,具体用于计算所述各路段组合对应的转移概率的统计值,将所述统计值作为所述待处理路线对应的序列统计特征;其中,所述统计值包括以下至少之一:最大值、最小值、中位数、平均值、标准差。Optionally, the first
可选地,所述第二特征计算单元7032,具体用于计算所述各路段组合对应的转移概率的乘积,将所述乘积作为所述待处理路线对应的似然概率特征。Optionally, the second
可选地,所述第二获取模块702,具体用于从预先存储的各候选路段组合对应的转移概率中,查询所述当前路段组合对应的转移概率;其中,所述各候选路段组合对应的转移概率,是基于历史路线的相关数据统计得到。Optionally, the second obtaining
可选地,所述各候选路段组合对应的转移概率通过如下模块得到:确定模块704,用于将历史路线中,顺序相接的每两个候选路段组成一个候选路段组合;统计模块705,用于针对每个候选路段组合,统计当前候选路段组合中的前一候选路段在所述历史路线中出现的第一总次数,以及统计所述当前候选路段组合在所述历史路线中出现的第二总次数;第二计算模块706,用于基于所述第一总次数与所述第二总次数,计算所述当前候选路段组合对应的转移概率。Optionally, the transition probability corresponding to each candidate road segment combination is obtained through the following modules: the
本发明实施例中,由于当前路段组合对应的转移概率用于指示从当前路段组合中的前一路段转移到当前路段组合中的后一路段的概率,转移概率能够体现两个相接路段之间的关联性,体现从前一路段转移到后一路段的可能性,因此基于转移概率计算得到的路线特征更加准确。In the embodiment of the present invention, since the transition probability corresponding to the current road segment combination is used to indicate the probability of transitioning from the previous road segment in the current road segment combination to the latter road segment in the current road segment combination, the transition probability can reflect the difference between two adjacent road segments. The correlation of , reflects the possibility of transferring from the previous section to the next section, so the route features calculated based on the transition probability are more accurate.
参照图8,示出了本发明实施例的一种路线排序装置的结构框图。Referring to FIG. 8 , a structural block diagram of a route sorting apparatus according to an embodiment of the present invention is shown.
如图8所示,路线排序装置可以包括以下模块:As shown in Figure 8, the route sorting device may include the following modules:
第三获取模块801,用于获取待处理路线;所述待处理路线包含顺序相接的多个路段,顺序相接的每两个路段组成一个路段组合;The third obtaining
第四获取模块802,用于针对每个路段组合,获取当前路段组合对应的转移概率;所述当前路段组合对应的转移概率,用于指示从所述当前路段组合中的前一路段转移到所述当前路段组合中的后一路段的概率;The fourth obtaining
第三计算模块803,用于基于各路段组合对应的转移概率,计算所述待处理路线对应的路线特征;The
排序模块804,用于基于所述待处理路线对应的路线特征进行路线排序。The
本发明实施例中,通过增加上述计算出来的路线特征,能够有效提高排序的准确率。In the embodiment of the present invention, by adding the above calculated route features, the accuracy of sorting can be effectively improved.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.
在本发明的实施例中,还提供了一种电子设备。该电子设备可以包括一个或多个处理器,以及其上存储有指令的一个或多个机器可读介质,指令例如应用程序。当所述指令由所述一个或多个处理器执行时,使得所述处理器执行如上任一实施例所述的特征获取方法,或者,执行如上实施例所述的路线排序方法。In an embodiment of the present invention, an electronic device is also provided. The electronic device may include one or more processors, and one or more machine-readable media having stored thereon instructions, such as an application program. When executed by the one or more processors, the instructions cause the processors to execute the feature acquisition method described in any of the above embodiments, or to execute the route sorting method described in the above embodiments.
在本发明的实施例中,还提供了一种非临时性计算机可读存储介质,其上存储有计算机程序,该程序可由电子设备的处理器执行,以执行如上任一实施例所述的特征获取方法,或者,执行如上实施例所述的路线排序方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an embodiment of the present invention, there is also provided a non-transitory computer-readable storage medium on which a computer program is stored, and the program can be executed by a processor of an electronic device to perform the features described in any of the above embodiments Obtaining method, or, executing the route sorting method described in the above embodiment. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本发明实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as a method, an apparatus, or a computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal equipment to produce a machine that causes the instructions to be executed by the processor of the computer or other programmable data processing terminal equipment Means are created for implementing the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal equipment to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the The instruction means implement the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby executing on the computer or other programmable terminal equipment The instructions executed on the above provide steps for implementing the functions specified in the flowchart flow or blocks and/or the block diagram block or blocks.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。While preferred embodiments of the embodiments of the present invention have been described, additional changes and modifications to these embodiments may be made by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment as well as all changes and modifications that fall within the scope of the embodiments of the present invention.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or terminal device comprising a list of elements includes not only those elements, but also a non-exclusive list of elements. other elements, or also include elements inherent to such a process, method, article or terminal equipment. Without further limitation, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
以上对本发明所提供的一种特征获取、路线排序方法、装置、电子设备及存储介质,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。A method, device, electronic device and storage medium for feature acquisition and route sorting provided by the present invention have been described above in detail. Specific examples are used in this paper to illustrate the principles and implementations of the present invention. The description is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. , the contents of this specification should not be construed as limiting the invention.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110121899.2A CN114817696A (en) | 2021-01-28 | 2021-01-28 | Feature acquisition, route sorting method, device, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110121899.2A CN114817696A (en) | 2021-01-28 | 2021-01-28 | Feature acquisition, route sorting method, device, electronic device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114817696A true CN114817696A (en) | 2022-07-29 |
Family
ID=82526933
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110121899.2A Withdrawn CN114817696A (en) | 2021-01-28 | 2021-01-28 | Feature acquisition, route sorting method, device, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114817696A (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105354221A (en) * | 2015-09-30 | 2016-02-24 | 百度在线网络技术(北京)有限公司 | Path query method and apparatus |
| CN106095973A (en) * | 2016-06-20 | 2016-11-09 | 东北大学 | The tourism route of a kind of combination short term traffic forecasting recommends method |
| CN110542428A (en) * | 2019-08-27 | 2019-12-06 | 腾讯科技(深圳)有限公司 | Driving route quality evaluation method and device |
-
2021
- 2021-01-28 CN CN202110121899.2A patent/CN114817696A/en not_active Withdrawn
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105354221A (en) * | 2015-09-30 | 2016-02-24 | 百度在线网络技术(北京)有限公司 | Path query method and apparatus |
| US20190056235A1 (en) * | 2015-09-30 | 2019-02-21 | Baidu Online Network Technology (Beijing) Co., Ltd. | Path querying method and device, an apparatus and non-volatile computer storage medium |
| CN106095973A (en) * | 2016-06-20 | 2016-11-09 | 东北大学 | The tourism route of a kind of combination short term traffic forecasting recommends method |
| CN110542428A (en) * | 2019-08-27 | 2019-12-06 | 腾讯科技(深圳)有限公司 | Driving route quality evaluation method and device |
Non-Patent Citations (1)
| Title |
|---|
| 潘晓等: "基于隐马尔科夫模型的潜在个性化路线推荐", 浙江大学学报(自然科学版), 30 September 2020 (2020-09-30), pages 1736 - 1745 * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109325182B (en) | Information pushing method and device based on session, computer equipment and storage medium | |
| CN107122469B (en) | Method and device for query recommendation ranking based on semantic similarity and timeliness frequency | |
| CN106570165B (en) | A content-based video retrieval method and device | |
| CN107229668A (en) | A kind of text extracting method based on Keywords matching | |
| CN108304526A (en) | A kind of data processing method, device and server | |
| CN105389713A (en) | Mobile data traffic package recommendation algorithm based on user historical data | |
| CN112148843B (en) | Text processing method, device, terminal device and storage medium | |
| CN108875040A (en) | Dictionary update method and computer readable storage medium | |
| CN108897842A (en) | Computer readable storage medium and computer system | |
| CN103646080A (en) | Microblog duplication-eliminating method and system based on reverse-order index | |
| CN108108426A (en) | Understanding method, device and the electronic equipment that natural language is putd question to | |
| CN103593371A (en) | Method and device for recommending search keywords | |
| CN103455593B (en) | A kind of service competition based on social networks realizes system and method | |
| CN114840642B (en) | Event extraction method, device, equipment and storage medium | |
| CN108021667A (en) | A kind of file classification method and device | |
| CN110928986A (en) | Legal evidence sorting and recommending method, device, equipment and storage medium | |
| CN106844482B (en) | Search engine-based retrieval information matching method and device | |
| CN105354186A (en) | News event extraction method and system | |
| CN118689879A (en) | Target index recommendation method, electronic device and computer-readable storage medium | |
| CN116521628B (en) | Log template online hybrid mining system for multi-source log | |
| CN103064887B (en) | A kind of method and apparatus of recommendation information | |
| CN111930701A (en) | Log structured processing method and device | |
| CN116303973A (en) | Information search method, device, electronic device and storage medium | |
| CN114238782B (en) | Data processing method, device, server and computer readable storage medium | |
| CN103336765A (en) | Markov matrix off-line correction method of text keywords |
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 | ||
| WW01 | Invention patent application withdrawn after publication |
Application publication date: 20220729 |
|
| WW01 | Invention patent application withdrawn after publication |