Method, system and device for sharing camera data of intelligent cockpit and medium
By receiving and processing camera requests from multiple APP applications in the intelligent cockpit system and dynamically managing camera resources and driver interfaces, the problem of multiple applications sharing the same camera is solved, and efficient data sharing and system resource utilization is achieved.
Patent Information
- Application Number
- CN202510448548.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2025-06-24
AI Technical Summary
The existing smart cockpit system cannot support multiple APP applications to preview images of the same camera at the same time, nor can it perform functions such as taking photos and recording at the same time, resulting in the inability to effectively share camera resources in multiple application scenarios.
By receiving requested camera instructions from multiple target applications, detecting the camera status and starting on demand, continuously intercepting the preset frame screen for update and storage, and sharing it with multiple target applications through different driver interfaces, dynamically managing and multiplexing driver interface resources.
The function of multiple APP applications using the same camera at the same time is realized, which improves data transmission efficiency and concurrency capabilities, and optimizes system resource utilization and overall performance.
Smart Images

Figure CN120201289A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of camera data sharing in intelligent cockpits, and particularly relates to a method, system, device, and medium for sharing camera data in an intelligent cockpit. Background Art
[0002] Intelligent cockpit technology has developed rapidly in the modern automotive industry. Its core lies in enhancing the driving experience and safety by integrating multiple sensors and computing units. As one of the key components of an intelligent cockpit, cameras are widely used in various scenarios such as driver monitoring, gesture recognition, and face recognition.
[0003] In recent years, the intelligent cockpit systems of vehicles have become increasingly intelligent. However, existing intelligent cockpit systems cannot support multiple APP applications to preview the images of the same camera simultaneously, nor can they support multiple APP applications to perform functions such as taking photos and recording videos simultaneously. For example, when the driving recorder APP uses the camera to record, WeChat and other APPs will not be able to use this camera. When developing a single-camera multi-application scenario, only multiple functional logics can be coupled in the APP, and they cannot be decoupled for separate functional development.
[0004] Therefore, how to solve the problem of multiple APP applications using the same camera simultaneously is an urgent problem to be solved currently. Summary of the Invention
[0005] The purpose of this application is to overcome the above technical problems and provide a method, system, device, and medium for sharing camera data in an intelligent cockpit.
[0006] In a first aspect, an embodiment of this application discloses a method for sharing camera data in an intelligent cockpit, adopting the following solution: A method for sharing camera data in an intelligent cockpit includes: receiving a request camera instruction from a first target application, detecting whether the camera is turned on, and if not, starting the camera to obtain camera data; continuously intercepting and updating and storing a preset number of frame images of the camera data, and sharing it to the first target application through a first driver interface; receiving a request camera instruction from a second target application, and sharing the preset frame images to the second target application through a second driver interface; detecting the startup states of the first target application and the second target application, and if they are closed, updating the occupancy states of the first driver interface and the second driver interface to be re-allocated and used as free driver interfaces.
[0007] By adopting the above technical solution, multiple APP applications in the intelligent cockpit can use the same camera simultaneously, thereby achieving efficient sharing of camera data. The specific effects are as follows: By receiving the request camera instruction of the target application and detecting the status of the camera, it ensures the on-demand startup of the camera resources. Continuously intercepting and updating the storage of the preset frame images, and sharing them to multiple target applications through different driver interfaces, improving the efficiency and concurrency of data transmission. Detecting the startup status of the target application and updating the occupancy status of the driver interface, realizing the dynamic management and reuse of the driver interface, and improving the utilization rate of system resources.
[0008] Optionally, before receiving the request camera instruction of the first target application and starting the camera to obtain camera data, it further includes: receiving an instruction to create a shared driver interface, creating a first preset number of driver interfaces, where the first preset number of driver interfaces includes the first driver interface and the second driver interface; wherein, by comparing the free time of the free driver interfaces, to determine the target driver interface to transmit the preset frame images to the target application, and the target driver interface is one of the first preset number of driver interfaces.
[0009] By adopting the above technical solution, the method for sharing camera data in the intelligent cockpit can pre-create a first preset number of driver interfaces, including the first driver interface and the second driver interface, before receiving the request camera instruction of the first target application, thereby providing sufficient driver interface resources for subsequent multiple applications to share camera data. At the same time, by comparing the free time of the free driver interfaces, determining the target driver interface to transmit the preset frame images to the target application, effectively improving the usage efficiency of the driver interface, reducing resource waste, and ensuring the stability and timeliness of data transmission.
[0010] Optionally, it further includes: when receiving the request camera instruction, allocating a second preset number of shared memories for storing the preset frame images; when no request camera instruction is received within the preset time and all the shared driver interfaces are free, recycling the shared memories and closing the camera.
[0011] By adopting the above technical solution, when receiving the request camera instruction, allocating shared memories to store the preset frame images can effectively improve the data processing efficiency, reduce the risk of data loss, and ensure the stability of multiple applications sharing camera data. When no request camera instruction is received within the preset time and all the shared driver interfaces are free, recycling the shared memories and closing the camera can significantly reduce the system resource occupancy and improve the overall performance and energy efficiency of the system.
[0012] Optionally, receiving the request camera instruction of the first target application and detecting whether the camera is turned on includes: if it is already turned on, obtaining an idle driver interface and sharing the preset frame image to the first target application through the idle driver interface.
[0013] By adopting the above technical solution, the effect of quickly obtaining an idle driver interface and sharing the preset frame image to the first target application when the camera is already turned on is achieved. Specifically, this solution avoids the waste of resources caused by repeatedly starting the camera, improves the system response speed and resource utilization rate, and at the same time ensures the efficiency and stability of multi-application sharing of camera data.
[0014] Optionally, it further includes: when receiving the request camera instruction and detecting that there is no such idle driver interface, closing one target application waiting to share the preset frame image for reallocation.
[0015] By adopting the above technical solution, when receiving the request camera instruction and detecting that there is no idle driver interface, waiting for one target application waiting to share the preset frame image to close and then reallocating. This way can effectively improve the utilization rate of the driver interface, avoid the problem that subsequent applications cannot use camera data due to insufficient driver interfaces, and thus improve the resource management efficiency of the system and the compatibility of multi-application concurrent use.
[0016] In a second aspect, an embodiment of the present application discloses a system for sharing camera data in an intelligent cockpit, adopting the following solution: A system for sharing camera data in an intelligent cockpit includes: a first receiving module, configured to receive the request camera instruction of the first target application and detect whether the camera is turned on. If not, start the camera to obtain camera data; a storage update module, configured to continuously intercept the preset frame image from the camera data for updated storage and share it to the first target application through the first driver interface; a second receiving module, configured to receive the request camera instruction of the second target application and share the preset frame image to the second target application through the second driver interface; a detection module, configured to detect the startup states of the first target application and the second target application. If they are closed, update the occupancy states of the first driver interface and the second driver interface to be reallocated as idle driver interfaces for use.
[0017] By adopting the above technical solutions, the system for sharing camera data in the intelligent cockpit can achieve the efficient sharing of camera data by multiple applications. The specific effects are as follows: The first receiving module realizes the response to the camera shooting instruction request of the first target application, and detects the camera status to determine whether to start the camera, ensuring that resources are used on demand and avoiding unnecessary energy consumption. The storage update module continuously intercepts and updates the storage of the camera data, ensuring the freshness and availability of the data, and sharing the data to the first target application through the first driver interface, improving the efficiency and stability of data transmission. The second receiving module supports the camera shooting instruction request of the second target application, further expanding the sharing ability of the camera data and meeting the needs of multiple applications using it simultaneously. The detection module dynamically updates the occupancy of the driver interface by monitoring the startup status of the first target application and the second target application, enabling the free driver interface to be reallocated and used, and improving the utilization rate of system resources.
[0018] Optionally, it further includes: a creation module, configured to receive an instruction to create a shared driver interface, and create a first preset number of driver interfaces, where the first preset number of driver interfaces includes the first driver interface and the second driver interface; wherein, by comparing the free time of the free driver interfaces, to determine a target driver interface to transmit the preset frame of picture to the target application, and the target driver interface is one of the first preset number of driver interfaces.
[0019] By adopting the above technical solutions, the number of driver interfaces can be dynamically created to meet the needs of multiple applications simultaneously requesting camera data. The specific effects are as follows: By receiving an instruction to create a shared driver interface and creating a first preset number of driver interfaces, the flexibility and scalability of the system are improved, supporting more target applications to use camera data simultaneously. By comparing the free time of the free driver interfaces to determine a target driver interface to transmit the preset frame of picture to the target application, the resource allocation strategy is optimized, and the data transmission efficiency and system performance are improved.
[0020] Optionally, it further includes: an allocation module, configured to allocate a second preset number of shared memories for storing the preset frame of picture when receiving a camera shooting instruction request; a recycling module, configured to recycle the shared memory and turn off the camera when no camera shooting instruction request is received within a preset time and all the shared driver interfaces are free.
[0021] By adopting the above technical solutions, the intelligent cockpit system can dynamically allocate and recycle shared memory resources. The specific effects are as follows: allocate a second preset number of shared memories for storing preset frame images, ensuring efficient storage and quick access when multiple applications use camera data simultaneously, improving the system resource utilization rate and data processing speed; recycle the shared memory and turn off the camera when no request camera instruction is received within a preset time and all shared drive interfaces are idle, effectively reducing the system resource occupation and energy consumption, and improving the system stability and response efficiency.
[0022] In a third aspect, an embodiment of the present application discloses an electronic device, adopting the following solution: An electronic device includes: a memory and a processor. The memory is used for storing a computer program; the processor is used for implementing the steps of the method as described in any one of the above when executing the computer program.
[0023] In a fourth aspect, an embodiment of the present application discloses a computer-readable storage medium, adopting the following solution: A computer-readable storage medium has a computer program stored thereon. When the computer program is executed by a processor, it implements the steps of the method as described in any one of the above.
[0024] In summary, the present application includes at least one of the following beneficial technical effects: 1. By receiving request camera instructions from multiple target applications and sharing camera data through drive interfaces, the function of multiple applications accessing and using the same camera simultaneously is realized, solving the problem in the prior art that multiple APPs cannot preview or use the camera simultaneously; 2. By detecting the startup state of the application and updating the occupation state of the drive interface, the idle drive interfaces can be re-allocated for use, improving the system resource utilization rate and avoiding waste of drive interfaces; 3. When a request camera instruction is received, allocate shared memory to store preset frame images, and recycle the shared memory and turn off the camera when no request is received within a preset time and the drive interface is idle, optimizing the management of memory and camera resources and reducing the system power consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a framework schematic diagram applied to a method for sharing camera data in an intelligent cockpit disclosed in an embodiment of the present application; Figure 2 For Figure 1 It is a flowchart schematic diagram of a method for sharing camera data in an intelligent cockpit disclosed in an embodiment of the present application; Figure 3Schematic structural diagram of a system for sharing camera data in an intelligent cockpit disclosed in another embodiment of the present application; Figure 4 Schematic structural diagram of an electronic device disclosed in another embodiment of the present application. Detailed implementation manners
[0026] The present application will be further described in detail below with reference to the accompanying drawings.
[0027] Embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application will be more thorough and complete, and can fully convey the scope of the present application to those skilled in the art.
[0028] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a" and "the" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0029] It should be understood that although the terms "first", "second", etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more unless otherwise specifically defined.
[0030] The technical solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0031]
First Embodiment
[0032] Among them, the camera driver interface is used to externally connect and drive the camera to transmit image data. The data reader is used to read the image data captured / recorded by the camera through the camera driver interface and store the image data in the shared memory. The shared memory allocator uses the shared memory mechanism to allocate two or more pieces of shared memory for storing image data such as 3 frames or 6 frames. The expander is used to create two or more driver interfaces based on actual needs and simultaneously share the video data in the shared memory with all the created driver interfaces. In this way, multiple APP applications can obtain camera data through the unoccupied driver interfaces, thereby realizing the sharing of camera data by multiple APP applications, that is, supporting multiple APP applications to preview the images of the same camera simultaneously. It should be noted here that the system architecture is a virtual architecture of software programs and does not require special modification to the original hardware.
[0033] Please refer to Figure 2 , a method for sharing camera data in an intelligent cockpit disclosed in an embodiment of the present application specifically includes the following steps: S10. Receive a request camera instruction from a first target application, detect whether the camera is turned on. If not, start the camera to obtain camera data; Among them, when operating the first target application to record or capture an image, the system correspondingly generates a request camera instruction. At the same time, it detects whether the camera is in the on state. If it is not started, the camera is started, which can ensure the on-demand start of the camera resources and reduce the power consumption of the camera.
[0034] Further, if the camera is already on, obtain an idle driver interface and share a preset frame of the picture to the first target application through the idle driver interface, so as to directly obtain the shared camera data.
[0035] S20. Continuously intercept and update and store the preset frame of the camera data, and share it to the first target application through the first driver interface; Among them, in this embodiment, based on the memory size, continuously intercept and update and store a preset frame of the picture, such as 3 frames of pictures, to ensure the freshness and availability of the data, and share the data to the first target application through the first driver interface, improving the efficiency and stability of data transmission.
[0036] S30. Receive a request camera instruction from a second target application, and share the preset frame of the picture to the second target application through the second driver interface; Among them, this step S30 continuously receives the request camera instruction of the second target application, further expanding the sharing ability of the camera data and meeting the needs of multiple applications using at the same time. Here, the second target application includes but is not limited to one APP application.
[0037] S40. Detect the startup status of the first target application and the second target application. If they are closed, update the occupancy status of the first drive interface and the second drive interface to be reallocated and used as free drive interfaces.
[0038] Among them, in step S40, by monitoring the startup status of the first target application and the second target application, the occupancy of the drive interface is dynamically updated, enabling free drive interfaces to be reallocated and used, realizing the dynamic management and reuse of the drive interface, and improving the utilization rate of system resources.
[0039] Here, it is worth mentioning that when all drive interfaces are occupied and there is still an APP application sending a request camera instruction, that is, when a request camera instruction is received and no free drive interface is detected, one of the target applications sharing the preset frame image needs to be closed to reallocate the corresponding drive interface to the waiting APP application. In this way, the utilization rate of the drive interface can be effectively improved, avoiding the problem that subsequent applications cannot use camera data due to insufficient drive interfaces, thereby enhancing the resource management efficiency of the system and the compatibility of multi-application concurrent use.
[0040] Furthermore, in this embodiment, before step S10, it further includes: S01. Receive an instruction to create a shared drive interface and create a first preset number of drive interfaces; Among them, the first preset number can be 1, 2, or more, and the operator can preset it based on the system performance. The first preset number of drive interfaces in step S01 includes the first drive interface and the second drive interface.
[0041] Specifically, in this embodiment, by comparing the free time of the free drive interfaces, the target drive interface is determined to transmit the preset frame image to the target application, and the target drive interface is any one of the first preset number of drive interfaces.
[0042] Furthermore, in this embodiment, it further includes: S50. When a request camera instruction is received, allocate a second preset number of shared memories for storing the preset frame image; Among them, when a request camera instruction sent by any APP application is received, the shared memory is allocated to store the preset frame image, which can effectively improve the data processing efficiency, reduce the risk of data loss, and ensure the stability of multiple applications sharing camera data.
[0043] S60. When no request camera instruction is received within the preset time and all shared drive interfaces are free, recycle the shared memory and turn off the camera.
[0044] Among them, when no request camera instruction is received within a preset time (such as 2 minutes, 5 minutes, etc.) and all shared drive interfaces are idle, the shared memory is recycled and the camera is turned off, which can significantly reduce the system resource occupancy and improve the overall performance and energy efficiency of the system.
[0045] In summary, a method for sharing camera data in an intelligent cockpit disclosed in the first embodiment of the present invention detects the camera status and starts the camera to obtain data when necessary, and at the same time shares the data to multiple target applications via different drive interfaces, realizing the function of concurrent access of a single camera by multiple applications, and effectively solving the problem that multiple applications cannot use the same camera simultaneously in the prior art; by dynamically creating the number of drive interfaces and selecting the optimal target drive interface to transmit data according to the idle time, the efficiency and flexibility of data sharing are improved, meeting the requirements in complex application scenarios; when the APP application is closed, the occupancy status of the drive interface is updated in time and used as an idle interface for reallocation, avoiding resource idleness and improving the dynamic management ability of system resources.
[0046]
Second Embodiment
[0047] Among them, the first receiving module 210 is used to receive a request camera instruction from a first target application, detect whether the camera is turned on, and if not, start the camera to obtain camera data; the storage update module 220 is used to continuously intercept a preset number of frames of the camera data for updated storage and share it to the first target application via a first drive interface; the second receiving module 230 is used to receive a request camera instruction from a second target application and share the preset number of frames to the second target application via a second drive interface; the detection module 240 is used to detect the start status of the first target application and the second target application, and if they are closed, update the occupancy status of the first drive interface and the second drive interface for reallocation as idle drive interfaces.
[0048] Specifically, the first receiving module 210 implements the response to the camera instruction request of the first target application, detects the camera status to determine whether to activate the camera, ensures the on-demand use of resources, and avoids unnecessary energy consumption. The storage update module 220 continuously captures and updates the storage of the camera data, ensuring the freshness and availability of the data, and sharing the data to the first target application through the first driver interface, improving the efficiency and stability of data transmission. The second receiving module 230 supports the camera instruction request of the second target application, further expanding the sharing ability of the camera data to meet the needs of multiple applications using simultaneously. The detection module 240 dynamically updates the occupancy of the driver interface by monitoring the startup status of the first target application and the second target application, enabling the free driver interface to be reallocated and used, thus enhancing the utilization rate of system resources.
[0049] Further, in this embodiment, there is also a creation module 250, which is used to receive the instruction to create a shared driver interface and create a first preset number of driver interfaces. The first preset number of driver interfaces includes the first driver interface and the second driver interface.
[0050] Among them, by comparing the free time of the free driver interfaces, the target driver interface is determined to transmit the preset frame of the picture to the target application, and the target driver interface is one of the first preset number of driver interfaces.
[0051] Specifically, by receiving the instruction to create a shared driver interface and creating the first preset number of driver interfaces, the flexibility and scalability of the system are improved, supporting more target applications to use the camera data simultaneously. By comparing the free time of the free driver interfaces to determine the target driver interface to transmit the preset frame of the picture to the target application, the resource allocation strategy is optimized, and the data transmission efficiency and system performance are enhanced.
[0052] Further, in this embodiment, there are also: an allocation module 260 and a recycling module 270. The allocation module 260 is used to allocate a second preset number of shared memories for storing the preset frame of the picture when receiving the camera instruction request; the recycling module 270 is used to recycle the shared memory and turn off the camera when no camera instruction request is received within the preset time and all the shared driver interfaces are free.
[0053] Among them, the allocation module 260 allocates a second preset number of shared memories for storing the preset frame of the picture, ensuring the efficient storage and fast access when multiple applications use the camera data simultaneously, enhancing the utilization rate of system resources and the data processing speed; the recycling module 270 recycles the shared memory and turns off the camera when no camera instruction request is received within the preset time and all the shared driver interfaces are free, effectively reducing the system resource occupancy and energy consumption, and improving the stability and response efficiency of the system.
[0054] It should be noted that the method for sharing camera data in an intelligent cockpit implemented by the system for sharing camera data in an intelligent cockpit disclosed in the second embodiment of the present application is the same as that in the first embodiment, so it will not be described in detail here. Optionally, each module in this embodiment and the above other operations or functions are respectively for implementing the method in the foregoing embodiment.
[0055]
Third Embodiment
[0056] The technical effect of the electronic device provided in this embodiment during actual application is the same as that of the method for sharing camera data in an intelligent cockpit in the first embodiment.
[0057]
Fourth Embodiment
[0058] In addition, it can be understood that the foregoing embodiments are only exemplary descriptions of the present invention. On the premise that the technical features do not conflict, the structures do not contradict, and the invention purpose of the present invention is not violated, the technical solutions of the various embodiments can be arbitrarily combined and used in combination.
[0059] In several embodiments provided by the present invention, it should be understood that the disclosed methods, systems, and devices can be implemented in other ways. For example, the modules included in the systems described above are merely illustrative. The division of modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can be in electrical, mechanical, or other forms.
[0060] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0061] In addition, in each embodiment of the present invention, each functional unit / module can be integrated in a processing unit / module, or each unit / module can exist physically alone, or two or more units / module can be integrated in one unit / module. The above-mentioned integrated unit / module can be implemented in the form of hardware or in the form of hardware plus software functional unit / module.
[0062] The above-mentioned integrated unit / module implemented in the form of software functional unit / module can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes several instructions to enable one or more processors of a computer device (which can be a personal computer, a server, or a network device, etc.) to execute some steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.
[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for sharing camera data in a smart cockpit, characterized in that: include: receiving a camera request instruction from a first target application, detecting whether a camera is turned on, and if not, starting the camera to obtain camera data; Continuously intercepting preset frame images of the camera data for updating and storage, and sharing them to the first target application via the first driver interface; receiving a camera request instruction from a second target application, and sharing the preset frame image to the second target application via a second driving interface; The startup status of the first target application and the second target application is detected. If they are closed, the occupation status of the first drive interface and the second drive interface is updated to reallocate them as free drive interfaces.
2. The method according to claim 1, characterized in that Before receiving the camera request instruction from the first target application and starting the camera to obtain camera data, the method further includes: Receiving an instruction to create a shared drive interface, and creating a first preset number of drive interfaces, wherein the first preset number of drive interfaces includes the first drive interface and the second drive interface; The idle time of the idle driving interface is compared to determine the target driving interface to transmit the preset frame image to the target application, and the target driving interface is one of the first preset number of driving interfaces.
3. The method according to claim 1, characterized in that Also includes: When a camera request instruction is received, a second preset amount of shared memory is allocated for storing the preset frame image; When no camera request instruction is received within a preset time and the shared drive interfaces are all free, the shared memory is recycled and the camera is turned off.
4. The method according to claim 1, characterized in that: The receiving the camera request instruction from the first target application and detecting whether the camera is turned on includes: If it is enabled, a free driving interface is obtained, and the preset frame image is shared to the first target application via the free driving interface.
5. The method according to claim 1, characterized in that Also includes: When a camera request instruction is received and it is detected that there is no free drive interface, a target application sharing the preset frame image is closed and reallocated.
6. A system for sharing camera data in a smart cockpit, characterized in that: include: A first receiving module is used to receive a camera request instruction from a first target application, detect whether the camera is turned on, and if not, start the camera to obtain camera data; A storage update module, used for continuously capturing preset frames of the camera data for update and storage, and sharing the same to the first target application via a first driver interface; A second receiving module is used to receive a camera request instruction from a second target application, and share the preset frame image to the second target application via a second driving interface; The detection module is used to detect the startup status of the first target application and the second target application. If they are closed, the occupancy status of the first drive interface and the second drive interface is updated to reallocate them as free drive interfaces.
7. The system according to claim 6, characterized in that Also includes: A creation module, configured to receive an instruction to create a shared drive interface, and create a first preset number of drive interfaces, wherein the first preset number of drive interfaces includes the first drive interface and the second drive interface; The idle time of the idle driving interface is compared to determine the target driving interface to transmit the preset frame image to the target application, and the target driving interface is one of the first preset number of driving interfaces.
8. The system according to claim 6, characterized in that Also includes: An allocation module, configured to allocate a second preset amount of shared memory for storing the preset frame image when receiving a camera request instruction; The recycling module is used to recycle the shared memory and turn off the camera when no camera request instruction is received within a preset time and the shared drive interfaces are all free.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; The processor is configured to implement the steps of the method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.