CN112883003A - Data sharing method and device for vehicle-mounted terminal - Google Patents
Data sharing method and device for vehicle-mounted terminal Download PDFInfo
- Publication number
- CN112883003A CN112883003A CN202110460202.4A CN202110460202A CN112883003A CN 112883003 A CN112883003 A CN 112883003A CN 202110460202 A CN202110460202 A CN 202110460202A CN 112883003 A CN112883003 A CN 112883003A
- Authority
- CN
- China
- Prior art keywords
- shared memory
- memory file
- vehicle
- mark
- read
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/176—Support for shared access to files; File sharing support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Traffic Control Systems (AREA)
Abstract
The application relates to a data sharing method and device for vehicle-mounted terminals. The method comprises the following steps: the method comprises the steps of obtaining camera data, wherein the camera data at least comprise a video data stream in a second preset format converted based on a video data stream in a first preset format; storing the camera data in a shared memory file according to a first mark of the shared memory file; and enabling a plurality of application programs of the vehicle-mounted terminal to read the camera data of the shared memory file according to the second mark of the shared memory file. According to the scheme, the camera data of one camera can be shared by a plurality of application programs of the vehicle-mounted terminal at the same time, and the functions of the application programs can be realized at the same time.
Description
Technical Field
The present application relates to the field of digital information transmission technologies, and in particular, to a data sharing method and apparatus for a vehicle-mounted terminal.
Background
The vehicle-mounted terminal is used as an important component in the vehicle networking system and has complex functions. Various APPs (applications) of vehicle-mounted terminals such as a vehicle data recorder, an ADAS (Advanced Driving Assistance System), live broadcast, video sharing, and the like need camera data to implement their respective functions. Under the condition that on-vehicle terminal only has a leading USB record appearance, after vehicle event data recorder APP opened USB interface record appearance, other APPs just can't open USB interface record appearance again and acquire the camera data. In the related technology, by connecting multiple hardware cameras, each camera independently acquires camera data so as to provide multiple APPs (application program applications) of vehicle-mounted terminals such as an automobile data recorder, an ADAS (application data System), live broadcast and video sharing to simultaneously realize respective functions. Or, the correlation technique can realize respective function for making a plurality of APPs of vehicle-mounted terminal through a camera, realizes respective function through the data of a plurality of APPs alternate use same camera.
The correlation technique uses a plurality of cameras to provide camera data, realizes a plurality of APP's of vehicle-mounted terminal function separately simultaneously, has increased use cost. And camera data through a plurality of APP alternate use same camera realize respective function, when an APP is opened and is used camera data, other APPs just can not use simultaneously and acquire camera data, have brought a great deal of inconvenience for the user, cause the user experience effect poor.
Disclosure of Invention
In order to solve or partially solve the problems in the related art, the application provides a data sharing method and device for a vehicle-mounted terminal, which can enable a plurality of application programs of the vehicle-mounted terminal to simultaneously share camera data of one camera, and enable the plurality of application programs to simultaneously realize respective functions.
The first aspect of the present application provides a data sharing method for a vehicle-mounted terminal, where the method includes:
the method comprises the steps of obtaining camera data, wherein the camera data at least comprise a video data stream in a second preset format converted based on a video data stream in a first preset format;
storing the camera data in a shared memory file according to a first mark of the shared memory file;
and enabling a plurality of application programs of the vehicle-mounted terminal to read the camera data of the shared memory file according to the second mark of the shared memory file.
Preferably, before the acquiring the camera data, the method includes:
and creating the shared memory file with a read-write mark, and setting the read-write mark as the first mark.
Preferably, the storing the camera data in the shared memory file according to the first flag of the shared memory file includes:
and storing the data of the camera in the shared memory file according to the read-write mark of the shared memory file as the first mark, and updating the read-write mark of the shared memory file as the second mark.
Preferably, the enabling the plurality of application programs of the vehicle-mounted terminal to read the camera data of the shared memory file according to the second flag of the shared memory file includes:
and sending the second mark to a plurality of application programs of the vehicle-mounted terminal according to the second mark of the read-write mark of the shared memory file, so that the plurality of application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
Preferably, the method further comprises:
and updating the read-write mark of the shared memory file to be the first mark according to the notification information fed back after the plurality of application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file.
The second aspect of the present application provides a data sharing apparatus for vehicle-mounted terminals, the apparatus comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring camera data, and the camera data at least comprises a video data stream in a second preset format converted based on a video data stream in a first preset format;
the storage module is used for storing the camera data acquired by the acquisition module in the shared memory file according to the first mark of the shared memory file;
and the reading module is used for enabling a plurality of application programs of the vehicle-mounted terminal to read the camera data stored in the shared memory file by the storage module according to the second mark of the shared memory file.
Preferably, the apparatus further comprises:
and the creating module is used for creating the shared memory file with the read-write mark and setting the read-write mark as the first mark.
Preferably, the storage module is specifically configured to store the camera data acquired by the acquisition module in the shared memory file according to the read-write flag of the shared memory file created by the creation module as the first flag, and update the read-write flag of the shared memory file as the second flag;
the reading module is specifically configured to send the second mark to the multiple application programs of the vehicle-mounted terminal according to the read-write mark of the shared memory file updated by the storage module, so that the multiple application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
Preferably, the apparatus further comprises:
and the updating module is used for updating the read-write mark of the shared memory file to be the first mark according to the notification information fed back after the plurality of application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file.
A third aspect of the present application provides an electronic device comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method as described above.
A fourth aspect of the present application provides a non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform a method as described above.
The technical scheme provided by the application can comprise the following beneficial effects:
according to the technical scheme, the camera data are stored in the shared memory file, so that a plurality of application programs of the vehicle-mounted terminal needing the camera data can simultaneously read the camera data stored in the shared memory file, the camera data of one camera can be simultaneously shared by the plurality of application programs of the vehicle-mounted terminal, and the respective functions of the plurality of application programs can be simultaneously realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular descriptions of exemplary embodiments of the application, as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout the exemplary embodiments of the application.
Fig. 1 is a schematic flowchart illustrating a data sharing method for a vehicle-mounted terminal according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating a data sharing method for a vehicle-mounted terminal according to another embodiment of the present application;
fig. 3 is a schematic structural diagram of a data sharing device of a vehicle-mounted terminal according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data sharing device of a vehicle-mounted terminal according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While embodiments of the present application are illustrated in the accompanying drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In the related art, under the condition that only one vehicle-mounted camera is arranged, multiple APPs of the vehicle-mounted terminal cannot be used simultaneously and acquire camera data to realize respective functions, so that inconvenience is brought to a user, and the user experience effect is poor.
In view of the above problem, an embodiment of the present application provides a data sharing method for a vehicle-mounted terminal, which can enable a plurality of applications of the vehicle-mounted terminal to simultaneously share camera data of one camera, and enable the plurality of applications to simultaneously implement respective functions.
The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The first embodiment is as follows:
fig. 1 is a schematic flowchart illustrating a data sharing method for a vehicle-mounted terminal according to an embodiment of the present application.
Referring to fig. 1, a method for sharing data by a vehicle-mounted terminal includes:
in step 101, camera data is obtained, wherein the camera data at least includes a video data stream in a second preset format converted based on a video data stream in a first preset format.
In one embodiment, a vehicle carries a camera that can be mounted to the front, top of the vehicle. The specific installation position of the camera is not limited in the application. The camera may be, but is not limited to, a camera of a vehicle event recorder. The camera can adopt a monocular camera and also can adopt a binocular camera.
In a specific implementation mode, a wired or wireless connection is established with an automobile data recorder, a video data stream in a first preset format shot by an automobile data recorder camera is obtained, the video data stream in the first preset format is converted into a video data stream in a second preset format which is favorable for storage and transmission, and the video data stream in the second preset format is used as camera data.
In step 102, the camera data is stored in the shared memory file according to the first flag of the shared memory file.
In one specific embodiment, a vehicle is provided with a plurality of vehicle-mounted terminals, and the plurality of vehicle-mounted terminals are connected in a wired or intangible mode through a vehicle networking. And when the mark of the shared memory file is a first mark, storing the video data stream of the camera in the shared memory file of the vehicle-mounted terminal.
In step 103, according to the second flag of the shared memory file, the multiple application programs of the vehicle-mounted terminal are enabled to read the camera data of the shared memory file.
In a specific embodiment, when the mark of the shared memory file is the second mark, the multiple APPs of the vehicle-mounted terminal can access the shared memory file at the same time, and the multiple APPs read the video data stream of the shared memory file as needed to realize respective functions.
According to the data sharing method for the vehicle-mounted terminal, the camera data are stored in the shared memory file, so that a plurality of application programs of the vehicle-mounted terminal needing the camera data can simultaneously read the camera data stored in the shared memory file, the camera data of one camera can be simultaneously shared by the plurality of application programs of the vehicle-mounted terminal, and the respective functions of the plurality of application programs can be simultaneously realized.
Example two:
fig. 2 is a flowchart illustrating a data sharing method for a vehicle-mounted terminal according to another embodiment of the present application. Fig. 2 describes the solution of the present application in more detail with respect to fig. 1.
Referring to fig. 2, a method for sharing data by a vehicle-mounted terminal includes:
in step 201, a shared memory file with a read/write flag is created, and the read/write flag is set as a first flag.
In a specific embodiment, a shared memory File may be created, a read-write flag may be set in a File header of the shared memory File, and a File Handle (File Handle) of the shared memory File is sent to all APPs of the vehicle-mounted terminal. All APPs of the vehicle-mounted terminal obtain file handles of the shared memory files.
In one embodiment, the shared memory file may be, but is not limited to being, an anonymous shared memory file.
In step 202, camera data is obtained, wherein the camera data at least includes a video data stream in a second preset format converted based on the video data stream in the first preset format.
In a specific embodiment, the vehicle is loaded with an automobile data recorder, and the camera of the automobile data recorder can adopt a monocular camera or a binocular camera. And establishing wired connection with the automobile data recorder through a USB interface of the automobile data recorder, and acquiring camera data from the automobile data recorder.
In a specific implementation manner, the video data stream in the first preset format captured by the vehicle event data recorder camera may be a video data stream in a Motion Joint Photographic Experts Group (Motion JPEG) format, and the video data stream in the Motion JPEG format has the advantages of low computational complexity, low requirement on a system memory, easiness in later editing, and the like.
In one embodiment, a video data stream in Motion JPEG format in a first preset format is converted into a video data stream in YUV (a video format represented by a luminance component (Y component) and a chrominance component (U component and V component) together) in a second preset format. The video data stream in YUV format can be used as camera data. The video data stream with the YUV format reduces the bandwidth of chromaticity, occupies less frequency band during transmission, can improve the transmission speed, and can save the storage space.
In step 203, the camera data is stored in the shared memory file according to the read-write flag of the shared memory file as the first flag, and the read-write flag of the shared memory file is updated as the second flag.
In a specific embodiment, when the read-write flag of the shared memory file is a first flag 0, the video data stream in the YUV format is stored in the shared memory file, and after the storage is completed, the read-write flag of the shared memory file is updated to a second flag 1.
In step 204, the second flag is sent to the multiple application programs of the vehicle-mounted terminal according to the read-write flag of the shared memory file, so that the multiple application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
In a specific implementation manner, when the read-write mark of the shared memory file is the second mark 1, the information of the read-write mark 1 is sent to multiple APPs operated by the vehicle-mounted terminal, so that the multiple APPs read the video data stream of the shared memory file in the YUV format according to the obtained file handle of the shared memory file according to the need of realizing their own functions. When the read-write mark of the shared memory file is the second mark 1, the multiple APPs operated by the vehicle-mounted terminal can simultaneously read the video data streams of the shared memory file according to the requirement of realizing the functions of the multiple APPs. For example, when the read-write mark of the shared memory file is the second mark 1, the APP of the ADAS of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the ADAS function; the APP with the live broadcast function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the live broadcast function; the APP with the video sharing function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the video sharing function; the APP with the face recognition function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the face recognition function.
In step 205, updating the read-write flag of the shared memory file to be a first flag according to the notification information fed back after the multiple application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file; step 202 is performed.
In a specific implementation manner, after a plurality of APPs operated by a vehicle-mounted terminal successfully read a video data stream in a YUV format of a shared memory file, notification information of completion of reading is fed back. After receiving notification information of reading completion fed back by all running multiple APPs, updating the read-write mark of the shared memory file to be a first mark 0; 202 can be continuously executed, so that the multiple APPs operated by the vehicle-mounted terminal continuously realize respective functions of the multiple APPs of the vehicle-mounted terminal by reading the video data stream of the shared memory file.
According to the data sharing method for the vehicle-mounted terminal, the camera data are stored in the shared memory file, so that a plurality of application programs of the vehicle-mounted terminal needing the camera data can simultaneously read the camera data stored in the shared memory file, the camera data of one camera can be simultaneously shared by the plurality of application programs of the vehicle-mounted terminal, and the respective functions of the plurality of application programs can be simultaneously realized.
Further, in the data sharing method of the vehicle-mounted terminal provided by the embodiment of the application, the camera data is stored in the shared memory file according to the first mark of the read-write mark of the shared memory file, and the read-write mark of the shared memory file is updated to be the second mark; sending the second mark to a plurality of application programs of the vehicle-mounted terminal according to the read-write mark of the shared memory file, so that the plurality of application programs of the vehicle-mounted terminal read the camera data of the shared memory file; the method and the device have the advantages that the camera data are prevented from being stored in the shared memory file and conflict is avoided when the camera data of the shared memory file are read by the multiple application programs simultaneously, the safety of the camera data of the shared memory file is guaranteed, the multiple application programs of the vehicle-mounted terminal can read the complete camera data from the shared memory file, the multiple application programs of the vehicle-mounted terminal needing the camera data can read the camera data of the shared memory file simultaneously, the multiple application programs of the vehicle-mounted terminal can share the camera data of one camera simultaneously, and the multiple application programs can achieve respective functions simultaneously.
Example three:
corresponding to the embodiment of the application function implementation method, the application also provides a data sharing device of the vehicle-mounted terminal, electronic equipment and a corresponding embodiment.
Fig. 3 is a schematic structural diagram of a data sharing device for in-vehicle terminals according to an embodiment of the present application.
Referring to fig. 3, the data sharing device for the vehicle-mounted terminal comprises an acquisition module 301, a storage module 302 and a reading module 303.
The obtaining module 301 is configured to obtain camera data, where the camera data at least includes a video data stream in a second preset format converted based on a video data stream in a first preset format.
In one embodiment, a vehicle carries a camera that can be mounted to the front, top of the vehicle. The specific installation position of the camera is not limited in the application. The camera may be, but is not limited to, a camera of a vehicle event recorder. The camera can adopt a monocular camera and also can adopt a binocular camera.
In a specific embodiment, the obtaining module 301 obtains a video data stream in a first preset format captured by a camera of the automobile data recorder by establishing a wired or wireless connection with the automobile data recorder, converts the video data stream in the first preset format into a video data stream in a second preset format which is favorable for storage and transmission, and takes the video data stream in the second preset format as camera data.
The storage module 302 is configured to store the camera data acquired by the acquisition module 301 in the shared memory file according to the first flag of the shared memory file.
In one specific embodiment, a vehicle is provided with a plurality of vehicle-mounted terminals, and the plurality of vehicle-mounted terminals are connected in a wired or intangible mode through a vehicle networking. When the mark of the shared memory file is the first mark, the storage module 302 stores the video data stream of the camera acquired by the acquisition module 301 in the shared memory file of the vehicle-mounted terminal.
The reading module 303 is configured to enable a plurality of application programs of the vehicle-mounted terminal to read the camera data stored in the shared memory file by the storage module 302 according to the second flag of the shared memory file.
In a specific embodiment, when the mark of the shared memory file is the second mark, the reading module 303 enables multiple APPs of the vehicle-mounted terminal to access the shared memory file at the same time, and the multiple APPs read the video data stream of the shared memory file as needed to implement their respective functions.
According to the technical scheme provided by the embodiment of the application, the camera data are stored in the shared memory file, so that a plurality of application programs of the vehicle-mounted terminal needing the camera data can simultaneously read the camera data stored in the shared memory file, the camera data of one camera can be simultaneously shared by the plurality of application programs of the vehicle-mounted terminal, and the respective functions of the plurality of application programs can be simultaneously realized.
Example four:
fig. 4 is a schematic structural diagram of a data sharing device for vehicle-mounted terminals according to another embodiment of the present application. Fig. 4 describes the solution of the present application in more detail with respect to fig. 3.
Referring to fig. 4, the data sharing device for the vehicle-mounted terminals comprises a creating module 401, an obtaining module 301, a storing module 302, a reading module 303 and an updating module 402.
The creating module 401 is configured to create a shared memory file with a read-write flag, and set the read-write flag as a first flag.
In a specific embodiment, the creating module 401 may create a shared memory file, set a read-write flag in a file header of the shared memory file, and send a file handle of the shared memory file to all APPs of the vehicle-mounted terminal. All the APPs of the vehicle-mounted terminal obtain file handles of the shared memory file created by the creating module 401.
In one embodiment, the shared memory file created by the creation module 401 may be, but is not limited to, an anonymous shared memory file.
The obtaining module 301 is configured to obtain camera data, where the camera data at least includes a video data stream in a second preset format converted based on a video data stream in a first preset format.
In a specific embodiment, the vehicle is loaded with an automobile data recorder, and the camera of the automobile data recorder can adopt a monocular camera or a binocular camera. The obtaining module 301 establishes a wired connection with the automobile data recorder through a USB interface of the automobile data recorder, and obtains the camera data from the automobile data recorder.
In a specific implementation manner, the video data stream in the first preset format captured by the vehicle event data recorder camera may be a video data stream in a Motion Joint Photographic Experts Group (Motion JPEG) format, and the video data stream in the Motion JPEG format has the advantages of low computational complexity, low requirement on a system memory, easiness in later editing, and the like.
In a specific embodiment, the obtaining module 301 converts the video data stream in the Motion JPEG format in the first preset format into the video data stream in the YUV format in the second preset format. The obtaining module 301 may use the video data stream in the YUV format as the camera data. The video data stream with the YUV format reduces the bandwidth of chromaticity, occupies less frequency band during transmission, can improve the transmission speed, and can save the storage space.
The storage module 302 is specifically configured to store the camera data acquired by the acquisition module 301 in the shared memory file according to the read-write flag of the shared memory file created by the creation module 401 as a first flag, and update the read-write flag of the shared memory file as a second flag.
In a specific embodiment, when the read-write flag of the shared memory file created by the creating module 401 is a first flag 0, the storage module 302 stores the video data stream in the YUV format in the shared memory file, and after the storage is completed, the read-write flag of the shared memory file is updated to a second flag 1.
The reading module 303 is specifically configured to send the second mark to the multiple application programs of the vehicle-mounted terminal according to the read-write mark of the shared memory file updated by the storage module 302, so that the multiple application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
In a specific embodiment, when the read-write flag of the shared memory file updated by the storage module 302 is the second flag 1, the reading module 303 sends the information of the read-write flag 1 to multiple APPs operated by the vehicle-mounted terminal, so that the multiple APPs read the video data stream of the shared memory file in the YUV format according to the acquired file handle of the shared memory file according to the requirement of implementing their own functions. When the read-write mark of the shared memory file is the second mark 1, the reading module 303 sends the information of the read-write mark 1 to the multiple APPs operated by the vehicle-mounted terminal, so that the multiple APPs operated by the vehicle-mounted terminal can simultaneously read the video data stream of the shared memory file according to the requirement of realizing the functions of the multiple APPs. For example, when the read-write mark of the shared memory file is the second mark 1, the APP of the ADAS of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the ADAS function; the APP with the live broadcast function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the live broadcast function; the APP with the video sharing function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the video sharing function; the APP with the face recognition function of the vehicle-mounted terminal reads the video data stream in the YUV format of the shared memory file to realize the face recognition function.
The updating module 402 is configured to update the read-write flag of the shared memory file to be the first flag according to notification information fed back after the multiple application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file.
In a specific implementation manner, after a plurality of APPs operated by a vehicle-mounted terminal successfully read a video data stream in a YUV format of a shared memory file, notification information of completion of reading is fed back. After receiving notification information of completion of reading fed back by all running multiple APPs, the updating module 402 updates the read-write flag of the shared memory file to be a first flag 0; the obtaining module 301, the storing module 302 and the reading module 303 may be continuously executed, and the reading module 303 continuously enables the multiple APPs operated by the vehicle-mounted terminal to continuously realize respective functions of the multiple APPs of the vehicle-mounted terminal by reading the video data stream of the shared memory file.
According to the technical scheme provided by the embodiment of the application, the camera data are stored in the shared memory file, so that a plurality of application programs of the vehicle-mounted terminal needing the camera data can simultaneously read the camera data stored in the shared memory file, the camera data of one camera can be simultaneously shared by the plurality of application programs of the vehicle-mounted terminal, and the respective functions of the plurality of application programs can be simultaneously realized.
Further, according to the technical scheme provided by the embodiment of the application, the camera data is stored in the shared memory file according to the first mark of the read-write mark of the shared memory file, and the read-write mark of the shared memory file is updated to be the second mark; sending the second mark to a plurality of application programs of the vehicle-mounted terminal according to the read-write mark of the shared memory file, so that the plurality of application programs of the vehicle-mounted terminal read the camera data of the shared memory file; the method and the device have the advantages that the camera data are prevented from being stored in the shared memory file and conflict is avoided when the camera data of the shared memory file are read by the multiple application programs simultaneously, the safety of the camera data of the shared memory file is guaranteed, the multiple application programs of the vehicle-mounted terminal can read the complete camera data from the shared memory file, the multiple application programs of the vehicle-mounted terminal needing the camera data can read the camera data of the shared memory file simultaneously, the multiple application programs of the vehicle-mounted terminal can share the camera data of one camera simultaneously, and the multiple application programs can achieve respective functions simultaneously.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
Referring to fig. 5, the electronic device 50 includes a memory 501 and a processor 502.
The Processor 502 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 501 may include various types of storage units, such as system memory, Read Only Memory (ROM), and permanent storage. Wherein the ROM may store static data or instructions for the processor 502 or other modules of the computer. The persistent storage device may be a read-write storage device. The persistent storage may be a non-volatile storage device that does not lose stored instructions and data even after the computer is powered off. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the permanent storage may be a removable storage device (e.g., floppy disk, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as a dynamic random access memory. The system memory may store instructions and data that some or all of the processors require at runtime. Further, the memory 501 may comprise any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash, programmable read-only memory), magnetic and/or optical disks, may also be employed. In some embodiments, memory 501 may include a removable storage device that is readable and/or writable, such as a Compact Disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, min SD card, Micro-SD card, etc.), a magnetic floppy disk, or the like. Computer-readable storage media do not contain carrier waves or transitory electronic signals transmitted by wireless or wired means.
The memory 501 has stored thereon executable code that, when processed by the processor 502, may cause the processor 502 to perform some or all of the methods described above.
Furthermore, the method according to the present application may also be implemented as a computer program or computer program product comprising computer program code instructions for performing some or all of the steps of the above-described method of the present application.
Alternatively, the present application may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform some or all of the various steps of the above-described methods in accordance with the present application.
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (10)
1. A data sharing method for vehicle-mounted terminals is characterized by comprising the following steps:
the method comprises the steps of obtaining camera data, wherein the camera data at least comprise a video data stream in a second preset format converted based on a video data stream in a first preset format;
storing the camera data in a shared memory file according to a first mark of the shared memory file;
and enabling a plurality of application programs of the vehicle-mounted terminal to read the camera data of the shared memory file according to the second mark of the shared memory file.
2. The method of claim 1, wherein prior to acquiring camera data, comprising:
and creating the shared memory file with a read-write mark, and setting the read-write mark as the first mark.
3. The method of claim 2, wherein storing the camera data in the shared memory file according to the first tag of the shared memory file comprises:
and storing the data of the camera in the shared memory file according to the read-write mark of the shared memory file as the first mark, and updating the read-write mark of the shared memory file as the second mark.
4. The method according to claim 3, wherein enabling the plurality of applications of the vehicle-mounted terminal to read the camera data of the shared memory file according to the second flag of the shared memory file comprises:
and sending the second mark to a plurality of application programs of the vehicle-mounted terminal according to the second mark of the read-write mark of the shared memory file, so that the plurality of application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
5. The method of claim 4, further comprising:
and updating the read-write mark of the shared memory file to be the first mark according to the notification information fed back after the plurality of application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file.
6. A data sharing device for vehicle-mounted terminals is characterized by comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring camera data, and the camera data at least comprises a video data stream in a second preset format converted based on a video data stream in a first preset format;
the storage module is used for storing the camera data acquired by the acquisition module in the shared memory file according to the first mark of the shared memory file;
and the reading module is used for enabling a plurality of application programs of the vehicle-mounted terminal to read the camera data stored in the shared memory file by the storage module according to the second mark of the shared memory file.
7. The apparatus of claim 6, further comprising:
and the creating module is used for creating the shared memory file with the read-write mark and setting the read-write mark as the first mark.
8. The apparatus of claim 7, wherein:
the storage module is specifically configured to store the camera data acquired by the acquisition module in the shared memory file according to the read-write flag of the shared memory file created by the creation module as the first flag, and update the read-write flag of the shared memory file as the second flag;
the reading module is specifically configured to send the second mark to the multiple application programs of the vehicle-mounted terminal according to the read-write mark of the shared memory file updated by the storage module, so that the multiple application programs of the vehicle-mounted terminal read the camera data of the shared memory file.
9. The apparatus of claim 8, further comprising:
and the updating module is used for updating the read-write mark of the shared memory file to be the first mark according to the notification information fed back after the plurality of application programs of the vehicle-mounted terminal finish reading the camera data of the shared memory file.
10. A non-transitory machine-readable storage medium having executable code stored thereon, which when executed by a processor of an electronic device, causes the processor to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110460202.4A CN112883003A (en) | 2021-04-27 | 2021-04-27 | Data sharing method and device for vehicle-mounted terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110460202.4A CN112883003A (en) | 2021-04-27 | 2021-04-27 | Data sharing method and device for vehicle-mounted terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112883003A true CN112883003A (en) | 2021-06-01 |
Family
ID=76040725
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110460202.4A Pending CN112883003A (en) | 2021-04-27 | 2021-04-27 | Data sharing method and device for vehicle-mounted terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112883003A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596328A (en) * | 2021-07-23 | 2021-11-02 | 北京字节跳动网络技术有限公司 | Camera calling method and device and electronic equipment |
CN114286019A (en) * | 2021-12-24 | 2022-04-05 | 智己汽车科技有限公司 | Video data processing method, device and equipment |
CN114302040A (en) * | 2021-12-24 | 2022-04-08 | 展讯半导体(成都)有限公司 | Method for sharing single camera by multiple applications and related product |
CN114885103A (en) * | 2022-06-14 | 2022-08-09 | 智道网联科技(北京)有限公司 | Method and device for processing video data of multiple paths of vehicle-mounted cameras |
CN114900654A (en) * | 2022-04-02 | 2022-08-12 | 北京斯年智驾科技有限公司 | Real-time monitoring video transmission system for automatic driving vehicle |
CN115022671A (en) * | 2022-06-02 | 2022-09-06 | 智道网联科技(北京)有限公司 | Multi-process video output method, cloud terminal, electronic device and storage medium |
CN116208816A (en) * | 2023-01-10 | 2023-06-02 | 深圳市拔超科技股份有限公司 | Video code stream processing and rendering system and method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007194946A (en) * | 2006-01-19 | 2007-08-02 | Murata Mach Ltd | Image data transmission system and image data transmission apparatus |
CN106648939A (en) * | 2016-12-30 | 2017-05-10 | 上海寰视网络科技有限公司 | Method and equipment for inter-process resource sharing |
CN109462726A (en) * | 2017-09-06 | 2019-03-12 | 比亚迪股份有限公司 | The control method and device of camera |
CN112616024A (en) * | 2020-12-31 | 2021-04-06 | 深兰科技(上海)有限公司 | USB camera data acquisition method and device, electronic equipment and storage medium |
-
2021
- 2021-04-27 CN CN202110460202.4A patent/CN112883003A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007194946A (en) * | 2006-01-19 | 2007-08-02 | Murata Mach Ltd | Image data transmission system and image data transmission apparatus |
CN106648939A (en) * | 2016-12-30 | 2017-05-10 | 上海寰视网络科技有限公司 | Method and equipment for inter-process resource sharing |
CN109462726A (en) * | 2017-09-06 | 2019-03-12 | 比亚迪股份有限公司 | The control method and device of camera |
CN112616024A (en) * | 2020-12-31 | 2021-04-06 | 深兰科技(上海)有限公司 | USB camera data acquisition method and device, electronic equipment and storage medium |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596328A (en) * | 2021-07-23 | 2021-11-02 | 北京字节跳动网络技术有限公司 | Camera calling method and device and electronic equipment |
CN113596328B (en) * | 2021-07-23 | 2023-02-24 | 北京字节跳动网络技术有限公司 | Camera calling method and device and electronic equipment |
CN114286019A (en) * | 2021-12-24 | 2022-04-05 | 智己汽车科技有限公司 | Video data processing method, device and equipment |
CN114302040A (en) * | 2021-12-24 | 2022-04-08 | 展讯半导体(成都)有限公司 | Method for sharing single camera by multiple applications and related product |
CN114302040B (en) * | 2021-12-24 | 2024-03-19 | 展讯半导体(成都)有限公司 | Method for sharing single camera by multiple applications and related products |
CN114900654A (en) * | 2022-04-02 | 2022-08-12 | 北京斯年智驾科技有限公司 | Real-time monitoring video transmission system for automatic driving vehicle |
CN114900654B (en) * | 2022-04-02 | 2024-01-30 | 北京斯年智驾科技有限公司 | Real-time monitoring video transmission system for automatic driving vehicle |
CN115022671A (en) * | 2022-06-02 | 2022-09-06 | 智道网联科技(北京)有限公司 | Multi-process video output method, cloud terminal, electronic device and storage medium |
CN115022671B (en) * | 2022-06-02 | 2024-03-01 | 智道网联科技(北京)有限公司 | Multi-process video output method, cloud terminal, electronic equipment and storage medium |
CN114885103A (en) * | 2022-06-14 | 2022-08-09 | 智道网联科技(北京)有限公司 | Method and device for processing video data of multiple paths of vehicle-mounted cameras |
CN116208816A (en) * | 2023-01-10 | 2023-06-02 | 深圳市拔超科技股份有限公司 | Video code stream processing and rendering system and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112883003A (en) | Data sharing method and device for vehicle-mounted terminal | |
CN112802232A (en) | Video stream data transmission method and related device thereof | |
US20240054723A1 (en) | Data processing method and apparatus, communication node and storage medium | |
US20200264602A1 (en) | Unmanned aerial vehicle system and communication method | |
US10681115B2 (en) | Multimedia data transmission method and device | |
US20210350509A1 (en) | Electronic device for processing image and image processing method thereof | |
CN111919451A (en) | Live broadcasting method, live broadcasting device and terminal | |
CN114500936A (en) | Video data processing method and device, electronic equipment and storage medium | |
US9905059B2 (en) | Data transfer system, data transmission device, and data reception device | |
CN111601154A (en) | Video processing method and related equipment | |
CN104754268A (en) | Method and device for recording reversed-sequence video | |
CN112333678A (en) | Data transmission method based on Bluetooth, intelligent system and storage medium | |
CN115053516A (en) | Electronic device and method for storing image | |
CN110996137A (en) | Video processing method and device | |
CN116074623B (en) | Resolution selecting method and device for camera | |
US20060224772A1 (en) | Apparatus and computer readable medium for transporting and processing digital media | |
US11825235B2 (en) | Electronic device for processing image and image processing method thereof | |
CN112019925B (en) | Video watermark identification processing method and device | |
CN116017060A (en) | Vehicle image data processing method and device | |
US20240214649A1 (en) | Method for processing spatial content and electronic device performing same | |
CN117151968B (en) | Image processing method and device for vehicle, electronic equipment and storage medium | |
CN113824621B (en) | CAN communication method based on signals and CAN controller | |
CN114463185B (en) | Image information processing method for short video production | |
CN115022671B (en) | Multi-process video output method, cloud terminal, electronic equipment and storage medium | |
CN114885103A (en) | Method and device for processing video data of multiple paths of vehicle-mounted cameras |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210601 |