A trajectory generation method, device, equipment and storage medium
By training the neural network model according to the activity patterns of different individuals, the problem of low trajectory accuracy in the existing technology is solved and the accuracy of trajectory generation is improved.
Patent Information
- Application Number
- CN202310540735.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-05-12
AI Technical Summary
The trajectories generated by existing techniques are less accurate because the neural network model is not built for every activity pattern, resulting in poor accuracy of subsequent activity types and activity locations.
Different neural network models are trained according to the activity patterns of different individuals, and the trained neural network model is used to predict the individual's initial activity type, determine the subsequent activity type and activity location, and thereby generate a trajectory.
The accuracy of trajectories is improved, and the accuracy of trajectory generation is improved by training neural network models against activity patterns, which enhances the accuracy of subsequent activity types.
Smart Images

Figure CN116822635B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of trajectory generation, and in particular to a trajectory generation method, device, equipment and storage medium. Background Art
[0002] Human mobility behavior is closely related to applications such as infectious diseases, transportation, and public safety. Although the development of modern ICT has made it easy to collect large-scale individual mobile positioning data, the availability and usability of raw trajectory data that involves personal privacy and has redundancy, missingness, and noise are still very limited in practice. The existing technology models the individual movement process based on a small number of easily accessible data samples to generate large-scale individual trajectories, making them close to real data at the statistical level and replaceable at the application level. The modeling of the existing technology is to first establish a neural network model for predicting activity types through sample activity types, but the neural network model established by the existing technology is not established for each activity mode to which the activity type belongs, that is, no matter what activity mode the individual belongs to, the same neural network model is applied to the individual's starting activity type, resulting in poor accuracy of the subsequent activity types generated by the neural network model, which in turn causes the trajectory generated according to the activity position of the subsequent activity type to deviate from the actual trajectory.
[0003] In summary, the trajectory generated by the existing technology has low accuracy.
[0004] Therefore, the prior art still needs to be improved and enhanced. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a trajectory generation method, device, equipment and storage medium, which solves the problem of low accuracy of the trajectory generated by the prior art.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a trajectory generation method, which comprises:
[0008] Applying a trained neural network model to the starting activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the starting activity type, the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs;
[0009] Determining each activity position corresponding to each of the subsequent activity types;
[0010] The trajectory of the individual is generated according to the activity position corresponding to the starting activity type and each activity position corresponding to each subsequent activity type.
[0011] In one implementation, the training method of the trained neural network model includes:
[0012] Constructing a sample starting activity type and each sample subsequent activity type of the sample individual, wherein the occurrence time of each sample subsequent activity type is after the occurrence time of the sample starting activity type;
[0013] Applying the neural network model to the sample starting activity type to obtain each training subsequent activity type output by the neural network model;
[0014] Comparing the differences between each of the sample subsequent activity types and each of the training subsequent activity types;
[0015] The parameters of the neural network model are adjusted according to the difference until the difference is less than a threshold value, thereby obtaining a trained neural network model.
[0016] In one implementation, the activity mode is constructed by:
[0017] Constructing each sample activity sequence, wherein the sample activity sequence is composed of each sample activity type arranged in sequence according to the occurrence time sequence of each sample activity type;
[0018] Cluster analysis is applied to each of the sample activity sequences to obtain the home mode, Monday to Wednesday outing mode, weekend outing mode, daily outing mode, 007 work mode, 996 work mode, 995 work mode, and 965 work mode in the activity modes.
[0019] In one implementation, determining each activity position corresponding to each subsequent activity type includes:
[0020] Determining a home activity type and a work activity type in the subsequent activity types, wherein an occurrence time of the home activity type is before an occurrence time of the work activity type;
[0021] Determine the probability of each residence location corresponding to the home activity type of the individual based on the population spatial distribution data of the area where the individual is located;
[0022] Determining a residence position in the activity position according to each of the residence probabilities, the residence position corresponding to the home activity type of the individual;
[0023] Determining the locations of each pre-selected work place corresponding to the work activity type according to the spatial structure of the area where the individual is located;
[0024] According to the population data of the residence location and the population data of each of the pre-selected work locations, each of the pre-selected work locations is screened to obtain the target work location in the activity location.
[0025] In one implementation, the screening of each of the pre-selected work locations based on the population data of the residence location and the population data of each of the pre-selected work locations to obtain the target work location in the activity location includes:
[0026] Draw a circle with a set radius with the residence location as the center;
[0027] Determine the selection probabilities of the individual selecting each of the pre-selected work locations based on the population data within the circle, the population data of the residence location, and the population data of each of the pre-selected work locations;
[0028] According to each of the selection probabilities, each of the pre-selected work locations is screened to obtain a target work location in the active location.
[0029] In one implementation, determining each activity position corresponding to each subsequent activity type includes:
[0030] Determine a work activity type and a non-work activity type in the subsequent activity type, wherein the occurrence time of the work activity type is after the occurrence time of the non-work activity type;
[0031] Determine the location of a work place in the activity location according to the spatial structure of the area where the individual is located, wherein the location of the work place corresponds to the type of work activity;
[0032] Determining various pre-selected non-working locations according to the spatial structure of the area where the individual is located, wherein the pre-selected non-working locations correspond to the non-working activity types;
[0033] Based on the population data of the working location and the population data of each of the preselected non-working locations, each of the preselected non-working locations is screened to obtain a target non-working location in the active location.
[0034] In one implementation, generating the trajectory of the individual according to the activity position corresponding to the starting activity type and the activity positions corresponding to the subsequent activity types includes:
[0035] Determine each position distance between each activity position corresponding to the subsequent activity type and the activity position corresponding to the starting activity type;
[0036] According to the distances of the respective positions, the activity positions corresponding to the respective subsequent activity types are screened to obtain the target subsequent activity positions;
[0037] The activity position corresponding to the starting activity type and each of the target subsequent activity positions are connected to generate a trajectory of the individual.
[0038] In a second aspect, an embodiment of the present invention further provides a trajectory generation device, wherein the device comprises the following components:
[0039] An activity type generation module, used to apply a trained neural network model to an initial activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the initial activity type, and the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs;
[0040] An activity position generating module, used to determine each activity position corresponding to each subsequent activity type;
[0041] The trajectory generating module is used to generate the trajectory of the individual according to the activity position corresponding to the starting activity type and the activity positions corresponding to the subsequent activity types.
[0042] In a third aspect, an embodiment of the present invention further provides a terminal device, wherein the terminal device includes a memory, a processor, and a trajectory generation program stored in the memory and executable on the processor, and when the processor executes the trajectory generation program, the steps of the above-mentioned trajectory generation method are implemented.
[0043] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a trajectory generation program is stored. When the trajectory generation program is executed by a processor, the steps of the above-mentioned trajectory generation method are implemented.
[0044] Beneficial effects: The present invention first trains different neural network models for different activity patterns of different individuals. The neural network model is used to record the probability of occurrence of each activity type. Then, the individual's starting activity type is input into the trained neural network model. The neural network model outputs each subsequent activity type of the individual after the starting activity type, and then determines the activity position corresponding to each subsequent activity type. Finally, the activity trajectory is constructed according to the activity position. From the above analysis, it can be seen that since the present invention trains a targeted neural network model for the individual's activity pattern, the accuracy of the subsequent activity type is improved, thereby improving the accuracy of the generated trajectory. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is the overall flow chart of the present invention;
[0046] Figure 2 A schematic diagram of a model for generating individual activity type sequences based on machine learning in an embodiment of the present invention;
[0047] Figure 3 Schematic diagram of the overall framework of the method for generating spatiotemporal trajectories of urban residents in an embodiment of the present invention;
[0048] Figure 4 is a Δt indicator distribution diagram in an embodiment of the present invention;
[0049] Figure 5 is a distribution diagram of N indicators in an embodiment of the present invention;
[0050] Figure 6 is a distribution diagram of the Δr index in an embodiment of the present invention;
[0051] Figure 7 is r in the embodiment of the present invention g Indicator distribution map;
[0052] Figure 8 It is the I-rank indicator distribution diagram in the embodiment of the present invention;
[0053] Fig. 9 This is a block diagram of the internal structure principle of the terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following is a clear and complete description of the technical solution of the present invention in combination with the embodiments and the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Research has found that human mobility behavior is closely related to applications such as infectious diseases, transportation, and public safety. Although the development of modern ICT has made it easy to collect large-scale individual mobile positioning data, the availability and usability of raw trajectory data that involves personal privacy and has redundancy, missingness, and noise are still very limited in practice. The existing technology models the individual movement process based on a small number of easily accessible data samples to generate large-scale individual trajectories, making them close to real data at the statistical level and replaceable at the application level. The modeling of the existing technology is to first establish a neural network model for predicting activity types through sample activity types, but the neural network model established by the existing technology is not established for each activity mode to which the activity type belongs, that is, no matter what activity mode the individual belongs to, the same neural network model is applied to the individual's starting activity type, resulting in poor accuracy of the subsequent activity types generated by the neural network model, which in turn causes the trajectory generated according to the activity position of the subsequent activity type to deviate from the actual trajectory.
[0056] In order to solve the above technical problems, the present invention provides a trajectory generation method, device, equipment and storage medium, which solves the problem of low accuracy of the trajectory generated by the prior art. In specific implementation, firstly, a trained neural network model is applied to the starting activity type of the individual to obtain each subsequent activity type of the individual, wherein the neural network model corresponds to the activity mode to which the individual belongs; then, each activity position corresponding to each subsequent activity type is determined; finally, the trajectory of the individual is generated based on the activity position corresponding to the starting activity type and each activity position corresponding to each subsequent activity type. The present invention can improve the accuracy of the generated trajectory.
[0057] For example, a traffic accident occurred in a certain place, and it is initially suspected that it was caused by the car driven by individual A. At present, we only know that the starting activity type of individual A is to send children to school (the starting activity type is calculated from 8 o'clock in the morning of the day), and the activity location corresponding to the starting activity type is the school. We do not know other activity types of individual A (other activity types are unknown due to missing data), so it is impossible to judge the overall activity trajectory of individual A based on other activity types. The following technical solution can be used to determine the overall activity trajectory of individual A:
[0058] According to the historical activity type of individual A, cluster analysis is performed to find out the activity pattern of individual A (for example, the activity pattern of individual A is the daily outing pattern, that is, individual A leaves home every day to go out for activities), and a neural network model d corresponding to the daily outing pattern is selected from eight trained neural network models, wherein the eight trained neural network models are neural network model a, neural network model b, neural network model c, neural network model d, neural network model e, neural network model f, neural network model g, neural network model h corresponding to the home mode, Monday to Wednesday outing mode, weekend outing mode, daily outing mode, 007 work mode, 996 work mode, 995 work mode, and 965 work mode, respectively. For example, neural network model a is a neural network model trained with the historical activity type of the individual whose activity pattern is the home mode, and neural network model c is a neural network model trained with the historical activity type of the individual whose activity pattern is the weekend outing mode. The above eight neural network models are used to record which activity type should occur after an activity type occurs, that is, the neural network model is used to record what kind of activity type should occur after an activity type occurs.
[0059] The neural network model d is applied to the starting activity type of individual A (the starting activity type is to send the child to school at 8 o'clock in the morning). The neural network model d outputs that the activity type of individual A at 9 o'clock is buying groceries (subsequent activity type), the activity type at 10 o'clock is picking up a package (subsequent activity type), and the activity type at 11 o'clock is cooking (subsequent activity type).
[0060] According to the activity type of individual A at 9 o'clock is buying vegetables, and according to this activity type, the location of individual A at 9 o'clock is the vegetable market; according to the activity type of individual A at 10 o'clock is picking up a parcel, the location of individual A at 10 o'clock is the parcel locker; according to the activity type of individual A at 11 o'clock is cooking, the location of individual A at 11 o'clock is home.
[0061] Summarizing the above positions of individual A at each moment forms the estimated trajectory of individual A.
[0062] If it is known that the activity mode of individual B is the home mode, then by applying the neural network model a to the initial activity type of individual B, each subsequent activity type of individual B can be obtained.
[0063] Exemplary Methods
[0064] The trajectory generation method of this embodiment can be applied to a terminal device, which can be a terminal product with a video trajectory data analysis function, such as a computer. Figure 1 As shown in , the trajectory generation method specifically includes the following steps:
[0065] S100, applying a trained neural network model to the initial activity type of an individual to obtain subsequent activity types of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the initial activity type, and the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity pattern to which the individual belongs.
[0066] S200: Determine each activity position corresponding to each subsequent activity type.
[0067] S300 , generating a trajectory of the individual according to an activity position corresponding to the starting activity type and each activity position corresponding to each subsequent activity type.
[0068] In one embodiment, the above trajectory generation method is used to generate the trajectory of a robot (the robot is an individual), and the specific process is as follows:
[0069] The activity pattern is the activity pattern of the robot, and the trained neural network model is a neural network model that matches the activity pattern of the robot.
[0070] The robot's initial activity type is input into the trained neural network model, and the neural network model outputs each subsequent activity type that follows the initial activity type.
[0071] Determine the positions of each subsequent activity corresponding to each subsequent activity type.
[0072] The trajectory of the robot is obtained according to the initial position corresponding to the initial activity type of the robot and each subsequent activity position.
[0073] In one embodiment, the activity model is constructed in the following manner:
[0074] Each sample activity sequence is constructed, wherein the sample activity sequence is composed of each sample activity type arranged in sequence according to the occurrence time sequence of each sample activity type.
[0075] Cluster analysis is applied to each of the sample activity sequences to obtain the home mode, Monday to Wednesday going out mode, weekend going out mode, daily going out mode, 007 work mode (i.e., the daily working time accounts for the largest proportion of the daily time), 996 work mode (referring to the main start and end time of work activities from 9 am to 9 pm from Monday to Saturday), 995 work mode (referring to the main start and end time of work activities from 9 am to 9 pm from Monday to Friday), and 965 work mode (referring to the main start and end time of work activities from 9 am to 6 pm from Monday to Friday).
[0076] Residents' activities are divided into different types, such as home, work, and others. Each activity type sequence consists of individual activity types at time intervals throughout the day (or week, month, etc.). The longer the time span, the more conducive it is to capturing temporal patterns. Since the daily activity patterns of urban residents are significant, small-scale data with representative samples can be used for model training. This data can be obtained from travel survey data (activity types are relatively accurate and rich), or the rules can be used to identify activity types from trajectory data (usually only residential and work types are more accurately identified).
[0077] A machine learning clustering algorithm (K-medoids is used in this paper) is used to cluster the individual activity type sequence data, and the silhouette coefficient indicator is used to select the optimal number of categories, so that the individual activity type sequences in each category have similar temporal patterns.
[0078] For example, the individuals serving as samples are individuals A, B, C, and D. The sample activity sequence A of individual A is (picking up children from school (activity type), cooking (activity type), washing clothes (activity type), mopping the floor (activity type)), the sample activity sequence B of individual B is (going out for a run, going out shopping, working, volunteering), the sample activity sequence C of individual C is (working, taking a lunch break, working, taking a walk), and the sample activity sequence D of individual D is (working, taking a lunch break, working, buying groceries).
[0079] Perform cluster analysis on sample activity sequence A, sample activity sequence B, sample activity sequence C, and sample activity sequence D, and set the number of clusters to 2. The results of the cluster analysis are the outing activity pattern and the work activity pattern.
[0080] In one embodiment, the neural network model for each activity mode is trained separately, and the training process is as follows:
[0081] A sample starting activity type and each sample subsequent activity type of the sample individual are constructed, and the occurrence time of each sample subsequent activity type is located after the occurrence time of the sample starting activity type.
[0082] The neural network model is applied to the sample starting activity type to obtain each training subsequent activity type output by the neural network model.
[0083] The differences between each of the sample subsequent activity types and each of the training subsequent activity types are compared.
[0084] The parameters of the neural network model are adjusted according to the difference until the difference is less than a threshold value, thereby obtaining a trained neural network model.
[0085] For example, the training method of the neural network model corresponding to each activity mode is the same. Taking the training of one of the neural network models as an example, the training process is explained:
[0086] like Figure 2 As shown in the figure, for each individual activity type sequence in each category (activity pattern), a recurrent neural network (such as a long short-term memory neural network LSTM) is trained as a generative model under the activity pattern. Taking a 2-week time span as an example, the data time span is 336 hours when divided into equal hourly intervals. In the training phase, the first 168-hour window is the initial training feature, and the 169th hour window is the initial training target. After the first round of training is completed, the training feature window and the training target window are both moved back one step to start the next stage of training until all training is completed.
[0087] That is, the activity type of each hour within two weeks of the sample individual is collected as the activity type sample, and a total of 336 activity types corresponding to 336 hours are obtained (including the same activity type but different activity types), and the activity types of the first 168 hours (the sample starting activity type) are input into the neural network model, and the neural network model outputs the activity type of the 169th hour (the subsequent activity type for training), and the activity type of the 169th hour output by the neural network is compared with the activity type of the 169th hour collected as the sample (each activity type is provided with a digital label, and the digital label output by the model is compared with the digital label as the sample), and the parameters of the neural network model are adjusted according to the difference between the two to complete a round of training, and then the activity types of the 2nd hour to the 169th hour are used as samples to input into the neural network model, and the activity types of the 170th hour output by the neural network are obtained, and the activity types of the 170th hour output by the neural network model are compared with the activity types of the 170th hour as the sample, and the model parameters are adjusted according to the comparison results to complete the next round of training. The neural network model is repeatedly trained in the above manner until all the activity types of 336 hours are input into the neural network model to complete the model training.
[0088] In one embodiment, the activity type in step S200 includes a home activity type and a work activity type. In this embodiment, step S200 includes the following steps S201a-S207a:
[0089] S201a, determining a home activity type and a work activity type in the subsequent activity types, wherein the occurrence time of the home activity type is before the occurrence time of the work activity type.
[0090] Home activity types and work activity types are determined as follows: given an individual's starting type, the model is used to continuously generate subsequent activity types. Each newly generated activity type is continuously added to the current input, and the window moves back one step to construct a new input window. Recurrent neural networks are good at capturing sequence features, and LSTM is even better at capturing long-range dependency information in long time series. Through the above steps, individual activity type sequences of a set number and sequence length can be generated based on a small-scale individual activity type sequence dataset that is representative of the sample.
[0091] S202a, determining the probability of each residence corresponding to the home activity type of the individual based on the population spatial distribution data of the area where the individual is located.
[0092] The neural network model is applied to the individual's starting activity type (the activity type is known and can be collected), and the neural network model outputs the next activity type as the home activity type. Then, from the population spatial distribution data of the area where the individual is located, the location of the concentrated residential area in the area is determined, and then the specific residential area of the individual is determined based on the individual's starting activity type.
[0093] For example, from the population spatial distribution data of the area where the individual is located, it can be seen that areas a, b, and c in the area are residential areas, and area d is an industrial area. Since the activity type of the individual is a home activity type, the individual may be located in area a, area b, or area c. And since the starting activity type of the individual is morning exercise, calculate the distance between the morning exercise area and area a, area b, or area c respectively. Based on these three distances, determine the probability of the individual being located in area a, the probability of being located in area b, and the probability of being located in area c.
[0094] S203a, determining a residence position in the activity position according to each of the residence probabilities, wherein the residence position corresponds to the home activity type of the individual.
[0095] For example, among the three probabilities mentioned above, the probability that the individual is located in place a is the largest, so the residential location corresponding to the individual's home activity type can be designated as place a.
[0096] S204a, determining the locations of each pre-selected work place corresponding to the work activity type according to the spatial structure of the area where the individual is located.
[0097] For example, if the spatial structure is that Place A is a residential area, Place B, Place C and Place D are all office areas, then Place B, Place C and Place D are the three pre-selected work locations.
[0098] S205a, drawing a circle with a set radius with the residence location as the center.
[0099] S206a, based on the population data S within the circle ij (With the residence location i as the center and the radius r ij The total population within the circle), the population data P of the residential location i , the population data P of each of the pre-selected work locations j , determine the probability P of the individual selecting each of the pre-selected work location j ij .
[0100]
[0101] In the formula, ∝ is a proportional symbol, α represents the preference of individuals for high potential benefits when choosing spatial locations, β represents the preference of individuals for short distances when choosing spatial locations, a value of 0 indicates no preference, and a value of 1 indicates full preference. Different coefficients can adjust the individual selection preferences in different regions. Based on the above formula, a work location can be selected for each individual who has determined the residential location, and all work activity types in the individual activity type sequence can be filled with this location.
[0102] In one embodiment, α and β are set values in Table 1, that is, α is equal to 0.1, β is equal to 0.5; or α is equal to 0.13, β is equal to 0.61.
[0103] Table 1
[0104] <![CDATA[Preference for workplace selection (α1, β1)]]> <![CDATA[Other location selection preferences (α2, β2) <!-- 7 -->]]> 2 km grid (0.1,0.5) (0.01,0.45) 1 km grid (0.13,0.61) (0.01,0.45)
[0105] As can be seen from Table 1, individuals have a relative preference for choosing a location close to their residence as their workplace and a location close to their current location as other locations, and they are more inclined to choose a location with high potential employment opportunities when choosing a workplace. In response to the problem of spatial heterogeneity, the optimal reference range of preference values for different regions is provided.
[0106] S207a, screening each of the pre-selected work location positions according to each of the selection probabilities, and obtaining a target work location position in the activity position.
[0107] Step S206a calculates the probability P of an individual at residence i selecting each pre-selected work location j. ij , which pre-selected work location corresponds to the probability P ij maximum, then the pre-selected work location is the target work location.
[0108] In another embodiment, the activity type in step S200 includes a non-work activity type and a work activity type, and the non-work activity type is other location selection.
[0109] Some individuals have one or more other activity locations besides their place of residence or work. Since residence and work dominate the daily lives of residents, individuals usually have limited time budgets for other activities. Similarly, when choosing other activity locations, individuals will compare the benefits of the current location, the total benefits between the current location and the destination, and the benefits of the destination, and choose the location closest to the current location with higher potential benefits than the current location, where the potential benefits can also be expressed as the product of the coefficient and the population. Based on a modeling idea similar to that of work location selection, this study uses formula (1) to calculate the probability P of choosing destination j' based on the current location i' ij ’, thereby determining other activity locations for the individual.
[0110] In this embodiment, step S200 includes the following steps S201b to S204b:
[0111] S201b, determining a work activity type and a non-work activity type in the subsequent activity type, wherein the occurrence time of the work activity type is after the occurrence time of the non-work activity type.
[0112] S202b, determining a workplace location in the activity location according to the spatial structure of the area where the individual is located, wherein the workplace location corresponds to the work activity type.
[0113] S203b, preselecting non-working locations j′ according to the spatial structure of the area where the individual is located, wherein the pre-selected non-working locations correspond to the non-working activity types.
[0114] S204b, based on the population data P of the workplace location i′ i ' and the population data P of each of the preselected non-working locations j' j ', filter each of the preselected non-working positions to obtain a target non-working position in the active position.
[0115]
[0116] In the formula, S i ' j is the number of people in a circle with radius r and worksite position i′ as the center, as shown in Table 1, α and β are the set values in Table 1, that is, α is equal to 0.01, β is equal to 0.45; or α is equal to 0.01, β is equal to 0.45.
[0117] In one embodiment, step S300 includes the following steps S301, S302, and S303:
[0118] S301, determining each position distance between each activity position corresponding to the subsequent activity type and the activity position corresponding to the starting activity type.
[0119] S302: Filter the activity locations corresponding to the subsequent activity types according to the location distances to obtain a target subsequent activity location.
[0120] S303: Connect the activity position corresponding to the starting activity type and each of the target subsequent activity positions to generate a trajectory of the individual.
[0121] In one embodiment, the process of determining the trajectory of city residents is as follows:
[0122] like Figure 3 As shown in the figure, the trajectory generation framework is divided into two parts: individual activity type sequence generation and individual spatial location selection. The individual activity type sequence generation part uses a small sample activity type sequence data set to train the machine learning model, and obtains a high-quality large-scale individual activity type sequence at a low data cost; the individual spatial location selection part uses a mechanism model that can clearly describe human mobility behavior to determine the specific location of each activity in the sequence, explicitly incorporating individual mobility behavior and spatial selection mechanisms, and retaining the interpretability of the model to a high degree. Through the above steps, a large number of urban resident trajectories can be generated.
[0123] In one embodiment, taking a region as an example, the accuracy of the trajectory generated by the above embodiment is verified, and the specific process is as follows:
[0124] The area is spatially divided into two spatial units of different granularity: 2km grid and 1km grid. The format of the trajectory point is [longitude, latitude, timestamp]. This embodiment uses the trajectory data of the sampled individuals for one week. After preprocessing such as stop point identification, each trajectory is represented as a sequence of spatial unit IDs with equal time intervals (1 hour in this embodiment), as shown in Table 2.
[0125] Table 2
[0126]
[0127] This embodiment obtains individual activity type sequences from trajectory data (Table 3). Specifically, the location where the individual stays the longest between 9 am and 6 pm is identified as the residential location, and the corresponding activity type is marked as "residence (H)". The non-residential location where the individual stays the longest between 9 am and 6 pm is identified as the work location, and the corresponding activity type is marked as "work (W)". Under this rule, if the work location is in the same spatial unit as the residential location, it will be identified as the "home" type. Since other activity types such as shopping and entertainment are difficult to accurately identify from trajectory data, this embodiment marks them as "others", and "other" activity types with different individual locations are marked as "other 1 (O1)", "other 2 (O2)", etc. It should be noted that this embodiment obtains individual activity type sequences based on trajectory data. In addition, individual activity type sequences can also be directly extracted from resident travel survey data, and the other activity types contained therein will also be richer.
[0128] Table 3
[0129] Time interval 0:00-1:00 1:00-2:00 … 23:00-24:00 23:00-24:00 … Activity Type Residence (H) Residence (H) … Work (W) Residence (H) …
[0130] The waiting time Δt (the time interval between two consecutive visited locations in the individual trajectory), the moving step Δr (the distance between two consecutive visited locations in the individual trajectory), the location set size N (the number of different locations visited by the individual), and the turning radius r are used. g The difference between the generated trajectory and the real trajectory is evaluated by the KL divergence corresponding to the frequency ranking of individual visits at the location and the CPC indicator (used to measure the similarity between the population flow between the areas obtained by generating trajectory aggregation and the real population flow):
[0131]
[0132] in,
[0133]
[0134] Where p and q are the distribution of a certain spatiotemporal characteristic index of the real trajectory data and the distribution of a certain spatiotemporal characteristic index of the generated trajectory data, respectively. The smaller the KL divergence value, the more similar the two probability distributions are.
[0135]
[0136] T ij is the actual population flow from location i to location j, T ij ′ is the population flow obtained by aggregating the generated trajectory from location i to location j. CPC takes values of [0,1], and the higher the value, the more consistent the two are.
[0137] The KL divergence was used to compare the differences in the distribution of spatiotemporal characteristic indicators between the trajectories generated by each model and the original trajectories, and the CPC indicator was used to compare the similarity between the population flow aggregated by the generated trajectories between locations and the actual population flow. At the same time, the robustness of the indicator results was analyzed by calculating the variance of the model running results multiple times. As shown in Table 4 and Figures 4 to 8 As shown, Figure 4 The horizontal axis is Δt, Figure 5 The horizontal axis is N. For the indicators Δt, N and I-rank, the trajectories generated by the present invention are better than other models at the two spatial granularities of 1km grid and 2km grid, indicating that the present invention captures the temporal pattern well in the activity sequence generation stage, such as activity residence time, visit frequency, exploration and preference return and other characteristics. At the same time, the results of the present invention on the CPC indicator are also optimal, indicating that the generated trajectory has obtained a result that is relatively consistent with the actual result at the group aggregation level. Finally, the present invention has a good performance in the rotation radius r. g The performance of the proposed method on the moving step length Δr is optimal or suboptimal, but it is more stable than other models. The above results show that this method can better capture the mobility behavior of urban residents, and the generated trajectory is more consistent with the real data at the statistical level.
[0138] Table 4
[0139]
[0140]
[0141] In summary, the present invention first trains different neural network models for different activity patterns of different individuals. The neural network model is used to record the probability of occurrence of each activity type. Then, the individual's starting activity type is input into the trained neural network model. The neural network model outputs each subsequent activity type of the individual after the starting activity type, and then determines the activity position corresponding to each subsequent activity type. Finally, the activity trajectory is constructed according to the activity position. From the above analysis, it can be seen that since the present invention trains a targeted neural network model for the individual's activity pattern, the accuracy of the subsequent activity type is improved, thereby improving the accuracy of the generated trajectory.
[0142] In addition, the present invention generates large-scale individual trajectory data based on low-cost, easily accessible small sample individual activity type sequence and population distribution data, directly avoiding the defects of original trajectory data involving personal privacy and having redundancy, omissions and noise.
[0143] The present invention utilizes a machine learning model to generate a sequence of individual activity types, and a mechanism model to select locations for corresponding activities. According to the characteristics of the research problem, the present invention adaptively combines and leverages the respective advantages of machine learning and mechanism models, making the model have both high accuracy and interpretability.
[0144] The present invention innovatively proposes the idea of "clustering first, then generating", and adopts the long short-term memory neural network (LSTM) that is good at capturing temporal features to construct an individual activity type sequence generation model, which can better preserve the original temporal pattern.
[0145] For the generated individual activity type sequence, the present invention selects the home location for the individual according to the population spatial distribution probability; generates the commuting flow distribution using the unified opportunity model and the workplace selection preference parameters, and selects the work location for each individual according to probability; uses the non-commuting flow distribution generated by the unified opportunity model and other activity type location selection preference parameters, and selects other activity type locations for each individual according to probability, and finally generates a complete individual trajectory. The entire location selection process reasonably incorporates multiple aspects of human mobility behavior laws, which helps to improve the authenticity of the generated trajectory.
[0146] Exemplary Devices
[0147] This embodiment also provides a trajectory generation device, which includes the following components:
[0148] An activity type generation module, used to apply a trained neural network model to an initial activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the initial activity type, and the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs;
[0149] An activity position generating module, used to determine each activity position corresponding to each subsequent activity type;
[0150] The trajectory generating module is used to generate the trajectory of the individual according to the activity position corresponding to the starting activity type and the activity positions corresponding to the subsequent activity types.
[0151] Based on the above embodiments, the present invention further provides a terminal device, whose principle block diagram can be shown as follows: Fig. 9As shown. The terminal device includes a processor, a memory, a network interface, a display screen, and a temperature sensor connected through a system bus. Among them, the processor of the terminal device is used to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a trajectory generation method is implemented. The display screen of the terminal device can be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the terminal device is pre-set inside the terminal device to detect the operating temperature of the internal device.
[0152] Those skilled in the art will understand that Fig. 9 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal device to which the scheme of the present invention is applied. The specific terminal device may include more or less components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0153] In one embodiment, a terminal device is provided. The terminal device includes a memory, a processor, and a trajectory generation program stored in the memory and executable on the processor. When the processor executes the trajectory generation program, the following operation instructions are implemented:
[0154] Applying a trained neural network model to the starting activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the starting activity type, the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs;
[0155] Determining each activity position corresponding to each of the subsequent activity types;
[0156] The trajectory of the individual is generated according to the activity position corresponding to the starting activity type and each activity position corresponding to each subsequent activity type.
[0157] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A trajectory generation method, characterized in that: include: Applying a trained neural network model to the starting activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the starting activity type, the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs; Determining each activity position corresponding to each of the subsequent activity types; Generate a trajectory of the individual according to the activity position corresponding to the starting activity type and the activity positions corresponding to the subsequent activity types; The determining of each activity position corresponding to each subsequent activity type includes: Determining a home activity type and a work activity type in the subsequent activity types, wherein an occurrence time of the home activity type is before an occurrence time of the work activity type; Determine the probability of each residence location corresponding to the home activity type of the individual based on the population spatial distribution data of the area where the individual is located; Determining a residence position in the activity position according to each of the residence probabilities, the residence position corresponding to the home activity type of the individual; Determining the locations of each pre-selected work place corresponding to the work activity type according to the spatial structure of the area where the individual is located; According to the population data of the residence location and the population data of each of the pre-selected work locations, each of the pre-selected work locations is screened to obtain a target work location in the activity location; Alternatively, the determining of each activity position corresponding to each subsequent activity type includes: Determine a work activity type and a non-work activity type in the subsequent activity type, wherein the occurrence time of the work activity type is after the occurrence time of the non-work activity type; Determine the location of a work place in the activity location according to the spatial structure of the area where the individual is located, wherein the location of the work place corresponds to the type of work activity; Determining various pre-selected non-working locations according to the spatial structure of the area where the individual is located, wherein the pre-selected non-working locations correspond to the non-working activity types; Based on the population data of the working location and the population data of each of the preselected non-working locations, each of the preselected non-working locations is screened to obtain a target non-working location in the active location.
2. The trajectory generation method according to claim 1, characterized in that: The training methods of the trained neural network model include: Constructing a sample starting activity type and each sample subsequent activity type of the sample individual, wherein the occurrence time of each sample subsequent activity type is after the occurrence time of the sample starting activity type; Applying the neural network model to the sample starting activity type to obtain each training subsequent activity type output by the neural network model; Comparing the differences between each of the sample subsequent activity types and each of the training subsequent activity types; The parameters of the neural network model are adjusted according to the difference until the difference is less than a threshold value, thereby obtaining a trained neural network model.
3. The trajectory generation method according to claim 1, characterized in that: The activity mode is constructed in a manner including: Constructing each sample activity sequence, wherein the sample activity sequence is composed of each sample activity type arranged in sequence according to the occurrence time sequence of each sample activity type; Cluster analysis is applied to each of the sample activity sequences to obtain the home mode, Monday to Wednesday going out mode, weekend going out mode, daily going out mode, 007 work mode, 996 work mode, 995 work mode, and 965 work mode in the activity modes.
4. The trajectory generation method according to claim 1, characterized in that: The step of screening each of the pre-selected work locations based on the population data of the residence location and the population data of each of the pre-selected work locations to obtain the target work location in the activity location includes: Draw a circle with a set radius with the residence location as the center; Determine the selection probabilities of the individual selecting each of the pre-selected work locations based on the population data within the circle, the population data of the residence location, and the population data of each of the pre-selected work locations; According to each of the selection probabilities, each of the pre-selected work locations is screened to obtain a target work location in the active location.
5. The trajectory generation method according to claim 1, characterized in that: The generating the trajectory of the individual according to the activity position corresponding to the starting activity type and the activity positions corresponding to the subsequent activity types includes: Determine each position distance between each activity position corresponding to each of the subsequent activity types and the activity position corresponding to the starting activity type; According to the distances of the respective positions, the activity positions corresponding to the respective subsequent activity types are screened to obtain the target subsequent activity positions; The activity position corresponding to the starting activity type and each of the target subsequent activity positions are connected to generate a trajectory of the individual.
6. A trajectory generating device, characterized in that: The device comprises the following components: An activity type generation module, used to apply a trained neural network model to an initial activity type of an individual to obtain each subsequent activity type of the individual, wherein the occurrence time of each subsequent activity type is after the occurrence time of the initial activity type, and the neural network model is used to record the probability of occurrence of each activity type, and the neural network model corresponds to the activity mode to which the individual belongs; An activity position generating module, used to determine each activity position corresponding to each subsequent activity type; A trajectory generation module, configured to generate a trajectory of the individual according to an activity position corresponding to the starting activity type and each activity position corresponding to each subsequent activity type; The determining of each activity position corresponding to each subsequent activity type includes: Determining a home activity type and a work activity type in the subsequent activity types, wherein an occurrence time of the home activity type is before an occurrence time of the work activity type; Determine the probability of each residence location corresponding to the home activity type of the individual based on the population spatial distribution data of the area where the individual is located; Determining a residence position in the activity position according to each of the residence probabilities, the residence position corresponding to the home activity type of the individual; Determining the locations of each pre-selected work place corresponding to the work activity type according to the spatial structure of the area where the individual is located; According to the population data of the residence location and the population data of each of the pre-selected work locations, each of the pre-selected work locations is screened to obtain a target work location in the activity location; Alternatively, the determining of each activity position corresponding to each subsequent activity type includes: Determine a work activity type and a non-work activity type in the subsequent activity type, wherein the occurrence time of the work activity type is after the occurrence time of the non-work activity type; Determine the location of a work place in the activity location according to the spatial structure of the area where the individual is located, wherein the location of the work place corresponds to the type of work activity; Determining various pre-selected non-working locations according to the spatial structure of the area where the individual is located, wherein the pre-selected non-working locations correspond to the non-working activity types; Based on the population data of the working location and the population data of each of the preselected non-working locations, each of the preselected non-working locations is screened to obtain a target non-working location in the active location.
7. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a trajectory generation program stored in the memory and executable on the processor. When the processor executes the trajectory generation program, the steps of the trajectory generation method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a trajectory generation program, and when the trajectory generation program is executed by the processor, the steps of the trajectory generation method according to any one of claims 1 to 5 are implemented.
