CN112764811B - Camera detection method and electronic equipment - Google Patents

Camera detection method and electronic equipment Download PDF

Info

Publication number
CN112764811B
CN112764811B CN202011331353.1A CN202011331353A CN112764811B CN 112764811 B CN112764811 B CN 112764811B CN 202011331353 A CN202011331353 A CN 202011331353A CN 112764811 B CN112764811 B CN 112764811B
Authority
CN
China
Prior art keywords
camera
application
detecting
electronic device
connection state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011331353.1A
Other languages
Chinese (zh)
Other versions
CN112764811A (en
Inventor
刘鹏
冯旭
赵从富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Semiconductor Chengdu Co Ltd
Original Assignee
Spreadtrum Semiconductor Chengdu Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Semiconductor Chengdu Co Ltd filed Critical Spreadtrum Semiconductor Chengdu Co Ltd
Priority to CN202011331353.1A priority Critical patent/CN112764811B/en
Publication of CN112764811A publication Critical patent/CN112764811A/en
Application granted granted Critical
Publication of CN112764811B publication Critical patent/CN112764811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a detection method of a camera, which is applied to electronic equipment, wherein the electronic equipment comprises a first application, the first application is in a running state, and the first application is used for opening the camera, and the method comprises the following steps: detecting the connection state of the electronic equipment and the camera; if the first application is in the non-connection state, setting the first application to be in a sleep state; detecting a first operation of a user for inserting the camera into the electronic equipment, and responding to the detected first operation to wake up the first application; and acquiring configuration data of the camera, wherein the configuration data is used for displaying the image data acquired by the first camera by the first application, and receiving the image data acquired by the camera, and the image data is displayed by the first application, so that the detection efficiency of the analog camera is improved.

Description

Camera detection method and electronic equipment
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method for detecting a camera and an electronic device.
Background
The compatibility of various simulation cameras needs to be verified and tested in the car machine system, the camera application or the factory test application needs to be opened and closed continuously by controlling the central control screen, meanwhile, the cameras need to be plugged and pulled, the factory test speed is reduced, the mass production is influenced, and some manufacturers do not verify the compatibility of the cameras on a large scale.
Disclosure of Invention
The application provides a display method and electronic equipment, and also provides a computer readable storage medium to provide a camera detection method to improve the compatibility of a detection simulation camera with systems such as a vehicle machine and the like.
In a first aspect, the present application provides a method for detecting a camera, which is applied to an electronic device, where the electronic device includes a first application, the first application is in an operating state, and the first application is used to open the camera, and the method includes:
detecting the connection state of the electronic equipment and the camera;
if the first application is in the non-connection state, setting the first application in a sleep state;
detecting a first operation that a user inserts a camera into the electronic equipment, and responding to the detected first operation to wake up a first application;
acquiring configuration data of the camera, wherein the configuration data is used for displaying image data acquired by the camera by a first application;
and receiving and displaying the image data acquired by the camera.
Further, still include:
and if the first application is in the connection state, detecting a second operation of pulling the camera out of the electronic equipment by the user, and responding to the detected second operation to set the first application in a sleep state.
Further, still include:
if the electronic equipment is in the connection state, detecting whether the camera acquires the image data, and if the camera does not acquire the image data, detecting the connection state of the electronic equipment and the camera.
Further, detecting whether the camera acquires the image data, and if not, detecting a connection state of the electronic device and the camera, including:
detecting whether the camera acquires image data within a preset time period, and if the image data is not acquired within the preset time period, detecting the connection state of the electronic equipment and the camera;
the preset time period is at least 2 times of the interval time of the frames of the camera.
Further, the configuration data includes at least one of a resolution, a frame rate, and a standard of the camera, and further detects a connection state of the electronic device and the camera, including:
and starting a detection thread, and detecting the connection state based on the detection thread.
Further, the detecting thread is further configured to acquire configuration data of the camera, and after acquiring the configuration data of the camera, the detecting thread further includes:
the thread is put into a sleep state.
In a second aspect, the present application provides an electronic device, where the electronic device includes a first application, the first application is in a running state, the first application is used to open a camera, the electronic device further includes a processor and a storage device, the storage device stores an application program, and when the application program is run by the processor, the electronic device executes the following steps:
detecting the connection state of the electronic equipment and the camera;
if the first application is in the non-connection state, setting the first application in a sleep state;
detecting a first operation that a user inserts a camera into the electronic equipment, and responding to the detected first operation to wake up a first application;
acquiring configuration data of the camera, wherein the configuration data is used for displaying image data acquired by the camera by a first application;
and receiving and displaying the image data acquired by the camera.
Further, the application program, when executed by the processor, causes the electronic device to further perform the steps of:
and if the first application is in the connection state, detecting a second operation of pulling the camera out of the electronic equipment by the user, and responding to the detected second operation to set the first application in a sleep state.
Further, the application program, when executed by the processor, causes the electronic device to further perform the steps of:
if the electronic equipment is in the connection state, detecting whether the camera acquires the image data, and if the camera does not acquire the image data, detecting the connection state of the electronic equipment and the camera.
Further, when the application program is run by the processor, the electronic device executes a step of detecting whether the camera acquires the image data, and if the image data is not acquired, detecting a connection state between the electronic device and the camera, including the following steps:
detecting whether the camera acquires image data within a preset time period, and if the image data is not acquired within the preset time period, detecting the connection state of the electronic equipment and the camera;
wherein the preset time period is at least 2 times of the interval time of the frames of the camera.
Further, the configuration data includes at least one of resolution, frame rate and format of the camera
Further, when the application program is executed by the processor, the electronic device executes the step of detecting the connection state of the electronic device and the camera, and the method comprises the following steps:
and starting a detection thread, and detecting the connection state based on the detection thread.
Further, when the application program is executed by the processor, the electronic device is caused to execute the detection thread and is further used for acquiring the configuration data of the camera, and after the step of acquiring the configuration data of the camera, the method further includes the following steps:
the thread is put into a sleep state.
In a third aspect, the present application provides a computer-readable storage medium comprising computer instructions that, when run on the electronic device, cause the electronic device to perform the grouping method as described in any of the first aspects above.
In a fourth aspect, the present application provides a computer program product, when the computer program product runs on a computer, the computer is caused to execute the method for detecting a camera in any one of the above first aspects.
In a possible design, the program in the fourth aspect may be stored in whole or in part on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure;
fig. 2 is an application framework layer of the electronic device 100 according to an embodiment of the present application;
fig. 3 is a flowchart of a detection method for a die camera according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a method for detecting a die camera according to an embodiment of the present disclosure;
fig. 5 is a device for detecting a camera according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more unless otherwise specified.
Along with the gradual increase of the automobile market and the rapid development of the vehicle-mounted electronic technology in the vehicle-mounted system, the vehicle-mounted information system is deeply applied to the automobile field, wherein analog cameras with different formats and different configurations are more and more compatible with automobile manufacturers or automobile central control systems, the analog cameras are divided into CVBS (composite video broadcast system) and AHD (advanced high performance digital simulator) resolution, wherein the CVBS also has 25FPS PAL (phase alternating current) standard and 30FPS NTS (national standard for digital subscriber system) standard.
In the prior art, compatibility of various analog cameras needs to be verified and tested, a central control screen needs to be continuously controlled to open and close a camera application or a factory test application, and meanwhile, the cameras need to be plugged in a vehicle, specifically, when the compatibility of one analog camera with a vehicle-mounted system is tested, the analog camera needs to be plugged in the vehicle firstly, then the camera application or the factory test application is opened, when the analog camera is compatible with the vehicle-mounted system, the camera application on the vehicle-mounted system or the factory test application can display data acquired by the analog camera, when the analog camera is pulled out, the camera application or the factory test application needs to be closed on the central control screen firstly, when a new analog camera is tested, the camera application or the factory test application needs to be reopened, so that factory test speed is reduced, mass production is affected, and some manufacturers do not verify the compatibility of the cameras on a large scale.
Therefore, the present application provides a data display method, which does not need to close a camera application or a factory test application, and when the vehicle cannot detect the image data of the analog camera, does not report the image data to the camera application or the factory test application and cannot detect an error of the camera, and the camera application or the factory test application does not report the error, so that the analog camera can be continuously tested without being closed.
Referring to fig. 1, a block diagram of an electronic device provided in an embodiment of the present application is specifically designed.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The camera 193 is an external device that can be inserted into and pulled out of the electronic device, and the camera 193 illustratively includes an analog camera.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The electronic device 100 may further include a switch chip, which may be configured to convert an analog signal obtained by the analog camera into a digital signal, and then report the digital signal to a camera application on the display screen 194.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention uses an Android system with a hierarchical architecture as an example to exemplarily explain a software structure of the electronic device 100.
It is to be understood that the configuration illustrated in fig. 1 does not constitute a specific limitation of the electronic device 100. In other embodiments of the invention, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Fig. 2 is a block diagram of a software configuration of the electronic apparatus 100 according to the embodiment of the present invention.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 2, the application package may include camera, gallery, calendar, talk, skin care, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions for the electronic device 100. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a brief dwell, and does not require user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, sounding a prompt tone, vibrating the electronic device, flashing an indicator light, etc.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application layer and the application framework layer as binary files. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The following describes exemplary workflow of the software and hardware of the electronic device 100 in connection with capturing a photo scene.
When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is issued to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and the like). The raw input events are stored at the kernel layer. And the application program framework layer acquires the original input event from the kernel layer and identifies the control corresponding to the input event. Taking the example that the touch operation is a touch click operation, and the control corresponding to the click operation is the control of the icon of the "camera application" shown above, the camera application calls the interface of the application framework layer to start the camera application, and after the camera application is started, the interface of the application framework layer can be called, so that the camera drive is started by calling the kernel layer, and a still image or video is captured by the camera 193.
Referring to fig. 3, a flowchart of a method for detecting a camera provided in the present application is shown, and for convenience of understanding, the method shown in the present application is further explained and explained below by taking the electronic device with the structure shown in fig. 1 and fig. 2 as an example, wherein the electronic device runs the first application, and the first application includes the camera application and the factory test application, etc. described above.
And 304, detecting the connection state of the electronic equipment and the camera, and setting the first application to be in a sleep state if the electronic equipment is in the non-connection state.
In this step, when the electronic device and the camera are not in a connected state, that is, when there is no camera to be tested, the switching chip may not receive information acquired by the camera, and may not report the state of the electronic device not connected to the camera to the first application.
The detecting of the connection state of the electronic device and the camera may include various methods, for example, a detection thread may be created, and the connection state of the electronic device and the camera may be detected in real time through the detection thread, or the connection state of the electronic device and the camera may also be detected in real time through a hardware abstraction layer related to the first application.
The electronic device includes but is not limited to a terminal device such as a car machine, the camera includes but is not limited to an analog camera, and the connection state includes a physical connection, and may also include a communication connection, and the like. The first application enters the sleep state to indicate that the first application is not operated, the related data of the first application is temporarily stored in the cache, and the first application can continue to operate after being awakened.
Step 306, detecting a first operation of inserting a camera into the electronic device by a user, and waking up the first application in response to the detected first operation.
When the electronic equipment detects that the camera is inserted into the electronic equipment, the first application is awakened, so that the first application runs.
Step 308, acquiring configuration data of the camera, where the configuration data is used for displaying, by the first application, the image data acquired by the first camera.
Specifically, the electronic device may obtain configuration data of the camera, where the configuration data includes parameters such as a format, a resolution, and a frame rate of the camera, and the adaptor chip may perform configuration based on the parameters, so that the first application can receive and display image data obtained by the camera based on the parameters.
And 310, receiving and displaying the image data acquired by the camera by the first application.
And after the configuration data is acquired, the first application receives and displays the data acquired by the camera based on the parameters in the configuration data.
The camera detection method can detect the insertion and extraction states of the camera in real time, and continuously detect the camera under the condition that the camera does not need to be closed, so that the detection efficiency is improved, and the cost is reduced.
For convenience of description, the method shown in the present application is explained and explained below by taking the electronic device as a car machine, the camera as an analog camera, and the first application as a camera application as examples.
Referring to fig. 4, a flowchart of a method for detecting a camera according to another embodiment of the present application is specifically described.
At step 402, a detection thread is started.
Specifically, the detection thread is used for detecting the insertion and extraction states of the analog camera on the vehicle. When the analog cameras are inserted into the car machine, the detection process can also read configuration data of each analog camera, the configuration data includes but is not limited to the system, the resolution, the frame rate and the like of the analog cameras, and the first application can display data acquired by the analog cameras based on the configuration data.
In this embodiment, the insertion and extraction states of the analog camera on the in-vehicle device are detected by the detection thread, and the insertion and extraction states of the analog camera on the in-vehicle device are read and detected.
Step 404, a first operation of inserting the analog camera into the car machine by the user is detected.
As already shown above, the detection thread may detect whether the analog camera is inserted into the in-vehicle device in real time, for example, the detection thread may poll the register content of the switch chip, determine that the analog camera is inserted into the in-vehicle device if the preset content is read, and enter step 406 when the analog camera is detected to be inserted into the in-vehicle device.
At step 406, the configuration data is read.
As shown above, the detection thread may read the configuration data of the analog camera inserted into the in-vehicle device in real time, and may, for example, poll the register content of the switch chip to read and store all the configuration data of the analog camera.
In one example, the sleep state is entered after the detection thread reads all configuration data.
And after the detection thread reads the configuration data of the analog camera, configuring, and after the configuration is finished, entering step 406.
And step 408, turning on the analog camera.
After the configuration data is acquired, the analog camera can be opened, and if the analog camera is compatible with other cameras or a vehicle machine, the data transmitted by the analog camera can be directly acquired.
Step 410, detecting whether the analog camera acquires image data.
For example, a timer may be set to detect whether the analog camera can acquire the image data, for example, the timer is set to be at least 2 times of a frame interval of the analog camera, and if the image data is detected, step 402 is performed, and the switch chip of the in-vehicle device reports the image data acquired from the analog camera to the camera application for display.
If no image data can be detected, step 414 may be entered.
And step 414, detecting whether the analog camera is pulled out.
The detection thread can be awakened to judge whether the simulation camera is currently arranged, if the simulation camera is still inserted into the vehicle machine, when the simulation camera is not compatible with the vehicle machine and other systems, a user can judge through observing a display interface of the vehicle machine. When the user finds that the camera application cannot display data, the user considers that the simulation camera is probably incompatible, the simulation camera can be pulled out, and the user can start to test the next camera.
Or if the detection thread cannot read the information in the switching chip, the analog camera is determined to be pulled out.
It should be noted that, in the present application, when the analog camera is incompatible or the camera is suddenly pulled out and cannot acquire image data, the in-vehicle system does not need to report error information to the first application, but directly detects through the detection thread, and if it is detected that the analog camera has been pulled out from the in-vehicle device, the method proceeds to step 416.
The camera application goes to sleep, step 416.
And entering a sleep state under the condition that the analog camera is pulled out.
The first application can not display the reported information sent by the vehicle machine system, the camera application is not required to be closed and opened again, but enters a sleep state, and when the detection thread detects that a new camera is inserted, the camera application is awakened, so that the simulation camera is tested continuously.
On the other hand, referring to fig. 5, the present application further provides a detection device for simulating a camera, the detection device comprising:
a first detection module 502, configured to detect a connection state between the electronic device and the camera;
a setting module 504, configured to set the first application to a sleep state if the first application is in a non-connected state;
a second detecting module 506, configured to detect a first operation of a user to insert the camera into the electronic device, and wake up the first application in response to the detected first operation;
an obtaining module 508, configured to obtain configuration data of the camera, where the configuration data is used for the first application to display image data obtained by the first camera.
A receiving module 510, configured to receive the image data obtained by the camera, where the first application displays the image data.
In the embodiment of the present application, the electronic device and the like may be divided into functional modules according to the method example, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only one logic function division, and another division manner may be available in actual implementation.
Through the description of the foregoing embodiments, it will be clear to those skilled in the art that, for convenience and simplicity of description, only the division of the functional modules is illustrated, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the apparatus may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
Each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or make a contribution to the prior art, or all or part of the technical solutions may be implemented in the form of a software product stored in a storage medium and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A camera detection method is applied to an electronic device, the electronic device comprises a first application, the first application is in a running state, the first application is used for opening a camera, and the method comprises the following steps:
detecting the connection state of the electronic equipment and a camera;
if the first application is in the non-connection state, setting the first application to be in a sleep state;
detecting a first operation of inserting the camera into the electronic equipment by a user, and responding to the detected first operation to wake up the first application;
acquiring configuration data of the camera, wherein the configuration data is used for displaying image data acquired by the camera by the first application;
receiving and displaying image data acquired by the camera;
if the electronic equipment is in the connection state, detecting whether the camera acquires image data, and if the camera does not acquire the image data, detecting the connection state of the electronic equipment and the camera;
the detecting whether the camera acquires image data, and if not, detecting a connection state of the electronic device and the camera includes:
whether the camera acquires image data is detected within a preset time period, and if the image data is not acquired within the preset time period, the connection state of the electronic equipment and the camera is detected.
2. The method for detecting according to claim 1, further comprising:
and if the first application is in the connection state, detecting a second operation of pulling the camera out of the electronic equipment by the user, and responding to the detected second operation to set the first application in a sleep state.
3. The detection method according to claim 1,
the preset time period is at least 2 times of the interval time of the frames of the camera.
4. The detection method according to claim 1,
the configuration data includes at least one of a resolution, a frame rate, and a system of the camera.
5. The detection method according to claim 1, wherein the detecting the connection state of the electronic device and a camera comprises:
and starting a detection thread, and detecting the connection state based on the detection thread.
6. The detection method according to claim 5, wherein the detection thread is further configured to obtain configuration data of the camera, and after obtaining the configuration data of the camera, the method further comprises:
the thread is put into a sleep state.
7. An electronic device comprising a first application, the first application being in a running state, the first application being for turning on a camera, the electronic device further comprising a processor and a storage device, the storage device having an application program stored thereon, the application program, when executed by the processor, causing the electronic device to perform the steps of:
detecting the connection state of the electronic equipment and a camera;
if the first application is in the non-connection state, setting the first application to be in a sleep state;
detecting a first operation that a user inserts the camera into the electronic equipment, and responding to the detected first operation to wake up the first application;
acquiring configuration data of the camera, wherein the configuration data is used for displaying the image data acquired by the camera by the first application;
receiving and displaying image data acquired by the camera;
if the camera is in the connection state, detecting whether the camera acquires image data, and if the camera does not acquire the image data, detecting the connection state of the electronic equipment and the camera;
the detecting whether the camera acquires image data, and if not, detecting a connection state of the electronic device and the camera includes:
whether the camera acquires image data is detected within a preset time period, and if the image data is not acquired within the preset time period, the connection state of the electronic equipment and the camera is detected.
8. The electronic device of claim 7, wherein the application program, when executed by the processor, causes the electronic device to further perform the steps of:
and if the first application is in the connection state, detecting a second operation of pulling the camera out of the electronic equipment by the user, and responding to the detected second operation to set the first application in a sleep state.
9. The electronic device of claim 7,
the preset time period is at least 2 times of the interval time of the frames of the camera.
10. The electronic device of claim 7,
the configuration data includes at least one of a resolution, a frame rate, and a system of the camera.
11. The electronic device of claim 7, wherein the application program, when executed by the processor, causes the electronic device to perform the step of detecting the connection status of the electronic device with a camera, comprising the steps of:
and starting a detection thread, and detecting the connection state based on the detection thread.
12. The electronic device of claim 7, wherein the application program, when executed by the processor, causes the electronic device to execute the detection thread to further obtain configuration data of the camera, and wherein the step of obtaining the configuration data of the camera further comprises the steps of:
the thread is put into a sleep state.
13. A computer-readable storage medium comprising computer instructions which, when run on a computer device, cause the computer device to perform the method of detecting a camera of any of claims 1-6.
CN202011331353.1A 2020-11-24 2020-11-24 Camera detection method and electronic equipment Active CN112764811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011331353.1A CN112764811B (en) 2020-11-24 2020-11-24 Camera detection method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011331353.1A CN112764811B (en) 2020-11-24 2020-11-24 Camera detection method and electronic equipment

Publications (2)

Publication Number Publication Date
CN112764811A CN112764811A (en) 2021-05-07
CN112764811B true CN112764811B (en) 2023-02-17

Family

ID=75693175

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011331353.1A Active CN112764811B (en) 2020-11-24 2020-11-24 Camera detection method and electronic equipment

Country Status (1)

Country Link
CN (1) CN112764811B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063009A (en) * 2009-11-13 2011-05-18 蒋思远 Camera testing system
CN103747242A (en) * 2013-12-23 2014-04-23 乐视致新电子科技(天津)有限公司 Method for automatically detecting camera shooting device and detecting apparatus
CN205754682U (en) * 2016-05-12 2016-11-30 上海斐讯数据通信技术有限公司 A kind of test device of photographic head
CN106294108A (en) * 2015-05-27 2017-01-04 腾讯科技(深圳)有限公司 Applied program testing method and device
CN107071162A (en) * 2017-03-30 2017-08-18 努比亚技术有限公司 Dormancy control system and its dormancy control method
CN107219914A (en) * 2017-05-31 2017-09-29 广东小天才科技有限公司 Method and device for saving electric quantity
CN109525839A (en) * 2018-12-04 2019-03-26 深圳创维数字技术有限公司 HDMI compatibility test method, device, mobile terminal and readable storage medium storing program for executing
CN109936761A (en) * 2017-12-19 2019-06-25 深圳市冠旭电子股份有限公司 VR all-in-one machine and the synchronous method of external terminal, system and VR all-in-one machine
CN110175114A (en) * 2019-04-19 2019-08-27 深圳壹账通智能科技有限公司 Test terminal, APP and camera compatibility test method and storage medium
CN111475347A (en) * 2020-03-03 2020-07-31 福州瑞芯微电子股份有限公司 Method, device, equipment and medium for supporting hot plug and unplug function of camera
CN111683279A (en) * 2020-06-08 2020-09-18 海信视像科技股份有限公司 Display apparatus and image restoration method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040212678A1 (en) * 2003-04-25 2004-10-28 Cooper Peter David Low power motion detection system
CN105939474B (en) * 2016-06-24 2018-03-06 华为技术有限公司 For testing the test equipment and method of testing of camera
JP6872704B2 (en) * 2017-09-14 2021-05-19 パナソニックIpマネジメント株式会社 Surveillance camera system and surveillance method
CN109819111A (en) * 2019-01-29 2019-05-28 上海与德通讯技术有限公司 A kind of control method, device, equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063009A (en) * 2009-11-13 2011-05-18 蒋思远 Camera testing system
CN103747242A (en) * 2013-12-23 2014-04-23 乐视致新电子科技(天津)有限公司 Method for automatically detecting camera shooting device and detecting apparatus
CN106294108A (en) * 2015-05-27 2017-01-04 腾讯科技(深圳)有限公司 Applied program testing method and device
CN205754682U (en) * 2016-05-12 2016-11-30 上海斐讯数据通信技术有限公司 A kind of test device of photographic head
CN107071162A (en) * 2017-03-30 2017-08-18 努比亚技术有限公司 Dormancy control system and its dormancy control method
CN107219914A (en) * 2017-05-31 2017-09-29 广东小天才科技有限公司 Method and device for saving electric quantity
CN109936761A (en) * 2017-12-19 2019-06-25 深圳市冠旭电子股份有限公司 VR all-in-one machine and the synchronous method of external terminal, system and VR all-in-one machine
CN109525839A (en) * 2018-12-04 2019-03-26 深圳创维数字技术有限公司 HDMI compatibility test method, device, mobile terminal and readable storage medium storing program for executing
CN110175114A (en) * 2019-04-19 2019-08-27 深圳壹账通智能科技有限公司 Test terminal, APP and camera compatibility test method and storage medium
CN111475347A (en) * 2020-03-03 2020-07-31 福州瑞芯微电子股份有限公司 Method, device, equipment and medium for supporting hot plug and unplug function of camera
CN111683279A (en) * 2020-06-08 2020-09-18 海信视像科技股份有限公司 Display apparatus and image restoration method

Also Published As

Publication number Publication date
CN112764811A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN112767231B (en) Layer composition method and device
CN113836540B (en) Method, apparatus, storage medium and program product for managing application rights
CN117129085B (en) Ambient light detection method, electronic device and readable storage medium
CN118276722A (en) Window display method and electronic device
US20240248752A1 (en) Process scheduling method and terminal device
CN114706633B (en) Preloading method, electronic device and storage medium
CN115794361A (en) Method for managing memory and electronic equipment
CN111381996A (en) Memory exception handling method and device
CN115017534A (en) File processing authority control method and device and storage medium
CN113672445B (en) Method for recording running state information of target program and electronic equipment
CN112764811B (en) Camera detection method and electronic equipment
US20230300240A1 (en) Lock Screen Display Method for Electronic Device and Electronic Device
CN114443117A (en) Application processing method and electronic equipment
CN114449171A (en) Method for controlling camera, terminal device, storage medium and program product
CN113900740A (en) Method and device for loading multiple list data
CN113253905A (en) Touch method based on multi-finger operation and intelligent terminal
CN117707462B (en) Audio data processing method, electronic equipment and medium
CN116719556B (en) System upgrading method and electronic equipment
CN116688494B (en) Method and electronic device for generating game prediction frame
CN116672707B (en) Method and electronic device for generating game prediction frame
CN117097883B (en) Frame loss fault cause determining method, electronic equipment and storage medium
WO2024032022A1 (en) Application icon visualization method and device
CN117130627B (en) Fitting upgrading method and electronic equipment
CN116680019B (en) Screen icon moving method, electronic equipment and storage medium
CN114879896B (en) Frozen screen processing method, electronic equipment and storage medium

Legal Events

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