Efficient multi-channel code stream signature verification method and electronic device based on dynamic arrangement
By dynamically orchestrating the identification and management of the key frame verification time of the monitored code stream, the problem of key frame verification occupying too much CPU resources is solved, the verification efficiency is improved and the risk of resource contention and crash is avoided, achieving a more balanced CPU load.
Patent Information
- Application Number
- CN202411212653.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-29
AI Technical Summary
During the monitoring code stream transmission process, key frame signature verification occupies too much CPU resources, causing multiple key frame signature verification threads to compete for resources, reducing signature verification efficiency, and may lead to excessive CPU resource occupancy, causing carding. pauses and operating system crashes.
Through the method of dynamic orchestration, it is identified whether the latest key frame received has completed the signature verification, and the pause duration is determined based on the start and end times of the signature verification, so that the code stream transmission end pauses the transmission to ensure that the signature verification time period of subsequent key frames is consistent with The signature verification time periods of the latest keyframes do not overlap, preventing multiple keyframes from being verified within the same time period.
It improves signature verification efficiency, avoids competition for CPU resources and excessive occupancy, prevents lagging and operating system crashes, and optimizes CPU load balancing.
Smart Images

Figure CN118714372B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security, and in particular to an efficient multi-channel code stream signature verification method and electronic equipment based on dynamic arrangement. Background Art
[0002] As information security is increasingly valued by society, "video security" as an important way to ensure information security has gradually been widely used. For example, in the field of security, surveillance video, as a carrier of information with a certain degree of confidentiality, also has the risk of leakage, and common leakage methods include video transmission interception, video theft, etc. Therefore, in order to ensure the tamper-proof nature of the surveillance code stream during transmission, the surveillance code stream needs to be encrypted during network transmission, and the code stream is then verified by the code stream receiver after being transmitted to the code stream receiver.
[0003] However, in actual applications, since the key frame (i.e., I frame) in the monitoring code stream has the largest amount of data, its signature verification occupies more central processing unit (CPU) resources than other frames (such as B frame, P frame). If the code stream receiver happens to process the signature verification of multiple key frames received at the same time, the signature verification threads of each key frame will compete for CPU resources, thereby reducing the signature verification efficiency. Summary of the invention
[0004] In view of this, the present application provides an efficient multi-channel code stream signature verification method and electronic device based on dynamic arrangement to improve the signature verification efficiency.
[0005] The embodiment of the present application provides an efficient multi-channel code stream signature verification method based on dynamic arrangement, which is applied to a code stream receiving end; the method includes:
[0006] If it is determined that the designated key frame of the current code stream needs to be verified, then based on the current code stream and the remaining code streams other than the current code stream, it is determined whether to identify the latest key frame of the first code stream that has been received to identify whether the latest key frame of the first code stream that has been received has completed the verification; the first code stream is a code stream whose first frame selected from the remaining code streams other than the current code stream is the code stream whose reception time is closest to the first frame of the current code stream;
[0007] If it is identified that the signature verification of the latest key frame of the first code stream that has been received has not been completed, a first pause duration is determined according to the signature verification start time of the latest key frame of the first code stream and the signature verification start time of the designated key frame of the current code stream; the first pause duration is used to indicate the duration of the suspension of transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame of the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame of the first code stream subsequently received meet the time proximity requirement; and / or,
[0008] If it is identified that the signature verification of the latest key frame received belonging to the first code stream has been completed, then check whether the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement; if so, determine the second suspension duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; the second suspension duration is used to indicate the duration of the suspension transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0009] The embodiment of the present application also provides an efficient multi-channel code stream signature verification device based on dynamic arrangement, which is applied to a code stream receiving end; the device includes:
[0010] an identification module, for determining, if it is determined that the signature of the designated key frame of the current code stream needs to be verified, whether to identify the latest key frame of the first code stream that has been received to identify whether the signature verification has been completed for the latest key frame of the first code stream that has been received, based on the current code stream and the remaining code streams other than the current code stream; the first code stream is a code stream whose first frame selected from the remaining code streams other than the current code stream is the closest to the reception time of the first frame of the current code stream;
[0011] A first determining module is used to determine a first pause duration according to a signature verification start time of the latest key frame belonging to the first code stream and a signature verification start time of a designated key frame of the current code stream if it is identified that the received latest key frame belonging to the first code stream has not completed signature verification; the first pause duration is used to indicate a duration for which a code stream transmission end of the current code stream pauses transmission, so that a signature verification start time of a key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and a signature verification end time of a latest key frame belonging to the first code stream subsequently received meet a time proximity requirement; and / or,
[0012] The second determining module is used for checking whether the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement if it is identified that the signature verification of the received latest key frame belonging to the first code stream has been completed; if so, determining the second suspension duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; the second suspension duration is used to indicate the duration of the suspension transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0013] The present application also provides an electronic device, the electronic device comprising:
[0014] Processor; and
[0015] A computer-readable storage medium stores computer program instructions, which, when executed by a processor, cause the processor to execute the steps of the above method.
[0016] An embodiment of the present application further provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps in the above method.
[0017] It can be seen from the above technical solutions that the embodiment of the present application first identifies whether the latest key frame currently received and belonging to the first code stream has completed the signature verification when determining that the designated key frame of the current code stream needs to be verified. Then, the pause duration is determined based on the identification result and the signature verification start time of the designated key frame of the current code stream. The pause duration is used to indicate the duration of the code stream transmission end of the current code stream to suspend transmission, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement, that is, the signature verification time period of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification time period of the latest key frame belonging to the first code stream subsequently received do not overlap, so that it can be ensured as much as possible that multiple other key frames will not be verified in the process of verifying a key frame, thereby avoiding the problem of competing for CPU resources between signature verification threads of multiple key frames, thereby improving the signature verification efficiency.
[0018] Furthermore, the embodiment of the present application can avoid processing the signature verification of multiple key frames in the same time period as much as possible by ensuring that the signature verification time period of the key frames belonging to the current code stream subsequently transmitted by the code stream transmission end does not overlap with the signature verification time period of the latest key frames belonging to the first code stream subsequently received. In this way, the resource occupancy rate of the CPU will not increase rapidly in the same time period, thereby avoiding situations such as the resource occupancy rate of the CPU exceeding the set safety threshold, causing the application at the code stream receiving end to freeze due to the inability to obtain CPU resources in time, and the operating system crashing. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in the specification and constitute a part of this application, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
[0020] Figure 1A A schematic diagram of the CPU resource occupancy provided in an embodiment of the present application.
[0021] Figure 1BA schematic diagram of another CPU resource occupancy situation provided in an embodiment of the present application.
[0022] Figure 2 A flow chart of the method provided in an embodiment of the present application.
[0023] Figure 3A A schematic diagram of signature verification provided in an embodiment of the present application.
[0024] Figure 3B Another signature verification schematic diagram provided for an embodiment of the present application.
[0025] Figure 3C Another signature verification schematic diagram provided for an embodiment of the present application.
[0026] Figure 3D Another signature verification schematic diagram provided for an embodiment of the present application.
[0027] Figure 3E Another signature verification schematic diagram provided for an embodiment of the present application.
[0028] Figure 3F Another signature verification schematic diagram provided for an embodiment of the present application.
[0029] Figure 3G Another signature verification schematic diagram provided for an embodiment of the present application.
[0030] Figure 3H Another signature verification schematic diagram provided for an embodiment of the present application.
[0031] Figure 4 This is a diagram of the device structure provided in an embodiment of the present application.
[0032] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] Before describing the solution provided by the embodiment of the present application, the traditional code stream signature verification solution and its existing technical problems are described first:
[0034] In the traditional code stream signature verification scheme, when the code stream frame transmitted by the code stream transmission end (such as a monitoring device, where the monitoring device can be a camera or other device) reaches the code stream receiving end, the code stream receiving end completes the signature verification of the frame belonging to the code stream. Here, the code stream refers to a continuous binary data stream transmitted through a certain transmission method (such as a network, cable, etc.); wherein the code stream can be composed of multiple frames, and the data obtained by encoding the image collected by the code stream transmission end can be referred to as a frame. Signature verification refers to the process of signature verification of a frame. As for how to implement signature verification of a frame, this embodiment does not specifically limit it.
[0035] In practical applications, a bitstream usually contains multiple types of frames, such as key frames (denoted as I frames), predicted frames (denoted as P frames), and bidirectional predicted frames (denoted as B frames). Among them, I frames have the largest amount of data, and their signature verification occupies more CPU resources than B frames and P frames. Figure 1A It should be noted that Figure 1A The number of B frames and P frames between two adjacent I frames shown in the figure is only an exemplary description, and this embodiment does not specifically limit the number of B frames and P frames between two adjacent I frames.
[0036] Based on the above description, Figure 1B As shown in the figure, when the code stream receiving end happens to process the I frame of the code stream transmitted by multiple monitoring devices (such as device A, device B and device C) at the same time, the CPU resource utilization rate will rise rapidly. Then, when processing B frames and P frames, since the data volume of B frames and P frames is relatively small compared to I frames, the CPU resources occupied by their signature verification are also much smaller than those of I frames, so the CPU resource utilization rate will drop rapidly. In this case, the following problems will occur:
[0037] 1) When the bitstream receiver verifies multiple I frames at the same time, the CPU resource usage rate will increase rapidly, which will cause the verification threads of each key frame to compete for CPU resources, thereby reducing the verification efficiency; and at this time, the CPU resource usage rate may exceed the set safety threshold (such as 90%), which may cause the application in the operating system running environment of the bitstream receiver to freeze due to failure to obtain CPU resources in time, and the operating system may crash;
[0038] 2) When the bitstream receiving end processes I frames, the CPU resource utilization rate will increase significantly, while when the bitstream receiving end processes B frames and P frames, the CPU resource utilization rate will decrease significantly. This will cause the CPU resource utilization rate to vary greatly, resulting in the phenomenon of "the CPU is very busy when busy and very idle when idle", making the CPU load unbalanced and causing waste of CPU resources.
[0039] To solve the above problems, the embodiment of the present application provides an efficient multi-channel code stream signature verification method based on dynamic arrangement. In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present application, and to make the above-mentioned purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the technical solution in the embodiment of the present application is further described in detail below with reference to the accompanying drawings.
[0040] See also Figure 2 , Figure 2This is a flow chart of the method provided in the embodiment of the present application. The method is applied to a code stream receiving end. In this embodiment, the code stream receiving end may be an electronic device such as a computer, a smart phone, and a laptop computer, and this embodiment does not specifically limit it. Figure 2 As shown, the process may include the following steps:
[0041] Step 201: if it is determined that the designated key frame of the current code stream needs to be verified, then based on the current code stream and the remaining code streams other than the current code stream, it is determined whether to identify the latest key frame that has been received and belongs to the first code stream to identify whether the latest key frame that has been received and belongs to the first code stream has completed the verification; if it is identified that the latest key frame that has been received and belongs to the first code stream has not completed the verification, step 202 is executed; if it is identified that the latest key frame that has been received and belongs to the first code stream has completed the verification, step 203 is executed.
[0042] In this embodiment, taking the monitoring scene as an example, at least one monitoring point control is deployed on the interface of the code stream receiving end. When the user clicks one of the monitoring point controls on the interface of the code stream receiving end, the code stream transmission end (such as the monitoring device) corresponding to the monitoring point will be triggered to start transmitting the frame obtained by encoding the collected image to the code stream receiving end, wherein the first frame transmitted to the code stream receiving end can be called the first frame of the code stream transmitted by the code stream transmission end corresponding to the monitoring point. Based on this, the current code stream is the code stream to which the first frame with the latest reception time among the first frames received belongs. Here, there is no specific limitation on the frame type of the first frame belonging to the code stream, for example, it can be a key frame.
[0043] In this embodiment, the first code stream refers to a code stream selected from remaining code streams except the current code stream, the first frame of which is closest to the receiving time of the first frame of the current code stream.
[0044] In this embodiment, for any code stream, when at least one frame belonging to the any code stream is received, it can be considered that the code stream receiving end has received the any code stream. Of course, the code stream receiving end will continue to receive other frames subsequently transmitted by the code stream transmitting end of the any code stream. Based on this, there are many ways to determine the designated key frame in this step 201. For example, as an embodiment, if the number of code streams currently obtained by the code stream receiving end is 1, the designated key frame is the first key frame of the current code stream. As another embodiment, if the number of code streams currently obtained by the code stream receiving end is greater than 1, the designated key frame is a non-first key frame of the current code stream. Here, the number of code streams refers to the number of remaining code streams other than the current code stream.
[0045] In this embodiment, as an embodiment, the non-first key frame in the current code stream as the designated key frame may be specifically determined, for example, including: after the signature verification of the first key frame of the current code stream is completed, first checking whether the time difference between the signature verification start time of the latest key frame belonging to the first code stream and the signature verification end time of the latest key frame belonging to the second code stream meets the time proximity requirement; then, if the time difference meets the time proximity requirement, a key frame belonging to the current code stream received subsequently is determined as the designated key frame; if the time difference does not meet the time proximity requirement, returning to the step of checking whether the time difference between the signature verification start time of the latest key frame belonging to the first code stream and the signature verification end time of the latest key frame belonging to the second code stream meets the time proximity requirement. Here, the second code stream refers to the code stream whose first frame selected from the remaining code streams except the current code stream is closest to the reception time of the first frame of the first code stream.
[0046] In this embodiment, as an embodiment, the time difference satisfies the time proximity requirement, which means that the time difference is less than or equal to the set time difference threshold; correspondingly, the time difference does not meet the time proximity requirement, which means that the time difference is greater than the set time difference threshold. The set time difference threshold here can be flexibly set based on actual needs, such as 1ms, 3ms, or 5ms, etc., and this embodiment does not make specific limitations.
[0047] As for how to determine whether to identify the latest key frame belonging to the first bitstream that has been received based on the current bitstream and the remaining bitstreams except the current bitstream in step 201, an example will be given below and will not be described here.
[0048] It should be noted that, in this embodiment, if it is determined that the designated key frame of the current code stream needs to be verified, then while executing the step of identifying whether the latest key frame belonging to the first code stream that has been received has completed the signature verification, the step of verifying the signature of the designated key frame of the current code stream is also executed, that is, the execution of these two steps does not affect each other.
[0049] Step 202: determining a first pause duration according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream; the first pause duration is used to indicate the duration of the code stream transmission end suspending transmission of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0050] In this embodiment, as an embodiment, for a received frame, it can be determined that the frame needs to be verified when the frame is received, that is, the moment when the frame is received is determined as the starting moment of the verification of the frame; or, the starting moment of the verification of the frame can also be other pre-specified moments, which is not specifically limited in this embodiment. Based on this, for example, the starting moment of the verification of the specified key frame of the current code stream can be the moment when it is determined that the specified key frame of the current code stream needs to be verified, or it can be other pre-specified moments, which is not specifically limited in this embodiment.
[0051] In this embodiment, if it is identified that the signature verification of the latest key frame belonging to the first code stream that has been received has not been completed, it means that the signature verification time period of the designated key frame of the current code stream overlaps with the signature verification time period of the latest key frame belonging to the first code stream. At this time, in order to ensure that the signature verification time period of the latest key frame belonging to the current code stream that is subsequently received does not overlap with the signature verification time period of the latest key frame belonging to the first code stream that is subsequently received, the first pause duration can be determined according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream.
[0052] Here, the first pause duration is used to indicate the duration of the code stream transmission end of the current code stream to suspend transmission, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement, that is, the signature verification time period of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification time period of the latest key frame belonging to the first code stream subsequently received do not overlap.
[0053] In this embodiment, the above-mentioned requirement of close temporal proximity is satisfied when the time difference between the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received is less than or equal to the set time difference threshold. As for setting the time difference threshold, as described above, it can be flexibly set based on actual needs.
[0054] As for how to determine the first pause duration in step 202 according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream, the following will give an example and will not be described here.
[0055] Step 203 , checking whether the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement; if yes, executing step 204 .
[0056] In this embodiment, if the latest key frame currently received belonging to the first code stream has completed the signature verification, it is first checked whether the time difference between the signature verification start time of the specified key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement; here, the time difference meets the code stream transmission suspension requirement means: the time difference is greater than the set time difference threshold.
[0057] If the above time difference meets the requirement for pausing bitstream transmission, it means that the time difference is greater than the set time difference threshold, that is, the signature verification start time of the specified key frame of the current bitstream is not close to the signature verification end time of the latest key frame belonging to the first bitstream (that is, the time proximity requirement is not met). At this time, although the signature verification time period of the specified key frame of the current bitstream does not overlap with the signature verification time period of the latest key frame belonging to the first bitstream, in order to make full use of the CPU resources at each moment, the bitstream transmission end of the current bitstream can also be controlled to suspend transmission so that the signature verification start time of the key frame belonging to the current bitstream subsequently transmitted by the bitstream transmission end and the signature verification end time of the latest key frame belonging to the first bitstream subsequently received meet the time proximity requirement.
[0058] Of course, if the above time difference does not meet the requirement of pausing code stream transmission, it means that the time difference is less than or equal to the set time difference threshold, that is, the signature verification start time of the specified key frame of the current code stream and the signature verification end time of the latest key frame belonging to the first code stream meet the time proximity requirement, and no processing is required at this time.
[0059] Step 204, determining a second pause duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; the second pause duration is used to indicate the duration of the code stream transmission end suspending transmission of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0060] In this embodiment, if the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement, the second suspension duration is determined according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; here, the second suspension duration is used to indicate the duration of the suspension transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0061] As for how to determine the second pause duration in step 204 according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame, an example will be given below and will not be described here.
[0062] So far, completed Figure 2 The process shown.
[0063] pass Figure 2 It can be seen from the flow that the embodiment of the present application first identifies whether the latest key frame currently received and belonging to the first code stream has completed the signature verification when determining that the designated key frame of the current code stream needs to be verified. Then, the pause duration is determined based on the identification result and the signature verification start time of the designated key frame of the current code stream. The pause duration is used to indicate the duration of the code stream transmission end suspending transmission of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement, that is, the signature verification time period of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification time period of the latest key frame belonging to the first code stream subsequently received do not overlap. In this way, it can be ensured as much as possible that during the process of verifying a key frame, multiple other key frames will not be verified, thereby avoiding the problem of competing for CPU resources between signature verification threads of multiple key frames, thereby improving the signature verification efficiency.
[0064] Furthermore, the embodiment of the present application can avoid processing the signature verification of multiple key frames in the same time period as much as possible by ensuring that the signature verification time period of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end does not overlap with the signature verification time period of the latest key frame belonging to the first code stream subsequently received, so as to prevent the resource occupancy rate of the CPU from increasing rapidly in the same time period, thereby preventing situations such as the resource occupancy rate of the CPU exceeding the set safety threshold, causing the application at the code stream receiving end to freeze due to the inability to obtain CPU resources in time, and the operating system crashing; and in this way, the resource occupancy rate of the above-mentioned CPU will not change greatly to cause the CPU load to be unbalanced, thereby avoiding the waste of CPU resources.
[0065] The following describes how to determine whether to identify the latest key frame belonging to the first code stream that has been received based on the current code stream and the remaining code streams other than the current code stream in the above step 201:
[0066] In this embodiment, there are many specific implementation methods for determining whether to identify the latest key frame that has been received and belongs to the first code stream based on the current code stream and the remaining code streams except the current code stream. For example, as an embodiment, if the number of code streams currently obtained by the code stream receiving end is 1, then when the designated key frame is the first key frame of the current code stream, it is determined that the latest key frame that has been received and belongs to the first code stream needs to be identified.
[0067] The code stream receiving end may be connected to multiple code stream transmitting ends, and the set key frame transmission period pre-configured for each code stream transmitting end is the same; here, the set key frame transmission period refers to the transmission time interval between any two adjacent key frames in the code stream. Based on this, as another embodiment, if the number of code streams currently obtained by the code stream receiving end is greater than 1, it is also necessary to first check whether the signature verification of the specified key frame belonging to the current code stream can be completed in addition to the signature verification of a key frame of the remaining code streams except the current code stream within the time period of the set key frame transmission period, that is, check whether the difference between the set key frame transmission period and the first total duration is greater than or equal to the signature verification duration of the first key frame in the current code stream; if so, it means that the signature verification of the specified key frame belonging to the current code stream can be completed within the time period of the set key frame transmission period, and at this time, it can be determined that the latest key frame belonging to the first code stream that has been received is identified; if not, it means that the signature verification of the specified key frame belonging to the current code stream cannot be completed within the time period of the set key frame transmission period, and at this time, it can be determined whether the latest key frame belonging to the first code stream that has been received is identified based on the second total duration and the set key frame transmission period.
[0068] The first total duration is the sum of the signature verification durations of the first key frames of all remaining code streams except the current code stream, and the second total duration is the sum of the signature verification durations of the first key frames of all code streams.
[0069] It should be noted that there are many ways to obtain the verification duration of the first key frame. For example, as an embodiment, the time difference between the moment when the verification of the first key frame ends and the moment when the verification starts can be determined as the verification duration of the first key frame.
[0070] As an embodiment, the above-mentioned determination of whether to identify the latest key frame belonging to the first code stream that has been received based on the second total duration and the set key frame transmission period can be implemented as follows: when the signature verification of the specified key frame belonging to the current code stream cannot be completed within the time period of the set key frame transmission period, it is also necessary to check whether the specified key frame of the current code stream is the first key frame that cannot complete the signature verification within the time period of the set key frame transmission period, that is, to check whether the difference between the second total duration and the set key frame transmission period is less than the set difference threshold. Here, the time difference threshold can be flexibly set based on actual needs, such as 40ms, 50ms, etc., and this embodiment does not make specific limitations.
[0071] If the difference between the second total duration and the set key frame transmission period is less than the set difference threshold, it means that the key frame of the current code stream is the first key frame that cannot complete the signature verification within the time period of the set key frame transmission period. At this time, the signature verification of the key frame of the current code stream can be arranged from the starting time of the time period of the set key frame transmission period, that is, the signature verification start time of the key frame belonging to the third code stream received subsequently and the signature verification start time of the key frame of the current code stream received subsequently meet the time proximity requirement, where the third code stream refers to the code stream with the largest difference in reception time between the first frame selected from the remaining code streams except the current code stream and the first frame of the current code stream; therefore, at this time, it is determined that there is no need to identify the latest key frame belonging to the first code stream that has been received, but a pause duration needs to be determined so that the signature verification start time of the key frame belonging to the third code stream received subsequently and the signature verification start time of the key frame of the current code stream received subsequently meet the time proximity requirement. As for how to make the signature verification start time of the key frame belonging to the third code stream received subsequently and the signature verification start time of the key frame of the current code stream received subsequently meet the time proximity requirement, an example will be given below and will not be repeated here.
[0072] If the difference between the above-mentioned second total duration and the set key frame transmission period is greater than or equal to the set difference threshold, it means that the key frame of the current code stream is not the first key frame that cannot complete the signature verification within the time period of the set key frame transmission period. At this time, it is determined that the latest key frame belonging to the first code stream that has been received needs to be identified.
[0073] For example, see Figure 3A As shown, code stream 3 is the current code stream, and code stream 1 and code stream 2 are the remaining code streams except the current code stream. It can be seen that the difference between the set key frame transmission period and the first total duration (that is, the sum of the signature verification durations of the first key frames belonging to code stream 1 and code stream 2) is greater than the signature verification duration of the first key frame in code stream 3, and the difference in signature verification durations of different key frames belonging to the same code stream is very small, which can be ignored in this embodiment. Therefore, within the time period of the set key frame transmission period, in addition to completing the signature verification of a key frame of code stream 1 and code stream 2, the signature verification of the specified key frame belonging to code stream 3 can also be completed.
[0074] For another exemplary example, see Figure 3BAs shown, code stream n is the current code stream, and code streams 1 to n-1 are the remaining code streams except the current code stream. It can be seen that the difference between the set key frame transmission period and the first total duration (i.e., the sum of the signature verification durations of the first key frames belonging to code streams 1 to n-1) is less than the signature verification duration of the first key frame in code stream n, and the difference between the signature verification durations of different key frames belonging to the same code stream is very small, which can be ignored in this embodiment. Therefore, the signature verification of the specified key frame belonging to code stream n cannot be completed within the time period of the set key frame transmission period. Moreover, at this time, the difference between the second total duration (i.e., the sum of the signature verification durations of the first key frames belonging to code streams 1 to n) and the set key frame transmission period is less than the set difference threshold, that is, the key frame of code stream n is the first key frame that cannot complete the signature verification within the time period of the set key frame transmission period. At this time, Figure 3B As shown, the signature verification start time of the key frame belonging to the code stream n received subsequently and the signature verification start time of the key frame belonging to the code stream 1 received subsequently meet the time proximity requirement.
[0075] The following describes how to make the signature verification start time of the key frame of the third code stream received subsequently and the signature verification start time of the key frame of the current code stream received subsequently meet the time proximity requirement after determining that the latest key frame of the first code stream received does not need to be identified:
[0076] As an embodiment, after determining that there is no need to identify the latest key frame received belonging to the first code stream, the method further includes: first checking whether the time difference between the signature verification start time of the latest key frame received belonging to the third code stream and the signature verification start time of the specified key frame of the current code stream meets the code stream transmission suspension requirement.
[0077] Afterwards, if the time difference between the signature verification start time of the latest key frame belonging to the third codestream and the signature verification start time of the designated key frame of the current codestream meets the codestream transmission suspension requirement, it means that the signature verification start time of the latest key frame belonging to the third codestream and the signature verification start time of the designated key frame of the current codestream do not meet the time proximity requirement. At this time, the third suspension duration can be determined according to the signature verification start time of the designated key frame of the current codestream and the signature verification start time of the latest key frame belonging to the third codestream; the third suspension duration here is used to indicate the duration of the suspension transmission of the codestream transmission end of the current codestream, so that the signature verification start time of the key frame belonging to the current codestream subsequently transmitted by the codestream transmission end and the signature verification start time of the latest key frame belonging to the third codestream subsequently received meet the time proximity requirement.
[0078] If the time difference between the signature verification start time of the latest key frame belonging to the third code stream and the signature verification start time of the specified key frame of the current code stream does not meet the code stream transmission suspension requirement, it means that the signature verification start time of the latest key frame belonging to the third code stream and the signature verification start time of the specified key frame of the current code stream meet the time proximity requirement, and no processing is required at this time.
[0079] As for how to determine the third pause duration based on the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame belonging to the third code stream, the following will give an example description and will not be repeated here.
[0080] The following describes how to determine the first pause duration based on the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the specified key frame of the current code stream:
[0081] As an embodiment, the first pause duration is determined according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream. In a specific implementation, for example, it can be as follows: first, check whether the latest key frame belonging to the first code stream is the first key frame belonging to the first code stream. If yes, when the signature verification of the latest key frame belonging to the first code stream ends, calculate the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the latest key frame of the first code stream as the second result. If not, it means that the signature verification of the first key frame belonging to the first code stream has ended and the signature verification duration of the first key frame belonging to the first code stream has also been obtained. At this time, the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the first key frame belonging to the first code stream can be calculated as the second result. Then, the first pause duration is determined according to the difference between the second result and the signature verification start time of the designated key frame of the current code stream.
[0082] In this embodiment, as an embodiment, the first pause duration is determined based on the difference between the second result and the signature verification start time of the specified key frame of the current code stream. There are many ways to implement it in specific implementation. For example, it can be: the difference between the second result and the signature verification start time of the specified key frame of the current code stream is determined as the first pause duration; for another example, it can be: the difference between the second result and the signature verification start time of the specified key frame of the current code stream is calculated, and the sum of the difference and the set duration is determined as the first pause duration. Here, the set duration can be set based on actual needs, for example, it can be 1ms, 2ms, or 3ms.
[0083] For example, see Figure 3CAs shown in the figure, assuming that the set key frame transmission period corresponding to the first code stream and the current code stream is 1s, and the key frame verification duration corresponding to the same code stream is the same, such as 50ms; when it is determined that the specified key frame of the current code stream needs to be verified, that is, when the verification start time of the specified key frame of the current code stream is 4s25ms, if the latest key frame currently received belonging to the first code stream has not completed the verification, the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is estimated to be 5s25ms. It can be seen that the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is the same as that of the first code stream. The signature verification end time of the key frame belonging to the first code stream subsequently transmitted by the code stream transmission end of the current code stream does not meet the time proximity requirement. At this time, the code stream transmission end of the current code stream can be controlled to suspend transmission so that the signature verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream and the signature verification end time of the key frame belonging to the first code stream subsequently received meet the time proximity requirement; for example, the code stream transmission end of the current code stream can be controlled to suspend transmission so that the signature verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is equal to the signature verification end time of the key frame belonging to the first code stream subsequently received (that is, 5s50ms). Figure 3D As shown, the duration of the pause at the code stream transmission end of the current code stream can be the difference between the signature verification end time of the latest key frame belonging to the first code stream (ie, 4s50ms) and the signature verification start time of the specified key frame belonging to the current code stream (ie, 4s25ms), which is 25ms.
[0084] The following describes how to determine the second pause duration based on the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the specified key frame:
[0085] As an embodiment, the second pause duration is determined based on the end time of signature verification of the latest key frame belonging to the first code stream and the start time of signature verification of the specified key frame. In a specific implementation, for example, the sum of the end time of signature verification of the latest key frame belonging to the first code stream and the set key frame transmission period is first calculated as the third result; then, the second pause duration is determined based on the difference between the third result and the start time of signature verification of the specified key frame.
[0086] In this embodiment, as an embodiment, the second pause duration is determined based on the difference between the third result and the start time of signature verification of the specified key frame. There are many ways to implement it in specific implementation, for example, it can be: the difference between the third result and the start time of signature verification of the specified key frame is determined as the second pause duration; for another example, it can be: the difference between the third result and the start time of signature verification of the specified key frame is calculated, and the sum of the difference and the set duration is determined as the second pause duration; as described above, the set duration here can be set based on actual needs, for example, it can be 1ms, 2ms, or 3ms, etc.
[0087] For example, see Figure 3E As shown in the figure, assuming that the set key frame transmission period corresponding to the first code stream and the current code stream is 1s, and the key frame verification duration corresponding to the same code stream is the same, such as 50ms; when it is determined that the specified key frame of the current code stream needs to be verified, that is, when the verification start time of the specified key frame of the current code stream is 4s75ms, if the latest key frame currently received belonging to the first code stream has completed the verification, then the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is estimated to be 5s75ms. It can be seen that the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is the same as that of the first code stream. The signature verification end time of the key frame belonging to the first code stream subsequently transmitted by the code stream transmission end of the current code stream does not meet the time proximity requirement. At this time, the code stream transmission end of the current code stream can be controlled to suspend transmission so that the signature verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream and the signature verification end time of the key frame belonging to the first code stream subsequently received meet the time proximity requirement; for example, the code stream transmission end of the current code stream can be controlled to suspend transmission so that the signature verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is equal to the signature verification end time of the key frame belonging to the first code stream subsequently received (that is, 6s50ms). Figure 3F As shown, the duration of the pause at the code stream transmission end of the current code stream can be the difference between the sum of the signature verification end time of the latest key frame belonging to the first code stream and the set key frame transmission period (i.e. 4s50ms+1s=5s50ms) and the signature verification start time of the specified key frame belonging to the current code stream (i.e. 4s75ms), which is 975ms.
[0088] The following describes how to determine the third pause duration according to the signature verification start time of the specified key frame of the current code stream and the signature verification start time of the latest key frame belonging to the third code stream:
[0089] As an embodiment, the third pause duration is determined according to the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame belonging to the third code stream. In a specific implementation, for example, the sum of the signature verification start time of the latest key frame belonging to the third code stream and the set key frame transmission period is first calculated as the first result; then, the third pause duration is determined according to the difference between the first result and the signature verification start time of the designated key frame of the current code stream.
[0090] In this embodiment, as an embodiment, the third pause duration is determined based on the difference between the first result and the signature verification start time of the specified key frame of the current code stream. There are many ways to implement it in specific implementation. For example, it can be: the difference between the first result and the signature verification start time of the specified key frame of the current code stream is determined as the third pause duration; for another example, it can be: the difference between the first result and the signature verification start time of the specified key frame of the current code stream is calculated, and the sum of the difference and the set duration is determined as the third pause duration; as described above, the set duration here can be set based on actual needs, for example, it can be 1ms, 2ms, or 3ms.
[0091] For example, see Figure 3G As shown, assuming that the set key frame transmission period corresponding to the third code stream and the current code stream is 1s, and the key frame verification duration corresponding to the same code stream is the same, such as 50ms; it can be seen that the time difference of 25ms between the verification start time of the latest key frame belonging to the third code stream (i.e. 4s) and the verification start time of the specified key frame of the current code stream (i.e. 4s25ms) is less than the set time difference threshold of 3ms, that is, the code stream transmission suspension requirement is met. At this time, the code stream transmission end of the current code stream can be controlled to suspend transmission so that the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream and the verification start time of the key frame belonging to the third code stream subsequently received meet the time proximity requirement; for example, by controlling the code stream transmission end of the current code stream to suspend transmission so that the verification start time of the key frame subsequently transmitted by the code stream transmission end of the current code stream is equal to the verification start time of the key frame belonging to the third code stream subsequently received (i.e. 6s), as shown Figure 3H As shown, the duration of the pause of the code stream transmission end of the current code stream can be the difference between the sum of the signature verification start time of the latest key frame belonging to the third code stream and the set key frame transmission period (i.e. 4s+1s=5s) and the signature verification start time of the specified key frame belonging to the current code stream (i.e. 4s25ms), which is 975ms.
[0092] The following describes how to issue an alarm based on CPU resource usage:
[0093] As an embodiment, after the bitstream receiving end is started, a resource monitoring thread is started to monitor the resource occupancy rate of the CPU. When it is found that the resource occupancy rate of the CPU exceeds the set safety threshold (such as 85%, 90%, etc.), an alarm prompt is output to indicate that the current CPU resource occupancy rate exceeds the set safety threshold, so as to prompt relevant operation and maintenance personnel to handle the alarm in time to ensure the operation stability of the bitstream receiving end.
[0094] At this point, the description of the method provided in this embodiment is completed. The following is a description of the device provided in this embodiment of the application:
[0095] As an embodiment, this embodiment also provides an efficient multi-channel code stream signature verification device based on dynamic arrangement. Figure 4 , Figure 4 A schematic diagram of the device structure provided in an embodiment of the present application.
[0096] like Figure 4 As shown, the device 400 is applied to a code stream receiving end; the device includes:
[0097] The identification module 401 is used to determine whether to identify the latest key frame of the first code stream that has been received to identify whether the signature verification has been completed based on the current code stream and the remaining code streams other than the current code stream if it is determined that the signature verification needs to be performed on the designated key frame of the current code stream; the first code stream is a code stream whose first frame selected from the remaining code streams other than the current code stream is the closest to the reception time of the first frame of the current code stream;
[0098] The first determining module 402 is configured to determine a first pause duration according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream if it is identified that the signature verification of the latest key frame belonging to the first code stream that has been received has not been completed; the first pause duration is used to indicate the duration of the suspension of transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the requirement of close temporal proximity; and / or,
[0099] The second determining module 403 is used to check whether the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement if it is identified that the signature verification of the received latest key frame belonging to the first code stream has been completed; if so, determine the second suspension duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; the second suspension duration is used to indicate the duration of the suspension transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
[0100] As an embodiment, if the number of code streams currently obtained by the code stream receiving end is 1, the designated key frame is the first key frame of the current code stream; the number of code streams refers to the number of remaining code streams except the current code stream;
[0101] When the designated key frame is the first key frame of the current code stream, it is determined that the latest key frame belonging to the first code stream that has been received needs to be identified.
[0102] As an embodiment, the time difference satisfies the code stream transmission suspension requirement, which means that: the time difference is greater than a set time difference threshold;
[0103] When the time difference between the signature verification start time of the specified key frame and the signature verification end time of the latest key frame belonging to the first code stream is greater than the set time difference threshold, it means that the signature verification start time of the specified key frame and the signature verification end time of the latest key frame belonging to the first code stream do not meet the time proximity requirement.
[0104] As an embodiment, if the number of code streams currently obtained by the code stream receiving end is greater than 1, the designated key frame is a non-first key frame of the current code stream; the number of code streams refers to the number of remaining code streams except the current code stream;
[0105] Among them, after the signature verification of the first key frame of the current code stream is completed, if the time difference between the signature verification start time of the latest key frame belonging to the first code stream and the signature verification end time of the latest key frame belonging to the second code stream meets the time proximity requirement, then a key frame belonging to the current code stream that is subsequently received is determined as the designated key frame; the second code stream is the code stream whose first frame selected from the remaining code streams except the current code stream is the code stream whose reception time is closest to the first frame of the first code stream.
[0106] As an embodiment, the identification module is specifically used for:
[0107] Check whether the difference between the set key frame transmission period and the first total duration is greater than or equal to the signature verification duration of the first key frame in the current code stream. If so, determine to identify the latest key frame belonging to the first code stream that has been received. If not, determine whether to identify the latest key frame belonging to the first code stream that has been received based on the second total duration and the set key frame transmission period; the first total duration is the sum of the signature verification durations of the first key frames of the remaining code streams except the current code stream; the second total duration is the sum of the signature verification durations of the first key frames in all code streams;
[0108] If the difference between the second total duration and the set key frame transmission period is less than the set difference threshold, it is determined that there is no need to identify the latest key frame received belonging to the first code stream; otherwise, it is determined that the latest key frame received belonging to the first code stream needs to be identified.
[0109] As an embodiment, when it is determined that there is no need to identify the latest key frame that has been received and belongs to the first bitstream, the device further includes:
[0110] The third determining module is used to determine a third pause duration according to the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame of the third code stream, when the time difference between the signature verification start time of the latest key frame of the third code stream received and the signature verification start time of the designated key frame of the current code stream meets the code stream transmission suspension requirement; the third code stream is a code stream with the largest difference in reception time between the first frame selected from the remaining code streams except the current code stream and the first frame of the current code stream; the third pause duration is used to indicate the duration of the code stream transmission end suspending transmission of the current code stream, so that the signature verification start time of the key frame of the current code stream subsequently transmitted by the code stream transmission end and the signature verification start time of the latest key frame of the third code stream subsequently received meet the time proximity requirement.
[0111] As an embodiment, determining the third pause duration according to the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame belonging to the third code stream includes:
[0112] Calculate the sum of the signature verification start time of the latest key frame belonging to the third code stream and the set key frame transmission period as the first result;
[0113] The third pause duration is determined according to the difference between the first result and the signature verification start time of the designated key frame of the current code stream.
[0114] As an embodiment, the first determining module 402 is specifically configured to:
[0115] Check whether the latest key frame belonging to the first code stream is the first key frame belonging to the first code stream. If yes, when the signature verification of the latest key frame belonging to the first code stream ends, calculate the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the latest key frame of the first code stream as the second result. If no, calculate the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the first key frame belonging to the first code stream as the second result.
[0116] The first pause duration is determined according to the difference between the second result and the signature verification start time of the designated key frame of the current code stream.
[0117] As an embodiment, the second determining module 403 is specifically configured to:
[0118] Calculate the sum of the signature verification end time of the latest key frame belonging to the first code stream and the set key frame transmission period as the third result;
[0119] The second pause duration is determined according to the difference between the third result and the signature verification start time of the specified key frame.
[0120] So far, completed Figure 4Structural description of the device shown.
[0121] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0122] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0123] See also Figure 5 , is a schematic diagram of the hardware structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device may include a processor 501, a communication interface 502, a computer-readable storage medium 503 and a communication bus 504. The processor 501, the communication interface 502 and the computer-readable storage medium 503 communicate with each other through the communication bus 504. Among them, computer program instructions are stored on the computer-readable storage medium 503; the processor 501 can execute the steps of the method described in the above embodiment by executing the computer program instructions stored on the computer-readable storage medium 503. The electronic device may also include other hardware according to the actual function of the electronic device, which will not be described in detail.
[0124] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, on which a number of computer program instructions are stored. When the computer program instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.
[0125] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof. The processor and memory may be supplemented by or incorporated into a dedicated logic circuit.
[0126] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An efficient multi-channel code stream signature verification method based on dynamic arrangement, characterized in that: The method is applied to a code stream receiving end; the method comprises: If it is determined that the designated key frame of the current code stream needs to be verified, then based on the current code stream and the remaining code streams other than the current code stream, it is determined whether to identify the latest key frame of the first code stream that has been received to identify whether the latest key frame of the first code stream that has been received has completed the verification of the signature; the first code stream is a code stream whose first frame selected from the remaining code streams other than the current code stream is the closest to the reception time of the first frame of the current code stream; If it is identified that the received latest key frame belonging to the first code stream has not completed the signature verification, a first pause duration is determined according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream; the first pause duration is used to indicate the duration of the code stream transmission end suspending transmission of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement; and / or, If it is identified that the received latest key frame belonging to the first code stream has completed signature verification, check whether the time difference between the signature verification start time of the designated key frame and the signature verification end time of the latest key frame belonging to the first code stream meets the code stream transmission suspension requirement; if so, determine the second suspension duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame; the second suspension duration is used to indicate the duration of suspension of transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame belonging to the current code stream subsequently transmitted by the code stream transmission end and the signature verification end time of the latest key frame belonging to the first code stream subsequently received meet the time proximity requirement.
2. The method according to claim 1, characterized in that If the number of code streams currently obtained by the code stream receiving end is 1, the designated key frame is the first key frame of the current code stream; the number of code streams refers to the number of remaining code streams except the current code stream; When the designated key frame is the first key frame of the current code stream, it is determined that the latest key frame that has been received and belongs to the first code stream needs to be identified.
3. The method according to claim 2, characterized in that The time difference meeting the code stream transmission suspension requirement means that: the time difference is greater than a set time difference threshold; When the time difference between the signature verification start time of the specified key frame and the signature verification end time of the latest key frame belonging to the first code stream is greater than the set time difference threshold, it means that the signature verification start time of the specified key frame and the signature verification end time of the latest key frame belonging to the first code stream do not meet the time proximity requirement.
4. The method according to claim 1, characterized in that: If the number of code streams currently obtained by the code stream receiving end is greater than 1, the designated key frame is a non-first key frame of the current code stream; the number of code streams refers to the number of remaining code streams except the current code stream; Among them, after the signature verification of the first key frame of the current code stream is completed, if the time difference between the signature verification start time of the latest key frame belonging to the first code stream and the signature verification end time of the latest key frame belonging to the second code stream that have been received meets the time proximity requirement, then a key frame belonging to the current code stream that is subsequently received is determined as the designated key frame; the second code stream is a code stream whose first frame selected from the remaining code streams except the current code stream is the code stream whose reception time is closest to the first frame of the first code stream.
5. The method according to claim 4, characterized in that The determining whether to identify the latest key frame belonging to the first code stream that has been received based on the current code stream and the remaining code streams except the current code stream includes: Check whether the difference between the set key frame transmission period and the first total duration is greater than or equal to the signature verification duration of the first key frame in the current code stream. If so, determine to identify the latest key frame belonging to the first code stream that has been received. If not, determine whether to identify the latest key frame belonging to the first code stream that has been received based on the second total duration and the set key frame transmission period; the first total duration is the sum of the signature verification durations of the first key frames of the remaining code streams except the current code stream; the second total duration is the sum of the signature verification durations of the first key frames in all code streams; If the difference between the second total duration and the set key frame transmission period is less than the set difference threshold, it is determined that there is no need to identify the latest key frame received belonging to the first code stream; otherwise, it is determined that the latest key frame received belonging to the first code stream needs to be identified.
6. The method according to claim 1 or 5, characterized in that: When it is determined that there is no need to identify the latest key frame that has been received and belongs to the first code stream, the method further includes: In the case where the time difference between the signature verification start time of the latest key frame of the third code stream that has been received and the signature verification start time of the designated key frame of the current code stream meets the code stream transmission suspension requirement, the third suspension duration is determined according to the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame of the third code stream; the third code stream is the code stream with the largest difference in reception time between the first frame selected from the remaining code streams except the current code stream and the first frame of the current code stream; the third suspension duration is used to indicate the duration of the suspension transmission of the code stream transmission end of the current code stream, so that the signature verification start time of the key frame of the current code stream that is subsequently transmitted by the code stream transmission end and the signature verification start time of the latest key frame of the third code stream that is subsequently received meet the time proximity requirement.
7. The method according to claim 6, characterized in that The determining of the third pause duration according to the signature verification start time of the designated key frame of the current code stream and the signature verification start time of the latest key frame belonging to the third code stream includes: Calculate the sum of the signature verification start time of the latest key frame belonging to the third code stream and the set key frame transmission period as the first result; A third pause duration is determined according to a difference between the first result and a signature verification start time of a designated key frame of the current code stream.
8. The method according to claim 2 or 4, characterized in that: The determining of the first pause duration according to the signature verification start time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame of the current code stream comprises: Check whether the latest key frame belonging to the first code stream is the first key frame belonging to the first code stream. If yes, when the signature verification of the latest key frame belonging to the first code stream ends, calculate the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the latest key frame of the first code stream as the second result. If no, calculate the sum of the signature verification start time of the latest key frame belonging to the first code stream and the signature verification duration of the first key frame belonging to the first code stream as the second result. The first pause duration is determined according to a difference between the second result and a signature verification start time of a designated key frame of the current code stream.
9. The method according to claim 2 or 4, characterized in that: The determining of the second pause duration according to the signature verification end time of the latest key frame belonging to the first code stream and the signature verification start time of the designated key frame comprises: Calculate the sum of the signature verification end time of the latest key frame belonging to the first code stream and the set key frame transmission period as the third result; The second pause duration is determined according to the difference between the third result and the signature verification start time of the designated key frame.
10. An electronic device, characterized in that: include: processor; as well as A computer-readable storage medium, wherein computer program instructions are stored in the computer-readable storage medium, and when the computer program instructions are executed by the processor, the processor executes the steps in any one of the methods of claims 1 to 9.
Citation Information
Patent Citations
Code stream signature verification method, device, electronic equipment and computer readable medium
CN113810779A
Code stream data authentication method, computer equipment and storage medium
CN117956176A
