MIPI multi-channel switching method and device, equipment and storage medium
By parsing and dynamically switching MIPI multi-channel data, the problems of increased system memory usage and hardware costs have been solved, and efficient and orderly transmission and flexible switching of MIPI multi-channel data have been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-15
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies suffer from excessive system memory consumption and increased hardware costs when processing MIPI multi-channel data, and lack flexibility in multi-channel switching.
By receiving MIPI multi-channel composite data, parsing it into independent channels and obtaining frame synchronization signals, determining the highest priority target channel according to preset switching parameters, generating a switching command, opening the target channel for data transmission, closing the remaining channels, monitoring the transmission progress using frame synchronization signals, and dynamically switching to the next highest priority target channel.
It effectively avoids data caching from consuming a large amount of system storage resources, reduces hardware costs, ensures the integrity and flexibility of data transmission, adapts to diverse application scenarios, and achieves efficient and orderly transmission of multi-channel data.
Smart Images

Figure CN121750802A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image interface processing technology, and in particular to a MIPI multi-channel switching method, apparatus, device, and storage medium. Background Technology
[0002] In the field of image transmission protocols, there are currently various interface types, each suitable for different application scenarios. Among them, MIPI (Mobile Industry Processor Interface) has been widely and maturely applied in mobile terminal devices and other fields due to its outstanding advantages of low power consumption and high-speed transmission. Furthermore, the MIPI interface's support for multi-channel video data composite transmission effectively reduces the number of interface pins, better adapting to the miniaturization and integration trends of mobile devices.
[0003] However, traditional multi-channel data processing solutions have significant drawbacks when the image processing module cannot process multi-channel data in parallel. First, by using data caching, multi-channel data that the image processing module cannot process temporarily is cached in system memory and then retrieved for processing when the image processing module is idle. However, this method continuously occupies a large amount of system storage resources, causing system memory space shortage, and thus reducing the overall system operating efficiency and response speed. Second, by adding a parallel image processing module to achieve synchronous processing of multi-channel data, although this method can improve data processing efficiency, it will significantly increase a large amount of additional circuit logic, resulting in a significant increase in the chip layout area and a significant increase in chip research and development and production costs. Summary of the Invention
[0004] The purpose of this invention is to provide a MIPI multi-channel switching method, apparatus, device, and storage medium, which aims to solve the problems of excessive system memory resource consumption due to data caching, increased hardware costs due to the addition of parallel processing modules, and insufficient flexibility in multi-channel switching when processing multi-channel MIPI channel data in the prior art.
[0005] In a first aspect, the present invention provides a MIPI multi-channel switching method, the method comprising the following steps: Receive MIPI multi-channel composite data input from the camera, parse the multi-channel composite data into multiple independent channel data, and obtain the frame synchronization signal of each channel; The highest priority target channel is determined based on preset switching parameters, and a switching instruction corresponding to the highest priority target channel is generated. According to the switching instruction, the target channel is opened, data is transmitted through the target channel, and the other channels are closed; The channel data output from the target channel is processed frame by frame, and the transmission progress of the current frame data is monitored according to the frame synchronization signal of the target channel. Once the current frame data transmission is completed, the next highest priority target channel is determined based on the switching parameters, and a switching instruction corresponding to the next highest priority target channel is generated to continue processing the channel data.
[0006] In some embodiments, the step of determining the target channel with the highest current priority based on preset switching parameters and generating a switching instruction corresponding to the target channel with the highest current priority includes: Configure corresponding switching parameters for the multiple channels, the switching parameters including the number of channels to be switched and the switching order; Based on the switching parameters and the frame synchronization signal, the channel with the highest current priority is determined, and a corresponding switching instruction is generated.
[0007] In some embodiments, the steps of opening the target channel, transmitting data through the target channel, and closing the remaining channels according to the switching instruction include: Obtain the corresponding binary enable signal from the switching instruction, and control the opening and closing of data transmission of the corresponding channel according to the binary enable signal; When the value of the corresponding bit of the binary enable signal is 1, the corresponding channel is turned on, and data is output through the channel; When the value of the corresponding bit of the binary enable signal is 0, the corresponding channel is closed, and the channel is prohibited from outputting data.
[0008] In some embodiments, at any given time, only the binary enable signal of the target channel with the highest priority has a value of 1 for the corresponding bit, while the binary enable signal of the other channels has a value of 0 for the corresponding bit.
[0009] In some embodiments, before determining the next highest priority target channel based on the switching parameters after the current frame data transmission is detected to be complete, the process includes: Check if a reset command for the switching parameters has been received: When no reset instruction for the switching parameters is received, the next highest priority target channel is determined based on the switching order in the switching parameters, a corresponding switching instruction is generated, and channel data processing continues. When a reset command for the switching parameters is received, the reset switching parameters are obtained, the set of channels to participate in the switching is determined based on the number of switching channels in the reset switching parameters, the next highest priority target channel is determined from the set of channels according to the switching order in the reset switching parameters, the corresponding switching command is generated, and the channel data processing continues.
[0010] In a second aspect, the present invention provides a MIPI multi-channel switching device, the device comprising: The parsing module is used to receive MIPI multi-channel composite data input from the camera, parse the multi-channel composite data into independent multiple channel data, and obtain the frame synchronization signal of each channel; The instruction generation module is used to determine the target channel with the highest current priority based on preset switching parameters, and generate a switching instruction corresponding to the target channel with the highest current priority. The gating module is used to open the target channel according to the switching instruction, perform data transmission through the target channel, and close the other channels; The processing module is used to process the channel data output by the target channel frame by frame, and monitor the transmission progress of the current frame data according to the frame synchronization signal of the target channel. When the current frame data transmission is completed, the instruction generation module further determines the next highest priority target channel based on the switching parameters, and generates a switching instruction corresponding to the next highest priority target channel to continue processing the channel data.
[0011] In some embodiments, the instruction generation module includes: A parameter configuration unit is used to configure corresponding switching parameters for the plurality of channels, wherein the switching parameters include the number of channels to be switched and the switching order; The instruction generation subunit is used to determine the channel with the highest current priority based on the switching parameters and the frame synchronization signal, and generate the corresponding switching instruction.
[0012] In some embodiments, the gating module includes: The signal acquisition unit acquires the corresponding binary enable signal from the switching instruction. The channel control unit controls the opening and closing of data transmission for the corresponding channel according to the binary enable signal; Specifically, when the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 1, the channel switch control unit opens the corresponding channel and outputs data through the channel; When the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 0, the channel switch control unit closes the corresponding channel and prohibits the channel from outputting data.
[0013] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0014] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0015] This invention, through its multi-channel dynamic switching transmission design, enables a single image processing module to process multiple parallel MIPI input data without the need for additional memory caching. This completely avoids the problem of traditional caching schemes consuming large amounts of system storage resources due to data caching, effectively freeing up memory space and improving the overall system operating efficiency. It also avoids the hardware cost increase caused by adding extra circuit logic, significantly reducing production costs. Furthermore, it utilizes frame synchronization signals to precisely control the timing of multiple channel switching, performing switching only after the current frame data transmission is complete, ensuring the integrity of each frame's data transmission and effectively preventing data loss or corruption. Simultaneously, priority configuration supports flexible switching strategies, adapting to diverse application scenarios and achieving efficient and orderly transmission of multi-channel data. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the MIPI multi-channel switching method provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating step S200 provided in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the MIPI multi-channel switching control provided in an embodiment of the present invention. Figure 4 This is another flowchart example of MIPI multi-channel switching control provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the MIPI multi-channel switching device provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integral, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. Furthermore, the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. The terms "first," "second," and similar words do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Words such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Above," "below," "left," "right," etc., are used only to indicate relative positional relationships, which may change accordingly when the absolute position of the described object changes.
[0019] To keep the following description of the embodiments of the present invention clear and concise, detailed descriptions of some known functions and known components are omitted in this specification.
[0020] Please refer to the following: Figure 1 , Figure 1 This is a flowchart illustrating the MIPI multi-channel switching method provided in an embodiment of the present invention. The method includes the following steps: S100: Receives MIPI multi-channel composite data input from the camera, parses the multi-channel composite data into independent multiple channel data, and obtains the frame synchronization signal of each channel.
[0021] In this embodiment of the invention, when MIPI multi-channel composite data is received from the camera, the protocol header information in the MIPI data packet is first identified and extracted, including data identifier, data type, packet length, etc. According to the data format specified by the CSI-2 protocol, the payload data of each channel is separated. Based on the protocol parsing, according to the channel identifier information (such as the virtual channel number VC-ID), the composite data stream is restored into multiple independent channel data, with each channel corresponding to an independent image or video data stream, and the channels are logically completely isolated from each other. While separating the channel data, the frame synchronization signal corresponding to each channel data stream is simultaneously extracted. This frame synchronization signal includes a frame start flag indicating the start of a frame data transmission and a frame end flag indicating the end of a frame data transmission. By identifying the synchronization control field in the data frame, the frame synchronization signal is bound and stored with the corresponding channel data, providing a precise timing basis for subsequent channel switching. The parsed independent channel data and their corresponding frame synchronization signals are output in parallel, with each channel data stream maintaining its original data format and timing relationship, ensuring the integrity and consistency of the image information. The embodiments of the present invention achieve accurate restoration of MIPI multi-channel composite data to multi-channel independent channel data through the above steps, and simultaneously complete the synchronous acquisition of frame synchronization signals, providing reliable data and timing basis for subsequent channel switching control based on frame synchronization signals.
[0022] S200: Determine the target channel with the highest current priority based on the preset switching parameters, and generate the switching command corresponding to the target channel with the highest current priority.
[0023] In this embodiment of the invention, switching parameters are pre-configured and stored. Before data transmission begins, the preset switching parameters are loaded into the control logic to provide a basis for channel priority determination. Dynamic updates of the switching parameters are also supported; the updated parameters take effect after the current frame data transmission is completed, allowing for flexible adjustment to adapt to different scenarios. Based on the switching parameters, the target channel with the highest current priority is selected, and the priorities of each channel are sorted and filtered. Simultaneously, the frame synchronization signal status of each channel is used for auxiliary determination to ensure that the selected target channel is in a normal data transmission ready state, avoiding the selection of channels with transmission anomalies. After determining the target channel with the highest current priority, a switching command is generated. Specifically, a corresponding switching command is generated based on the channel number of the target channel. This embodiment of the invention, through the above process, accurately determines the target channel with the highest current priority and generates a targeted switching command, providing a clear execution basis for subsequent channel output enable control and data transmission switching, ensuring the orderliness and accuracy of the switching operation.
[0024] S300: Based on the switching command, open the target channel, transmit data through the target channel, and close the other channels.
[0025] In this embodiment of the invention, the target channel is activated according to the switching command. At this time, the output driving circuit of the target channel is activated, enabling data transmission through the target channel. Conversely, all other channels are deactivated according to the switching command. The output driving circuits of the remaining channels are disabled, and their outputs enter a logic blocking state, ensuring that their data does not interfere with the data transmission of the target channel. If a new switching command is received during data transmission in the target channel, the channel output state will be reconfigured according to the new switching command after the current frame transmission is completed, achieving smooth and conflict-free channel switching. This embodiment of the invention selects the target channel and blocks non-target channels according to the switching command, ensuring that only one channel's data is effectively transmitted at any given time. This achieves precise control over multi-channel data output, effectively avoiding signal conflicts and resource contention between channels while ensuring data transmission integrity.
[0026] S400: Processes the channel data output from the target channel in frames and monitors the transmission progress of the current frame data according to the frame synchronization signal of the target channel.
[0027] In this embodiment of the invention, after the target channel is opened and data is transmitted through the target channel, the channel data output from the target channel is processed frame by frame according to preset image processing operations to ensure the integrity and processing effect of each frame of data. The processing may include, but is not limited to: image signal processing (ISP), such as denoising, color correction, automatic white balance, etc.; image format conversion, scaling, or cropping; data compression or encoding; feature extraction or computer vision analysis, etc. Simultaneously with image processing, the frame synchronization signal corresponding to the target channel is retrieved. By continuously monitoring the frame start flag and frame end flag in the signal, the transmission progress of the current frame data is accurately tracked. When the frame end flag in the frame synchronization signal is detected, the current frame data transmission is complete. In this embodiment of the invention, the monitoring process and data processing are executed in parallel, which does not affect the efficiency of image processing and can obtain the status information of data transmission in real time, avoiding content errors caused by cross-frame processing and providing a precise timing trigger basis for subsequent channel switching.
[0028] S500: When the current frame data transmission is completed, the next highest priority target channel is determined according to the switching parameters, and a switching instruction corresponding to the next highest priority target channel is generated to continue processing the channel data.
[0029] In this embodiment of the invention, when the frame end flag of the frame synchronization signal is detected, it is determined that the current frame data has been transmitted successfully and the corresponding image processing operation has been completed synchronously. At this time, the pre-stored switching parameters or the reset switching parameters are retrieved again, and the next highest priority target channel is determined according to the switching parameters. Then, a switching instruction corresponding to the target channel is generated. After the switching instruction is generated, the aforementioned steps S200-S400 are repeated to achieve time-division cyclic transmission and processing of multi-channel MIPI data. This embodiment of the invention, through the switching mechanism triggered by the frame synchronization signal, ensures that the data of each channel is switched only after its frame transmission is completely completed, thereby avoiding data loss or interleaving while supporting reliable, efficient, and orderly processing of multi-channel image streams.
[0030] In some embodiments, please refer to the reference Figure 2 , Figure 2 This is a flowchart illustrating step S200 provided in an embodiment of the present invention. Step S200 in the aforementioned embodiment, which determines the target channel with the highest current priority based on preset switching parameters and generates a switching instruction corresponding to the target channel with the highest current priority, includes the following steps: S210: Configure corresponding switching parameters for multiple channels. The switching parameters include the number of channels to be switched and the switching order.
[0031] In this embodiment of the invention, the switching parameters are configuration information used to guide the switching of multi-channel data, including the number of switching channels and the switching order. The switching channel refers to the number of valid channels currently participating in the polling switching, with a value range greater than or equal to 2 and less than or equal to the maximum supported number of channels N. This parameter determines the size of the actual set of channels participating in the switching logic; channels not included in the valid set will be excluded from the switching process. For example, when the total number of channels is 8 and the number of switching channels is set to 4, only the 4 channels specified in the switching order participate in the subsequent switching process, while the remaining 4 channels remain closed. The switching order refers to the priority sequence in which valid channels are selected as "target channels" in turn. It is defined in the form of an ordered list, and this sequence supports arbitrary custom arrangements. It can be flexibly set according to application scenarios (such as screen importance, bandwidth requirements, etc.), and the sequence length is consistent with the number of switching channels. For example, the sequence [3,1,0,2] indicates that channel 3 is selected first, then channel 1, then channel 0, and finally channel 2, then the cycle returns to channel 3. In this embodiment of the invention, both the number of switching channels and the switching order can be flexibly configured according to actual data processing needs.
[0032] S220: Based on the switching parameters and the frame synchronization signal, determine the channel with the highest current priority and generate the corresponding switching command.
[0033] The set of channels participating in this switch is determined based on the number of switching channels, excluding channels not included in the switch scope. Subsequently, the filtered channel set is prioritized according to the switch order, establishing a channel priority queue. The channel at the head of the queue is the highest priority channel in the initial state. The frame synchronization signal corresponding to each channel is monitored in real time. This signal includes a frame start flag and a frame end flag, used to characterize the data transmission progress of the corresponding channel. When determining the current highest priority channel, a status check is performed based on the frame synchronization signal. If it is the first time initial channel selection is initiated, the channel at the head of the priority queue is directly selected as the current target channel, while simultaneously verifying whether the frame synchronization signal of that channel is in a ready-to-transmit state to ensure the channel has the conditions for data transmission. If it is a channel switch after the current frame data transmission is completed, and the frame end flag of the current channel's frame synchronization signal is detected, the next-ranked channel is selected from the priority queue as the new target channel, while simultaneously verifying whether the frame synchronization signal of the new target channel is normal to avoid data loss due to channel transmission anomalies. After determining the target channel with the highest priority, the generation and output of the switching command are based on the channel number of that channel. The switching command is a standardized control signal. During the transmission of the switching command, a verification mechanism can be used to ensure that the command is free of errors and loss, thus ensuring the accuracy of the channel switching operation.
[0034] In some embodiments, step S300 in the foregoing embodiments, which involves opening the target channel, transmitting data through the target channel, and closing the remaining channels according to the switching instruction, includes: Obtain the corresponding binary enable signal from the switching instruction, and control the start and stop of data transmission of the corresponding channel according to the binary enable signal; When the value of the corresponding bit of the binary enable signal is 1, the corresponding channel is turned on, and data is output through the channel; When the value of the corresponding bit of the binary enable signal is 0, the corresponding channel is closed, and the channel is prohibited from outputting data.
[0035] In this embodiment of the invention, the corresponding binary enable signal is first obtained from the switching instruction. This switching instruction contains the identification information of the target channel and directly maps the target channel number using binary encoding. The number of bits in the binary enable signal is consistent with the total number of MIPI channels, with each bit corresponding to the output enable control of one channel. Based on the state of each bit of the binary enable signal, the data transmission of the corresponding channel is independently controlled to be enabled or disabled. When a bit in the binary enable signal is logic "1", it indicates that the channel corresponding to that bit is selected, and the corresponding channel is enabled for data output. When a bit in the binary enable signal is logic "0", it indicates that the channel corresponding to that bit is not selected, and the corresponding channel is disabled, prohibiting data output. For example, as shown in Table 1, Table 1 shows the time-division multiplexing selection status of four MIPI channels.
[0036] Table 1 In the gating status table shown above, each row represents the gating status of each channel under different switching commands, where "1" indicates that the channel is selected, and "0" indicates that the channel is not selected. The table is explained in detail below: When the switching command specifies the target channel as "channel 0", channel 0 is selected (value 1), and channels 1, 2, and 3 are all closed (value 0), resulting in a binary enable signal of 0001; When the switching command specifies the target channel as "Channel 1", Channel 1 is enabled (value is 1), and Channels 0, 2, and 3 are all disabled (value is 0), resulting in a binary enable signal of 0010. When the switching command specifies the target channel as "Channel 2", Channel 2 is selected (value 1), and Channels 0, 1, and 3 are all closed (value 0), resulting in a binary enable signal of 0100. When the switching instruction specifies the target channel as "Channel 3", Channel 3 is enabled (value 1), and Channels 0, 1, and 2 are all disabled (value 0), resulting in a binary enable signal of 1000.
[0037] In some embodiments, at any given time, only the target channel with the highest priority has a binary enable signal bit set to 1, while the other channels have binary enable signal bits set to 0. Only one bit in the binary enable signal is set to logic "1", ensuring that only one channel is in data output state at any given time, while the other channels are in output-inhibited state. This achieves mutual exclusion gating and orderly switching between multiple channels.
[0038] In some embodiments, before determining the next highest priority target channel based on the switching parameters after the current frame data transmission is detected to be complete, the following steps are included: Detect whether a reset instruction for the switching parameters has been received: If no reset instruction for the switching parameters has been received, determine the next highest priority target channel based on the switching order in the switching parameters, generate the corresponding switching instruction, and continue processing the channel data; If a reset instruction for the switching parameters has been received, obtain the reset switching parameters, determine the set of channels participating in the switching based on the number of switching channels in the reset switching parameters, determine the next highest priority target channel from the set of channels according to the switching order in the reset switching parameters, generate the corresponding switching instruction, and continue processing the channel data.
[0039] In this embodiment of the invention, when a frame end marker is detected in the frame synchronization signal of the currently outputting channel, it is determined that the channel has completed the transmission of a complete frame. After the current frame transmission is completed, a channel switching update operation is triggered to ensure that parameter changes do not interrupt the current frame's data transmission, avoiding data loss or corruption. The next highest priority target channel is determined based on the switching parameters. First, it is checked whether a reset instruction for the switching parameters has been received. If no reset instruction is received, the current number of switching channels and the switching order remain unchanged. The next highest priority target channel is selected from the switching order of the original channel set. After the switch is completed, the frame synchronization signal monitoring and subsequent channel switching process continue according to the original switching parameters. When a reset instruction for the switching parameters is received, the reset switching parameters are first obtained and jointly verified: on the one hand, it is verified whether the new number of switching channels is within the maximum number of channels; on the other hand, it is verified that all channel numbers in the new switching order are included within the channel range defined by the new number of switching channels, excluding invalid channel numbers. After the verification passes, the reset number of switching channels and the reset switching order are temporarily stored in the buffer area. The set of channels participating in the handover is redefined based on the number of channels in the reset handover parameters. Then, all channels in the reset channel set are prioritized according to the handover order in the reset handover parameters. The next highest priority target channel is determined from the reset channel set, and the corresponding handover command is generated to continue processing the channel data. The selection rule is as follows: if the original target channel is still in the reset channel set and is defined in the new order, its subsequent channel is selected according to the reset handover order. If the original target channel is not in the reset channel set or is not defined in the reset handover order, the first channel defined in the reset handover order is directly selected as the next target channel. Subsequently, the corresponding handover command is generated according to the channel number of the new target channel and the handover is executed. After the handover is completed, the frame synchronization signal monitoring and subsequent channel handover process continues according to the reset number of channels and handover order.
[0040] This invention, through its multi-channel dynamic switching transmission design, enables a single image processing module to process multiple parallel MIPI input data without the need for additional memory caching. This completely avoids the problem of traditional caching schemes consuming large amounts of system storage resources due to data caching, effectively freeing up memory space and improving the overall system operating efficiency. It also avoids the hardware cost increase caused by adding extra circuit logic, significantly reducing production costs. Furthermore, it utilizes frame synchronization signals to precisely control the timing of multiple channel switching, performing switching only after the current frame data transmission is complete, ensuring the integrity of each frame's data transmission and effectively preventing data loss or corruption. Simultaneously, priority configuration supports flexible switching strategies, adapting to diverse application scenarios and achieving efficient and orderly transmission of multi-channel data.
[0041] Please refer to the following: Figure 3 , Figure 3 The flowchart provided here is an example of MIPI multi-channel switching control provided in the embodiments of the present invention. For ease of explanation, only the parts related to the embodiments of the present invention are shown.
[0042] In this embodiment, taking the data processing when no reset instruction for switching parameters is received as an example, the control logic when no reset instruction for switching parameters is received is described in detail: First, the system receives MIPI multi-channel composite data from four cameras, separates the composite data into independent channel 0, channel 1, channel 2, and channel 3, and simultaneously acquires the frame synchronization signal (including the frame end marker) for each channel. The first switching parameter is set to [3,1], indicating that only channel 1 and channel 3 data need to be processed, and data output follows the channel switching order of 3-1. This switching parameter configuration remains unchanged, providing a fixed basis for subsequent channel switching. Based on the preset switching parameter [3,1], the highest priority target channel is selected as channel 3, and a switching command to channel 3 is generated. The corresponding 4-bit binary enable signal 1000 is obtained from the switching command (only the signal bit corresponding to channel 3 is 1, and the rest are 0). Channel 3 is enabled based on the binary enable signal 1000, and data is output through channel 3. Preset image processing operations such as noise reduction and format conversion are performed on the channel data output by channel 3 frame by frame. Simultaneously, channels 0, 1, and 2 are disabled, prohibiting data output from channels 0, 1, and 2. At this point, the frame synchronization signal of channel 3 is continuously monitored. When the frame end marker in the frame synchronization signal is detected, it is determined that channel 3 has completed the transmission and processing of a complete frame of data, satisfying the timing conditions for channel switching. Based on the fixed switching sequence 3-1, channel 1 is selected as the next highest priority candidate channel, and a switching instruction to channel 1 is generated. The corresponding 4-bit binary enable signal 0010 is obtained from this switching instruction (only the signal bit corresponding to channel 1 is 1, and the rest are 0). According to the binary enable signal 0010, the corresponding channel 1 is turned on, and data is output through channel 1. Pre-set image processing operations such as noise reduction and format conversion are performed on the channel data output by channel 1 frame by frame. At the same time, channels 0, 2, and 3 are turned off, and data output by channels 0, 2, and 3 is prohibited. At this point, the frame synchronization signal of channel 1 is continuously monitored. When the frame end marker in the frame synchronization signal is detected, it is determined that channel 1 has completed the transmission and processing of a complete frame of data, satisfying the timing conditions for channel switching. Based on the fixed switching sequence 3-1, channel 3 is again determined to be the next highest priority channel. The instruction to switch to channel 3 is repeatedly generated, channel 3 is reopened for data output, and other channels are closed. Subsequently, the process of processing data output from channel 3, generating a switching instruction triggered by the end-of-frame signal, switching to channel 1, processing data output from channel 1, and triggering another switching instruction by the end-of-frame signal constitutes a cycle. This process is continuously executed to achieve time-division and ordered processing of data from channel 1 and channel 3 in the four-channel composite data.
[0043] Please refer to the following: Figure 4 , Figure 4 This is another flowchart example of MIPI multi-channel switching control provided by an embodiment of the present invention. For ease of explanation, only the parts related to the embodiment of the present invention are shown.
[0044] In this embodiment, taking the data processing when a reset instruction for switching parameters is received as an example, the control logic when a reset instruction for switching parameters is received is described in detail: First, it receives MIPI multi-channel composite data from eight cameras, separates the composite data into independent channels 0, 1, 2, 3, 4, 5, 6, and 7, and simultaneously acquires the frame synchronization signal (including the frame end marker) for each channel. The first switching parameter is set to [5,2,7,0,4], indicating that only data from channels 0, 2, 4, 5, and 7 needs to be processed, and data is output according to the channel switching order of 5-2-7-0-4. According to the preset switching parameters [5,2,7,0,4], the first target channel with the highest priority is selected as channel 5, and a switching instruction to switch to channel 5 is generated. The corresponding 8-bit binary enable signal 00100000 is obtained from the switching instruction (only the 5th bit corresponding to channel 5 is 1, and the rest are 0). Channel 5 is enabled according to the binary enable signal 00100000, and data is output through channel 5. Preset image processing operations such as noise reduction and format conversion are performed on the channel data output by channel 5 frame by frame. At the same time, channels 0, 2, 4, 5 and 7 are closed, and data output by channels 0, 2, 4, 5 and 7 is prohibited. At this time, the frame synchronization signal of channel 5 is continuously monitored. When the frame end mark in the frame synchronization signal is detected, it is determined that channel 5 has completed the transmission and processing of a complete frame of data, and the timing conditions for channel switching are met. Based on the switching sequence 5-2-7-0-4, channel 2 is determined to be the next highest priority candidate channel, and a switching instruction to channel 2 is generated. The corresponding 8-bit binary enable signal 00000100 is obtained from this instruction (only the signal bit corresponding to channel 2 is 1, and the rest are 0). Channel 2 is then enabled based on the binary enable signal 00000100, and data is output through channel 2. Pre-defined image processing operations such as noise reduction and format conversion are performed on the channel data output from channel 2 frame by frame. Simultaneously, channels 0, 4, 5, and 7 are disabled, preventing data output from these channels. The frame synchronization signal of channel 2 is continuously monitored. When a frame end marker is detected in the frame synchronization signal, it is determined that channel 2 has completed the transmission and processing of a complete frame of data, satisfying the timing conditions for channel switching.
[0045] At this point, a reset command for the switching parameters is received. The reset switching parameters are [1,2,3,4], indicating that only data from channels 1, 2, 3, and 4 need to be processed, and data output should be performed according to the channel switching order 1-2-3-4. Based on the reset switching order 1-2-3-4, the next highest priority target channel after channel 2 is determined to be channel 3, and a switching command to switch to channel 3 is generated. The corresponding 8-bit binary enable signal 00001000 is obtained from this switching command (only the signal bit corresponding to channel 3 is 1, and the rest are 0). According to the binary enable signal 00001000, the corresponding channel 3 is enabled, and data is output through channel 3. Pre-set image processing operations such as noise reduction and format conversion are performed on the channel data output by channel 3 frame by frame. At the same time, channels 1, 2, 3, and 7 are closed, and data output from channels 1, 2, and 3 is prohibited. Continue monitoring the frame synchronization signal of channel 3. When the frame end flag in the frame synchronization signal is detected, it is determined that channel 3 has completed the transmission and processing of a complete frame of data, and the timing conditions for channel switching are met.
[0046] At this point, a reset command for the switching parameters is received again. The reset switching parameters are [7,2,4], indicating that only data from channels 2, 4, and 7 need to be processed, and data output should be performed according to the channel switching order of 7-2-4. Based on the reset switching order 7-2-4, channel 7 is determined to be the next highest priority target channel after channel 3, and a switching command to switch to channel 7 is generated. The corresponding 8-bit binary enable signal 10000000 is obtained from this switching command (only the signal bit corresponding to channel 7 is 1, and the rest are 0). Channel 7 is enabled according to the binary enable signal 10000000, and data is output through channel 7. Pre-set image processing operations such as noise reduction and format conversion are performed on the channel data output by channel 7 frame by frame. At the same time, channels 2 and 4 are closed, and data output by channels 2 and 4 is prohibited. The frame synchronization signal of channel 7 is monitored. When the frame end flag in the frame synchronization signal is detected, it is determined that channel 7 has completed the transmission and processing of a complete frame of data, and the timing conditions for channel switching are met. After the switching parameters are configured, [7,2,4] remain unchanged. Based on the switching order 7-2-4, the next highest priority channel is determined to be channel 2 and channel 4. Thereafter, the process of processing the data output of channel 7, generating the switching instruction triggered by the frame end signal, switching to channel 2, processing the data output of channel 2, generating the switching instruction triggered by the frame end signal, switching to channel 4, processing the data output of channel 4, and triggering the switching of the frame end signal is repeated as a cycle. The above process is continuously executed to realize the time-division and cyclic processing of the three channels of data in channel 2, channel 4 and channel 7 in the 8-channel MIPI composite data.
[0047] Please refer to the reference. Figure 5 , Figure 5 This is a schematic diagram of the structure of a MIPI multi-channel switching device provided in an embodiment of the present invention. The present invention provides a MIPI multi-channel switching device, which includes a parsing module 100, an instruction generation module 200, a gating module 300, and a processing module 400, wherein: The parsing module 100 is used to receive MIPI multi-channel composite data input from the camera, parse the multi-channel composite data into independent multiple channel data, and obtain the frame synchronization signal of each channel; The instruction generation module 200 is used to determine the target channel with the highest current priority based on preset switching parameters, and generate a switching instruction corresponding to the target channel with the highest current priority. The gating module 300 is used to open the target channel according to the switching instruction, perform data transmission through the target channel, and close the other channels; The processing module 400 is used to process the channel data output by the target channel frame by frame, and monitor the transmission progress of the current frame data according to the frame synchronization signal of the target channel. When the current frame data transmission is completed, the instruction generation module further determines the next highest priority target channel based on the switching parameters, and generates a switching instruction corresponding to the next highest priority target channel to continue processing the channel data.
[0048] The MIPI multi-channel switching device in this embodiment of the invention achieves flexible, complete, and orderly sequential processing of multiple MIPI input data without adding extra memory cache or extra parallel processing hardware through the coordinated linkage of the parsing module, instruction generation module, gating module, and processing module.
[0049] In some embodiments, the instruction generation module 200 includes: The parameter configuration unit is used to configure corresponding switching parameters for multiple channels. The switching parameters include the number of channels to be switched and the switching order. The instruction generation subunit is used to determine the channel with the highest current priority based on the switching parameters and frame synchronization signal, and generate the corresponding switching instruction.
[0050] In some embodiments, the gating module 300 includes: The signal acquisition unit obtains the corresponding binary enable signal from the switching instruction. The channel control unit controls the opening and closing of data transmission for the corresponding channel based on the binary enable signal; Specifically, when the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 1, the channel switch control unit opens the corresponding channel and outputs data through the channel; When the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 0, the channel switch control unit closes the corresponding channel and prohibits the channel from outputting data.
[0051] In this embodiment of the invention, for the sake of convenience and brevity, only the division of the above-described functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to achieve all or part of the functions described above. Each unit and module of the device can be implemented by corresponding hardware or software units. Each unit and module can be an independent hardware or software unit, or it can be integrated into a single hardware or software unit, which is not intended to limit the invention. In addition, the specific names of each functional unit and module are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the device can be referred to the corresponding description in the foregoing method embodiments, and will not be repeated here.
[0052] In this embodiment of the invention, an electronic device 5 is provided, which includes a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, it implements the steps described in the various method embodiments above, for example... Figure 1 The steps S100 to S500 are shown. Alternatively, when the processor 50 executes the computer program 52, it implements the functions of each unit in the above-described device embodiments, for example... Figure 5 The functions of the parsing module 100 to the processing module 400 are shown.
[0053] In this embodiment of the invention, MIPI multi-channel composite data input from a camera is received, the multi-channel composite data is parsed into multiple independent channel data, and the frame synchronization signal of each channel is obtained; the target channel with the highest priority is determined according to preset switching parameters, and a switching instruction corresponding to the target channel with the highest priority is generated; according to the switching instruction, the target channel is opened, data is transmitted through the target channel, and the other channels are closed; the channel data output by the target channel is processed frame by frame, and the transmission progress of the current frame data is monitored according to the frame synchronization signal of the target channel; when the current frame data transmission is detected to be completed, the next target channel with the highest priority is determined according to the switching parameters, and a switching instruction corresponding to the next target channel with the highest priority is generated to continue processing the channel data.
[0054] The electronic device in this embodiment of the invention can be a mobile terminal device or an Internet of Things (IoT) device. Specifically, it can be a mobile phone, a laptop computer, a security monitoring camera, etc. The steps implemented by the processor 50 in this electronic device when executing the computer program 52 to implement the above-described MIPI multi-channel switching method can be referred to the description of the foregoing method embodiments, and will not be repeated here.
[0055] In this embodiment of the invention, a computer-readable storage medium is provided, which stores a computer program. When executed by a processor, the computer program implements the steps in the above-described MIPI multi-channel switching method embodiments, for example... Figure 1 The steps S100 to S500 are shown. Alternatively, when the computer program is executed by the processor, it implements the functions of each unit in the above-described device embodiments, for example... Figure 5 The functions of the parsing module 100 to the processing module 400 are shown.
[0056] In this embodiment of the invention, MIPI multi-channel composite data input from a camera is received, the multi-channel composite data is parsed into multiple independent channel data, and the frame synchronization signal of each channel is obtained; the target channel with the highest priority is determined according to preset switching parameters, and a switching instruction corresponding to the target channel with the highest priority is generated; according to the switching instruction, the target channel is opened, data is transmitted through the target channel, and the other channels are closed; the channel data output by the target channel is processed frame by frame, and the transmission progress of the current frame data is monitored according to the frame synchronization signal of the target channel; when the current frame data transmission is detected to be completed, the next target channel with the highest priority is determined according to the switching parameters, and a switching instruction corresponding to the next target channel with the highest priority is generated to continue processing the channel data.
[0057] The computer-readable storage medium of this invention can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EEPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0058] The above embodiments are merely illustrative of the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the scope of disclosure involved in the above embodiments is not limited to technical solutions formed by specific combinations of the above technical features, but should also cover other technical solutions formed by arbitrary combinations of the above technical features or their equivalent features without departing from the above-disclosed concept. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0059] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
Claims
1. A MIPI multi-channel switching method, characterized in that, The method includes the following steps: Receive MIPI multi-channel composite data input from the camera, parse the multi-channel composite data into multiple independent channel data, and obtain the frame synchronization signal of each channel; The highest priority target channel is determined based on preset switching parameters, and a switching instruction corresponding to the highest priority target channel is generated. According to the switching instruction, the target channel is opened, data is transmitted through the target channel, and the other channels are closed; The channel data output from the target channel is processed frame by frame, and the transmission progress of the current frame data is monitored according to the frame synchronization signal of the target channel. Once the current frame data transmission is completed, the next highest priority target channel is determined based on the switching parameters, and a switching instruction corresponding to the next highest priority target channel is generated to continue processing the channel data.
2. The method as described in claim 1, characterized in that, The steps of determining the target channel with the highest current priority based on preset switching parameters and generating a switching instruction corresponding to the target channel with the highest current priority include: Configure corresponding switching parameters for the multiple channels, the switching parameters including the number of channels to be switched and the switching order; Based on the switching parameters and the frame synchronization signal, the channel with the highest current priority is determined, and a corresponding switching instruction is generated.
3. The method as described in claim 1, characterized in that, The steps of opening the target channel according to the switching instruction, transmitting data through the target channel, and closing the remaining channels include: Obtain the corresponding binary enable signal from the switching instruction, and control the opening and closing of data transmission of the corresponding channel according to the binary enable signal; When the value of the corresponding bit of the binary enable signal is 1, the corresponding channel is turned on, and data is output through the channel; When the value of the corresponding bit of the binary enable signal is 0, the corresponding channel is closed, and the channel is prohibited from outputting data.
4. The method as described in claim 3, characterized in that, At any given moment, among all channels, only the binary enable signal of the highest priority target channel has a value of 1 for the corresponding bit, while the binary enable signal of the other channels has a value of 0 for the corresponding bit.
5. The method as described in claim 1, characterized in that, Before determining the next highest priority target channel based on the switching parameters after the current frame data transmission is detected to be complete, the process includes: Check if a reset command for the switching parameters has been received: When no reset instruction for the switching parameters is received, the next highest priority target channel is determined based on the switching order in the switching parameters, a corresponding switching instruction is generated, and channel data processing continues. When a reset command for the switching parameters is received, the reset switching parameters are obtained, the set of channels to participate in the switching is determined based on the number of switching channels in the reset switching parameters, the next highest priority target channel is determined from the set of channels according to the switching order in the reset switching parameters, the corresponding switching command is generated, and the channel data processing continues.
6. A MIPI multi-channel switching device, characterized in that, The device includes: The parsing module is used to receive MIPI multi-channel composite data input from the camera, parse the multi-channel composite data into independent multiple channel data, and obtain the frame synchronization signal of each channel; The instruction generation module is used to determine the target channel with the highest current priority based on preset switching parameters, and generate a switching instruction corresponding to the target channel with the highest current priority. The gating module is used to open the target channel according to the switching instruction, perform data transmission through the target channel, and close the other channels; The processing module is used to process the channel data output by the target channel frame by frame, and monitor the transmission progress of the current frame data according to the frame synchronization signal of the target channel. When the current frame data transmission is completed, the instruction generation module further determines the next highest priority target channel based on the switching parameters, and generates a switching instruction corresponding to the next highest priority target channel to continue processing the channel data.
7. The apparatus as claimed in claim 6, characterized in that, The instruction generation module includes: A parameter configuration unit is used to configure corresponding switching parameters for the plurality of channels, wherein the switching parameters include the number of channels to be switched and the switching order; The instruction generation subunit is used to determine the channel with the highest current priority based on the switching parameters and the frame synchronization signal, and generate the corresponding switching instruction.
8. The apparatus as claimed in claim 6, characterized in that, The gating module includes: The signal acquisition unit acquires the corresponding binary enable signal from the switching instruction. The channel control unit controls the opening and closing of data transmission for the corresponding channel according to the binary enable signal; Specifically, when the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 1, the channel switch control unit opens the corresponding channel and outputs data through the channel; When the value of the corresponding bit of the binary enable signal acquired by the enable signal acquisition unit is 0, the channel switch control unit closes the corresponding channel and prohibits the channel from outputting data.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 5.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.