Camera sharing method and apparatus, device, and medium

By allocating memory for multiple camera processes in the head-mounted device and copying image data, the conflict problem of multiple processes using the camera simultaneously in the head-mounted device is solved, realizing the sharing of the camera by multiple processes and avoiding resource waste.

WO2026091429A1PCT designated stage Publication Date: 2026-05-07GOERTEK INC
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GOERTEK INC
Filing Date
2025-04-24
Publication Date
2026-05-07

AI Technical Summary

Technical Problem

In head-mounted devices, when multiple applications are launched simultaneously, once a camera is invoked by one process, it cannot be invoked by other processes. This results in at least two processes that need to access the same camera being unable to obtain camera data simultaneously, or the camera function of the later-launched process becoming invalid.

Method used

By acquiring at least two target camera processes corresponding to the camera, allocating memory for each process according to image configuration requirements, controlling the camera to acquire image data, storing the image data in the first memory, and then copying it to the second memory, camera sharing is achieved.

Benefits of technology

It enables at least two target camera processes to successfully invoke the camera, resolving the conflict problem of multiple processes using the camera simultaneously and avoiding waste of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025090951_07052026_PF_FP_ABST
    Figure CN2025090951_07052026_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing. Disclosed are a camera sharing method and apparatus, a device, and a medium. The method comprises: for any camera, acquiring at least two target camera processes corresponding to the camera, the at least two target camera processes being camera processes having the possibility of simultaneously invoking the camera; for any target camera process, applying for a first memory for the target camera process according to image configuration requirements corresponding to the target camera process; when any target camera process is started, controlling the camera to collect image data according to the corresponding image configuration requirements, and applying for a second memory for the target camera process; storing the image data in the first memory corresponding to the target camera process; and copying the image data in the first memory corresponding to the target camera process to the second memory. The method enables at least two target camera processes to successfully invoke one camera, thereby achieving camera sharing among at least two camera processes.
Need to check novelty before this filing date? Find Prior Art

Description

Camera sharing methods, devices, equipment and media

[0001] This application claims priority to Chinese Patent Application No. 202411516870.4, filed on October 28, 2024, entitled "Camera Sharing Method, Apparatus, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This invention relates to the field of image processing technology, and more specifically, to a camera sharing method, apparatus, device, and medium. Background Technology

[0003] With the rapid development of economy and technology, wearable devices, especially head-mounted devices (such as AR, VR, MR and XR smart glasses or helmets), are widely used in various fields.

[0004] Multiple applications running simultaneously is a typical application scenario in head-mounted displays (HMDs), where multiple applications run in the foreground on the HMD simultaneously. In this scenario, the HMD may simultaneously run at least two processes that need to access the same camera. For example, it might run both a 6DoF algorithm and a gesture algorithm simultaneously, or it might run both a camera app and a QR code scanning app simultaneously.

[0005] However, when a head-mounted device simultaneously launches at least two processes that need to access the same camera, once that same camera is accessed by one process, it cannot be accessed by other processes. This results in at least two processes that need to access the same camera being unable to simultaneously obtain camera data, or the camera function of the later-launched process becoming invalid. Summary of the Invention

[0006] One object of the present invention is to provide a new technical solution for camera sharing.

[0007] According to a first aspect of the present invention, a camera sharing method is provided, the method comprising:

[0008] For any camera, obtain at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously;

[0009] For any of the target camera processes, allocate first memory for the target camera process according to the image configuration requirements corresponding to the target camera process;

[0010] When any of the target camera processes is started, the camera is controlled to acquire image data according to the corresponding image configuration requirements, and a second memory is allocated for the target camera process;

[0011] The image data is stored in the first memory corresponding to the target camera process;

[0012] In addition, the image data in the first memory corresponding to the target camera process is copied to the second memory.

[0013] Optionally, the process of acquiring at least two target camera processes corresponding to any given camera includes:

[0014] For any camera, if one of the at least two target camera processes is started, obtain the at least two target camera processes corresponding to that camera.

[0015] Optionally, before allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process, the method further includes:

[0016] For any of the target camera processes, the image configuration requirements corresponding to the target camera process are found from the preset mapping relationship;

[0017] The preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements.

[0018] Optionally, copying the image data from the first memory corresponding to the target camera process to the second memory includes:

[0019] Once the data in the first memory is filled, the image data in the first memory corresponding to the target camera process is copied to the second memory.

[0020] Optionally, the image configuration requirements include at least one of image size and image format.

[0021] According to a second aspect of the present invention, a camera sharing device is provided, comprising:

[0022] The acquisition module is used to acquire, for any camera, at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously;

[0023] The application module is used to apply for first memory for any target camera process according to the image configuration requirements corresponding to the target camera process.

[0024] The control module is used to control the camera to acquire image data according to the corresponding image configuration requirements when any of the target camera processes is started, and to allocate a second memory for the target camera process.

[0025] A storage module is used to store the image data in the first memory corresponding to the target camera process;

[0026] The copying module is used to copy the image data in the first memory corresponding to the target camera process to the second memory.

[0027] Optionally, the acquisition module is specifically used to: for any camera, if one of the at least two target camera processes is started, acquire at least two target camera processes corresponding to the camera.

[0028] Optionally, the copying module is specifically used to: copy the image data in the first memory corresponding to the target camera process to the second memory after the first memory has been filled with data.

[0029] According to a third aspect of the invention, an electronic device is provided, the electronic device comprising the means as described in any one of the second aspects; or,

[0030] The electronic device includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of the first aspects.

[0031] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of the first aspects.

[0032] This invention provides a camera sharing method, comprising: for any camera, acquiring at least two target camera processes corresponding to the camera, wherein the target camera processes are camera processes that may simultaneously call the camera; for any target camera process, allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process; when any target camera process is started, controlling the camera to acquire image data according to the image configuration requirements corresponding to the target camera process, and allocating second memory for the target camera process; storing the image data in the first memory corresponding to the target camera process; and copying the image data in the first memory corresponding to the target camera process to the second memory. This method enables at least two target camera processes to successfully call a camera, that is, it realizes camera sharing by at least two camera processes.

[0033] Other features and advantages of this specification will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the invention and, together with their description, serve to explain the principles of the invention.

[0035] Figure 1 is a block diagram of the hardware configuration of an electronic device for implementing a camera sharing method according to an embodiment of the present invention;

[0036] Figure 2 is a flowchart illustrating a camera sharing method according to an embodiment of the present invention;

[0037] Figure 3 is a schematic diagram of a camera architecture according to an embodiment of the present invention;

[0038] Figure 4 is a schematic diagram of a camera sharing device according to an embodiment of the present invention;

[0039] Figure 5 is a block diagram of the hardware configuration of an electronic device for implementing a camera sharing method according to an embodiment of the present invention.

[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] It should be noted that if the embodiments of the present invention involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.

[0043] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the meaning of "and / or" throughout the text includes three parallel solutions; for example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.

[0044] Figure 1 is a block diagram of the hardware configuration of an electronic device for implementing a camera sharing method according to an embodiment of the present invention.

[0045] Electronic device 1000 can be a terminal or a server. Furthermore, the terminal can be a head-mounted device (such as an AR device, MR device, VR device, and XR device), a portable computer, a tablet computer, a PDA, etc. The server can be a cloud server, etc.

[0046] Electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, etc. The processor 1100 may be a central processing unit (CPU), a microprocessor (MCU), etc. The memory 1200 may include, for example, ROM (Read-Only Memory), RAM (Random Access Memory), or non-volatile memory such as a hard disk. The interface device 1300 may include, for example, a USB interface, a headphone jack, etc. The communication device 1400 may be capable of wired or wireless communication. The display device 1500 may be, for example, an LCD screen, a touch screen, etc. The input device 1600 may include, for example, a touch screen, a keyboard, etc. Users can input / output voice information through the speaker 1700 and the microphone 1800.

[0047] Although multiple devices are shown for electronic device 1000 in FIG1, the present invention may refer to only some of the devices therein. For example, electronic device 1000 may refer to only memory 1200 and processor 1100.

[0048] In an embodiment of the present invention, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to execute the camera sharing method provided in the embodiment of the present invention.

[0049] In the above description, those skilled in the art can design instructions based on the scheme disclosed in this invention. How the instructions control the processor to operate is well known in the art, and therefore will not be described in detail here.

[0050] This invention provides a camera sharing method, which is applied to the electronic device shown in Figure 1. As shown in Figure 2, the camera sharing method provided by this invention includes the following steps S2100 to S2500.

[0051] Step S2100: For any camera, obtain at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that have the possibility of calling the camera simultaneously.

[0052] Electronic devices typically have multiple cameras, such as wide-angle lenses, ultra-wide-angle lenses, and telephoto lenses. A single camera can be invoked by at least two camera processes. When at least two camera processes invoke a single camera, there is a possibility that at least two camera processes will invoke that camera simultaneously. In this embodiment, for any camera on the electronic device, there will be at least two camera processes that simultaneously invoke that camera, denoted as the at least two target camera processes of that camera.

[0053] In one example, the camera process can be a camera algorithm, such as 6DoF and gesture algorithms. The camera process can also be a camera application, such as a social application that enables video calls or a search application that allows scanning.

[0054] If at least two target camera processes corresponding to the camera are obtained based on the above step S2100, the following step S2200 is executed to allocate memory for each target camera process.

[0055] Step S2200: For any target camera process, allocate first memory for the target camera process according to the image configuration requirements corresponding to the target camera process.

[0056] Image configuration requirements describe the specifications of the image data needed for the corresponding target camera process. In one embodiment, image configuration requirements include at least one of image size and image format. The image format may be, for example, RGB or YUV format.

[0057] For each camera process, there are corresponding image configuration requirements. Based on this, the target camera process also has image configuration requirements.

[0058] In this embodiment, based on the above step S2200, a corresponding first memory is allocated in advance for each target camera process.

[0059] Step S2300: When any target camera process is started, control the camera to acquire image data according to the corresponding image configuration requirements, and allocate second memory for the target camera process.

[0060] When any target camera process is started, for example, when target camera process 1 is turned on, at this time, while allocating second memory for target camera process 1, the camera is controlled to acquire image data according to the corresponding image configuration requirements of target camera 1.

[0061] In one example, taking the image configuration requirement as including image size, and the image configuration requirement corresponding to the target camera process 1 as 640*480, based on the above step S2300, the image data acquired by the camera is image data of 640*480 specification.

[0062] It should be noted that step S2300 above is the step performed by the electronic device when the camera process is started in conventional technology.

[0063] Furthermore, based on the following step S2400, the image data acquired by the camera is stored in the first memory corresponding to the activated target camera process.

[0064] Step S2400: Store the image data in the first memory corresponding to the target camera process.

[0065] Step S2500: Copy the image data in the first memory corresponding to the target camera process to the second memory.

[0066] When the target camera process is target camera process 1, since the first memory stores image data acquired by the camera according to the image configuration requirements corresponding to target camera process 1, based on the above step S2500, the image data in the first memory that meets the image configuration requirements corresponding to target camera process 1 can be completely copied to the second memory. At this time, the second memory stores the image data acquired according to the image configuration requirements corresponding to target camera process 1. In this way, target camera process 1 can successfully access the image data in the second memory.

[0067] Based on the above steps S2100 to S2500, at least two target camera processes can successfully invoke a camera, that is, at least two camera processes can share the camera.

[0068] It should be emphasized that the target camera process involved in steps S2300 to S2400 above is specifically the target camera process that was started as described in step S2300 above.

[0069] This invention provides a camera sharing method, comprising: for any camera, acquiring at least two target camera processes corresponding to the camera, wherein the target camera processes are camera processes that may simultaneously call the camera; for any target camera process, allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process; when any target camera process is started, controlling the camera to acquire image data according to the image configuration requirements corresponding to the target camera process, and allocating second memory for the target camera process; storing the image data in the first memory corresponding to the target camera process; and copying the image data in the first memory corresponding to the target camera process to the second memory. This method enables at least two target camera processes to successfully call a camera, that is, it realizes camera sharing by at least two camera processes.

[0070] In one embodiment of the present invention, the above step S2100 can be specifically implemented by the following step S2110.

[0071] Step S2110: For any camera, if at least one of the at least two target camera processes is started, obtain at least two target camera processes corresponding to the camera.

[0072] In this embodiment, for any camera, if one of the at least two target camera processes is started, it indicates that there is a possibility that other target camera processes besides the one that was started may also be started. In this case, by obtaining the at least two target camera processes corresponding to the camera and then executing steps S2200 to S2500, a successful call to a camera by at least two target camera processes can be achieved, i.e., camera sharing by at least two camera processes is realized.

[0073] By using the above step S2110, unnecessary execution of steps S2200 to S2500 can be avoided, thus preventing the waste of computing resources of electronic devices.

[0074] In one embodiment of the present invention, the camera sharing method provided by the present invention further includes the following step S2210 before the above step S2200.

[0075] Step S2310: For any target camera process, find the image configuration requirements corresponding to the target camera process from the preset mapping relationship.

[0076] Among them, the preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements.

[0077] In this embodiment, the image configuration requirements corresponding to any target camera process are known in advance. Therefore, a preset mapping relationship can be generated in advance and stored in the electronic device. The preset mapping relationship represents the mapping relationship between the camera process and the corresponding image configuration requirements.

[0078] Furthermore, for any camera, the image configuration requirements corresponding to the target camera process that was initiated are found in the preset mapping relationship.

[0079] In one embodiment of the present invention, step S2500 is specifically implemented through the following step S2510:

[0080] Step S2510: After the data in the first memory is filled, copy the image data in the first memory corresponding to the target camera process to the second memory.

[0081] In this embodiment, after the first memory is filled with data, the image data corresponding to the target camera process in the first memory is copied to the second memory. This avoids redundant or incorrect copying of image data from the first memory to the second memory, which could lead to errors in the image data in the second memory.

[0082] The camera sharing method provided by this invention can be implemented through a camera daemon process. Based on this, and combining the above embodiments and the camera architecture shown in Figure 3, and taking APP1 and APP2 as the target camera processes respectively, and APP1's image configuration requirement being an image size of 640*480, and APP2's image configuration requirement being an image size of 720*1280 and 1280*1920 as an example, the specific implementation of the above steps S2200 to S2500 is as follows:

[0083] S1, the camera daemon sends the image configuration requirements of 640*480 for APP1 and the image configuration requirements of 720*1280 and 1280*1920 for APP2 to the camera driver through the first path. The first path refers to the path from the camera server, through the config in the camera provider to the camera driver.

[0084] S2, after receiving the image configuration requirements of 640*480 from APP1 and 720*1280 and 1280*1920 from APP2, the camera driver instructs the camera provider to request memory s_buffer1 for 640*480, memory s_buffer2 for 720*1280, and memory s_buffer3 for 1280*1920.

[0085] S3, according to the instructions in S2 above, the camera provider requests memory s_buffer1 corresponding to 640*480, memory s_buffer2 corresponding to 720*1280 and memory s_buffer3 corresponding to 1280*1920.

[0086] S4, when APP1 is started, APP1 controls the camera to acquire image data according to the image configuration requirements of 640*480, and instructs the camera provider to request the memory buffer1 corresponding to 640*480;

[0087] S5, the camera daemon stores the image data captured by the camera in s_buffer1, and copies the data in s_buffer1 to buffer1.

[0088] S6, when APP2 is started, APP1 controls the camera to collect image data according to the image configuration requirements of 720*1280 and 1280*1920, and instructs the camera provider to apply for memory buffer2 corresponding to 720*1280 and memory buffer3 corresponding to 1280*1920.

[0089] S7, the camera daemon stores the 720*1280 image data captured by the camera in s_buffer2 and copies the data in s_buffer2 to buffer2. It also stores the 1280*1920 image data captured by the camera in s_buffer3 and copies the data in s_buffer3 to buffer3.

[0090] As can be understood, as shown in Figure 3, after S7 above, the image data in buffer1, buffer2 and buffer3 are fed back to APP1 and APP2 through the camera server.

[0091] It should be noted that s_buffer1, s_buffer2, and s_buffer3 in S1-S5 above correspond to the first memory in steps S2100 to S2500 above. buffer1 in S1-S5 above is the second memory corresponding to APP1. buffer2 and buffer3 are the second memory corresponding to APP2.

[0092] The present invention also provides a camera sharing device 400, as shown in FIG4, comprising:

[0093] The acquisition module 410 is used to acquire, for any camera, at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that have the possibility of calling the camera simultaneously;

[0094] The application module 420 is used to apply for first memory for any target camera process according to the image configuration requirements corresponding to the target camera process.

[0095] The control module 430 is used to control the camera to acquire image data according to the corresponding image configuration requirements when any of the target camera processes are started, and to allocate second memory for the target camera process.

[0096] Storage module 440 is used to store the image data in the first memory corresponding to the target camera process;

[0097] The copy module 450 is used to copy the image data in the first memory corresponding to the target camera process to the second memory.

[0098] In one embodiment of the present invention, the acquisition module 410 is specifically used to: for any camera, if one of the at least two target camera processes is started, acquire at least two target camera processes corresponding to the camera.

[0099] In one embodiment of the present invention, the copying module 450 is specifically used to: copy the image data in the first memory corresponding to the target camera process to the second memory after the first memory has been filled with data.

[0100] In one embodiment of the present invention, the camera sharing device 400 provided by the present invention further includes:

[0101] The lookup module is used to look up the image configuration requirements corresponding to any target camera process from a preset mapping relationship;

[0102] The preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements.

[0103] The present invention also provides an electronic device comprising the device 400 as described in any of the above-described device embodiments.

[0104] Alternatively, as shown in FIG5, the electronic device 500 includes a memory 510 and a processor 520, the memory 510 being used to store computer instructions, and the processor 520 being used to retrieve the computer instructions from the memory 510 to execute the method as described in any of the above method embodiments.

[0105] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of the above-described method embodiments.

[0106] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.

[0107] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0108] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0109] The computer program instructions used to perform the operations of this invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing state information from the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of the invention.

[0110] Various aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0111] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0112] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0114] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims

1. A camera sharing method, characterized in that, The method includes: For any camera, obtain at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; For any of the target camera processes, allocate first memory for the target camera process according to the image configuration requirements corresponding to the target camera process; When any of the target camera processes is started, the camera is controlled to acquire image data according to the corresponding image configuration requirements, and a second memory is allocated for the target camera process; The image data is stored in the first memory corresponding to the target camera process; In addition, the image data in the first memory corresponding to the target camera process is copied to the second memory.

2. The method according to claim 1, characterized in that, The process of acquiring at least two target camera processes corresponding to any given camera includes: For any camera, if one of the at least two target camera processes is started, obtain the at least two target camera processes corresponding to that camera.

3. The method according to claim 1, characterized in that, Before allocating first memory for the target camera process according to the image configuration requirements corresponding to the target camera process, the method further includes: For any of the target camera processes, the image configuration requirements corresponding to the target camera process are found from the preset mapping relationship; The preset mapping relationship is a mapping relationship that represents the camera process and the corresponding image configuration requirements.

4. The method according to claim 1, characterized in that, The step of copying the image data from the first memory corresponding to the target camera process to the second memory includes: Once the data in the first memory is filled, the image data in the first memory corresponding to the target camera process is copied to the second memory.

5. The method according to claim 1, characterized in that, The image configuration requirements include at least one of the following: image size and image format.

6. A camera sharing device, characterized in that, include: The acquisition module is used to acquire, for any camera, at least two target camera processes corresponding to the camera, wherein the at least two target camera processes are camera processes that may call the camera simultaneously; The application module is used to apply for first memory for any target camera process according to the image configuration requirements corresponding to the target camera process. The control module is used to control the camera to acquire image data according to the corresponding image configuration requirements when any of the target camera processes is started, and to allocate a second memory for the target camera process. A storage module is used to store the image data in the first memory corresponding to the target camera process; The copying module is used to copy the image data in the first memory corresponding to the target camera process to the second memory.

7. The apparatus according to claim 6, characterized in that, The acquisition module is specifically used to: for any camera, if one of the at least two target camera processes is started, acquire at least two target camera processes corresponding to the camera.

8. The apparatus according to claim 6, characterized in that, The copying module is specifically used to: copy the image data in the first memory corresponding to the target camera process to the second memory after the first memory has been filled with data.

9. An electronic device, characterized in that, The electronic device includes the means as described in any one of claims 6 to 8; or... The electronic device includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-5.

10. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Camera data sharing method and device based on vehicle-mounted Android, equipment and medium

    CN116225716A

  • Image data acquisition method and device, storage medium and scanning equipment

    CN116862745A

  • Camera sharing method, device, equipment and system

    CN116916146A

  • Memory calling method, electronic equipment and storage medium

    CN118445056A

  • Allocating and sharing a data object among program instances

    US20140289739A1