CN114154687A - Trajectory prediction method and apparatus, electronic device and storage medium - Google Patents

Trajectory prediction method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
CN114154687A
CN114154687A CN202111359735.XA CN202111359735A CN114154687A CN 114154687 A CN114154687 A CN 114154687A CN 202111359735 A CN202111359735 A CN 202111359735A CN 114154687 A CN114154687 A CN 114154687A
Authority
CN
China
Prior art keywords
target object
track
matrix
place
conversion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111359735.XA
Other languages
Chinese (zh)
Inventor
向正贵
张伟平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Taikang Health Industry Investment Holdings Co ltd
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Health Industry Investment Holdings Co ltd
Taikang Insurance Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Taikang Health Industry Investment Holdings Co ltd, Taikang Insurance Group Co Ltd filed Critical Taikang Health Industry Investment Holdings Co ltd
Priority to CN202111359735.XA priority Critical patent/CN114154687A/en
Publication of CN114154687A publication Critical patent/CN114154687A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

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

Abstract

The application discloses a track prediction method, a track prediction device, electronic equipment and a storage medium, which belong to the technical field of health care, and the method comprises the following steps: the method comprises the steps of obtaining track data of a target object in a current period, wherein the track data comprises a place where the target object reaches and an arrival sequence of the place, carrying out feature analysis on the track data to obtain track features, carrying out conversion processing on the track features based on weight parameters to obtain conversion features, analyzing interest of the target object to each candidate place based on the conversion features, determining a place where the target object is going to based on an interest analysis result, and learning a relation between the track features and the conversion features of the track data of the target object in a history period by the weight parameters. Therefore, the place where the target object is going to can be known in advance, a manager can conveniently master the activity direction of the target object, and the management efficiency is improved.

Description

Trajectory prediction method and apparatus, electronic device and storage medium
Technical Field
The present application relates to the field of health care technology, and in particular, to a trajectory prediction method and apparatus, an electronic device, and a storage medium.
Background
In the field of old people care, community old people care is a trend because the old people can live in a familiar community environment and the old people can feel more affiliated. However, the elderly in community care have relatively more activity areas and more dispersed activity places, which brings great difficulty to the care management.
Therefore, how to predict the activity track of the elderly to facilitate the elderly care manager to better perform care management becomes an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a track prediction method, a track prediction device, electronic equipment and a storage medium, which are used for providing a scheme for predicting an activity track.
In a first aspect, an embodiment of the present application provides a trajectory prediction method, including:
acquiring track data of a target object in a current period, wherein the track data comprises a place reached by the target object and an arrival sequence of the place;
carrying out characteristic analysis on the track data to obtain track characteristics;
performing conversion processing on the track characteristics based on weight parameters to obtain conversion characteristics, wherein the weight parameters are obtained by learning the relationship between the track characteristics and the conversion characteristics of the track data of the target object in the historical period;
analyzing the interest of the target object to each candidate place based on the conversion characteristics;
determining a location to which the target object is to go based on the interest analysis result.
In some embodiments, performing feature analysis on the trajectory data to obtain trajectory features includes:
generating a location embedding vector for each location where the target object arrives based on predetermined location embedding parameters;
generating an order embedding vector for the place based on a predetermined order embedding parameter;
carrying out fusion processing on the place embedding vector and the sequence vector to obtain a track vector of the place;
and combining the track vectors of all the points according to the reaching sequence, and taking a track matrix obtained by combination as the track characteristic.
In some embodiments, the weighting parameters include a first weighting matrix, a second weighting matrix, and a third weighting matrix, and the transforming the trajectory feature based on the weighting parameters to obtain a transformed feature includes:
performing conversion processing on the track matrix based on the first weight matrix to obtain a first conversion matrix;
performing conversion processing on the track matrix based on the second weight matrix to obtain a second conversion matrix;
performing conversion processing on the track matrix based on the third weight matrix to obtain a third conversion matrix;
and taking the first conversion matrix, the second conversion matrix and the third conversion matrix as the conversion characteristics.
In some embodiments, analyzing the interest of the target object in going to each candidate location based on the conversion features includes:
determining the weight of each place where the target object arrives based on the first conversion matrix and the second conversion matrix;
and performing weighted summation on the column vectors in the third conversion matrix based on the weight of each place where the target object arrives to obtain an interest characterization vector.
In some embodiments, the weight w of the ith location reached by the target object is determined according to the following formulai
Figure BDA0003358690360000021
Wherein q isiFor the ith column vector, k, in the first conversion matrixiFor the ith column vector, k, in the second transformation matrixjFor the jth column vector in the second transformation matrix, d is the row of the trace matrixAnd m is the total number of the places where the target object arrives, and i and j are integers.
In some embodiments, determining a location to which the target object is to go based on the interest analysis results comprises:
determining the probability of the target object going to each candidate site based on the interest characterization vector and the embedded vector of each candidate site, wherein each candidate site is determined according to the site reached by the target object in the history period;
and determining the candidate place with the highest probability as the place to which the target object is going.
In some embodiments, the probability p (v) that the target object will go to the c-th candidate location is determined according to the following formulac):
Figure BDA0003358690360000031
Wherein v iscIs the c-th candidate location, a is the interest characterization vector, VEcAs an embedding vector for the c-th candidate location, VEsIs the embedding vector of the s-th candidate location, N is the total number of candidate locations, and c and s are integers.
In a second aspect, an embodiment of the present application provides a trajectory prediction apparatus, including:
the acquisition module is used for acquiring track data of a target object in a current period, wherein the track data comprises a place reached by the target object and an arrival sequence of the place;
the characteristic analysis module is used for carrying out characteristic analysis on the track data to obtain track characteristics;
the conversion module is used for carrying out conversion processing on the track characteristics based on weight parameters to obtain conversion characteristics, wherein the weight parameters are obtained by learning the relation between the track characteristics and the conversion characteristics of the track data of the target object in the historical period;
the interest analysis module is used for analyzing the interest of the target object to each candidate place based on the conversion characteristics;
and the determining module is used for determining the place to which the target object is going to go based on the interest analysis result.
In some embodiments, the feature analysis module is specifically configured to:
generating a location embedding vector for each location where the target object arrives based on predetermined location embedding parameters;
generating an order embedding vector for the place based on a predetermined order embedding parameter;
carrying out fusion processing on the place embedding vector and the sequence vector to obtain a track vector of the place;
and combining the track vectors of all the points according to the reaching sequence, and taking a track matrix obtained by combination as the track characteristic.
In some embodiments, the weight parameters include a first weight matrix, a second weight matrix, and a third weight matrix, and the conversion module is specifically configured to:
performing conversion processing on the track matrix based on the first weight matrix to obtain a first conversion matrix;
performing conversion processing on the track matrix based on the second weight matrix to obtain a second conversion matrix;
performing conversion processing on the track matrix based on the third weight matrix to obtain a third conversion matrix;
and taking the first conversion matrix, the second conversion matrix and the third conversion matrix as the conversion characteristics.
In some embodiments, the interest analysis module is specifically configured to:
determining the weight of each place where the target object arrives based on the first conversion matrix and the second conversion matrix;
and performing weighted summation on the column vectors in the third conversion matrix based on the weight of each place where the target object arrives to obtain an interest characterization vector.
In some embodiments, theThe interest analysis module is specifically configured to determine a weight w of an ith location reached by the target object according to the following formulai
Figure BDA0003358690360000051
Wherein q isiFor the ith column vector, k, in the first conversion matrixiFor the ith column vector, k, in the second transformation matrixjAnd d is the jth column vector in the second conversion matrix, d is the row number of the track matrix, m is the total number of the places where the target object arrives, and i and j are integers.
In some embodiments, the determining module is specifically configured to:
determining the probability of the target object going to each candidate site based on the interest characterization vector and the embedded vector of each candidate site, wherein each candidate site is determined according to the site reached by the target object in the history period;
and determining the candidate place with the highest probability as the place to which the target object is going.
In some embodiments, the determining module is specifically configured to determine the probability p (v) that the target object travels to the c-th candidate location according to the following formulac):
Figure BDA0003358690360000052
Wherein v iscIs the c-th candidate location, a is the interest characterization vector, VEcAs an embedding vector for the c-th candidate location, VElIs the embedding vector of the ith candidate location, N is the total number of candidate locations, and c and l are integers.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the trajectory prediction method described above.
In a fourth aspect, embodiments of the present application provide a storage medium, where instructions in the storage medium are executed by a processor of an electronic device, and the electronic device is capable of executing the trajectory prediction method.
In the embodiment of the application, the track data of a target object in a current period is obtained, the track data comprises the reaching place of the target object and the reaching sequence of the reaching place, feature analysis is carried out on the track data to obtain track features, conversion processing is carried out on the track features based on weight parameters to obtain conversion features, the interest of the target object in going to each candidate place is analyzed based on the conversion features, the place to which the target object is going to be going is determined based on the interest analysis result, and the weight parameters are obtained by learning the relation between the track features and the conversion features of the track data of the target object in a history period. Therefore, the place where the target object is going to can be known in advance, a manager can conveniently master the activity trend of the target object, the management difficulty is reduced, and the management efficiency is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is an application scenario diagram of trajectory prediction according to an embodiment of the present application;
fig. 2 is a flowchart of a trajectory prediction method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a feature analysis performed on trajectory data according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating an analysis of interest of a target object in going to each candidate location according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a method for determining a location to which a target object is to go according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a self-attention model according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of a continuous bag-of-words model provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a trajectory prediction apparatus according to an embodiment of the present application;
fig. 9 is a schematic hardware structure diagram of an electronic device for implementing a trajectory prediction method according to an embodiment of the present application.
Detailed Description
In order to provide a scheme for predicting an activity track, embodiments of the present application provide a track prediction method, an apparatus, an electronic device, and a storage medium.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In the community care for the aged, the old man generally has a plurality of activity places such as dormitory, dining room, square, park, library etc. in order to provide the care for the aged better, can provide the locator card for the old man, the locator card can acquire the activity data of old man under the enabling state like which places, how long waiting etc. in these places, can learn old man's orbit data based on the activity data.
Fig. 1 is an application scenario diagram of trajectory prediction according to an embodiment of the present application. In particular, a region (shown by an oval in fig. 1) allowing to acquire trajectory data of an object may be predetermined, and there may be a plurality of locations in the region, and there may be a plurality of objects such as 3 objects: object 1, object 2 and object 3, wherein object 1 is always active in this area, object 2 is entered into this area from outside, and object 3 stays in this area. In any case, when an object is located in the area, the locator card worn by the object can transmit the trajectory data of the object in the area to the server. The server may then generate trajectory data for the object during the current period based on the activity data.
After introducing the application scenarios of the embodiments of the present application, a description is next given of a trajectory prediction method according to the embodiments of the present application with reference to a flowchart.
Fig. 2 is a flowchart of a trajectory prediction method according to an embodiment of the present application, where the method may be applied to the server in fig. 1, and may also be applied to other servers, and the method includes the following steps.
In step S201, trajectory data of the target object in the current cycle is acquired, the trajectory data including a place where the target object arrives and an arrival order of the places.
The target object may be any resident, such as an old person living in an elderly community, a child living in a general community, and the like. The current period is as of the current day.
In step S202, the trajectory data is subjected to feature analysis to obtain trajectory features.
In specific implementation, the trajectory data may be subjected to feature analysis according to the flow shown in fig. 3, including the following steps:
in step S301a, a location embedding vector for each location where the target object arrives is generated based on predetermined location embedding parameters.
In general, the location embedding parameters may be expressed in a matrix form. In specific implementation, one-hot coding can be adopted to code each place where a target object arrives to obtain a sparse vector of the place, and then, the dot product of the sparse vector and the matrix is calculated to obtain a place embedding vector of the place.
In step S302a, an order embedding vector for the place is generated based on a predetermined order embedding parameter.
In general, order-embedded parameters may be represented as vectors parameterized by the order of the locations. In specific implementation, the order of arrival of each place where the target object arrives is substituted into the vector, so that the order embedding vector of the place can be obtained.
In step S303a, the location embedding vector and the order vector are fused to obtain a trajectory vector of the location.
For example, the location embedding vector and the elements corresponding to the same position in the order embedding vector are added to obtain the trajectory vector of the location.
In step S304a, the trajectory vectors of the respective points are combined in the order of arrival, and the combined trajectory matrix is used as the trajectory feature.
For example, the track vectors of the respective points are combined in columns according to the sequence of the arrival order from morning to evening, and the track matrix obtained by combination is used as the track feature of the track data.
In step S203, the trajectory feature is subjected to conversion processing based on the weight parameter, which is obtained by learning the relationship between the trajectory feature and the conversion feature of the trajectory data of the target object in the history period, so as to obtain the conversion feature.
In a specific implementation, the weight parameter may include a first weight matrix, a second weight matrix, and a third weight matrix, and therefore, the trajectory matrix may be converted based on the first weight matrix to obtain a first conversion matrix, the trajectory matrix may be converted based on the second weight matrix to obtain a second conversion matrix, the trajectory matrix may be converted based on the third weight matrix to obtain a third conversion matrix, and the first conversion matrix, the second conversion matrix, and the third conversion matrix are used as the conversion feature.
The first conversion matrix mainly focuses on the current location in the track data and can be used for representing track characteristics of the current location; the second conversion matrix mainly focuses on other places (namely, places except the current place) and can be used for representing the track characteristics of the other places; the third conversion matrix is used for representing the incidence relation between the current place and other places.
In step S204, based on the conversion features, the interest of the target object in going to each candidate location is analyzed.
In specific implementation, the interest of the target object in going to each candidate location may be analyzed according to the flow shown in fig. 4, including the following steps:
in step S401a, the weight of each place where the target object arrives is determined based on the first conversion matrix and the second conversion matrix.
For example, the weight w of the ith location reached by the target object can be determined according to the following formulai
Figure BDA0003358690360000091
Wherein q isiFor the ith column vector, k, in the first conversion matrixiFor the ith column vector, k, in the second transformation matrixjThe j-th column vector in the second conversion matrix, d the number of rows of the track matrix, m the total number of the places where the target object arrives, and i and j are integers.
In step S402a, the column vectors in the third transformation matrix are weighted and summed based on the weight of each place where the target object arrives, so as to obtain an interest characterization vector.
The interest characterization vector is used for characterizing the interest degree of the target object in each candidate place. Each element in the interest vector corresponds to a candidate location, the larger the value of the element is, the higher the interest degree of the target object in the candidate location is, and the smaller the value of the element is, the lower the interest degree of the target object in the candidate location is.
For example, the interest characterization vector a is determined according to the following formula:
Figure BDA0003358690360000092
wherein u isiIs the ith column vector in the third transformation matrix.
In step S205, based on the interest analysis result, a place to which the target object is going is determined.
In specific implementation, the location to which the target object is going can be determined according to the flow shown in fig. 5, including the following steps:
in step S501a, based on the interest characterization vector and the embedded vector of each candidate location, the probability that the target object will go to each candidate location is determined, and each candidate location is determined according to the location where the target object has arrived in the history cycle.
In specific implementation, all the places that the target object has reached in the history period may be determined as candidate places, and some of the places that the target object has reached in the history period may also be determined as candidate places.
Then, the probability p (v) of the target object going to the c-th candidate site is determined according to the following formulac):
Figure BDA0003358690360000101
Wherein the content of the first and second substances,vcfor the c-th candidate location, a is the interest characterization vector, VEcAs an embedding vector for the c-th candidate location, VElIs the embedding vector of the ith candidate location, N is the total number of candidate locations, and c and l are integers.
In step S502a, the candidate location with the highest probability is determined as the location to which the target object will go.
The above process is described below with reference to specific examples.
In particular, a self-attention model may be used to predict the location to which the target object will go based on the trajectory data of the target object in the current period, where the trajectory data includes the location to which the target object arrives and the arrival order of the locations.
Referring to fig. 6, the self-attention model includes an input layer, an embedded representation layer, a feature conversion layer, an attention layer, and an output layer. The input layer is used for coding each place where the target object arrives in the current period to obtain a sparse vector of each place; the embedding representation layer is used for representing the sparse vector of each place as a place embedding vector, converting the arrival sequence of each place into a sequence embedding vector, carrying out fusion processing on the place embedding vector and the sequence embedding vector of the same place to obtain a track vector of the place, and generating a track matrix based on the track vectors of each place; the characteristic conversion layer is used for carrying out conversion processing on the track matrix to obtain a conversion matrix; the attention layer is used for calculating the probability of the target object going to each candidate place based on the conversion matrix; and the output layer is used for outputting the place with the maximum probability as the place to which the target object is going.
In specific implementation, the above process can be performed according to the following steps:
the first step is to embed and represent the location in the trajectory data.
The embedded representation of the place includes a place embedded representation and an order embedded representation, which are described separately below.
1. The place is embedded in the representation.
Taking a day period as an example, the trajectory data of the target object in the last three days are assumed as follows:
trajectory data 1: a is di- > B di- > D di- > E di- > A;
trajectory data 2: a di- > B di- > C di- > D di- > E di- > A;
trajectory data 3: a is Di- > C is Di- > D is Di- > E is Di- > A.
All the site sets of the three-day trajectory data are: { a, B, C, D, E, etc., the size of the set is denoted as n-5, v1Denotes A, v2Denotes B or v3Denotes C, v4Denotes D ground, v5Represents E ground.
In specific implementation, the five locations may be encoded by one-hot encoding, and the sparse vector of the location a is: (1,0,0,0, 0); the sparse vector for B is: (0, 1,0,0, 0); the sparse vector for C is: (0, 0, 1,0, 0); the sparse vector for D is: (0, 0,0, 1, 0); the sparse vector for E-site is: (0,0,0,0,1). Then, the Word-to-vector (Word2Vec) technology is used to represent the sparse vector with n dimensions of each place as a dense vector with d dimensions (namely, a place embedding vector), wherein d < n.
The following describes a generation process of a location embedding parameter for converting a sparse vector of a location into a dense vector by taking a Continuous Bag-of-Words Model (CBOW) as an example.
Assuming that d is 2, fig. 7 is a schematic structural diagram of a continuous bag-of-words model provided in the present application example, where W is1,B1,W2,B2For the continuous bag-of-words model parameters to be learned, relu (x) max (0, x),
Figure BDA0003358690360000111
m is the number of locations contained in the trajectory data.
When training is started, the weight matrix W may be set1And W2Initialization is to random values such as:
Figure BDA0003358690360000121
is prepared from A, Di-)>B is an example, then
Figure BDA0003358690360000122
Operating according to the formula in fig. 7 can obtain:
Figure BDA0003358690360000123
wherein the content of the first and second substances,
Figure BDA0003358690360000124
output of continuous bag of words model based on initialized weight matrix
Figure BDA0003358690360000125
The error from the actual result Y (B ground) can be expressed as the cross entropy:
Figure BDA0003358690360000126
in the training process of the continuous bag-of-words model, model parameters such as the weight matrix and the like are adjusted, so that the sum of cross entropies of all training samples is smaller than a preset threshold value.
With track data 1: for example, A di- > B di- > D di- > E di- > A di, based on trajectory data 1, the following training samples can be constructed:
a, next site: b is ground;
b, next site: d, ground;
d, next site: e, ground;
e, next site: a is ground;
a, B > B, the next place: d, ground;
b, D > D, next place: e, ground;
d di- > E di, the next place: a is ground;
a di- > B di- > D di, the next place: e, ground;
b di- > D di- > E di, the next place: a is ground;
a di- > B di- > D di- > E di, the next place: a is ground;
the cross entropy loss function of all training samples constructed based on the trajectory data of the target object in each history period is expressed as:
Figure BDA0003358690360000131
wherein S is the total number of samples in all training samples.
The objective function is to minimize the cross entropy loss function for all training samples. By optimizing the objective function using a stochastic gradient descent method, or an optimizer such as Adam, optimal parameters such as weights can be generated, for example,
Figure BDA0003358690360000132
once the objective function is optimized, the weight matrix W can be used1 *Or transposed weight matrix
Figure BDA0003358690360000133
As a location embedding parameter.
Subsequently, any trajectory data v by means of location embedding parameters1→v2→...→vmCan be converted into a d × m embedded matrix (VE)1...VEk...VEm) Wherein VEkFor the k-th position v in the trajectory datakD-dimensional location of (3) is embedded in a vector, and VEkIs W1 *And location vkIs the dot product of the sparse vectors of (k ∈ [1, m ]]。
2. The order embedding representation.
By track data v1→v2→v4→v5→v1For example, the arrival order of each location in the trajectory data is 1, 2, 3, 4, 5. Then, the d-dimensional order embedding vector for the Pos-th location (i.e., Pos arrival order) in the trajectory data can be expressed as:
Figure BDA0003358690360000141
assuming that d is 2, the order embedding vector of the first location in the trace data is
Figure BDA0003358690360000142
The order of the second location is embedded into the vector
Figure BDA0003358690360000143
Assuming that d is 4, the order embedding vector of the first location in the trace data is
Figure BDA0003358690360000144
The order of the second location is embedded into the vector
Figure BDA0003358690360000145
In specific implementation, the method aims at the Pos-th arrival place v in the track datakV. sitekD-dimensional trajectory vector VPposCan be expressed as: VPpos=VEk+PEposWherein VEkIs a location vkD-dimensional location embedding vector, PEposIs a location vkThe d-dimensional order of the corresponding arrival order Pos embeds the vector. Then, the trajectory vectors of the respective points in the trajectory data are combined in columns in the order of the arrival order from morning to evening, and the obtained trajectory matrix V ═ VP (VP)1,VP2,...,VPm) I.e. the track characteristics of the track data, and m is the total number of locations included in the track data.
And secondly, analyzing the context relationship between the positions in the track data.
In specific implementation, the trajectory matrix V is (VP)1,VP2,...,VPm) And three weight matrices WQ、WK、WU(these three weight matrices, i.e., conversion parameters) are multiplied to obtain three d × m-dimensional conversion matrices Q ═ Q (Q ═ m)1,q2,...,qm)、K=(k1,k2,...,km)、U=(u1,u2,...,um) As shown in the following formula.
Figure BDA0003358690360000146
Wherein, WQ、WK、WUIs a d × d dimension weight parameter to be learned. Q, the first transformation matrix, may also be referred to as a query matrix, K, the second transformation matrix, may also be referred to as a key matrix, and U, the third transformation matrix, may also be referred to as a value matrix.
Here, Q focuses on the current location in the trajectory data, and the attention score of the other location with respect to the current location can be obtained by multiplying the query vector corresponding to the current location in Q by the key vector corresponding to the other location in K. K focuses on other locations and the key vector corresponds to the index of each location in the trajectory data. U concerns the arrival sequence relationship between the current location and other locations, and the value vector is a true representation of the location. After the attention score is calculated, a vector representing the context information of the current location can be obtained by performing weighted summation using the value vector.
To learn WQ、WKAnd WUPairing based on interactions between queries, keys and valuesModeling the context information of the track data, wherein the interaction between a certain place and other places in the track data can be described by an interest characterization vector a, and the calculation formula of a is as follows:
Figure BDA0003358690360000151
Figure BDA0003358690360000152
wherein, wiIs a value vector uiWeight of (a), qi(ki)TIs a location viQuery vector q ofiAnd the key vector kiTransposed dot product of uiIs the ith column vector in U, qiIs the ith column vector in Q, kiIs the ith column vector in K, KjFor the jth column vector in K, i, j ∈ [1, m ∈ ]]。
And thirdly, predicting the next place to which the target object is going to go.
In specific implementation, the probability distribution of the target object to each candidate location can be calculated according to the following formula:
Figure BDA0003358690360000153
wherein, p (v)i) The probability of the target object going to the ith candidate location is defined as a interest characterization vector, VEiIs the embedded vector for the ith candidate location, N is the total number of all candidate locations, and in general, a candidate location may be all locations reached by the target object during the selected history period.
Then, the candidate location with the highest probability is determined as the next location to which the target object will go.
The following describes learning WQ、WKAnd WUThe process of (1).
In specific implementation, all the positions in front of the current position in the track data can be used as outputsThen, the place next to the current place is used as a marker value, and the place with the maximum probability value obtained by the formula is used as a predicted value. Weight matrix W of self-attention model when training is startedQ、WKAnd WUThen, the weight matrix W can be used firstQ、WKAnd WUInitialized to a random value.
With the track data v of a certain day of the target object1→v2→v4→v5→v1For example, the first 4 location sequences are used as input, the 5 th location is used as a mark, and then the trajectory matrix is V ═ VE (VE)1+PE1,VE2+PE2,VE4+PE3,VE5+PE4) The query matrix Q ═ WQV, bond weight K ═ WKV, value matrix U ═ WUV,
Figure BDA0003358690360000161
Interest characterization vector
Figure BDA0003358690360000162
The next location of the sequence of tracks is actually v1And is represented by Y ═ 1,0,0, 0.
The next position of the track sequence calculated based on the above formula is viHas a probability of p (v)i),i∈[1,5]Memory for recording
Figure BDA0003358690360000163
Weight matrix W based on initializationQ、WKAnd WUThe result output from the attention model
Figure BDA0003358690360000164
The error from the actual result Y can be expressed as the cross entropy:
Figure BDA0003358690360000165
then, a cross entropy loss function can be used as an objective function for model training, which is shown by the following formula:
Figure BDA0003358690360000166
wherein, S is the total number of samples in the training sample set, S is the S-th track (training sample), and n is the total number of locations. The goal of the optimization is to minimize this cross entropy loss function.
Then, an optimizer such as Adam can be used to optimize the objective function, thereby generating an optimal weight matrix
Figure BDA0003358690360000171
In addition, based on the track data of a plurality of target objects in different periods, the social relationship among the target objects can be found, so that a manager can better provide endowment services for the target objects based on the social relationship among the target objects. The identity of the target object can be identified based on the trajectory data of the same target object in different periods, so that the identity of the target object is identified based on the insensitive data, and the privacy data of the target object is protected. Based on the track data of the same target object in different periods, the abnormal track of the target object can be found, so that the abnormal path of the target object can be known in advance, and the target object (such as incapability and intelligent loss personnel) is prevented from being lost.
Based on the same technical concept, the embodiment of the present application further provides a trajectory prediction device, and the principle of the trajectory prediction device to solve the problem is similar to that of the trajectory prediction method, so the implementation of the trajectory prediction device can refer to the implementation of the trajectory prediction method, and repeated details are not repeated. Fig. 8 is a schematic structural diagram of a trajectory prediction apparatus according to an embodiment of the present application, and includes an obtaining module 801, a feature analysis module 802, a conversion module 803, an interest analysis module 804, and a determination module 805.
An obtaining module 801, configured to obtain trajectory data of a target object in a current period, where the trajectory data includes a place where the target object reaches and an arrival order of the places;
a feature analysis module 802, configured to perform feature analysis on the trajectory data to obtain trajectory features;
a conversion module 803, configured to perform conversion processing on the trajectory features based on weight parameters to obtain conversion features, where the weight parameters are obtained by learning a relationship between the trajectory features and the conversion features of the trajectory data of the target object in a history period;
an interest analysis module 804, configured to analyze interests of the target object going to each candidate location based on the conversion features;
a determining module 805, configured to determine, based on the interest analysis result, a location to which the target object is going to go.
In some embodiments, the feature analysis module 802 is specifically configured to:
generating a location embedding vector for each location where the target object arrives based on predetermined location embedding parameters;
generating an order embedding vector for the place based on a predetermined order embedding parameter;
carrying out fusion processing on the place embedding vector and the sequence vector to obtain a track vector of the place;
and combining the track vectors of all the points according to the reaching sequence, and taking a track matrix obtained by combination as the track characteristic.
In some embodiments, the weight parameters include a first weight matrix, a second weight matrix, and a third weight matrix, and the conversion module 803 is specifically configured to:
performing conversion processing on the track matrix based on the first weight matrix to obtain a first conversion matrix;
performing conversion processing on the track matrix based on the second weight matrix to obtain a second conversion matrix;
performing conversion processing on the track matrix based on the third weight matrix to obtain a third conversion matrix;
and taking the first conversion matrix, the second conversion matrix and the third conversion matrix as the conversion characteristics.
In some embodiments, the interest analysis module 804 is specifically configured to:
determining the weight of each place where the target object arrives based on the first conversion matrix and the second conversion matrix;
and performing weighted summation on the column vectors in the third conversion matrix based on the weight of each place where the target object arrives to obtain an interest characterization vector.
In some embodiments, the interest analysis module 804 is specifically configured to determine a weight w of an ith location reached by the target object according to the following formulai
Figure BDA0003358690360000181
Wherein q isiFor the ith column vector, k, in the first conversion matrixiFor the ith column vector, k, in the second transformation matrixjAnd d is the jth column vector in the second conversion matrix, d is the row number of the track matrix, m is the total number of the places where the target object arrives, and i and j are integers.
In some embodiments, the determining module 805 is specifically configured to:
determining the probability of the target object going to each candidate site based on the interest characterization vector and the embedded vector of each candidate site, wherein each candidate site is determined according to the site reached by the target object in the history period;
and determining the candidate place with the highest probability as the place to which the target object is going.
In some embodiments, the determining module 805 is specifically configured to determine the probability p (v) that the target object travels to the c-th candidate location according to the following formulac):
Figure BDA0003358690360000191
Wherein v iscIs the c-th candidate location, a is the interest characterization vector, VEcAs an embedding vector for the c-th candidate location, VElIs the embedding vector of the ith candidate location, N is the total number of candidate locations, and c and l are integers.
The division of the modules in the embodiments of the present application is schematic, and only one logic function division is provided, and in actual implementation, there may be another division manner, and in addition, each function module in each embodiment of the present application may be integrated in one processor, may also exist alone physically, or may also be integrated in one module by two or more modules. The coupling of the various modules to each other may be through interfaces that are typically electrical communication interfaces, but mechanical or other forms of interfaces are not excluded. Thus, modules described as separate components may or may not be physically separate, may be located in one place, or may be distributed in different locations on the same or different devices. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device includes a transceiver 901 and a processor 902, and the processor 902 may be a Central Processing Unit (CPU), a microprocessor, an application specific integrated circuit, a programmable logic circuit, a large scale integrated circuit, or a digital Processing Unit. The transceiver 901 is used for data transmission and reception between an electronic device and other devices.
The electronic device may further comprise a memory 903 for storing software instructions executed by the processor 902, but may also store some other data required by the electronic device, such as identification information of the electronic device, encryption information of the electronic device, user data, etc. The Memory 903 may be a Volatile Memory (Volatile Memory), such as a Random-Access Memory (RAM); the Memory 903 may also be a Non-Volatile Memory (Non-Volatile Memory) such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD), or the Memory 903 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 903 may be a combination of the above memories.
The specific connection medium between the processor 902, the memory 903 and the transceiver 901 is not limited in the embodiments of the present application. In the embodiment of the present application, only the memory 903, the processor 902, and the transceiver 901 are connected through the bus 904 in fig. 9 for explanation, the bus is shown by a thick line in fig. 9, and the connection manner between other components is only for illustrative purpose and is not limited thereto. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The processor 902 may be dedicated hardware or a processor running software, and when the processor 902 can run software, the processor 902 reads software instructions stored in the memory 903 and executes the trajectory prediction method involved in the foregoing embodiments under the driving of the software instructions.
The embodiment of the present application also provides a storage medium, and when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is capable of executing the trajectory prediction method in the foregoing embodiment.
In some possible embodiments, the trajectory prediction method provided in the present application may also be implemented in the form of a program product, where the program product includes program code, and when the program product runs on an electronic device, the program code is configured to enable the electronic device to execute the trajectory prediction method in the foregoing embodiments.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable Disk, a hard Disk, a RAM, a ROM, an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a Compact Disk Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for trajectory prediction in the embodiments of the present application may be a CD-ROM and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device over any kind of Network, such as a Local Area Network (LAN) or Wide Area Network (WAN), or may be connected to external computing devices (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A trajectory prediction method, comprising:
acquiring track data of a target object in a current period, wherein the track data comprises a place reached by the target object and an arrival sequence of the place;
carrying out characteristic analysis on the track data to obtain track characteristics;
performing conversion processing on the track characteristics based on weight parameters to obtain conversion characteristics, wherein the weight parameters are obtained by learning the relationship between the track characteristics and the conversion characteristics of the track data of the target object in the historical period;
analyzing the interest of the target object to each candidate place based on the conversion characteristics;
determining a location to which the target object is to go based on the interest analysis result.
2. The method of claim 1, wherein performing a feature analysis on the trajectory data to obtain trajectory features comprises:
generating a location embedding vector for each location where the target object arrives based on predetermined location embedding parameters;
generating an order embedding vector for the place based on a predetermined order embedding parameter;
carrying out fusion processing on the place embedding vector and the sequence vector to obtain a track vector of the place;
and combining the track vectors of all the points according to the reaching sequence, and taking a track matrix obtained by combination as the track characteristic.
3. The method of claim 2, wherein the weight parameters include a first weight matrix, a second weight matrix, and a third weight matrix, and wherein transforming the trajectory feature based on the weight parameters to obtain a transformed feature comprises:
performing conversion processing on the track matrix based on the first weight matrix to obtain a first conversion matrix;
performing conversion processing on the track matrix based on the second weight matrix to obtain a second conversion matrix;
performing conversion processing on the track matrix based on the third weight matrix to obtain a third conversion matrix;
and taking the first conversion matrix, the second conversion matrix and the third conversion matrix as the conversion characteristics.
4. The method of claim 3, wherein analyzing the interest of the target object in going to each candidate location based on the transformed features comprises:
determining the weight of each place where the target object arrives based on the first conversion matrix and the second conversion matrix;
and performing weighted summation on the column vectors in the third conversion matrix based on the weight of each place where the target object arrives to obtain an interest characterization vector.
5. The method of claim 4, wherein the weight w of the ith location reached by the target object is determined according to the following formulai
Figure FDA0003358690350000021
Wherein q isiFor the ith column vector, k, in the first conversion matrixiFor the ith column vector, k, in the second transformation matrixjAnd d is the jth column vector in the second conversion matrix, d is the row number of the track matrix, m is the total number of the places where the target object arrives, and i and j are integers.
6. The method of claim 4, wherein determining a location to which the target object is to go based on the interest analysis results comprises:
determining the probability of the target object going to each candidate site based on the interest characterization vector and the embedded vector of each candidate site, wherein each candidate site is determined according to the site reached by the target object in the history period;
and determining the candidate place with the highest probability as the place to which the target object is going.
7. The method of claim 6, wherein the probability p (v) that the target object travels to the c-th candidate location is determined according to the following formulac):
Figure FDA0003358690350000022
Wherein v iscIs the c-th candidate location, a is the interest characterization vector, VEcAs an embedding vector for the c-th candidate location, VElIs the embedding vector of the ith candidate location, N is the total number of candidate locations, and c and l are integers.
8. A trajectory prediction device, comprising:
the acquisition module is used for acquiring track data of a target object in a current period, wherein the track data comprises a place reached by the target object and an arrival sequence of the place;
the characteristic analysis module is used for carrying out characteristic analysis on the track data to obtain track characteristics;
the conversion module is used for carrying out conversion processing on the track characteristics based on weight parameters to obtain conversion characteristics, wherein the weight parameters are obtained by learning the relation between the track characteristics and the conversion characteristics of the track data of the target object in the historical period;
the interest analysis module is used for analyzing the interest of the target object to each candidate place based on the conversion characteristics;
and the determining module is used for determining the place to which the target object is going to go based on the interest analysis result.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-7.
CN202111359735.XA 2021-11-17 2021-11-17 Trajectory prediction method and apparatus, electronic device and storage medium Pending CN114154687A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111359735.XA CN114154687A (en) 2021-11-17 2021-11-17 Trajectory prediction method and apparatus, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111359735.XA CN114154687A (en) 2021-11-17 2021-11-17 Trajectory prediction method and apparatus, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN114154687A true CN114154687A (en) 2022-03-08

Family

ID=80456359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111359735.XA Pending CN114154687A (en) 2021-11-17 2021-11-17 Trajectory prediction method and apparatus, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114154687A (en)

Similar Documents

Publication Publication Date Title
US11423325B2 (en) Regression for metric dataset
CN111046027A (en) Missing value filling method and device for time series data
CN110232444B (en) Geological monitoring BP neural network optimization method, device, equipment and storage medium
CN114817663A (en) Service modeling and recommendation method based on class perception graph neural network
CN116684330A (en) Traffic prediction method, device, equipment and storage medium based on artificial intelligence
Liu et al. Multilevel Federated Learning based Intelligent Traffic Flow Forecasting for Transportation Network Management
CN114862010A (en) Flow determination method, device, equipment and medium based on space-time data
CN116635877A (en) Model generation device, estimation device, model generation method, and model generation program
Park et al. Development and evaluation of a stochastic traffic signal optimization method
CN114154687A (en) Trajectory prediction method and apparatus, electronic device and storage medium
CN116313148A (en) Drug sensitivity prediction method, device, terminal equipment and medium
KR102388215B1 (en) Apparatus and method for predicting drug-target interaction using deep neural network model based on self-attention
CN106600053B (en) User attribute prediction system based on space-time trajectory and social network
CN110457650B (en) Method, device, medium and electronic equipment for generating livability design
CN113255824A (en) Method and device for training classification model and data classification
JPWO2020162294A1 (en) Conversion method, training device and inference device
Liu et al. Count-based exploration via embedded state space for deep reinforcement learning
CN117493583B (en) Method and system for generating flow operation sequence by combining event log and knowledge graph
CN116226434B (en) Multi-element heterogeneous model training and application method, equipment and readable storage medium
JP6959559B2 (en) Data number determination device, data number determination method and data number determination program
CN111158640B (en) One-to-many demand analysis and identification method based on deep learning
CN111368966B (en) Work order description generation method and device, electronic equipment and readable storage medium
JP6783707B2 (en) Data number determination device, data number determination method and data number determination program
JP6849542B2 (en) Class determination device, class determination method and class determination program
CN117151287A (en) Network content processing method, model training method, device, medium and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination