Test method based on high-concurrency video stream
Through the testing method of simulating high concurrent video streams, the video stream processing problem of deep learning algorithms in complex environments is solved, the stability and reliability testing of video streaming is achieved, and the development process is simplified.
Patent Information
- Application Number
- CN202411266224.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-06
AI Technical Summary
In real applications, deep learning algorithms have test problems in video stream processing in complex environments and high-pressure scenarios, especially for storage and transmission systems with thousands or even tens of thousands of real-time video streams. It is difficult for existing technology to effectively carry out deep depth. Early testing and optimization of learning algorithms.
Provide a test method based on high concurrency video stream. By simulating a high concurrency and high pressure environment, using push stream and pull stream servers, obtain the pull state of the video stream, judge the concurrent inference conditions, and segment the video frame for identification and inference. Generate test results to achieve automated load balancing and fault detection.
This method can efficiently complete the testing of deep learning algorithms, ensure the stability and reliability of video streaming, simplify the testing process in real video processing scenarios, and improve development efficiency and system reliability.
Smart Images

Figure CN119094816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video transmission, and in particular to a testing method based on high-concurrency video streams. Background Art
[0002] With the rapid development of AI algorithms, more and more AI (Artificial Intelligence)-based applications are being implemented in video streaming scenarios, such as smart security, smart cities, and smart transportation. The use of these algorithms can significantly improve the original video streaming scenario decision-making and automation capabilities. In recent years, with the significant improvement in processor performance, large-scale application processor cluster training of deep learning algorithms has become a hot spot for AI applications. Compared with traditional AI algorithms based on machine learning, pattern recognition, etc., deep learning algorithms have significant advantages in recognition accuracy, running speed, and accuracy in dealing with complex scenarios.
[0003] However, judging from the current status of scientific research and application practices, due to the more complex environment, greater load and pressure, and more stringent reliability requirements in real application scenarios, although AI algorithms based on deep learning are becoming increasingly mature in scientific research institutions, they are still at the forefront in real-world applications.
[0004] Real-time video stream storage and transmission are already quite mature. In real projects, thousands or even tens of thousands of real-time video stream storage systems are already very common. However, applying deep learning algorithms to such high-pressure scenarios is still at the forefront and requires complex algorithm optimization, stress testing, security and privacy assessment, etc. Video streams in real scenes come from real devices, but it is obviously unrealistic to use hundreds or thousands of video acquisition devices for the early testing of DL (Deep Learning) target detection algorithms. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a testing method based on high-concurrency video streams, which simulates a transmission test of video streams in a high-concurrency and high-pressure environment, thereby assisting developers to use real-time video stream local simulation, high-concurrency and high-availability push and pull streams, automatic load balancing and various automatic system judgments, log storage and other testing processes to efficiently complete the deep learning algorithm testing work in real video processing scenarios. The specific technical solution is as follows:
[0006] In a first aspect of the implementation of the present invention, a test method based on high concurrent video streams is first provided, characterized in that the method is applied to a test system, the test system includes a push stream server and a pull stream server, and the method includes:
[0007] Get the video stream to be tested;
[0008] In response to the streaming instruction sent by the streaming server, the video stream to be tested is pushed to a preset test address;
[0009] In response to the stream pulling instruction sent by the stream pulling server, pull the video stream to be tested from the test address;
[0010] Obtaining a pull status of the video stream to be tested, and determining whether to perform concurrent reasoning on the video stream to be tested according to the pull status;
[0011] When the pull state satisfies the preset concurrent reasoning condition, the video stream to be tested is divided into a plurality of video frames, and each of the video frames is identified and reasoned to obtain a reasoning result for each of the video frames;
[0012] The inference results are combined to generate a test result for the test system.
[0013] Optionally, obtaining the video stream to be tested includes:
[0014] Get the video file path;
[0015] Read the video file path to obtain the local video under the video file path;
[0016] Randomly selecting a video stream to be tested from the local video, and determining a first test quantity corresponding to the video stream to be tested;
[0017] The step of pushing the video stream to be tested to a preset test address in response to the streaming instruction sent by the streaming server includes:
[0018] According to the streaming instruction, a streaming mode for the video stream to be tested is configured;
[0019] Acquire a local network address, select a test address from the local network address according to the first test quantity, and number the test address;
[0020] Assign corresponding test addresses to the video streams to be tested in order according to the numbers;
[0021] The video stream to be tested is pushed to the test address according to the streaming mode.
[0022] Optionally, obtaining the pulling status of the video stream to be tested, and judging whether to perform concurrent reasoning on the video stream to be tested according to the pulling status, includes:
[0023] Preset pull failure threshold and inference conditions;
[0024] Obtaining the pulling status of the video stream to be tested, wherein the pulling status includes pulling success and pulling failure;
[0025] Counting the pull numbers corresponding to the pull state to obtain a first stream pull number and a second stream pull number, wherein the first stream pull number is used to indicate the number of video streams to be tested whose pull state is the pull success, and the second stream pull number is used to indicate the number of video streams to be tested whose pull state is the pull failure;
[0026] Compare the second stream pulling quantity with the stream pulling failure threshold;
[0027] When the second stream pulling quantity is greater than the stream pulling failure threshold, determining that the pulling state does not meet the concurrent reasoning condition, interrupting the current test process for the test system, performing fault detection on the test system and generating a fault report for the test system;
[0028] When the second stream pulling quantity is less than or equal to the stream pulling failure threshold, it is determined that the pulling state satisfies the concurrent reasoning condition.
[0029] Optionally, the video stream to be tested includes a plurality of continuous video frames, and obtaining the pulling state of the video stream to be tested includes:
[0030] Continuously monitoring the pulling process of the video stream to be tested, and if continuous video frames are received, determining that the pulling state of the video stream to be tested corresponding to the video frames is successful;
[0031] If an intermittent video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is a pull failure;
[0032] Alternatively, if a clear video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is successfully pulled;
[0033] If a blurred video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is a pull failure;
[0034] Alternatively, if the delay time of the received video frame is less than or equal to a preset delay time threshold, it is determined that the pull state of the video stream to be tested corresponding to the video frame is successfully pulled;
[0035] If the delay time of the received video frame is greater than the delay time threshold, it is determined that the pulling state of the video stream to be tested corresponding to the video frame is a pulling failure.
[0036] Optionally, the test system further includes a processor, and before dividing the video stream to be tested into a plurality of video frames and performing recognition and reasoning on each of the video frames, the method further includes:
[0037] Counting the number of the processors;
[0038] Comparing the number of processors with a preset processor threshold, and performing load balancing processing on the test system when the number of processors is greater than or equal to the processor threshold;
[0039] When the number of the processors is less than the processor threshold, concurrent reasoning is performed on the video stream to be tested.
[0040] Optionally, the performing load balancing processing on the test system includes:
[0041] Obtaining a second test quantity corresponding to the test address;
[0042] Calculating a real-time video stream load number for each processor according to the number of the processors and the second test number;
[0043] Corresponding concurrent reasoning tasks are allocated to the processor according to the real-time video stream load number, and concurrent reasoning is performed on the video stream to be tested based on the concurrent reasoning tasks.
[0044] Optionally, the method further includes:
[0045] Create multiple threads;
[0046] The concurrent reasoning tasks are allocated to corresponding threads according to the number of the processors, and each of the threads is used to process at least one of the video streams to be tested.
[0047] In a second aspect of the present invention, a test device based on high concurrent video streams is provided, wherein the device comprises:
[0048] An acquisition module is used to acquire the video stream to be tested;
[0049] A streaming module, configured to push the video stream to be tested to a preset test address in response to a streaming instruction sent by the streaming server;
[0050] A stream pulling module, configured to pull the video stream to be tested from the test address in response to a stream pulling instruction sent by the stream pulling server;
[0051] A judgment module, used for obtaining the pulling state of the video stream to be tested, and judging whether to perform concurrent reasoning on the video stream to be tested according to the pulling state;
[0052] An inference module, used for dividing the video stream to be tested into a plurality of video frames, identifying and inferring each of the video frames, and obtaining an inference result for each of the video frames when the pull state meets a preset concurrent inference condition;
[0053] The result generating module is used to merge the reasoning results to generate a test result for the test system.
[0054] In a third aspect of the implementation of the present invention, there is also provided a communication device, comprising: a transceiver, a memory, a processor, and a program stored in the memory and executable on the processor;
[0055] The processor is used to read the program in the memory to implement and execute any of the above-mentioned testing methods based on high-concurrency video streams.
[0056] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes any of the above-mentioned testing methods based on high-concurrency video streams.
[0057] The test method based on high-concurrency video stream provided by the embodiment of the present invention obtains the video stream to be tested; in response to the push instruction sent by the push server, the video stream to be tested is pushed to a preset test address; in response to the pull instruction sent by the pull server, the video stream to be tested is pulled from the test address; the pull status of the video stream to be tested is obtained, and whether to perform concurrent reasoning on the video stream to be tested is determined according to the pull status; when the pull status meets the preset concurrent reasoning condition, the video stream to be tested is divided into several video frames, each video frame is identified and reasoned, and the reasoning result for each video frame is obtained; the reasoning results are merged to generate the test result for the test system. The embodiment of the present invention simulates a transmission test of the video stream in a high-concurrency and high-pressure environment, thereby assisting developers to use the real-time video stream local simulation, high-concurrency and high-availability push and pull, automatic load balancing and various automatic system judgments, log preservation and other testing processes to efficiently complete the deep learning algorithm testing work in the real video processing scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0059] Figure 1 A flowchart of a test method based on high concurrent video streams provided by an embodiment of the present invention;
[0060] Figure 2A flowchart of the steps of concurrent streaming in a test method based on high concurrent video streams provided by an embodiment of the present invention;
[0061] Figure 3 A flowchart of the steps of concurrent streaming in a test method based on high concurrent video streams provided by an embodiment of the present invention;
[0062] Figure 4 A flow chart of the steps of performing load balancing in a test method based on high concurrent video streams provided by an embodiment of the present invention;
[0063] Figure 5 It is a structural schematic diagram of a test device based on high concurrent video streams provided by an embodiment of the present invention;
[0064] Figure 6 It is a structural diagram of a communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0065] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0066] Reference Figure 1 , shows a flowchart of the steps of a test method based on high concurrent video streams provided by an embodiment of the present invention, the method is applied to a test system, the test system includes a push stream server and a pull stream server, and the method may include:
[0067] Step 101: Obtain a video stream to be tested.
[0068] In an embodiment of the present invention, developers can specify the path of the local video file through a configuration file or a command line parameter, and can also specify a single or multiple paths when performing a test. The embodiment of the present invention does not specifically limit this. The video stream of a single path can only push one file. On the other hand, developers can specify the number of video streams pushed for each video file.
[0069] RTSP (Real Time Streaming Protocol) is a network control protocol used to control streaming media servers. After specifying the file path and the number of video streams, start the RTSP streaming service synchronously to push the video stream to the specified target. At the same time, start the relevant port monitoring by running the script to complete the preparation before streaming. The specific process is as follows:
[0070] Get the video file path.
[0071] Read the video file path to obtain the local video under the video file path.
[0072] A video stream to be tested is randomly selected from the local video, and a first test quantity corresponding to the video stream to be tested is determined.
[0073] In the embodiment of the present invention, the video file can also be encoded into a format suitable for network transmission, and then the video stream data is sent to the target server through the RTSP protocol, and the streaming process is monitored to ensure stable transmission of the video stream.
[0074] Step 102, in response to the streaming instruction sent by the streaming server, pushes the video stream to be tested to a preset test address. The specific execution steps include:
[0075] Configure the streaming mode for the video stream to be tested according to the streaming instructions;
[0076] Obtaining a local network address, selecting a test address from the local network address according to the first test quantity, and numbering the test address;
[0077] Assign corresponding test addresses to the video streams to be tested in sequence according to the numbers;
[0078] Push the video stream to be tested to the test address in push mode.
[0079] Among them, in an embodiment of the present invention, developers can set different streaming modes according to different test requirements. In one example, the streaming mode can be set by default to loop streaming for continuous testing. Developers can select a reasonable streaming mode according to the syntax requirements of FFMPEG (Fast Forward MPEG, a multimedia processing tool). FFMPEG is an open source multimedia framework that can parse, transcode, encode, decode and stream most types of audio and video formats. For example, according to the syntax requirements of FFMPEG, the streaming parameters are configured. The streaming parameters include the speed of reading the input file, the input file, the encoding used for video and audio encoding, the output format and the target address.
[0080] In addition, the embodiment of the present invention can set the transmission protocol to TCP (Transmission Control Protocol) to enhance reliability, use the multi-threaded characteristics of the server to run concurrent streaming, and finally automatically allocate the test address of each video stream in sequence, and its format is:
[0081] rtsp: / / 127.0.0.1:8554 / [No]
[0082] In one embodiment of the present invention, by setting the IP address (Internet Protocol Address) as the local network address, local video stream simulation can be achieved, and the commonly used transmission port 8554 of the RTSP protocol is used. Finally, [No] is allocated according to the total number of video streams determined by the developer, starting with 0, for example:
[0083] rtsp: / / 127.0.0.1:8554 / 0
[0084] Step 103: In response to the stream pulling instruction sent by the stream pulling server, pull the video stream to be tested from the test address.
[0085] After the push process of the video stream to be tested is completed, a stream pulling instruction sent from the stream pulling server is received and responded to, where the stream pulling instruction is used to instruct to pull the video stream to be tested from the test address.
[0086] Step 104, obtaining the pulling status of the video stream to be tested, and determining whether to perform concurrent reasoning on the video stream to be tested according to the pulling status.
[0087] The embodiment of the present invention can continuously monitor the process of pulling the video stream to be tested, and after the pulling process is completed, analyze the pulling status of the video stream to be tested, the pulling status can be divided into successful pulling and failed pulling, and count the number of successfully pulled video streams to be tested and the number of failed pulled video streams to be tested. When the number of failed pulled video streams exceeds the failure threshold preset by the developer, the test process is automatically interrupted, the test system is fault detected and a fault report of the test is generated, so that the developer can troubleshoot and repair the actual video transmission environment according to the fault report. The specific steps are as follows:
[0088] Preset pull failure threshold and inference conditions;
[0089] Get the pull status of the video stream to be tested, which includes pull success and pull failure;
[0090] Count the pull numbers corresponding to the pull status to obtain a first pull number and a second pull number, wherein the first pull number is used to indicate the number of video streams to be tested whose pull status is successful, and the second pull number is used to indicate the number of video streams to be tested whose pull status is failed;
[0091] Compare the second stream pulling quantity with the stream pulling failure threshold;
[0092] When the second stream pulling quantity is greater than the stream pulling failure threshold, it is determined that the pulling state does not meet the concurrent reasoning condition, the current test process for the test system is interrupted, a fault detection is performed on the test system, and a fault report for the test system is generated;
[0093] When the second stream pulling quantity is less than or equal to the stream pulling failure threshold, it is determined that the pulling state meets the concurrent reasoning condition.
[0094] Through the above steps, the pulling status of the video stream can be automatically monitored, and when the number of pulling failures exceeds the preset threshold, problems can be discovered in time, and fault detection and reporting can be performed, thereby ensuring the stability and reliability of the test system.
[0095] In one embodiment of the present invention, the video stream to be tested includes a plurality of continuous video frames, and the pulling state of the video stream to be tested is monitored and determined in detail. The determination criteria may include continuity determination, clarity determination and delay time determination. The specific steps may include:
[0096] Continuously monitor the pulling process of the video stream to be tested. If continuous video frames are received, that is, there is no obvious gap between the video frames, it is determined that the pulling state of the video stream to be tested corresponding to the video frame is pulled successfully.
[0097] If intermittent video frames are received, that is, there are obvious gaps between the video frames, it is determined that the pull status of the video stream to be tested corresponding to the video frame is pull failure;
[0098] Alternatively, if a clear video frame is received, that is, the video frame has good quality and is not blurred or distorted, then the pull state of the video stream to be tested corresponding to the video frame is determined to be successfully pulled;
[0099] If a blurred video frame is received, that is, the video frame quality is poor, blurry or distorted, then the pull status of the video stream to be tested corresponding to the video frame is determined to be a pull failure;
[0100] Alternatively, if the delay time of the received video frame is less than or equal to a preset delay time threshold, it is determined that the pull state of the video stream to be tested corresponding to the video frame is successfully pulled;
[0101] If the delay time of the received video frame is greater than the delay time threshold, it is determined that the pull state of the video stream to be tested corresponding to the video frame is a pull failure.
[0102] According to the above judgment results, the number of video streams that are successfully pulled (the first number of streams pulled) and the number of video streams that fail to be pulled (the second number of streams pulled) are counted, and the second number of streams pulled obtained by counting is compared with the preset stream pulling failure threshold. If the second number of streams pulled is greater than the stream pulling failure threshold, it is determined that the pulling state does not meet the concurrent reasoning condition. At this time, the current test process is interrupted, the test system is fault-detected, and a fault report is generated. If the second number of streams pulled is less than or equal to the stream pulling failure threshold, it is determined that the pulling state meets the concurrent reasoning condition and the test continues.
[0103] Through the above steps, factors such as the continuity, clarity and delay time of the video frames can be comprehensively considered, the pulling status of the video stream to be tested can be accurately determined, and the problem can be discovered in time when the number of pulling failures exceeds the preset threshold, and fault detection and reporting can be performed, thereby ensuring the stability and reliability of the test system. In addition to the above-mentioned judgment criteria, developers can also choose other judgment criteria and judgment methods, and the present invention does not specifically limit this.
[0104] Step 105, when the pull state meets the preset concurrent reasoning condition, the video stream to be tested is divided into a number of video frames, and each video frame is identified and reasoned to obtain a reasoning result for each video frame.
[0105] When determining that the pull state meets the preset concurrent reasoning conditions, the embodiment of the present invention divides the video stream to be tested into several continuous video frames. The specific segmentation process is implemented through a video processing library or tool to decompose the video stream into individual video frames in chronological order. Each segmented video frame is recognized, and the recognition process involves image processing and computer vision technology, such as using a pre-trained deep learning model to recognize objects, scenes or other features in the video frame. Reasoning is performed on each recognized video frame to obtain an inference result, which can be a classification label, probability distribution or other form of output. The inference result for each video frame is recorded for subsequent analysis and processing. The embodiment of the present invention can also store the inference result in a database, file or other data storage system, and can also analyze the inference results of all video frames to evaluate the overall quality of the video stream and the transmission performance of the system.
[0106] Through the above steps, the system can perform detailed analysis and reasoning on the video stream to be tested when the pull status meets the concurrent reasoning conditions, thereby providing in-depth insights into video content and system performance. This helps ensure the quality of the video stream and the reliability of the system, and provides a basis for subsequent optimization and improvement.
[0107] The test system of the embodiment of the present invention further includes a processor. Before dividing the video stream to be tested into a plurality of video frames and performing recognition and reasoning on each video frame, the method further includes:
[0108] Count the number of processors;
[0109] Comparing the number of processors with a preset processor threshold, and performing load balancing processing on the test system when the number of processors is greater than or equal to the processor threshold;
[0110] When the number of processors is less than the processor threshold, concurrent reasoning is performed on the video stream to be tested.
[0111] Each video stream requires a certain amount of memory to store input data, intermediate calculation results, and output results when performing reasoning. Since the application scenario for the embodiment of the present invention is high-concurrency real-time video streams, the reasoning pressure is relatively large. If too many video streams are processed at the same time, or the resolution or complexity of a single video stream is very high, it may exceed the memory limit of the processor. Therefore, it is necessary to load balance all test addresses that are successfully read so that the test can proceed smoothly. It should be noted that load balancing here is only performed when equipped with two or more processors. If it only contains a single processor, there is no need for load balancing and parallel reasoning can be performed directly.
[0112] In addition, due to many factors such as the high complexity of deep learning algorithms and the large amount of real-time streaming video reasoning operations, it is difficult for developers to evaluate the reasoning pressure in the early stage of testing. Although the pressure of a single processor has been reduced as much as possible through load balancing, the reasoning memory may still be exhausted, causing the test to be interrupted. Therefore, the embodiment of the present invention can use a monitoring tool to continuously monitor the operating status of the processor, for example, corresponding to the memory usage rate, set a threshold of the memory usage rate, and trigger a warning of insufficient memory when the memory usage rate exceeds the threshold. For example, when insufficient memory is detected, the background operation information of the graphics card is obtained, including the video memory usage rate and the running process, and the information is saved in a log file, and the various parameter configurations of the system are obtained and saved in a log file. The obtained graphics card background operation information and the various parameter configurations of the system are organized into a fault report, and the report should contain detailed system status information and specific manifestations when insufficient memory is insufficient. According to the information in the fault report, the developer investigates the cause of insufficient memory and optimizes the load pressure of the system, which may include adjusting the memory usage strategy of the application, increasing the system memory, optimizing the code, etc. After completing the troubleshooting and load pressure optimization, the test process is rerun to ensure that the system can run stably and achieve the expected performance indicators.
[0113] Through the above steps, key operating information and system configuration can be automatically saved when insufficient memory occurs, helping testers to quickly troubleshoot and optimize system performance. This helps improve the efficiency of the test process and the stability of the system.
[0114] Step 106: Merge the inference results to generate a test result for the test system.
[0115] The test method based on high-concurrency video stream provided by the embodiment of the present invention obtains the video stream to be tested; in response to the push instruction sent by the push server, the video stream to be tested is pushed to a preset test address; in response to the pull instruction sent by the pull server, the video stream to be tested is pulled from the test address; the pull status of the video stream to be tested is obtained, and whether to perform concurrent reasoning on the video stream to be tested is determined according to the pull status; when the pull status meets the preset concurrent reasoning condition, the video stream to be tested is divided into several video frames, each video frame is identified and reasoned, and the reasoning result for each video frame is obtained; the reasoning results are merged to generate the test result for the test system. The embodiment of the present invention simulates a transmission test of the video stream in a high-concurrency and high-pressure environment, thereby assisting developers to use the real-time video stream local simulation, high-concurrency and high-availability push and pull, automatic load balancing and various automatic system judgments, log preservation and other testing processes to efficiently complete the deep learning algorithm testing work in the real video processing scenario.
[0116] Reference Figure 2 , shows a flowchart of the steps of concurrent streaming in a test method based on high concurrent video streams provided by an embodiment of the present invention, specifically including:
[0117] Step 201, read the file path of the local video to obtain the local video.
[0118] Step 202: configure a streaming mode for the video stream to be tested according to the streaming instruction sent by the streaming server.
[0119] Step 203, obtain the local network address, select the test address from the local network address, and number the test address.
[0120] Step 204: assign corresponding test addresses to the video streams to be tested in order according to the numbers.
[0121] Step 205: Push the video stream to be tested to the test address in a push mode.
[0122] Figure 3 A flowchart of the steps of concurrent streaming in a test method based on high concurrent video streams provided by an embodiment of the present invention specifically includes:
[0123] Step 301: preset a stream pulling failure threshold.
[0124] Step 302: In response to a stream pulling instruction sent by a stream pulling server, pull a video stream to be tested from a test address.
[0125] Step 303: Obtain the pull status of the video stream to be tested, where the pull status includes pull success and pull failure.
[0126] Step 304: Count the number of video streams that failed to be pulled, and compare the number of video streams that failed to be pulled with a stream pulling failure threshold.
[0127] When the pull quantity corresponding to the video stream that failed to be pulled is greater than the pull failure threshold, it is determined that the pull state does not meet the concurrent reasoning condition, the current test process for the test system is interrupted, and step 3041 is executed to perform fault detection on the test system and generate a fault report for the test system;
[0128] When the pull quantity corresponding to the video stream that failed to be pulled is less than or equal to the pull failure threshold, step 3042 is executed to determine whether to perform a load balancing operation.
[0129] Figure 4 A flow chart of the steps of performing load balancing in a test method based on high concurrent video streams provided in an embodiment of the present invention specifically includes:
[0130] Step 401, obtaining the number of processors in the test system, and determining whether the number of processors is greater than or equal to two.
[0131] Step 402: Obtain a second test quantity corresponding to the test address.
[0132] Step 403: calculate the real-time video stream load number for each processor according to the number of processors and the second test number.
[0133] In the embodiment of the present invention, after obtaining the number of processors L and the total number of test addresses M, the number of real-time flow loads N that a single processor needs to bear is calculated as follows:
[0134] N=M÷L
[0135] If N is not an integer, the load of the first L-1 graphics cards in the processor cluster is rounded up, and the remaining video streams are all handled by the last processor. At this time, the real-time video stream address corresponding to each graphics card is generated for the L graphics cards.
[0136] Step 404, assign corresponding concurrent reasoning tasks to the processor according to the real-time video stream load number, and perform concurrent reasoning on the video stream to be tested based on the concurrent reasoning tasks.
[0137] The embodiment of the present invention may also include the following process when performing load balancing:
[0138] Create multiple threads;
[0139] Concurrent reasoning tasks are assigned to corresponding threads according to the number of processors, and each thread is used to process at least one video stream to be tested.
[0140] Reference Figure 5 , shows a schematic diagram of the structure of a test device based on high concurrent video streams provided by an embodiment of the present invention, such as Figure 5 As shown, the device may include:
[0141] The acquisition module 501 is used to acquire the video stream to be tested.
[0142] The streaming module 502 is used to push the video stream to be tested to a preset test address in response to a streaming instruction sent by the streaming server.
[0143] The stream pulling module 503 is used to pull the video stream to be tested from the test address in response to the stream pulling instruction sent by the stream pulling server.
[0144] The judgment module 504 is used to obtain the pulling status of the video stream to be tested, and judge whether to perform concurrent reasoning on the video stream to be tested according to the pulling status.
[0145] The reasoning module 505 is used to divide the video stream to be tested into several video frames when the pull state meets the preset concurrent reasoning condition, identify and reason each video frame, and obtain the reasoning result for each video frame.
[0146] The result generation module 506 is used to merge the reasoning results to generate a test result for the test system.
[0147] Optionally, the acquisition module 501 includes:
[0148] The first acquisition module is used to obtain the video file path.
[0149] The second acquisition module is used to read the video file path to obtain the local video under the video file path.
[0150] The selection module is used to randomly select a video stream to be tested from the local video and determine a first test quantity corresponding to the video stream to be tested.
[0151] Optionally, the streaming module 502 includes:
[0152] The push streaming mode configuration module is used to configure the push streaming mode for the video stream to be tested according to the push streaming instruction.
[0153] The test address numbering module is used to obtain the local network address, select the test address from the local network address according to the first test quantity, and number the test address.
[0154] The test address allocation module is used to allocate corresponding test addresses to the video streams to be tested in sequence according to the numbers.
[0155] The video push module is used to push the video stream to be tested to the test address according to the push mode.
[0156] Optionally, the determination module 504 includes:
[0157] The first preset module is used to preset a flow pulling failure threshold and an inference condition.
[0158] The status acquisition module is used to obtain the pull status of the video stream to be tested, and the pull status includes pull success and pull failure.
[0159] The first statistical module is used to count the pull quantity corresponding to the pull status to obtain the first pull quantity and the second pull quantity. The first pull quantity is used to indicate the number of video streams to be tested whose pull status is successful, and the second pull quantity is used to indicate the number of video streams to be tested whose pull status is failed.
[0160] The quantity comparison module is used to compare the second stream pulling quantity with the stream pulling failure threshold.
[0161] The test interruption module is used to determine that the pulling state does not meet the concurrent reasoning condition when the second pulling quantity is greater than the pulling failure threshold, interrupt the current test process for the test system, perform fault detection on the test system and generate a fault report for the test system.
[0162] The state determination module is used to determine that the pull state meets the concurrent reasoning condition when the second pull quantity is less than or equal to the pull failure threshold.
[0163] Optionally, the status acquisition module includes:
[0164] The first determination unit is used to continuously monitor the pulling process of the video stream to be tested, and if continuous video frames are received, it is determined that the pulling state of the video stream to be tested corresponding to the video frames is a pulling success; if intermittent video frames are received, it is determined that the pulling state of the video stream to be tested corresponding to the video frames is a pulling failure; or,
[0165] The second determination unit is configured to determine that the pull state of the video stream to be tested corresponding to the video frame is a pull success if a clear video frame is received; and determine that the pull state of the video stream to be tested corresponding to the video frame is a pull failure if a blurred video frame is received; or
[0166] The third judgment unit is used to judge that the pulling state of the video stream to be tested corresponding to the video frame is a successful pulling if the delay time of the received video frame is less than or equal to a preset delay time threshold; if the delay time of the received video frame is greater than the delay time threshold, then the pulling state of the video stream to be tested corresponding to the video frame is a failed pulling.
[0167] Optionally, the test system further includes a processor, and the device further includes:
[0168] The second statistical module is used to count the number of processors.
[0169] The load balancing module is used to compare the number of processors with a preset processor threshold, and when the number of processors is greater than or equal to the processor threshold, perform load balancing processing on the test system.
[0170] The concurrent streaming submodule is used to perform concurrent reasoning on the video stream to be tested when the number of processors is less than the processor threshold.
[0171] Optionally, the concurrent streaming submodule also includes:
[0172] Thread creation unit, used to create multiple threads.
[0173] The task allocation unit is used to allocate concurrent reasoning tasks to corresponding threads according to the number of processors, and each thread is used to process at least one video stream to be tested.
[0174] The test method based on high-concurrency video stream provided by the embodiment of the present invention obtains the video stream to be tested; in response to the push instruction sent by the push server, the video stream to be tested is pushed to a preset test address; in response to the pull instruction sent by the pull server, the video stream to be tested is pulled from the test address; the pull status of the video stream to be tested is obtained, and whether to perform concurrent reasoning on the video stream to be tested is determined according to the pull status; when the pull status meets the preset concurrent reasoning condition, the video stream to be tested is divided into several video frames, each video frame is identified and reasoned, and the reasoning result for each video frame is obtained; the reasoning results are merged to generate the test result for the test system. The embodiment of the present invention simulates a transmission test of the video stream in a high-concurrency and high-pressure environment, thereby assisting developers to use the real-time video stream local simulation, high-concurrency and high-availability push and pull, automatic load balancing and various automatic system judgments, log preservation and other testing processes to efficiently complete the deep learning algorithm testing work in the real video processing scenario.
[0175] The embodiment of the present invention also provides a communication device, such as Figure 6As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.
[0176] Memory 603, used for storing computer programs;
[0177] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:
[0178] Get the video stream to be tested;
[0179] In response to the streaming instruction sent by the streaming server, the video stream to be tested is pushed to a preset test address;
[0180] In response to the stream pulling instruction sent by the stream pulling server, pull the video stream to be tested from the test address;
[0181] Obtain the pull status of the video stream to be tested, and determine whether to perform concurrent inference on the video stream to be tested based on the pull status;
[0182] When the pull status meets the preset concurrent reasoning conditions, the video stream to be tested is divided into several video frames, and each video frame is identified and reasoned to obtain the reasoning result for each video frame;
[0183] The inference results are combined to generate test results for the test system.
[0184] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0185] The communication interface is used for communication between the above terminal and other devices.
[0186] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0187] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0188] The present invention also provides a readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the test method based on high-concurrency video streams of the aforementioned embodiment.
[0189] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0190] The algorithm and display provided herein are not inherently related to any particular computer, virtual device or other equipment. According to the above description, it is obvious that the structure required for constructing this type of device is. In addition, the present invention is not directed to any specific programming language. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific language is to disclose the best mode of the present invention.
[0191] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0192] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all of the features of the individual embodiments disclosed above. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0193] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0194] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0195] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
[0196] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0197] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
[0198] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0199] It should be noted that the various data-related processes in the embodiments of the present application are all carried out in compliance with the corresponding data protection laws and policies of the country where the device is located, and with the authorization given by the owner of the corresponding device.
Claims
1. A testing method based on high concurrent video streams, characterized in that: The method is applied to a test system, the test system includes a streaming push server and a streaming pull server, and the method includes: Get the video stream to be tested; In response to the streaming instruction sent by the streaming server, the video stream to be tested is pushed to a preset test address; In response to the stream pulling instruction sent by the stream pulling server, pull the video stream to be tested from the test address; Obtaining a pull status of the video stream to be tested, and determining whether to perform concurrent reasoning on the video stream to be tested according to the pull status; When the pull state satisfies the preset concurrent reasoning condition, the video stream to be tested is divided into a plurality of video frames, and each of the video frames is identified and reasoned to obtain a reasoning result for each of the video frames; The inference results are combined to generate a test result for the test system.
2. The method according to claim 1, characterized in that The step of obtaining the video stream to be tested includes: Get the video file path; Read the video file path to obtain the local video under the video file path; Randomly selecting a video stream to be tested from the local video, and determining a first test quantity corresponding to the video stream to be tested; The step of pushing the video stream to be tested to a preset test address in response to the streaming instruction sent by the streaming server includes: According to the streaming instruction, a streaming mode for the video stream to be tested is configured; Acquire a local network address, select a test address from the local network address according to the first test quantity, and number the test address; Assign corresponding test addresses to the video streams to be tested in order according to the numbers; The video stream to be tested is pushed to the test address according to the streaming mode.
3. The method according to claim 1, characterized in that The obtaining the pulling status of the video stream to be tested, and judging whether to perform concurrent reasoning on the video stream to be tested according to the pulling status, includes: Preset pull failure threshold and inference conditions; Obtaining the pulling status of the video stream to be tested, wherein the pulling status includes pulling success and pulling failure; Counting the pull numbers corresponding to the pull state to obtain a first stream pull number and a second stream pull number, wherein the first stream pull number is used to indicate the number of video streams to be tested whose pull state is the pull success, and the second stream pull number is used to indicate the number of video streams to be tested whose pull state is the pull failure; Compare the second stream pulling quantity with the stream pulling failure threshold; When the second stream pulling quantity is greater than the stream pulling failure threshold, determining that the pulling state does not meet the concurrent reasoning condition, interrupting the current test process for the test system, performing fault detection on the test system and generating a fault report for the test system; When the second stream pulling quantity is less than or equal to the stream pulling failure threshold, it is determined that the pulling state satisfies the concurrent reasoning condition.
4. The method according to claim 1 or 3, characterized in that: The video stream to be tested includes a plurality of continuous video frames, and obtaining the pulling state of the video stream to be tested includes: Continuously monitoring the pulling process of the video stream to be tested, and if continuous video frames are received, determining that the pulling state of the video stream to be tested corresponding to the video frames is successful; If an intermittent video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is a pull failure; Alternatively, if a clear video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is successfully pulled; If a blurred video frame is received, determining that the pull status of the video stream to be tested corresponding to the video frame is a pull failure; Alternatively, if the delay time of the received video frame is less than or equal to a preset delay time threshold, it is determined that the pull state of the video stream to be tested corresponding to the video frame is successfully pulled; If the delay time of the received video frame is greater than the delay time threshold, it is determined that the pulling state of the video stream to be tested corresponding to the video frame is a pulling failure.
5. The method according to claim 1, characterized in that The test system further includes a processor. Before dividing the video stream to be tested into a plurality of video frames and performing recognition and reasoning on each of the video frames, the method further includes: Counting the number of the processors; Comparing the number of processors with a preset processor threshold, and performing load balancing processing on the test system when the number of processors is greater than or equal to the processor threshold; When the number of the processors is less than the processor threshold, concurrent reasoning is performed on the video stream to be tested.
6. The method according to claim 5, characterized in that The load balancing process for the test system includes: Obtaining a second test quantity corresponding to the test address; Calculating a real-time video stream load number for each processor according to the number of the processors and the second test number; Corresponding concurrent reasoning tasks are allocated to the processor according to the real-time video stream load number, and concurrent reasoning is performed on the video stream to be tested based on the concurrent reasoning tasks.
7. The method according to claim 6, characterized in that The method further comprises: Create multiple threads; The concurrent reasoning tasks are allocated to corresponding threads according to the number of the processors, and each of the threads is used to process at least one of the video streams to be tested.
8. A test device based on high concurrent video streams, characterized in that: The device comprises: An acquisition module is used to acquire the video stream to be tested; A streaming module, configured to push the video stream to be tested to a preset test address in response to a streaming instruction sent by the streaming server; A stream pulling module, configured to pull the video stream to be tested from the test address in response to a stream pulling instruction sent by the stream pulling server; A judgment module, used for obtaining the pulling state of the video stream to be tested, and judging whether to perform concurrent reasoning on the video stream to be tested according to the pulling state; An inference module, used for dividing the video stream to be tested into a plurality of video frames, identifying and inferring each of the video frames, and obtaining an inference result for each of the video frames when the pull state meets a preset concurrent inference condition; The result generating module is used to merge the reasoning results to generate a test result for the test system.
9. A communication device, characterized in that: include: A transceiver, a memory, a processor, and a program stored on the memory and executable on the processor; The processor is used to read the program in the memory to implement the steps in the testing method based on high-concurrency video streams as described in any one of claims 1-7.
10. A readable storage medium for storing a program, characterized in that: When the program is executed by a processor, the steps in the testing method based on high-concurrency video streams as described in any one of claims 1-7 are implemented.
Citation Information
Cited By
Algorithm verification method and device based on offline video, equipment and storage medium
CN121438077A
Method and device for realizing accelerated generation of first Token by intelligent computing cloud platform through computing power accelerated reasoning
CN122633421A
Method and device for realizing first token acceleration generation by computing power acceleration inference through intelligent computing cloud platform
CN122633421B
