Signal processing method and device, electronic equipment and storage medium
By switching the working state in the signal source component, only one signal source component is activated at a time and processing its MIPI signal, the complex and cost-effective circuits in the prior art are solved, and the hardware cost and circuit design are simplified.
Patent Information
- Application Number
- CN202411994573.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, when using SOC or MIPI two-choice chips that support two-channel MIPI RX to process signals, there is a problem of complex circuit and high cost.
By switching the working state of the multi-channel signal source component, only one signal source component is in the activated state at a time, and other components are in the standby state, obtaining and processing the MIPI signal of the activated state component, and intelligently switching is performed based on the preset frame threshold and priority.
Reduces hardware cost and circuit design complexity, reduces GPIO operation, and simplifies switching control logic.
Smart Images

Figure CN120386746A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of signal processing, and in particular, to a signal processing method and apparatus, an electronic device, and a storage medium. Background Art
[0002] With the popularization of mobile devices, the use of MIPI (Mobile Industry Processor Interface) is becoming more and more widespread. The MIPI interface aims to optimize the connection between internal components of mobile devices, including processors, cameras, displays, memories, and other peripherals.
[0003] Taking a binocular camera as an example, currently, it is relatively common to use an SOC (System on Chip) that supports two receiving end modules (MIPI RX) to process two signals, or to receive and process signals in a time-sharing manner through an MIPI two-way selection and switching chip, which has the problems of complex circuit and high cost. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a signal processing method and apparatus, an electronic device, and a storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a signal processing method is provided, the method including:
[0006] Switch the working state of signal source components in multiple signal source components; wherein, after each switch, there is one signal source component in an active state, and the signal source components other than the one signal source component are in a standby state;
[0007] Obtain the MIPI signal of the signal source component in the active state; wherein, the MIPI signal is a signal generated by the signal source component in the active state when performing a task;
[0008] Process the MIPI signal.
[0009] In some embodiments, the signal source component is an image acquisition component, and the method further includes:
[0010] Obtain the preset frame number threshold of each image acquisition component, and the working state and the number of acquired image frames of each image acquisition component before the current switch;
[0011] The switching of the working state of signal source components in multiple signal source components includes:
[0012] In response to the presence of an image acquisition component for which the number of acquired image frames has reached the corresponding frame number threshold and which is in the active state, switch the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state; wherein, the corresponding frame number threshold is the preset frame number threshold associated with the image acquisition component.
[0013] In some embodiments, the switching the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes:
[0014] In response to there being one image acquisition component that has not reached the corresponding frame number threshold and is in the standby state, switch the working state of the image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state.
[0015] In some embodiments, the switching the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes:
[0016] In response to there being multiple image acquisition components that are in the standby state before the switching and for which the number of acquired image frames has not reached the corresponding frame number threshold, screen out a target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold, and switch the working state of the target image acquisition component to the active state, and set the working states of all other image acquisition components except the target image acquisition component to the standby state.
[0017] In some embodiments, the method further includes:
[0018] Obtain the preset priorities of each image acquisition component;
[0019] The screening out a target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold includes:
[0020] According to the preset priorities of each image acquisition component, determine the image acquisition component with the highest priority among the image acquisition components that have not reached the corresponding frame number threshold as the target image acquisition component.
[0021] In some embodiments, the screening out a target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold includes:
[0022] Among multiple image acquisition components that have not reached the corresponding frame number threshold, the image acquisition component with the largest difference between the number of acquired images and the corresponding frame number threshold is determined as the target image acquisition component.
[0023] In some embodiments, the method further includes:
[0024] Before switching the working state of the signal source component in the multi-channel signal source component, confirm that the function indicating the working state of the switching signal source component is enabled.
[0025] According to a second aspect of the embodiments of the present disclosure, there is provided a signal processing device, the device includes:
[0026] A switching module configured to switch the working state of the signal source component in the multi-channel signal source component; wherein, after each switch, one signal source component is in an active state, and the signal source components other than the one signal source component are in a standby state;
[0027] A first acquisition module configured to acquire the MIPI signal of the signal source component in the active state; wherein, the MIPI signal is a signal generated by the signal source component in the active state when performing a task;
[0028] A processing module configured to process the MIPI signal.
[0029] In some embodiments, the signal source component is an image acquisition component, and the device further includes:
[0030] A second acquisition module configured to acquire the preset frame number threshold of each image acquisition component, and the working state and the number of acquired images of each image acquisition component before the current switch;
[0031] The switching module is further configured to, in response to an image acquisition component whose acquired number of images reaches the corresponding frame number threshold and is in the active state, switch the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state; wherein, the corresponding frame number threshold is the preset frame number threshold associated with the image acquisition component.
[0032] In some embodiments, the switching module is further configured to, in response to there being only one image acquisition component that has not reached the corresponding frame number threshold and is in the standby state, switch the working state of the image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state.
[0033] In some embodiments, the switching module is further configured to, in response to multiple image acquisition components being in the standby state before switching and the number of frames of the acquired images not reaching the corresponding frame number threshold, screen out a target image acquisition component from the multiple image acquisition components whose number of frames does not reach the corresponding frame number threshold, and switch the working state of the target image acquisition component to the active state, and set the working states of all image acquisition components other than the target image acquisition component to the standby state.
[0034] In some embodiments, the apparatus further includes:
[0035] A third acquisition module, configured to acquire the preset priorities of the respective image acquisition components;
[0036] The switching module is further configured to determine, according to the preset priorities of the respective image acquisition components, the image acquisition component with the highest priority among the image acquisition components whose number of frames does not reach the corresponding frame number threshold as the target image acquisition component.
[0037] In some embodiments, the switching module is further configured to determine, among the multiple image acquisition components whose number of frames does not reach the corresponding frame number threshold, the image acquisition component with the largest difference between the number of frames of the acquired images and the corresponding frame number threshold as the target image acquisition component.
[0038] In some embodiments, the apparatus further includes:
[0039] A confirmation module, configured to confirm that the function of indicating the working state of the switching signal source component is enabled before switching the working state of the signal source component in the multiple signal source components.
[0040] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor;
[0041] A memory for storing a computer program or instruction;
[0042] Wherein, the processor executes the computer program or instruction to implement the steps of the method described in the first aspect above.
[0043] According to a fourth aspect of the embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, the storage medium stores a computer program or instruction, and when the computer program or instruction in the storage medium is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0044] According to a fifth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program or instruction, and when the computer program or instruction is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0045] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
[0046] In the embodiments of the present disclosure, the method of switching the working state of the signal source component in the multi-channel signal source component belongs to a method of controlling the input from the source and belongs to a software control method. Compared with the method of selecting an SOC that supports two MIPI RXs, the cost can be reduced; and compared with the method of selecting an SOC that supports a single MIPI RX and matching it with a hardware two-way MIPI switching chip, not only the cost of the hardware MIPI switch can be reduced, but also the complexity of the circuit design can be reduced; in addition, since there is no need to operate the GPIO, the complexity of the switching control logic is also reduced.
[0047] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure.
[0049] Figure 1 is a flowchart of a signal processing method shown according to an exemplary embodiment;
[0050] Figure 2 is a schematic diagram of the signal processing method in the embodiments of the present disclosure;
[0051] Figure 3 is a flowchart of performing a working state switch in the embodiments of the present disclosure;
[0052] Figure 4 is a block diagram of a signal processing device shown according to an exemplary embodiment;
[0053] Figure 5 is a block diagram of an electronic device shown according to an exemplary embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0054] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.
[0055] As described above, currently, it is widely used to select an SOC that supports two receiving-end modules (MIPI RX) to process two signals, or to receive and process signals time-divisionally through an MIPI two-way selection and switching chip. Taking a binocular camera as an example, if an SOC that supports two MIPI RXs is selected, the two input channels of the MIPI are respectively connected to a camera. After the MIPI receives two image signals, it transmits them to the SOC so that the SOC can synchronously process the two signals. Since the SOC of the MIPI RX integrates more image processing functions and interfaces in this case, its manufacturing cost will be relatively high. If an SOC that supports a single MIPI RX is selected and paired with an MIPI two-way selection and switching chip, this MIPI two-way selection and switching chip is usually an FPGA (Field Programmable Gate Array) chip, also known as an MIPI switch. The MIPI switch receives a GPIO signal through a GPIO (General Purpose Input / Output) port to control its own state, thereby turning on the channel to a camera, and realizes the switching between binocular cameras in this way. The method of using the MIPI switch, on the one hand, requires an MIPI two-way selection and switching chip and GPIO ports, which will increase the hardware cost; and the use of the switching chip also increases the complexity of the system, including the development workload in aspects such as hardware connection, control logic, and software driver.
[0056] Based on this, an embodiment of the present disclosure provides a signal processing method Figure 1 is a flowchart of a signal processing method shown according to an exemplary embodiment. As Figure 1 shown, the method mainly includes the following steps:
[0057] S11. Switch the working state of the signal source component in the multi-channel signal source components; wherein, after each switch, there is one signal source component in the active state, and the signal source components other than the one signal source component are in the standby state;
[0058] S12. Obtain the MIPI signal of the signal source component in the active state; wherein, the MIPI signal is a signal generated by the signal source component in the active state when performing a task;
[0059] S13. Process the MIPI signal.
[0060] In the embodiments of the present disclosure, the signal processing method can be applied to electronic devices such as mobile phones, tablet computers, personal digital assistants (PDAs), wearable devices, etc. An SOC that supports single-channel MIPI RX is provided in the electronic device. When the electronic device has built-in or externally connected multiple signal source components, the SOC can control the switching of the working states of the signal source components to control the reception of only one MIPI signal and process the signal.
[0061] In step S11, the electronic device switches the working state of the signal source component among multiple signal source components. The multiple signal source components can be two or more than two. The signal source component can be, for example, an image acquisition component, an audio acquisition component, or an audio-video acquisition component that integrates audio and video acquisition, etc. In addition, the signal source component can be a component built into the electronic device or a peripheral device independent of the electronic device. The embodiments of the present disclosure do not limit this. Among them, the working state includes the active state (RESUNME) and the standby state (STANDBY). In the active state, the power consumption of the signal source component is relatively large and tasks can be executed; while in the standby state, the power consumption of the signal source component is relatively small, but usually no tasks are executed in this state. Taking the signal source component as a camera as an example, the camera can execute image acquisition and processing tasks in the active state; while in the standby state, it does not execute image acquisition and processing tasks. In the embodiments of the present disclosure, the signal source components whose working states are switched are two of the multiple paths. One path can be switched from the active state to the standby state, and the other path can be switched from the standby state to the active state.
[0062] In some embodiments, the electronic device can switch the working states of the signal source components based on a preset interval duration. For example, it switches once every 1 minute, alternately making one signal source component in the active state and other signal source components in the standby state; in some embodiments, the electronic device can switch the working states based on the task execution situation of each signal source component; in other embodiments, the electronic device can also receive control signals from other devices or users to switch the working states of the signal source components.
[0063] In step S12, after the electronic device switches the working states of the signal source components, since only one signal source component is in the active state each time, the electronic device can only receive the MIPI signal generated by the one signal source component in the active state when it executes tasks. Thus, in step S13, the one MIPI signal is processed.
[0064] For example, taking the multi-channel signal source component as a binocular camera, the camera can be a camera based on CMOS (Complementary Metal Oxide Semiconductor, complementary metal oxide semiconductor image sensor). Since the electronic device will switch the working state of the binocular camera, each switch enables one camera to perform tasks and generate a MIPI signal. Then the SOC in the electronic device will only receive this one MIPI signal (image signal) and perform image enhancement on the MIPI signal or perform some image analysis and processing based on the image.
[0065] It is understood that the method of switching the working state of the signal source components in the multi-channel signal source components in the embodiment of the present disclosure is a method of controlling the input from the source and is a software control method. Compared with the method of using a SoC that supports two MIPI RX channels, it can reduce costs; and compared with the method of using a SoC that supports a single MIPI RX channel and a hardware two-choose-one MIPI switching chip, it not only reduces the cost of the hardware MIPI switch, but also reduces the complexity of the circuit design. In addition, since there is no need to operate GPIO, the complexity of the switching control logic is also reduced.
[0066] Figure 2 is a schematic diagram of a signal processing method in an embodiment of the present disclosure, such as Figure 2 As shown, camera A and camera B are respectively connected to the "MIPI switch" through the MIPI interface, and the "MIPI switch" is connected to the system-on-chip SOC. Among them, the "MIPI switch" is different from the aforementioned hardware two-to-one MIPI switching chip, but refers to the control method of switching the working status of the signal source component in the multi-channel signal source component based on software in the embodiment of the present disclosure. Based on the "MIPI switch" of the embodiment of the present disclosure, the two data channels of camera A and camera B and MIPI are both turned on, but only one of the two cameras is in working state, so there is data transmission on only one data channel; while in the method of the hardware two-to-one MIPI switching chip, only one data channel between camera A and camera B and MIPI is turned on.
[0067] In some embodiments, the signal source component is an image acquisition component, and the method further includes:
[0068] Obtaining the preset frame number threshold of each image acquisition component, as well as the working status of each image acquisition component and the number of image frames acquired before the current switch;
[0069] The switching of the working state of the signal source components in the multi-channel signal source components includes:
[0070] In response to the existence of an image acquisition component for which the number of acquired image frames has reached the corresponding frame number threshold and is in the active state, switch the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of the other image acquisition components except this one to the standby state; where the corresponding frame number threshold is the preset frame number threshold associated with the image acquisition component.
[0071] In the embodiments of the present disclosure, the signal source component is an image acquisition component (i.e., a camera), and the electronic device can control the switching of the working states of the signal source components in the multiple signal source components according to the preset frame number thresholds of each camera, the working state before switching, and the number of acquired image frames. Among them, the preset frame number threshold of each image acquisition component can be a value that is related to the acquisition frame rate and represents the number of image frames that should be acquired within a preset time period. In the embodiments of the present disclosure, the preset frame number thresholds of different image acquisition components can be the same or different, and the setting of this value can be flexibly set according to project requirements. Exemplarily, if the images acquired by camera A are used for front-end display, and the images acquired by camera B are used for background recognition, then the acquisition frame rate of camera A can be higher than that of camera B.
[0072] In the embodiments of the present disclosure, the electronic device will obtain the working states of each image acquisition component before the current switch. Exemplarily, the electronic device can register a structure variable for each image acquisition component, and then call the callback functions of STANDBY and RESUME based on the structure variable to obtain the working states of the image acquisition components. In addition, the electronic device will also accumulate the number of image frames acquired by the image acquisition component to be used to determine whether the accumulated number of acquired image frames has reached the corresponding frame number threshold. It should be noted that the corresponding frame number threshold refers to the preset frame number threshold associated with the image acquisition component, that is, the number of image frames accumulated by each image acquisition component is compared with the preset frame number threshold configured by itself. For example, if the number of image frames accumulated by a certain image acquisition component is expressed as ++cntFrm, and the corresponding frame number threshold is dstFrm, then in the embodiments of the present disclosure, no switching is performed when ++cntFrm < dstFrm, and switching is performed when ++cntFrm reaches dstFrm.
[0073] In the embodiments of the present disclosure, when the electronic device determines that there is an image acquisition component whose acquired number of image frames has reached the corresponding frame number threshold and is in the active state, it switches the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and sets the working states of all other image acquisition components to the standby state. It should be noted that since only one image acquisition component is in the active state at a time, the electronic device can only switch the working state of one image acquisition component that has not reached the corresponding frame number threshold to the active state, and the remaining image acquisition components are in the standby state. For the image components that were in the standby state among the remaining image acquisition components before the switch, they still remain in the standby state. For the image acquisition components that were in the working state before the switch and whose acquired number of image frames has reached the corresponding frame number threshold, they are switched to the standby state. It should be noted that in the embodiments of the present disclosure, the image acquisition component initially in the active state can be preset. For example, for camera A and camera B, camera A can be preferentially set to acquire images, and then the switching judgment is executed.
[0074] It can be understood that for the image acquisition component, in the embodiments of the present disclosure, the switching is controlled in combination with the acquired number of image frames, so that the switching timing better meets the requirements and has a high degree of intelligence.
[0075] In some embodiments, the switching the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes:
[0076] In response to there being one image acquisition component that has not reached the corresponding frame number threshold and is in the standby state, switch the working state of the image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state.
[0077] In the embodiments of the present disclosure, when the acquired number of image frames of an image acquisition component in the active state has reached the corresponding frame number threshold, if there is one image acquisition component that has not reached the corresponding frame number threshold and is in the standby state, directly switch the working state of this image acquisition component to the standby state, and set the working states of all other image acquisition components to the standby state, so that the SOC processes only one MIPI signal each time.
[0078] In some embodiments, the switching the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes:
[0079] In response to there being multiple image acquisition components that were in the standby state before the switch and the number of acquired image frames did not reach the corresponding frame number threshold, a target image acquisition component is selected from the multiple image acquisition components that did not reach the corresponding frame number threshold, and the working state of the target image acquisition component is switched to the active state, and the working states of all image acquisition components other than the target image acquisition component are set to the standby state.
[0080] In an embodiment of the present disclosure, when the number of image frames acquired by an image acquisition component in the active state has reached the corresponding frame number threshold, if there are multiple image acquisition components that have not reached the corresponding frame number threshold and are in the standby state, it is necessary to select a target image acquisition component from them and switch it to the active state, and the working states of all other image acquisition components are set to the standby state.
[0081] It can be understood that in an embodiment of the present disclosure, when the number of image frames acquired by an image acquisition component in the active state has reached the corresponding frame number threshold, targeted processing is performed according to the number of image acquisition components that have not reached the corresponding frame number threshold and are in the standby state, and the intelligence is relatively high.
[0082] In some embodiments, the method further includes:
[0083] Obtain the preset priorities of each image acquisition component;
[0084] The step of selecting a target image acquisition component from the multiple image acquisition components that did not reach the corresponding frame number threshold includes:
[0085] According to the preset priorities of each image acquisition component, determine the image acquisition component with the highest priority among the image acquisition components that did not reach the corresponding frame number threshold as the target image acquisition component.
[0086] In an embodiment of the present disclosure, when there are multiple image acquisition components that have not reached the corresponding frame number threshold and are in the standby state, the electronic device determines the image acquisition component with the highest priority among the image acquisition components that did not reach the corresponding frame number threshold as the target image acquisition component according to the preset priorities of each image acquisition component, so that the image acquisition component with a higher priority can be preferentially in the active state and thus complete image acquisition preferentially. Among them, the setting of the priority can also be set according to requirements. Exemplarily, if there are multiple cameras set at different angles, the camera with the smallest difference in angle from the acquisition target has the highest priority, and the camera with the largest difference in angle from the acquisition target has the lowest priority. It can be understood that in an embodiment of the present disclosure, based on the preset priorities, the target image acquisition component that is preferentially switched to the active state is determined, and the intelligence is relatively high and flexible.
[0087] In some embodiments, screening out a target image acquisition component from multiple image acquisition components that have never reached the corresponding frame number threshold includes:
[0088] Among multiple image acquisition components that have not reached the corresponding frame number threshold, determining as the target image acquisition component an image acquisition component with the largest difference between the number of frames of the acquired images and the corresponding frame number threshold.
[0089] In the embodiments of the present disclosure, when there are multiple image acquisition components that have not reached the corresponding frame number threshold and are in the standby state, the electronic device determines as the target image acquisition component an image acquisition component with the largest difference between the number of frames of the acquired images and the corresponding frame number threshold. In this way, it is possible to optimize the abnormal situation where the number of image acquisitions does not meet the standard due to the temporary abnormality of the image acquisition component or the abnormal signal transmission, resulting in the loss of image frames, so that the image acquisition tasks of each image acquisition component can be relatively balanced.
[0090] In some embodiments, the method further includes:
[0091] Before switching the working state of the signal source component in the multiple signal source components, confirm that the function indicating the switching of the working state of the signal source component is enabled.
[0092] In the embodiments of the present disclosure, the function indicating the switching of the working state of the signal source component can be enabled or disabled through page configuration, or can also be enabled or disabled by voice. The embodiments of the present disclosure do not limit this. After enabling this switching function, the electronic device executes the signal processing method of the embodiments of the present disclosure, and switches the working state of the signal source component in the multiple signal source components so that the electronic device can take turns to obtain the MIPI signal of one signal source component each time for processing. Exemplarily, in the electronic device, the isFrmCtrl variable is used to determine whether the function is enabled. When isFrmCtrl is True, it can indicate that the switching control is enabled. It should be noted that in the embodiments of the present disclosure, if the switching function of the working state of the signal source component is not enabled, the electronic device can only obtain the MIPI signal of one of the preset signal source components to execute the task check.
[0093] It can be understood that the embodiments of the present disclosure can dynamically set the function indicating the switching of the working state of the signal source component, and have good intelligence.
[0094] Figure 3 The following is a flowchart for executing the working state switching in the embodiments of the present disclosure. As Figure 3 shown, it includes the following steps:
[0095] S31. Obtain the respective structure information of the cameras.
[0096] In an embodiment of the present disclosure, taking a binocular camera as an example, the electronic device obtains the structure information corresponding to each camera, that is, registers a structure variable for each camera.
[0097] S32. Obtain the STANDBY and RESUME callback functions of the corresponding driver according to the structure information of the camera.
[0098] In an embodiment of the present disclosure, the electronic device uses the structure variable corresponding to the camera to call the callback function that can obtain the working state of the camera. Taking camera A as an example, the electronic device can use the structure variable of camera A to call the callback function of STANDBY, and determine whether camera A is in the standby state according to the return result of the callback function; in addition, the electronic device also uses the structure variable of camera A to call the callback function of RESUME, and determine whether camera A is in the active state according to the return result of the callback function. It should be noted that a camera can only be in one working state at the same time. If it is determined to be in the active state based on the callback function of RESUME, the callback function of STANDBY may no longer be called; similarly, if it has been determined to be in the standby state, the callback function of RESUME may no longer be called. However, if it is determined not to be in the active state based on the callback function of RESUME, the callback function of STANDBY still needs to be called to determine whether it is in the standby state, because camera A may still be in an offline state; similarly, if it is determined not to be in the standby state based on the callback function of STANDBY, the callback function of RESUME still needs to be called to determine whether it is in the active state.
[0099] S33. Loop to execute the switching logic: If the current switching FLAG is 0, then execute the RESUME of camera A and the STANDBY of camera B; if the current switching FLAG is 1, then execute the STANDBY of camera A and the RESUME of camera B. In an embodiment of the present disclosure, FLAG is a preset variable value, and the initial value can be set to 0, indicating that camera A is in the active state to execute the work task first, while camera B is in the standby state; when it is determined that a switch needs to be performed based on the method of comparing the number of captured image frames with the corresponding frame number threshold as described above in the embodiment of the present disclosure, or based on a control method such as a preset interval duration, etc., the variable value of FLAG can be changed, for example, set the FLAG value to 1. At this time, the electronic device can switch camera A to the standby state and camera B to the active state according to the value of FLAG.
[0100] It should be noted that the initial value of FLAG does not necessarily have to be set to 0. For example, it can also be -1. When the preset camera A is preferentially activated and working, if the switching condition is met, the FLAG value is set to 1 at this time, and the switching makes camera A in the standby state and camera B in the activated state; if the switching condition is met again after the switching, the FLAG value is set to 0 at this time, and the switching makes camera A in the activated state and camera B in the standby state again.
[0101] It can be understood that the method of switching the working state of the binocular camera in the embodiments of the present disclosure belongs to a pure software control method for controlling the input from the source. Compared with the method of selecting an SOC that supports two-way MIPI RX, it can reduce costs; and compared with the method of selecting an SOC that supports single-way MIPI RX and matching it with a hardware one-way MIPI switching chip, it can not only reduce the cost of the hardware MIPI switch, but also reduce the complexity of the circuit design; in addition, since there is no need to operate the GPIO, the complexity of the switching control logic is also reduced.
[0102] Figure 4 It is a block diagram of a signal processing device shown according to an exemplary embodiment. As Figure 4 shown, the device mainly includes:
[0103] A switching module 41 configured to switch the working state of the signal source components in the multiple signal source components; wherein, after each switching, one signal source component is in the activated state, and the signal source components other than the one signal source component are in the standby state;
[0104] A first acquisition module 42 configured to acquire the MIPI signal of the signal source component in the activated state; wherein, the MIPI signal is a signal generated by the signal source component in the activated state when performing a task;
[0105] A processing module 43 configured to process the MIPI signal.
[0106] In some embodiments, the signal source component is an image acquisition component, and the device further includes:
[0107] A second acquisition module configured to acquire the preset frame number threshold of each image acquisition component, as well as the working state and the number of acquired image frames of each image acquisition component before the current switching;
[0108] The switching module 41 is further configured to, in response to the existence of an image acquisition component for which the number of acquired image frames has reached the corresponding frame number threshold and which is in the active state, switch the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all image acquisition components other than the above to the standby state; wherein, the corresponding frame number threshold is a preset frame number threshold associated with the image acquisition component.
[0109] In some embodiments, the switching module 41 is further configured to, in response to the number of image acquisition components that have not reached the corresponding frame number threshold and are in the standby state being one, switch the working state of the image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all image acquisition components other than the above to the standby state.
[0110] In some embodiments, the switching module 41 is further configured to, in response to there being a plurality of image acquisition components that are in the standby state before switching and for which the number of acquired image frames has not reached the corresponding frame number threshold, screen out a target image acquisition component from the plurality of image acquisition components that have not reached the corresponding frame number threshold, and switch the working state of the target image acquisition component to the active state, and set the working states of all image acquisition components other than the target image acquisition component to the standby state.
[0111] In some embodiments, the device further includes:
[0112] A third acquisition module, configured to acquire the preset priorities of each image acquisition component;
[0113] The switching module 41 is further configured to, according to the preset priorities of each image acquisition component, determine the image acquisition component with the highest priority among the image acquisition components that have not reached the corresponding frame number threshold as the target image acquisition component.
[0114] In some embodiments, the switching module 41 is further configured to determine, among a plurality of image acquisition components that have not reached the corresponding frame number threshold, the image acquisition component with the largest difference between the number of acquired image frames and the corresponding frame number threshold as the target image acquisition component.
[0115] In some embodiments, the device further includes:
[0116] A confirmation module, configured to confirm that the function of indicating the switching of the working state of the signal source component is enabled before switching the working state of the signal source component in the multi-channel signal source components.
[0117] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated in detail here.
[0118] Figure 5 It is a block diagram of the structure of an electronic device shown according to an exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a tablet computer, a wearable device, etc.
[0119] Referring to Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power supply component 506, a multimedia component 508, an audio component 510, an input / output (I / O) interface 55, a sensor component 514, and a communication component 516.
[0120] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0121] The memory 504 is configured to store various types of data to support the operations on the electronic device 500. Examples of these data include at least one of the following: instructions for any application or method to operate on the electronic device 500, contact data, phone book data, messages, pictures, and videos. The memory 504 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0122] The power supply component 506 provides power to various components of the electronic device 500. The power supply component 506 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.
[0123] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0124] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a Microphone (MIC), which is configured to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 further includes a speaker for outputting audio signals.
[0125] The I / O interface 55 provides an interface between the processing component 502 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.
[0126] The sensor assembly 514 includes one or more sensors for providing status assessments of various aspects for the electronic device 500. For example, the sensor assembly 514 can detect the on / off state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500. The sensor assembly 514 can also detect a change in the position of the electronic device 500 or a component within the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and a change in the temperature of the electronic device 500. The sensor assembly 514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 can also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 can also include, but is not limited to, at least one of the following: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.
[0127] The communication component 516 is configured to facilitate communication between the electronic device 500 and other devices in a wired or wireless manner. The electronic device 500 can access a wireless network based on communication standards, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0128] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.
[0129] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including executable instructions or a computer program. The above instructions or computer program can be executed by a processor 520 of the electronic device 500 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.
[0130] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute any one of the signal processing methods in the above embodiments of the present disclosure.
[0131] The embodiments of the present disclosure provide a computer program product, which includes: a computer program or executable instructions, and the computer program or executable instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium, and the processor executes the computer program or executable instructions, so that the computer device executes any one of the signal processing methods in the above embodiments of the present disclosure.
[0132] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed by the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0133] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A signal processing method, characterized in that, Including: Switch the working state of the signal source components in the multi-channel signal source components; wherein, after each switch, one signal source component is in the active state, and the signal source components other than the one signal source component are in the standby state; Obtain the MIPI signal of the signal source component in the active state; wherein, the MIPI signal is a signal generated by the signal source component in the active state when performing a task; Process the MIPI signal.
2. The method according to claim 1, characterized in that, The signal source component is an image acquisition component, and the method further includes: Obtain the preset frame number threshold of each image acquisition component, as well as the working state and the number of acquired image frames of each image acquisition component before the current switch; The switching of the working state of the signal source components in the multi-channel signal source components includes: In response to an image acquisition component in the active state whose acquired image frames have reached the corresponding frame number threshold, switch the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state; wherein, the corresponding frame number threshold is the preset frame number threshold associated with the image acquisition component.
3. The method according to claim 2, characterized in that The switching of the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes: In response to there being only one image acquisition component that has not reached the corresponding frame number threshold and is in the standby state, switch the working state of the image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and set the working states of all other image acquisition components to the standby state.
4. The method according to claim 2, wherein The switching of the working state of an image acquisition component that has not reached the corresponding frame number threshold and is in the standby state to the active state, and setting the working states of all other image acquisition components to the standby state includes: In response to there being multiple image acquisition components that were in the standby state before the switch and whose acquired image frames have not reached the corresponding frame number threshold, screen out the target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold, and switch the working state of the target image acquisition component to the active state, and set the working states of all other image acquisition components except the target image acquisition component to the standby state.
5. The method according to claim 4, characterized in that, The method further includes: Obtain the preset priority of each image acquisition component; The screening out of the target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold includes: According to the preset priority of each image acquisition component, determine the image acquisition component with the highest priority among the image acquisition components that have not reached the corresponding frame number threshold as the target image acquisition component.
6. The method according to claim 4, wherein The screening out of the target image acquisition component from the multiple image acquisition components that have not reached the corresponding frame number threshold includes: Determine the image acquisition component with the largest difference between the number of acquired image frames and the corresponding frame number threshold among the multiple image acquisition components that have not reached the corresponding frame number threshold as the target image acquisition component.
7. The method according to claim 1, characterized in that The method further includes: Before switching the working state of the signal source component in the multi-channel signal source component, confirm that the function indicating the working state of the signal source component is enabled.
8. A signal processing device, characterized in that, Including: A switching module configured to switch the working state of the signal source component in the multi-channel signal source component; wherein, after each switch, one signal source component is in an active state, and the signal source components other than the one signal source component are in a standby state; A first acquisition module configured to acquire the MIPI signal of the signal source component in the active state; wherein, the MIPI signal is a signal generated by the signal source component in the active state when performing a task; A processing module configured to process the MIPI signal.
9. An electronic device, characterized in that, Including: A processor; A memory for storing computer programs or instructions; Wherein, the processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.