A bus dispatching method

By installing cameras and information display screens at bus stops and combining them with data analysis on a remote cloud platform, flexible bus scheduling can be achieved, solving the problem of inefficient bus connections and improving passengers' waiting experience.

CN117058910BActive Publication Date: 2025-09-19SHENZHEN URBAN TRANSPORT PLANNING CENT CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311256846.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-09-19
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

The existing bus transfer system is inefficient and cannot respond to passengers' needs in a timely manner, especially during peak travel periods, where passengers are seriously stranded.

Method used

By installing cameras, edge computing nodes, and information display screens at bus stops, the system monitors the waiting status in real time. A remote cloud platform evaluates and analyzes the data, formulates bus travel plans, and displays the latest plans on information screens, enabling flexible bus scheduling.

Benefits of technology

It improves the efficiency of bus connection, can respond to passenger needs in a timely manner, reduce passenger detention time, and enhance passenger waiting experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058910B_ABST
    Figure CN117058910B_ABST
Patent Text Reader

Abstract

The present invention proposes a bus dispatching method, which belongs to the field of intelligent transportation technology. It includes the following steps: S1. Acquiring waiting data of passengers waiting at bus stops; S2. Evaluating and analyzing the data, formulating a bus travel plan based on the spatiotemporal relationship between historical peak and off-peak periods, temporarily dispatching bus trips based on the peak alarm information of the day, and publishing the latest bus travel plan information on the bus stop information screen device for display. The method includes the following steps: S21. Displaying real-time bus waiting status; S22. Displaying a flow time curve; S23. Displaying a waiting number time curve; S24. Marking an alarm; S25. Analyzing an alarm event; S26. Preparing a bus travel plan and temporarily dispatching bus trips. When the bus travel information changes, it is sent to the bus stop information screen device for display. This method solves the problem of low bus connection efficiency and inability to respond to passengers' travel needs in a timely manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a dispatching method, and in particular to a bus dispatching method, and belongs to the field of intelligent transportation technology. Background Art

[0002] In daily life, buses typically connect passengers along fixed routes and at fixed times. During off-peak travel times, many seats remain unused, while during peak travel times, crowded waiting times and delayed passengers often occur, resulting in significantly low connection efficiency. Therefore, a method is needed to improve the efficiency of existing bus connections by providing bus scheduling that can account for these crowded waiting times and delayed passenger traffic. Summary of the Invention

[0003] A brief overview of the present invention is provided below to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important aspects of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is simply to present certain concepts in a simplified form as a prelude to the more detailed description discussed later.

[0004] In view of this, in order to solve the technical problems in the prior art of low bus connection efficiency and failure to respond to passengers' needs in a timely manner, the present invention provides a bus scheduling method.

[0005] Solution 1: A bus dispatching method, comprising the following steps:

[0006] S1. Obtain waiting data of passengers at the bus stop;

[0007] S2. Evaluate and analyze the data, formulate a bus travel plan based on the temporal and spatial relationship between historical peak and off-peak periods, temporarily dispatch buses based on the current day's peak alert information, and display the latest bus travel plan information on bus stop information screens, including the following steps:

[0008] S21. Display real-time bus waiting status: Mark each bus stop on the map and display the current waiting status data of each bus stop in real time, including: picture, current number of waiting people, maximum number of waiting people, minimum number of waiting people, average number of waiting people, maximum waiting time, minimum waiting time and average waiting time;

[0009] S22. Display of traffic flow time curve: Displays the curve of the number of people entering and leaving each bus stop over time;

[0010] S23. Display the time curve of the number of waiting people: Each bus stop displays the curves of the current number of waiting people, the maximum number of waiting people, the minimum number of waiting people, and the average number of waiting people over time;

[0011] S24. Alarm mark: Set peak alarm and low-peak alarm thresholds. When the average number of people waiting at each bus stop exceeds the set peak threshold, the bus stop is highlighted; when the average number of people waiting is lower than the set low-peak threshold, the bus stop is dimmed; and the current alarm information is recorded and generated respectively;

[0012] S25. Perform alarm event analysis: Statistics display the total number of alarms today, the total number of historical warnings, the trend of the number of alarm events in a week or a month, and the distribution points of the number of alarm events;

[0013] S26. Prepare bus travel plans in advance and temporarily dispatch bus travel: Based on historical peak and off-peak periods, the remote cloud platform prepares bus travel plans one day in advance, including: bus routes, number of buses and departure time from the terminal; when buses are running, during peak hours on a certain route, the number of buses is increased to shorten the waiting time at the bus terminal; during off-peak hours on a certain route, the number of buses is reduced to increase the waiting time at the bus terminal; based on peak warning information that appears on the day, bus travel is temporarily dispatched; when bus travel information changes, it is promptly sent to the information screen equipment at the bus stop for display.

[0014] Preferably, the method for obtaining waiting data of passengers waiting at a bus stop comprises the following steps:

[0015] S11 obtains the bus stop waiting area video stream, and detects the waiting person for each frame of the video stream;

[0016] S12. Using the detected waiting persons in each frame, track the waiting persons and obtain their ID information;

[0017] S13. Collect data of passengers waiting for the bus;

[0018] The waiting data include: bus station inflow and outflow flow, bus station waiting flow and waiting time;

[0019] The inflow and outflow of bus stops includes: the number of people entering and the number of people leaving;

[0020] The waiting flow at the bus stop includes: the current number of people waiting, the maximum number of people waiting, the minimum number of people waiting, and the average number of people waiting;

[0021] Waiting time includes: maximum waiting time, minimum waiting time and average waiting time;

[0022] S14 sends statistical data to the information display device, which controls the information display to display passenger flow information in real time;

[0023] S15. Take a screenshot of the on-site video and send the waiting data to the remote cloud platform.

[0024] Preferably, the waiting persons in each frame of the image are detected to track the waiting persons and obtain the ID information of each person, the method is:

[0025] S121. Corner point detection obtains a set of corner points for each frame of image and numbers the corner points by ID;

[0026] S122. Motion estimation is performed by translation or affine for each corner point between consecutive frames;

[0027] S123. Connect the motion vectors in consecutive frames to obtain the trajectory of each corner point;

[0028] S124. For each corner point, remove corner points that are blocked or cannot be accurately tracked;

[0029] S125. Track new and old corner points using steps S121-S123.

[0030] The preferred method for counting the inflow and outflow of bus stops is:

[0031] S131. Initially set the data sampling period T. On the camera video screen, draw a polygon 1 surrounding the waiting area of ​​the bus stop, and save the vertex coordinate information of polygon 1 in a fixed format;

[0032] S132. Read the vertex coordinate point information of polygon 1 to obtain the vertex coordinate set of polygon 1;

[0033] S133. Calculate the coordinates of the person in each frame of the picture;

[0034] S134. Determine whether the coordinates of the person are inside or outside the polygon;

[0035] S135. Set the indentation value and indent the vertex coordinate set of polygon 1 equidistantly to obtain the vertex coordinate set of polygon 2;

[0036] S136. Set the array length to length and create two array sets. The array set inside_id[length] stores the ID information of people inside polygon 2, and the array set outside_id[length] stores the ID information of people outside polygon 1.

[0037] S137. According to the coordinates of the person and the obtained set of polygon vertex coordinates, judge the coordinates of the person. If the person's coordinates are inside polygon 2 and there is no person's ID in inside_id[length], then add the person's ID to the queue in inside_id[length]; otherwise, if the person's coordinates are outside polygon 1 and there is no person's ID in outside_id[length], then add the person's ID to the queue in outside_id[length].

[0038] S138. Then judge the coordinates of the person. If the person's coordinates are inside polygon 2 and the person's ID exists in outside_id[length], then increment the number of people entering by 1, and at the same time delete the person's ID from outside_id[length].

[0039] S139. Then judge the coordinates of the person. If the person's coordinates are outside polygon 1 and the person's ID exists in inside_id[length], then increment the number of people leaving by 1, and at the same time delete the person's ID from inside_id[length].

[0040] Preferably, the method of setting a shrinking value and shrinking the set of vertex coordinates of polygon 1 equidistantly to obtain the set of vertex coordinates of polygon 2 includes the following steps:

[0041] S1351. Input the shrinking value and the set of n vertex coordinates of polygon 1, point1[n][2];

[0042] S1352. Let the vertex number of polygon 1 be i, starting from 0 to n - 1;

[0043] S1353. If the vertex number i < n, then set i = i + 1 and continue to the next step, otherwise exit;

[0044] S1354. Obtain the coordinates of the i-th vertex of polygon 2 obtained by offsetting the coordinates of the i-th vertex of the current polygon 1;

[0045] S1355. Calculate the coordinates of the i-th vertex of polygon 2 based on the x coordinate offset and y coordinate offset of the vertex coordinates:

[0046] S1356. Jump to S1353 and repeat the execution until exiting and ending.

[0047] Preferably, the method of counting the waiting flow at the bus stop is as follows:

[0048] Current number of waiting people: In a certain frame of the picture, if the coordinates of the person are inside polygon 1, then increment the current number of waiting people by 1. At the same time, within the cycle time, collect and calculate the current number of waiting people every 1 second, and a total of T times are counted: Then

[0049] Maximum number of waiting people: If the maximum number of waiting people is less than the current number of waiting people, the maximum number of waiting people = the current number of waiting people;

[0050] Minimum number of waiting people: If the minimum number of waiting people is greater than the current number of waiting people, the minimum number of waiting people = the current number of waiting people;

[0051] Average number of people waiting: After the cycle time ends, the average number of people waiting =

[0052] Among them, T represents the cycle time, i represents the sequence number, that is, the i-th second, currentWait i Indicates the current number of people waiting for the bus at the i-th second.

[0053] Preferably, the method for calculating waiting time is:

[0054] Initially set the k value, where k represents the number of image intervals;

[0055] Extract the i-th frame image, the current time is time1, and determine whether a person is inside polygon 1. If so, add the person's ID information to the ID array set of all waiting people;

[0056] Extract the i+kth frame image, the current time is time2, and determine whether a person is inside polygon 1. If so, add the person's ID information to the ID array set of all waiting people, and then cyclically compare to determine whether the person's ID is in the ID array set of all waiting people in the i-th frame image; if not, the current waiting person's waiting time waitTime is cleared: waitTime=0; if so, the current waiting person's waiting time waitTime is accumulated: waitTime=waitTime+(time2-time1);

[0057] Get the waiting time of all current passengers at a certain moment, filter out the maximum waiting time, minimum waiting time and average waiting time at a certain moment; suppose the total number of passengers waiting at a certain moment is m, and the set of waiting time of all passengers is waitTime[m], then:

[0058] Maximum waiting time: The maximum waiting time is equal to the maximum value of the set of waiting times of all waiting people; Minimum waiting time: The minimum waiting time is equal to the minimum value of the set of waiting times of all waiting people;

[0059] Average waiting time: Average waiting time =

[0060] Among them, m represents the total number of waiting people at a certain moment, i represents the sequence number, and waitTime[i] represents the current waiting time of the i-th person.

[0061] Solution 2: An electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of a bus scheduling method described in Solution 1 when executing the computer program.

[0062] Solution 3: A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the bus dispatching method described in Solution 1.

[0063] The beneficial effects of the present invention are as follows: The present invention installs cameras, edge computing nodes and information display screen devices in the bus stop area, and uses these edge devices to monitor the waiting status of waiting passengers online in real time throughout the day. The remote cloud platform is responsible for managing all bus stops within the area, evaluating and analyzing the acquired data on the waiting status of passengers at the bus stops, formulating bus travel plans in advance based on the spatiotemporal relationship between historical peak and off-peak periods, temporarily dispatching bus trips based on the peak warning information of the day, and publishing the latest bus travel plan information to the bus stop information screen device for display. This achieves flexible scheduling of bus transfer passengers, solving the problem of low efficiency of current bus transfers and the inability to respond to passenger travel needs in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0065] Figure 1 The figure is a flow chart of a bus dispatching method;

[0066] Figure 2 This is a schematic diagram of the bus stop polygon area;

[0067] Figure 3 This is a thumbnail diagram of the bus stop polygonal area. DETAILED DESCRIPTION

[0068] In order to make the technical solutions and advantages of the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, and are not an exhaustive list of all the embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other unless they conflict.

[0069] Example 1, reference Figure 1-Figure 3This embodiment describes a bus dispatching method, comprising the following steps:

[0070] S1. Obtain waiting data of passengers at the bus stop;

[0071] S2. The remote cloud platform evaluates and analyzes the data, formulates a bus travel plan based on the temporal and spatial relationships between historical peak and off-peak periods, temporarily dispatches buses based on the current day's peak alert information, and displays the latest bus travel plan information on bus stop information screens, including the following steps:

[0072] S21. Display real-time bus waiting status: Mark each bus stop on the map and display the current waiting status data of each bus stop in real time, including: picture, current number of waiting people, maximum number of waiting people, minimum number of waiting people, average number of waiting people, maximum waiting time, minimum waiting time and average waiting time;

[0073] S22. Display of traffic flow time curve: Displays the curve of the number of people entering and leaving each bus stop over time;

[0074] S23. Display the time curve of the number of waiting people: Each bus stop displays the curves of the current number of waiting people, the maximum number of waiting people, the minimum number of waiting people, and the average number of waiting people over time;

[0075] S24. Alarm mark: Set peak alarm and low-peak alarm thresholds. When the average number of people waiting at each bus stop exceeds the set peak threshold, the bus stop is highlighted; when the average number of people waiting is lower than the set low-peak threshold, the bus stop is dimmed; and the current alarm information is recorded and generated respectively;

[0076] S25. Perform alarm event analysis: Statistics display the total number of alarms today, the total number of historical warnings, the trend of the number of alarm events in a week or a month, and the distribution points of the number of alarm events;

[0077] S26. Develop bus travel plans in advance and temporarily dispatch bus trips: Based on historical peak and off-peak periods, the remote cloud platform will develop bus travel plans one day in advance, including bus routes, number of buses, and departure times from the terminal. When buses are running, during peak hours on a certain route, the number of buses will be increased to shorten waiting times at the bus terminal. During off-peak hours on a certain route, the number of buses will be reduced to increase waiting times at the bus terminal. Buses will be temporarily dispatched based on peak warning information that appears on the day. When bus travel information changes, it will be promptly sent to the information screens at the bus stops for display. If a sudden peak waiting period occurs on the same day, temporary vehicles will be added to pick up and drop off passengers on this route. Specifically, when bus travel information changes, it will be promptly sent to the information screens at the bus stops for display.

[0078] The method for obtaining the waiting data of passengers waiting at a bus stop comprises the following steps:

[0079] S11 obtains the bus stop waiting area video stream, and detects the waiting person for each frame of the video stream;

[0080] Specifically, the edge computing node device accesses the real-time video stream of the camera device, performs video decoding operations, and divides the video into frames for input; then uses the yolov5 target detection algorithm to detect people in each frame of the picture, and obtains the position coordinate information of the person in the picture, that is, a rectangular detection box [left, top, wIDth, height], which are the horizontal coordinate of the upper left corner, the vertical coordinate of the upper left corner, the width and height of the rectangular detection box respectively.

[0081] S12. Using the detected waiting persons in each frame, target tracking is performed on the waiting persons to obtain each person's ID information;

[0082] Through corner detection, we obtain the sparse feature point set of the previous frame image, and then obtain the sparse feature point set of the next frame image. Finally, we determine whether there is optical flow between the two frames of images for a certain feature point, and thus track each target in the image. Specifically, it includes the following steps:

[0083] S121. Corner point detection obtains a set of corner points for each frame of image and numbers the corner points by ID;

[0084] S122. Motion estimation is performed by translation or affine for each corner point between consecutive frames;

[0085] S123. Connect the motion vectors in consecutive frames to obtain the trajectory of each corner point;

[0086] S124. For each corner point, remove corner points that are blocked or cannot be accurately tracked;

[0087] S125. Track new and old corner points using steps S121-S123.

[0088] S13. Collect data of passengers waiting for the bus;

[0089] When performing target detection and ID tracking on people based on video, there is often jitter in the target detection frame and ID jumps due to people walking, crowding or being blocked, which leads to two common double counting problems. The first is when a person is just at the boundary of the bus stop polygon 1, due to the jitter of the target detection frame, it is equivalent to people constantly entering and exiting, resulting in double counting; the second is when a person is inside the bus stop polygon 1, due to the phenomenon of ID jumps, if only counting is performed by counting people's IDs, double counting will also occur. In order to avoid these phenomena, the present invention uses the following method to count the in and out flow of people at the bus stop:

[0090] The waiting data include: bus station inflow and outflow flow, bus station waiting flow and waiting time;

[0091] The inflow and outflow of bus stops includes: the number of people entering and the number of people leaving;

[0092] The waiting flow at the bus stop includes: the current number of people waiting, the maximum number of people waiting, the minimum number of people waiting, and the average number of people waiting;

[0093] Waiting time includes: maximum waiting time, minimum waiting time and average waiting time;

[0094] The method for counting the flow of people entering and leaving the bus station is:

[0095] S31. Initially set the data sampling period T. On the camera video screen, draw a polygon 1 surrounding the waiting area of ​​the bus stop, and save the vertex coordinate information of the polygon 1 in a fixed format;

[0096] Specifically, the vertex coordinates are saved in the format: x0,y0;x1,y1;...;x n-1 ,y n-1 ; Where n represents the total number of polygon vertices, x represents the x-coordinate of a vertex, and y represents the y-coordinate of a vertex.

[0097] S132. Read the vertex coordinate point information of polygon 1 to obtain the vertex coordinate set of polygon 1;

[0098] point1[n][2]= {{x0,y0}, {x1,y1}, ..., {x n-1 ,y n-1}}; where n represents the total number of polygon vertices, x represents the x-coordinate of a vertex, and y represents the y-coordinate of a vertex.

[0099] S133. Calculate the coordinates of the person in each frame of the picture;

[0100] S134. Determine whether the person's coordinates are inside or outside the polygon;

[0101] Judge by the number of intersection points between the horizontal line (ray) passing through the coordinate point and each side of the polygon. If the number of intersection points is odd, it is determined that the person's coordinate is inside the polygon; otherwise, the person's coordinate is outside the polygon. If the person's coordinate is inside the polygon, it is determined as a waiting passenger.

[0102] The method to determine whether a person's coordinate is inside or outside a polygon is as follows: Let the set of coordinates of the n vertices of the polygon be: point[n][2] = {{x0, y0}, {x1, y1},..., {x n-1 , y n-1}}. The person's coordinate is (x, y), and the judgment method is as follows:

[0103] S1341. Initially set variables i = 0, j = n - 1, count = 0, where i represents the vertex number or the side number of the polygon, starting from 0 to n - 1, j represents the number of the other vertex adjacent to the i-th vertex in the counterclockwise direction, n represents the number of vertices of the polygon, and count represents the number of intersection points.

[0104] S1342. If i < n, loop to calculate S343 and S344, otherwise execute S345;

[0105] S1343. Judge whether the horizontal ray of the person's coordinate point (x, y) intersects with the i-th side.

[0106] If

[0107] and ;

[0108] Then it intersects, and let count = count + 1;

[0109] S1344. Let j = i, i = i + 1, and jump to S1342;

[0110] S1345. Judge whether count is odd. If it is odd, judge that the person's coordinate is inside a certain polygon. [[ID=�7]]

[0111] S135. Set the shrink value, and shrink the set of vertex coordinates of polygon 1 equidistantly to obtain the set of vertex coordinates of polygon 2;

[0112] S1351. Input the shrink value and the set of coordinates of the n vertices of polygon 1, point1[n][2];

[0113] [[ID=^4]]S1352. Let the vertex number of polygon 1 be i, starting from 0 to n - 1, where n represents the number of vertices of the polygon; [[ID=^]] [[ID=^6]]

[0114] [[ID=^7]]S1353. If the vertex number of i < n, then let i = i + 1 and continue to the next step, otherwise exit; [[ID=^8]]

[0115] S1354. Obtain the coordinates of the i-th vertex of polygon 2 obtained by offsetting the coordinates of the i-th vertex of polygon 1;

[0116] Assume that the coordinates of the current i-th vertex of polygon 1 are (px,py), and the coordinates of the other two adjacent vertices are (p1.x,p1.y) and (p2.x,p2.y), then:

[0117] px=point1[i][0]

[0118] py=point1[i][1]

[0119] If i is equal to 0, the adjacent vertex coordinates of the first vertex (p1.x, p1.y) are:

[0120] p1.x=point1[n-1][0]

[0121] p1.y=point1[n-1][1]

[0122] Otherwise:

[0123] p1.x=point1[i-1][0]

[0124] p1.y=point1[i-1][1]

[0125] If i is equal to (n-1), the adjacent vertex coordinates (p2.x, p2.y) of the last vertex are:

[0126] p2.x=point1[0][0]

[0127] p2.y=point1[0][1]

[0128] Otherwise:

[0129] p2.x=point1[i+1][0]

[0130] p2.y=point1[i+1][1]

[0131] Specifically, point1[i][0] and point1[i][1] are elements in the vertex coordinate set point1[n][2] (the vertex coordinate set is a two-dimensional array). "()?():()" is a conditional judgment operator (condition)? (result 1): (result 2) means that if the condition is met, the result is equal to result 1, otherwise it is equal to result 2.

[0132] Convert the two adjacent sides into vectors P1 (v1x, v1y) and P2 (v2x, v2y) for calculation:

[0133] v1x=p1.xp.x

[0134] v1y=p1.yp.y

[0135] v2x=p2.xp.x

[0136] v2y=p2.yp.y

[0137] Convert P1 and P2 into normalized vectors to obtain P1(vv1x,vv1y) and P2(vv2x,vv2y):

[0138] ;

[0139] Vectors P1 and P2 intersect at point P. After translation by the expand distance, they intersect again at point Q. Let vectorLen be the distance between points PQ. Calculate the vectorLen value:

[0140] ;

[0141] The cross product of the P1 and P2 vectors is used to determine whether the angle is concave or convex:

[0142] judge=v1x*v2y-v2x*v1y

[0143] If the cross product judge < 0, the vector angle is concave;

[0144] If the cross product judge>0, the vector angle is convex;

[0145] If the cross product judge = 0, the angle between the vectors is a straight angle;

[0146] When the angle between the vectors is concave or flat, no operation is performed. When the angle between the vectors is convex, let:

[0147] vectorLen=vectorLen*(-1)

[0148] Calculate the current vertex coordinates, and set the x-coordinate offset and y-coordinate offset after isometric indentation to vx and vy respectively:

[0149] ;

[0150] S1355. Based on the x-coordinate offset and y-coordinate offset of the vertex coordinates, the coordinates of the i-th vertex of polygon 2 can be calculated:

[0151] ;

[0152] S1356. Jump to S1353 and repeat the execution until exit.

[0153] S136. Set the array length to length and create two array sets. The array set inside_id[length] stores the ID information of people inside polygon 2, and the array set outside_id[length] stores the ID information of people outside polygon 1.

[0154] S137. Based on the person's coordinates and the obtained set of polygon vertex coordinates, determine the person's coordinates. If the person is inside polygon 2 and the person's ID does not exist in inside_id[length], then add the person's ID to inside_id[length]. Otherwise, if the person is outside polygon 1 and the person's ID does not exist in outside_id[length], then add the person's ID to outside_id[length].

[0155] Specifically, the way to join the queue is: the head element of the array is removed from the queue, and the new id is added to the end of the array;

[0156] S38. Then determine the coordinates of the person. If the person is inside polygon 2 and the person's ID is in outside_id[length], the number of people entering is incremented by 1, and the person's ID is deleted from outside_id[length].

[0157] S139. Then determine the coordinates of the person. If the person is outside polygon 1 and the person's ID is in inside_id[length], then add 1 to the number of people who left the polygon and delete the person's ID from inside_id[length].

[0158] The method for counting the waiting flow at bus stops is:

[0159] Calculate the current number of people waiting (currentWait) in each frame in real time, and count the maximum number of people waiting (maxWait), the minimum number of people waiting (minWait), and the average number of people waiting (aveWait) within the cycle time T;

[0160] Current number of people waiting for the bus: In a certain frame of the picture, if the coordinates of a person are within polygon 1, the current number of people waiting for the bus will be added by 1. At the same time, the current number of people waiting for the bus will be collected and calculated every 1 second during the cycle time, and a total of T times:

[0161] Maximum number of waiting people: If the maximum number of waiting people is less than the current number of waiting people, the maximum number of waiting people = the current number of waiting people;

[0162] Minimum number of waiting people: If the minimum number of waiting people is greater than the current number of waiting people, the minimum number of waiting people = the current number of waiting people;

[0163] Average number of people waiting: After the cycle time ends, the average number of people waiting = ;

[0164] Among them, T represents the cycle time, i represents the sequence number, that is, the i-th second, currentWait i Indicates the current number of people waiting for the bus at the i-th second.

[0165] The calculation of waiting time includes the following steps:

[0166] In multiple consecutive frames of images, the current waiting time of each passenger is counted to obtain the maximum waiting time (maxWaitTime), minimum waiting time (minWaitTime) and average waiting time (aveWaitTime) at a certain moment;

[0167] From the continuous multi-frame images, extract one frame to record the current time and the ID information of all the waiting people within polygon 1; after K frames of images, extract another frame to record the current time and the ID information of all the waiting people within polygon 1; compare the IDs of the waiting people in the two frames to see if they are the same, and then the waiting time of each waiting person can be accumulated based on the time difference between the two frames. Specifically:

[0168] Initially set the k value, k represents the number of image intervals, generally set k=10;

[0169] Extract the i-th frame image, the current time is time1, and determine whether a person is inside polygon 1. If so, add the person's ID information to the ID array set of all waiting people;

[0170] Extract the i+kth frame image, the current time is time2, and determine whether a person is inside polygon 1. If so, add the person's ID information to the ID array set of all waiting people, and then loop to compare and determine whether the person's ID is in the ID array set of all waiting people in the i-th frame image;

[0171] If not, the waiting time of the current person waiting is reset to zero:

[0172] waitTime=0

[0173] If yes, then the waiting time of the current waiter, waitTime, is accumulated:

[0174] waitTime=waitTime+(time2-time1)

[0175] Get the waiting time of all current passengers at a certain moment, and filter out the maximum waiting time (maxWaitTime), minimum waiting time (minWaitTime) and average waiting time (aveWaitTime) at a certain moment

[0176] Assume that the total number of people waiting for the bus at a certain moment is m, and the set of waiting times of all the people waiting for the bus is waitTime[m], then:

[0177] Maximum waiting time: The maximum waiting time maxWaitTime is equal to the maximum value of the set of waiting times of all waiting people;

[0178] Minimum waiting time: The minimum waiting time minWaitTime is equal to the minimum value of the set of waiting times of all waiting people;

[0179] Average waiting time: Average waiting time = ;

[0180] Among them, m represents the total number of waiting people at a certain moment, i represents the sequence number, and waitTime[i] represents the current waiting time of the i-th person.

[0181] S14 sends statistical data to the information display device, which controls the information display to display passenger flow information in real time;

[0182] S15. Take a screenshot of the on-site video and send the waiting data to the remote cloud platform.

[0183] Take screenshots of the on-site video, and then structure the statistical data according to a fixed message format and send it to the remote cloud platform. The data parameters include: edge computing node device ID, message ID, message type, message time, camera ID, location section ID, picture, statistical cycle time, number of people entering, number of people leaving, current number of waiting people, maximum number of waiting people, minimum number of waiting people, average number of waiting people, maximum waiting time, minimum waiting time and average waiting time.

[0184] Specifically, the message format is:

[0185] "deviceId": "mydeviceid",

[0186] "messageId": "gdfgrdtasdasdwaewaedxZxzd",

[0187] "type": "busStationFlow",

[0188] "time": "2023-06-16 18:30:00",

[0189] "params": {

[0190] "sourceId": "aaaaa001" ,

[0191] "roadId": "road001" ,

[0192] "pictureList": "picture / 20230616 / xx.jpg" ,

[0193] "cycle": 60,

[0194] "entry": 20,

[0195] "exit": 14,

[0196] "currentWait": 6,

[0197] "aveWait": 8,

[0198] "maxWait": 10,

[0199] "minWait": 5,

[0200] "aveWaitTime": 30,

[0201] "maxWaitTime": 60,

[0202] "minWaitTime": 10

[0203] }

[0204] }

[0205] Message field description:

[0206] Parameter name: deviceId; Type: string; Field description: The ID of the edge computing node device where the information comes from;

[0207] Parameter name: messageId; Type: string; Field description: Message unique ID, using 32-bit UUID;

[0208] Parameter name: type; Type: string; Field description: message type;

[0209] Parameter name: time; Type: string; Field description: message time, date type time;

[0210] Parameter name: params; Type: object; Field description: parameter item;

[0211] Parameter name: sourceId; Type: string; Field description: Event data source ID, such as camera ID;

[0212] Parameter name: roadId; Type: string; Field description: The id of the location road;

[0213] Parameter name: pictureList; Type: string; Field description: picture, multiple pictures are separated by commas ",";

[0214] Parameter name: cycle; Type: string; Field description: Statistical cycle time, in seconds;

[0215] Parameter name: entry; Type: int; Field description: The cumulative number of people entering the platform during the cycle time;

[0216] Parameter name: exit; Type: int; Field description: The cumulative number of people who walked out of the platform during the cycle time;

[0217] Parameter name: currentWait; Type: int; Field description: Number of people waiting at the current platform;

[0218] Parameter name: aveWait; Type: int; Field description: The average number of people waiting at the platform during the cycle time;

[0219] Parameter name: maxWait; Type: int; Field description: The maximum number of people waiting at the platform within the cycle time;

[0220] Parameter name: minWait; Type: int; Field description: The minimum number of people waiting at the platform within the cycle time;

[0221] Parameter name: aveWaitTime; Type: int; Field description: Current average waiting time, in seconds;

[0222] Parameter name: maxWaitTime; Type: int; Field description: Current maximum waiting time, in seconds;

[0223] Parameter name: minWaitTime; Type: int; Field description: Current minimum waiting time, in seconds.

[0224] In embodiment 2, the computer device of the present invention may include a processor and a memory, such as a single-chip microcomputer including a central processing unit. The processor is used to execute a computer program stored in the memory to implement the steps of the above-mentioned bus dispatching method.

[0225] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0226] The memory may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback); the data storage area may store data generated based on the use of the phone (such as audio data and a phone book). Furthermore, the memory may include high-speed random access memory (RAM) and non-volatile memory, such as a hard disk, internal memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0227] Embodiment 3, computer readable storage medium embodiment.

[0228] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. The computer-readable storage medium stores a computer program. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned bus scheduling method can be implemented.

[0229] The computer program includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of legislation and patent practice within a jurisdiction. For example, in some jurisdictions, based on legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.

[0230] Although the present invention has been described with respect to a limited number of embodiments, it will be apparent to those skilled in the art, having benefit of the foregoing description, that other embodiments are contemplated within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been selected primarily for readability and didactic purposes, rather than for the purpose of explaining or limiting the subject matter of the present invention. Consequently, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative rather than restrictive of the scope of the invention, which is defined by the appended claims.

Claims

1. A bus dispatching method, characterized in that: The following steps are involved: S1. Obtain waiting data of passengers at the bus stop; The method for obtaining the waiting data of passengers waiting at a bus stop comprises the following steps: S11 obtains the bus stop waiting area video stream, and detects the waiting person for each frame of the video stream; S12. Using the detected waiting persons in each frame, track the waiting persons and obtain their ID information; S13. Collect data of passengers waiting for the bus; The waiting data include: bus station inflow and outflow flow, bus station waiting flow and waiting time; The inflow and outflow of bus stops includes: the number of people entering and the number of people leaving; The waiting flow at the bus stop includes: the current number of people waiting, the maximum number of people waiting, the minimum number of people waiting, and the average number of people waiting; Waiting time includes: maximum waiting time, minimum waiting time and average waiting time; The method for counting the flow of people entering and leaving the bus station is: S131. Initially set the data sampling period T. On the camera video screen, draw a polygon 1 surrounding the waiting area of ​​the bus stop, and save the vertex coordinate information of polygon 1 in a fixed format; S132. Read the vertex coordinate point information of polygon 1 to obtain the vertex coordinate set of polygon 1; S133. Calculate the coordinates of the person in each frame of the picture; S134. Determine whether the coordinates of the person are inside or outside the polygon; S135. Set the indentation value and indent the vertex coordinate set of polygon 1 equidistantly to obtain the vertex coordinate set of polygon 2; S136. Set the array length to length and create two array sets. The array set inside_id[length] stores the ID information of people inside polygon 2, and the array set outside_id[length] stores the ID information of people outside polygon 1. S137. Based on the person's coordinates and the obtained polygon vertex coordinate set, determine the person's coordinates. If the person is inside polygon 2 and there is no person's ID in inside_id[length], then add the person's ID to inside_id[length]. Otherwise, if the person is outside polygon 1 and there is no person's ID in outside_id[length], then add the person's ID to outside_id[length]. S138. Then determine the coordinates of the person. If they are inside polygon 2 and the person's ID is in outside_id[length], the number of people entering is incremented by 1, and the person's ID is deleted from outside_id[length]. S139. Then determine the coordinates of the person. If the person is outside polygon 1 and the person's ID is in inside_id[length], then add 1 to the number of people who left the polygon and delete the person's ID from inside_id[length]. S14 sends statistical data to the information display device, which controls the information display to display passenger flow information in real time; S15. Take a screenshot of the on-site video and send the waiting data to the remote cloud platform; S2. Evaluate and analyze the waiting data, formulate a bus travel plan based on the temporal and spatial relationship between historical peak and off-peak periods, temporarily dispatch bus trips based on the peak warning information of the day, and publish the latest bus travel plan information to the bus station information screen device for display. The S2 includes the following steps: S21. Display real-time bus waiting status: Mark each bus stop on the map and display the current waiting status data of each bus stop in real time, including: picture, current number of waiting people, maximum number of waiting people, minimum number of waiting people, average number of waiting people, maximum waiting time, minimum waiting time and average waiting time; S22. Display of traffic flow time curve: Displays the curve of the number of people entering and leaving each bus stop over time; S23. Display the time curve of the number of waiting people: Each bus stop displays the curves of the current number of waiting people, the maximum number of waiting people, the minimum number of waiting people, and the average number of waiting people over time; S24. Alarm mark: Set peak alarm and low-peak alarm thresholds. When the average number of people waiting at each bus stop exceeds the set peak threshold, the bus stop is highlighted; when the average number of people waiting is lower than the set low-peak threshold, the bus stop is dimmed; and the current alarm information is recorded and generated respectively; S25. Perform alarm event analysis: Statistics display the total number of alarms today, the total number of historical warnings, the trend of the number of alarm events in a week or a month, and the distribution points of the number of alarm events; S26. Prepare bus travel plans in advance and temporarily dispatch bus travel: Based on historical peak and off-peak periods, the remote cloud platform prepares bus travel plans one day in advance, including: bus routes, number of buses and departure time from the terminal; when buses are running, during peak hours on a certain route, the number of buses is increased to shorten the waiting time at the bus terminal; during off-peak hours on a certain route, the number of buses is reduced to increase the waiting time at the bus terminal; based on peak warning information that appears on the day, bus travel is temporarily dispatched; when bus travel information changes, it is promptly sent to the information screen equipment at the bus stop for display.

2. A bus dispatching method according to claim 1, characterized in that: Using the detected passengers in each frame, we can track the passengers and obtain their ID information. The method is as follows: S121. Corner point detection obtains a set of corner points for each frame of image and numbers the corner points by ID; S122. Motion estimation is performed by translation or affine for each corner point between consecutive frames; S123. Connect the motion vectors in consecutive frames to obtain the trajectory of each corner point; S124. For each corner point, remove corner points that are blocked or cannot be accurately tracked; S125. Track new and old corner points using steps S121-S123.

3. A bus dispatching method according to claim 2, characterized in that: The method of setting an indentation value and indenting the vertex coordinate set of polygon 1 by equal distance to obtain the vertex coordinate set of polygon 2 includes the following steps: S1351. Input the indentation value and the coordinate set of n vertices of polygon 1, point1[n][2]; S1352. Let the vertex of polygon 1 be i, where i starts from 0 and goes to n-1; S1353. If the vertex sequence number i < n, then set i = i + 1 and continue to the next step; otherwise, exit. S1354. Obtain the coordinates of the i-th vertex of polygon 2 obtained by offsetting the coordinates of the i-th vertex of the current polygon 1. S1355. Calculate the coordinates of the i-th vertex of polygon 2 based on the x-coordinate offset and y-coordinate offset of the vertex coordinates: S1356. Jump to S1353 and repeat the execution until exiting and ending.

4. A bus dispatching method according to claim 3, characterized in that: The method for counting the waiting flow of bus stops is as follows: Current number of waiting people: In a certain frame of picture, if the coordinates of a person are within polygon 1, increment the current number of waiting people by 1. At the same time, within the cycle time, collect and calculate the current number of waiting people every 1 second, and a total of T times are counted: Then Maximum number of waiting people: If the maximum number of waiting people is less than the current number of waiting people, set the maximum number of waiting people = the current number of waiting people; Minimum number of waiting people: If the minimum number of waiting people is greater than the current number of waiting people, set the minimum number of waiting people = the current number of waiting people; Average number of people waiting: After the cycle time ends, the average number of people waiting ; Among them, T represents the cycle time, s represents the sequence number, that is, the sth second, currentWait s Indicates the current number of people waiting at the sth second.

5. A bus dispatching method according to claim 4, characterized in that: The method for counting the waiting time is as follows: Initially set the value of k, where k represents the number of picture intervals; Extract the q-th frame of the picture. The current time is time1. Determine whether a person is within polygon 1. If so, add the id information of this person to the id array set of all waiting people; Extract the (q + k)-th frame of the picture. The current time is time2. Determine whether a person is within polygon 1. If so, add the id information of this person to the id array set of all waiting people, and loop to compare and determine whether the id of this person is in the id array set of all waiting people in the q-th frame of the picture; If not, clear the waiting time waitTime of the current waiting person: waitTime = 0; if so, accumulate the waiting time waitTime of the current waiting person: waitTime = waitTime + (time2 - time1); Obtain the waiting time of all current waiting people at a certain moment, and filter to obtain the maximum waiting time, minimum waiting time, and average waiting time at a certain moment; Let the total number of waiting people at a certain moment be m, and the set of waiting times of all waiting people be waitTime[m], then: Maximum waiting time: The maximum waiting time is equal to the maximum value in the set of waiting times of all waiting people; Minimum waiting time: The minimum waiting time is equal to the minimum value in the set of waiting times of all waiting people; Average waiting time: Average waiting time = ; Among them, m represents the total number of waiting people at a certain moment, p represents the sequence number, and waitTime[p] represents the current waiting time of the p-th person.

6. An electronic device, characterized in that: It includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of a bus scheduling method described in any one of claims 1-5.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements a bus scheduling method described in any one of claims 1-5.

Citation Information

Patent Citations

  • System and method for forecasting queuing length in comprehensive passenger transport hub

    CN112258723A

  • Bus scheduling method and system based on accurate real-time information

    CN114241770A