A video stream transmission method, device and storage medium in a video surveillance system

By introducing a connection instruction mechanism between the backup access device and the processing device in the video surveillance system, the problem that the video surveillance system cannot receive and process video streams during failure is solved, and the integrity of the video stream and the continuity of the user experience are achieved. sex.

CN119052432BActive Publication Date: 2025-02-11CRSC COMM & INFORMATION GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411533542.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-11
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

The video surveillance system is unable to receive and process video streams during processing failures, resulting in incomplete video streams received and processed, affecting the completion of video surveillance tasks and user experience.

Method used

Provide a video streaming method in a video surveillance system, through a backup access device, continuously receives a video stream when the access device fails, and sends a video stream according to the connection command sent by the processing device, so that the processing device can receive a complete video The stream is processed.

Benefits of technology

Ensure the integrity of video surveillance tasks and the continuity of user experience, and avoid interruptions in video streaming caused by failures and user-perceived preview or video recording.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052432B_ABST
    Figure CN119052432B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of video surveillance technology, and discloses a video stream transmission method, device and storage medium in a video surveillance system. A standby access device can continuously receive a video stream during a failure of the access device, and send the video stream to the processing device according to a first connection instruction sent by the processing device, so that the processing device can receive the complete video stream and perform data processing, thereby avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video surveillance technology, and in particular to a video stream transmission method, device and storage medium in a video surveillance system. Background Art

[0002] The role of video surveillance systems in transportation command and production operations is becoming increasingly prominent, and the requirements for the functions and performance of video surveillance systems are becoming more and more stringent.

[0003] The video surveillance system can communicate with the camera, continuously receive the video stream sent by the camera, and process the video stream sent by the camera to complete the video surveillance task. When a video surveillance system fails and cannot receive the video stream sent by the camera, the failure can be handled in a short time, and the video surveillance system can continue to receive and process the video stream sent by the camera after the failure is handled.

[0004] However, the video surveillance system cannot receive and process the video stream during the fault processing, resulting in incomplete video streams received and processed, which may affect the completion of the video surveillance task and affect the user experience. For example, when a user views real-time monitoring in the video surveillance system, the video surveillance system can create a communication link between the camera and the user terminal, and continuously send the video stream captured by the camera to the user terminal through the communication link so that the user can view the real-time monitoring. When the communication link fails, the reception and transmission of the video stream will be interrupted. At this time, the video surveillance system can continue to send the video stream captured by the camera to the user terminal through the new communication link after building a new communication link. However, the video surveillance system cannot receive and transmit the video stream during the construction of the new communication link, resulting in the user being unable to view the surveillance video during this period, which may cause the user to perceive the video interruption, affecting the user experience. Summary of the invention

[0005] The present invention provides a video stream transmission method, device and storage medium in a video surveillance system, which are used to solve the defect in the related art that the video surveillance system cannot receive and process the video stream during the processing of a fault, resulting in incomplete received and processed video streams, which may affect the completion of the video surveillance task and affect the user experience. The standby access device can continue to receive the video stream during the access device is in a fault period, and send the video stream to the processing device according to the first connection instruction sent by the processing device, so that the processing device can receive the complete video stream and perform data processing, thereby avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience.

[0006] In a first aspect, the present invention provides a video stream transmission method in a video surveillance system, wherein the system includes an access device, a backup access device, and a processing device; the method includes:

[0007] The standby access device analyzes the video stream continuously sent by the camera device to obtain multiple picture frames in sequence, and caches the latest N picture groups; wherein the multiple picture frames include multiple picture groups arranged in sequence, each of the picture groups includes a first key frame and at least one predicted frame arranged in sequence, the at least one predicted frame includes each of the picture frames located after the first key frame and before a second key frame, and the second key frame is a key frame after the first key frame; N is an integer not less than 1;

[0008] The standby access device determines that any of the obtained picture frames is a key frame, generates a corresponding hash value according to a preset hash algorithm and the picture frame and uses it as a picture group identifier, records the order in which the picture frame and the picture frames in the same group are obtained from a preset initial order to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creates frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group;

[0009] The standby access device receives a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to the preset hash algorithm and the target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device;

[0010] The backup access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value in the first connection instruction, the target acquisition order and the frame information, and sends the video stream to the processing device to continue data processing starting from the next picture frame.

[0011] Optionally, before caching the latest acquired N picture groups, the method further includes:

[0012] The standby access device determines the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group; wherein the switching duration is the time required for the processing device to successfully switch to the standby access device after determining that the access device has failed;

[0013] The standby access device inputs the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group into a preset model for calculation, obtains an output value of the preset model, determines an integer that is not less than the output value and is closest to the output value, and uses it as N;

[0014] Wherein, the preset model is:

[0015] ;

[0016] is the variable corresponding to the output value, is the variable corresponding to the switching duration, is the variable corresponding to the maximum frame transmission delay, is the variable corresponding to the picture frame transmission rate, is a variable corresponding to the number of picture frames.

[0017] Optionally, when the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and is disconnected from the access device during forwarding of the video stream received through the access device to a downstream device;

[0018] The step of sending the video stream to the processing device for continuing data processing starting from the next picture frame includes:

[0019] The standby access device sends the video stream to the distribution device starting from the next picture frame of the target picture frame, so that the distribution device continues to forward the received video stream to the downstream device.

[0020] Optionally, when the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and is disconnected from the access device during the storage of the video stream received through the access device;

[0021] The step of sending the video stream to the processing device for continuing data processing starting from the next picture frame includes:

[0022] The standby access device sends the video stream to the storage device starting from the next picture frame of the target picture frame, so that the storage device continues to store the received video stream.

[0023] Optionally, when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, the first connection instruction is generated and is set to:

[0024] When the processing device obtains the first key frame in the video stream received by the access device and has processed the first key frame, the processing device generates a corresponding first hash value according to the preset hash algorithm and the first key frame, determines a first acquisition order of the first key frame in the corresponding picture group, and saves the first hash value and the first acquisition order into a preset information recording table;

[0025] When the processing device obtains a new key frame in the video stream received by the access device and has processed the new key frame, the processing device generates a corresponding new hash value according to the preset hash algorithm and the new key frame, replaces the hash value currently saved in the information recording table with the new hash value and saves it; and, when a new picture frame is obtained in the video stream received by the access device and has processed the new picture frame, determines a new order of acquisition of the new picture frame in the corresponding picture group, replaces the currently saved order of acquisition in the information recording table with the new order of acquisition, and saves it;

[0026] During data processing of the video stream received by the access device by the processing device, when it is determined that the access device fails and is disconnected from the access device, the hash value and the acquisition order currently stored in the information record table are used as the target hash value and the target acquisition order respectively;

[0027] The processing device generates a first connection instruction including the target hash value and the order in which the targets are acquired.

[0028] Optionally, the system further includes a standby processing device and a service monitoring device; after sending the video stream to the processing device for continuing data processing starting from the next picture frame, the method further includes:

[0029] The standby access device stops sending the video stream to the processing device in response to a stop instruction sent by the service monitoring device; wherein the stop instruction is generated by the service monitoring device when determining that the processing device fails according to a status message sent by the processing device;

[0030] The standby access device receives a second connection instruction sent by the standby processing device; wherein the second connection instruction is generated by the standby processing device in response to a startup instruction sent by the service monitoring device, according to the hash value currently stored in the information recording table and the order in which it is obtained; the startup instruction is generated by the service monitoring device when it is determined that the processing device has a fault according to a status message sent by the processing device;

[0031] The backup access device sends the video stream to the backup processing device to continue data processing according to the second connection instruction.

[0032] In a second aspect, the present invention provides a video stream transmission device in a video surveillance system, the system comprising an access device, a backup access device and a processing device; the video stream transmission device is applied to the backup access device;

[0033] The video stream transmission device comprises:

[0034] A parsing unit, configured to parse a video stream continuously sent by a camera device to sequentially obtain a plurality of picture frames; wherein the plurality of picture frames include a plurality of picture groups arranged sequentially, each of the picture groups includes a first key frame and at least one predicted frame arranged sequentially, the at least one predicted frame includes each of the picture frames located after the first key frame and before a second key frame, the second key frame being a key frame subsequent to the first key frame; and N is an integer not less than 1;

[0035] A cache unit, used to cache the latest N picture groups;

[0036] a creating unit, for determining that any of the obtained picture frames is a key frame, generating a corresponding hash value according to a preset hash algorithm and the picture frame and using the hash value as a picture group identifier, recording the order in which the picture frame and the picture frames in the same group are obtained starting from a preset initial order to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creating frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group;

[0037] A first receiving unit is configured to receive a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to the preset hash algorithm and the target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, and the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device;

[0038] A first determining unit, configured to determine a next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value in the first connection instruction, the target acquisition order and the frame information;

[0039] The first sending unit is used to send the video stream to the processing device to continue data processing starting from the next picture frame.

[0040] Optionally, when the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and is disconnected from the access device during forwarding of the video stream received through the access device to a downstream device;

[0041] The first sending unit is further used for:

[0042] Starting from the next picture frame of the target picture frame, the video stream is sent to the distribution device, so that the distribution device continues to forward the received video stream to the downstream device.

[0043] Optionally, when the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and is disconnected from the access device during the storage of the video stream received through the access device;

[0044] The first sending unit is further used for:

[0045] Starting from the next picture frame of the target picture frame, the video stream is sent to the storage device, so that the storage device continues to store the received video stream.

[0046] In a third aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the video stream transmission method in a video surveillance system in the first aspect or any corresponding embodiment thereof.

[0047] The video stream transmission method, device and storage medium in the video surveillance system provided by the present invention include an access device, a standby access device and a processing device in the video surveillance system. The standby access device can parse the video stream continuously sent by the camera device to obtain multiple picture frames in sequence, and cache the latest N picture groups, create frame information of each picture frame, and the frame information of the picture frame includes the corresponding picture group identifier and the order in which the picture frame is obtained in the corresponding picture group. The standby access device receives the first connection instruction sent by the processing device, and the first connection instruction is generated when the processing device determines that the access device fails and disconnects from the access device during data processing of the video stream received by the access device. The standby access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the first connection instruction. The target picture frame is the latest picture frame obtained and processed by the processing device according to the video stream before the processing device determines that the access device fails and disconnects from the access device. The standby access device sends the video stream to the processing device from the next picture frame to continue data processing. The backup access device can continue to receive the video stream during the period when the access device is in a failure, and send the video stream to the processing device according to the first connection instruction sent by the processing device, so that the processing device can receive the complete video stream and perform data processing, avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A flowchart of a video stream transmission method in a video surveillance system provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of the structure of a video stream provided by an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of the structure of multiple pieces of frame information provided by an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of the structure of an information recording table provided by an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of the structure of another information recording table provided by an embodiment of the present invention;

[0054] Figure 6A schematic diagram of distributing picture groups provided by an embodiment of the present invention;

[0055] Figure 7 A schematic diagram of the structure of a video stream transmission device in a video surveillance system provided by an embodiment of the present invention;

[0056] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] Combine the following Figure 1-Figure 6 The video stream transmission method in the video monitoring system of the present invention is described.

[0059] like Figure 1 As shown, this embodiment proposes a first video stream transmission method in a video surveillance system, the system includes an access device, a backup access device and a processing device. The method may include the following steps:

[0060] S101, the standby access device analyzes the video stream continuously sent by the camera device to obtain multiple picture frames in sequence. The multiple picture frames include multiple picture groups arranged in sequence, each picture group includes a first key frame and at least one predicted frame arranged in sequence, and the at least one predicted frame includes each picture frame located after the first key frame and before the second key frame, and the second key frame is the key frame after the first key frame.

[0061] Optionally, the video monitoring system may be a video monitoring system used in transportation command, public security protection, production operation or security monitoring. For example, the video monitoring system may be a railway integrated video monitoring system.

[0062] The performance of the access device and the backup access device may be the same. The access device and the backup access device are both connected to the camera device for communication and synchronously receive the video stream continuously sent by the camera device. The access device may forward the video stream continuously sent by the camera device to the processing device in real time. The backup access device may replace the access device and transmit the video stream sent by the camera device to the processing device when the access device fails.

[0063] Specifically, the key frames and predicted frames in a group of pictures (GOP) are all picture frames, and the first picture frame in a group of pictures is a key frame. A video sequence, i.e., a video stream, may include multiple GOPs arranged in sequence, and each GOP has one key frame, i.e., an I frame, and other non-key frames arranged in sequence. Non-key frames are predicted frames, which may be P frames (forward prediction frames) or B frames (bidirectional interpolation frames).

[0064] like Figure 2 As shown, when the video surveillance system is a railway integrated video surveillance system, each GOP in the video sequence, i.e., the video stream, can be composed of 1 I frame and 49 P frames thereafter, corresponding to a 2-second video stream. It should be noted that in the railway integrated video surveillance system, the programs for processing video streams are divided into video access, video storage, and video forwarding programs. When a user views a video, the program in the system creates a communication link after signaling negotiation, which is used for storage or forwarding of the video stream. During the user's viewing process, once a program on this communication link fails or needs to be restarted and upgraded, the link will be interrupted, and a new link needs to be renegotiated to establish. The user terminal will inevitably be affected by the temporary failure to receive data. The characteristic of a video sequence is that the correct decoding of a P frame in a GOP depends on the previous I frame and P frame. Once the data is lost, the data after this GOP may not be correctly decoded and viewed, and the recovery can only start from the receipt of the next I frame.

[0065] Specifically, the processing device may receive the video stream forwarded by the access device or the standby access device, and perform corresponding processing on the video stream, such as storing the video stream or forwarding the video stream to the user terminal.

[0066] Specifically, the processing device may first receive the video stream forwarded by the access device. When the access device fails and cannot continue to forward the video stream to the processing device, the processing device may switch to the backup access device to receive the video stream forwarded by the backup access device.

[0067] S102: The standby access device caches the most recently acquired N picture groups, where N is an integer not less than 1.

[0068] It should be noted that when the processing device determines that the access device has failed, it will disconnect from the access device, and the processing device will no longer receive the video stream forwarded by the access device. The process of the processing device switching to the backup access device to receive the video stream requires a certain switching time. If the backup access device only forwards the video stream sent by the camera device to the processing device in real time, the processing device will miss the video stream sent by the camera device within the aforementioned switching time. The backup access device of this embodiment can save the video stream within the aforementioned switching time, so that when sending the video stream to the processing device, it starts sending it to the processing device from the video stream within the aforementioned switching time, so that the processing device can obtain the complete video stream.

[0069] Specifically, the standby access device can parse the received video stream, extract multiple picture frames carried in the video stream in sequence, and cache the latest extracted N picture groups, that is, only store the latest extracted N picture groups, and do not store other picture groups.

[0070] It is understandable that the size of N needs to ensure that the standby access device stores the video stream within the aforementioned switching duration. In this embodiment, the technical personnel can set N according to the actual situation to ensure that when the standby access device sends the video stream to the processing device, it can start sending the video stream within the aforementioned switching duration to the processing device, thereby ensuring that the processing device can obtain the complete video stream, avoid affecting the completion of the video monitoring task, and avoid affecting the user experience.

[0071] S103, the standby access device determines that any obtained picture frame is a key frame, generates a corresponding hash value according to a preset hash algorithm and the picture frame and uses it as a picture group identifier, records the acquisition order of the picture frame and the picture frames in the same group starting from a preset initial order to obtain the acquisition order of the picture frame and the picture frames in the same group in the corresponding picture group, and creates frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the acquisition order of the picture frame in the corresponding picture group.

[0072] The preset initial order may be set by a technician according to actual conditions, for example, it may be set to 0 or 1, and this embodiment does not limit this.

[0073] Wherein, the same group of picture frames may include other picture frames in the same picture group as the key frame. It is understandable that the same group of picture frames may include each picture frame in the picture group that is located after the key frame, that is, each predicted frame in the picture group. For example, when a picture group includes key frame A, predicted frame B, predicted frame C and predicted frame D, the same group of picture frames may include predicted frames B, C and D in the same picture group as the key frame A.

[0074] Specifically, the standby access device can determine whether any picture frame is a key frame. If it is a key frame, the preset hash algorithm can be used to process the picture frame to generate a corresponding hash value, and the hash value is used as the identifier of the corresponding picture group, that is, the picture group identifier. The standby access device can record the order in which the picture frame and the picture frames in the same group are obtained from the preset initial order, thereby recording the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group. If the picture frame is not a key frame, this embodiment continues to record the order in which the picture frame is obtained in the corresponding picture group from the current recorded order.

[0075] It is understandable that the standby access device can record the order in which each picture frame is obtained in the corresponding picture group. The standby access device can also create frame information of each picture frame. The frame information of any picture frame can include the picture group identifier of the picture group in which the picture frame is located, and the order in which the picture frame is obtained in the corresponding picture group. Among them, the frame information of the picture frames in the same group can include the frame information of each picture frame located after the key frame in the picture group.

[0076] It can be understood that the picture group identifier and the acquisition order carried in the frame information of the picture frame can realize the unique identification of the picture frame.

[0077] Optionally, the standby access device may also record information such as the video stream ID, the time when the picture frame is received, and the original data of the picture frame in the frame information. Figure 3 The multiple frame information shown in Figure 3 The GOP HASH in the image is the picture group identifier. Figure 3 The time in is the time information when the picture frame is received, which can be used to identify the receiving moment of the picture frame. The sequence number is the order in which the picture frame is obtained in the corresponding picture group (sequence number 0 indicates that the picture frame is first in the corresponding picture group, sequence number 1 indicates that the picture frame is second in the corresponding picture group, and so on). The data is the original data of the picture frame.

[0078] S104. The standby access device receives a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to a preset hash algorithm and a target key frame, the target acquisition order is the order in which the target picture frame is acquired in the corresponding picture group, and the target key frame and the target picture frame are, respectively, the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before the processing device is disconnected from the access device.

[0079] Specifically, when the processing device determines that the access device has failed, it can disconnect the communication connection with the access device, and determine the latest key frame and the latest picture frame received from the access device and processed (for example, stored or forwarded to the user terminal) before disconnecting the connection with the access device, and use a preset hash algorithm to process the latest key frame to generate a corresponding hash value, i.e., a target hash value, and determine the order in which the latest picture frame is acquired in the corresponding picture group, i.e., the target acquisition order.

[0080] It is understandable that the processing device may also generate a corresponding hash value according to the new key frame each time it receives and processes a new key frame, or each time it receives and processes a new picture frame, and determine the order in which the picture frame of the new key frame is obtained in the corresponding picture group, and save the hash value and the order in which the picture frame is obtained. Of course, the processing device may also only save the hash value corresponding to the latest key frame and the order in which the latest picture frame is obtained in the corresponding picture group, without saving the hash values ​​corresponding to other key frames and the order in which other picture frames are obtained in the corresponding picture group.

[0081] Specifically, the processing device may generate a first connection instruction according to the target hash value and the order in which the targets are acquired, and send the first connection instruction to the standby access device.

[0082] S105 . The standby access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value, the target acquisition order and the frame information in the first connection instruction.

[0083] Specifically, the standby access device can extract the target hash value and the target acquisition order from the first connection instruction, determine the matching frame information according to the target hash value and the target acquisition order, and determine the next frame information of the frame information, that is, the frame information of the next picture frame of the picture frame corresponding to the frame information. Afterwards, this embodiment can determine the corresponding picture frame among all the picture frames of the N picture groups currently cached according to the next frame information, that is, the next picture frame of the target picture frame in the video stream.

[0084] S106: The standby access device sends the video stream to the processing device to continue data processing starting from the next picture frame.

[0085] Specifically, the standby access device may forward the video stream to the processing device starting from the next picture frame of the target picture frame in the video stream, that is, forward the subsequent picture frames of the target picture frame in the video stream to the processing device.

[0086] The video stream transmission method in the video surveillance system proposed in this embodiment includes an access device, a standby access device and a processing device in the video surveillance system. The standby access device can parse the video stream continuously sent by the camera device to obtain multiple picture frames in sequence, and cache the latest N picture groups, create frame information for each picture frame, and the frame information of the picture frame includes the corresponding picture group identifier and the order in which the picture frame is obtained in the corresponding picture group. The standby access device receives the first connection instruction sent by the processing device, and the first connection instruction is generated when the processing device determines that the access device fails and disconnects from the access device during data processing of the video stream received through the access device. The standby access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the first connection instruction. The target picture frame is the latest picture frame obtained and processed by the processing device according to the video stream before the processing device determines that the access device fails and disconnects from the access device. The standby access device sends the video stream to the processing device from the next picture frame to continue data processing. The backup access device can continue to receive the video stream during the period when the access device is in a failure, and send the video stream to the processing device according to the first connection instruction sent by the processing device, so that the processing device can receive the complete video stream and perform data processing, avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience.

[0087] It should be noted that among the related technologies, the railway integrated video surveillance system has important use value in the field of railway transportation. The system has achieved large-scale network coverage of work areas, stations, railway bureaus / companies, and the Railway Corporation along the railway. With the development of railway transportation, the role of video surveillance systems in transportation command, public security protection, production operations, and safety monitoring has become increasingly prominent, and the pressure on railway business to call on integrated video surveillance systems has also increased. Therefore, the railway's requirements for the functions and performance of video surveillance systems have become increasingly stringent.

[0088] In the currently running railway integrated video surveillance system, with the use of cloud computing technology, the system stability has been greatly improved. Due to the characteristics of the video system, after a failure of the background service program, the system will automatically recover, but there will still be a short-term interruption of the video stream, which will make the user perceive the interruption of preview and recording, affecting the user experience and related services. In addition, normal system software upgrades and maintenance will also cause real-time preview and recording interruptions, so upgrades and maintenance need to be performed at night, which also causes inconvenience to maintenance personnel. Specifically, in the current railway integrated video surveillance system, single-point access is adopted, and single-point forwarding is performed between background service programs. When watching the video from the core node, there is a unique route from the core node to the camera under the access node. In such a software architecture, when a program has a problem, even if it recovers quickly, it is still necessary to re-establish the link, and the continuity of the video data will inevitably be destroyed, resulting in an interruption of the upper-level video preview. This embodiment is achieved by Figure 1 The method shown takes into account system-related interfaces, cloud computing and other technologies to improve system stability and solve the problems of real-time preview and recording interruptions caused by program instability or upgrades in the railway integrated video surveillance system. When individual service programs fail or are upgraded or maintained, the user will not be aware of the problem, thus ensuring user experience.

[0089] based on Figure 1 This embodiment proposes a second video stream transmission method in a video surveillance system. Before caching the latest N picture groups, the method includes:

[0090] The standby access device determines the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames contained in the picture group; wherein the switching duration is the duration that the processing device needs to spend to successfully switch to the standby access device after determining that the access device has failed;

[0091] The standby access device determines N according to the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group.

[0092] Specifically, this embodiment can determine the value of N based on the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group, so as to reduce the number of caches for the picture group as much as possible while ensuring the transmission of the complete video stream to the processing device, reduce the consumption of cache resources, and improve the utilization of cache resources.

[0093] In practical applications, in video transmission, the video stream transmission rate must be greater than the video bit rate, otherwise it cannot be watched in real time, and the video stream transmission rate will not have a large delay on the video. For example, for a video stream with a key frame every 2 seconds, 25 frames per second, and a bit rate of 4Mb / s, the transmission speed must be greater than 4Mb / s, and the average delay per frame cannot exceed 40 milliseconds (25 frames per second). Specifically, due to the different sizes of each frame, the key frame has a larger data volume, so the delay will be slightly larger.

[0094] Optionally, the standby access device determines N according to the switching duration, the maximum frame transmission delay, the picture frame transmission rate, and the number of picture frames included in the picture group, including:

[0095] The standby access device inputs the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group into a preset model for calculation, obtains an output value of the preset model, determines an integer that is not less than the output value and is closest to the output value, and uses it as N;

[0096] Among them, the preset model is:

[0097] ;

[0098] is the variable corresponding to the output value, is the variable corresponding to the switching duration, is the variable corresponding to the maximum frame transmission delay, is the variable corresponding to the picture frame transmission rate, A variable corresponding to the number of picture frames.

[0099] Specifically, in this embodiment, the switching duration, the maximum frame transmission delay, the picture frame transmission rate, and the number of picture frames contained in the picture group can be input into a preset model for calculation to obtain a corresponding output value, and the integer closest to the output value and not less than the output value is determined, and the integer is used as N.

[0100] The video stream transmission method in the video surveillance system proposed in this embodiment can determine N based on the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames contained in the picture group. While effectively ensuring the transmission of the complete video stream to the processing device, it can reduce the consumption of video stream cache resources in the backup access device and improve the utilization rate of cache resources.

[0101] based on Figure 1 , This embodiment proposes a third video stream transmission method in a video surveillance system, and the processing device is a storage device or a distribution device.

[0102] Optionally, when the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and disconnects from the access device during the process of forwarding the video stream received through the access device to the downstream device. In this case, starting from the next picture frame, the video stream is sent to the processing device to continue data processing, including:

[0103] The standby access device sends the video stream to the distribution device starting from the next picture frame of the target picture frame, so that the distribution device continues to forward the received video stream to the downstream device.

[0104] Specifically, when the processing device is a distribution device, this embodiment can continuously forward and completely forward the video stream captured by the camera device to the user terminal through the setting of the access device, the backup access device and the distribution device, thereby meeting the user's demand for viewing real-time monitoring and avoiding the user's perception of video interruption and affecting the user experience.

[0105] Optionally, for any picture group in the received video stream, the distribution device may split each picture frame in the picture group into multiple Realtime Transport Protocol (RTP) packets, and send the multiple RTP packets corresponding to each picture frame to the downstream device.

[0106] Optionally, when the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and disconnects from the access device during the storage of the video stream received through the access device. In this case, starting from the next picture frame, the video stream is sent to the processing device to continue data processing, including:

[0107] The standby access device sends the video stream to the storage device starting from the next picture frame of the target picture frame, so that the storage device continues to store the received video stream.

[0108] The downstream device may be a user terminal, or a downstream device with heavy related video surveillance tasks.

[0109] Optionally, when the processing device is a storage device, a distribution device may also be provided in the video surveillance system of this embodiment. In this case, the storage device may store the complete video stream sent by the access device or the backup access device, and may send the stored video stream to the downstream device through the distribution device.

[0110] Specifically, when the processing device is a storage device, this embodiment sends the video stream captured by the camera device to the storage device for storage in its entirety through the setting of the access device, the backup access device and the storage device. When the user needs to view historical monitoring, it can meet the user's need to view historical monitoring and avoid the user's perception of video interruption and affecting the user experience.

[0111] The video stream transmission method in the video surveillance system proposed in this embodiment can effectively realize the full storage of the video stream sent by the camera device, and can also realize the real-time forwarding of the video stream of the camera device to the user terminal, so that the user can view historical video surveillance or real-time video surveillance, and when the access device fails, the backup access device can be enabled to work, avoiding the user from perceiving the video interruption during the video surveillance process, thereby ensuring the user experience and enhancing the user stickiness.

[0112] This embodiment provides a fourth video stream transmission method in a video surveillance system. During data processing of a video stream received by an access device, when the processing device determines that the access device fails and is disconnected from the access device, a first connection instruction is generated, which is set to:

[0113] The processing device obtains the first key frame in the video stream received by the access device and has processed the first key frame, generates a corresponding first hash value according to a preset hash algorithm and the first key frame, determines a first acquisition order of the first key frame in the corresponding picture group, and saves the first hash value and the first acquisition order in a preset information recording table;

[0114] The processing device obtains a new key frame in the video stream received by the access device and has processed the new key frame, generates a corresponding new hash value according to the preset hash algorithm and the new key frame, replaces the hash value currently stored in the information recording table with the new hash value and saves it; and obtains a new picture frame in the video stream received by the access device and processes the new picture frame, determines a new acquisition order of the new picture frame in the corresponding picture group, replaces the currently stored acquisition order in the information recording table with the new acquisition order, and saves it;

[0115] During data processing of the video stream received by the access device by the processing device, when it is determined that the access device fails and is disconnected from the access device, the hash value and the acquisition order currently stored in the information record table are used as the target hash value and the target acquisition order respectively;

[0116] The processing device generates a first connection instruction including a target hash value and an order in which the targets are to be acquired.

[0117] Specifically, the processing device can save and update the identification information of the latest key frame and the latest picture frame in the information recording table, and record in real time the identification information of the latest key frame and the latest picture frame that have been acquired and processed, that is, the hash value corresponding to the latest key frame and the order in which the latest picture frame is acquired in the corresponding picture group, so that when the access device fails, the identification information can be sent to the backup access device, so that the backup access device can continue to send subsequent picture frames to the processing device from the point where the video stream is interrupted, thereby ensuring the integrity of the video stream received by the processing device.

[0118] Specifically, when the processing device is a storage device, the storage device can start a storage task when it starts receiving the video stream, and create a storage session, i.e., an information record table, in which the hash value of the latest key frame received by the storage device and the order in which the latest picture frame is obtained are saved and updated. The information record table can also record information such as the storage task session ID and the video stream ID. Figure 4 The information record table shown can save the storage task session ID, video stream ID and device identification of all access devices (i.e., access programs), and can also save the stored data frame GOP HASA (i.e., the hash value of the latest key frame received and stored by the storage device), the stored data frame timestamp (i.e., the timestamp of the latest key frame stored), the stored data frame sequence number (i.e., the order in which the latest picture frame received and stored by the storage device is obtained in the corresponding GOP) and the last storage time (i.e., the timestamp of the latest picture frame stored).

[0119] Optionally, when the processing device is a storage device, the storage device can obtain the addresses of all access programs, that is, all access devices, when starting the storage task, that is, when starting to receive the video stream, select the access program to obtain the stream, obtain the video stream, and determine whether the video stream has timed out. If it is determined that it has not timed out, the video stream is stored and the video stream continues to be received. If it is determined that the video stream has timed out, that is, the video stream sent by the access device is not received within a certain period of time, other access devices, that is, backup access devices, are selected to obtain the stream.

[0120] Specifically, when the storage device stores the video stream, it needs to update the storage session, i.e., the time, sequence number, GOP HASH and other information of the video frame in the first record information table. When switching to the backup access device, the HASH value, timestamp and frame sequence number of the last complete video frame received can be sent to the backup access device. The backup access device can find the next frame to be sent based on the information and send the stream to the storage device. The storage device needs to ensure the integrity of each stored video frame.

[0121] Specifically, there can be multiple distribution devices. Multiple distribution devices can jointly complete a sub-forwarding session, and they share the same task synchronization block, that is, create a jointly maintained information record table. At this time, the information record table can also include information such as the sub-forwarding task session ID, task connection information, and the current working distribution device identifier. Figure 5 The information record table shown includes the sub-forwarding task session ID, video stream ID, task connection information, all sub-forwarding program IDs (i.e., the device identification of all distribution devices), the current working sub-forwarding program ID (i.e., the device identification of the currently working distribution device), the sent data frame GOP HASH (i.e., the hash value of the latest key frame sent by the distribution device to the downstream device), the sent data frame timestamp (i.e., the sending timestamp of the latest key frame), the sent data frame sequence number (i.e., the order in which the latest picture frame sent by the distribution device to the downstream device is obtained in the corresponding GOP), the sent data frame RTP sequence number (i.e., the order of the latest sent RTP in the corresponding picture frame) and the sent data frame RTP timestamp (i.e., the sending timestamp of the latest RPT).

[0122] The distribution device can work in three modes: User Datagram Protocol (UDP), Transmission Control Protocol (TCP) active, and TCP passive. Depending on the working mode, the distribution device adopts different strategies. For UDP and TCP active modes, the competition strategy mode is used, that is, once the work of the forwarding work times out, other distribution devices automatically enter the competition mode. Distributed lock technology can be used here to ensure that only one distribution device obtains the authority, and the distribution device that obtains the authority immediately enters the forwarding state to provide external streaming. When using the forwarding TCP passive mode, because the terminal or the upper-level streaming media service actively initiates the connection, the distribution device immediately enters the working state when it monitors the establishment of the connection.

[0123] Optionally, when starting the sub-forwarding task, the distribution device can obtain the addresses of all access programs, i.e., access devices, and determine whether it has the authority and status to obtain the task. If it does not have the authority, it can wait and update the address of the access device. After obtaining the authority, it can select the access device to obtain the stream, obtain the video stream, and determine whether the video stream has timed out. If it has timed out, it can reselect the access device to obtain the stream. If it has not timed out, it can determine whether it has the sub-forwarding authority. If not, it can re-obtain the address of the access device. If it has the authority, it can sub-forward the video stream, update the sub-forwarding task status, update the task authority timeout, and continue to receive the video stream.

[0124] Optionally, the system further includes a backup processing device and a service monitoring device. After sending the video stream to the processing device for further data processing starting from the next picture frame, the method further includes:

[0125] The standby access device stops sending the video stream to the processing device in response to the stop instruction sent by the service monitoring device; wherein the stop instruction is generated when the service monitoring device determines that the processing device fails according to the status message sent by the processing device;

[0126] The standby access device receives a second connection instruction sent by the standby processing device; wherein the second connection instruction is generated by the standby processing device in response to the startup instruction sent by the service monitoring device, according to the hash value currently stored in the information recording table and the order in which it is obtained; the startup instruction is generated by the service monitoring device when it determines that the processing device has failed according to the status message sent by the processing device;

[0127] The standby access device sends the video stream to the standby processing device to continue data processing according to the second connection instruction.

[0128] Specifically, this embodiment can set up a backup processing device. When the processing device fails and cannot continue to process the video stream, the backup processing device is started to continue to receive and process the video stream to ensure that the complete video stream is processed, such as storing and forwarding to the user terminal, to ensure the normal implementation of the video surveillance task, and to ensure the user experience.

[0129] The second connection instruction may include the hash value and the order of acquisition currently stored in the information record table, that is, the hash value corresponding to the latest key frame received by the processing device, and the order of acquisition of the latest received picture frame in the corresponding picture group. The standby access device may determine the next picture frame of the latest picture frame received by the processing device among the picture frames included in the N picture frames currently cached according to the second connection instruction, and transmit the video stream to the standby processing device for data processing starting from the next picture frame of the latest picture frame, so as to ensure the transmission and processing of the complete video stream by the video surveillance system.

[0130] Specifically, when the processing device is a storage device, the backup processing device is a backup storage device. At this time, the system can monitor the status of the storage device. Once it times out, it will notify the access device or the backup access device to stop sending streams to the storage device, deactivate the storage device, and quickly start a backup storage device. The backup storage device can continue to store the video stream according to the information in the storage session, that is, the information record table, to ensure the continuity and integrity of the video stream storage.

[0131] Specifically, when the processing device is a distribution device, the standby processing device is a standby processing device. When the standby processing device is started, it can continue to receive picture frames in the video stream according to the information in the information record table, and split the received picture frames into multiple RTPs and send them to the downstream device. Figure 6 As shown, there are multiple RTP packets corresponding to picture frames 1, 2 and 3, and sub-forwarding 1 and sub-forwarding 2 are respectively a distribution device and a backup distribution device. When the distribution device sends picture frame 2 to the downstream device and the sending is interrupted, the backup distribution device can start from picture frame 2 and send multiple RTP packets corresponding to picture frame 2 and subsequent picture frames to the downstream device.

[0132] It should be noted that the present embodiment can perform multiple accesses to the video stream of the camera device. The present embodiment can set multiple access devices that are mutually redundant to ensure uninterrupted access to the camera device, that is, for the camera device that requires uninterrupted access, at least two video stream access programs on different servers must be working to ensure that the system can reliably obtain video source data.

[0133] It should also be noted that this embodiment can ensure that multiple access devices can forward video streams for the distribution device by communicating between the distribution device and multiple access devices, so that the distribution device can correctly and completely obtain and process the video stream.

[0134] It should also be noted that when multiple distribution devices send the same video stream, they can use the same cache information block, i.e. the above-mentioned information record table, to ensure the consistency of the sending status. The user terminal can use the RTP protocol to receive the stream, and complete the continuous frames according to the relevant information of RTP, thus ensuring the uninterrupted real-time preview. The distribution device records the same data when working, ensuring that multiple distribution devices have a consistent working state, ensuring that the same frame of data can be correctly identified by the other party when sent using RTP, so as to achieve correct decoding and display, and using distributed lock technology to ensure the atomicity of the same frame of data.

[0135] The video stream transmission method in the video surveillance system proposed in this embodiment can meet the user's needs for viewing historical monitoring or real-time monitoring, and avoid the user's perception of video interruption due to system-related failures during the monitoring process, thereby avoiding the impact on the user's viewing experience.

[0136] like Figure 7 As shown, this embodiment proposes a video stream transmission device in a video surveillance system, the system includes an access device, a backup access device and a processing device; the video stream transmission device is applied to the backup access device. The video stream transmission device includes:

[0137] The parsing unit 101 is used to parse the video stream continuously sent by the camera device to sequentially obtain multiple picture frames; wherein the multiple picture frames include multiple picture groups arranged in sequence, each picture group includes a first key frame and at least one predicted frame arranged in sequence, and the at least one predicted frame includes each picture frame located after the first key frame and before the second key frame, and the second key frame is a key frame after the first key frame; N is an integer not less than 1;

[0138] A cache unit 102, used for caching the latest acquired N picture groups;

[0139] The creating unit 103 is used for determining that any obtained picture frame is a key frame, generating a corresponding hash value according to a preset hash algorithm and the picture frame and using the hash value as a picture group identifier, recording the order in which the picture frame and the picture frames in the same group are obtained from a preset initial order to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creating frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group;

[0140] The first receiving unit 104 is used to receive a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to a preset hash algorithm and a target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, and the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device;

[0141] A first determining unit 105 is used to determine the next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value, the target acquisition order and the frame information in the first connection instruction;

[0142] The first sending unit 106 is used to send the video stream to the processing device to continue data processing starting from the next picture frame.

[0143] It should be noted that the processing processes of the parsing unit 101, the caching unit 102, the creating unit 103, the first receiving unit 104, the first determining unit 105 and the first sending unit 106 and the beneficial effects thereof can be respectively referred to in the embodiments of the present invention. Figure 1 The relevant descriptions of steps S101 to S106 are not repeated here.

[0144] Optionally, the above device also includes:

[0145] The second determination unit is used to determine the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames contained in the picture group before caching the latest N picture groups obtained; wherein the switching duration is the time required for the processing device to successfully switch to the backup access device after determining that the access device has failed; N is determined based on the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames contained in the picture group.

[0146] Optionally, the second determining unit is further configured to:

[0147] Input the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group into a preset model for calculation, obtain the output value of the preset model, determine an integer that is not less than the output value and is closest to the output value, and use it as N;

[0148] Among them, the preset model is:

[0149] ;

[0150] is the variable corresponding to the output value, is the variable corresponding to the switching duration, is the variable corresponding to the maximum frame transmission delay, is the variable corresponding to the picture frame transmission rate, A variable corresponding to the number of picture frames.

[0151] Optionally, when the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and is disconnected from the access device during forwarding of the video stream received through the access device to the downstream device;

[0152] The first sending unit 106 is further configured to:

[0153] Starting from the next picture frame of the target picture frame, the video stream is sent to the distribution device, so that the distribution device continues to forward the received video stream to the downstream device.

[0154] Optionally, when the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and is disconnected from the access device during storage of the video stream received through the access device;

[0155] The first sending unit 106 is further configured to:

[0156] Starting from the next picture frame of the target picture frame, the video stream is sent to the storage device, so that the storage device continues to store the received video stream.

[0157] Optionally, during data processing of the video stream received through the access device, when the processing device determines that the access device fails and is disconnected from the access device, a first connection instruction is generated, which is set to:

[0158] The processing device obtains the first key frame in the video stream received by the access device and has processed the first key frame, generates a corresponding first hash value according to a preset hash algorithm and the first key frame, determines a first acquisition order of the first key frame in the corresponding picture group, and saves the first hash value and the first acquisition order in a preset information recording table;

[0159] The processing device obtains a new key frame in the video stream received by the access device and has processed the new key frame, generates a corresponding new hash value according to the preset hash algorithm and the new key frame, replaces the hash value currently stored in the information recording table with the new hash value and saves it; and obtains a new picture frame in the video stream received by the access device and processes the new picture frame, determines a new acquisition order of the new picture frame in the corresponding picture group, replaces the currently stored acquisition order in the information recording table with the new acquisition order, and saves it;

[0160] During data processing of the video stream received by the access device by the processing device, when it is determined that the access device fails and is disconnected from the access device, the hash value and the acquisition order currently stored in the information record table are used as the target hash value and the target acquisition order respectively;

[0161] The processing device generates a first connection instruction including a target hash value and an order in which the targets are to be acquired.

[0162] Optionally, the system further includes a backup processing device and a service monitoring device; the above device also includes:

[0163] a stop unit, configured to stop sending the video stream to the processing device in response to a stop instruction sent by the service monitoring device after sending the video stream to the processing device for continuing data processing starting from the next picture frame; wherein the stop instruction is generated by the service monitoring device when determining that the processing device has a fault according to a status message sent by the processing device;

[0164] A second receiving unit is used to receive a second connection instruction sent by the standby processing device; wherein the second connection instruction is generated by the standby processing device in response to the startup instruction sent by the service monitoring device according to the hash value currently stored in the information recording table and the order in which it is obtained; the startup instruction is generated by the service monitoring device when it determines that the processing device has a fault according to the status message sent by the processing device;

[0165] The second sending unit is used to send the video stream to the backup processing device to continue data processing according to the second connection instruction.

[0166] The video stream transmission equipment in the video surveillance system proposed in this embodiment, the backup access device can continue to receive the video stream during the access device is in a fault period, and send the video stream to the processing device according to the first connection instruction sent by the processing device, so that the processing device can receive the complete video stream and perform data processing, thereby avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience.

[0167] This embodiment provides a video monitoring system, which includes an access device, a backup access device and a processing device; wherein:

[0168] The standby access device analyzes the video stream continuously sent by the camera device to obtain multiple picture frames in sequence, and caches the latest N picture groups; wherein the multiple picture frames include multiple picture groups arranged in sequence, each picture group includes a first key frame and at least one predicted frame arranged in sequence, and the at least one predicted frame includes each picture frame located after the first key frame and before the second key frame, and the second key frame is a key frame after the first key frame; N is an integer not less than 1;

[0169] The standby access device determines that any obtained picture frame is a key frame, generates a corresponding hash value according to a preset hash algorithm and the picture frame and uses it as a picture group identifier, records the order in which the picture frame and the picture frames in the same group are obtained from a preset initial order, so as to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creates frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group;

[0170] During data processing of the video stream received through the access device by the processing device, when it is determined that the access device fails and is disconnected from the access device, a first connection instruction is generated; wherein the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to a preset hash algorithm and a target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device;

[0171] The processing device sends a first connection instruction to the standby access device;

[0172] The standby access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value, target acquisition order and frame information in the first connection instruction, and sends the video stream to the processing device to continue data processing starting from the next picture frame.

[0173] In another video surveillance system proposed in this embodiment, multiple access devices, storage devices, and distribution devices can be set in the video surveillance system. The video surveillance system can be connected to the camera device and the user terminal respectively, and can be set with a signaling access program, a video stream access program, a video stream storage program, a video stream forwarding program, and other service programs. Other service programs can be metadata management, resource and program management, configuration and middleware, etc., and resource and program management can be a registration center, etc. It should be noted that different video stream access programs are set in different access devices, the video stream storage program can be set in the storage device, and different video stream forwarding programs can be set in different distribution devices.

[0174] The video surveillance system proposed in this embodiment can switch to a backup access device to receive the video stream when the access device is in failure, so as to receive the complete video stream and perform data processing, thereby avoiding affecting the completion of the video surveillance task and avoiding affecting the user experience.

[0175] The video stream transmission device in the video surveillance system of this embodiment is presented in the form of a functional unit, where the unit refers to a dedicated integrated circuit circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0176] The embodiment of the present invention also provides a computer device having the above Figure 7 The video stream transmission device in the video surveillance system is shown.

[0177] See also Figure 8 , a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 10 is taken as an example.

[0178] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general array logic or any combination thereof. The memory 20 stores instructions executable by at least one processor 10 so that at least one processor 10 executes the method shown in the above embodiment.

[0179] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function. The data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The memory 20 may include a volatile memory, such as a random access memory. The memory may also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state hard disk. The memory 20 may also include a combination of the above-mentioned types of memories. The computer device also includes a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0180] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A video stream transmission method in a video surveillance system, characterized in that: The system includes an access device, a standby access device and a processing device; the method includes: The standby access device analyzes the video stream continuously sent by the camera device to obtain multiple picture frames in sequence, and caches the latest N picture groups; wherein the multiple picture frames include multiple picture groups arranged in sequence, each of the picture groups includes a first key frame and at least one predicted frame arranged in sequence, the at least one predicted frame includes each of the picture frames located after the first key frame and before a second key frame, and the second key frame is a key frame after the first key frame; N is an integer not less than 1; The standby access device determines that any of the obtained picture frames is a key frame, generates a corresponding hash value according to a preset hash algorithm and the picture frame and uses it as a picture group identifier, records the order in which the picture frame and the picture frames in the same group are obtained from a preset initial order to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creates frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group; The standby access device receives a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to the preset hash algorithm and the target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device; The backup access device determines the next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value in the first connection instruction, the target acquisition order and the frame information, and sends the video stream to the processing device to continue data processing starting from the next picture frame.

2. The method according to claim 1, characterized in that Before caching the latest N picture groups, the method further includes: The standby access device determines the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group; wherein the switching duration is the time required for the processing device to successfully switch to the standby access device after determining that the access device has failed; The standby access device inputs the switching duration, the maximum frame transmission delay, the picture frame transmission rate and the number of picture frames included in the picture group into a preset model for calculation, obtains an output value of the preset model, determines an integer that is not less than the output value and is closest to the output value, and uses it as N; Wherein, the preset model is: ; is the variable corresponding to the output value, is the variable corresponding to the switching duration, is the variable corresponding to the maximum frame transmission delay, is the variable corresponding to the picture frame transmission rate, is a variable corresponding to the number of picture frames.

3. The method according to claim 1, characterized in that When the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and is disconnected from the access device during forwarding the video stream received through the access device to a downstream device; The step of sending the video stream to the processing device to continue data processing starting from the next picture frame includes: The standby access device sends the video stream to the distribution device starting from the next picture frame of the target picture frame, so that the distribution device continues to forward the received video stream to the downstream device.

4. The method according to claim 1, characterized in that: When the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and is disconnected from the access device during the storage of the video stream received through the access device; The step of sending the video stream to the processing device to continue data processing starting from the next picture frame includes: The standby access device sends the video stream to the storage device starting from the next picture frame of the target picture frame, so that the storage device continues to store the received video stream.

5. The method according to claim 1, characterized in that When the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, the first connection instruction is generated, which is set to: When the processing device obtains the first key frame in the video stream received by the access device and has processed the first key frame, the processing device generates a corresponding first hash value according to the preset hash algorithm and the first key frame, determines a first acquisition order of the first key frame in the corresponding picture group, and saves the first hash value and the first acquisition order into a preset information recording table; When the processing device obtains a new key frame from the video stream received by the access device and has processed the new key frame, the processing device generates a corresponding new hash value according to the preset hash algorithm and the new key frame, replaces the hash value currently saved in the information recording table with the new hash value and saves the new hash value; and, when a new picture frame is acquired from the video stream received by the access device and the new picture frame is processed, determining a new acquisition order of the new picture frame in the corresponding picture group, replacing the currently saved acquisition order in the information record table with the new acquisition order, and saving the order; During data processing of the video stream received by the access device by the processing device, when it is determined that the access device fails and is disconnected from the access device, the hash value and the acquisition order currently stored in the information record table are used as the target hash value and the target acquisition order respectively; The processing device generates a first connection instruction including the target hash value and the order in which the targets are acquired.

6. The method according to claim 5, characterized in that The system also includes a backup processing device and a service monitoring device; After sending the video stream to the processing device for further data processing starting from the next picture frame, the method further includes: The standby access device stops sending the video stream to the processing device in response to a stop instruction sent by the service monitoring device; wherein the stop instruction is generated by the service monitoring device when determining that the processing device fails according to a status message sent by the processing device; The standby access device receives a second connection instruction sent by the standby processing device; wherein the second connection instruction is generated by the standby processing device in response to a startup instruction sent by the service monitoring device, according to the hash value currently stored in the information recording table and the order in which it is obtained; the startup instruction is generated by the service monitoring device when it is determined that the processing device has a fault according to a status message sent by the processing device; The backup access device sends the video stream to the backup processing device to continue data processing according to the second connection instruction.

7. A video stream transmission device in a video surveillance system, characterized in that: The system includes an access device, a backup access device and a processing device; The video stream transmission device is applied to the backup access device; The video stream transmission device comprises: A parsing unit, configured to parse a video stream continuously sent by a camera device to sequentially obtain a plurality of picture frames; wherein the plurality of picture frames include a plurality of picture groups arranged sequentially, each of the picture groups includes a first key frame and at least one predicted frame arranged sequentially, the at least one predicted frame includes each of the picture frames located after the first key frame and before a second key frame, the second key frame being a key frame subsequent to the first key frame; and N is an integer not less than 1; A cache unit, used to cache the latest N picture groups; a creating unit, for determining that any of the obtained picture frames is a key frame, generating a corresponding hash value according to a preset hash algorithm and the picture frame and using the hash value as a picture group identifier, recording the order in which the picture frame and the picture frames in the same group are obtained starting from a preset initial order to obtain the order in which the picture frame and the picture frames in the same group are obtained in the corresponding picture group, and creating frame information of the picture frame and the picture frames in the same group, wherein the frame information includes the picture group identifier and the order in which the picture frame is obtained in the corresponding picture group; A first receiving unit is configured to receive a first connection instruction sent by the processing device; wherein the first connection instruction is generated when the processing device determines that the access device fails and is disconnected from the access device during data processing of the video stream received through the access device, and the first connection instruction includes a target hash value and a target acquisition order, the target hash value is generated by the processing device according to the preset hash algorithm and the target key frame, the target acquisition order is the acquisition order of the target picture frame in the corresponding picture group, and the target key frame and the target picture frame are respectively the latest key frame and the latest picture frame obtained and processed by the processing device according to the video stream before disconnecting from the access device; A first determining unit, configured to determine a next picture frame of the target picture frame in the N picture groups currently cached according to the target hash value in the first connection instruction, the target acquisition order and the frame information; The first sending unit is used to send the video stream to the processing device to continue data processing starting from the next picture frame.

8. The device according to claim 7, characterized in that When the processing device is a distribution device, the first connection instruction is generated when the distribution device determines that the access device fails and is disconnected from the access device during forwarding the video stream received through the access device to a downstream device; The first sending unit is further used for: Starting from the next picture frame of the target picture frame, the video stream is sent to the distribution device, so that the distribution device continues to forward the received video stream to the downstream device.

9. The device according to claim 7, characterized in that When the processing device is a storage device, the first connection instruction is generated when the storage device determines that the access device fails and is disconnected from the access device during the storage of the video stream received through the access device; The first sending unit is further used for: Starting from the next picture frame of the target picture frame, the video stream is sent to the storage device, so that the storage device continues to store the received video stream.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the video stream transmission method in the video surveillance system according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data center architecture supporting attack detection and mitigation

    CN106576099A

  • Real-time audio and video transmission system, method and device and storage medium

    CN117041630A