CN113762644A - Congestion state prediction method and device based on Markov chain - Google Patents

Congestion state prediction method and device based on Markov chain Download PDF

Info

Publication number
CN113762644A
CN113762644A CN202111131956.1A CN202111131956A CN113762644A CN 113762644 A CN113762644 A CN 113762644A CN 202111131956 A CN202111131956 A CN 202111131956A CN 113762644 A CN113762644 A CN 113762644A
Authority
CN
China
Prior art keywords
congestion
state
carriage
target
trains
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.)
Granted
Application number
CN202111131956.1A
Other languages
Chinese (zh)
Other versions
CN113762644B (en
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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202111131956.1A priority Critical patent/CN113762644B/en
Publication of CN113762644A publication Critical patent/CN113762644A/en
Application granted granted Critical
Publication of CN113762644B publication Critical patent/CN113762644B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Strategic Management (AREA)
  • Computational Mathematics (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Algebra (AREA)
  • Marketing (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a congestion state prediction method and a congestion state prediction device based on a Markov chain, which relate to the technical field of communication and are used for predicting the probability of the congestion state of passengers in each carriage of a subway and providing reference information for riding of a user, and the method comprises the following steps: obtaining the carriage congestion states of N trains corresponding to the target station within the historical time, and determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the congestion state of the carriage comprises at least two states, wherein N is a positive integer, and P is a positive number; and calculating the probability M that the carriage congestion state of each train corresponding to the target station in the future is a target state according to the congestion state transition probability matrix P, wherein the target state is any one of at least two states, and M is greater than or equal to 0 and less than or equal to 1. The embodiment of the invention is applied to the scene of predicting the passenger crowding state in the subway carriage.

Description

Congestion state prediction method and device based on Markov chain
Technical Field
The invention relates to the technical field of communication, in particular to a congestion state prediction method and device based on a Markov chain.
Background
With the continuous development of modern transportation, users have become more and more common to travel through public transportation, wherein, the long-distance public transportation mainly includes: trains, high-speed rails, airplanes and the like, and the short-distance public transportation mainly comprises the following components: buses, subways, taxis, and the like. The subway is the most special public transport and is most concerned about traveling in cities.
However, in the current state, when a passenger goes out and takes a subway, because the subway has no fixed seat, and the number of carriages of the subway is large, when the passenger takes a bus, the door selected by the passenger to take a bus has blindness and randomness, the passenger in a certain carriage is full, and the passengers in other carriages are less, so that the difference of the crowded states in different doors on the subway is large, thereby the waste of public resources to a certain extent is caused, and the riding experience of part of the passengers is poor.
Disclosure of Invention
The embodiment of the invention provides a congestion state prediction method and device based on a Markov chain, which are used for predicting the probability of the congestion state of passengers in each carriage of a subway and providing reference information for a user to take a bus.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a method for predicting a congestion state based on a markov chain is provided, and the method includes: obtaining the carriage congestion states of N trains corresponding to the target station within the historical time, and determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the congestion state of the carriage comprises at least two states, wherein N is a positive integer, and P is a positive number; and calculating the probability M that the carriage congestion state of each train corresponding to the target station in the future is a target state according to the congestion state transition probability matrix P, wherein the target state is any one of at least two states, and M is greater than or equal to 0 and less than or equal to 1.
In a possible implementation manner, acquiring the carriage congestion states of N trains corresponding to the target station within the historical time includes: obtaining the seat number and the passenger number in the carriage of each train in N trains corresponding to the target station in the historical time, and determining the seat proportion corresponding to the carriage according to the seat number and the passenger number; and determining the carriage congestion state of each train according to the value range met by the seat proportion, and corresponding to different carriage congestion states under the condition that the seat proportion meets different value ranges.
In one possible implementation, determining the congestion state transition probability matrix P according to the carriage congestion states of N trains includes: determining the congestion state transition probability of transitioning from a first target state to a second target state according to the carriage congestion states of N-1 groups of trains corresponding to N trains, wherein the first target state and the second target state are any one of at least two states; any one group of trains in the N-1 groups of trains is two adjacent trains in the N trains; a congestion state transition probability matrix P is determined based on the determined plurality of congestion state transition probabilities.
In a possible implementation manner, calculating a probability M that the congestion status of each train corresponding to the target station in the future is the target status according to the congestion status transition probability matrix P includes: calculating the probability M that the carriage congestion state of the first train corresponding to the target station in the future is in the target state by a first algorithm according to each congestion state transition probability included in the congestion state transition probability matrix P; wherein the first algorithm is as follows:
Figure BDA0003280774660000021
i and j are used for indicating the ith state or the jth state in the at least two states, a is used for indicating the number of the states included in the at least two states, and a, i and j are positive integers.
In a possible implementation manner, calculating a probability M that the congestion status of each train corresponding to the target station in the future is the target status according to the congestion status transition probability matrix P includes: calculating the probability M that the carriage congestion state of the first train corresponding to the target station is in the target state in the future time through a second algorithm according to the congestion state transition probability matrix P and the initial congestion state probability vector M (0); wherein the second algorithm is: m (t) -M (t-1) P-M (t-2) P2=M(0)Pt,M(0)=[M1(0),M2(0),M3(0),...,Ma(0)]And a is a positive integer, and M (0) is a congestion state probability vector of a carriage of the last train corresponding to the target station in the historical time.
In a second aspect, there is provided a markov chain-based congestion state prediction apparatus comprising: the device comprises an acquisition unit, a determination unit and a calculation unit; the acquisition unit is used for acquiring the carriage congestion states of N trains corresponding to the target station within historical time; the determining unit is used for determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the congestion state of the carriage comprises at least two states, wherein N is a positive integer, and P is a positive number; and the calculating unit is used for calculating the probability M that the carriage congestion state of each train corresponding to the target station in the future is a target state according to the congestion state transition probability matrix P, wherein the target state is any one of at least two states, and M is greater than or equal to 0 and less than or equal to 1.
In a third aspect, there is provided a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computer, cause the computer to perform a method of markov chain based congestion status prediction as in the first aspect.
In a fourth aspect, an electronic device includes: a processor and a memory; wherein the memory is configured to store one or more programs, the one or more programs comprising computer executable instructions that, when executed by the processor, cause the electronic device to perform a markov chain based congestion status prediction method according to the first aspect.
The embodiment of the invention provides a congestion state prediction method and a congestion state prediction device based on a Markov chain, which are applied to a scene of predicting the congestion state of passengers in subway carriages, wherein the carriage congestion states of N trains corresponding to a target station in historical time are obtained, so that a congestion state transition probability matrix P of the target station can be determined according to the carriage congestion states of N trains passed by the target station in historical time, and further, the probability M that the congestion state of each carriage of each train to be reached by the target station in future time is a target state is calculated based on the congestion state transition probability matrix P of the target station, so that the possibility that the congestion state of each carriage of each train to be reached by the target station in future time is each of at least two congestion states is determined. According to the scheme, the passenger crowding state probability in each carriage of the subway can be predicted, and reference information is provided for the user to take the subway.
Drawings
Fig. 1 is a schematic structural diagram of a congestion status prediction system according to an embodiment of the present invention;
fig. 2 is a first schematic flowchart of a congestion status prediction method based on a markov chain according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a congestion status prediction method based on a markov chain according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a congestion status prediction method based on a markov chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a congestion status prediction apparatus based on a markov chain according to an embodiment of the present invention;
fig. 6 is a first schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In the description of the present invention, "/" means "or" unless otherwise specified, for example, a/B may mean a or B. "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. Further, "at least one" or "a plurality" means two or more. The terms "first", "second", and the like do not necessarily limit the number and execution order, and the terms "first", "second", and the like do not necessarily limit the difference.
The method for predicting the congestion state based on the Markov chain can be applied to a system for predicting the congestion state. Fig. 1 is a schematic diagram showing a configuration of the congestion status prediction system. As shown in fig. 1, the congestion status prediction system 10 includes a data collection device 11, a data analysis device 12, and a data calculation device 13. The data acquisition device 11 is connected with the data analysis device 12, and the data analysis device 12 is connected with the data calculation device 13. The data acquisition device 11, the data analysis device 12, and the data calculation device 13 may be connected in a wired manner or in a wireless manner, which is not limited in the embodiment of the present invention.
The congestion status prediction system 10 may be used in the internet of things, and the congestion status prediction system 10 may include hardware such as a plurality of Central Processing Units (CPUs), a plurality of memories, and a storage device storing a plurality of operating systems.
Data acquisition equipment 11 can be used for the thing networking, sets up in the environment that needs the data collection, for example, data acquisition equipment 11 can be for people flow sensor or object recognition sensor etc. can set up in the scene that needs monitoring people flow, for example the station is imported and exported, train door or carriage in, etc to data transmission to data analysis equipment 12 that will gather.
The data analysis device 12 may also be used in the internet of things, and is configured to receive the real-time data sent by the data acquisition device 11, and may store the received data for future use, and the further data analysis device 12 may further perform specific analysis on the received data to perform processing such as labeling or data classification.
The data calculation device 13 may also be used in the internet of things, and is configured to calculate data analyzed and processed by the data analysis device 12, so as to calculate predicted data in a future time for reference by a user.
It should be noted that the data acquisition device 11, the data analysis device 12, and the data calculation device 13 may be independent devices or may be integrated in the same device, and the present invention is not limited in this respect.
When the data acquisition device 11, the data analysis device 12 and the data calculation device 13 are integrated in the same device, the communication mode among the data acquisition device 11, the data analysis device 12 and the data calculation device 13 is the communication among the internal modules of the device. In this case, the communication flow between the two is the same as "the communication flow between the data acquisition device 11, the data analysis device 12, and the data calculation device 13 in the case where they are independent of each other".
In the following embodiments provided by the present invention, the present invention is described by taking an example in which the data acquisition device 11, the data analysis device 12, and the data calculation device 13 are provided independently of each other.
A method for predicting a congestion state based on a markov chain according to an embodiment of the present invention is described below with reference to the accompanying drawings.
As shown in fig. 2, the method for predicting a congestion state based on a markov chain according to an embodiment of the present invention is applied to a device for predicting a congestion state based on a markov chain, which includes a plurality of memories and a plurality of CPUs, and includes steps S201 to S202:
s201, obtaining the carriage congestion states of N trains corresponding to the target station in the historical time, and determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains.
The traffic congestion state comprises at least two states, wherein N is a positive integer, and P is a positive number.
As a possible implementation manner, when the congestion status of the cars of the trains passing through the target station within the next time needs to be predicted, the congestion status of the cars of a plurality of trains passing through the target station before the current time can be acquired, and the corresponding congestion status transition probability matrix P can be constructed according to the acquired congestion status of the cars of the plurality of trains.
It should be noted that the train may be a subway, and the congestion state of the train may be understood as a congestion state in any one car on the subway, and because the doors selected by passengers to take the train have blindness and randomness, the congestion state difference in different cars on the subway is large.
As one possible implementation manner, the congestion state transition probability matrix P includes a plurality of congestion state transition probabilities, and each congestion state transition probability indicates a congestion state change situation from a previous train to a next train in a car corresponding to two adjacent trains.
It should be noted that the two carriages corresponding to the two adjacent trains can be understood as two carriages formed by two corresponding trains when different trains corresponding to the same door of the platform stop.
As one possible implementation, the congestion status of the car may include at least two statuses: an extremely comfortable state (first state), a comfortable state (second state), a general state (third state), a crowded state (fourth state), and an extremely crowded state (fifth state).
S202, calculating the probability M that the carriage congestion state of each train corresponding to the target station is in the target state in the future according to the congestion state transition probability matrix P.
Wherein the target state is any one of at least two states, and M is greater than or equal to 0 and less than or equal to 1.
As one possible implementation, the congestion state transition probability matrix P is used to indicate a probability that, among a plurality of trains passing through the destination station in the past, the car congestion state of two adjacent trains is changed from a certain state to another congestion state.
Illustratively, the probability of the carriage congestion state of two adjacent trains being converted from the extreme comfort state to the extreme comfort state, the probability of the carriage congestion state being converted from the extreme comfort state to the general state, the probability of the carriage congestion state being converted from the extreme comfort state to the congestion state, the probability of the carriage congestion state being converted from the extreme comfort state to the extreme congestion state, and the like can be indicated by the congestion state transition probability matrix P.
As a possible implementation, in the congestion state transition probability matrix P, by PijIndicating the probability of transitioning from the ith state to the jth state.
In the embodiment of the invention, the congestion state in the carriages corresponding to all doors in the target station is determined, a congestion state transition probability matrix P is obtained through the congestion state transition probability in the carriages corresponding to multiple subways passing through the target station before the current time, so that the congestion state probability of the train passing through the target station in the t-th time after the current time is deduced according to the congestion state transition probability matrix P, an initial state probability vector is determined according to the congestion state of the carriage at the time when t is 0 (namely the congestion state of the train in the last train before the current time), and the congestion state probability prediction result of the train in the t-th time after the current time is finally calculated.
In one design, in order to obtain the car congestion states of N trains corresponding to the destination station within the historical time, as shown in fig. 3, the "obtaining the car congestion states of N trains corresponding to the destination station within the historical time" in S201 according to the embodiment of the present invention may specifically include the following S301 to S302.
S301, seat numbers and passenger numbers in carriages of each train in N trains corresponding to the target station in the historical time are obtained, and the people-seat ratio corresponding to the carriages is determined according to the seat numbers and the passenger numbers.
As a possible implementation mode, the seat number and the passenger number in each carriage of a plurality of trains passing through the target station before the current time are obtained, and the corresponding seat ratio is obtained by calculating the ratio of the passenger number and the seat number in each carriage.
And S302, determining the carriage congestion state of each train according to the value range met by the people-seat ratio.
Under the condition that the seat proportion meets different value ranges, the device corresponds to different carriage crowding states.
As a possible implementation manner, the congestion state in each car can be determined according to the corresponding relationship between the proportion of seats in each car and a plurality of preset value ranges.
For example, when the number of seats in the vehicle compartment is denoted as S and the number of passengers in the vehicle compartment is denoted as T, the proportion of seats in the vehicle compartment can be denoted as: r is T/S; and a plurality of value ranges can be preset: specifically, when R ∈ (0, 1/2), the congestion state in the vehicle compartment is "extremely comfortable state (first state)", when R ∈ (1/2, 1) ", the congestion state in the vehicle compartment is" comfortable state (second state) ", when R ∈ (1, 3/2), the congestion state in the vehicle compartment is" general state (third state) ", when R ∈ (3/2, 5/2), the congestion state in the vehicle compartment is" congestion state (fourth state) ", when R ∈ (5/2, + ∞), the congestion state in the vehicle interior is "extremely congested state (fifth state)", and S and T are positive integers.
In the embodiment of the invention, a method for predicting the congestion state based on a Markov chain is provided, and specifically, the method can predict the probability of the congestion state in all the numbers of subway cars of a train after the current time of a target station, and firstly, the congestion state in a carriage is determined according to the proportion of seats in the carriage; obtaining a congestion state transition probability matrix P according to the carriage congestion state transition probability of a plurality of trains passing through the target station before the current moment; and then further deducing a carriage congestion state probability formula of the train which is about to pass through the target station after the current time, and determining and calculating a prediction result of the carriage congestion state probability of the train which is about to reach the target station according to the congestion state of the last train which passes through the target station before the current time.
In one design, in order to determine the congestion state transition probability matrix P according to the congestion states of the cars of N trains, as shown in fig. 4, "determining the congestion state transition probability matrix P according to the congestion states of the cars of N trains" in S201 according to the embodiment of the present invention may specifically include the following steps S401 to S402.
S401, according to the carriage congestion states of the N-1 groups of trains corresponding to the N trains, determining the congestion state transition probability of the train from the first target state to the second target state.
The first target state and the second target state are both any one of at least two states; any one train in the N-1 trains is two adjacent trains in the N trains.
S402, determining a congestion state transition probability matrix P based on the plurality of determined congestion state transition probabilities.
As one possible implementation, based on N trains that pass the target site before the current time, N-1 groups of trains can be determined, thereby determining N-1 congestion state transition probabilities.
It should be noted that the above-mentioned extreme comfort state (first state) can be represented by E1, the comfort state (second state) can be represented by E2, the general state (third state) can be represented by E3, the congestion state (fourth state) can be represented by E4, and the extreme congestion state (fifth state) can be represented by E5.
Illustratively, a process of transitioning from one of the above five states to another state is referred to as a congestion state transition process, and a state transition probability of transitioning from the i-th state to the j-th state is PijI.e. P (E)i-Ej)=P(Ej/Ei)=PijTherefore, the congestion state transition probability matrix P is obtained as:
Figure BDA0003280774660000081
wherein, the conditions need to be satisfied:
Figure BDA0003280774660000082
specifically, if the congestion status at the target station of 40 trains passing through the target station before the current time is as follows:
watch 1
Number of shifts 1 2 3 4 5 6 7 8 9 10
Status of state E1 E1 E2 E1 E2 E2 E3 E2 E3 E3
Number of shifts 11 12 13 14 15 16 17 18 19 20
Status of state E4 E4 E3 E3 E4 E5 E5 E4 E5 E4
Number of shifts 21 22 23 24 25 26 27 28 29 30
Status of state E2 E3 E2 E3 E3 E4 E3 E2 E2 E1
Number of shifts 31 32 33 34 35 36 37 38 39 40
Status of state E1 E2 E2 E3 E2 E4 E3 E4 E3 E4
As can be seen from the table, among the 5 transitions from the E1 state to other states included in the above table, 2 transitions from the E1 state to the E1 state, and 3 transitions from the E1 state to the E2 state, and therefore,
Figure BDA0003280774660000091
among the 11 transitions from the E2 state to other states included in the above table, 2 are transitions from the E2 state to the E1 state, 3 are transitions from the E2 state to the E2 state, 5 are transitions from the E2 state to the E3 state, and 1 is transition from the E2 state to the E4 state, and therefore,
Figure BDA0003280774660000092
among the 12 transitions from the E3 state to other states included in the above table, 4 are transitions from the E3 state to the E2 state, 3 are transitions from the E3 state to the E3 state, and 5 are transitions from the E3 state to the E4 state, and therefore,
Figure BDA0003280774660000101
among the 4 transitions from the E4 state to other states included in the above table, 1 is a transition from the E4 state to the E2 state, 4 is a transition from the E4 state to the E3 state, 1 is a transition from the E4 state to the E4 state, and 2 is a transition from the E4 state to the E5 state, and therefore,
Figure BDA0003280774660000102
among the 3 transitions from the E5 state to other states included in the above table, 2 are transitions from the E5 state to the E4 state, and 1 is transition from the E5 state to the E5 state, and thus,
Figure BDA0003280774660000103
therefore, the congestion state transition probability matrix P can be obtained as follows:
Figure BDA0003280774660000104
in the embodiment of the invention, the congestion state transition probability of transition from any one of at least two states to another state can be determined according to the carriage congestion states of N-1 groups of trains corresponding to N trains passing through the target station before the current time, so that a congestion state transition probability matrix P is determined according to a plurality of congestion state transition probabilities and is used for calculating the probability M that the carriage congestion state of the t-th train corresponding to the target station is the target state in the future time.
In one design, in order to calculate the probability M that the congestion status of the train of each time corresponding to the destination station is the destination status in the future time according to the congestion status transition probability matrix P, S202 provided in the embodiment of the present invention may specifically include the following S501.
S501, according to each congestion state transition probability included in the congestion state transition probability matrix P, calculating the probability M that the congestion state of the train in the first time corresponding to the target station is in the target state in the future through a first algorithm.
Wherein the first algorithm is as follows:
Figure BDA0003280774660000111
i and j are used for indicating the ith state or the jth state in the at least two states, a is used for indicating the number of the states included in the at least two states, and a, i and j are positive integers.
As one possible implementation manner, in order to predict the probability of the congestion state of the passing train in the process of the target station developing over time, the probability of the congestion state of the train in the first time after the current time is denoted as Mj(t)。
Therefore, after t congestion state transitions have elapsed from the time when t is 0 (i.e., the last train that passed the destination stop before the current time), that is, when t trains reach the destination stop, there is a time when t trains arrive at the destination stop
Figure BDA0003280774660000112
The congestion state of the train reaching the target station after t-1 times of congestion state transition can be regarded as EjAfter a congestion status transition, it is Ej+1Then there is
Figure BDA0003280774660000113
In one design, in order to calculate the probability M that the congestion status of the train of each time corresponding to the destination station is the destination status in the future time according to the congestion status transition probability matrix P, S202 provided in the embodiment of the present invention may specifically include the following S601.
S601, calculating the probability M that the carriage congestion state of the first train corresponding to the target station in the future is in the target state by a second algorithm according to the congestion state transition probability matrix P and the initial congestion state probability vector M (0).
Wherein the second algorithm is: m (t) -M (t-1) P-M (t-2) P2=M(0)Pt,M(0)=[M1(0),M2(0),M3(0),...,Ma(0)]And a is a positive integer, and M (0) is a congestion state probability vector of a carriage of the last train corresponding to the target station in the historical time.
As a possible implementation manner, it may be determined that the initial state probability vector is M (0) ═ M by the congestion state corresponding to the last train passing through the target station before the current time1(0),M2(0),M3(0),M4(0),M5(0)]Then, the probability m (t) of each congestion state in at least two states of the tth train passing the target station after the current time can be obtained.
Thus, it is possible to obtain:
Figure BDA0003280774660000121
for example, according to the specific data in the above table one, in the case that the congestion status of the train in the last train before the current time is E4, it may be determined that the initial state probability vector is M (0) ═ 0,0,0,1,0, and the state probability matrices P and M (0) are substituted into formula nine, so that the probability that the congestion status corresponding to the train passing through the destination station after the current time is in each of at least two states may be calculated.
Watch two
Figure BDA0003280774660000122
The embodiment of the invention provides a congestion state prediction method and a congestion state prediction device based on a Markov chain, which are applied to a scene of predicting the congestion state of passengers in subway carriages, wherein the carriage congestion states of N trains corresponding to a target station in historical time are obtained, so that a congestion state transition probability matrix P of the target station can be determined according to the carriage congestion states of N trains passed by the target station in historical time, and further, the probability M that the congestion state of each carriage of each train to be reached by the target station in future time is a target state is calculated based on the congestion state transition probability matrix P of the target station, so that the possibility that the congestion state of each carriage of each train to be reached by the target station in future time is each of at least two congestion states is determined. According to the scheme, the passenger crowding state probability in each carriage of the subway can be predicted, and reference information is provided for the user to take the subway.
The scheme provided by the embodiment of the invention is mainly introduced from the perspective of a method. To implement the above functions, it includes hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiment of the present invention, a congestion status prediction apparatus based on a markov chain may be divided into function modules according to the above method, for example, each function module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. Optionally, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 5 is a schematic structural diagram of a congestion status prediction apparatus based on a markov chain according to an embodiment of the present invention. As shown in fig. 5, a congestion status prediction apparatus 50 based on a markov chain is used for predicting a probability of a congestion status of a passenger in each car of a subway, and providing reference information for a user to take a car, for example, for performing a congestion status prediction method based on a markov chain as shown in fig. 2. The Markov chain-based congestion state prediction device 50 includes: an acquisition unit 501, a determination unit 502, and a calculation unit 503.
An obtaining unit 501, configured to obtain a carriage congestion state of N trains corresponding to a target station within a historical time.
A determining unit 502, configured to determine a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the traffic congestion state includes at least two states, N is a positive integer, and P is a positive number.
A calculating unit 503, configured to calculate, according to the congestion state transition probability matrix P, a probability M that the congestion state of the train of each time corresponding to the target station in the future is a target state, where the target state is any one of at least two states, and M is greater than or equal to 0 and less than or equal to 1.
Optionally, as shown in fig. 5, the obtaining unit 501 provided in the embodiment of the present invention is specifically configured to obtain the number of seats and the number of passengers in each train of N trains corresponding to the target station in the historical time.
The determining unit 502 is further configured to determine a seat proportion corresponding to the compartment according to the seat number and the number of passengers.
The determining unit 502 is further configured to determine the carriage congestion state of each train according to the value range that the seat-to-seat ratio satisfies, and correspond to different carriage congestion states under the condition that the seat-to-seat ratio satisfies different value ranges.
Optionally, as shown in fig. 5, the determining unit 502 provided in the embodiment of the present invention is specifically configured to determine, according to the congestion states of the cars of N-1 groups of trains corresponding to N trains, a congestion state transition probability of transitioning from the first target state to the second target state, where the first target state and the second target state are both any one of at least two states; any one train in the N-1 trains is two adjacent trains in the N trains.
The determining unit 502 is further configured to determine a congestion state transition probability matrix P according to the determined multiple congestion state transition probabilities.
Optionally, as shown in fig. 5, the calculating unit 503 is specifically configured to calculate, according to each congestion state transition probability included in the congestion state transition probability matrix P, a probability M that the congestion state of the train in the first time t corresponding to the target station is a target state by using a first algorithm; wherein the first algorithm is as follows:
Figure BDA0003280774660000141
Figure BDA0003280774660000142
i and j are used for indicating the ith state or the jth state in the at least two states, a is used for indicating the number of the states included in the at least two states, and a, i and j are positive integers.
Optionally, as shown in fig. 5, the calculating unit 503 is specifically configured to calculate, by using a second algorithm, a probability M that the congestion state of the train in the first time corresponding to the target station is the target state in the future according to the congestion state transition probability matrix P and the initial congestion state probability vector M (0); wherein the second algorithm is: m (t) -M (t-1) P-M (t-2) P2=M(0)Pt,M(0)=[M1(0),M2(0),M3(0),…,Ma(0)]a is a positive integer, and M (0) is a congestion state probability vector of a carriage of the last train corresponding to the target station in the historical time.
In the case of implementing the functions of the integrated modules in the form of hardware, the embodiment of the present invention provides another possible structural schematic diagram of the electronic device related to the above embodiment. As shown in fig. 6, an electronic device 60 is used for predicting the probability of the congestion state of passengers in each car of the subway and providing reference information for the passengers to take a train, for example, for executing a method for predicting the congestion state based on the markov chain shown in fig. 2. The electronic device 60 includes a processor 601, a memory 602, and a bus 603. The processor 601 and the memory 602 may be connected by a bus 603.
The processor 601 is a control center of the communication apparatus, and may be a single processor or a collective term for a plurality of processing elements. For example, the processor 601 may be a Central Processing Unit (CPU), other general-purpose processors, or the like. Wherein a general purpose processor may be a microprocessor or any conventional processor or the like.
For one embodiment, processor 601 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 6.
The memory 602 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or 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.
As a possible implementation, the memory 602 may be present separately from the processor 601, and the memory 602 may be connected to the processor 601 via a bus 603 for storing instructions or program code. The processor 601 can implement a method for predicting a congestion state based on a markov chain according to an embodiment of the present invention when it calls and executes instructions or program codes stored in the memory 602.
In another possible implementation, the memory 602 may also be integrated with the processor 601.
The bus 603 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. 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. 6, but this is not intended to represent only one bus or type of bus.
It is to be noted that the structure shown in fig. 6 does not constitute a limitation of the electronic apparatus 60. In addition to the components shown in fig. 6, the electronic device 60 may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As an example, in conjunction with fig. 5, the functions implemented by the acquisition unit 501, the determination unit 502, and the calculation unit 503 in the electronic device are the same as those of the processor 601 in fig. 6.
Optionally, as shown in fig. 6, the electronic device 60 provided in the embodiment of the present invention may further include a communication interface 604.
A communication interface 604 for connecting with other devices via a communication network. The communication network may be an ethernet network, a radio access network, a Wireless Local Area Network (WLAN), etc. The communication interface 604 may include a receiving unit for receiving data and a transmitting unit for transmitting data.
In one design, in the electronic device provided by the embodiment of the present invention, the communication interface may be further integrated in the processor.
Fig. 7 shows another hardware configuration of the electronic apparatus in the embodiment of the present invention. As shown in fig. 7, the electronic device 80 may include a processor 801, a communication interface 802, a memory 803, and a bus 804. The processor 801 is coupled to a communication interface 802 and a memory 803.
The functions of the processor 801 may refer to the description of the processor 601 above. The processor 801 also has a memory function, and the function of the memory 602 can be referred to.
The communication interface 802 is used to provide data to the processor 801. The communication interface 802 may be an internal interface of the communication device, or may be an external interface of the communication device (corresponding to the communication interface 604).
It is noted that the configuration shown in fig. 7 does not constitute a limitation of the electronic device 80, and that the electronic device 80 may include more or less components than those shown in fig. 7, or combine some components, or a different arrangement of components, in addition to the components shown in fig. 7.
Through the above description of the embodiments, it is clear for a person skilled in the art that, for convenience and simplicity of description, only the division of the above functional units is illustrated. In practical applications, the above function allocation can be performed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed by a computer, the computer executes each step in the method flow shown in the above method embodiment.
Embodiments of the present invention provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform one of the above method embodiments based on a markov chain congestion status prediction method.
The computer 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 thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, and a hard disk. Random Access Memory (RAM), Read-Only Memory (ROM), Erasable Programmable Read-Only Memory (EPROM), registers, a hard disk, an optical fiber, a portable Compact disk Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any other form of computer-readable storage medium, in any suitable combination, or as appropriate in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC). In embodiments of the invention, a computer 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.
Since the electronic device, the computer-readable storage medium, and the computer program product in the embodiments of the present invention may be applied to the method described above, for technical effects obtained by the method, reference may also be made to the method embodiments described above, and details of the embodiments of the present invention are not repeated herein.
The above description is only an embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions within the technical scope of the present invention are intended to be covered by the scope of the present invention.

Claims (12)

1. A Markov chain-based congestion state prediction method is applied to a Markov chain-based congestion state prediction device, and is characterized by comprising the following steps:
obtaining the carriage congestion states of N trains corresponding to a target station within historical time, and determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the congestion state of the carriage comprises at least two states, wherein N is a positive integer, and P is a positive number;
and calculating the probability M that the carriage congestion state of each train corresponding to the target station in the future is a target state according to the congestion state transition probability matrix P, wherein the target state is any one of the at least two states, and M is greater than or equal to 0 and less than or equal to 1.
2. The method of claim 1, wherein the obtaining of the carriage congestion status of the N trains corresponding to the destination station within the historical time comprises:
the method comprises the steps of obtaining the seat number and the passenger number in a carriage of each train in N trains corresponding to a target station in historical time, and determining the seat proportion corresponding to the carriage according to the seat number and the passenger number;
and determining the carriage congestion state of each train according to the value range met by the seat proportion, and corresponding to different carriage congestion states under the condition that the seat proportion meets different value ranges.
3. The method according to claim 1 or 2, wherein the determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains comprises:
determining the congestion state transition probability of transitioning from a first target state to a second target state according to the carriage congestion states of N-1 groups of trains corresponding to the N trains, wherein the first target state and the second target state are any one of the at least two states; any one group of trains in the N-1 groups of trains is two adjacent trains in the N trains;
and determining the congestion state transition probability matrix P according to the plurality of determined congestion state transition probabilities.
4. The method according to claim 1 or 2, wherein the calculating the probability M that the congestion status of the train of each time corresponding to the target station in the future is the target status according to the congestion status transition probability matrix P comprises:
calculating the probability M that the carriage congestion state of the first train corresponding to the target station in the future is in the target state by a first algorithm according to each congestion state transition probability included in the congestion state transition probability matrix P;
wherein the first algorithm is:
Figure FDA0003280774650000011
i and j are used for indicating the ith state or the jth state in the at least two states, a is used for indicating the number of the states included in the at least two states, and a, i and j are positive integers.
5. The method according to claim 1 or 2, wherein the calculating the probability M that the congestion status of the train of each time corresponding to the target station in the future is the target status according to the congestion status transition probability matrix P comprises:
calculating the probability M that the carriage congestion state of the first train corresponding to the target station is in the target state in the future time through a second algorithm according to the congestion state transition probability matrix P and the initial congestion state probability vector M (0);
wherein the second algorithm is: m (t) -M (t-1) P-M (t-2) P2=M(0)Pt,M(0)=[M1(0),M2(0),M3(0),...,Ma(0)]And a is a positive integer, and M (0) is a congestion state probability vector of a carriage of the last train corresponding to the target station in the historical time.
6. A Markov chain-based congestion state prediction device is characterized by comprising: the device comprises an acquisition unit, a determination unit and a calculation unit;
the acquisition unit is used for acquiring the carriage congestion states of N trains corresponding to the target station within the historical time;
the determining unit is used for determining a congestion state transition probability matrix P according to the carriage congestion states of the N trains; the congestion state of the carriage comprises at least two states, wherein N is a positive integer, and P is a positive number;
the calculating unit is configured to calculate, according to the congestion state transition probability matrix P, a probability M that a congestion state of a carriage of each train corresponding to a target station in future time is a target state, where the target state is any one of the at least two states, and M is greater than or equal to 0 and less than or equal to 1.
7. The Markov chain-based congestion status prediction device of claim 6, wherein the obtaining unit is specifically configured to obtain the number of seats and passengers in the car of each train of the N trains corresponding to the target station within the historical time;
the determining unit is further used for determining the seat proportion corresponding to the compartment according to the seat number and the passenger number;
the determining unit is further configured to determine the carriage congestion state of each train according to the value range that the seat-to-seat ratio satisfies, and correspond to different carriage congestion states under the condition that the seat-to-seat ratio satisfies different value ranges.
8. The Markov chain-based congestion status prediction device of claim 6 or 7, wherein the determining unit is specifically configured to determine a congestion status transition probability of transitioning from a first target status to a second target status according to the congestion status of the carriages of the N-1 groups of trains corresponding to the N trains, and the first target status and the second target status are both any one status of the at least two statuses; any one group of trains in the N-1 groups of trains is two adjacent trains in the N trains;
the determining unit is further configured to determine the congestion state transition probability matrix P according to the determined multiple congestion state transition probabilities.
9. The Markov chain-based congestion status prediction device of claim 6 or 7, wherein the calculating unit is specifically configured to calculate, according to each congestion status transition probability included in the congestion status transition probability matrix P, a probability M that the congestion status of the train in the t-th time corresponding to the target station is a target status in a future time by using a first algorithm;
wherein the first algorithm is:
Figure FDA0003280774650000031
i and j are used for indicating the ith state or the jth state in the at least two states, a is used for indicating the number of the states included in the at least two states, and a, i and j are positive integers.
10. The Markov chain-based congestion status prediction device of claim 6 or 7, wherein the calculating unit is specifically configured to calculate, according to the congestion status transition probability matrix P and the initial congestion status probability vector M (0), a probability M that the congestion status of the train in the first time corresponding to the target station is a target status in a future time by a second algorithm;
wherein the second algorithm is: m (t) -M (t-1) P-M (t-2) P2=M(0)Pt,M(0)=[M1(0),M2(0),M3(0),…,Ma(0)]And a is a positive integer, and M (0) is a congestion state probability vector of a carriage of the last train corresponding to the target station in the historical time.
11. A computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a computer, cause the computer to perform a markov chain based congestion status prediction method of any one of claims 1 to 5.
12. An electronic device, comprising: a processor and a memory; wherein the memory is configured to store one or more programs, the one or more programs including computer-executable instructions, which when executed by the processor, cause the electronic device to perform a Markov chain-based congestion status prediction method of any one of claims 1-5.
CN202111131956.1A 2021-09-26 2021-09-26 Congestion state prediction method and device based on Markov chain Active CN113762644B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111131956.1A CN113762644B (en) 2021-09-26 2021-09-26 Congestion state prediction method and device based on Markov chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111131956.1A CN113762644B (en) 2021-09-26 2021-09-26 Congestion state prediction method and device based on Markov chain

Publications (2)

Publication Number Publication Date
CN113762644A true CN113762644A (en) 2021-12-07
CN113762644B CN113762644B (en) 2023-11-24

Family

ID=78797557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111131956.1A Active CN113762644B (en) 2021-09-26 2021-09-26 Congestion state prediction method and device based on Markov chain

Country Status (1)

Country Link
CN (1) CN113762644B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265811A1 (en) * 2006-05-12 2007-11-15 International Business Machines Corporation Using stochastic models to diagnose and predict complex system problems
CN103413443A (en) * 2013-07-03 2013-11-27 太原理工大学 Short-term traffic flow forecasting method based on hidden Markov model
CN104200661A (en) * 2014-09-05 2014-12-10 厦门大学 Method for forecasting state changes of road traffic system
CN104616498A (en) * 2015-02-02 2015-05-13 同济大学 Markov chain and neural network based traffic congestion state combined prediction method
CN107215363A (en) * 2017-06-12 2017-09-29 中国联合网络通信集团有限公司 Passenger's queuing bootstrap technique and guiding system in a kind of subway station
CN109460023A (en) * 2018-11-09 2019-03-12 上海理工大学 Driver's lane-changing intention recognition methods based on Hidden Markov Model
CN109977927A (en) * 2019-04-25 2019-07-05 苏州雷格特智能设备股份有限公司 A kind of train passenger crowding early warning system
CN110458056A (en) * 2019-07-29 2019-11-15 交控科技股份有限公司 Compartment crowding detection method and device
CN110659549A (en) * 2018-06-29 2020-01-07 华为技术有限公司 Method and device for notifying congestion degree of train
CN112124379A (en) * 2020-09-29 2020-12-25 合肥工业大学 Platform guiding method based on subway passenger flow analysis

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070265811A1 (en) * 2006-05-12 2007-11-15 International Business Machines Corporation Using stochastic models to diagnose and predict complex system problems
CN103413443A (en) * 2013-07-03 2013-11-27 太原理工大学 Short-term traffic flow forecasting method based on hidden Markov model
CN104200661A (en) * 2014-09-05 2014-12-10 厦门大学 Method for forecasting state changes of road traffic system
CN104616498A (en) * 2015-02-02 2015-05-13 同济大学 Markov chain and neural network based traffic congestion state combined prediction method
CN107215363A (en) * 2017-06-12 2017-09-29 中国联合网络通信集团有限公司 Passenger's queuing bootstrap technique and guiding system in a kind of subway station
CN110659549A (en) * 2018-06-29 2020-01-07 华为技术有限公司 Method and device for notifying congestion degree of train
CN109460023A (en) * 2018-11-09 2019-03-12 上海理工大学 Driver's lane-changing intention recognition methods based on Hidden Markov Model
CN109977927A (en) * 2019-04-25 2019-07-05 苏州雷格特智能设备股份有限公司 A kind of train passenger crowding early warning system
CN110458056A (en) * 2019-07-29 2019-11-15 交控科技股份有限公司 Compartment crowding detection method and device
CN112124379A (en) * 2020-09-29 2020-12-25 合肥工业大学 Platform guiding method based on subway passenger flow analysis

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘映池;朱顺应;彭增辉;胡磊;郑骞;王红;: "轨道交通站台拥挤指数计算模型", 物流技术, no. 04, pages 74 - 79 *
宁尧: ""城市轨道交通车站设施服务水平评价研究"", 《中国优秀硕士学位论文全文数据库 (工程科技Ⅱ辑)》, pages 033 - 160 *

Also Published As

Publication number Publication date
CN113762644B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN110189006B (en) Scheduling method and device for vehicle, computer equipment and storage medium thereof
JP2020514895A (en) Inter-vehicle automatic passenger sharing system and method
CN112262418B (en) Vehicle management system and vehicle management method
CN108332765B (en) Carpooling travel route generation method and device
CN111340318B (en) Vehicle dynamic scheduling method and device and terminal equipment
US20210311498A1 (en) Operation management device, operation management method, and transportation system
Fan et al. Planning skip-stop services with schedule coordination
CN107204124A (en) Bus recommends method and apparatus
CN112183889B (en) Riding route recommendation method and device
CN110598246A (en) Improved lane side capacity optimization design method
CN113762644B (en) Congestion state prediction method and device based on Markov chain
Habibullah et al. A Driver-Centric Carpooling: Optimal Route-Finding Model Using Heuristic Multi-Objective Search
JP7359083B2 (en) Vehicle allocation planning device, vehicle allocation planning system, and vehicle allocation planning program
CN111079986B (en) Matching method and system for transport capacity of transfer station
Csiszár Model of multimodal mobility coordination and guiding system
CN116935643A (en) Traffic management method, device, equipment and storage medium
CN115424437A (en) Station response type bus dispatching method and device
CN113240910B (en) Road detection method, system, equipment and storage medium based on cooperative vehicle
Sarma et al. On-Demand Ride-Pooling with Walking Legs: Decomposition Approach for Dynamic Matching and Virtual Stops Selection
Szimba et al. How beneficial is fully automated driving in urban areas from a socio-economic point of view
Sánchez et al. Prediction Horizon Requirements for Automated Driving: Optimizing Safety, Comfort, and Efficiency
WO2016155790A1 (en) Method for providing configuration information for a system comprising a plurality of moving objects
CN114896507B (en) Subway path recommendation method based on space-time structure
CN117252323B (en) User preference-based multi-mode travel path planning method
CN117973640B (en) Transfer subway station transfer personnel flow prediction method and device

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
GR01 Patent grant
GR01 Patent grant