CN-121985154-A - Multi-process video data acquisition method and related device
Abstract
The application provides a multi-process video data acquisition method and a related device, wherein the method comprises the steps of controlling m video nodes to acquire m first video data according to preset frequency in real time, acquiring preset multi-process acquisition tasks, wherein the multi-process acquisition tasks comprise a first process acquisition tasks, determining a client corresponding to the a first process acquisition tasks, receiving a processing instruction sent by the a client for a reference video node, acquiring first video data corresponding to the reference video node in the m first video data, acquiring the reference first video data, and performing data processing and data reading on the reference first video data according to the a processing instruction and the a client to complete the multi-process acquisition tasks. And the video data is processed and shared with multiple processes for reading, so that the efficiency and flexibility of the multiple process video data acquisition are improved.
Inventors
- LI JIONG
- YI XIANG
Assignees
- 深圳从平技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260403
Claims (10)
- 1. A multi-process video data acquisition method is characterized by being applied to a server, wherein a multi-process video data acquisition system comprises the server, m video nodes and a plurality of clients which are exclusively managed and controlled by the server, m is an integer larger than 1, and the method comprises the following steps: Controlling the m video nodes to acquire in real time according to a preset frequency to obtain m first video data; acquiring a preset multi-process acquisition task, wherein the multi-process acquisition task comprises a first process acquisition tasks, a is a positive integer; Determining a clients corresponding to the a first process acquisition tasks in the multi-process video data acquisition system; Receiving a processing instruction sent by the a clients for a reference video node, wherein the reference video node is any video node in the m video nodes; acquiring first video data corresponding to the reference video node in the m first video data to obtain reference first video data; And according to the a processing instructions and the a clients, carrying out data processing and data reading on the reference first video data so as to complete the multi-process acquisition task.
- 2. The method of claim 1, wherein each of the m video nodes comprises a memory block group, each memory block group comprises a first memory block and a second memory block, the first memory block is used for storing first video data acquired by the corresponding video node, the second memory block is used for storing second video data obtained by hardware acceleration processing of the first video data, and the processing instruction comprises any one of a hardware acceleration enabling instruction and a hardware acceleration disabling instruction, wherein the hardware acceleration enabling instruction carries a target aging requirement, and the target aging requirement is used for limiting hardware acceleration processing time of the reference first video data; and performing data processing and data reading on the reference first video data according to the a processing instructions and the a clients to complete the multi-process acquisition task, wherein the method comprises the following steps: if the a processing instructions are all the hardware acceleration disabling instructions, stopping hardware acceleration processing on the reference first video data, wherein the reference first video data is stored in a first memory block of the reference video node; controlling the a clients to read the reference first video data so as to complete the multi-process acquisition task; Or alternatively If at least one processing instruction in the a processing instructions is the hardware acceleration enabling instruction, performing hardware acceleration processing on the reference first video data to obtain reference second video data, wherein the reference second video data is stored in a second memory block of the reference video node; And controlling the a clients to read the data of the reference first video data or the reference second video data so as to complete the multi-process acquisition task.
- 3. The method of claim 2, wherein performing hardware acceleration processing on the reference first video data to obtain reference second video data comprises: Invoking a 2D hardware accelerator corresponding to the server side, and distributing reference reading permission and reference writing permission for the 2D hardware accelerator, wherein the reference reading permission is used for reading the reference first video data in a first memory block of the reference video node; Controlling the 2D hardware accelerator, and reading the reference first video data according to the reference read authority; Determining a target processing speed according to the target aging requirement; Controlling the 2D hardware accelerator, and executing 2D graphic operation on the reference first video data according to the target processing speed to obtain the reference second video data, wherein the 2D graphic operation comprises at least one of point drawing, line drawing, image clipping, scaling and rotation; and controlling the 2D hardware accelerator, writing the reference second video data into a second memory block of the reference video node according to the reference writing authority, and releasing the reference reading authority and the reference writing authority after the writing is completed.
- 4. The method of claim 2, wherein the controlling the a clients to read the reference first video data or the reference second video data comprises: obtaining a processing instruction corresponding to a reference client in the a processing instructions to obtain a reference processing instruction, wherein the reference client is any one client in the a clients; If the reference processing instruction is the hardware acceleration disabling instruction, reading the reference first video data from a first memory block of the reference video node; and if the reference processing instruction is the hardware acceleration enabling instruction, reading the reference second video data from a second memory block of the reference video node.
- 5. The method of claim 4, wherein the reading the reference first video data from the first memory block of the reference video node comprises: the method comprises the steps of receiving a first access request sent by a reference client, wherein the first access request comprises a first identifier of the reference client and a first number of a first memory block of a reference video node; Performing authority verification on a preset data reading authority library according to the first identifier and the first number to obtain an authority verification result; If the authority verification result is that verification is not passed, terminating a reading flow and feeding back an authority abnormality prompt to the reference client; If the authority verification result is that the verification is passed, a first access address and a data writing state of a first memory block of the reference video node are obtained, wherein the data writing state comprises a writing state or a suspension writing state; If the data writing state is the writing state, waiting for the data writing state to be changed into the writing suspension state, and reading the reference first video data according to the first access address; and if the data writing state is the writing suspension state, directly reading the reference first video data according to the first access address.
- 6. The method of claim 4, wherein after the reading the reference second video data from the second memory block of the reference video node, the method further comprises: acquiring the service type of the reference client and the acquisition requirement of a reference process acquisition task, wherein the reference process acquisition task is a first process acquisition task corresponding to the reference client in the a first process acquisition tasks; Determining a processing chip corresponding to the service type in the server, wherein the processing chip comprises an NPU chip or a GPU chip; The load state comprises at least one of a calculated force occupancy rate, a task queue length and a chip temperature; if the load state meets the preset condition, controlling the processing chip to process the reference second video data based on the acquisition requirement to obtain target second video data; and if the load state does not meet the preset condition, starting a load balancing scheduling strategy, wherein the load balancing scheduling strategy is used for adjusting chip resource allocation and reducing the load pressure of the processing chip.
- 7. The method of any of claims 3-6, wherein prior to said receiving a processing instructions sent by the a clients for a reference video node, the method further comprises: acquiring a first working state of the reference video node and a second working state of the 2D hardware accelerator; if the first working state and the second working state are both normal states, executing the step of receiving a processing instructions sent by the a clients for the reference video node; And if the first working state and/or the second working state is an abnormal state, not executing the step of receiving a processing instructions sent by the a clients for the reference video node, and feeding back a work abnormality prompt to each client in the a clients.
- 8. The multi-process video data acquisition device is characterized by being applied to a server, wherein a multi-process video data acquisition system comprises the server, m video nodes and a plurality of clients which are exclusively managed and controlled by the server, m is an integer larger than 1, and the device comprises a control module, a first acquisition module, a determination module, a receiving module, a second acquisition module and a processing module, wherein: the control module is used for controlling the m video nodes to acquire m first video data in real time according to a preset frequency; the first acquisition module is used for acquiring a preset multi-process acquisition task, wherein the multi-process acquisition task comprises a first process acquisition tasks, a is a positive integer; The determining module is used for determining a clients corresponding to the a first process acquisition tasks in the multi-process video data acquisition system; The receiving module is used for receiving a processing instructions sent by the a clients aiming at a reference video node, wherein the reference video node is any video node in the m video nodes; the second obtaining module is configured to obtain first video data corresponding to the reference video node in the m first video data, so as to obtain reference first video data; And the processing module is used for carrying out data processing and data reading on the reference first video data according to the a processing instructions and the a clients so as to complete the multi-process acquisition task.
- 9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-7.
- 10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-7.
Description
Multi-process video data acquisition method and related device Technical Field The application relates to the technical field of video data acquisition, in particular to a multi-process video data acquisition method and a related device. Background Along with the popularization of intelligent flat boards in the vehicle-mounted field, multipath video processing has become a necessary function for core operations such as AI visual monitoring, video streaming, real-time display and the like. The current vehicle-mounted video data acquisition and processing is dependent on a V4L2 video driving frame, but a video node adopts an exclusive access mechanism, and only one process client access is supported at the same time, so that the requirement of using video streams in parallel by multiple processes cannot be met. The existing solution mostly adopts a data copy forwarding mechanism, but has the defects of high transmission delay, more occupied system resources and poor compatibility and adaptability of multiple systems, and the graphics processing operation of video data is independently executed by each process, so that the problems of resource waste and insufficient processing flexibility are solved. Therefore, how to improve the efficiency and flexibility of multi-process video data acquisition is needed to be solved. Disclosure of Invention The embodiment of the application provides a multi-process video data acquisition method and a related device, which are characterized in that a server side exclusively controls a plurality of video nodes and uniformly receives processing instructions of a plurality of clients aiming at the same video node, and data processing and multi-process sharing reading are carried out on video data of the video nodes, so that the efficiency and the flexibility of multi-process video data acquisition are improved. In a first aspect, an embodiment of the present application provides a multi-process video data acquisition method, which is applied to a server, where the multi-process video data acquisition system includes the server, and m video nodes and a plurality of clients are exclusively managed and controlled by the server, where m is an integer greater than 1, and the method includes: Controlling the m video nodes to acquire in real time according to a preset frequency to obtain m first video data; acquiring a preset multi-process acquisition task, wherein the multi-process acquisition task comprises a first process acquisition tasks, a is a positive integer; Determining a clients corresponding to the a first process acquisition tasks in the multi-process video data acquisition system; Receiving a processing instruction sent by the a clients for a reference video node, wherein the reference video node is any video node in the m video nodes; acquiring first video data corresponding to the reference video node in the m first video data to obtain reference first video data; And according to the a processing instructions and the a clients, carrying out data processing and data reading on the reference first video data so as to complete the multi-process acquisition task. In a second aspect, an embodiment of the present application provides a multi-process video data acquisition device, which is applied to a server, where the multi-process video data acquisition system includes the server, and m video nodes and a plurality of clients are controlled exclusively by the server, where m is an integer greater than 1, and the device includes a control module, a first acquisition module, a determination module, a receiving module, a second acquisition module, and a processing module, where: the control module is used for controlling the m video nodes to acquire m first video data in real time according to a preset frequency; the first acquisition module is used for acquiring a preset multi-process acquisition task, wherein the multi-process acquisition task comprises a first process acquisition tasks, a is a positive integer; The determining module is used for determining a clients corresponding to the a first process acquisition tasks in the multi-process video data acquisition system; The receiving module is used for receiving a processing instructions sent by the a clients aiming at a reference video node, wherein the reference video node is any video node in the m video nodes; the second obtaining module is configured to obtain first video data corresponding to the reference video node in the m first video data, so as to obtain reference first video data; And the processing module is used for carrying out data processing and data reading on the reference first video data according to the a processing instructions and the a clients so as to complete the multi-process acquisition task. In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more progr