Path recommendation method, system and equipment and storage medium
The method leverages historical vehicle trajectory data and machine learning to provide personalized and precise path recommendations, addressing the limitations of traditional navigation systems in complex environments.
Patent Information
- Application Number
- CN202510249491.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-07-15
AI Technical Summary
Traditional path recommendation methods are based on planning algorithms of navigation software, which usually only considers traffic conditions and shortest path problems in road networks, making it difficult to provide accurate recommendations in complex environments.
Using historical trajectory data to assist path recommendation, combined with the real-time status of the target vehicle, through vectorized calculation and similarity analysis, candidate trajectories that meet the current driving needs of the target vehicle are screened out, and path recommendations are combined with large-scale vehicle behavior patterns and road conditions experience.
It has achieved more accurate and personalized path choices, which can better cope with complex traffic environments, and improve the practical feasibility and rationality of the recommended results.
Smart Images

Figure CN120316360A_ABST
Abstract
Description
Background Art
[0002] With the development of intelligent driving, intelligent driving functions are becoming increasingly popular in vehicles. Intelligent driving functions can assist or replace drivers in controlling vehicles to drive on roads. In the scenario of autonomous driving, path recommendation is one of the important links in the vehicle planning and control system. Its task is to generate a safe, efficient, and reliable driving path based on the vehicle's current position, destination, road environment, and other constraints.
[0003] Traditional path recommendation methods are based on the planning algorithms of navigation software and usually only consider traffic conditions and the shortest path problem in the road network, making it difficult to provide accurate recommendations in complex environments. Summary of the Invention
[0004] To solve the above problems existing in the prior art, the present invention provides a path recommendation method, system, device, and storage medium.
[0005] The first aspect of the present invention provides a path recommendation method, including: Obtain the historical trajectory data of historical vehicles on the road and construct a trajectory vector database based on the historical trajectory data; Collect the driving state information of the target vehicle and obtain a trajectory query vector based on the driving state information; Calculate the similarity between the trajectory query vector and each historical trajectory vector on the driving path of the target vehicle in the trajectory vector database to obtain the similarity value between the trajectory query vector and each historical trajectory vector; Judge that the similarity value is not less than the set threshold, and screen out the corresponding K candidate trajectories from the similarity values not less than the set threshold from large to small; Process the K candidate trajectories based on the processing method of the candidate trajectories to obtain a recommended path, and feedback the recommended path to the interaction end.
[0006] In an embodiment: the processing method of the candidate trajectories includes: Convert the trajectory query vector into a query text and input it into the recommendation model for matching the recommended path; Calculate the K candidate trajectories respectively based on the recommendation model to obtain the comprehensive score of each candidate trajectory; screen out the candidate trajectory corresponding to the highest comprehensive score as the recommended path.
[0007] In an embodiment: the trajectory processing method further includes a correction process, and the correction process includes: Convert the historical trajectory data of historical vehicles into JSON format training text for saving to provide a supervision signal; Correct the recommendation model based on the JSON format training text in combination with the LORA method.
[0008] In one embodiment: constructing a trajectory vector database based on the historical trajectory data includes: Processing the historical trajectory data of each vehicle based on trajectory data cleaning to obtain the optimized trajectory data of each vehicle; Generating a corresponding structured description based on the optimized trajectory data of each vehicle, and constructing a trajectory text library based on the structured description of each vehicle; Performing vectorization processing on the structured description of each vehicle in the trajectory text library based on a training model to obtain a trajectory vector database.
[0009] In one embodiment: the trajectory data cleaning processing includes: Processing the historical trajectory data of each historical vehicle based on trajectory anomaly filtering to obtain the first historical trajectory data of each vehicle; Performing trajectory smoothing on the first historical trajectory data of each vehicle to obtain optimized trajectory data.
[0010] In one embodiment: obtaining the historical trajectory data of historical measurements on the road further includes historical trajectory data correction, and the historical trajectory data correction includes: Setting a correction time window; When it is determined that the time of real-time collecting the vehicle trajectory data on the road satisfies the correction time window, covering the vehicle trajectory data within the correction time window to the historical trajectory data and deleting the original historical trajectory data.
[0011] In one embodiment: the similarity calculation uses cosine similarity and / or Euclidean distance.
[0012] The second aspect of the present invention provides a path recommendation system, which is characterized by including: An acquisition unit: used to acquire the historical trajectory data of historical vehicles on the road and construct a trajectory vector database based on the historical trajectory data; A collection unit: used to collect the driving state information of the target vehicle and obtain a trajectory query vector based on the driving state information; A calculation unit: used to calculate the similarity between the trajectory query vector and each historical trajectory vector in the trajectory vector data road to obtain the similarity value between the trajectory query vector and each historical trajectory vector; A trajectory screening unit: used to screen out K candidate trajectories from high to low based on the similarity value; A recommendation feedback unit: used to process the K candidate trajectories based on the processing method of the candidate trajectories to obtain a recommended path and feedback the recommended path to the interaction end.
[0013] A third aspect of the present invention provides an electronic device, including: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device and is used for the above path recommendation method.
[0014] A fourth aspect of the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the above path recommendation method.
[0015] The beneficial effects of the present invention compared with the prior art are as follows: By converting the driving state information of the target vehicle into a trajectory query vector and performing similarity matching with the data in the historical trajectory vector library, candidate trajectories that highly meet the current driving needs of the target vehicle are screened out. This method is based on verified real road trajectories for recommendation, which is more in line with the actual driving scenario. At the same time, the best path is matched according to the unique state of the target vehicle, making the recommendation result more personalized and closer to the user's needs; the data in the historical trajectory vector library combines large-scale vehicle behavior patterns and road condition experience, enabling the recommended path to better cope with complex traffic environments. This data-driven design based on experience also greatly improves the practical feasibility and rationality of the recommendation result in a dynamic environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 According to an embodiment of the present invention, a flowchart of a path recommendation method is shown.
[0018] Figure 2 According to an embodiment of the present invention, a flowchart of constructing a trajectory vector database based on historical trajectory data is shown.
[0019] Figure 3 According to an embodiment of the present invention, a flowchart of cleaning and processing trajectory data is shown.
[0020] Figure 4 According to an embodiment of the present invention, a flowchart structure diagram of correcting historical trajectory data is shown.
[0021] Figure 5 According to an embodiment of the present invention, a flowchart of a processing method for candidate trajectories is shown.
[0022] Figure 6 According to an embodiment of the present invention, a schematic flowchart of a correction process is shown.
[0023] Figure 7 According to an embodiment of the present invention, a schematic structural diagram of a path recommendation system is shown.
[0024] Figure 8 According to an embodiment of the present invention, a schematic structural diagram of an electronic device is shown.
[0025] Figure 9 According to an embodiment of the present invention, a schematic structural diagram of a computer-readable storage medium is shown. Detailed implementation manners
[0026] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed by the present invention. The present invention can also be implemented or applied through other different specific implementation manners. Various details of the present invention can also be modified or changed according to different viewpoints and application systems without departing from the spirit of the present invention. It should be noted that, without conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0027] The following takes the drawings as a reference and details the embodiments of the present invention so that those skilled in the technical field to which the present invention belongs can easily implement it. The present invention can be embodied in many different forms and is not limited to the embodiments described herein.
[0028] In the description of the present invention, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics represented in connection with the embodiment or example are included in at least one embodiment or example of the present invention. Moreover, the specific features, structures, materials, or characteristics represented can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples represented in the present invention and the features of the different embodiments or examples.
[0029] In addition, the terms "first" and "second" are only used for the purpose of indication and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0030] In order to clearly illustrate the present invention, devices irrelevant to the description are omitted, and the same or similar constituent elements throughout the specification are given the same reference numerals.
[0031] Throughout the specification, when it is said that a device is "connected" to another device, this includes not only the case of "direct connection", but also the case of "indirect connection" with other elements placed therebetween. In addition, when it is said that a certain device "includes" a certain constituent element, unless there is a particularly contrary record, it does not exclude other constituent elements, but means that other constituent elements may also be included.
[0032] When it is said that a device is "above" another device, this may be directly above the other device, but there may also be other devices therebetween. When it is said that a device is "directly" "above" another device, there are no other devices therebetween.
[0033] Although in some instances the terms first, second, etc. are used herein to denote various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, the first interface and the second interface, etc. are indicated. Furthermore, as used herein, the singular forms "a", "an", and "the" are intended to also include the plural forms unless the context clearly dictates otherwise. It should be further understood that the terms "comprising", "including" indicate the presence of the features, steps, operations, elements, components, items, kinds, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The term "or" and "and / or" used herein are interpreted as inclusive, or meaning any one or any combination. Thus, "A, B, or C" or "A, B, and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A, B, and C". An exception to this definition only occurs when the combination of elements, functions, steps, or operations are mutually exclusive in some manner.
[0034] The technical terms used herein are only for referring to specific embodiments and are not intended to limit the present invention. The singular forms used herein also include the plural forms as long as the statement does not clearly indicate the contrary meaning. The meaning of "including" used in the specification is to embody specific characteristics, regions, integers, steps, operations, elements, and / or components, and does not exclude the existence or addition of other characteristics, regions, integers, steps, operations, elements, and / or components.
[0035] Although not differently defined, including technical terms and scientific terms used herein, all terms have the same meaning as generally understood by those skilled in the technical field to which the present invention pertains. Terms defined in commonly used dictionaries are additionally interpreted as having meanings consistent with the relevant technical literature and the content presented herein. As long as they are not defined, they shall not be over-interpreted as ideal or overly formulaic meanings.
[0036] Regarding the following problems existing in the prior art: Traditional path recommendation methods are based on the planning algorithms of navigation software and usually only consider traffic conditions and the shortest path problem in the road network, making it difficult to provide accurate recommendations in complex environments.
[0037] The path recommendation method proposed by the present invention uses historical trajectory data to assist path recommendation, combines the real-time state of the target vehicle, and through vectorized calculation and similarity analysis, realizes a more accurate and personalized path selection. The historical trajectory data combines large-scale vehicle behavior patterns and road condition experience, enabling the recommended path to better cope with complex traffic environments.
[0038] In some embodiments of the present invention, Figure 1 shows a schematic flowchart of a path recommendation method, as Figure 1 shown, a path recommendation method includes: Step 110: Obtain the historical trajectory data of historical vehicles on the road and construct a trajectory vector database based on the historical trajectory data; among them, the historical trajectory data includes information such as the timestamp, vehicle ID, vehicle type, vehicle position longitude and latitude, vehicle speed, and vehicle heading angle corresponding to the historical vehicle. Specifically, the timestamp is used to determine the time distribution of the trajectory and the sequence of events, and is the key link for associating trajectory points. During the trajectory restoration process, the motion characteristics (such as distance and speed change) between consecutive trajectory points are calculated through the timestamp; the vehicle ID is the unique identifier of the vehicle, used to distinguish the data of different vehicles, realize the individual differentiation of different vehicles, facilitate personalized analysis of single-vehicle behavior, and is also used for aggregated analysis of fleet or group behavior; the vehicle type is used to describe the type of vehicle (such as sedan, SUV, truck, bus, etc.), and is used for subsequent personalized decision-making of different vehicles: for example, large trucks will preferentially avoid height-limited bridges or narrow sections, while small sedans may tend to choose fast and convenient commuting routes; the vehicle position longitude and latitude are used to record the specific position of the vehicle in the geographic coordinate system. The longitude and latitude map the actual running trajectory of the target vehicle on the road onto the map, forming a complete spatial motion curve, supporting spatial visualization and refined modeling in combination with GIS (Geographic Information System) to realize trajectory generation; the vehicle speed is used to record the driving speed of the vehicle at the acquisition moment; the vehicle heading angle is used to describe the movement direction of the vehicle; each trajectory vector data in the trajectory vector database is a high-dimensional vector representation of the historical trajectory data, specifically generated by a Chinese semantic embedding model (such as text2vec-large-chinese), and the vector content reflects the semantics, vehicle status, and other information described by the corresponding historical trajectory data, facilitating subsequent similarity retrieval and context reasoning.
[0039] Step 120: Collect the driving state information of the target vehicle and obtain a trajectory query vector based on the driving state information; among them, the trajectory query vector is a numerical expression after high-dimensional vectorization of the driving state information of the target vehicle, and is used for similarity calculation with the historical trajectory vectors in the trajectory vector database. Essentially, it maps the current state description of the target vehicle into a vector of a specific dimension through a semantic embedding model (such as text2vec-large-chinese or other embedding models), represents the current motion characteristics of the target vehicle in the vector space, and facilitates subsequent retrieval of the historical trajectory most similar to the target vehicle state in the historical trajectory vector library through mathematical calculations (such as cosine similarity or Euclidean distance, etc.), and then serves path recommendation.
[0040] Step 130: Calculate the similarity between the trajectory query vector and each historical trajectory vector in the trajectory vector database on the driving path of the target vehicle to obtain the similarity value between the trajectory query vector and each historical trajectory vector; wherein, the similarity calculation uses cosine similarity and / or Euclidean distance. It can be understood that by introducing the similarity calculation between the trajectory vector database and the trajectory query vector, this method optimizes path recommendation from traditional topological search to a vector matching problem, greatly simplifying the calculation process.
[0041] Step 140: Determine that the similarity value is not less than the set threshold, and screen out the corresponding K candidate trajectories from the similarity values not less than the set threshold from large to small; specifically, in this embodiment, the value of K is 0.8, and in other embodiments, it can be set according to requirements and will not be limited here. It can be understood that the similarity threshold screening mechanism further improves the efficiency of the system in large-scale data processing, enabling high-quality paths to be quickly selected from the candidate trajectories; on the one hand, it improves the query speed, and on the other hand, it reduces cumbersome operations.
[0042] Step 150: Process the K candidate trajectories based on the processing method of the candidate trajectories to obtain the recommended path, and feedback the recommended path to the interaction end. The following will further illustrate the specific implementation of the above steps 110 to 150: In the above embodiment, in the foregoing step 110, the historical trajectory data of the historical vehicle is obtained through the AI camera set on the roadside. In this embodiment, the data acquisition frequency of the AI camera is 10Hz, and the specific arrangement method of the AI camera is not limited. It can be installed on a mounting pole, or installed on an existing street lamp pole, or on a monitoring pole. In other embodiments, the data acquisition frequency can be set by itself and will not be limited here.
[0043] In the above embodiment, in the foregoing step 120, when collecting the driving state information of the target vehicle, the collected data may be inaccurate due to GPS drift. Therefore, in this embodiment, error correction is adopted, specifically, the integrated ground augmentation technology (RTK-GPS) is used to correct the current position information to improve the real-time state description accuracy.
[0044] In the above embodiment, in the foregoing step 130, cosine similarity is used to measure the angle between two vectors rather than the absolute length of the vectors. Its calculation formula: Cosine similarity = cos(θ) = =
[0045] A and B respectively represent the trajectory query vector and the historical trajectory vector.
[0046] A B represents the dot product of the trajectory query vector and the historical trajectory vector.
[0047] respectively represent the magnitudes of the trajectory query vector and the historical trajectory vector.
[0048] are the components of the two vectors in the i-th dimension.
[0049] The Euclidean distance is the straight-line distance between two points in a geometric sense, and its calculation formula: Euclidean distance = =
[0050] and represent the data values in the corresponding dimensions (such as longitude and latitude, speed, or timestamp, etc.).
[0051] In the actual use process, the cosine similarity is used to match the overall path trend in the historical trajectory library, and candidate trajectories that conform to the current driving direction and behavior pattern of the target vehicle are screened out; the Euclidean distance is used to evaluate the current position information of the target vehicle to find the historical trajectory point closest to it and the geometric gap between the trajectory points along the way, so as to refine the matching; the cosine similarity and the Euclidean distance are combined to further ensure the reliability in terms of physical distance on the premise of meeting the consistency of the vehicle driving trend, providing comprehensive support for the path decision-making of autonomous driving.
[0052] In the above embodiment, in the foregoing step 140, if the similarity value between the trajectory query vector and each historical trajectory vector is less than the set threshold, the path recommendation ends; it can be understood that the difference between the historical trajectory data and the driving state of the target vehicle is relatively large, and there is no similar path recommendation in the historical trajectory data.
[0053] In the above embodiment, in the foregoing step 150, the interaction terminal includes the image display and voice reminder of the in-vehicle display screen, which are used to display the recommended path to the driver and voice-remind the driver of the recommended path, so as to facilitate the driver to understand the recommended path information.
[0054] The path recommendation method adopted in the above steps 110 to 150 converts the driving state information of the target vehicle into a trajectory query vector, and performs similarity matching with the data in the historical trajectory vector library, so as to screen out candidate trajectories that highly meet the current driving needs of the target vehicle. This method is based on verified real-road trajectories for recommendation, which can better fit the actual driving scenario. At the same time, the best path is matched according to the unique state of the target vehicle, making the recommendation result more personalized and closer to the user's needs; the data in the historical trajectory vector library combines large-scale vehicle behavior patterns and road condition experience, enabling the recommended path to better handle complex traffic environments. This data-driven design based on experience also greatly improves the practical feasibility and rationality of the recommendation result in a dynamic environment. In some embodiments of the present disclosure, Figure 2 FIG. shows a schematic flowchart of constructing a trajectory vector database related to the aforementioned step 110, as Figure 2 shown. The method for constructing a trajectory vector database includes: Step 210: Process the historical trajectory data of each vehicle based on trajectory data cleaning to obtain the optimized trajectory data of each vehicle; this is used to transform the originally messy and redundant historical trajectories into clean and reasonably structured optimized trajectory data, so as to lay a foundation for subsequent construction of structured descriptions and analysis.
[0055] Step 220: Generate a corresponding structured description based on the optimized trajectory data of each vehicle, and construct a trajectory text library based on the structured descriptions of each vehicle; the structured description refines the movement process of the vehicle into an easy-to-process format, making subsequent modeling and analysis more efficient. Constructing a trajectory text library is used to collect the structured descriptions of all vehicles and store them in a database or document according to a certain data storage format, so that the data of each vehicle is saved in the system in a textual-like form, which is convenient for searching and indexing.
[0056] Step 230: Perform vectorization processing on the structured description of each vehicle in the trajectory text library based on a training model to obtain a trajectory vector database. In this embodiment, the vectorization processing converts the structured description into a numerical vector in a multi-dimensional space for subsequent similarity calculation.
[0057] In the above embodiments, in the foregoing step 210, the historical trajectory data generated by different collection sources or vehicles is inconsistent in format and specification. The trajectory data is cleaned and processed and converted into standardized data for subsequent operations. Historical trajectory data often contains redundancy, noise, or outliers (such as GPS drift, data interruption, etc.), which may reduce the accuracy and reliability of subsequent analysis and processing results. Trajectory data cleaning and processing can remove invalid or incorrect data points and optimize the original messy trajectory data into a reasonably structured, continuous, and real movement trajectory.
[0058] Through the method of constructing a trajectory vector database adopted in the above steps 210 to 230, the messy historical trajectory data can be converted into an information resource with clear meaning and high utilization rate, providing accurate data support for subsequent path recommendation; the numerical vectors in the multi-dimensional space obtained after vectorization processing are used for subsequent similarity calculation.
[0059] In some embodiments of the present disclosure, Figure 3 FIG. shows a schematic flow chart of a trajectory data cleaning and processing involved in the foregoing step 210, as Figure 3 shown, the trajectory data cleaning and processing includes: Step 211: Filter and process the historical trajectory data of each historical vehicle based on trajectory anomalies to obtain the first historical trajectory data of each vehicle; specifically, the reasonable range of longitude is [-180, 180], the reasonable range of latitude is [-90, 90], and the reasonable range of the position distance between the upper and lower frames is [0, 3.34] (the maximum speed limit is 120 km / h, the frequency of trajectory data generation is 10 HZ, that is, one piece per 0.1 s, then the maximum movement in 0.1 s is about 3.33…3 meters, taking the upper limit of 3.34). If the above reasonable range is not met, the trajectory point is excluded.
[0060] Step 212: Smoothly process the first historical trajectory data of each vehicle based on the trajectory to obtain optimized trajectory data. Specifically, the trajectory is smoothed (the first point is not smoothed, starting from the second point). For each vehicle, obtain its current trajectory point and the smoothed trajectory points of multiple historical frames, judge the time interval between the current trajectory point and the historical trajectory points. If the interval is too large, the smoothing is abandoned, and the following formula is used to calculate the smoothing result:
[0061] where, is the smoothed current frame trajectory, is the current frame trajectory before smoothing, is the smoothed trajectory of the previous frame, is the smoothing coefficient (between 0 and 1).
[0062] Through the trajectory data cleaning process adopted in the above-mentioned steps 211 to 212, invalid or unreasonable data points are deleted through exception handling, making the overall trajectory more in line with the requirements of the "real-world movement process", avoiding model deviation, incorrect decision-making or inaccurate recommendation results caused by data anomalies; through smoothing processing, small fluctuations caused by noise are suppressed, making the trajectory smoother in space, reducing interference caused by jitter, and at the same time being more in line with the real situation in terms of features such as movement direction and speed; through the two-step processing, the historical trajectory data is transformed from the original state into cleaner, higher-quality and more reasonable data.
[0063] In some embodiments of the present disclosure, the historical trajectory data obtained in the foregoing step 110 further includes historical trajectory data correction. Figure 4 A schematic flow structure diagram of a historical trajectory data correction is shown, as Figure 4 shown, the historical trajectory data correction includes: Step 310: Set a correction time window; specifically, the time of the time window is one day. It can be understood that in this embodiment, the update period of the historical trajectory data is one day. The specific time of the correction time window in this embodiment is not limited and can be set according to requirements.
[0064] Step 320: When it is determined that the time of the vehicle trajectory data collected in real time on the road satisfies the correction time window, the vehicle trajectory data within the correction time window is overwritten to the historical trajectory data, and the original historical trajectory data is deleted. It can be understood that whenever the newly collected real-time trajectory data satisfies the current time window, the new data replaces and overwrites the old historical trajectory within the corresponding time window, ensuring that the historical trajectory data is always consistent with the latest actual situation, making the data recorded in the system more credible, accurate, and reflecting the real operating state of the current road or vehicle.
[0065] In the foregoing step 320, the latest real-time data overwrites the historical trajectory data, which can avoid incorrect analysis caused by old data generated by road construction, construction, and traffic speed limit adjustment.
[0066] Through the historical trajectory data correction described in the foregoing steps 310 to 320, the effectiveness and timeliness of the trajectory database storage are guaranteed, the stale information is dynamically updated and overwritten, ensuring that the data always keeps up with the actual situation, providing the latest and high-quality data support for subsequent path recommendation, reducing storage pressure, and improving operation efficiency.
[0067] In some embodiments of the present disclosure, Figure 5 A schematic flow diagram of a method for processing a candidate trajectory involved in the foregoing step 150 is shown, as Figure 5 shown, the method for processing a candidate trajectory includes: Step 151: Convert the trajectory query vector into a query text and input it into the recommendation model for coordinating the recommended path. In this embodiment, the recommendation model includes a traditional recommendation module, a deep learning model, and a large language model (LLM) inference. The traditional recommendation module includes logical rules, statistical methods, or heuristic methods, considering the scores of features (such as speed, location information, etc.) in the trajectory data. The deep learning model, such as a neural network pre-trained with trajectory data or a supervised learning model based on the JSON format, evaluates the trajectory. The large language model (LLM) inference, such as ChatGLM3, understands the trajectory content through natural language and returns the recommendation result.
[0068] Step 152: Calculate K candidate trajectories respectively based on the recommendation model, and obtain the comprehensive score of each candidate trajectory; Screen the candidate trajectory corresponding to the highest comprehensive score as the recommended path. In this embodiment, a confidence score is generated for each candidate trajectory text through the generative evaluation of the LLM.
[0069] In the aforementioned step 151, construct a structured prompt and pass it as input information to the LLM. This prompt needs to clearly express the task requirements and provide necessary context information. The prompt mainly consists of three parts, including: Current vehicle status: {Current vehicle position / speed information}; It is equivalent to telling the LLM "where the vehicle is now and what its status is.
[0070] Candidate trajectories: {Description of candidate trajectory 1} {Description of candidate trajectory 2} ... {Description of candidate trajectory K} The candidate trajectories provide K similar trajectories screened out as reference information to help the LLM understand "how the vehicle usually travels in similar situations in the past.
[0071] Please output the comprehensive optimal recommended path based on the existing information; Clearly inform the LLM of the task to be completed.
[0072] The specific reference when K = 2 is as follows: Current vehicle status: Current vehicle position: [121.34460729, 30.34103982], speed is 20; Candidate trajectories: Current vehicle position: [121.34460729, 30.34103982], speed is 30, recommended path: [[120.30717203839234, 31.47242678 ], [120.3071747992984, 31.472431016 ],...,[120.30718942253856, 31.4724369979616]] Current vehicle position: [121.34460727, 30.34103983], speed is 40, recommended path: [[120.30717203839234, 31.47242678 ], [120.3071747992984, 31.472431016 ],...,[120.30718942253856, 31.4724369979616]]; Please output the overall optimal recommended path based on the existing information.
[0073] In some embodiments of the present disclosure, the trajectory processing method in the foregoing step 150 further includes correction processing. Figure 6 A flowchart of a correction process is shown, as Figure 6 shown, the correction processing includes: Step 410: Convert the historical trajectory data of historical vehicles into JSON format training text for storage, which is used to provide supervision signals; in this embodiment, the JSON format is convenient for coordinating information in multiple data dimensions, such as timestamps, status attributes (speed, position), historical paths, etc.; the JSON format training text serves as the data source for supervised learning. These data include: containing instruction, input, and output. Among them, instruction: clearly defines the task objective, that is, requires the model to generate a recommended path, input: describes the current position, speed and other trajectory-related information of the vehicle, as the reasoning basis for the model, output: the given standard answer (recommended path), representing the "correct" result.
[0074] Two examples of training text are as follows: {"instruction": "You are now a path recommendation expert. Please generate a recommended path based on the current state of the vehicle:", "input": "Current vehicle location: [121.34460729, 30.34103982], speed is 30", "output": "Recommended path: [[120.30717203839234, 31.47242678], [120.3071747992984, 31.472431016 ],..., [120.30718942253856, 31.4724369979616]]"} {"instruction": "You are now a path recommendation expert. Please generate a recommended path based on the current state of the vehicle:", "input": "Current vehicle location: [121.34460727, 30.34103983], speed is 40", "output": "Recommended path: [[120.30717203839234, 31.47242678], [120.3071747992984, 31.472431016 ],..., [120.30718942253856, 31.4724369979616]]"} Step 420: Modify the recommendation model based on the JSON - formatted training text combined with the LoRA method. In this embodiment, the LoRA method is used to fine - tune in combination with the pre - trained large - language model LLM (here, the large model defaults to ChatGLM3 - 6B, and other large models can be selected according to the situation). The size of the LoRA matrix rank is defaulted to 16, and other parameters can be adjusted according to the actual situation. Among them, LoRA (Low - Rank Adaptation) is a machine - learning technique mainly used to fine - tune the model with a small amount of data and computing resources without modifying the base model.
[0075] In the aforementioned step 420, the JSON - formatted training text is used to perform LoRA fine - tuning on the large - language model (LLM) to optimize the performance of the recommendation model. When fine - tuning with the LoRA method, only a small number of learning parameters need to be added, without modifying the complete model parameters, thus saving computing resources and being able to quickly adapt to new scenarios. For example, dynamically adjust the path - planning method for the construction area.
[0076] Through the correction process in the aforementioned steps 410 to 420, the recommendation deviation problem caused by environmental dynamics is repaired, and the robustness and responsiveness of the recommendation results to complex relationships and detailed tasks are improved. In other embodiments, the fine-tuning method can also adopt full-parameter fine-tuning, Prefix Tuning / P-Tuning v2, RLHF, etc., which are not limited in this application. In some embodiments of the present disclosure, Figure 7 A structural schematic diagram of a path recommendation system is provided. As Figure 7 shown, this path recommendation system is used to implement the path recommendation method provided in the foregoing embodiments, and specifically may include: Acquisition unit 501: configured to acquire historical trajectory data of historical vehicles on a road and construct a trajectory vector database based on the historical trajectory data; Collection unit 502: configured to collect driving state information of a target vehicle and obtain a trajectory query vector based on the driving state information; Calculation unit 503: configured to calculate a similarity between the trajectory query vector and each historical trajectory vector in the trajectory vector database to obtain a similarity value between the trajectory query vector and each historical trajectory vector; Trajectory screening unit 504: configured to screen out K candidate trajectories based on the similarity values from high to low; Recommendation feedback unit 505: configured to process the K candidate trajectories based on a processing method of the candidate trajectories to obtain a recommended path and feedback the recommended path to the interaction end.
[0077] Those skilled in the art of the present technology can understand that various aspects of the present disclosure can be implemented as a system, a method, or a program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation manner, a complete software implementation manner (including firmware, microcode, etc.), or an implementation manner combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "platform" here.
[0078] Specifically, Figure 8 According to an embodiment of the present disclosure, a structural schematic diagram of an electronic device is shown. The following refers to Figure 8 to describe the electronic device 600 according to this embodiment of the present disclosure. Figure 8 The shown electronic device 600 is only an example and should not bring any limitation to the functions and usage scopes of the embodiments of the present disclosure.
[0079] As Figure 8As shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0080] Among them, the storage unit stores program code, and the program code can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present disclosure. For example, the processing unit 610 can execute the relevant steps of the path recommendation method as shown in Figure 1 the figure.
[0081] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 6201 and / or a cache storage unit 6202, and may further include a read-only memory (ROM) 6203.
[0082] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205. Such program modules 6205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0083] The bus 630 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the multiple bus structures.
[0084] The electronic device 600 can also communicate with one or more external devices 700 (such as a keyboard, a pointing device, a Bluetooth device, etc.), can also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through an input / output (I / O) interface 650. And, the electronic device 600 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660. The network adapter 660 can communicate with other modules of the electronic device 600 through the bus 630. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, etc.
[0085] Embodiments of the present disclosure also provide a computer-readable storage medium for storing a program that, when executed, implements the steps of the path recommendation method. In some possible implementation manners, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above text generation method section of this specification.
[0086] Specifically, Figure 9 According to an embodiment of the present disclosure, a schematic structural diagram of a computer-readable storage medium is shown. As Figure 9 shown, a program product 800 for implementing the above path recommendation method according to an embodiment of the present disclosure is described. It may be a portable compact disc read-only memory (CD-ROM) and includes program code, and can run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device.
[0087] The program product may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0088] The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, system, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.
[0089] The program code for performing the specific implementation operations of the path recommendation method provided in the foregoing embodiments of the present disclosure can be written in any combination of one or more programming languages. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as an independent software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).
[0090] In summary, through the technical solution provided by the present disclosure, the proposed path recommendation method converts the driving state information of the target vehicle into a trajectory query vector and performs a similarity match with the data in the historical trajectory vector library, thereby screening out candidate trajectories that highly conform to the current driving needs of the target vehicle. This method is based on verified real road trajectories for recommendation, which is more in line with the actual driving scenario. At the same time, it matches the best path according to the unique state of the target vehicle, making the recommendation result more personalized and closer to the user's needs; the data in the historical trajectory vector library combines large-scale vehicle behavior patterns and road condition experience, enabling the recommended path to better cope with complex traffic environments. This data-driven design based on experience also greatly improves the practical feasibility and rationality of the recommendation result in a dynamic environment.
[0091] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.
Claims
1. A path recommendation method, characterized in that, Including: Obtain the historical trajectory data of historical vehicles on the road, and construct a trajectory vector database based on the historical trajectory data; Collect the driving state information of the target vehicle, and obtain a trajectory query vector based on the driving state information; Calculate the similarity between the trajectory query vector and each historical trajectory vector in the trajectory vector database on the driving path of the target vehicle to obtain the similarity value between the trajectory query vector and each historical trajectory vector; Judge that the similarity value is not less than the set threshold, and screen out the corresponding K candidate trajectories from the similarity values not less than the set threshold from large to small; Process the K candidate trajectories based on the processing method of the candidate trajectories to obtain a recommended path, and feedback the recommended path to the interaction terminal.
2. The path recommendation method according to claim 1, wherein The processing method of the candidate trajectories includes: Convert the trajectory query vector into a query text and input it into the recommendation model for coordinating the recommended path; Calculate the K candidate trajectories respectively based on the recommendation model to obtain the comprehensive score of each candidate trajectory; screen out the candidate trajectory corresponding to the highest comprehensive score as the recommended path.
3. The path recommendation method according to claim 2, characterized in that, The trajectory processing method further includes correction processing, and the correction processing includes: Convert the historical trajectory data of historical vehicles into JSON format training text for storage to provide supervision signals; Correct the recommendation model based on the JSON format training text combined with the LORA method.
4. The path recommendation method according to claim 1, wherein Constructing a trajectory vector database based on the historical trajectory data includes: Process the historical trajectory data of each vehicle based on trajectory data cleaning to obtain the optimized trajectory data of each vehicle; Generate a corresponding structured description based on the optimized trajectory data of each vehicle, and construct a trajectory text library based on the structural description of each vehicle; Perform vectorization processing on the structured description of each vehicle in the trajectory text library based on the training model to obtain a trajectory vector database.
5. The path recommendation method according to claim 4, wherein The trajectory data cleaning processing includes: Filter the historical trajectory data of each historical vehicle based on trajectory anomaly to obtain the first historical trajectory data of each vehicle; Perform trajectory smoothing on the first historical trajectory data of each vehicle to obtain optimized trajectory data.
6. The path recommendation method according to claim 1, characterized in that Obtaining the historical trajectory data of historical measurements on the road further includes historical trajectory data correction, and the historical trajectory data correction includes: Set a correction time window; When it is judged that the time of real-time collecting the vehicle trajectory data on the road meets the correction time window, cover the vehicle trajectory data within the correction time window to the historical trajectory data and delete the original historical trajectory data.
7. The path recommendation method according to claim 1, wherein The similarity calculation uses cosine similarity and / or Euclidean distance.
8. A path recommendation system, characterized in that, Including: Obtaining unit: used to obtain the historical trajectory data of historical vehicles on the road, and construct a trajectory vector database based on the historical trajectory data; Collection unit: used to collect the driving state information of the target vehicle, and obtain a trajectory query vector based on the driving state information; Calculation unit: used to calculate the similarity between the trajectory query vector and each historical trajectory vector in the trajectory vector data road to obtain the similarity value between the trajectory query vector and each historical trajectory vector; Trajectory screening unit: used to screen out K candidate trajectories based on the similarity values from high to low; Recommendation feedback unit: configured to process K candidate trajectories based on a processing method of candidate trajectories, obtain a recommended path, and feedback the recommended path to the interaction end.
9. An electronic device, characterized in that, Comprising: A memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, for executing the path recommendation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the path recommendation method according to any one of claims 1 to 7.
Citation Information
Cited By
Vehicle, driving track generation method, electronic equipment, storage medium and product
CN120517442A