Collision detection method, electronic device, and computer-readable medium

By detecting the start and end times of video frames to generate a set to be detected and performing collision detection, the problem of video freeze caused by long I-frame transmission time is solved, and the user experience is improved.

CN116805966BActive Publication Date: 2025-10-03ZTE CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210258184.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2025-10-03
Estimated Expiration
2042-03-16

AI Technical Summary

Technical Problem

I-frames take too long to transmit over bandwidth-constrained transmission channels, causing video playback to stall at the receiving end and impacting user experience.

Method used

By determining the start and end times of the video frames, generating a set of detection windows for collision detection, performing collision detection on the video frames, and calculating the collision time, probability, duty cycle, and flow rate, etc., in order to avoid collisions.

Benefits of technology

It improves the user experience of video users and provides a basis for avoiding I-frame transmission conflicts by accurately detecting collisions of video frames, thereby reducing playback interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116805966B_ABST
    Figure CN116805966B_ABST
Patent Text Reader

Abstract

The present disclosure provides a collision detection method, comprising: determining the detection time of at least one video frame in at least one collision detection window, wherein the detection time of the video frame includes the start time and the end time of the video frame; generating a to-be-detected set corresponding to each collision detection window based on the detection time of each video frame, wherein the detection times in the to-be-detected set are arranged in chronological order; and performing collision detection on the video frames based on the to-be-detected set corresponding to each collision detection window. The present disclosure also provides an electronic device and a computer-readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and its features include a collision detection method, an electronic device, and a computer-readable medium. Background Art

[0002] Video data packets are transmitted in frames. Common frame types include I-frames and P-frames. I-frames construct the image background and moving subjects, contain complete image information, and have a low compression ratio. They are the basis for P-frame decoding. P-frames rely on I-frames for inter-frame prediction and differential transmission, resulting in a high compression ratio.

[0003] Because I-frames are much larger than P-frames, they take up more time to transmit over bandwidth-constrained channels, potentially causing delays at the receiving end. If the I-frame transmission time exceeds a certain threshold, video playback may become stagnant at the receiving end.

[0004] I-frame collision has become an important factor affecting video user experience. Summary of the Invention

[0005] Embodiments of the present disclosure provide a collision detection method, an electronic device, and a computer-readable medium.

[0006] In a first aspect, an embodiment of the present disclosure provides a collision detection method, comprising:

[0007] Determining a detection time of at least one video frame in at least one conflict detection window, wherein the detection time of the video frame includes a start time and an end time of the video frame;

[0008] Generating a set to be detected corresponding to each conflict detection window according to the detection moment of each video frame, wherein the detection moments in the set to be detected are arranged in chronological order;

[0009] Collision detection of video frames is performed according to the to-be-detected sets corresponding to the conflict detection windows.

[0010] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows includes:

[0011] According to the to-be-detected sets corresponding to the conflict detection windows, the number of n-stream collisions occurring in each conflict detection window is determined, wherein n-stream collision means that transmission periods of n video frames overlap in time, and n is 1, 2, 3, etc.

[0012] In some embodiments, determining the number of n-stream collisions occurring in the conflict detection window according to the to-be-detected set corresponding to the conflict detection window includes:

[0013] Detecting each target detection moment in sequence according to the order of each detection moment in the set to be detected corresponding to the conflict detection window, and determining the number of n-stream collisions that occurred in the conflict detection window, wherein the target detection moment is a detection moment in the set to be detected whose flag bit is a first flag bit, and the first flag bit indicates that no detection was performed at the corresponding detection moment;

[0014] Wherein, detecting any one of the target detection moments includes:

[0015] According to the relationship between the target detection time and the previous detection time, and the flag bits of each detection time before the target detection time, the number of n-stream collisions occurring before the target detection time is determined, where n is 1, 2, 3, ... respectively.

[0016] In some embodiments, determining the number of n-stream collisions that occurred before the target detection moment based on a relationship between the target detection moment and a previous detection moment and flag bits of each detection moment before the target detection moment includes:

[0017] When the target detection moment is the same as the previous detection moment and the target detection moment is the end moment, the flag bit of the target detection moment and the flag bit of the start moment corresponding to the target detection moment are set to a second flag bit, wherein the second flag bit indicates that the corresponding detection moment has been detected;

[0018] When the target detection time is different from the previous detection time, and the target detection time is the starting time and the previous detection time is the starting time, counting the number i of starting times before the target detection time whose flag bit is the first flag bit, and adding 1 to a first counter corresponding to the i-stream collision, where i is a positive integer;

[0019] When the target detection time is different from the previous detection time and the target detection time is the end time, counting the number j of start times before the target detection time whose flag bit is the first flag bit, and adding 1 to a first counter corresponding to the j-stream collision, where j is a positive integer;

[0020] The flag bit of the target detection moment and the flag bit of the start moment corresponding to the target detection moment are set as the second flag bit.

[0021] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0022] According to the number of times that n-stream collisions occur in each of the conflict detection windows, the combination of video streams in which the n-stream collision occurs and the time period in which the n-stream collision occurs are determined, where n is 1, 2, 3, ... respectively.

[0023] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0024] A first collision probability is determined according to the number of times n-stream collisions occur in each of the conflict detection windows, wherein the first collision probability represents the probability of n-stream collisions occurring, and n is 1, 2, 3, ... respectively.

[0025] In some embodiments, determining the first collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes:

[0026] When the first counter corresponding to the n-stream collision is not cleared, determining the number of n-stream collisions occurring in each of the collision detection windows according to the to-be-detected sets corresponding to the collision detection windows, and obtaining the total number of n-stream collisions occurring, where n is 1, 2, 3, ..., respectively;

[0027] Accumulate the values ​​of the first counters to obtain the total number of collisions;

[0028] The first collision probability is calculated according to the total number of n-stream collisions and the total number of collisions.

[0029] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0030] A second collision probability is determined according to the number of times n-flow collisions occur in each of the conflict detection windows, wherein the second collision probability represents the probability that the n-flow collision is the maximum number of flow collisions, and n is 1, 2, 3, ... respectively.

[0031] In some embodiments, determining the second collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes:

[0032] For any of the conflict detection windows, determining a maximum value of n according to the number of times n-flow collisions occur in the conflict detection window, and obtaining a maximum number of flow collisions;

[0033] Add 1 to the second counter corresponding to the maximum number of flow collisions;

[0034] The second collision probability is calculated according to the values ​​of the second counters and the number of conflict detection windows.

[0035] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0036] The duty cycle is calculated, where the duty cycle represents the proportion of n-stream collisions to the total time, and n is 1, 2, 3, etc.

[0037] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0038] Calculate the flow rate when n streams collide, where n is 1, 2, 3, etc.

[0039] In some embodiments, determining a detection time of at least one video frame in at least one conflict detection window includes:

[0040] Messages of a target aggregation level are aggregated to determine a detection time of each of the video frames, wherein the target aggregation level includes any one of a camera level, an application level, and a cell level.

[0041] In some embodiments, determining a detection time of at least one video frame in at least one conflict detection window includes:

[0042] According to the data at the video frame level, the detection moment of each video frame is determined.

[0043] In a second aspect, an embodiment of the present disclosure provides an electronic device, including:

[0044] one or more processors;

[0045] a memory storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the collision detection method according to the first aspect of the embodiment of the present disclosure;

[0046] One or more I / O interfaces are connected between the processor and the memory and configured to implement information interaction between the processor and the memory.

[0047] In a third aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the collision detection method described in the first aspect of the embodiment of the present disclosure.

[0048] In the collision detection method provided by the embodiment of the present disclosure, by determining the start time and end time of the video frame, and forming the start time and end time of each video frame into a set to be detected in chronological order, and then performing collision detection of the video frame based on the set to be detected, the time of the collision, collision probability, duty cycle, traffic flow at the time of collision, etc. can be determined, which serves as the basis for subsequent I frame avoidance, which is beneficial to improving the experience of video users. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flow chart of a collision detection method according to an embodiment of the present disclosure;

[0050] Figure 2 is a block diagram of an electronic device according to an embodiment of the present disclosure;

[0051] Figure 3 is a block diagram of a computer-readable medium in an embodiment of the present disclosure;

[0052] Figure 4 is a schematic diagram of a collision detection in an embodiment of the present disclosure;

[0053] Figure 5 It is a schematic diagram of a collision detection in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0054] To enable those skilled in the art to better understand the technical solutions of the present disclosure, the collision detection method, electronic device, and computer-readable medium provided by the present disclosure are described in detail below with reference to the accompanying drawings.

[0055] Example embodiments will be described more fully hereinafter with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the scope of this disclosure to those skilled in the art.

[0056] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.

[0057] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0058] The terms used herein are used only to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a," "an," and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements, and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof is not excluded.

[0059] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless expressly defined as such herein.

[0060] First, refer to Figure 1 , an embodiment of the present disclosure provides a collision detection method, comprising:

[0061] S1. Determine a detection time of at least one video frame in at least one conflict detection window, wherein the detection time of the video frame includes a start time and an end time of the video frame;

[0062] S2. Generating a set to be detected corresponding to each conflict detection window according to the detection moment of each video frame, wherein the detection moments in the set to be detected are arranged in chronological order;

[0063] S3. Perform collision detection on the video frames according to the to-be-detected sets corresponding to the conflict detection windows.

[0064] The embodiment of the present disclosure does not impose any special restrictions on the length of the conflict detection window. In some embodiments, the length of the conflict detection window can be set as needed.

[0065] The embodiment of the present disclosure does not impose any special limitation on the video frame. For example, the video frame can be an I frame or a P frame.

[0066] In the disclosed embodiments, a video frame collision refers to the overlap of transmission time between multiple video frames. The disclosed embodiments do not impose any specific restrictions on the number of video frames that collide at the same time. For example, the number of collided video frames can be 1, indicating no collision; the number of collided video frames can be 2 or more.

[0067] In the embodiments of the present disclosure, collision detection may include determining a combination of video frames in which a collision occurs, determining the time of collision, determining a collision probability, determining a duty cycle, or determining a flow rate at the time of collision. The embodiments of the present disclosure are not particularly limited to this.

[0068] In the collision detection method provided by the embodiment of the present disclosure, by determining the start time and end time of the video frame, and forming the start time and end time of each video frame into a set to be detected in chronological order, and then performing collision detection of the video frame based on the set to be detected, the time of the collision, collision probability, duty cycle, traffic flow at the time of collision, etc. can be determined, which serves as the basis for subsequent I frame avoidance, which is beneficial to improving the experience of video users.

[0069] In an embodiment of the present disclosure, when generating a set to be detected corresponding to each conflict detection window based on the detection time of each video frame, the following rules must be met: in a conflict detection window, the starting times of several video frames that only have end times but no start times are all set to the first time. The first time can be the starting time of the conflict detection window, or the starting time of any one of the several video frames, or any time, as long as the starting times of the video frames that only have end times but no start times are the same; in a conflict detection window, the ending times of several video frames that only have start times but no end times are all set to the second time. The second time can be the ending time of the conflict detection window, or the ending time of any one of the several video frames, or any time, as long as the ending times of the video frames that only have start times but no end times are the same; the ending time on the boundary of the conflict detection window is placed in the set to be detected corresponding to the previous conflict detection window, and the starting time on the boundary of the conflict detection window is placed in the set to be detected corresponding to the next conflict detection window.

[0070] The embodiment of the present disclosure does not impose any special limitation on how to perform collision detection on video frames.

[0071] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows includes:

[0072] According to the to-be-detected sets corresponding to the conflict detection windows, the number of n-stream collisions occurring in each conflict detection window is determined, wherein n-stream collision means that transmission periods of n video frames overlap in time, and n is 1, 2, 3, etc.

[0073] In some embodiments, determining the number of n-stream collisions occurring in the conflict detection window according to the to-be-detected set corresponding to the conflict detection window includes:

[0074] Detecting each target detection moment in sequence according to the order of each detection moment in the set to be detected corresponding to the conflict detection window, and determining the number of n-stream collisions that occurred in the conflict detection window, wherein the target detection moment is a detection moment in the set to be detected whose flag bit is a first flag bit, and the first flag bit indicates that no detection was performed at the corresponding detection moment;

[0075] Wherein, detecting any one of the target detection moments includes:

[0076] According to the relationship between the target detection time and the previous detection time, and the flag bits of each detection time before the target detection time, the number of n-stream collisions occurring before the target detection time is determined, where n is 1, 2, 3, ... respectively.

[0077] In some embodiments, determining the number of n-stream collisions that occurred before the target detection moment based on a relationship between the target detection moment and a previous detection moment and flag bits of each detection moment before the target detection moment includes:

[0078] When the target detection moment is the same as the previous detection moment and the target detection moment is the end moment, the flag bit of the target detection moment and the flag bit of the start moment corresponding to the target detection moment are set to a second flag bit, wherein the second flag bit indicates that the corresponding detection moment has been detected;

[0079] When the target detection time is different from the previous detection time, and the target detection time is the starting time and the previous detection time is the starting time, counting the number i of starting times before the target detection time whose flag bit is the first flag bit, and adding 1 to a first counter corresponding to the i-stream collision, where i is a positive integer;

[0080] When the target detection time is different from the previous detection time and the target detection time is the end time, counting the number j of start times before the target detection time whose flag bit is the first flag bit, and adding 1 to a first counter corresponding to the j-stream collision, where j is a positive integer;

[0081] The flag bit of the target detection moment and the flag bit of the start moment corresponding to the target detection moment are set as the second flag bit.

[0082] For example, the set to be detected is represented by an array t, where each detection moment corresponds to an element; flag = 0 represents the first flag, and flag = 1 represents the second flag; the length of array t is N, k = 2...N, that is, the value of flag = 0 in the array is retrieved starting from the second element;

[0083] In the case where t[k] is equal to t[k-1]:

[0084] If t[k] is the starting time starttime, no processing will be done;

[0085] If t[k] is the end time, then the starttime flag of the corresponding flow t[k] is 1, and the endtime flag is 1;

[0086] When t[k] is not equal to t[k-1]:

[0087] If t[k] is the starttime, and t[k-1] is the endtime, no processing is done; otherwise, the number of flows i with starttime flag = 0 before t[k] is counted, and it is considered that the i flows have collided, that is, a flow collision has occurred, and the corresponding first counter counter_i+1;

[0088] If t[k] is the endtime, then count the number of flows j with starttime flag = 0 before this value, and it is considered that these j flows have collided, that is, a j-flow collision has occurred, and the corresponding counter_j+1;

[0089] Set the starttime flag of the t[k] stream to 1 and the endtime flag to 1.

[0090] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0091] According to the number of times that n-stream collisions occur in each of the conflict detection windows, the combination of video streams in which the n-stream collision occurs and the time period in which the n-stream collision occurs are determined, where n is 1, 2, 3, ... respectively.

[0092] In some embodiments, the first collision probability is calculated based on the actual counting result.

[0093] Accordingly, in some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0094] A first collision probability is determined according to the number of times n-stream collisions occur in each of the conflict detection windows, wherein the first collision probability represents the probability of n-stream collisions occurring, and n is 1, 2, 3, ... respectively.

[0095] In some embodiments, determining the first collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes:

[0096] When the first counter corresponding to the n-stream collision is not cleared, determining the number of n-stream collisions occurring in each of the collision detection windows according to the to-be-detected sets corresponding to the collision detection windows, and obtaining the total number of n-stream collisions occurring, where n is 1, 2, 3, ..., respectively;

[0097] Accumulate the values ​​of the first counters to obtain the total number of collisions;

[0098] The first collision probability is calculated according to the total number of n-stream collisions and the total number of collisions.

[0099] For example, the calculation of the first collision probability can be expressed as the following formula:

[0100]

[0101] Among them, P i It represents the probability of i-stream collision, counter_i represents the number of times i-stream collision occurs, and i is a positive integer.

[0102] In some embodiments, the second collision probability is calculated based on the event counting result.

[0103] Accordingly, in some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0104] A second collision probability is determined according to the number of times n-flow collisions occur in each of the conflict detection windows, wherein the second collision probability represents the probability that the n-flow collision is the maximum number of flow collisions, and n is 1, 2, 3, ... respectively.

[0105] In some embodiments, determining the second collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes:

[0106] For any of the conflict detection windows, determining a maximum value of n according to the number of times n-flow collisions occur in the conflict detection window, and obtaining a maximum number of flow collisions;

[0107] Add 1 to the second counter corresponding to the maximum number of flow collisions;

[0108] The second collision probability is calculated according to the values ​​of the second counters and the number of conflict detection windows.

[0109] For example, the calculation of the second collision probability can be expressed as the following formula:

[0110]

[0111] Among them, P i,max It represents the probability that the collision of stream i is the maximum number of streams in the collision detection window. counter_i_max represents the number of collision detection windows corresponding to the collision of stream i being the maximum number of streams in the collision detection window. The total number of sampling times is the total number of collision detection windows.

[0112] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0113] The duty cycle is calculated, where the duty cycle represents the proportion of n-stream collisions to the total time, and n is 1, 2, 3, etc.

[0114] In the embodiment of the present disclosure, the duty cycle is the ratio of the time when n streams collide to the total sampling time.

[0115] For example, the duty cycle is calculated as follows:

[0116] 1 frame collision duty cycle = conflictPeriod_1 / total time;

[0117] 2-frame collision duty cycle = conflictPeriod_2 / total time;

[0118] And so on...

[0119] n-frame collision duty cycle = conflictPeriod_n / total time.

[0120] Here, conflictPeriod_n represents the time when n streams collide.

[0121] In some embodiments, performing collision detection on video frames according to the to-be-detected sets corresponding to the collision detection windows further includes:

[0122] Calculate the flow rate when n streams collide, where n is 1, 2, 3, etc.

[0123] For example, the flow rate when n streams collide is calculated as follows:

[0124] Calculate the traffic (kbps) of each video frame l where n stream collision occurs: Wherein, starttime(l) represents the starting time of video frame l, and endtime(l) represents the ending time of video frame l;

[0125] Calculate the traffic (kbps) when n-stream collision occurs:

[0126] In some embodiments, determining a detection time of at least one video frame in at least one conflict detection window includes:

[0127] Messages of a target aggregation level are aggregated to determine a detection time of each of the video frames, wherein the target aggregation level includes any one of a camera level, an application level, and a cell level.

[0128] In some embodiments, determining a detection time of at least one video frame in at least one conflict detection window includes:

[0129] According to the data at the video frame level, the detection moment of each video frame is determined.

[0130] Secondly, refer to Figure 2 , an embodiment of the present disclosure provides an electronic device, comprising:

[0131] One or more processors 101;

[0132] a memory 102 storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement any one of the aforementioned collision detection methods;

[0133] One or more I / O interfaces 103 are connected between the processor and the memory and are configured to implement information exchange between the processor and the memory.

[0134] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.

[0135] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.

[0136] Thirdly, refer to Figure 3 , an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements any of the above-mentioned collision detection methods when the program is executed by a processor.

[0137] In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present disclosure, the technical solutions provided by the embodiments of the present disclosure are described in detail below through specific examples:

[0138] Example

[0139] This embodiment uses the video frame as an I frame for illustration. This embodiment does not specifically limit the application scenario. For example, it can be a camera-level data stream aggregation scenario, an application-level APP data stream aggregation scenario, or a cell-level data stream aggregation scenario.

[0140] The data to be detected includes IP packet-level data contained in the I frame in the video stream (this solution does not provide specific video stream service identification technology), including but not limited to: IP packet arrival time, IP five-tuple information, packet size information, etc.

[0141] The data to be detected includes video stream data of multiple aggregation levels, including but not limited to:

[0142] Camera level: Identify based on the IP quintuple and perform collision detection on the camera-level video IP packet stream.

[0143] App level: Identify based on IP address (addr) and port number (port). Perform collision detection after aggregating video IP packet streams from the same app.

[0144] Cell level: Identification is performed based on the NR CGI (Cell Global Identifier). Collision detection is performed after the video IP packet flows in the same cell are aggregated.

[0145] Optionally, the data to be detected may also include video frame-level data such as I frames and P frames calculated after preprocessing, including but not limited to: frame start time, frame end time, frame duration, frame type, IP five-tuple information, frame size information, etc.

[0146] I-frame collision detection includes:

[0147] Set the conflict detection window (conflictWindow). The window length can be set to any value as needed. Record the arrival time of the first IP packet of each video stream's I-frame within the conflict detection window as the start time of the I-frame (starttime). Record the arrival time of the last IP packet of the I-frame as the end time of the I-frame (endtime). The time is based on the current device local time.

[0148] A flag is set for each I-frame's starttime and endtime and initialized to 0. This flag determines whether the current time has already been used to calculate the collision probability. When flag = 0, the time corresponding to the current flag is included in the probability calculation; when flag = 1, the time corresponding to the current flag is not included in the collision probability calculation.

[0149] Each collision detection window sets a set of I-frame collision counters, counter_n (n = 1, 2, 3, ...), to record the number of I-frame collisions within the current window. counter_1 represents the number of times a single I-frame (no collision) occurs. During system initialization, all counters are initialized to 0.

[0150] For example, assuming that the statistical results in a certain conflict detection window (assuming 5 video stream services) are counter_2=2, counter_3=1, and other counters are all 0, that is, there are 2 two-frame collisions and 1 three-frame collision.

[0151] Step 1:

[0152] Combine and sort the starttime and endtime values ​​of all flows within the conflict detection window to form a set t. If some flows within the current detection window only have an endtime, add their starttime values ​​to the set and set them to the same value. Endtime values ​​on the detection window boundary are added to the set of the previous detection window, and starttime values ​​on the detection window boundary are added to the set of the next detection window.

[0153] like Figure 4 As shown, there are a total of 6 I frames of video streams in two adjacent conflict detection windows, among which the set detected by conflict detection window 2 is:

[0154] t=[4_starttime,5_starttime,4_endtime,5_endtime,6_starttime,6_endtime];

[0155] illustrate: Figure 4 The I-frame start time 4_starttime of stream 4 and the I-frame start time 5_starttime of stream 5 can be set to the start time of collision detection window 2; or both can be set to 4_starttime of stream 4; the principle is that the values ​​of 4_starttime and 5_starttime must be the same, otherwise the number of collision frames will be overcounted.

[0156] Step 2:

[0157] Assume that the length of the array t after the combination and sorting in Step 1 is N, k = 2...N, that is, the value of flag = 0 in the array is retrieved starting from the second element.

[0158] In the case where t[k] is equal to t[k-1]:

[0159] If t[k] is the starting time starttime, no processing will be done;

[0160] If t[k] is the end time, then the starttime flag of the corresponding flow t[k] is 1, and the endtime flag is 1;

[0161] When t[k] is not equal to t[k-1]:

[0162] If t[k] is the starttime, and t[k-1] is the endtime, no processing is done; otherwise, the number of flows i with starttime flag = 0 before t[k] is counted, and it is considered that the i flows have collided, that is, a flow collision has occurred, and the corresponding first counter counter_i+1;

[0163] If t[k] is the endtime, then count the number of flows j with starttime flag = 0 before this value, and it is considered that these j flows have collided, that is, a j-flow collision has occurred, and the corresponding counter_j+1;

[0164] Set the starttime flag of the t[k] stream to 1 and the endtime flag to 1.

[0165] When a collision is detected, the colliding stream combination needs to be recorded (for example, a 4-stream collision records the stream numbers [3, 6, 10, 19]) and the collision time period corresponding to each stream collision combination is calculated: conflictPeroid = t[i] - t[i-1], in milliseconds (ms).

[0166] 1) Calculate the collision probability:

[0167] This embodiment provides two collision probability calculation methods: an actual count-based method and an event count-based method. The difference between these two methods lies in the different counting algorithms used by the collision counter within the collision detection window. The actual count-based method records the number of all collision combinations that occur within the current collision detection window; the event count-based method, on the other hand, uses the former to filter out the event with the greatest number of collisions within the window. In other words, the event count-based method determines that the event that needs to be resolved within a given time period is the scene with the greatest number of collision frames.

[0168] like Figure 5 As shown, there are a total of six video I-frames within three adjacent conflict detection windows. Taking conflict detection window 1 as an example, within the current window, the actual counting method outputs the counting results as counter_1 = 1 and counter_2 = 1, indicating that one one-frame collision (no collision) and one two-frame collision were recorded within the current window. The event counting method, on the other hand, only outputs the maximum number of collision flows recorded within the current window, counter_2 = 1, indicating that a two-frame collision occurred within the current window.

[0169] a. First collision probability based on actual counting results:

[0170] After the current conflict window detection is completed, the number of each I frame conflict is counted, the count result of the saved counter is not cleared, and the value of each counter corresponding to the next detection result is accumulated, and finally the total number of times for each counter is counted.

[0171] The calculation of the first collision probability can be expressed as the following formula:

[0172]

[0173] Among them, Pi It represents the probability of i-stream collision, counter_i represents the number of times i-stream collision occurs, and i is a positive integer.

[0174] b. Second collision probability based on event counting results:

[0175] After the current conflict window detection is completed, only the event with the largest number of collision frames (i.e., the largest n value among the non-zero values ​​in counter_n) is recorded, and the corresponding event counter (second counter) count_n+1 is recorded. At the same time, after each conflict detection window detection is completed, the counter (first counter) of the actual number of collisions of each I frame is cleared to 0.

[0176] The calculation of the second collision probability can be expressed as the following formula:

[0177]

[0178] Among them, P i,max It represents the probability that the collision of stream i is the maximum number of streams in the collision detection window. counter_i_max represents the number of collision detection windows corresponding to the collision of stream i being the maximum number of streams in the collision detection window. The total number of sampling times is the total number of collision detection windows.

[0179] 2) Calculate the duty cycle:

[0180] After the current conflict window detection is completed, the number of each I frame conflict is counted, the count result of the saved counter is not cleared, and the value of each counter corresponding to the next detection result is accumulated, and finally the total number of times for each counter is counted.

[0181] After the detection is completed, the time of all types of I-frame collisions is obtained and the total time is calculated. The total time is the sum of the time of all types of I-frame collisions. The I-frame collision duty cycle is calculated as follows:

[0182] 1 frame collision duty cycle = conflictPeriod_1 / total time;

[0183] 2-frame collision duty cycle = conflictPeriod_2 / total time;

[0184] And so on...

[0185] n-frame collision duty cycle = conflictPeriod_n / total time.

[0186] Here, conflictPeriod_n represents the time when n streams collide.

[0187] 3) Calculate the flow rate when n streams collide:

[0188] Calculate the traffic (kbps) of each video frame l where n stream collision occurs: Wherein, starttime(l) represents the starting time of video frame l, and endtime(l) represents the ending time of video frame l;

[0189] Calculate the traffic (kbps) when n-stream collision occurs:

[0190] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0191] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly indicated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.

Claims

1. A collision detection method, comprising: Determining a detection time of at least one video frame in at least one conflict detection window, wherein the detection time of the video frame includes a start time and an end time of the video frame; Generating a set to be detected corresponding to each conflict detection window according to the detection moment of each video frame, wherein the detection moments in the set to be detected are arranged in chronological order; Collision detection of video frames is performed according to the to-be-detected sets corresponding to the conflict detection windows.

2. The collision detection method according to claim 1, wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows includes: According to the to-be-detected sets corresponding to the conflict detection windows, the number of n-stream collisions occurring in each conflict detection window is determined, wherein n-stream collision refers to time overlap between transmission periods of n video frames, and n is 2, 3, etc.

3. The collision detection method according to claim 2, wherein: Determining, according to the to-be-detected sets corresponding to the conflict detection windows, the number of times n-stream collisions occur in each conflict detection window includes: Detecting each target detection moment in sequence according to the order of each detection moment in the set to be detected corresponding to the conflict detection window, and determining the number of n-stream collisions that occurred in the conflict detection window, wherein the target detection moment is a detection moment in the set to be detected whose flag bit is a first flag bit, and the first flag bit indicates that no detection was performed at the corresponding detection moment; Wherein, detecting any one of the target detection moments includes: The number of n-stream collisions that occurred before the target detection moment is determined based on the relationship between the target detection moment and the previous detection moment, and the flag bits of each detection moment before the target detection moment.

4. The collision detection method according to claim 3, wherein: Determining the number of n-stream collisions that occurred before the target detection moment according to a relationship between the target detection moment and a previous detection moment, and flag bits of each detection moment before the target detection moment, includes: When the target detection moment is the same as the previous detection moment and the target detection moment is the end moment, the flag bit of the target detection moment and the flag bit of the start moment corresponding to the target detection moment are set to a second flag bit, wherein the second flag bit indicates that the corresponding detection moment has been detected; When the target detection time is different from the previous detection time, and the target detection time is the starting time and the previous detection time is the starting time, counting the number i of starting times before the target detection time whose flag bit is the first flag bit, and adding 1 to a first counter corresponding to the i-stream collision, where i is a positive integer; When the target detection moment is different from the previous detection moment and the target detection moment is the end moment, the number j of starting moments before the target detection moment whose flag bit is the first flag bit is counted, and the first counter corresponding to the j-stream collision is increased by 1, where j is a positive integer; the flag bit of the target detection moment and the flag bit of the starting moment corresponding to the target detection moment are set to the second flag bit.

5. The collision detection method according to any one of claims 2 to 4, wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows further includes: According to the number of times that n-stream collisions occur in each of the conflict detection windows, the combination of video streams in which the n-stream collision occurs and the time period in which the n-stream collision occurs are determined. The collision detection method according to claim 4 , wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows further includes: A first collision probability is determined according to the number of times the n-stream collision occurs in each of the conflict detection windows, wherein the first collision probability represents the probability of the n-stream collision occurring.

7. The collision detection method according to claim 6, wherein: Determining a first collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes: When the first counter corresponding to the n-stream collision is not cleared, determining the number of n-stream collisions occurring in each of the collision detection windows according to the to-be-detected sets corresponding to the collision detection windows, and obtaining the total number of n-stream collisions occurring; Accumulate the values ​​of the first counters to obtain the total number of collisions; The first collision probability is calculated according to the total number of n-stream collisions and the total number of collisions.

8. The collision detection method according to any one of claims 2 to 4, wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows further includes: A second collision probability is determined according to the number of times the n-flow collision occurs in each of the conflict detection windows, wherein the second collision probability represents the probability that the n-flow collision is the collision of the maximum number of flows.

9. The collision detection method according to claim 8, wherein: Determining the second collision probability according to the number of times n-stream collisions occur in each of the collision detection windows includes: For any of the conflict detection windows, determining a maximum value of n according to the number of times n-flow collisions occur in the conflict detection window, and obtaining a maximum number of flow collisions; Add 1 to the second counter corresponding to the maximum number of flow collisions; The second collision probability is calculated according to the values ​​of the second counters and the number of conflict detection windows.

10. The collision detection method according to any one of claims 2 to 4, wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows further includes: A duty cycle is calculated, wherein the duty cycle represents a proportion of the n-stream collision to the total time.

11. The collision detection method according to any one of claims 2 to 4, wherein: Performing collision detection on video frames according to the to-be-detected sets corresponding to the conflict detection windows further includes: Calculate the flow rate when n streams collide.

12. The collision detection method according to any one of claims 1 to 4, wherein: Determining a detection time of at least one video frame in at least one conflict detection window includes: Messages of a target aggregation level are aggregated to determine a detection time of each of the video frames, wherein the target aggregation level includes any one of a camera level, an application level, and a cell level.

13. The collision detection method according to any one of claims 1 to 4, wherein: Determining a detection time of at least one video frame in at least one conflict detection window includes: According to the data at the video frame level, the detection moment of each video frame is determined.

14. An electronic device comprising: one or more processors; a memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the collision detection method according to any one of claims 1 to 13; One or more I / O interfaces are connected between the processor and the memory and configured to implement information interaction between the processor and the memory. 15 . A computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the collision detection method according to claim 1 is implemented.

Citation Information

Patent Citations

  • Method for billable timekeeping

    AU2005229658A1

  • Efficient self-adaptive RFID (radio frequency identification) anti-collision tracking tree algorithm

    CN103577783A