Video stream and/or picture stream data sharing method and device and electronic equipment

文档序号:1617319 发布日期:2020-01-10 浏览:16次 中文

阅读说明:本技术 视频流和/或图片流数据的共享方法、装置及电子设备 (Video stream and/or picture stream data sharing method and device and electronic equipment ) 是由 杨俊� 陶云峰 袁海 朱庄峰 于 2019-10-10 设计创作,主要内容包括:本发明涉及视频流和/或图片流数据的共享方法、装置、电子设备及存储介质,其中,视频流和/或图片流数据的共享方法包括:获取监控系统的视频流和/或图片流并对获取的所述视频流和/或图片流进行解码得到解码后的数据;将所述解码后的数据缓存在内存中;根据接收到的多个客户端发送的请求,分别对多个客户端共享所述解码后的数据,以便所述多个客户端获取所述解码后的数据。本发明实施例的视频流和/或图片流数据的共享方法,提高了解码后的数据的复用率,降低了处理器中的硬件解码单元对同一视频流和/或图片流的解码次数,降低了处理器中的硬件解码单元的解码压力,可在不依赖特殊硬件、不增加成本的情况下增加视频流和/或图片流的接入路数。(The invention relates to a sharing method and a sharing device of video stream and/or picture stream data, electronic equipment and a storage medium, wherein the sharing method of the video stream and/or the picture stream data comprises the following steps: acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data; caching the decoded data in a memory; and sharing the decoded data for the plurality of clients respectively according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data. The sharing method of the video stream and/or the picture stream data improves the multiplexing rate of the decoded data, reduces the decoding times of the hardware decoding unit in the processor on the same video stream and/or the picture stream, reduces the decoding pressure of the hardware decoding unit in the processor, and can increase the access path number of the video stream and/or the picture stream without depending on special hardware and increasing the cost.)

1. A method for sharing video stream and/or picture stream data, comprising:

acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

caching the decoded data in a memory;

and sharing the decoded data for the plurality of clients respectively according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

2. The method for sharing video stream and/or picture stream data according to claim 1, wherein the method for sharing video stream and/or picture stream data further comprises:

and after the plurality of clients all acquire the decoded data, clearing the decoded data cached in the memory.

3. The method for sharing video stream and/or picture stream data according to claim 2, wherein the clearing specifically comprises: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

4. The method according to claim 1, wherein the sharing the decoded data among the plurality of clients specifically comprises:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

5. The method for sharing video stream and/or picture stream data according to claim 1, wherein the request sent by the client includes data processing rules;

and respectively sharing the decoded data to a plurality of clients, and simultaneously respectively carrying out data processing on the decoded data according to the data processing rule in the request sent by each client.

6. An apparatus for sharing stream data of video stream and/or picture, comprising:

the decoding module is used for acquiring a video stream and/or a picture stream of the monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

the storage module is used for caching the decoded data in a memory;

and the sharing module is used for respectively sharing the decoded data to the plurality of clients according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

7. The apparatus for sharing video stream and/or picture stream data according to claim 6, further comprising:

and the clearing module is used for clearing the decoded data cached in the memory after the plurality of clients all acquire the decoded data.

8. The apparatus for sharing video stream and/or picture stream data according to claim 7, wherein the clearing module is specifically configured to: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

9. The apparatus for sharing video stream and/or picture stream data according to claim 6, wherein the sharing module is specifically configured to:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

10. The apparatus for sharing video stream and/or picture stream data according to claim 6,

the request sent by the client comprises a data processing rule;

the sharing module is further configured to, while sharing the decoded data with the multiple clients, perform data processing on the decoded data according to the data processing rule in the request sent by each client.

11. An electronic device for sharing of video stream and/or picture stream data, comprising:

one or more processors;

one or more memories having computer readable code stored therein which, when executed by the one or more processors, performs the method of sharing of video and/or picture stream data of any of claims 1-5.

12. A non-transitory computer storage medium having stored therein computer readable code, which when executed by one or more processors performs the method of sharing of video stream and/or picture stream data of any one of claims 1-5.

Technical Field

The present invention relates to the field of video data processing technologies, and in particular, to a method and an apparatus for sharing video stream and/or picture stream data, an electronic device, and a computer storage medium.

Background

In the prior art, the hardware decoding unit decodes the acquired video stream and/or picture stream for multiple times to send the decoded data to a plurality of clients respectively, but the capacity of the hardware decoding unit in the processor is limited, if the number of access paths of the video stream and/or picture stream is to be increased, an external video decoding chip needs to be expanded or a processor with a higher specification needs to be selected, and related cost is increased.

Disclosure of Invention

To solve the above technical problems, an object of the present invention is to provide a method for sharing video stream and/or picture stream data, which improves the multiplexing rate of decoded data, reduces the decoding times of the same video stream and/or picture stream by a hardware decoding unit in a processor, and further reduces the decoding pressure of the hardware decoding unit in the processor, so as to increase the number of access paths for the video stream and/or picture stream without depending on special hardware and increasing the cost

Another object of the present invention is to provide a video stream and/or picture stream data sharing apparatus for implementing the above sharing method.

In order to achieve the purpose, the invention adopts the following technical scheme:

the method for sharing the video stream and/or the picture stream data according to the embodiment of the first aspect of the invention comprises the following steps:

acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

caching the decoded data in a memory;

and sharing the decoded data for the plurality of clients respectively according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

Preferably, the method for sharing video stream and/or picture stream data further includes: and after the plurality of clients all acquire the decoded data, clearing the decoded data cached in the memory.

Preferably, the clearing specifically comprises: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

Preferably, the sharing the decoded data among the plurality of clients respectively specifically includes:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

Preferably, the request sent by the client comprises a data processing rule;

and respectively sharing the decoded data to a plurality of clients, and simultaneously respectively carrying out data processing on the decoded data according to the data processing rule in the request sent by each client.

The device for sharing video stream and/or picture stream data according to the second aspect of the present invention comprises:

the decoding module is used for acquiring a video stream and/or a picture stream of the monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

the storage module is used for caching the decoded data in a memory;

and the sharing module is used for respectively sharing the decoded data to the plurality of clients according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

Preferably, the apparatus for sharing video stream and/or picture stream data further comprises:

and the clearing module is used for clearing the decoded data cached in the memory after the plurality of clients all acquire the decoded data.

Preferably, the clearing module is specifically configured to: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

Preferably, the sharing module is specifically configured to:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

Preferably, the request sent by the client comprises a data processing rule;

the sharing module is further configured to, while sharing the decoded data with the multiple clients, perform data processing on the decoded data according to the data processing rule in the request sent by each client.

An electronic device for sharing of video stream and/or picture stream data according to an embodiment of the third aspect of the invention, comprises:

one or more processors;

one or more memories having computer readable code stored therein, which when executed by the one or more processors, performs the method of sharing video stream and/or picture stream data of any of the above embodiments.

A non-transitory computer storage medium according to a fourth aspect of the invention, wherein computer readable code is stored, which when executed by one or more processors performs the method of sharing video stream and/or picture stream data as described in any of the above embodiments.

The invention has the beneficial effects that:

the sharing method of the video stream and/or the picture stream data improves the multiplexing rate of the decoded data, reduces the decoding times of a hardware decoding unit in a processor on the same video stream and/or the picture stream, further reduces the decoding pressure of the hardware decoding unit in the processor, and can increase the access path number of the video stream and/or the picture stream without depending on special hardware and increasing the cost. In addition, the sharing method also avoids resource waste and time consumption caused by copying the decoded data.

The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood and to implement them in accordance with the contents of the description, the following detailed description is given with reference to the preferred embodiments of the present invention and the accompanying drawings.

Drawings

Fig. 1 is a flowchart of a method for sharing video stream and/or picture stream data according to an embodiment of the present invention;

fig. 2 is a schematic structural diagram of a device for sharing video stream and/or picture stream data according to an embodiment of the present invention;

fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention, but are not intended to limit the scope of the invention.

It will be appreciated that as used herein, the term module may refer to or include an Application Specific Integrated Circuit (ASIC), an electronic circuit, a processor (shared, dedicated, or group) and/or memory that executes one or more software or firmware programs, a combinational logic circuit, and/or other suitable hardware components that provide the described functionality, or may be part of such hardware components.

It will be appreciated that in embodiments of the invention, the processor may be a microprocessor, a digital signal processor, a microcontroller, the like, and/or any combination thereof. According to another aspect, the processor may be a single-core processor, a multi-core processor, the like, and/or any combination thereof.

According to the sharing device of the video stream and/or the picture stream data, the sharing device can acquire the video stream and/or the picture stream of the monitoring system, decode the acquired video stream and/or the picture stream and share the decoded video stream and/or the picture stream to a plurality of clients, and enable the plurality of clients to acquire the decoded data.

For example, in a security product, the sharing device may collect a video stream and/or a picture stream of a monitoring camera, decode the obtained video stream and/or picture stream, and share the video playing client and the AI data processing client, so that the video playing client and the AI data processing client obtain the decoded data for processing.

The device for sharing video stream and/or picture stream data comprises a decoding module 10, a storage module 20 and a sharing module 30.

The decoding module 10 is configured to acquire a video stream and/or a picture stream of the monitoring system and decode the acquired video stream and/or picture stream to obtain decoded data. The video stream and/or the picture stream may be directly transmitted to the decoding module 10 by the monitoring system, or one of the video stream and/or the picture stream obtained by copying the video stream and/or the picture stream of the monitoring system through the copying module may be transmitted to the decoding module 10. Wherein, the decoded data can be YUV stream.

The storage module 20 is configured to cache the decoded data in the memory.

The sharing module 30 is configured to share the decoded data with the multiple clients respectively according to the received requests sent by the multiple clients, so that the multiple clients can obtain the decoded data.

The sharing device of the video stream and/or the picture stream data improves the multiplexing rate of the decoded data, reduces the decoding times of a hardware decoding unit in a processor on the same video stream and/or the picture stream, further reduces the decoding pressure of the hardware decoding unit in the processor, and can increase the access path number of the video stream and/or the picture stream without depending on special hardware and increasing the cost. In addition, the sharing device also avoids resource waste and time consumption caused by copying the decoded data. Moreover, the sharing device of the video stream and/or the picture stream data has wide application range and can be widely popularized and applied.

According to some embodiments of the present invention, the apparatus for sharing video stream and/or picture stream data further includes a clearing module, configured to clear the decoded data cached in the memory after the plurality of clients all obtain the decoded data. So as to ensure the use space of the memory and further ensure the decoding capability of the sharing device of the video stream and/or the picture stream data on the video stream and/or the picture stream data.

Preferably, the purging module is specifically configured to send the purging instructions for purging the cached decoded data respectively after the client acquires the decoded data, and purge the cached decoded data after receiving the purging instructions sent by all of the plurality of clients. The method can ensure that the decoded data cached in the memory is cleared after the plurality of clients all acquire the decoded data, and is simple.

According to some embodiments of the present invention, the sharing module 30 is specifically configured to map the decoded data to a physical address thereof, and send the physical address to a plurality of clients; and mapping the physical address to a virtual address, and accessing the virtual address by a plurality of clients according to the received physical address to share the decoded data. The decoded data can be simply shared by a plurality of clients, so that the plurality of clients can conveniently acquire the decoded data.

According to some embodiments of the invention, the request sent by the client comprises a data processing rule;

the sharing module 30 is further configured to, while sharing the decoded data with the multiple clients, perform data processing on the decoded data according to the data processing rule in the request sent by each client.

The method for sharing the video stream and/or the picture stream data based on the video stream and/or the picture stream data sharing device comprises the following steps:

step S1, acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

step S2, caching the decoded data in a memory;

step S3, according to the received requests sent by the multiple clients, sharing the decoded data with the multiple clients, respectively, so that the multiple clients can obtain the decoded data.

According to some embodiments of the invention, the request sent by the client comprises a data processing rule;

and respectively sharing the decoded data to a plurality of clients, and simultaneously respectively carrying out data processing on the decoded data according to the data processing rule in the request sent by each client. The data processing rule may be to perform all or interval access on the decoded data, or may perform other processing on the decoded data according to actual conditions.

The sharing method of the video stream and/or the picture stream data improves the multiplexing rate of the decoded data, reduces the decoding times of a hardware decoding unit in a processor on the same video stream and/or the picture stream, further reduces the decoding pressure of the hardware decoding unit in the processor, and can increase the access path number of the video stream and/or the picture stream without depending on special hardware and increasing the cost.

According to some embodiments of the present invention, sharing the decoded data among the plurality of clients specifically includes:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

According to some embodiments of the invention, the method of sharing video stream and/or picture stream data further comprises:

step S4, after all the clients acquire the decoded data, the decoded data cached in the memory is cleared.

Preferably, the clearing specifically comprises: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

Based on the same inventive concept as the above-described method of sharing video stream and/or picture stream data, the present application further provides an electronic device 1400, the electronic device 1400 comprising one or more processors 1401 and one or more memories 1402, the memory 1402 storing therein computer readable code,

wherein the computer readable code when executed by the one or more processors 1401 performs the steps of:

acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

caching the decoded data in a memory;

and sharing the decoded data for the plurality of clients respectively according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

Preferably, the sharing of the decoded data by the plurality of clients specifically includes:

mapping the decoded data to its physical address, an

Sending the physical address to the plurality of clients;

and mapping the physical address to a virtual address, and the plurality of clients access the virtual address according to the received physical address to share the decoded data.

Preferably, the request sent by the client comprises a data processing rule;

and respectively sharing the decoded data to a plurality of clients, and simultaneously respectively carrying out data processing on the decoded data according to the data processing rule in the request sent by each client.

Further, the electronic device 1400 further includes a network interface 1403, an input device 1404, a hard disk 1405, and a display device 1406.

The various interfaces and devices described above may be interconnected by a bus architecture. A bus architecture may be any architecture that may include any number of interconnected buses and bridges. One or more Central Processing Units (CPUs), represented in particular by processor 1401, and the various circuits of one or more memories 1402, represented by memory 1402, are coupled together. The bus architecture may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like. It will be appreciated that a bus architecture is used to enable communications among the components. The bus architecture includes a power bus, a control bus, and a status signal bus, in addition to a data bus, all of which are well known in the art and therefore will not be described in detail herein.

The network interface 1403 may be connected to a network (e.g., the internet, a local area network, etc.), obtain relevant data from the network, and store the data in the hard disk 1405.

An input device 1404 may receive various instructions input by an operator and send to processor 1401 for execution. The input devices 1404 may include a keyboard or pointing device (e.g., mouse, trackball, touch pad, touch screen, or the like).

The display device 1406 may display a result obtained by the processor 1401 executing the instruction.

The memory 1402 is used for storing programs and data necessary for the operation of the operating system 14021, and data such as intermediate results in the calculation process of the processor 1401.

It will be appreciated that the memory 1402 in the subject embodiments can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. The memory 1402 of the apparatus and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.

In some embodiments, memory 1402 stores elements, executable modules or data structures, or a subset thereof, or an expanded set thereof as follows: an operating system 14021 and application programs 14014.

The operating system 14021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application 14014 includes various applications, such as a Browser (Browser), and the like, for implementing various application services. A program implementing the methods of embodiments of the present application may be included in application 14014.

The methods disclosed in the embodiments described above may be implemented in processor 1401, or by processor 1401. Processor 1401 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by instructions in the form of hardware integrated logic circuits or software in the processor 1401. The processor 1401 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory 1402, and a processor 1401 reads information in the memory 1402 and performs the steps of the above method in combination with hardware thereof.

It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.

For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.

Preferably, the computer readable code when executed by the one or more processors 1401 may also implement the steps of:

and after the plurality of clients all acquire the decoded data, clearing the decoded data cached in the memory.

Preferably, the clearing specifically comprises: and after the client side acquires the decoded data, respectively sending out a clearing instruction for clearing the cached decoded data, and after receiving the clearing instructions sent by all the plurality of client sides, clearing the cached decoded data.

In the embodiment of the present application, the electronic device 1400 caches the decoded data in the memory and shares the data with multiple clients, so that the multiple clients obtain the decoded data, thereby improving the multiplexing rate of the decoded data, reducing the decoding times of the hardware decoding unit in the processor for the same video stream and/or picture stream, and further reducing the decoding pressure of the hardware decoding unit in the processor, so as to increase the number of access paths for the video stream and/or picture stream without depending on special hardware or increasing the cost.

Additionally, embodiments of the present application also provide a non-transitory computer storage medium storing computer readable code that when executed by one or more processors performs the steps of:

acquiring a video stream and/or a picture stream of a monitoring system and decoding the acquired video stream and/or picture stream to obtain decoded data;

caching the decoded data in a memory;

and sharing the decoded data for the plurality of clients respectively according to the received requests sent by the plurality of clients so that the plurality of clients can acquire the decoded data.

When executed by the processor, the computer readable code implements the processes of the above-mentioned video stream and/or picture stream data sharing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, detailed processes are not repeated here. The computer storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.

In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.

In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.

The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:校准媒体回放信道用于同步呈现

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类