Road information self-supervised learning method and device and route recalling or sorting method
Through the self-supervised learning method of road information, self-supervised training is used using user historical trajectory data, which solves the problem that deep models require a large number of labeling samples and generalization capabilities in route recall and sorting, and achieves more efficient and accurate route recommendations.
Patent Information
- Application Number
- CN202411959887.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-11
AI Technical Summary
When relying solely on the depth model for route recall or sorting, a large number of samples are required, which consumes a lot of manpower and material resources, and the generalization ability is not strong and the applicability is insufficient, especially after the road network version is updated, the effect is significantly reduced.
The road information self-supervised learning method is adopted to obtain user historical trajectory data, generate real trajectory strings, and convert them into index sequences and time series of road segment sequences, spatial indexes, and self-supervised training of mask language models to obtain a complete mask language model for downstream applications.
It significantly reduces the training cost of downstream tasks, improves the generalization ability of the model, reduces the dependence on manual annotation, shortens the model training time, saves computing resources, and improves the accuracy and personalization of path recall or sorting.
Smart Images

Figure CN119807552A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of map navigation technology, and in particular to a road information self-supervision learning method and a route recall or sorting method. Background Art
[0002] In the route recommendation system, in order to provide users with the best road options, it is necessary to recall routes and sort the recalled routes. In the route recall and route planning sorting models, it is essential to label a large amount of data, which can be obtained through manual labeling or the user's real historical trajectory. In the training process of the route recall or sorting model, feature learning of the input data is a key. At present, relying solely on deep models for learning will face the following shortcomings: (1) A large number of labeled samples are required, which consumes a lot of manpower; (2) The generalization ability is not strong. After the road network version is updated, the effect is significantly reduced, resulting in insufficient applicability of the model; (3) The model needs to train a large number of parameters, requires high computing resources, and takes a long time to train the model. These problems seriously affect the iteration efficiency and effect of the model. Summary of the invention
[0003] In view of the above defects in the prior art, the present invention provides a road information self-supervised learning method and device, and a route recall or sorting method to solve the technical problems of consuming a lot of manpower and material resources and having poor generalization ability when relying solely on deep models for route recall or sorting.
[0004] To achieve the above-mentioned purpose and other related purposes, the present invention provides a road information self-supervised learning method, comprising: obtaining user historical trajectory data; obtaining the user's actual walking trajectory string based on the user's historical trajectory data; obtaining a sample group based on the actual walking trajectory string, the sample group including a road segment sequence, an index sequence of a spatial index, and a time series; performing mask training on a mask language model through the sample group to obtain a complete mask language model; and applying the pre-trained vector output by the embedding layer in the complete mask language model as a feature to downstream applications.
[0005] In one embodiment of the present invention, obtaining a sample group according to the actual trajectory string includes: matching the actual trajectory string with road network data to obtain the road segment sequence.
[0006] In one embodiment of the present invention, obtaining a sample group according to the actual trajectory string further includes: in a matching process, performing data cleaning on trajectory points in the actual trajectory string to obtain a basic trajectory string; and transforming the basic trajectory string using a spatial index encoding to obtain an index sequence of the spatial index.
[0007] In one embodiment of the present invention, obtaining a sample group according to the actual trajectory string further includes: obtaining time information of the basic trajectory string according to the timestamp of each trajectory point in the basic trajectory string; and converting the time information using a preset time period code and a date code to obtain the time series.
[0008] In one embodiment of the present invention, the time information is converted using a preset time period code and a date code to obtain the time series, including: dividing each day into a number of time periods according to a preset duration, assigning a code to each of the time periods, and obtaining the preset time period code; assigning a code to each of Monday to Sunday, and obtaining the preset date code; adding the code of the time period corresponding to the time information to the date code corresponding to the time information, and obtaining the time series.
[0009] In one embodiment of the present invention, mask training is performed on a masked language model through the sample group to obtain a complete masked language model, including: masking part of the sequences in the sample group according to a preset ratio to obtain masked sequences; constructing a masked language model; inputting the masked sequences into the masked language model to obtain prediction values of the masked sequences; calculating a loss value based on the masked sequences and their prediction values; and optimizing the masked language model based on the loss value to obtain the complete masked language model.
[0010] To achieve the above-mentioned purpose and other related purposes, the present invention also provides a road information self-supervised learning device, including: a data acquisition unit, used to acquire user historical trajectory data; a first processing unit, used to obtain the user's actual walking trajectory string based on the user's historical trajectory data; a second processing unit, used to obtain a sample group based on the actual walking trajectory string, and the sample group includes a road segment sequence, an index sequence of a spatial index, and a time series; a training unit, used to perform mask training on a mask language model through the sample group to obtain a complete mask language model; an application unit, used to apply the pre-trained vector output by the embedding layer in the complete mask language model as a feature to a downstream application.
[0011] To achieve the above-mentioned purpose and other related purposes, the present invention also provides a route recall or sorting method, which uses the embedding layer obtained by the above-mentioned road information self-supervised learning method to construct a route recall model, or construct a route sorting model; uses a generative method to generate a recalled route according to the route recall model, or sorts the recalled route according to the route sorting model to obtain a sorted route.
[0012] To achieve the above-mentioned purpose and other related purposes, the present invention also provides an electronic device, including a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute a computer program stored in the memory to implement a method provided in any one of the above embodiments.
[0013] To achieve the above-mentioned object and other related objects, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is used to enable a computer to execute the method provided in any one of the above-mentioned embodiments.
[0014] Beneficial effects of the present invention: The present invention proposes a method and device for self-supervised learning of road information, and a route recall or sorting method. The method learns pre-trained information of geographical roads through a pre-trained self-supervised learning method, thereby significantly reducing the training cost of downstream tasks and improving the generalization ability of the model, solving the problem of decreased sorting effect due to changes in road network versions; the scheme not only reduces the dependence on manual labeling, but also completes model training in a shorter time, saving computing resources; in this way, road features can be learned more efficiently, thereby providing more accurate and personalized recommendations in path recall or sorting, and ultimately improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A flowchart of a road information self-supervised learning method provided by an embodiment of the present invention;
[0017] Figure 2 A flowchart of obtaining an index sequence of a spatial index provided by an embodiment of the present invention;
[0018] Figure 3 A flow chart of obtaining a time series according to an embodiment of the present invention;
[0019] Figure 4 A detailed flow chart of step S322 provided for one embodiment of the present invention;
[0020] Figure 5 A flowchart of training a masked language model provided by an embodiment of the present invention;
[0021] Figure 6 A structural diagram of a masked language model provided by an embodiment of the present invention;
[0022] Figure 7 A schematic diagram of a road information self-supervised learning device provided by an embodiment of the present invention;
[0023] Figure 8 A route recall method provided by an embodiment of the present invention;
[0024] Fig. 9 A route sorting method provided by an embodiment of the present invention;
[0025] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0026] Explanation of the reference numerals: 101, data acquisition unit; 102, first processing unit; 103, second processing unit; 104, training unit; 105, application unit; 201, processor; 202, memory. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present invention through specific specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. It should be noted that the following embodiments and the features in the embodiments can be combined with each other without conflict. In addition to the specific methods, equipment, and materials used in the embodiments, according to the technical personnel in this technical field's grasp of the prior art and the records of the present invention, any methods, equipment, and materials of the prior art that are similar or equivalent to the methods, equipment, and materials described in the embodiments of the present invention can also be used to implement the present invention.
[0028] It should be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the scope of protection of the present invention. Unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those generally understood by those skilled in the art.
[0029] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In some of the embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0030] The flowchart and block diagram in the accompanying drawings illustrate the system architecture, functions and operations that may be implemented according to the methods and computer program products of various embodiments disclosed in the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0031] See also Figure 1 , Figure 1 A road information self-supervised learning method provided by an embodiment of the present invention includes steps S100 to S500.
[0032] Step S100, obtaining user historical trajectory data. The user historical trajectory data may include location data, time data, etc. The location data may be, for example, longitude and latitude information, and the time data may be the timestamp of the user at a specific location. In this step, only the historical trajectory data needs to be obtained, and no manual marking or manpower consumption is required.
[0033] Step S200: Get the actual walking trajectory string of the user according to the historical trajectory data of the user. The actual walking trajectory string is also the actual walking trajectory string. The trajectory string is generally composed of a set of continuous trajectory points. The actual walking trajectory string may include GPS coordinate data (including longitude and latitude information), timestamp (the specific time when the coordinate data is collected, which can be accurate to seconds or milliseconds), speed information, direction information, acceleration data, trajectory point density, etc. The historical trajectory data includes a lot of trajectory data, and each actual walking trajectory string is extracted to facilitate the next step of processing.
[0034] Step S300: According to the actual trajectory string, a sample group is obtained, and the sample group includes a segment sequence, an index sequence of a spatial index, and a time sequence. This step is equivalent to preprocessing, that is, extracting some sequences as features from the actual trajectory string. These sequence features can also be used in the route recall model or route sorting model.
[0035] In a specific embodiment of the present invention, obtaining a sample group according to an actual trajectory string includes: matching the actual trajectory string with road network data to obtain a road segment sequence.
[0036] In this embodiment, the road network data can be preset or dynamically updated. A lot of road network data is preset based on geographic information system (GIS) and urban planning. These data include the layout of roads, the connection relationship of roads, the location of traffic facilities, etc. These preset data are usually provided by government departments, map service providers or traffic management departments, and are regularly updated to reflect road construction, maintenance or other changes. With the development of technology, more and more road network data can be dynamically collected through real-time sensors, GPS tracking devices, mobile applications, etc. In practical applications, preset road network data and dynamically updated data are often used in combination. Preset data provides the infrastructure of the road network, while dynamic data provides real-time traffic information. This combination can help traffic management systems and navigation applications provide users with more accurate and real-time route planning and traffic status information.
[0037] In this embodiment, the segment sequence is also called a LINK sequence, which represents the mapping of the user's walking path in the road network and is a collection of specific segment identifiers in the road network. For example, if a user's actual walking trajectory passes through three segments in the road network, the resulting LINK sequence may be (link_1, link_2, link_3), where each link_i represents a specific segment in the road network.
[0038] The matching in this embodiment is also called "road binding processing", which refers to the process of comparing and matching the user's actual GPS trajectory data with the known road network data, with the purpose of accurately matching the GPS trajectory points to the links on the specific road network. This can improve the accuracy and availability of the trajectory data. After the matching is completed, the original GPS trajectory points (i.e., the actual trajectory string) are converted into a series of link identifiers (i.e., link sequence), which represent the links that the user actually traveled.
[0039] See also Figure 2 In a specific embodiment of the present invention, a sample group is obtained according to the actual trajectory string, and the method further includes: S311, in the matching process, data cleaning is performed on the trajectory points in the actual trajectory string to obtain a basic trajectory string; S312, the basic trajectory string is converted using spatial index coding to obtain an index sequence of the spatial index.
[0040] In step S311, data cleaning is performed to remove data with low matching quality, such as too sparse or dense track points, and data that is obviously off the road. Abnormal data may be generated due to GPS device failure, signal interference, etc. Data quality can be ensured by removing these abnormal data through data cleaning.
[0041] In step S312, the basic trajectory string is converted using spatial index coding in order to standardize the geographic location data. For example, taking H3 coding as an example, it can convert the basic trajectory string into a heptagonal grid grid at a specific level, so that spatial information can be represented and processed more efficiently. H3 coding is a geospatial indexing system that divides the earth's surface into a series of fixed, polygonal (usually hexagonal) grid cells and assigns a unique index code to each grid cell. This encoding method was developed by Uber to address some limitations of traditional longitude and latitude coordinate systems, such as the continuity of the earth's surface and spherical geometry. H3 coding is a coding system that converts continuous longitude and latitude coordinates into discrete, fixed-size grid cells. Each grid cell has a unique identifier, which makes the processing of geospatial data more efficient and accurate.
[0042] See also Figure 3 In a specific embodiment of the present invention, a sample group is obtained according to the actual trajectory string, and the method further includes: S321, obtaining time information of the basic trajectory string according to the timestamp of each trajectory point in the basic trajectory string; S322, converting the time information using the preset time period code and date code to obtain a time series.
[0043] In this embodiment, the time series is introduced because the traffic status of the road at different time points is different in path planning. For example, a strategy to avoid congestion may be implemented during peak hours. Therefore, it is important to learn the same link at different time points.
[0044] See also Figure 4 In a specific embodiment of the present invention, step S322 includes steps S3221 to S3223.
[0045] Step S3221: Divide each day into several time periods according to the preset duration, assign a code to each time period, and obtain a preset time period code. For example, a 24-hour day can be divided into 144 segments, each 10 minutes long, and then a time period code is set for each time period to obtain a preset time period code.
[0046] Step S3222: assign a code to each of Monday to Sunday to obtain a preset date code. When performing date coding, coding can be performed according to the different dates of the week, month, and year. In this step, coding is performed according to the different dates of the week. For example, Monday to Sunday can be coded 0 to 6 respectively.
[0047] Step S3223, add the code of the time period corresponding to the time information to the date code corresponding to the time information to obtain a time series. That is, the code of the time period corresponds to the time period to which the time information of the basic trajectory string belongs, and then the date code is obtained according to the day of the week to which the time information belongs, and the two are added (can be addition or concatenation). In this way, the time information can be easily converted.
[0048] After obtaining the road segment sequence, the index sequence of the spatial index and the time series according to the above steps, they can be matched and used as basic data for training, namely, a sample group.
[0049] Step S400: Mask training is performed on the mask language model through the sample group to obtain a complete mask language model. The mask language model can realize self-supervised learning and make full use of unlabeled data. The link information is regarded as a word in the traditional mask language model, and the model is trained by masking part of the sequence, thereby enhancing the model's ability to understand these sequence data.
[0050] See also Figure 5 In a specific embodiment of the present invention, step S400 includes steps S401 to S405.
[0051] Step S401: Mask part of the sequence in the sample group according to a preset ratio to obtain a masked sequence. Different masking strategies can be used for masking, such as random masking, proportional masking, or frequency-based masking, etc. In this embodiment, a random mask with a preset ratio is used, where the preset ratio can be, for example, 5%, 6%, 10%, 15%, etc.
[0052] Step S402: construct a masked language model.
[0053] See also Figure 6 In a specific embodiment of the present invention, the masked language model includes an embedding layer, an encoding layer and a decoding layer.
[0054] The embedding layer is used to process the masked sequence to obtain an embedding vector. The function of the embedding layer is to convert the input discrete data into a continuous vector representation, such as processing the LINK sequence into a link embedding, the H3 sequence into an H3 embedding, and the time series into a time embedding. At the same time, the position needs to be processed to obtain a position embedding. These embedding vectors are added together to form the final embedding vector, which provides the model with semantic and syntactic information of the input data. The output of the embedding layer is a high-dimensional vector that the model can process, which contains rich features of the original data.
[0055] The encoding layer is used to process the embedding vector to capture the deep features and contextual information of the input sequence and provide rich feature representation for subsequent tasks. The encoding layer is usually composed of multiple Transformer encoder layers, which are responsible for processing the output of the embedding layer and capturing the deep features and contextual information of the input sequence. The encoding layer generally achieves this through a self-attention mechanism and a feedforward neural network.
[0056] The decoding layer is used to predict the predicted value of the masked road section. The decoding layer also contains a self-attention mechanism and a feed-forward fully connected network.
[0057] Step S403: Input the masked sequence into the masked language model to obtain the predicted value of the masked sequence. The masked language model predicts the masked sequences by learning context information, thereby obtaining the predicted value.
[0058] Step S404: Calculate the loss value according to the masked sequence and its predicted value.
[0059] Step S405: Optimize the masked language model according to the loss value to obtain a complete masked language model.
[0060] In the masked language model, the loss function plays a crucial role. The loss value can be calculated by substituting the masked sequence and its predicted value into the loss function. The commonly used loss function is the cross-entropy loss, which measures the difference between the predicted value output by the model and the true value (the masked sequence). The cross-entropy loss encourages the predicted value output by the model to be as close to the masked value as possible, thereby improving the accuracy of the model's prediction of the masked sequence. By minimizing this loss, the model is continuously optimized during the training process to obtain a complete masked language model.
[0061] Step S500: Apply the pre-trained vectors output by the embedding layer in the complete masked language model as features to downstream applications. In specific applications, the pre-trained vectors output by the embedding layer can be applied as features to downstream applications, that is, the input features of the downstream applications are these pre-trained vectors (link embedding, H3 embedding, and time embedding); or the embedding layer in the complete masked language model can be directly used as a component of the downstream application, that is, the embedding layer is used as a part of other models.
[0062] There can be many downstream applications, such as the route recall model and route sorting model mentioned below. In addition, there can also be other models that use route sequences, spatial indexed index sequences, and time series as input features.
[0063] See also Figure 7 , Figure 7A road information self-supervised learning device provided in one embodiment of the present invention includes a data acquisition unit 101, a first processing unit 102, a second processing unit 103, a training unit 104 and an application unit 105. The data acquisition unit 101 is used to acquire user historical trajectory data; the first processing unit 102 is used to obtain the user's actual walking trajectory string according to the user's historical trajectory data; the second processing unit 103 is used to obtain a sample group according to the actual walking trajectory string, and the sample group includes a road segment sequence, an index sequence of a spatial index and a time series; the training unit 104 is used to perform mask training on a mask language model through the sample group to obtain a complete mask language model; the application unit 105 is used to apply the pre-trained vector output by the embedding layer in the complete mask language model as a feature to a downstream application.
[0064] It should be noted that the road information self-supervised learning device of the present embodiment is a device corresponding to the road information self-supervised learning method described above, and the functional modules in the road information self-supervised learning device may correspond to the corresponding steps in the road information self-supervised learning method. The road information self-supervised learning device of the present embodiment can be implemented in conjunction with the road information self-supervised learning method, that is, in the absence of conflict, the relevant technical details mentioned in the road information self-supervised learning method of the above embodiment can also be applied to the road information self-supervised learning device of the present embodiment.
[0065] See also Figure 8 and Fig. 9 , Figure 8 and Fig. 9 A route recall or sorting method provided in an embodiment of the present invention includes: using the embedding layer obtained by the above-mentioned road information self-supervised learning method to construct a route recall model or a route sorting model; using a generative method to generate a recalled route according to the route recall model, or sorting the recalled route according to the route sorting model to obtain a sorted route. In fact, there are two typical application scenarios, which are described below.
[0066] See also Figure 8 , Figure 8 A route recall method provided for an embodiment of the present invention includes: S11, constructing a route recall model using the embedding layer obtained by the above-mentioned road information self-supervised learning method; S12, generating a recall route using a generative method based on the route recall model.
[0067] In this embodiment, in a recommendation system or a path planning system, a route recall model can be a process of preliminarily screening out a small number of potentially relevant or useful candidates from a large number of possible candidates. In path planning, this usually means screening out paths that may suit user needs from the entire road network. A generative approach is a technique that uses a model to generate new data or candidates. In path planning, this may involve using machine learning models, such as generative adversarial networks (GANs), variational autoencoders (VAEs), or recurrent neural networks (RNNs), to generate possible paths or routes. The reason for using a generative approach to produce recall routes is that this can increase the recall rate.
[0068] See also Fig. 9 , Fig. 9 A route sorting method provided for an embodiment of the present invention includes: S21, using the embedding layer obtained by the above-mentioned road information self-supervised learning method to construct a route sorting model; S22, according to the route sorting model, sorting the recalled routes to obtain sorted routes. In this embodiment, by constructing a route sorting model, the personalized needs of users and actual road conditions are comprehensively considered to provide users with better route options. It plays a key role in providing personalized navigation services, optimizing user experience, improving travel efficiency or reducing logistics costs. In terms of route sorting, the vector product obtained through pre-training can fine-tune the sorting model, which can make the sorting effect more robust.
[0069] In the above route recall model and route sorting model, the trained embedding layer is used as part of the model. After this processing, the input of the route recall model or route sorting model is various sequence data and other data. In addition, these models may not include the embedding layer, but directly use the pre-trained vector output by the embedding layer as the input feature of the model.
[0070] It should be noted that the step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.
[0071] See also Fig.10 , Fig.10An electronic device provided for one embodiment of the present invention includes a processor 201, a memory 202 and a communication bus; the communication bus is used to connect the processor 201 and the memory 202; the processor 201 is used to execute a computer program stored in the memory 202 to implement the above-mentioned road information self-supervised learning method or route recall method or route sorting method.
[0072] The above-mentioned electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0073] The electronic device mentioned above can be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.
[0074] The electronic device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0075] The network where the above electronic devices are located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0076] The above-mentioned processor can be, for example, a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components; the above-mentioned memory may include random access memory (RAM), and may also include non-volatile memory (Non-volatile Memory), such as at least one disk storage.
[0077] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and the computer program is used to enable a computer to execute the above-mentioned road information self-supervised learning method or route recall method or route sorting method.
[0078] In order to verify the beneficial effects of the above methods, we defined two indicators to evaluate the benefits. (1) Offline similarity calculation of trained embeddings. The similarity of embeddings of adjacent or similar routes is higher. (2) Improving the effect of route sorting model. Fine-tune the sorting model through pre-trained vectors to see the consistency rate between the actual trajectory route and the recommended route. Experiments show that pre-training can significantly improve the route sorting effect and greatly reduce training resources.
[0079] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A road information self-supervised learning method, characterized in that: include: Get user historical trajectory data; According to the user's historical trajectory data, obtain the user's actual walking trajectory string; According to the actual walking trajectory string, a sample group is obtained, wherein the sample group includes a road segment sequence, an index sequence of a spatial index, and a time sequence; Performing mask training on the mask language model through the sample group to obtain a complete mask language model; The pre-trained vectors output by the embedding layer in the complete masked language model are applied as features to downstream applications.
2. The road information self-supervised learning method according to claim 1, characterized in that: According to the actual walking trajectory string, a sample group is obtained, including: The actual trajectory string is matched using the road network data to obtain the road segment sequence.
3. The road information self-supervised learning method according to claim 2, characterized in that: According to the actual walking trajectory string, a sample group is obtained, which also includes: During the matching process, data cleaning is performed on the trajectory points in the actual trajectory string to obtain a basic trajectory string; The basic trajectory string is transformed by using spatial index coding to obtain an index sequence of the spatial index.
4. The road information self-supervised learning method according to claim 3, characterized in that: According to the actual walking trajectory string, a sample group is obtained, which also includes: Obtaining time information of the basic trajectory string according to the timestamp of each trajectory point in the basic trajectory string; The time information is converted using a preset time period code and date code to obtain the time series.
5. The road information self-supervised learning method according to claim 3, characterized in that: The time information is converted using the preset time period code and date code to obtain the time series, including: Divide each day into a number of time periods according to a preset duration, assign a code to each time period, and obtain the preset time period code; Assign a code to each of Monday to Sunday to obtain the preset date code; The time series is obtained by adding the code of the time period corresponding to the time information to the date code corresponding to the time information.
6. The road information self-supervised learning method according to claim 1, characterized in that: The masked language model is subjected to mask training by using the sample group to obtain a complete masked language model, including: Masking part of the sequences in the sample group according to a preset ratio to obtain masked sequences; Build a masked language model; Inputting the masked sequence into the masked language model to obtain a predicted value of the masked sequence; Calculate the loss value based on the masked sequence and its predicted value; The masked language model is optimized according to the loss value to obtain the complete masked language model.
7. A road information self-supervised learning device, characterized in that: include: A data acquisition unit, used to acquire user historical trajectory data; A first processing unit, configured to obtain a user's actual walking trajectory string according to the user's historical trajectory data; A second processing unit is used to obtain a sample group according to the actual trajectory string, wherein the sample group includes a road segment sequence, an index sequence of a spatial index, and a time sequence; A training unit, used for performing mask training on the masked language model through the sample group to obtain a complete masked language model; An application unit is used to apply the pre-trained vector output by the embedding layer in the complete masked language model as a feature to a downstream application.
8. A route recall or sorting method, characterized in that: include: Using the embedding layer obtained by the road information self-supervised learning method according to any one of claims 1 to 6, a route recall model or a route sorting model is constructed; A recall route is generated using a generative method according to the route recall model, or the recall route is sorted according to the route sorting model to obtain a sorted route.
9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the road information self-supervised learning method as described in any one of claims 1 to 6 or the route recall or sorting method as described in claim 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the road information self-supervised learning method according to any one of claims 1 to 6 or the route recall or sorting method according to claim 8.