Train over-the-horizon video stream playing method and device, computer equipment, storage medium and computer program product
By filtering and storing camera video streams on the train based on location and sliding window range and storing track-side camera video streams, the screen flickering and black screen problems caused by switching during train over-visual video stream playback are solved, and more stable video stream playback is achieved.
Patent Information
- Application Number
- CN202510562191.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the over-visual video streaming of trains is easily caused to short-term flashing and black screen when switching, and the video streaming playback is low.
By determining the sliding window range based on the train position, the configuration value beyond the visual range and the sliding window width value, filter out the camera next to the candidate track, and store its video stream in the video cache for playback processing, avoiding temporary streaming switching.
Improve the stability of video streaming, avoid screen flickering and black screen, and ensure the smoothness and stability of video streaming.
Smart Images

Figure CN120499412A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for playing beyond-visual-range video streams on trains. Background Art
[0002] At present, in order to allow train drivers to check the road conditions in front of the train in advance, it is crucial to stably play the train's beyond-line-of-sight video stream.
[0003] Traditionally, when playing beyond-visual-range video streams on trains, the stream is generally pulled when switching is needed. However, with this method, the new camera video stream takes 1-2 seconds to stabilize, which can easily cause the screen to flicker or go black for a short period of time, resulting in lower stability in video stream playback. Summary of the Invention
[0004] Based on this, it is necessary to provide a train beyond-visual-range video stream playback method, device, computer equipment, computer-readable storage medium and computer program product that can improve the stability of video stream playback in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for playing a video stream beyond visual range on a train, comprising:
[0006] Determining a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value;
[0007] determining, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and selecting, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value falls within the sliding window as a second candidate trackside camera;
[0008] Filtering a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras;
[0009] Storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train;
[0010] According to the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0011] In one embodiment, after selecting a second number of target trackside cameras from the third candidate trackside cameras according to the second position value of the third candidate trackside camera and playing the video streams captured by the target trackside cameras in the video cache, the method further includes:
[0012] Obtaining an updated position value of the train;
[0013] Determining an updated sliding window range corresponding to the train according to the updated position value, the beyond-horizon lead configuration value, and the sliding window width value;
[0014] Filtering out, from each of the target trackside cameras, a target trackside camera whose second position value is not within the updated sliding window range as the trackside camera to be replaced;
[0015] Generate a video stream replacement instruction for the trackside camera to be replaced, and switch the video stream collected by the trackside camera to be replaced according to the video stream replacement instruction.
[0016] In one embodiment, switching the video stream captured by the trackside camera to be replaced according to the video stream replacement instruction includes:
[0017] Obtain the number of videos in the video cache;
[0018] When it is detected that the number of videos is greater than the second number, switching the video stream captured by the to-be-replaced trackside camera to the video stream captured by the current trackside camera in accordance with the video stream replacement instruction; the current trackside camera is used to represent the trackside camera whose second position value is closest to the train among the fourth trackside cameras; the fourth trackside camera represents the trackside camera among the third candidate trackside cameras, excluding the target trackside camera;
[0019] When it is detected that the number of videos is less than or equal to the second number, the video stream captured by the target trackside camera is kept playing.
[0020] In one embodiment, before determining the sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value, the method further includes:
[0021] grouping the first candidate trackside cameras according to the first number to obtain multiple groups of candidate trackside cameras;
[0022] Determining a total distance value of the plurality of groups of candidate trackside cameras according to the second position value;
[0023] The sliding window width value of the train is determined based on the total distance values of the multiple groups of candidate trackside cameras.
[0024] In one embodiment, determining the sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value includes:
[0025] Summing the first position value and the beyond-horizon advance configuration value to obtain a sliding window minimum value corresponding to the train;
[0026] Summing the first position value, the beyond-horizon advance configuration value, and the sliding window width value to obtain a sliding window maximum value corresponding to the train;
[0027] The sliding window range is determined according to the sliding window minimum value and the sliding window maximum value.
[0028] In one embodiment, before storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train, the method further includes:
[0029] generating a video stream acquisition request for the third candidate trackside camera according to the second position value of the third candidate trackside camera;
[0030] The video stream acquisition request is sent to the ground server, so that the ground server returns the video stream captured by the third candidate trackside camera according to the video stream acquisition request.
[0031] In a second aspect, the present application further provides a device for playing a video stream on a train beyond visual range, comprising:
[0032] A range determination module is used to determine a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value;
[0033] a first screening module, configured to determine, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and screen out, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value is within the sliding window range as a second candidate trackside camera;
[0034] a second screening module, configured to screen out a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras;
[0035] a video storage module, configured to store the video stream captured by the third candidate trackside camera into a video cache corresponding to the train;
[0036] A video playback module is used to screen out a second number of target trackside cameras from the third candidate trackside cameras according to the second position value of the third candidate trackside camera, and to play and process the video streams captured by the target trackside cameras in the video cache; the second number is smaller than the first number.
[0037] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0038] Determining a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value;
[0039] determining, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and selecting, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value falls within the sliding window as a second candidate trackside camera;
[0040] Filtering a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras;
[0041] Storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train;
[0042] According to the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0044] Determining a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value;
[0045] determining, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and selecting, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value falls within the sliding window as a second candidate trackside camera;
[0046] Filtering a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras;
[0047] Storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train;
[0048] According to the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0049] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0050] Determining a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value;
[0051] determining, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and selecting, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value falls within the sliding window as a second candidate trackside camera;
[0052] Filtering a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras;
[0053] Storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train;
[0054] According to the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0055] The above-mentioned train beyond-visual-range video stream playback method, device, computer equipment, storage medium and computer program product first determine the sliding window range corresponding to the train based on the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value, then determine the second position value of the first candidate trackside camera of the line where the train is located based on the electronic map corresponding to the train, and screen out candidate trackside cameras whose second position values are within the sliding window range from each first candidate trackside camera as the second candidate trackside camera. Then, based on the second position value of the second candidate trackside camera, a first number of third candidate trackside cameras are screened out from the second candidate trackside cameras. Then, the video streams captured by the third candidate trackside cameras are stored in the video cache corresponding to the train. Finally, based on the second position value of the third candidate trackside camera, a second number of target trackside cameras less than the first number are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed. In this way, during the playback of the train's beyond-visual-range video stream, the sliding window range is first determined based on the train position, the beyond-visual-range advance configuration value, and the sliding window width value. Then, the second candidate trackside camera within the sliding window range is screened out based on the electronic map. Then, the first number of third candidate trackside cameras is screened out from the second candidate trackside cameras based on the second position value. This series of calculations and screening can determine the candidate trackside cameras related to the train position in advance, and store the video streams collected by them in the video cache. When the video stream of a certain trackside camera needs to be played, these video streams are already prepared in the video cache, and there is no need to temporarily pull the stream, avoiding the method of pulling the stream when switching is needed, which can easily cause the screen to flicker or go black for a short time, thereby causing the video stream playback to be less stable, which is beneficial to improving the stability of video stream playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 A diagram illustrating an application environment of a method for playing beyond-visual-range video streams on a train in one embodiment;
[0058] Figure 2 1. A flow chart of a method for playing a train beyond-visual-range video stream in one embodiment;
[0059] Figure 3 Schematic diagram of a train traveling beyond visual range in an embodiment;
[0060] Figure 4 A schematic diagram of a flow chart of a method for playing a train beyond-visual-range video stream in another embodiment;
[0061] Figure 5 A schematic diagram of a camera EML (Electronic Map Location) initialization operation in one embodiment;
[0062] Figure 6 2. It is a structural block diagram of a device for playing a video stream beyond visual range on a train in one embodiment;
[0063] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0064] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0065] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0066] The train beyond-visual-range video stream playback method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown in FIG. , the vehicle-mounted device 102 communicates with the ground server 104 via the network. Specifically, refer to Figure 1The onboard device 102 obtains the first position value of the train through the onboard CTU (Central Treatment Unit). Then, the onboard host determines the sliding window range corresponding to the train based on the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value. The onboard host determines the second position value of the first candidate trackside camera on the line where the train is located based on the electronic map corresponding to the train. The onboard device 102 selects candidate trackside cameras whose second position values are within the sliding window range from each first candidate trackside camera as the second candidate trackside camera. Based on the second position values of the second candidate trackside cameras, the onboard device 102 selects a first number of third candidate trackside cameras from the second candidate trackside cameras. The onboard device 102 then stores the video streams captured by the third candidate trackside cameras returned by the ground server 104 in the video cache corresponding to the train on the onboard smart screen. The onboard smart screen selects a second number of target trackside cameras from the third candidate trackside cameras based on the second position values of the third candidate trackside cameras, and plays and processes the video streams captured by the target trackside cameras in the video cache. The second number is less than the first number.
[0067] Among them, the on-board equipment 102 is an electronic device installed on the train, including an on-board CTU, an on-board host and an on-board smart screen; the ground server 104 refers to a server located on the ground, also known as a trackside video ground server; the server can be implemented as an independent server or a server cluster composed of multiple servers.
[0068] In an exemplary embodiment, Figure 2 As shown, a method for playing train beyond visual range video stream is provided, and the method is applied to Figure 1 Taking the vehicle-mounted device in FIG. 1 as an example, in this embodiment, the method includes the following steps:
[0069] Step S201: Determine a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value.
[0070] The trains referred to here are heavy-duty freight trains. It's important to note that heavy-duty freight trains can reach speeds of up to 80 km / h and have braking distances exceeding 3 km. These trains operate in harsh environments, often subject to intrusion by people, animals, fallen rocks, and other foreign objects, which can easily compromise train safety. Therefore, beyond-visual-range (BLOS) technology based on vehicle-ground collaboration can effectively address the safety issues associated with long-distance braking of trains.
[0071] Among them, the first position value is used to represent the real-time position value of the train, including the kilometer mark value and the offset value. It should be noted that the data format of the first position value is "kilometer mark value + offset value", such as "100 kilometers + 50 meters". It should be noted that the first position value is also called RL (Realtime Location, real-time location), refer to Figure 3 .
[0072] Among them, the beyond-visual-range lead value is used to indicate how far ahead the train needs to see the line condition, such as 2000 meters. It should be noted that the beyond-visual-range lead value is also called LD (Lead Distance). Figure 3 .
[0073] The sliding window width value refers to a fixed length value extending forward from the sum of the first position value and the beyond-horizon lead configuration value as the starting point. It should be noted that the sliding window width value is also called WD (Window Width, window width), refer to Figure 3 .
[0074] The sliding window range is used to indicate the coverage range of the corresponding position of the trackside camera in front of the train. It should be noted that the sliding window range is also called SW (Slide Window, sliding window range), including SW_N (sliding window minimum value) and SW_F (sliding window maximum value), refer to Figure 3 .
[0075] Exemplarily, in response to a video stream acquisition instruction for a train, the on-board device acquires the real-time position value of the train through the on-board CTU as a first position value; then, the on-board device acquires the current weather data, the current line curve curvature value, and the current network signal strength value corresponding to the train; then, the on-board device determines the first impact value corresponding to the current weather data (a larger value indicates a more serious impact, for example, if the current weather data is foggy, the corresponding first impact value is larger), the second impact value corresponding to the current line curve curvature value (for example, if the current line curve curvature value indicates that the line is in a small curvature curve, the corresponding second impact value is larger), and the third impact value corresponding to the current network signal strength value (for example, if the current network signal strength value is less than a preset network signal strength value, the corresponding third impact value is larger); then, the on-board device The device performs weighted summation processing on the first influence value, the second influence value and the third influence value to obtain the target influence value corresponding to the train; then, the on-board device queries the correspondence between the influence value and the adjustment coefficient, obtains the adjustment coefficient corresponding to the target influence value, and uses it as the target adjustment coefficient corresponding to the train; then, the on-board device obtains the beyond-visual-sight advance configuration value and the sliding window width value of the train, and adjusts the beyond-visual-sight advance configuration value and the sliding window width value according to the target adjustment coefficient, to obtain the adjusted beyond-visual-sight advance configuration value and the adjusted sliding window width value of the train; then, the on-board device determines the sliding window range corresponding to the first position value, the adjusted beyond-visual-sight advance configuration value and the adjusted sliding window width value according to the first position value, the adjusted beyond-visual-sight advance configuration value and the adjusted sliding window width value of the train, as the sliding window range corresponding to the train.
[0076] In step S202, based on the electronic map corresponding to the train, the second position value of the first candidate trackside camera of the line where the train is located is determined, and the candidate trackside cameras whose second position values are within the sliding window range are screened out from each first candidate trackside camera as the second candidate trackside camera.
[0077] The electronic map stores the second position value of the first candidate trackside camera of the line where the train is located.
[0078] Among them, the first candidate trackside camera is used to represent the trackside camera of the line where the train is located.
[0079] Among them, trackside cameras are used to refer to video surveillance equipment installed next to the line where the train is located.
[0080] The second position value refers to the position value of the first candidate trackside camera, including the kilometer mark value and the offset value. It should be noted that the data format of the second position value is the same as that of the first position value.
[0081] Among them, the second candidate trackside camera is used to represent the candidate trackside camera among the first candidate trackside cameras, whose second position value is within the sliding window range.
[0082] Exemplarily, the on-board device determines the camera identifier (such as C1, C2, etc.) of the first candidate trackside camera on the line where the train is located, and based on these camera identifiers, determines the position value of the first candidate trackside camera on the line where the train is located from the electronic map corresponding to the train as the second position value; then, the on-board device filters out the candidate trackside cameras whose second position values are within the sliding window range from each first candidate trackside camera as the initial trackside camera; then, the on-board device obtains the current network bandwidth, current signal strength and current packet loss rate of the initial trackside camera, and filters out the trackside cameras whose current network bandwidth is greater than the preset network bandwidth, current signal strength is greater than the preset signal strength, and current packet loss rate is less than the preset previous packet loss rate from the initial trackside cameras as the second candidate trackside camera.
[0083] Step S203: Filter out a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras.
[0084] The first number refers to the number of trackside cameras whose corresponding video streams need to be stored in the video buffer corresponding to the train. In actual scenarios, the first number is 5.
[0085] Exemplarily, the on-board device obtains the current distance value between the second candidate trackside camera and the train based on the second position value of the second candidate trackside camera and the first position value of the train; then, the on-board device sorts the second candidate trackside cameras in order from small to large according to the current distance values between the second candidate trackside camera and the train, to obtain sorted second candidate trackside cameras; then, the on-board device filters out the first number of trackside cameras from the sorted second candidate trackside cameras in order from small to large according to the current distance values as the third candidate trackside cameras.
[0086] Step S204: The video stream captured by the third candidate trackside camera is stored in the video cache corresponding to the train.
[0087] The video stream refers to the video data continuously captured and output by the third candidate trackside camera.
[0088] The video cache is used to represent the storage space in the onboard equipment corresponding to the train for temporarily storing the video stream.
[0089] Exemplarily, the on-board device determines the data volume of the video stream collected by the third candidate trackside camera, and determines the cache space corresponding to the video stream collected by the third candidate trackside camera according to the data volume of the video stream collected by the third candidate trackside camera and the current cache remaining space of the video cache corresponding to the train; then, the on-board device stores the video stream collected by the third candidate trackside camera in the video cache corresponding to the train according to the cache space corresponding to the video stream collected by the third candidate trackside camera.
[0090] Step S205: Based on the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0091] The second number refers to the number of trackside cameras that need to play the corresponding video stream. In actual scenarios, the second number is 4.
[0092] Exemplarily, the on-board device obtains the current distance value between the third candidate trackside camera and the train based on the second position value of the third candidate trackside camera and the first position value of the train; then, the on-board device sorts the third candidate trackside cameras in the order of the current distance values between the third candidate trackside camera and the train from small to large, to obtain sorted third candidate trackside cameras; then, the on-board device selects a second number of trackside cameras from the sorted third candidate trackside cameras in the order of the current distance values from small to large, as target trackside cameras; then, the on-board device obtains the current network bandwidth of the on-board device and the current remaining cache space; then, the on-board device determines the network impact factor of the on-board device based on the current network bandwidth and the preset network bandwidth (for example, the current network bandwidth is 22Mbps preset The network bandwidth is 20Mbps, which means that the network transmission capacity is limited, and the corresponding network impact factor is smaller), and the cache impact factor of the on-board device is determined based on the current cache remaining space and the preset cache remaining space (for example, the current cache remaining space of 300MB is close to the preset cache remaining space of 200MB, which means that the cache space is tight, and the corresponding cache impact factor is smaller); then, the on-board device determines the original frame rate of the video stream collected by the target trackside camera in the video cache, and adjusts the original frame rate based on the network impact factor and the cache impact factor of the on-board device to obtain the adjusted frame rate of the video stream collected by the target trackside camera in the video cache; then, the on-board device plays the video stream collected by the target trackside camera in the video cache according to the adjusted frame rate of the video stream collected by the target trackside camera in the video cache.
[0093] In the above-mentioned method for playing the beyond-visual-range video stream of the train, the sliding window range corresponding to the train is first determined according to the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value, and then the second position value of the first candidate trackside camera of the line where the train is located is determined according to the electronic map corresponding to the train, and the candidate trackside cameras whose second position values are within the sliding window range are screened out from each first candidate trackside camera as the second candidate trackside camera, and then, according to the second position value of the second candidate trackside camera, a first number of third candidate trackside cameras are screened out from the second candidate trackside cameras, and then, the video stream collected by the third candidate trackside camera is stored in the video cache corresponding to the train, and finally, according to the second position value of the third candidate trackside camera, a second number of target trackside cameras less than the first number are screened out from the third candidate trackside cameras, and the video stream collected by the target trackside camera in the video cache is played and processed. In this way, during the playback of the train's beyond-visual-range video stream, the sliding window range is first determined based on the train position, the beyond-visual-range advance configuration value, and the sliding window width value. Then, the second candidate trackside camera within the sliding window range is screened out based on the electronic map. Then, the first number of third candidate trackside cameras is screened out from the second candidate trackside cameras based on the second position value. This series of calculations and screening can determine the candidate trackside cameras related to the train position in advance, and store the video streams collected by them in the video cache. When the video stream of a certain trackside camera needs to be played, these video streams are already prepared in the video cache, and there is no need to temporarily pull the stream, avoiding the method of pulling the stream when switching is needed, which can easily cause the screen to flicker or go black for a short time, thereby causing the video stream playback to be less stable, which is beneficial to improving the stability of video stream playback.
[0094] In an exemplary embodiment, the above-mentioned step S205, after screening out a second number of target trackside cameras from the third candidate trackside cameras according to the second position value of the third candidate trackside camera, and playing and processing the video streams captured by the target trackside cameras in the video cache, also includes: obtaining the updated position value of the train; determining the updated sliding window range corresponding to the train according to the updated position value, the beyond-visual-range advance configuration value and the sliding window width value; screening out the target trackside cameras whose second position values are not within the updated sliding window range from each target trackside camera as the trackside camera to be replaced; generating a video stream replacement instruction for the trackside camera to be replaced, and switching and processing the video stream captured by the trackside camera to be replaced according to the video stream replacement instruction.
[0095] The updated position value refers to the first position value after the update. It should be noted that the first position value is updated once per second.
[0096] The updated sliding window range refers to the sliding window range after the update.
[0097] The trackside camera to be replaced refers to the target trackside camera whose second position value is not within the updated sliding window range.
[0098] The video stream replacement instruction refers to an instruction for switching the video stream collected by the trackside camera to be replaced.
[0099] Exemplarily, the on-board device obtains the updated position value of the train through the on-board CTU; then, the on-board device determines the updated sliding window range corresponding to the train based on the updated position value, the beyond-visual-range advance configuration value and the sliding window width value (it should be noted that the specific determination process corresponding to the updated sliding window range can refer to the relevant embodiments of the specific determination process corresponding to the sliding window range in step S201, which will not be repeated here); then, the on-board device selects the target trackside camera whose second position value is not within the updated sliding window range from each target trackside camera as the trackside camera to be replaced; then, the on-board device determines the braking distance of the train based on the current operating parameters of the train (such as operating speed, acceleration, braking performance and other parameters); then, the on-board device determines the safe switching distance of the train based on the braking distance (such as setting a safe switching distance The switching distance is half of the braking distance), and based on the running speed of the train, the time required for the train to travel from the current position to the safe switching distance is determined as the safe switching time corresponding to the trackside camera to be replaced; then, the on-board equipment determines the total system delay corresponding to the trackside camera to be replaced based on the average instruction processing time of the on-board equipment, the average communication transmission time, and the average switching operation time of the trackside equipment; then, the on-board equipment sums the safe switching time corresponding to the trackside camera to be replaced with the total system delay to obtain the target switching time of the trackside camera to be replaced; then, the on-board equipment generates a video stream replacement instruction for the trackside camera to be replaced based on the target switching time and camera identifier of the trackside camera to be replaced; then, the on-board equipment switches the video stream collected by the trackside camera to be replaced according to the video stream replacement instruction.
[0100] In this embodiment, the updated sliding window range corresponding to the train is accurately determined based on the real-time position information of the train, combined with the beyond-visual-range advance configuration value and the sliding window width value, so that the target trackside cameras that do not match the current position of the train, that is, the trackside cameras to be replaced, can be accurately screened out, avoiding blind selection of cameras for switching and improving the accuracy and pertinence of switching.
[0101] In an exemplary embodiment, the video stream captured by the trackside camera to be replaced is switched according to the video stream replacement instruction, which specifically includes the following contents: obtaining the number of videos in the video cache; when it is detected that the number of videos is greater than the second number, switching the video stream captured by the trackside camera to be replaced to the video stream captured by the current trackside camera according to the video stream replacement instruction; the current trackside camera is used to represent the trackside camera whose second position value is closest to the train among the fourth trackside cameras; the fourth trackside camera represents the trackside camera other than the target trackside camera among the third candidate trackside cameras; when it is detected that the number of videos is less than or equal to the second number, keeping playing the video stream captured by the target trackside camera.
[0102] The number of videos is used to indicate the number of complete video files or video clips stored in the video cache.
[0103] Among them, the current trackside camera is used to represent the trackside camera whose second position value among the fourth trackside cameras is closest to the train.
[0104] The fourth trackside camera represents a trackside camera among the third candidate trackside cameras except the target trackside camera.
[0105] Exemplarily, the on-board device obtains the number of videos in the video cache of the on-board smart screen, and detects the number of videos through a second number; when it is detected that the number of videos is greater than the second number, the on-board device determines the trackside camera other than the target trackside camera among the third candidate trackside cameras as the fourth trackside camera, determines the trackside camera whose second position value is closest to the train among the fourth trackside cameras as the current trackside camera, and switches the video stream captured by the trackside camera to be replaced to the video stream captured by the current trackside camera according to the video stream replacement instruction; when it is detected that the number of videos is less than or equal to the second number, the on-board device keeps playing the video stream captured by the target trackside camera.
[0106] In this embodiment, by obtaining the number of videos in the video cache and comparing it with the second number, it is possible to decide whether to switch the video stream based on the actual situation of the cache. This strategy can avoid unnecessary video stream switching, reduce playback interruptions or freezes that may be caused by frequent switching, and improve the stability and smoothness of video stream playback.
[0107] In an exemplary embodiment, the above-mentioned step S201, before determining the sliding window range corresponding to the train based on the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value, specifically includes the following contents: grouping the first candidate trackside cameras according to the first number to obtain multiple groups of candidate trackside cameras; determining the total distance value of the multiple groups of candidate trackside cameras based on the second position value; and determining the sliding window width value of the train based on the total distance value of the multiple groups of candidate trackside cameras.
[0108] The plurality of groups of candidate trackside cameras are obtained by grouping the first candidate trackside cameras based on the first number.
[0109] The total distance value refers to the distance value between the candidate trackside camera closest to the train and the candidate trackside camera farthest from the train in each group of candidate trackside cameras.
[0110] For example, there are seven candidate trackside cameras on the line where the train is located. In ascending order of distance from the train, they are C1, C2, C3, C4, C5, C6, and C7. The first number is 5. Then, after grouping, the resulting multiple groups of candidate trackside cameras are three groups of candidate trackside cameras: the first group of candidate trackside cameras is C1, C2, C3, C4, and C5; the second group of candidate trackside cameras is C2, C3, C4, C5, and C6; and the third group of candidate trackside cameras is C3, C4, C5, C6, and C7. Among the multiple groups of candidate trackside cameras, the total distance value of the first group of candidate trackside cameras is between C1 and C5, the total distance value of the second group of candidate trackside cameras is between C2 and C6, and the total distance value of the third group of candidate trackside cameras is between C3 and C7. Since the sliding window width value only needs to be no less than the maximum total distance value in each group of candidate trackside cameras, after determining the maximum distance value among the distance values between C1 and C5, the distance value between C2 and C6, and the distance value between C3 and C7 (assuming it is the distance value between C2 and C6), the distance value between C2 and C6 (for example, 1000 meters) is used as the sliding window width value of the train (for example, 1000 meters), or the distance value between C2 and C6 (for example, 1000 meters) is summed with the preset distance value (for example, 100 meters), and the processed distance value (for example, 1100 meters) is used as the sliding window width value of the train (for example, 1100 meters).
[0111] Exemplarily, the on-board device groups the first candidate trackside cameras according to the first number to obtain multiple groups of candidate trackside cameras; then, the on-board device determines the distance values between each pair of candidate trackside cameras in the multiple groups of candidate trackside cameras based on the second position value; then, the on-board device respectively calculates the distance values between each pair of candidate trackside cameras in the multiple groups of candidate trackside cameras to obtain a total distance value of the multiple groups of candidate trackside cameras; then, the on-board device uses the total distance value of the multiple groups of candidate trackside cameras as the original sliding window width value of the train; then, the on-board device obtains the current network load, and determines the adjustment coefficient corresponding to the original sliding window width value based on the current network load and the preset network load (for example, if the current network load is lower than the preset network load, the adjustment coefficient corresponding to the original sliding window width value is determined to be 10%; for example, if the current network load is higher than the preset network load, the adjustment coefficient corresponding to the original sliding window width value is determined to be 5%); then, the on-board device multiplies the original sliding window width value by the adjustment coefficient corresponding to the original sliding window width value to obtain the sliding window width value of the train.
[0112] In this embodiment, the train sliding window width is determined based on the total distance value, which can ensure that a certain number of candidate trackside cameras are included in the sliding window range. Therefore, during the train's movement, the video acquisition system can comprehensively and without omission monitor the train's surrounding environment, avoid monitoring blind spots, and provide all-round video information support for train operation.
[0113] In an exemplary embodiment, the above-mentioned step S201 determines the sliding window range corresponding to the train based on the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value, and specifically includes the following contents: summing the first position value and the beyond-visual-range advance configuration value to obtain the minimum sliding window value corresponding to the train; summing the first position value, the beyond-visual-range advance configuration value and the sliding window width value to obtain the maximum sliding window value corresponding to the train; and determining the sliding window range based on the minimum sliding window value and the maximum sliding window value.
[0114] The sliding window minimum value refers to the starting boundary of the sliding window range of the train.
[0115] The sliding window maximum value refers to the end boundary of the sliding window range of the train.
[0116] Exemplarily, the on-board device determines a first weight corresponding to the first position value, a second weight corresponding to the beyond-visual-range advance configuration value, and a third weight corresponding to the sliding window width value; then, the on-board device sums the first position value and the beyond-visual-range advance configuration value according to the first weight and the second weight to obtain the minimum sliding window value corresponding to the train, and sums the first position value, the beyond-visual-range advance configuration value, and the sliding window width value according to the first weight, the second weight, and the third weight to obtain the maximum sliding window value corresponding to the train; then, the on-board device determines the sliding window range based on the minimum sliding window value and the maximum sliding window value.
[0117] In this embodiment, by determining the sliding window range based on the minimum and maximum sliding window values, the system can more specifically collect data and manage video stream transmission from the trackside cameras in the area, thereby reducing video stream freezes and interruptions caused by temporary searches, camera switching, or data transmission interruptions, thereby improving the stability of video stream playback and providing more reliable visual support for train operation.
[0118] In an exemplary embodiment, the above-mentioned step S204, before storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train, specifically includes the following contents: generating a video stream acquisition request for the third candidate trackside camera based on the second position value of the third candidate trackside camera; sending the video stream acquisition request to the ground server, so that the ground server returns the video stream captured by the third candidate trackside camera according to the video stream acquisition request.
[0119] The video stream acquisition request refers to a request corresponding to obtaining the video stream captured by the third candidate trackside camera.
[0120] Exemplarily, the on-board device determines the current distance value between the third candidate trackside camera and the train based on the second position value of the third candidate trackside camera and the first position value of the train; then, the on-board device sorts the third candidate trackside cameras in ascending order according to the current distance value between the third candidate trackside camera and the train to obtain the sorted third candidate trackside cameras; then, the on-board device sequentially generates video stream acquisition requests for the sorted third candidate trackside cameras, and sequentially sends the video stream acquisition requests to the ground server; the ground server sequentially sends the video streams collected by the sorted third candidate trackside cameras to the on-board device according to the video stream acquisition requests.
[0121] In this embodiment, requests are accurately generated based on location values. After receiving the request, the ground server can quickly locate the corresponding camera, reducing the time for searching and screening cameras and returning the video stream more quickly, thereby improving the response speed of the entire system and enabling train-related personnel to obtain the required video information in a timely manner, which helps to make timely decisions.
[0122] In an exemplary embodiment, Figure 4 As shown, another method for playing train beyond-visual-range video streams is provided, which is applied to Figure 1 The vehicle-mounted device in the example is used to illustrate the process, including the following steps:
[0123] Step S401: Group the first candidate trackside cameras according to the first number to obtain multiple groups of candidate trackside cameras; determine the total distance values of the multiple groups of candidate trackside cameras based on the second position value; and determine the sliding window width value of the train based on the total distance values of the multiple groups of candidate trackside cameras.
[0124] Step S402: Summing the first position value and the beyond-visual-range advance configuration value to obtain the minimum sliding window value corresponding to the train; summing the first position value, the beyond-visual-range advance configuration value, and the sliding window width value to obtain the maximum sliding window value corresponding to the train; and determining the sliding window range based on the minimum sliding window value and the maximum sliding window value.
[0125] In step S403, based on the electronic map corresponding to the train, the second position value of the first candidate trackside camera of the line where the train is located is determined, and the candidate trackside cameras whose second position values are within the sliding window range are screened out from each first candidate trackside camera as the second candidate trackside camera.
[0126] Step S404: Filter out a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position value of the second candidate trackside camera.
[0127] Step S405: Generate a video stream acquisition request for the third candidate trackside camera based on the second position value of the third candidate trackside camera; send the video stream acquisition request to the ground server, so that the ground server returns the video stream captured by the third candidate trackside camera according to the video stream acquisition request.
[0128] Step S406: The video stream captured by the third candidate trackside camera is stored in the video cache corresponding to the train.
[0129] Step S407: Based on the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
[0130] In the above-mentioned method for playing the beyond-visual-range video stream of the train, during the process of playing the beyond-visual-range video stream of the train, the sliding window range is first determined according to the train position, the beyond-visual-range advance configuration value and the sliding window width value, and then the second candidate trackside camera within the sliding window range is screened out according to the electronic map, and then the first number of third candidate trackside cameras are screened out from the second candidate trackside cameras according to the second position value. This series of calculations and screenings can determine the candidate trackside cameras related to the train position in advance and store the video streams collected by them in the video cache. When the video stream of a certain trackside camera needs to be played, these video streams are already prepared in the video cache, and there is no need to temporarily pull the stream, avoiding the method of pulling the stream when switching is needed, which can easily cause the screen to flicker or go black for a short time, thereby causing the stability of the video stream playback to be low, which is conducive to improving the stability of the video stream playback.
[0131] In an exemplary embodiment, in order to more clearly illustrate the train beyond-visual-range video stream playback method provided by the embodiment of the present application, the train beyond-visual-range video stream playback method is specifically described below with a specific embodiment. In one embodiment, the present application also provides a train beyond-visual-range system video stream switching method. In the process of playing the train beyond-visual-range video stream, first, according to the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value, the sliding window range corresponding to the train is determined. Then, according to the electronic map corresponding to the train, the second position value of the first candidate trackside camera of the line where the train is located is determined, and from each first candidate trackside camera, the candidate trackside camera whose second position value is within the sliding window range is screened as the second candidate trackside camera. Then, according to the second position value of the second candidate trackside camera, a first number of third candidate trackside cameras are screened from the second candidate trackside cameras. Then, the video stream collected by the third candidate trackside camera is stored in the video cache corresponding to the train. Finally, according to the second position value of the third candidate trackside camera, a second number of target trackside cameras less than the first number are screened from the third candidate trackside cameras, and the video stream collected by the target trackside camera in the video cache is played. Specifically include the following:
[0132] The video stream request scheme is as follows:
[0133] 1. Electronic map design. Create a static electronic map based on the camera location information (CL, format: kilometer mark + offset, in meters) for all trackside cameras along the entire line. The data format is: {camera unique identifier, camera location information CL, URL (Uniform Resource Locator) of the ground video server corresponding to the camera}. Trackside camera information is stored in the electronic map in ascending order of kilometer mark.
[0134] 2. Over-the-horizon sliding window design. As Figure 3 shown, the in-vehicle host obtains the real-time train position RL (data format: {up / down line identification, timestamp, kilometer marker + offset (unit: meter)}) from the existing CTU equipment of the locomotive; then, starting from the real-time train position RL, adding the train over-the-horizon advance configuration LD (which is the configuration of how far ahead the train needs to see the line conditions, the project default is 2000, unit: meter), and adding a determined sliding window width WD (default 1000, unit: meter), to achieve the sliding window range SW (Slide Window) based on the train position RL = (RL + LD, RL + LD + WD) (the expression for the up line, and the down line is similar). The train RL information obtained by the in-vehicle host is also sent to the in-vehicle intelligent screen in real time. Special case: Before reaching the end point EP in the up line, when SW = EP (End Point, kilometer marker + maximum offset) - RL < LD + WD is true, it means the sliding window has reached the end.
[0135] Among them, the up line direction is defined as starting from the start point SP (Start Point, kilometer marker + offset = 0) and driving towards the end point EP, and the down line direction is defined as driving from the end point towards the start point.
[0136] Among them, SW is a range, and the mathematical expression for the up line direction is {SW_N, SW_F};
[0137] It should be noted that the above descriptions are all exemplified by the up line direction, and the description of the down line direction is similar.
[0138] 3. Camera video stream request cache design REQ_FIFO (Request First In First Out). REQ_FIFO is a first-in-first-out queue. During the train operation, the in-vehicle host triggers the query of the camera position information CL in the electronic map through the obtained RL. The specific trigger operation frequency: update the RL information once per second; the camera positions that meet the conditions in the current electronic map are called EML; the initial value of EML in the up line direction is SP + LD, and the initial value in the down line is EP - LD. If there is no matching camera at the initial EML position, then jump forward to the camera at the nearest position coordinate (see Figure 5 for the EML initialization operation: The initial value of EML is between C5 and C6, and then it jumps to C6. The actual initial value of EML is (2,123) of C6).
[0139] Among them, REQ_FIFO push operation. When uplink, if the push judgment condition SW_F ≥ EML is true, the current EML information is pushed into REQ_FIFO, and then EML is updated to the next camera position information; continue to judge whether the push judgment condition is met. If it is true, continue the above operation until all camera information in SW is pushed into REQ_FIFO.
[0140] Among them, REQ_FIFO pop-up operation. The in-vehicle smart screen is used to output pop-up enable.
[0141] The depth of the REQ-FIFO is designed to store the number of cameras within the sliding window at any line position where (SW_F - SW_N = WD) is true. In other words, the depth of the REQ-FIFO is designed to store the number of cameras within the most densely populated WD sliding window on the line.
[0142] 4. Design of sliding window interval WD: Based on the actual camera distribution, ensure that the number of cameras is no less than 5 when SW_F - SW_N = WD.
[0143] The video stream caching and video playback scheme is as follows:
[0144] 1. Functional Description of the On-board Smart Screen. The On-board Smart Screen communicates with the vehicle host in real time through client software. Currently, the On-board Smart Screen is designed as a quad-split screen, meaning that videos from four trackside cameras can be displayed simultaneously on the screen.
[0145] 2. Design of the in-vehicle smart screen client software (hereinafter referred to as the client software). The client software sets up a CMD-FIFO (Command First In First Out) with a depth of 5 to buffer requests sent to the ground video server. CMD_PUSH_CND is the CMD_FIFO push enable, and CMD_POP_CND is the pop enable. In addition, five independent video buffers VD_BUF0 to VD_BUF4 are set up.
[0146] 3. CMD-FIFO push operation: If CMD-FIFO is not full, the smart screen pushes the data popped out of REQ-FIFO into CMD-FIFO.
[0147] 4. Initialize the in-vehicle smart screen. During initialization, the CMD-FIFO is empty. Following the CMD-FIFO push operation guidelines, the system continuously requests five camera information entries from the REQ-FIFO. The camera position information popped out of the REQ-FIFO is then pushed into the CMD-FIFO. The camera's ground server URL is sent to the ground server. The returned video stream is then pushed into five independent video buffers, VD_BUF0 through VD_BUF4. Finally, VD_BUF0 through VD_BUF3 are played sequentially in the smart screen windows VD_BUF0 through VD_BUF3.
[0148] 5. CMD-FIFO Pop-up Operation. Taking the subsequent operations after the above initialization operation as an example, when the CMD-FIFO is full, the position of the first camera in the CMD_FIFO is recorded as CMD_FIFO_H. When RL + LD ≥ CMD_FIFO_H, the pop-up operation is executed. Special case: When the data in the CMD_FIFO is ≤ 4, CMD_POP_CND is forced to 0 to ensure that four video streams are playing at the end of the line, avoiding a black screen.
[0149] 6. Video stream switching operation. This section describes the subsequent operations after the initialization operation described above, which are synchronized with the CMD-FIFO pop-up operation CMD_POP_CND. When CMD_POP_CND is true, the video stream from VD_BUF4 is switched to smart screen window 0. Because VD_BUF4 already has a video cache and is playing in the background, switching to the front-end screen window is virtually flicker-free and black, ensuring a pleasant visual experience for the user. When CMD_POP_CND is true, the CMD-FIFO status becomes non-full, triggering the CMD-FIFO push operation. Subsequently, the new video is pushed into VD_BUF0, VD_BUF1, and so on.
[0150] In the above embodiment, during the playback of a train's beyond-visual-range video stream, a sliding window range is first determined based on the train's position, the beyond-visual-range lead configuration value, and the sliding window width. A second candidate trackside camera within the sliding window range is then screened based on an electronic map. A first number of third candidate trackside cameras are then screened from the second candidate trackside cameras based on the second position value. This series of calculations and screenings allows the candidate trackside cameras associated with the train's position to be determined in advance and their captured video streams to be stored in a video cache. When a specific trackside camera's video stream is needed, it is already prepared in the video cache, eliminating the need for temporary stream pulling. This avoids the need to pull streams when switching, which can easily cause short-term screen flickering or black screens, leading to lower video stream playback stability. This method is therefore beneficial for improving video stream playback stability. Furthermore, for long and narrow lines, the above method significantly improves search speed and reduces system resource consumption compared to conventional methods when a large number of cameras are present. The above-mentioned video stream pulling and caching solution pulls one video stream in advance as cache. When the smart screen client software needs to switch to a new camera video, the switching is almost seamless on the screen side, which is conducive to improving the user experience.
[0151] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0152] Based on the same inventive concept, embodiments of the present application also provide a train beyond-visual-range video stream playback device for implementing the aforementioned train beyond-visual-range video stream playback method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the train beyond-visual-range video stream playback device provided below can be found in the above-mentioned limitations of the train beyond-visual-range video stream playback method and will not be further elaborated here.
[0153] In an exemplary embodiment, Figure 6As shown, a device for playing a train beyond-visual-range video stream is provided, comprising: a range determination module 601, a first screening module 602, a second screening module 603, a video storage module 604, and a video playing module 605, wherein:
[0154] The range determination module 601 is used to determine the sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value.
[0155] The first screening module 602 is used to determine the second position value of the first candidate trackside camera of the train line based on the electronic map corresponding to the train, and to screen out the candidate trackside cameras whose second position values are within the sliding window range from each first candidate trackside camera as the second candidate trackside camera.
[0156] The second screening module 603 is configured to screen out a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras.
[0157] The video storage module 604 is used to store the video stream captured by the third candidate trackside camera into the video cache corresponding to the train.
[0158] The video playback module 605 is used to screen out a second number of target trackside cameras from the third candidate trackside cameras based on the second position value of the third candidate trackside camera, and play and process the video streams captured by the target trackside cameras in the video cache; the second number is smaller than the first number.
[0159] In an exemplary embodiment, the train beyond-visual-range video stream playback device also includes a video switching module for obtaining the updated position value of the train; determining the updated sliding window range corresponding to the train based on the updated position value, the beyond-visual-range advance configuration value and the sliding window width value; screening out the target trackside camera whose second position value is not within the updated sliding window range from each target trackside camera as the trackside camera to be replaced; generating a video stream replacement instruction for the trackside camera to be replaced, and switching the video stream collected by the trackside camera to be replaced according to the video stream replacement instruction.
[0160] In an exemplary embodiment, the video switching module is also used to obtain the number of videos in the video cache; when it is detected that the number of videos is greater than the second number, the video stream captured by the trackside camera to be replaced is switched to the video stream captured by the current trackside camera in accordance with the video stream replacement instruction; the current trackside camera is used to represent the trackside camera whose second position value is closest to the train among the fourth trackside cameras; the fourth trackside camera represents the trackside camera other than the target trackside camera among the third candidate trackside cameras; when it is detected that the number of videos is less than or equal to the second number, the video stream captured by the target trackside camera is kept playing.
[0161] In an exemplary embodiment, the train beyond-visual-range video stream playback device also includes a width determination module, which is used to group the first candidate trackside cameras according to a first number to obtain multiple groups of candidate trackside cameras; determine the total distance values of the multiple groups of candidate trackside cameras based on the second position value; and determine the sliding window width value of the train based on the total distance value of the multiple groups of candidate trackside cameras.
[0162] In an exemplary embodiment, the range determination module 601 is also used to sum the first position value and the beyond-visual-range advance configuration value to obtain the minimum sliding window value corresponding to the train; sum the first position value, the beyond-visual-range advance configuration value and the sliding window width value to obtain the maximum sliding window value corresponding to the train; and determine the sliding window range based on the minimum sliding window value and the maximum sliding window value.
[0163] In an exemplary embodiment, the train beyond-visual-range video stream playback device also includes a video acquisition module, which is used to generate a video stream acquisition request for the third candidate trackside camera based on the second position value of the third candidate trackside camera; and send the video stream acquisition request to the ground server, so that the ground server returns the video stream collected by the third candidate trackside camera according to the video stream acquisition request.
[0164] Each module in the above-mentioned train beyond-visual-range video stream playback device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0165] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the beyond-visual-range advance configuration value and the sliding window width value. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for playing beyond-visual-range video streams of a train is implemented.
[0166] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0167] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0168] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0169] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0170] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0171] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0172] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for playing a train beyond-visual-range video stream, characterized in that: The method comprises: Determining a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value; determining, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and selecting, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value falls within the sliding window as a second candidate trackside camera; Filtering a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras; Storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train; According to the second position value of the third candidate trackside camera, a second number of target trackside cameras are screened out from the third candidate trackside cameras, and the video streams captured by the target trackside cameras in the video cache are played and processed; the second number is smaller than the first number.
2. The method according to claim 1, characterized in that After selecting a second number of target trackside cameras from the third candidate trackside cameras according to the second position value of the third candidate trackside camera, and playing the video streams captured by the target trackside cameras in the video cache, the method further includes: Obtaining an updated position value of the train; Determining an updated sliding window range corresponding to the train according to the updated position value, the beyond-horizon lead configuration value, and the sliding window width value; Filtering out, from each of the target trackside cameras, a target trackside camera whose second position value is not within the updated sliding window range as the trackside camera to be replaced; Generate a video stream replacement instruction for the trackside camera to be replaced, and switch the video stream collected by the trackside camera to be replaced according to the video stream replacement instruction.
3. The method according to claim 2, characterized in that The step of switching the video stream captured by the trackside camera to be replaced according to the video stream replacement instruction includes: Obtain the number of videos in the video cache; When it is detected that the number of videos is greater than the second number, switching the video stream captured by the to-be-replaced trackside camera to the video stream captured by the current trackside camera in accordance with the video stream replacement instruction; the current trackside camera is used to represent the trackside camera whose second position value is closest to the train among the fourth trackside cameras; the fourth trackside camera represents the trackside camera among the third candidate trackside cameras, excluding the target trackside camera; When it is detected that the number of videos is less than or equal to the second number, the video stream captured by the target trackside camera is kept playing.
4. The method according to claim 1, wherein Before determining the sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value, the method further includes: grouping the first candidate trackside cameras according to the first number to obtain multiple groups of candidate trackside cameras; Determining a total distance value of the plurality of groups of candidate trackside cameras according to the second position value; The sliding window width value of the train is determined based on the total distance values of the multiple groups of candidate trackside cameras.
5. The method according to claim 1, wherein The determining, based on the first position value of the train, the beyond-visual-range advance configuration value, and the sliding window width value, of a sliding window range corresponding to the train includes: Summing the first position value and the beyond-horizon advance configuration value to obtain a sliding window minimum value corresponding to the train; Summing the first position value, the beyond-horizon advance configuration value, and the sliding window width value to obtain a sliding window maximum value corresponding to the train; The sliding window range is determined according to the sliding window minimum value and the sliding window maximum value.
6. The method according to any one of claims 1 to 5, characterized in that Before storing the video stream captured by the third candidate trackside camera in the video cache corresponding to the train, the method further includes: generating a video stream acquisition request for the third candidate trackside camera according to the second position value of the third candidate trackside camera; The video stream acquisition request is sent to the ground server, so that the ground server returns the video stream captured by the third candidate trackside camera according to the video stream acquisition request.
7. A train beyond-visual-range video stream playback device, characterized in that: The device comprises: A range determination module is used to determine a sliding window range corresponding to the train according to the first position value of the train, the beyond-visual-range advance configuration value and the sliding window width value; a first screening module, configured to determine, based on an electronic map corresponding to the train, a second position value of a first candidate trackside camera for the line on which the train is located, and screen out, from each of the first candidate trackside cameras, a candidate trackside camera whose second position value is within the sliding window range as a second candidate trackside camera; a second screening module, configured to screen out a first number of third candidate trackside cameras from the second candidate trackside cameras according to the second position values of the second candidate trackside cameras; a video storage module, configured to store the video stream captured by the third candidate trackside camera into a video cache corresponding to the train; A video playback module is used to screen out a second number of target trackside cameras from the third candidate trackside cameras according to the second position value of the third candidate trackside camera, and to play and process the video streams captured by the target trackside cameras in the video cache; the second number is smaller than the first number.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.