Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this
Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described
Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual,
Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
In transport need analysis, OD (Origin-Destination) matrix is generallyd use to indicate going out for city dweller
The space distribution situation of row demand, to be applied to Traffic Systems planning and designing, online urban traffic control etc..
The method of traditional building OD matrix is to carry out large-scale OD survey, including roadside inquiry, home visiting, bright
Card investigation and vehicle license investigation etc., but need to put into more manpower, physics, and timeliness is poor.
With the development of communication technology, can the vehicle electronics of the electronic equipments such as mobile phone based on pedestrian and vehicle set
Standby to wait the LBS data accumulated in the server, the element for carrying out OD matrix calculates and building.But LBS data typically more from
It dissipates, noise data is also more, and there may be larger gaps for different location LBS data bulk collected, therefore pass through this
The OD matrix error that kind mode constructs is larger, can not still be well reflected transport need in application.
For problem of the prior art, this specification embodiment provides a kind of OD matrix construction methods, shown in Figure 1,
This method may comprise steps of:
S101 determines the corresponding several geographic regions of starting and terminal point OD matrix to be built;And
This specification embodiment does not limit the concrete mode for dividing geographic region, and those skilled in the art can be according to reality
The suitable division mode of border demand selection.
, can be according to longitude and latitude or geographic distance in a kind of specific embodiment of this specification embodiment, it will be pre-
Fixed region division is several squares, can such as be divided into the square of 1.5km*500m, each square is a geographic region.
Further, it is also possible to identify each geographic region by GeoHash.GeoHash can by one set length and
Latitude and longitude information in the rectangular area of width is converted to a string encoding, and all positions in the rectangular area are equal
It is indicated by the string encoding, therefore each geographic region of GeoHash code identification can be passed through.
It is of course also possible to use other forms identified geographic block, such as uses longitude and latitude range, starting point coordinate combination block
Length and width distance, etc., this specification embodiment does not need this to be defined.
S102 determines several users stopped in each geographic region;
This specification embodiment does not limit the concrete mode for determining the user stopped in each geographic region, this field skill
Art personnel can select suitable method of determination according to actual needs.
In a kind of specific embodiment of this specification embodiment, the LBS that can be reported by the electronic equipment of user
(Location Based Service, location based service) information, such as user identifier, longitude and latitude, timestamp, determine certain
The position of user, to correspond to the block that the user is stopped.
S103, for either block: obtaining the functional information for the block and each user for stopping in the block
Attribute information;According to the functional information and attribute information, the user property ratio in the block is determined;
The functional information of block can indicate the function that the block can provide, as in certain block include a school, then its
Instructional function can be provided, for another example may include in block residential quarter, office building-group, transport hub, hospital, etc., can use
As the functional information of block, the function that the block can provide is indicated.
The attribute information of user can specifically include various information, and this specification embodiment does not limit this.For example, can
Think age of user, gender, occupation, consumption portrait, work portrait, etc..Accordingly, the user in user property ratio belongs to
Property, it can also be indicated by diversified forms, for another example can be user for example, can be professional (such as student, teacher, civilian)
Portrait (can specifically include the other informations such as the essential informations such as age, and consumption portrait, work portrait), etc., this explanation
Book embodiment does not limit this.
In addition, in this specification embodiment specifically can by diversified forms according to the functional information and attribute information,
Determine that the user property ratio in the block, this specification embodiment do not limit this, those skilled in the art can basis
Actual demand neatly selects implementation.
In a kind of specific embodiment of this specification embodiment, several sample trainings can be first passed through in advance and obtain ratio
Prediction model obtains the scale prediction model constructed in advance, and according to preset feature then when constructing OD matrix first
Extracting rule in the attribute information of each user stopped from the functional information of the block and in the block, extracts several blocks
Feature and several user characteristics obtain the model prediction so that extracted feature be inputted in the scale prediction model
User property ratio in the block.
This specification embodiment does not need to limit the specific building mode of scale prediction model, for example, GBDT can be used
Algorithm constructs GBDT regression tree, etc..
In another specific embodiment of this specification embodiment, it can also determine that preset several user belongs to
Property and preset user property computation rule;The computation rule are as follows: calculate user property according to preset several attributive character
Rule, then for any user that is stopped in the block: according to the attribute information of the user, determining several attributes
The characteristic value of feature;According to the computation rule, the user property of the user is calculated by identified characteristic value, according to really
The ratio of the several user property in the block is calculated in the user property and the functional information of fixed each user
Example.
Specifically, the user property of each user determined by can adding up, is calculated described several in the block
Then the initial proportion of user property obtains the default corresponding relationship of functional information and setting ratio;The setting ratio is pre-
The ratio of the several user property first set, thus according to the functional information of the block and corresponding relationship obtained,
It determines the corresponding setting ratio of the block, the initial proportion is modified using the setting ratio, is obtained revised
User property ratio in the block.
S104, for any user: obtaining the user to the historical record several times of each block, the historical record is used for
Indicate motion profile of the user between each block and each stay time in each block;According to each secondary historical record, determining should
Several alternative starting point blocks and several alternate endpoint blocks of user;It determines in the attribute information and each alternative block of the user
The matching degree of user property ratio, and the determination origin zone block of the user is determined according to matching degree and determines terminal block, it obtains
The user is corresponding from determining starting point block to the block link for determining terminal block;
When obtaining the historical record of user, this specification embodiment does not limit specific number.It is for instance possible to obtain certain
All historical records of each block in one day;For another example, in order to avoid the accidental behavior of user becomes noise data, it can accumulate and obtain
Much in day each block all historical records, to include noise data be modified.
In a kind of specific embodiment of this specification embodiment, the user is being obtained to the history several times of each block
Each time for when record, can specifically determining preset time interval first, and obtaining the user accumulated in the time interval is gone through
Records of the Historian record, according to the time identifier of each secondary historical record, determines the time sequencing of each secondary historical record, and, it is gone through according to each time
The station location marker of Records of the Historian record, determines that the correspondence block of each secondary historical record obtains then according to the time sequencing and corresponding block
To motion profile of the user between each block, also, the user is obtained in each secondary historical record in each stop of each block
It is long.
It is not limited in this specification embodiment according to each secondary historical record, determines several alternative starting point blocks of the user
With the specific implementation of several alternate endpoint blocks.
It, can be according to the movement rail in each secondary historical record in a kind of specific embodiment of this specification embodiment
Mark determines several alternative starting point blocks and several alternate endpoint blocks of the user, then stops according in each secondary historical record
Duration is stayed, determines that probability that each alternative starting point block is determining starting point block and each alternate endpoint block are determining terminal block
Probability, wherein stay time and probability are to be positively correlated, i.e. residence time more long then probability is bigger.
Accordingly, according to the stay time in each secondary historical record, each alternative starting point block is determined to determine origin zone
The probability of block and each alternate endpoint block be determine terminal block probability after, can also further, if obtaining the user's
Payment record under main line, payment record can be used to indicate that the user carries out the position of payment behavior and payment under corresponding line under line
Behavior type.Such as the payment behavior type of payment record then can be the position for buying commodity for purchase commodity, position;Again
Such as, the payment behavior type of payment record can be subway of taking pubic transport, and position is then position when getting on or off the bus or is out of the station;
Etc..
Then, for payment record under any line, according to the position in the record, determine that this records corresponding block;It obtains
The corresponding relationship for obtaining payment behavior type and correction value, determines the corresponding correction value of payment behavior type in the record, thus
According to the correction value of payment record under each line, the probability of corresponding alternative starting point block or alternate endpoint block is corrected.
Further, since most users trip Origin And Destination all may be residential quarter, therefore can by it is specific when
Between put and stay time, determine block be beginning or end probability.For example, can choose 8 a.m. and at night 22 points when
Between point, obtain user before 8 a.m. and at night after 22 points, the residence time in corresponding block, if the residence time
It is longer, and the functional information (for example residential quarter) based on the block, it may be considered that the residential quarter is the residence of the user,
It can be carried out by the starting point of the block alternately and/or terminal block, or by probability of this conclusion to alternative block
Amendment.
S105 calculates the value of the corresponding matrix element of each block link according to obtained each block link, constructs OD square
Battle array.
Below with reference to one, more specifically example, the OD matrix construction methods provided this specification are illustrated.
The flow chart that OD matrix is constructed in this example can be as shown in Figure 2.
The location information, attribute information of user, payment events information etc. in Fig. 2 can open the feelings of permission in user
Under condition, by electronic equipment entrained by user (such as smart phone, tablet computer) software of installing obtain.For example, can lead to
It crosses map software and obtains customer position information;For another example, user property letter can be obtained by the Account Registration content of multiple softwares
Breath;For another example, payment events information can be obtained by consumer-targeted software, payment software;Etc..
In addition, being directed to the geographic area of OD matrix to be built, it can be divided into the block of multiple area approximations, be used in combination
Geohash identifies each block.And the function letter of block based on building function, the user's mark etc. in block, can be obtained
Breath.
As shown in Fig. 2, preset block and crowd's sample can be in advance based on from the angle of block, scale prediction is constructed
Model extracts feature from block functional information and crowd's attribute information, inputs the model, can export the block for people
The ordering of optimization preference of group's attribute, to obtain the user property ratio in the block.
For example, it is that can provide instructional function that the main building in the block, which is school and function,.Furthermore it can obtain
The attribute information of 5000 users, as occupation portrait and the consumption of user are drawn a portrait.After feature input model, it is available for
The ordering of optimization preference of each crowd in the block, as in the block main population be student, be secondly teacher, be again cook, cleaning
The workers such as member, so as to calculate the user property ratio in the block, such as student: teacher: worker 7:2:1.
As shown in Fig. 2, from the angle of user user can be obtained one according to the location information and stay time of user
The section time, such as daily in the motion profile of each block within one week.Furthermore it can pass through removal incident, increase day ordinary affair
The means such as payment events supplement, keep the motion profile of user more accurate, obtain one or more block conducts under part weight, line
The probability of user's starting point and/or terminal block.
Then, melt by the user property ratio obtained based on block angle, with the probability obtained based on user perspective
It closes, it is final to determine Origin And Destination block.For example, the user property ratio in block A is student: teacher: worker 7:2:1,
User property ratio in block B is programmer: retailer: student 9:0.9:0.1.And to Mr. Yu's attribute it is the user of student,
The probability of block A and block B alternately terminal block is 50%, then by comparing the attribute of block A, B and the user
With degree, block A can be determined as to the terminal block of the user.
After obtaining the determination origin zone block of each user through the above way and determining terminal block, user couple can be obtained
The block link from determining starting point block to determination terminal block answered, to pass through the tired of the number of users to same block link
Add, the value of the available corresponding matrix element of block link, and constructs and obtain OD matrix.
As it can be seen that it is not merely based on LBS position data using above scheme, the base of functional information, user also based on block
The information such as this information, consumption portrait, work portrait, obtain the motion profile of each user, determine alternative starting point and emphasis block
Probability cry and adequately determine the actual starting point block of user and terminal area and by the attributes match degree of block and user
Block obtains the element value in OD matrix, so that building obtains accurate OD matrix.
Based on more accurate OD matrix constructed by this programme, transport need analysis and prediction can be more accurately carried out,
Traffic Systems planning and designing, online urban traffic control etc. to more be tallied with the actual situation.
Corresponding to above method embodiment, this specification embodiment also provides a kind of OD matrix construction device, referring to Fig. 3 institute
Show, the apparatus may include:
Block determining module 110, for determining the corresponding several geographic regions of starting and terminal point OD matrix to be built;With
And
User's determining module 120, for determining several users stopped in each geographic region;
Ratio obtains module 130, for being directed to either block: obtaining for the functional information of the block and in the block
The attribute information of each user of middle stop;According to the functional information and attribute information, the user property ratio in the block is determined
Example;
Link obtains module 140, for being directed to any user: obtain the user to the historical record several times of each block,
The historical record is used to indicate motion profile of the user between each block and each stay time in each block;According to each time
Historical record determines several alternative starting point blocks and several alternate endpoint blocks of the user;Determine the attribute information of the user
With the matching degree of the user property ratio in each alternative block, and according to matching degree determine the user determination origin zone block and really
Determine terminal block, it is corresponding from determining starting point block to the block link for determining terminal block to obtain the user;
Matrix constructs module 150, for calculating the corresponding matrix element of each block link according to obtained each block link
The value of element constructs OD matrix.
Shown in Figure 4 in a kind of specific embodiment that this specification provides, the ratio obtains module 130, can
To include:
Model obtaining unit 131, for obtaining the scale prediction model constructed in advance;
Feature extraction unit 132, for regular according to preset feature extraction, from the area functional information Ji Gai of the block
In the attribute information of each user stopped in block, several Block Characteristics and several user characteristics are extracted;
It is pre- to obtain the model for inputting extracted feature in the scale prediction model for ratio obtaining unit 133
The user property ratio in the block surveyed.
Shown in Figure 5 in a kind of specific embodiment that this specification provides, the ratio obtains module 130, can
To include:
Regular obtaining unit 134, for determining that preset several user property and preset user property calculate rule
Then;The computation rule are as follows: the rule of user property is calculated according to preset several attributive character;
Attribute computing unit 135, for for any user stopped in the block: being believed according to the attribute of the user
Breath, determines the characteristic value of several attributive character;According to the computation rule, which is calculated by identified characteristic value
User property;
Ratio computing unit 136 is calculated for the user property and the functional information according to identified each user
The ratio of the several user property into the block.
In a kind of specific embodiment that this specification provides, the ratio computing unit 136 is specifically used for:
The first of the several user property in the block is calculated in the user property of each user determined by accumulative
Beginning ratio;
Obtain the default corresponding relationship of functional information and setting ratio;The setting ratio is preset described several
The ratio of kind user property;
According to the functional information of the block and corresponding relationship obtained, the corresponding setting ratio of the block is determined;
The initial proportion is modified using the setting ratio, obtains the user property in the revised block
Ratio.
Shown in Figure 6 in a kind of specific embodiment that this specification provides, the link obtains module 140, can
To include:
Position obtaining unit 141 for determining preset time interval, and obtains the user accumulated in the time interval
Each position information;
Data preparation unit 142 determines that the time of each position information is suitable for the time identifier according to each position information
Sequence;And the station location marker according to each position information, determine the correspondence block of each position information;
Obtaining unit 143 is recorded, for obtaining the user between each block according to the time sequencing and corresponding block
Motion profile;Also, each stay time of the user in each block in acquisition each position information.
Shown in Figure 7 in a kind of specific embodiment that this specification provides, the link obtains module 140, can
To include:
Alternative block determination unit 144, for determining that the user's is several according to the motion profile in each secondary historical record
Alternative starting point block and several alternate endpoint blocks;
Probability determining unit 145, for determining that each alternative starting point block is according to the stay time in each secondary historical record
It determines the probability of starting point block and each alternate endpoint block is the probability for determining terminal block;Wherein, stay time is with probability
It is positively correlated.
Shown in Figure 8 in a kind of specific embodiment that this specification provides, the link obtains module 140 also
Include: probability amending unit 146, be specifically used for:
According to the stay time in each secondary historical record, determine that each alternative starting point block is the general of determining starting point block
After rate and each alternate endpoint block are the probability for determining terminal block, if obtaining payment record under the main line of the user;The line
Lower payment record is used to indicate: the user carries out the position of payment behavior and payment behavior type under corresponding line;
For payment record under any line: according to the position in the record, determining that this records corresponding block;It is paid
The corresponding relationship of behavior type and correction value determines the corresponding correction value of payment behavior type in the record;
According to the correction value of payment record under each line, the general of corresponding alternative starting point block or alternate endpoint block is corrected
Rate.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
This specification embodiment also provides a kind of computer equipment, includes at least memory, processor and is stored in
On reservoir and the computer program that can run on a processor, wherein processor realizes OD square above-mentioned when executing described program
Battle array construction method.This method includes at least:
A kind of OD matrix construction methods, this method comprises:
Determine the corresponding several geographic regions of starting and terminal point OD matrix to be built;And
Determine several users stopped in each geographic region;
For either block: obtaining the functional information for the block and the attribute of each user stopped in the block
Information;According to the functional information and attribute information, the user property ratio in the block is determined;
For any user: obtaining the user to the historical record several times of each block, the historical record is for indicating
Motion profile of the user between each block and each stay time in each block;According to each secondary historical record, the user is determined
Several alternative starting point blocks and several alternate endpoint blocks;The attribute information for determining the user and the user in each alternative block
The matching degree of attribute ratio, and the determination origin zone block of the user is determined according to matching degree and determines terminal block, obtain the use
Family is corresponding from determining starting point block to the block link for determining terminal block;
According to obtained each block link, the value of the corresponding matrix element of each block link is calculated, constructs OD matrix.
Fig. 9 shows one kind provided by this specification embodiment and more specifically calculates device hardware structural schematic diagram,
The equipment may include: processor 1010, memory 1020, input/output interface 1030, communication interface 1040 and bus
1050.Wherein processor 1010, memory 1020, input/output interface 1030 and communication interface 1040 are real by bus 1050
The now communication connection inside equipment each other.
Processor 1010 can use general CPU (Central Processing Unit, central processing unit), micro- place
Reason device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one
Or the modes such as multiple integrated circuits are realized, for executing relative program, to realize technical side provided by this specification embodiment
Case.
Memory 1020 can use ROM (Read Only Memory, read-only memory), RAM (Random Access
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 1020 can store
Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware
When, relevant program code is stored in memory 1020, and execution is called by processor 1010.
Input/output interface 1030 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loudspeaker, vibrator, indicator light etc..
Communication interface 1040 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 1050 include an access, equipment various components (such as processor 1010, memory 1020, input/it is defeated
Outgoing interface 1030 and communication interface 1040) between transmit information.
It should be noted that although above equipment illustrates only processor 1010, memory 1020, input/output interface
1030, communication interface 1040 and bus 1050, but in the specific implementation process, which can also include realizing normal fortune
Other assemblies necessary to row.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising real in above equipment
Component necessary to existing this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
OD matrix construction methods above-mentioned are realized when sequence is executed by processor.This method includes at least:
A kind of OD matrix construction methods, this method comprises:
Determine the corresponding several geographic regions of starting and terminal point OD matrix to be built;And
Determine several users stopped in each geographic region;
For either block: obtaining the functional information for the block and the attribute of each user stopped in the block
Information;According to the functional information and attribute information, the user property ratio in the block is determined;
For any user: obtaining the user to the historical record several times of each block, the historical record is for indicating
Motion profile of the user between each block and each stay time in each block;According to each secondary historical record, the user is determined
Several alternative starting point blocks and several alternate endpoint blocks;The attribute information for determining the user and the user in each alternative block
The matching degree of attribute ratio, and the determination origin zone block of the user is determined according to matching degree and determines terminal block, obtain the use
Family is corresponding from determining starting point block to the block link for determining terminal block;
According to obtained each block link, the value of the corresponding matrix element of each block link is calculated, constructs OD matrix.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make
It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment
Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description
Module may or may not be physically separated, can be each module when implementing this specification example scheme
Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or
Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art
For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this
A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.