Processor computing power resource measuring and calculating method and device, electronic device and storage medium
By using multiple test scenarios and video files to calculate GPU computing resources in the field of intelligent video AI monitoring, the cost and performance problems of GPU procurement solutions in the existing technology are solved, and the effect of optimizing GPU resource configuration is achieved under the premise of meeting business needs.
Patent Information
- Application Number
- CN202510322997.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-19
Smart Images

Figure CN119854175A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video AI intelligent monitoring, and in particular to methods, devices, electronic devices and storage media for calculating processor computing power resources. Background Art
[0002] In the actual application scenarios of AI analysis platforms, especially when it is necessary to connect and apply the AI algorithms of application manufacturers, the selection and purchase of GPU cards has become a crucial link. This decision is not only related to the operating efficiency and performance of the platform, but also directly affects the overall cost investment and business benefits. Therefore, the platform needs to comprehensively consider various factors such as its own business needs, usage scenarios, budget constraints, and GPU cost and performance in order to develop the best GPU procurement plan.
[0003] However, in the current technological context, there is a significant problem: there is a lack of a universal and rigorous calculation model to support the formulation of GPU procurement plans. Specifically, for face recognition algorithms, how to balance the two key factors of cost and performance in the process of purchasing and selecting GPU computing resources according to the actual business needs of the platform to produce the best procurement plan has become an urgent problem to be solved.
[0004] At present, no effective solution has been proposed for the problem of how to strike a balance between low cost and high performance of computing resources occupied by AI algorithms in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a processor computing power resource measurement method, device, electronic device and storage medium to at least solve the problem of how to strike a balance between low cost and high performance of the computing power resources occupied by AI algorithms in the related art.
[0006] In a first aspect, an embodiment of the present application provides a method for calculating processor computing power resources, including: Acquire multiple preset test scenarios, each of which includes the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; Acquire multiple video files, and based on the number of video streams, input the multiple video files into the test algorithm under each of the test scenarios, perform algorithm operation test, and record corresponding test data obtained by running the test algorithm under each of the test scenarios; Based on the test data, a calculation result corresponding to the processor model to be tested is obtained, wherein the calculation result includes a maximum number of paths supported by the processor model to be tested under different numbers of the test base libraries and different numbers of processor allocations.
[0007] In some embodiments, obtaining the measurement result corresponding to the processor model to be tested based on the test data includes: Verifying one by one whether the test data in each of the test scenarios meets a preset validity condition, and recording the test data that meets the validity condition as valid data; Based on the valid data, a measurement result corresponding to the processor model to be tested is obtained.
[0008] In some embodiments, the validity condition includes that the difference between the multi-channel test data and the benchmark data is within the threshold range of the corresponding data; the benchmark data is determined based on the test data corresponding to the case where the number of video streams is single; and the multi-channel test data is determined based on the test data corresponding to the case where the number of video streams is two or more.
[0009] In some embodiments, the difference between the multi-channel test data and the reference data is within a threshold range of the corresponding data, including: The difference between the number of snapshots of the multi-channel test data and the number of snapshots of the reference data does not exceed the snapshot validity threshold; The difference in the number of alarms between the multi-channel test data and the reference data does not exceed the alarm validity threshold; The difference in the number of false alarms between the multi-channel test data and the reference data does not exceed a false alarm effective threshold, and the false alarm rate corresponding to the number of false alarms does not exceed a false alarm rate threshold; The difference between the number of missed reports of the multi-channel test data and the reference data does not exceed a missed report effective threshold, and the missed report rate corresponding to the number of missed reports does not exceed a missed report rate threshold; The time interval between the snapshot and the alarm does not exceed the delay determination threshold.
[0010] In some of the embodiments, the validity condition also includes determining that there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
[0011] In some embodiments, determining that the capture and alarm functions of the test scenario have no delay problem in a multi-channel concurrent situation includes: Add a real video stream address captured by a real camera to the test scene to build a test environment containing N video streams; A real person is selected as a test subject, and based on the actual elapsed time recorded by the real camera when the real person passes by, the capture time recorded in the algorithm running test, and the alarm time when the alarm is triggered after the real person is captured, the capture interval between the actual elapsed time and the capture time, and the alarm interval between the capture time and the alarm time are calculated; If the capture interval does not exceed the preset capture delay threshold, and the alarm interval does not exceed the preset alarm delay threshold, it is determined that there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
[0012] In some embodiments, the acquiring of multiple video files and, based on the number of video streams, inputting the multiple video files into the test algorithm in each of the test scenarios to perform the algorithm operation test includes: Deploy the test algorithm on a physical machine of the processor model to be tested, wherein the test algorithm is used to perform algorithm operation tests in each of the test scenarios; Using the deployed multi-channel real-time video distribution server, a plurality of the video files are acquired, and the video files are input into the test algorithm in each of the test scenarios deployed on the physical machine.
[0013] In a second aspect, an embodiment of the present application provides a processor computing power resource measurement device, including: An input module is used to obtain a plurality of preset test scenarios, each of which includes the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; A calculation module, used for acquiring a plurality of video files, and based on the number of video streams, inputting the plurality of video files into a test algorithm under each of the test scenarios, performing an algorithm operation test, and recording corresponding test data obtained by running the test algorithm under each of the test scenarios; A result analysis module is used to obtain the measurement results corresponding to the processor model to be tested based on the test data, and the measurement results include the maximum number of paths supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor computing power resource calculation method as described in the first aspect above is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the processor computing power resource calculation method described in the first aspect above is implemented.
[0016] Compared with the related art, the processor computing power resource calculation method, device, electronic device and storage medium provided in the embodiments of the present application obtain multiple preset test scenarios, including processor model, number of video stream channels, base library data and allocation number, input the video file into the algorithm under each test scenario to run the test, record the test data, and then obtain the maximum supported number of channels of the processor model under different base library numbers and allocation numbers, thereby solving the problem of how to strike a balance between low cost and high performance of the computing power resources occupied by AI algorithms in the related art, and achieving a balance between cost and performance while meeting business needs.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 It is a hardware structure block diagram of a terminal of the processor computing power resource calculation method according to an embodiment of the present invention; Figure 2 is a flowchart of a method for calculating processor computing power resources according to an embodiment of the present application; Figure 3 It is a module schematic diagram of a method for calculating processor computing power resources according to a preferred embodiment of the present application; Figure 4 It is a structural block diagram of a processor computing power resource calculation device according to an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means, and should not be understood as insufficient contents disclosed in the present application.
[0020] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0021] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0022] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 1 is a hardware structure block diagram of a terminal of the processor computing power resource measurement method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1Different configurations shown.
[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the processor computing power resource measurement method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0025] This embodiment provides a method for calculating processor computing power resources. Figure 2 is a flowchart of a method for calculating processor computing power resources according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps: Step S201, obtaining a plurality of preset test scenarios, each test scenario including the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; Each test scenario includes several key parameters: the processor model to be tested, the number of video streams, the base database data corresponding to the number of test base databases, and the number of processor allocations. The processor model to be tested refers to the model of the GPU card to be tested. In actual applications, different GPU cards have different performance and costs, so it is necessary to select the appropriate model for testing according to actual business needs. The number of video streams refers to the number of video streams processed simultaneously. In the AI analysis platform, the number of video streams directly affects the load and performance of the GPU card, so it is necessary to test the performance under different numbers of streams to determine the optimal number of streams configuration. The base database data is the basic data used for face recognition, including feature information of known faces, etc. The number of test base databases directly affects the recognition speed and accuracy of the algorithm, so it is necessary to prepare different numbers of base database data for testing to determine the optimal base database configuration. The number of processor allocations refers to the number of GPU cards allocated to each test scenario. In actual applications, the processing speed and performance of the algorithm can be improved by increasing the number of GPU cards, so it is necessary to test the performance under different numbers of processor allocations to determine the optimal processor configuration. In this step, test scenarios including different processor models, video stream numbers, test base libraries, and processor allocation numbers are set up. Multiple test scenarios can fully cover various situations that may be encountered, thereby improving the comprehensiveness and accuracy of the test, ensuring that the performance of the algorithm in actual applications meets expectations, and by testing the performance under different processor models, video stream numbers, test base libraries, and processor allocation numbers through these multiple test scenarios, the optimal resource allocation solution can be determined.
[0026] Step S202, obtaining multiple video files, and based on the number of video streams, inputting the multiple video files into the test algorithm in each test scenario, performing algorithm operation test, and recording corresponding test data obtained by running the test algorithm in each test scenario; Among them, a variety of video files can be obtained from the actual monitoring system. The video files should cover different scenes, lighting conditions, face angles and occlusion conditions to ensure the comprehensiveness and authenticity of the test. Then the video files are preprocessed, such as cropping, format conversion, etc. According to the preset test scene configuration, different GPU models, video streams, test base library numbers and processor allocation numbers are combined. In each test scene, the corresponding test parameters are configured, and the prepared video files are input into the corresponding test scene according to the preset video streams through the multi-channel real-time video distribution server. Start the algorithm to run the test, and record the test data obtained by the algorithm running the test algorithm in each test scene in real time. The test data includes the number of captures, the number of alarms, the number of false alarms, the number of missed alarms, the time of capture and alarm, the algorithm running time and resource occupancy (such as CPU, memory and GPU usage), etc., to ensure the accuracy and completeness of the data, so as to facilitate subsequent data analysis and performance evaluation. In this step, by using multiple video files and different test scene combinations, the performance of the algorithm under different conditions can be comprehensively evaluated. The recorded test data can provide strong data support for subsequent performance optimization and resource allocation.
[0027] Step S203, based on the test data, obtain the measurement result corresponding to the processor model to be tested, the measurement result including the maximum number of paths supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations.
[0028] Among them, the number of snapshots, the number of alarms, the number of false alarms and the number of missed alarms in the test data are compared and counted, and the maximum number of video streams that different processor models can support under different base library numbers and different processor allocation numbers is further analyzed. The analysis results are presented in an intuitive way, such as tables or charts, for easy understanding and application. The output results should clearly show the maximum number of supported channels of the processor model to be tested under different test conditions, providing strong support for subsequent procurement and selection decisions. This step can more accurately understand the performance of the processor model to be tested under different test conditions by analyzing the maximum number of channels supported by the processor model to be tested under different test base library numbers and different processor allocation numbers, thereby providing a scientific basis for procurement and selection decisions and avoiding the waste of resources caused by blind procurement and selection; this calculation result can ensure that the selected processor model can support enough video streams, thereby meeting the requirements of face recognition algorithm for real-time and accuracy, and according to the calculation results, the GPU computing power resources can be reasonably configured to ensure that while meeting business needs, a balance between cost and performance is achieved, which helps to reduce operating costs and improve resource utilization efficiency.
[0029] Through the above steps, firstly, by presetting multiple test scenarios and comprehensively considering multiple key factors, the performance of the processor can be evaluated more comprehensively and meticulously, the performance deviation that may exist in a single test scenario is avoided, and the accuracy and reliability of the measurement results are improved; secondly, by obtaining multiple video files and inputting these video files into the test algorithms in various test scenarios according to the preset number of video streams, the test data obtained from the algorithm operation in each test scenario is recorded in detail, including key indicators such as the number of snapshots, the number of alarms, the number of false alarms, the number of missed alarms, and the time delay of the algorithm operation. By recording and analyzing the test data obtained from the algorithm operation in detail, the accuracy and reliability of the processor performance can be improved. , which can provide a deeper understanding of the performance bottlenecks and potential problems of the processor, and provide an important reference for subsequent performance optimization and algorithm improvement; finally, based on the collected test data, the corresponding measurement results of the processor model to be tested were further analyzed and obtained, including the maximum number of video streams supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations, which helps to intuitively understand the performance of the processor under different configurations, and provides a basis for subsequent resource allocation and performance optimization, and solves the problem of how to strike a balance between the low cost and high performance of the computing resources occupied by AI algorithms in related technologies, and achieves a balance between cost and performance while meeting business needs.
[0030] In some embodiments, obtaining the measurement result corresponding to the processor model to be tested based on the test data includes: Verify whether the test data in each test scenario meets the preset validity conditions one by one, and record the test data that meets the validity conditions as valid data; Based on the valid data, obtain the measurement results corresponding to the processor model to be tested.
[0031] Wherein, for each test scenario, check whether the corresponding test data meets the preset validity conditions, which include but are not limited to the difference value range between multi-channel and single-channel in the number of snapshots, the number of alarms, the number of false alarms, and the number of missed alarms, and whether the algorithm runs with the phenomenon of snapshot delay or alarm delay. The test data that meets all validity conditions are marked as valid data for subsequent analysis and processing. If a certain group of test data does not meet the validity conditions, it is marked as invalid data and excluded from subsequent analysis. By counting and analyzing valid data, the maximum number of video streams supported by the processor model to be tested under different base library numbers and different processor number scenarios is calculated, i.e., the calculation result. Further, specific conclusions can be drawn, such as how many real-time video streams a certain model of GPU graphics card can support at most under a specific base library number, and corresponding hardware configuration suggestions. This embodiment ensures the accuracy and reliability of the analysis results by verifying the validity of the test data one by one, and avoids the interference of invalid data on the calculation results.
[0032] In some of the embodiments, the validity condition includes that the difference between the multi-channel test data and the benchmark data is within the threshold range of the corresponding data; the benchmark data is determined based on the test data corresponding to the case where the number of video streams is single; and the multi-channel test data is determined based on the test data corresponding to the case where the number of video streams is two or more.
[0033] It can be explained that for each test scenario, test data is collected and compared with the preset validity conditions one by one to check whether the number of snapshots, the number of alarms, the number of false alarms, the number of missed alarms, and the delay between snapshots and alarms in the test data meet the threshold requirements. This embodiment can ensure that the test data used is accurate and reliable by setting clear validity conditions and verifying the test data one by one, which helps to avoid the problem of inaccurate measurement results due to data errors.
[0034] In some embodiments, the difference between the multi-channel test data and the reference data is within a threshold range of the corresponding data, including: The difference in the number of snapshots between the multi-channel test data and the benchmark data does not exceed the snapshot validity threshold; The difference in the number of alarms between the multi-channel test data and the benchmark data does not exceed the alarm validity threshold; The difference in the number of false alarms between the multi-channel test data and the benchmark data does not exceed the false alarm effective threshold, and the false alarm rate corresponding to the number of false alarms does not exceed the false alarm rate threshold; The difference between the number of missed reports of the multi-channel test data and the reference data does not exceed the missed report effective threshold, and the missed report rate corresponding to the number of missed reports does not exceed the missed report rate threshold; The time interval between capturing and alarming does not exceed the delay determination threshold.
[0035] For example, when conducting a multi-channel test, first record the number of snapshots of each video stream and compare it with the benchmark data (i.e., the number of snapshots of a single video stream) to ensure that the difference in the number of snapshots between the multi-channel test data and the benchmark data does not exceed the preset snapshot effective threshold (e.g., no more than 15%). This is achieved by comparing and analyzing the test data to ensure that the number of snapshots can remain stable and will not fluctuate significantly under the pressure of multi-channel concurrency. Similarly, record the number of alarms for each video stream and compare it with the benchmark data to ensure that the difference in the number of alarms between the multi-channel test data and the benchmark data does not exceed the preset alarm effective threshold (also no more than 15%), which helps to verify the accuracy of the algorithm's alarms under multi-channel concurrency and ensure that the system can respond to abnormal situations in a timely manner. Record the number of false alarms in the multi-channel test and calculate the false alarm rate to ensure that the difference in the number of false alarms between the multi-channel test data and the benchmark data does not exceed the preset false alarm effective threshold (no more than 10% of the number of people to be reported), and the false alarm rate corresponding to the number of false alarms does not exceed the false alarm rate threshold (no more than 15%), which helps to reduce the false alarm rate of the system and improve the accuracy of the algorithm. Record the number of missed reports in the multi-channel test and calculate the missed report rate to ensure that the difference between the number of missed reports in the multi-channel test data and the benchmark data does not exceed the preset missed report effective threshold (no more than 10% of the number of people who should be reported), and the missed report rate corresponding to the number of missed reports does not exceed the missed report rate threshold (also no more than 15%), which helps to reduce missed reports in the system and improve the coverage and reliability of the algorithm. During the test, record the time interval between the capture and the alarm to ensure that the time interval does not exceed the preset delay judgment threshold (such as within 3 seconds), which helps to verify the real-time performance of the algorithm, ensure that the system can respond and handle abnormal situations in a timely manner, and improve the user experience. Through the above steps, this embodiment can ensure the stability of the algorithm under multi-channel concurrent pressure, reduce the fluctuation of the number of captures and the number of alarms, and improve the reliability of the algorithm; control the number of false alarms and missed reports, which helps to reduce the false alarm rate and missed report rate of the system and improve the accuracy of the algorithm; ensure that the time interval between the capture and the alarm is within a reasonable range, which can improve the real-time performance of the system, reduce user waiting time, and improve user experience.
[0036] In some of the embodiments, the validity condition also includes determining whether there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
[0037] In some embodiments, determining that there is no delay problem in the capture and alarm functions of the test scene under multi-channel concurrent conditions includes: Add a real video stream address shot by a real camera to the test scene to build a test environment containing N video streams; A real person is selected as the test subject. Based on the actual elapsed time recorded by the real camera, the capture time recorded in the algorithm running test, and the alarm time when the alarm is triggered after the real person is captured, the capture interval between the actual elapsed time and the capture time, as well as the alarm interval between the capture time and the alarm time, are calculated. If the capture interval does not exceed the preset capture delay threshold, and the alarm interval does not exceed the preset alarm delay threshold, it is determined that there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
[0038] Among them, a multi-channel real-time video distribution server is used to simulate the RTSP addresses of the required number of channels (such as N-1 channels) (Real Time Streaming Protocol, RTSP multi-channel real-time video distribution server simulates the RTSP addresses of the required number of channels, which is used to test the performance of the algorithm under multi-channel concurrency), and 1 real camera RTSP address is added to build a multi-channel concurrent test scene (N channels), select real person A as the test object, and add it to the control base library. When real person A passes by the camera, let real person A record the time point at the scene as soon as possible as the actual time of capture; obtain the time point when real person A is captured through the algorithm background, that is, the capture time, and compare the capture time with the actual time, and calculate the capture interval length, which represents the delay length of the capture function. Similarly, the alarm interval length between the capture time and the alarm time is checked through the algorithm background, which represents the alarm delay length. The delay determination threshold is set according to business needs (e.g., within 3 seconds). After multiple tests and verifications, if the capture interval does not exceed the preset capture delay threshold (e.g., within 3 seconds), and the alarm interval does not exceed the preset alarm delay threshold (e.g., within 3 seconds), it is determined that there is no delay problem in the capture and alarm functions under multi-channel concurrency (N channels). This embodiment can accurately evaluate the real-time performance of the algorithm under multi-channel concurrency by simulating multi-channel concurrency scenarios and conducting real-person cooperation tests, ensure the timeliness of the capture and alarm functions, and ensure that there is no delay problem in the capture and alarm functions under multi-channel concurrency, which helps to enhance the overall stability of the system and improve the reliability and accuracy of the system.
[0039] In some embodiments, a plurality of video files are obtained, and based on the number of video streams, the plurality of video files are input into a test algorithm in each test scenario to perform an algorithm operation test, including: Deploy the test algorithm on the physical machine of the processor model to be tested. The test algorithm is used to perform algorithm operation tests in various test scenarios. Using the deployed multi-channel real-time video distribution server, multiple video files are obtained and input into the test algorithms in various test scenarios deployed on the physical machine.
[0040] After determining the GPU model to be tested (such as Nvidia Tesla T4), deploy the host instance of the specified face recognition algorithm on the physical machine with the GPU of this model. This instance will be used as the main body of the test to run the algorithm in various test scenarios and collect relevant performance data. Deploy a multi-channel real-time video distribution server (RTSP server), which can simulate multiple concurrent scenarios, provide multiple RTSP addresses, and prepare test materials, including the base library (i.e., face database) and video files. These video files will be used as input data to test the performance of the algorithm in different scenarios. These video files will be distributed to the test algorithm deployed on the physical machine through the RTSP server. The test algorithm will receive these video files, perform face recognition processing, and output relevant result data. In this embodiment, the test algorithm is deployed on the physical machine of the processor model to be tested, which ensures the consistency and accuracy of the test environment, can truly reflect the performance of the GPU model to be tested in the operation of the face recognition algorithm, and is convenient for collecting and analyzing the operation data of the algorithm in different scenarios, providing strong support for subsequent performance optimization and algorithm improvement; by utilizing the deployed multi-channel real-time video distribution server, multi-channel concurrent scenarios can be simulated, and the performance of the algorithm in a complex environment can be comprehensively tested, thereby improving the efficiency and accuracy of the test.
[0041] The embodiments of the present application are described and illustrated below through preferred embodiments.
[0042] Figure 3 is a module diagram of a method for calculating processor computing power resources according to a preferred embodiment of the present application, such as Figure 3 As shown, the processor computing power resource calculation method includes the following steps: (1) Deploy the RTSP multi-channel real-time video distribution server (press) on the designated server.
[0043] (2) Deploy the host instance of the specified algorithm on the GPU physical machine.
[0044] (3) Preparation of test materials, such as database and video files.
[0045] (4) Prerequisites for valid test results (including the following five conditions a, b, c, d, e): a. The difference in the number of snapshots between multi-channel and single-channel should not exceed 15%.
[0046] b. The difference in the number of alarms between multi-channel and single-channel shall not exceed 15%.
[0047] c. The difference in the number of false alarms between multi-channel and single-channel should not exceed 10% of the number of people who should be reported, and the false alarm rate should not exceed 15%.
[0048] d. The difference between the number of missed reports between multi-channel and single-channel should not exceed 10% of the number of people who should be reported, and the missed reporting rate should not exceed 15%.
[0049] e. The algorithm operation of each channel must not have any capture delay or alarm delay. Specifically, in the case of multiple channels and single channels, the face of each person in each video channel must be captured within 3 seconds each time they appear on the screen, and if the captured face matches the face in the database, an alarm must be issued within 3 seconds after the capture.
[0050] In particular, in order to meet the "prerequisite e for valid test results", we adopted a workaround to verify to a certain extent whether the camera's capture and alarm have caused poor experience delays due to too many channels. The specific approach is, for example, if we want to stress test to see whether the algorithm can support N channels, we first use a multi-channel real-time video distribution server to simulate the RTSP address of N-1 channels, and then add 1 real camera RTSP address, and then let real person A cooperate with the test, that is, first add A to the control base library, and then let A record the time point at the scene as soon as he passes by the camera, and then compare it with the time point when the algorithm background captures the person A to see how many seconds the interval is. If after multiple tests and verifications, this interval duration can be within the range we specify (currently set to within 3 seconds), then to a certain extent, it can be indirectly explained that the algorithm will basically not have the phenomenon of capture delay under the concurrent pressure of N channels. Finally, check the interval between the capture and alarm of person A through the algorithm background. If after multiple tests and verifications, this interval duration can be within the range we specify (currently set to within 3 seconds), then to a certain extent, it can be indirectly explained that the algorithm will basically not have the phenomenon of alarm delay under the concurrent pressure of N channels.
[0051] (5) Perform a combined test using the GPU model, number of paths, number of base banks, and number of allocated GPUs as input conditions, collect the five test data listed in the fourth point, and calculate the maximum number of paths supported by the corresponding model GPU card under different base bank numbers and different allocated GPU numbers.
[0052] Compared with the hardware resource measurement methods required by other AI algorithms, this preferred embodiment has more test scenarios composed of input conditions, and more diverse results as data support for subsequent test analysis and conclusions. Taking a single channel as the benchmark, the fluctuation range of the difference from the benchmark is specified. This range is based on the impact on the business. If it exceeds this range, it is judged that the impact on the business is large and the result is invalid. The difference from the benchmark is 10%-15% because the impact on the business is acceptable within the judgment of the difference value below 20%. The response time of 3 seconds refers to the industry's 358 principle (if a page can be opened within three seconds, the user experience is better, if a page is opened within five seconds, it will affect the user experience, if the page is not opened for more than eight seconds, the user will give up using the product), which reflects that this application focuses on user experience and business performance under pressure during implementation.
[0053] Here are two test cases: Case 1: This is a selection of valid data from Case 1 (not all test data collected during the test process are included), which intuitively reflects the conditions and data described above. This data is used as one of the references, and the following conclusions can be drawn: 1) Dynamic face recognition algorithm 1 of a single Nvidia Tesla T4 GPU graphics card can support up to 22 real-time video streams with a 50,000 face database. The detailed test results are shown in Table 1 below.
[0054] 2) If you want to apply for the host resources of a single GPU card for this algorithm, the specific hardware configuration is: 1 T4 card, 24-thread CPU (at least 24 threads, 32 threads if conditions permit), and 80G memory.
[0055] Table 1
[0056] Case 2: Tables 2 to 6 show the data of the entire test process of Case 2. Based on this data, the following test conclusions are drawn: 1) The more stress test paths there are, the more stable the snapshot and alarm numbers are, with no obvious fluctuations and a deviation of less than 10%.
[0057] 2) The more stress test paths there are, the more false positives and missed positives there are. The deviations of 12-path and 15-path scenarios are larger than those of other multi-path scenarios.
[0058] Comprehensive optimal performance: 10 channels.
[0059] Table 2
[0060] Table 3
[0061] Table 4
[0062] Table 5
[0063] Table 6
[0064] This embodiment also provides a processor computing power resource measurement device, which is used to implement the above embodiments and preferred implementation modes, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0065] Figure 4 is a structural block diagram of a processor computing power resource calculation device according to an embodiment of the present application, such as Figure 4 As shown, the device comprises: An input module 10 is used to obtain a plurality of preset test scenarios, each of which includes the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; The calculation module 20 is used to obtain multiple video files, and based on the number of video streams, input the multiple video files into the test algorithm under each test scenario, perform algorithm operation test, and record the corresponding test data obtained by running the test algorithm under each test scenario; The result analysis module 30 is used to obtain the measurement results corresponding to the processor model to be tested based on the test data, and the measurement results include the maximum number of paths supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations.
[0066] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0067] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0068] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0069] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S1, obtaining multiple preset test scenarios, each test scenario including the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; S2, obtaining multiple video files, and based on the number of video streams, inputting the multiple video files into the test algorithm under each test scenario, performing algorithm operation test, and recording corresponding test data obtained by running the test algorithm under each test scenario; S3, based on the test data, obtaining the measurement results corresponding to the processor model to be tested, the measurement results including the maximum number of paths supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations.
[0070] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0071] In addition, in combination with the processor computing power resource calculation method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by the processor, any one of the processor computing power resource calculation methods in the above embodiment is implemented.
[0072] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0073] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for calculating processor computing power resources, characterized in that: include: Acquire multiple preset test scenarios, each of which includes the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; Acquire multiple video files, and based on the number of video streams, input the multiple video files into the test algorithm under each of the test scenarios, perform algorithm operation test, and record corresponding test data obtained by running the test algorithm under each of the test scenarios; Based on the test data, a calculation result corresponding to the processor model to be tested is obtained, wherein the calculation result includes a maximum number of paths supported by the processor model to be tested under different numbers of the test base libraries and different numbers of processor allocations.
2. The method for calculating processor computing power resources according to claim 1, characterized in that: The obtaining, based on the test data, a calculation result corresponding to the processor model to be tested includes: Verifying whether the test data in each of the test scenarios meets a preset validity condition one by one, and recording the test data that meets the validity condition as valid data; Based on the valid data, a measurement result corresponding to the processor model to be tested is obtained.
3. The method for calculating processor computing power resources according to claim 2, characterized in that: The validity condition includes that the difference between the multi-channel test data and the reference data is within the threshold range of the corresponding data; The reference data is determined based on the test data corresponding to when the number of video streams is single; the multi-channel test data is determined based on the test data corresponding to when the number of video streams is two or more.
4. The method for calculating processor computing power resources according to claim 3, characterized in that: The difference between the multi-channel test data and the benchmark data is within the threshold range of the corresponding data, including: The difference between the number of snapshots of the multi-channel test data and the number of snapshots of the reference data does not exceed the snapshot validity threshold; The difference in the number of alarms between the multi-channel test data and the reference data does not exceed the alarm validity threshold; The difference in the number of false alarms between the multi-channel test data and the reference data does not exceed a false alarm effective threshold, and the false alarm rate corresponding to the number of false alarms does not exceed a false alarm rate threshold; The difference between the number of missed reports of the multi-channel test data and the reference data does not exceed a missed report effective threshold, and the missed report rate corresponding to the number of missed reports does not exceed a missed report rate threshold; The time interval between the snapshot and the alarm does not exceed the delay determination threshold.
5. The method for calculating processor computing power resources according to claim 2, characterized in that: The validity condition also includes determining that there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
6. The method for calculating processor computing power resources according to claim 5, characterized in that: The determining that the capture and alarm functions of the test scenario have no delay problem in a multi-channel concurrent situation includes: Add a real video stream address captured by a real camera to the test scene to build a test environment containing N video streams; A real person is selected as a test subject, and based on the actual elapsed time recorded by the real camera when the real person passes by, the capture time recorded in the algorithm running test, and the alarm time when the alarm is triggered after the real person is captured, the capture interval between the actual elapsed time and the capture time, and the alarm interval between the capture time and the alarm time are calculated; If the capture interval does not exceed the preset capture delay threshold, and the alarm interval does not exceed the preset alarm delay threshold, it is determined that there is no delay problem in the capture and alarm functions of the test scenario under multi-channel concurrency.
7. The method for calculating processor computing power resources according to claim 1, characterized in that: The acquiring of multiple video files and, based on the number of video streams, inputting the multiple video files into the test algorithms in each of the test scenarios to perform algorithm operation tests include: Deploy the test algorithm on a physical machine of the processor model to be tested, wherein the test algorithm is used to perform algorithm operation tests in each of the test scenarios; Using the deployed multi-channel real-time video distribution server, a plurality of the video files are acquired, and the video files are input into the test algorithm in each of the test scenarios deployed on the physical machine.
8. A processor computing power resource measurement device, characterized in that: include: An input module is used to obtain a plurality of preset test scenarios, each of which includes the processor model to be tested, the number of video streams, the base library data corresponding to the number of test base libraries, and the number of processors allocated; A calculation module, used for acquiring a plurality of video files, and based on the number of video streams, inputting the plurality of video files into a test algorithm under each of the test scenarios, performing an algorithm operation test, and recording corresponding test data obtained by running the test algorithm under each of the test scenarios; A result analysis module is used to obtain the measurement results corresponding to the processor model to be tested based on the test data, and the measurement results include the maximum number of paths supported by the processor model to be tested under different numbers of test base libraries and different numbers of processor allocations.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the processor computing power resource measurement method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the processor computing power resource estimation method according to any one of claims 1 to 7 when running.
Citation Information
Patent Citations
Four-dimensional real scene traffic simulation vehicle overspeed whole-process tracking detection and alarm system and method
CN108919256A
Algorithm index test method and device, camera access method and medium
CN115052140A
Test data processing device, test data processing method and test apparatus
WO2018196734A1
Task scheduling method and apparatus, device, storage medium, computer program product, and computer program
WO2023024410A1