CN114071222B - Audio and video data sharing device and electronic equipment - Google Patents

Audio and video data sharing device and electronic equipment Download PDF

Info

Publication number
CN114071222B
CN114071222B CN202111346519.1A CN202111346519A CN114071222B CN 114071222 B CN114071222 B CN 114071222B CN 202111346519 A CN202111346519 A CN 202111346519A CN 114071222 B CN114071222 B CN 114071222B
Authority
CN
China
Prior art keywords
read
data
interface
reading
sharing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111346519.1A
Other languages
Chinese (zh)
Other versions
CN114071222A (en
Inventor
李森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN202111346519.1A priority Critical patent/CN114071222B/en
Publication of CN114071222A publication Critical patent/CN114071222A/en
Application granted granted Critical
Publication of CN114071222B publication Critical patent/CN114071222B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application relates to an audio and video data sharing device and electronic equipment. The device comprises a writing interface, a reading mask setting interface, a time period acquisition interface, a reading position adjusting interface and a reading interface; the write interface is configured to write data to be read to the shared module; the read mask setting interface is configured to set a mask of data to be read to the sharing module; the time period acquisition interface is configured to acquire the time length of the data to be read from the sharing module; the read position adjustment interface is configured to set a read position of data to be read to the sharing module; the reading interface is configured to read the data to be read from the sharing module based on the mask of the data to be read and the reading position of the data to be read, so that the multi-process equipment with audio and video processing is convenient to process the audio and video data with high efficiency, the multi-process concurrent access is realized, the effective data transfer and interaction are carried out among different processes, the audio and video data sharing operation is simplified, the data sharing efficiency is improved, and the memory fragmentation is avoided.

Description

Audio and video data sharing device and electronic equipment
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to an audio and video data sharing device and an electronic device.
Background
Along with the continuous progress of technology and market demand, more and more intelligent home products can combine Camera (Camera) and then derive more application scenario, like intelligent lock with electronic cat eye function, support cell-phone App to look into home gate and two-way pronunciation intercom in real time, not only improved security level and also brought better visual experience for the user.
The equipment end related to Camera needs to carry out video acquisition, coding, compression and transmission. In general, the device side is an operating system (such as Linux OS) supporting multitasking, different tasks are divided to process different logics, for example, an image is collected by a special collection process, the image is collected frame by frame in real time through Camera, and collected data is stored in a temporary Buffer (memory) corresponding to the task; the image is stored with a special storage process, and is responsible for reading the data stored from the acquisition process and writing the data into the local Flash; the network transmission has a special transmission process and is responsible for reading the data stored in the acquisition process and sending the data out through the network. Data transfer or data interaction is required between different processes.
In the prior art, different memory spaces are allocated for different data (such as H264 video, mjpeg image, audio data and the like), then data are transferred between processes through memory copying, the operation is complex, the data sharing efficiency is low, and memory fragments are easily caused.
Disclosure of Invention
Based on this, it is necessary to provide an audio/video data sharing device and an electronic device that can perform effective data transfer and interaction between different processes, simplify audio/video data sharing operation, improve data sharing efficiency, and avoid memory fragmentation, aiming at the problems of complicated operation, low data sharing efficiency, and easy memory fragmentation chip of the conventional audio/video data sharing.
In a first aspect, the present application provides an audio/video data sharing apparatus, including:
a write interface configured to write data to be read to the shared module;
a read mask setting interface configured to set a mask of data to be read to the shared module;
a time period acquisition interface configured to acquire a time length of data to be read from the sharing module;
a read position adjustment interface configured to set a read position of the data to be read to the shared module; the reading position of the data to be read is obtained by processing according to the time length of the data to be read;
and a read interface configured to read the data to be read from the shared module based on the mask of the data to be read and the read position of the data to be read.
Optionally, the method further comprises creating an interface and a switch interface;
the creation interface is configured to create a sharing module by the first process; the switch interface is configured to open the sharing module by the second process; the first process and the second process are different processes.
Optionally, the system further comprises a timestamp acquisition interface; the data to be read by the read interface comprises a current time stamp;
the time stamp obtaining interface is configured to obtain the latest time stamp in the sharing module, so that the processing process obtains the latest time stamp and the current time stamp, processes the latest time stamp and the current time stamp, and adjusts the reading speed of the reading interface according to the processing result.
Optionally, the system further comprises a latest data reading interface;
the latest data reading interface is configured to search and read latest data corresponding to the current reading position based on the current reading position; the latest data is the data corresponding to the latest writing time of the writing interface.
Optionally, the system further comprises a waiting interface;
the waiting interface is configured to wait for a preset time and then read the data to be read.
Optionally, the device further comprises a forced reading interface;
the forced reading interface is configured to read the data to be read from the sharing module based on the mask of the data to be read and the reading position of the data to be read, and if the data to be read fails, the data to be read is read from the sharing module again after waiting for a preset time until the data to be read is successfully read.
Optionally, the system further comprises a latest data forced reading interface;
the latest data forced reading interface is configured to search and read the latest data corresponding to the current reading position based on the current reading position, and if the reading fails, the latest data corresponding to the current reading position is searched and read again after waiting for a preset time until the reading is successful.
Optionally, if the write interface writes the data to be read into the shared module based on the first order, the read interface reads the data to be read from the shared module based on the mask of the data to be read and the read position of the data to be read, and according to the first order.
Optionally, the range of the reading position of the data to be read is a numerical value ranging from 0 to the time length of the data to be read; when the reading position of the data to be read is 0, the reading interface starts to read the data which is written into the sharing module earliest; when the reading position of the data to be read is the numerical value of the time length of the data to be read, the reading interface starts to read the data which is written into the sharing module from the latest.
In a second aspect, the present application provides an electronic device, including any one of the foregoing audio and video data sharing apparatuses.
One of the above technical solutions has the following advantages and beneficial effects:
the audio and video data sharing device comprises a writing interface, a reading mask setting interface, a time period acquisition interface, a reading position adjusting interface and a reading interface; the write interface, the read mask setting interface, the time period acquisition interface, the read position adjustment interface and the read interface are respectively in communication connection with the sharing module, and the write interface is configured to write data to be read into the sharing module; the read mask setting interface is configured to set a mask of data to be read to the sharing module; the time period acquisition interface is configured to acquire the time length of the data to be read from the sharing module; the read position adjustment interface is configured to set a read position of data to be read to the sharing module; the reading position of the data to be read is obtained by processing according to the time length of the data to be read; the read interface is configured to read the data to be read from the sharing module based on the mask of the data to be read and the read position of the data to be read, so that the multi-process equipment with audio and video processing is convenient to process the audio and video data with high efficiency. The audio and video sharing device has an efficient memory allocation mechanism, can realize multi-process concurrent access, realizes effective data transmission and interaction among different processes, simplifies audio and video data sharing operation, improves data sharing efficiency, and avoids memory fragments.
Drawings
Fig. 1 is a first structural schematic diagram of an audio/video data sharing device in an embodiment of the present application.
Fig. 2 is a second schematic structural diagram of an audio/video data sharing device in an embodiment of the present application.
Fig. 3 is a third structural schematic diagram of an audio/video data sharing device according to an embodiment of the present application.
Fig. 4 is a fourth schematic structural diagram of an audio/video data sharing device according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an audio/video data sharing system according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The audio and video data sharing device provided by the application can be applied to multi-process equipment with audio and video processing. The multi-process device can be, but not limited to, an intelligent door lock with an electronic cat eye function, a video monitoring device, other electronic devices with cameras and the like. The multi-process electronic device may include a processor-readable memory, the processor may include a plurality of processing processes, and any one of the processing processes may communicate with the shared module through a write interface, a read mask setting interface, a time period acquisition interface, a read position adjustment interface, and a read interface, respectively. For example, any processing process can call a write interface, and data to be read is written into the sharing module through the write interface; any processing process can call a read mask setting interface, and a mask of data to be read is set to the sharing module through the read mask setting interface; any processing process can call a time period acquisition interface, and the time period of the data to be read is acquired from the sharing module through the time period acquisition interface; any processing process can call a reading position adjusting interface, and a reading position of data to be read is set to the sharing module through the reading position adjusting interface; the reading position of the data to be read is obtained by processing according to the time length of the data to be read; any processing procedure can call a read interface, and the read interface reads the data to be read from the sharing module based on the mask of the data to be read and the read position of the data to be read.
In one embodiment, as shown in fig. 1, an audio and video data sharing apparatus is provided, which includes a write interface 110, a read mask setting interface 120, a time period acquisition interface 130, a read position adjustment interface 140, and a read interface 150. The write interface 110 is configured to write data to be read to the shared module 200; the read mask setting interface 120 is configured to set a mask of data to be read to the sharing module 200; the time period acquisition interface 130 is configured to acquire a time length of data to be read from the sharing module 200; the read position adjustment interface 140 is configured to set a read position of data to be read to the sharing module 200; the reading position of the data to be read is obtained by processing according to the time length of the data to be read; the read interface 150 is configured to read the data to be read from the sharing module 200 based on the mask of the data to be read and the read position of the data to be read.
The sharing module 200, that is, a Frame Share module, is a module for sharing audio and video data streams between processes. The data to be read refers to audio-video data. The audio/video data sharing device is provided with a write interface 110, and the write interface 110 is in communication connection with the sharing module 200. The write interface 110, i.e., the write interface, may be used to write data to be read to the shared module 200. Wherein the data to be read is audio/video data; if the process can call the write interface 110, the data to be read is written to the sharing module 200 through the write interface 110. The audio and video data sharing apparatus is provided with a read mask setting interface 120, and the read mask setting interface 120 is communicatively connected to the sharing module 200. The read mask setting interface 120, that is, a set read mask interface, may set a mask of data to be read to the sharing module 200; if the process can call the read mask setting interface 120, the mask of the data to be read is set to the sharing module 200 through the read mask setting interface 120. For example, when a mask of data to be read is set to the sharing module 200 through the read mask setting interface 120, a specific mask value may refer to a header file. The mask can be set to select which way or ways of data to be read, and if a plurality of ways of reading are set, which way of data to return to is encountered in sequence; in addition, the VPS, SPS, or PPS frames may also be specified to be acquired by the mask.
The audio and video data sharing apparatus is provided with a time period acquisition interface 130, and the time period acquisition interface 130 is communicatively connected to the sharing module 200. The time period acquisition interface 130, that is, the get duration interface, may be used to acquire the length of time for which the data is to be read from the sharing module 200. If the process may call the time period obtaining interface 130, the time period obtaining interface 130 obtains the time length of the data to be read from the sharing module 200, so as to obtain the data of how long the sharing module 200 has, wherein the unit of the time length is millisecond.
The audio and video data sharing device is provided with a reading position adjusting interface 140, and the reading position adjusting interface 140 is in communication connection with the sharing module 200. The read position adjustment interface 140, i.e. the set read pos interface, may be used to set a read position of the data to be read to the shared module 200. If the process can call the reading position adjusting interface 140, the reading position of the data to be read is set to the sharing module 200 through the reading position adjusting interface 140, so as to adjust the reading position of the data stream. The reading position of the data to be read is obtained by processing according to the time length of the data to be read, for example, the time length of the data to be read is duration, and the range of the reading position of the data to be read is 0 to duration.
The audio/video data sharing device is provided with a read interface 150, and the read interface 150 is in communication connection with the sharing module 200. The read interface 150, i.e., a read interface, may be used to read data to be read from the shared module 200 based on a mask of the data to be read and a read location of the data to be read. If the process can call the read interface 150, the read interface 150 reads the data to be read from the sharing module 200 based on the mask of the data to be read and the read position of the data to be read, so as to realize reading the audio/video data stream from the sharing module 200.
It should be noted that, the sharing module 200 is a module for sharing audio and video data streams between processes, and the bottom implementation of the sharing module is mainly based on the shared memory and the semaphore, and supports concurrent access of multiple processes, where each process can be both a writer and a reader. Each reader has a reader ID associated with the semaphore within the module, and when the reader has set the mask for the data stream of interest, the writer will set a readable flag when writing the corresponding data, and if the reader is waiting at this time, will trigger its associated semaphore.
Illustratively, the write interface 110 is configured to write data to be read to the shared module 200 via the write interface 110, the read mask setting interface 120, the time period acquisition interface 130, the read position adjustment interface 140, and the read interface 150, respectively, communicatively coupled to the shared module 200; the read mask setting interface 120 is configured to set a mask of data to be read to the sharing module 200; the time period acquisition interface 130 is configured to acquire a time length of data to be read from the sharing module 200; the read position adjustment interface 140 is configured to set a read position of data to be read to the sharing module 200; the reading position of the data to be read is obtained by processing according to the time length of the data to be read; the read interface 150 is configured to read the data to be read from the sharing module 200 based on the mask of the data to be read and the read position of the data to be read, so as to facilitate efficient audio/video data processing by the multiprocessing device with audio/video processing.
In the above embodiment, by setting the sharing module 200, the write interface 110, the read mask setting interface 120, the time period obtaining interface 130, the read position adjusting interface 140 and the read interface 150 in the audio and video sharing device, and further performing multi-process concurrent access, effective data transfer and interaction between different processes are realized, and the method has an efficient memory allocation mechanism, simplifies audio and video data sharing operation, improves data sharing efficiency, and avoids memory fragmentation.
To enhance the functional integrity of the audio-video sharing device, enriching the interface configuration of the audio-video sharing device, in one example, as shown in fig. 2, the audio-video sharing device further includes a creation interface 160 and a switch interface 170; the creation interface 160 is configured to create a sharing module 200 by a first process; the switch interface 170 is configured to open the sharing module 200 by the second process; the first process and the second process are different processes.
The audio and video data sharing apparatus is provided with a creation interface 160, and the creation interface 160 is communicatively connected to the sharing module 200. The creation interface 160, that is, the create interface, may be used to create the sharing module 200 by the first process; as the first process may invoke the creation interface 160, the sharing module 200 is created through the creation interface 160. It should be noted that, the creation interface 160 can only be invoked by one process, and the other processes can not be invoked any more. The audio/video data sharing device is provided with a switch interface 170, and the switch interface 170 is in communication connection with the sharing module 200. The switch interface 170, the open interface, may be used to open the shared module 200 by the second process; if the second process can call the switch interface 170, the created sharing module 200 is opened through the switch interface 170. Wherein the first process and the second process are different processing processes. The audio and video sharing device enriches the interface configuration of the audio and video sharing device by setting the creation interface 160 and the switch interface 170, thereby enhancing the functional integrity of the audio and video sharing device.
In one example, the same process, if it invokes creation interface 160, cannot invoke switch interface 170, and both returned handles are equivalent and can be used to write or read data.
In order to monitor the reading speed through the reading interface 150 in real time, facilitate process timing to adjust the delay of data stream reading, and avoid excessive delay of the read data stream, in one example, as shown in fig. 3, the audio-video data sharing device further includes a timestamp obtaining interface 180; the data to be read by the read interface 150 includes a current timestamp; the timestamp acquiring interface 180 is configured to acquire the latest timestamp in the sharing module 200, so that the processing procedure acquires the latest timestamp and the current timestamp, processes the latest timestamp and the current timestamp, and adjusts the reading speed of the reading interface 150 according to the result of the processing.
The audio and video data sharing device is provided with a timestamp obtaining interface 180, and the timestamp obtaining interface 180 is in communication connection with the sharing module 200. The timestamp acquiring interface 180, that is, the get new ts interface, may be used to acquire the latest timestamp in the sharing module 200; if the processing procedure can call the timestamp acquisition interface 180, the latest timestamp in the sharing module 200 is acquired through the timestamp; the processing process may call the data to be read by the read interface 150, and analyze the data to be read to obtain a current timestamp corresponding to the data to be read, and further the processing process may obtain the latest timestamp and the current timestamp, process the latest timestamp and the current timestamp, and adjust the reading speed of the read interface 150 according to the processing result.
The time stamp obtaining interface 180 is used for obtaining the latest time stamp in the sharing module 200, and analyzing the data to be read returned by the reading interface 150 to obtain the current time stamp, and comparing the latest time stamp with the current time stamp, so that the speed of the reading interface 150 for reading the data stream can be judged, the speed of the reading interface 150 for real-time monitoring is realized, the delay of the reading of the data stream is conveniently adjusted by process timing, and the overlarge delay of the read data stream is avoided.
To enhance the functional integrity of the audio-video sharing device, enriching the interface configuration of the audio-video sharing device, in one example, as shown in fig. 4, the audio-video data sharing device further includes a latest data reading interface 190; the latest data reading interface 190 is configured to find and read latest data corresponding to a current reading position based on the current reading position; the latest data is data corresponding to the latest write time of the write interface 110.
The audio and video data sharing device is provided with a latest data reading interface 190, and the latest data reading interface 190 is in communication connection with the sharing module 200. The latest data reading interface 190, i.e. read newest interface, may be configured to search and read the latest data corresponding to the current reading position based on the current reading position; if the processing procedure can call the latest data reading interface 190, based on the current reading position, the latest data corresponding to the latest writing time of the writing interface 110, that is, the latest data corresponding to the current reading position, is searched and read, so that the interface configuration of the audio/video sharing device is enriched.
In one example, as shown in fig. 4, the audio-video data sharing apparatus further includes a waiting interface 210; the wait interface 210 is configured to wait for a preset time before reading the data to be read.
The audio/video data sharing device is provided with a waiting interface 210, and the waiting interface 210 is in communication connection with the sharing module 200. The wait interface 210, i.e. wait interface, may be used to wait for a preset time to read the data to be read. If the processing procedure can call the waiting interface 210, and call the reading interface 150 to read the data to be read after waiting for the preset time. It should be noted that, the waiting interface 210 may be used to wait for whether the data needs to be read, but it is not guaranteed that the data can be read, and the waiting interface 210 may be called again when the data cannot be read, and the data is read again after waiting for the preset time.
In one example, as shown in fig. 4, the audio-video data sharing apparatus further includes a forced read interface 220; the forced read interface 220 is configured to read the data to be read from the shared module 200 based on the mask of the data to be read and the read position of the data to be read, and if the reading fails, the data to be read is read from the shared module 200 again after waiting for a preset time until the reading is successful.
The audio/video data sharing device is provided with a forced reading interface 220, and the forced reading interface 220 is in communication connection with the sharing module 200. The forced read interface 220, i.e. wait interface, may be configured to read the data to be read from the shared module 200 based on the mask of the data to be read and the read location of the data to be read, and if the reading fails, wait for a preset time and then read the data to be read from the shared module 200 again until the reading is successful. If the processing process can call the forced read interface 220, the data to be read is read from the sharing module 200, and if the corresponding data is read, the call of the forced read interface 220 is completed; if the corresponding data is not read, the data to be read is read from the sharing module 200 again after waiting for the preset time, and if the corresponding data is read, the call of the forced reading interface 220 is completed; if the corresponding data cannot be read, the corresponding data is read after waiting for the preset time again until the corresponding data is read, so that the corresponding data stream is forcedly read from the sharing module 200, effective data transmission and interaction among different processes are realized, the functional integrity of the audio and video sharing device is further enhanced, and the interface configuration of the audio and video sharing device is enriched.
In one example, as shown in fig. 4, the audio-video data sharing apparatus further includes a latest data forced reading interface 230; the latest data forced reading interface 230 is configured to search for and read the latest data corresponding to the current reading position based on the current reading position, and if the reading fails, wait for a preset time and then search for and read the latest data corresponding to the current reading position again until the reading is successful.
The audio/video data sharing device is provided with a latest data forced reading interface 230, and the latest data forced reading interface 230 is in communication connection with the sharing module 200. The latest data forced reading interface 230, i.e. a must read new interface, may be configured to search and read the latest data corresponding to the current reading position based on the current reading position, and if the reading fails, wait for a preset time and then search and read the latest data corresponding to the current reading position again until the reading is successful. If the processing procedure can call the latest data forced reading interface 230, based on the current reading position, searching and reading the latest data corresponding to the current reading position from the sharing module 200, and if the corresponding latest data is read, completing the call of the latest data forced reading interface 230; if the corresponding latest data is not read, searching and reading the latest data corresponding to the current reading position again after waiting for a preset time, and if the corresponding latest data is read, completing the call of the latest data forced reading interface 220; if the corresponding latest data cannot be read, the corresponding latest data is read after waiting for the preset time again until the corresponding latest data is read, so that the corresponding latest data stream is forcedly read from the sharing module 200, effective data transmission and interaction among different processes are realized, the functional integrity of the audio and video sharing device is further enhanced, and the interface configuration of the audio and video sharing device is enriched.
In one example, if the write interface 110 writes the data to be read to the shared module 200 based on the first order, the read interface 150 reads the data to be read from the shared module 200 based on the mask of the data to be read and the read location of the data to be read. After the writing interface 110 writes the data to be read into the sharing module 200 based on the first order, the sharing module 200 maintains the order of writing the data to be read, and when the data to be read is further read through the reading interface 150, the reading interface 150 returns the data to be read in order even if there are multiple data meeting the conditions.
In one example, the read location of the data to be read ranges from 0 to a value of the time length of the data to be read; when the read position of the data to be read is 0, the read interface 150 starts to read the data written into the shared module 200 earliest; when the read position of the data to be read is the value of the time length of the data to be read, the read interface 150 starts to read the data written in the sharing module 200 from the latest.
The value of the time length of the data to be read is duration, and the range of the reading position of the data to be read is 0 to duration. When the reading position of the data to be read is 0, it indicates that the read interface 150 starts to read from the data that is written into the shared module 200 earliest; when the read position of the data to be read is duration, it indicates that the read interface 150 reads the latest data from the data that is newly written into the sharing module 200.
In the above embodiment, by configuring the write interface, the read mask setting interface, the time period obtaining interface, the read position adjusting interface, the read interface, the creation interface, the switch interface, the timestamp obtaining interface, the latest data reading interface, the waiting interface, the forced reading interface, the latest data forced reading interface and other interfaces for the sharing module, the multi-process device with audio and video processing is convenient to perform efficient audio and video data processing. The audio and video sharing device has an efficient memory allocation mechanism, can realize multi-process concurrent access, realizes effective data transmission and interaction among different processes, simplifies audio and video data sharing operation, improves data sharing efficiency, and avoids memory fragments.
In one embodiment, an electronic device is provided. The electronic device may be, but not limited to, various multi-process devices with cameras (cameras), for example, the electronic device may be an intelligent door lock with electronic cat eye function, a video monitoring device, or other electronic devices with cameras, etc.
An internal structural diagram of the electronic device may be as shown in fig. 5. The electronic equipment comprises a processor, a memory, a display screen and a camera which are connected through a system bus; the electronic device may also include a network interface and an input device. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the electronic device is used for communicating with an external terminal through a network connection. The electronic equipment further comprises an audio and video data sharing device, and the processor is in interactive communication with the audio and video data sharing device. The camera of the electronic equipment can be used for monitoring the current environment in real time to obtain audio and video data. The display screen of the electronic equipment can be a liquid crystal display screen, the input device of the electronic equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the electronic equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the electronic device to which the present application is applied, and that a particular electronic device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, an electronic device is provided, where the electronic device includes an audio-video data sharing apparatus of any one of the above.
The audio and video data sharing device comprises a writing interface, a reading mask setting interface, a time period acquisition interface, a reading position adjusting interface and a reading interface; the write interface, the read mask setting interface, the time period acquisition interface, the read position adjustment interface and the read interface are respectively in communication connection with the sharing module, and the write interface is configured to write data to be read into the sharing module; the read mask setting interface is configured to set a mask of data to be read to the sharing module; the time period acquisition interface is configured to acquire the time length of the data to be read from the sharing module; the read position adjustment interface is configured to set a read position of data to be read to the sharing module; the reading position of the data to be read is obtained by processing according to the time length of the data to be read; the read interface is configured to read the data to be read from the sharing module based on the mask of the data to be read and the read position of the data to be read, so that the multi-process equipment with audio and video processing is convenient to process the audio and video data with high efficiency. The audio and video sharing device has an efficient memory allocation mechanism, can realize multi-process concurrent access, realizes effective data transmission and interaction among different processes, simplifies audio and video data sharing operation, improves data sharing efficiency, and avoids memory fragments.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the claims. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application is to be determined by the claims appended hereto.

Claims (10)

1. An audio-video data sharing apparatus, comprising:
a write interface configured to write data to be read to a shared module;
a read mask setting interface configured to set a mask of data to be read to the shared module;
a time period acquisition interface configured to acquire a time length of data to be read from the sharing module;
a read position adjustment interface configured to set a read position of data to be read to the shared module; the reading position of the data to be read is obtained by processing according to the time length of the data to be read;
and a read interface configured to read the data to be read from the shared module based on the mask of the data to be read and a read position of the data to be read.
2. The audio-visual data sharing apparatus according to claim 1, further comprising a creation interface and a switch interface;
the creation interface is configured to create the sharing module by a first process; the switch interface is configured to open the shared module by a second process; the first process and the second process are different processes.
3. The audio-visual data sharing apparatus according to claim 1, further comprising a timestamp acquisition interface; the data to be read by the read interface comprises a current time stamp;
the time stamp obtaining interface is configured to obtain the latest time stamp in the sharing module, so that a processing process obtains the latest time stamp and the current time stamp, processes the latest time stamp and the current time stamp, and adjusts the reading speed of the reading interface according to the processing result.
4. The audio-visual data sharing apparatus according to claim 1, further comprising a latest data reading interface;
the latest data reading interface is configured to search and read latest data corresponding to a current reading position based on the current reading position; the latest data is the data corresponding to the latest writing time of the writing interface.
5. The audio-visual data sharing apparatus according to claim 1, further comprising a waiting interface;
the waiting interface is configured to wait for a preset time and then read the data to be read.
6. The audio-visual data sharing apparatus of claim 5, further comprising a forced read interface;
the forced reading interface is configured to read the data to be read from the sharing module based on the mask of the data to be read and the reading position of the data to be read, and if the data to be read fails, the data to be read is read from the sharing module again after waiting for a preset time until the data to be read is successfully read.
7. The audio-visual data sharing apparatus according to claim 4, further comprising a latest data forced reading interface;
the latest data forced reading interface is configured to search and read the latest data corresponding to the current reading position based on the current reading position, and if the latest data forced reading interface fails to read, the latest data corresponding to the current reading position is searched and read again after waiting for a preset time until the latest data forced reading interface is successfully read.
8. The apparatus according to claim 1, wherein if the write interface writes the data to be read to the sharing module based on a first order, the read interface reads the data to be read from the sharing module based on a mask of the data to be read and a read position of the data to be read, and according to the first order.
9. The apparatus according to claim 1, wherein the read position of the data to be read ranges from 0 to a value of a time length of the data to be read; when the reading position of the data to be read is 0, the reading interface starts to read the data which is written into the sharing module earliest; when the reading position of the data to be read is the numerical value of the time length of the data to be read, the reading interface starts to read the data which is written into the sharing module from the latest.
10. An electronic device comprising an audio-visual data sharing apparatus as claimed in any one of claims 1 to 9.
CN202111346519.1A 2021-11-15 2021-11-15 Audio and video data sharing device and electronic equipment Active CN114071222B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111346519.1A CN114071222B (en) 2021-11-15 2021-11-15 Audio and video data sharing device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111346519.1A CN114071222B (en) 2021-11-15 2021-11-15 Audio and video data sharing device and electronic equipment

Publications (2)

Publication Number Publication Date
CN114071222A CN114071222A (en) 2022-02-18
CN114071222B true CN114071222B (en) 2023-07-25

Family

ID=80271741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111346519.1A Active CN114071222B (en) 2021-11-15 2021-11-15 Audio and video data sharing device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114071222B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115022671B (en) * 2022-06-02 2024-03-01 智道网联科技(北京)有限公司 Multi-process video output method, cloud terminal, electronic equipment and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6161169A (en) * 1997-08-22 2000-12-12 Ncr Corporation Method and apparatus for asynchronously reading and writing data streams into a storage device using shared memory buffers and semaphores to synchronize interprocess communications
CN1342940A (en) * 2000-09-06 2002-04-03 国际商业机器公司 Coprocessor with multiple logic interface
US8037476B1 (en) * 2005-09-15 2011-10-11 Oracle America, Inc. Address level log-based synchronization of shared data
US8386722B1 (en) * 2008-06-23 2013-02-26 Google Inc. Stacked DIMM memory interface
CN103077123A (en) * 2013-01-15 2013-05-01 华为技术有限公司 Data writing and reading methods and devices
US9547553B1 (en) * 2014-03-10 2017-01-17 Parallel Machines Ltd. Data resiliency in a shared memory pool
CN108668095A (en) * 2018-04-17 2018-10-16 上海小蚁科技有限公司 Media Stream sharing method and device, storage medium, terminal
CN109298935A (en) * 2018-09-06 2019-02-01 华泰证券股份有限公司 A kind of method and application of the multi-process single-write and multiple-read without lock shared drive
CN110059004A (en) * 2019-03-21 2019-07-26 深圳市腾讯信息技术有限公司 A kind of method, apparatus, equipment and the medium of application test
CN111698530A (en) * 2020-05-27 2020-09-22 深圳壹账通智能科技有限公司 Video transmission method, device, equipment and computer readable storage medium
CN111796948A (en) * 2020-07-02 2020-10-20 长视科技股份有限公司 Shared memory access method and device, computer equipment and storage medium
CN113396390A (en) * 2019-03-15 2021-09-14 英特尔公司 Graphics processor data access and sharing

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020112100A1 (en) * 1999-08-19 2002-08-15 Myron Zimmerman System and method for data exchange
US7107267B2 (en) * 2002-01-31 2006-09-12 Sun Microsystems, Inc. Method, system, program, and data structure for implementing a locking mechanism for a shared resource
US8521979B2 (en) * 2008-05-29 2013-08-27 Micron Technology, Inc. Memory systems and methods for controlling the timing of receiving read data
US8954697B2 (en) * 2010-08-05 2015-02-10 Red Hat, Inc. Access to shared memory segments by multiple application processes
CN102651690B (en) * 2011-02-28 2015-11-25 国际商业机器公司 To the method and apparatus that shared drive controls
US11119820B2 (en) * 2019-03-15 2021-09-14 Intel Corporation Local memory sharing between kernels
US11093400B2 (en) * 2019-10-15 2021-08-17 Sling Media Pvt. Ltd. Lock-free sharing of live-recorded circular buffer resources

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6161169A (en) * 1997-08-22 2000-12-12 Ncr Corporation Method and apparatus for asynchronously reading and writing data streams into a storage device using shared memory buffers and semaphores to synchronize interprocess communications
CN1342940A (en) * 2000-09-06 2002-04-03 国际商业机器公司 Coprocessor with multiple logic interface
US8037476B1 (en) * 2005-09-15 2011-10-11 Oracle America, Inc. Address level log-based synchronization of shared data
US8386722B1 (en) * 2008-06-23 2013-02-26 Google Inc. Stacked DIMM memory interface
CN103077123A (en) * 2013-01-15 2013-05-01 华为技术有限公司 Data writing and reading methods and devices
US9547553B1 (en) * 2014-03-10 2017-01-17 Parallel Machines Ltd. Data resiliency in a shared memory pool
CN108668095A (en) * 2018-04-17 2018-10-16 上海小蚁科技有限公司 Media Stream sharing method and device, storage medium, terminal
CN109298935A (en) * 2018-09-06 2019-02-01 华泰证券股份有限公司 A kind of method and application of the multi-process single-write and multiple-read without lock shared drive
CN113396390A (en) * 2019-03-15 2021-09-14 英特尔公司 Graphics processor data access and sharing
CN110059004A (en) * 2019-03-21 2019-07-26 深圳市腾讯信息技术有限公司 A kind of method, apparatus, equipment and the medium of application test
CN111698530A (en) * 2020-05-27 2020-09-22 深圳壹账通智能科技有限公司 Video transmission method, device, equipment and computer readable storage medium
CN111796948A (en) * 2020-07-02 2020-10-20 长视科技股份有限公司 Shared memory access method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HDTV SoC平台中存储器控制及其VLSI优化;邱琳,郑世宝,王涛,王峰;电视技术(11);全文 *
基于NiosⅡ的视频采集及网络传输系统的实现;袁兴;王林林;王桂海;陈新华;;计算机工程与设计(02);全文 *

Also Published As

Publication number Publication date
CN114071222A (en) 2022-02-18

Similar Documents

Publication Publication Date Title
CN108664331B (en) Distributed data processing method and device, electronic equipment and storage medium
US11961242B2 (en) Target tracking method, computer device, and storage medium
CA2991623A1 (en) Media production system with scheduling feature
CN114071222B (en) Audio and video data sharing device and electronic equipment
CN103823683A (en) Video recording device and method
CN109492206A (en) PPT presentation file method for recording, device, computer equipment and storage medium
CN108881227B (en) Operation control method and device of remote whiteboard system and remote whiteboard system
CN113015005B (en) Video clipping method, device and equipment and computer readable storage medium
US20190174089A1 (en) Method and device for storing warning image
DE112018006727T5 (en) ELECTRONIC DEVICE FOR COMBINING MUSIC WITH PHOTOGRAPHY AND CONTROL PROCEDURES FOR IT
CN111479095B (en) Service processing control system, method and device
CN108228331B (en) Resource management method and system
CN106412513B (en) Processing system for video and processing method
CN108388461A (en) A kind of screen picture intercept method and device for firmware
CN115035580A (en) Figure digital twinning construction method and system
DE112013007092B4 (en) Image synthesizer and method
CN107770487B (en) Feature extraction and optimization method, system and terminal equipment
CN111444670B (en) Document annotation method, device, computer equipment and storage medium
CN109739607B (en) Dynamic image loading method, device, equipment and storage medium
US10992901B2 (en) Method, apparatus, device and storage medium for controlling video playback speed
GB2577711A (en) Eye-tracking methods, apparatuses and systems
CN113709574A (en) Video screenshot method and device, electronic equipment and computer-readable storage medium
CN110401845B (en) First screen playing method and device, computer equipment and storage medium
CN114461726A (en) User behavior data writing method and device, computer equipment and storage medium
CN114090168A (en) Self-adaptive adjusting method for image output window of QEMU (QEMU virtual machine)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant