Initialization method and device of vehicle-mounted camera, storage medium and electronic device
By acquiring and assigning the business framework information of the vehicle camera, an initialization method for the vehicle camera was implemented, which solved the problem of low initialization efficiency caused by hardware coupling in the camera system and improved configuration flexibility and initialization efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING CHANGAN TECH CO LTD
- Filing Date
- 2023-09-27
- Publication Date
- 2026-05-29
AI Technical Summary
In vehicle camera systems, the involvement of serializers and deserializers increases the difficulty of image output from the camera path, and the coupling between various modules leads to low efficiency in initial setup.
By acquiring the business framework information of the image sensor, serializer, and deserializer, the initialization method is abstracted and modularized. The hardware model is parsed and the callback dataset of the calling interface is assigned to achieve hardware initialization.
It decouples hardware components, improves initialization efficiency, makes configuration more flexible, and allows non-professional users to perform initialization easily and quickly.
Smart Images

Figure CN119729237B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle-mounted cameras, and more specifically, to an initialization method and apparatus, storage medium, and electronic device for a vehicle-mounted camera. Background Technology
[0002] In related technologies, in automotive camera systems, the distances from each camera to the vehicle's system-on-a-chip (SoC) are varying and long. Therefore, conventional wiring and camera connection methods, as seen in products like mobile phones, cannot be used. This necessitates the intervention of serializers and deserializers. The serializer and deserializer are connected via a physical GMSL (Gigabit Multimedia Serial Link) line. Sensor image data is converted into GMSL signals by the serializer. After receiving the GMSL signal, the deserializer converts it back into raw sensor data and transmits it to the SoC. Due to the advantages of GMSL technology, such as high speed, long distance, and strong anti-interference capabilities, the sensor and serializer are treated as one component, and the deserializer and SoC as another, connected by a physical GMSL line. This enables long-distance transmission of sensor data to the SoC.
[0003] Because of the addition of serializers and deserializers, in addition to the original sensor settings, the serializers and deserializers also need to be configured, which increases the difficulty of image output on the camera path. Furthermore, the settings of the sensor, serializer, and deserializer are somewhat coupled, which can cause the settings of each module to affect each other. If a deserializer is connected to different serializers, the settings of the deserializer will also differ to some extent.
[0004] No efficient and accurate solution has yet been found to address the aforementioned issues in the relevant technologies. Summary of the Invention
[0005] This invention provides an initialization method and apparatus for a vehicle-mounted camera, a storage medium, and an electronic device to solve technical problems in related technologies.
[0006] According to an embodiment of the present invention, an initialization method for an in-vehicle camera is provided, comprising: detecting an initialization command for an in-vehicle camera targeting a target vehicle, wherein the in-vehicle camera includes an image sensor, a serializer, and a deserializer; acquiring first service framework information of the image sensor, second service framework information of the serializer, and third service framework information of the deserializer; and assigning values to a callback dataset of the in-vehicle camera's calling interface according to the first service framework information, the second service framework information, and the third service framework information to complete the hardware initialization of the in-vehicle camera.
[0007] Optionally, obtaining the first service framework information of the image sensor includes obtaining the following service settings of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linearity, trigger image output, current on, current off, and reset.
[0008] Optionally, obtaining the second service framework information of the serializer includes obtaining the following first service settings of the serializer: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, general purpose input / output (GPIO), and reset.
[0009] Optionally, obtaining the second service framework information of the serializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second service settings of the serializer: mode, lane mapping, channel pipe mapping for port data, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, GPIO, reset, address change of the serializer's two-wire serial bus I2C slave device, mapping relationship of the corresponding image sensor's I2C slave device address, and correspondence between the serializer's GPIO pins and the image sensor's fsync pin.
[0010] Optionally, obtaining the third service framework information of the deserializer includes obtaining the following first service settings of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, and reset.
[0011] Optionally, obtaining the third service framework information of the deserializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, obtaining the following second service settings of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0012] Optionally, assigning values to the callback dataset of the vehicle-mounted camera's calling interface based on the first business framework information, the second business framework information, and the third business framework information includes: reading a first general data structure of the image sensor, reading a second general data structure of the serializer, and reading a third general data structure of the deserializer. The first general data structure includes multiple first members, each corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each corresponding to a dataset implementing the third business framework information. The process also involves parsing the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; searching for a first dataset matching the first hardware model in the first general data structure, a second dataset matching the second hardware model in the second general data structure, and a third dataset matching the third hardware model in the third general data structure; and assigning values to the callback dataset of the vehicle-mounted camera's calling interface using the first dataset, the second dataset, and the third dataset.
[0013] Optionally, assigning values to the callback dataset of the vehicle camera's calling interface using the first dataset, the second dataset, and the third dataset includes: finding the first calling interface of the image sensor, finding the second calling interface of the serializer, and finding the third calling interface of the deserializer; assigning values to the callback dataset of the first calling interface using the first dataset, assigning values to the callback dataset of the second calling interface using the second dataset, and assigning values to the callback dataset of the third calling interface using the third dataset.
[0014] Optionally, after assigning values to the callback dataset of the invocation interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information, the method further includes: receiving the output instruction of the vehicle camera; invoking the callback dataset of the vehicle camera based on the output instruction; and using the callback dataset to control the vehicle camera to open the output flow.
[0015] According to another embodiment of the present invention, an initialization device for an in-vehicle camera is provided, comprising: a detection module for detecting an initialization command for an in-vehicle camera targeting a target vehicle, wherein the in-vehicle camera includes an image sensor, a serializer, and a deserializer; an acquisition module for acquiring first service framework information of the image sensor, second service framework information of the serializer, and third service framework information of the deserializer; and an initialization module for assigning values to a callback dataset of the in-vehicle camera's calling interface according to the first service framework information, the second service framework information, and the third service framework information, thereby completing the hardware initialization of the in-vehicle camera.
[0016] Optionally, the acquisition module includes: a first acquisition unit, used to acquire the following service settings of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linearity, trigger image output, current on, current off, and reset.
[0017] Optionally, the acquisition module includes a second acquisition unit, used to acquire the following first service settings of the serializer: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, general purpose input / output (GPIO), and reset.
[0018] Optionally, the acquisition module includes: a first parsing unit, used to parse the number of image sensor channels of the target vehicle; and a third acquisition unit, used to acquire the following second service settings of the serializer if the number of image sensor channels is multiple: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, GPIO, reset, serializer two-wire serial bus I2C slave device address change, mapping relationship of corresponding image sensor I2C slave device address, and correspondence between serializer GPIO pins and image sensor fsync pins.
[0019] Optionally, the acquisition module includes a fourth acquisition unit, used to acquire the following first service settings of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, and reset.
[0020] Optionally, the acquisition module includes: a second parsing unit, used to parse the number of image sensor channels of the target vehicle; and a fifth acquisition unit, used to acquire the following second service settings of the deserializer if the number of image sensor channels is multiple: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0021] Optionally, the initialization module includes: a reading unit, used to read a first general data structure of the image sensor, a second general data structure of the serializer, and a third general data structure of the deserializer, wherein the first general data structure includes multiple first members, each first member corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each second member corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each third member corresponding to a dataset implementing the third business framework information; a parsing unit, used to parse the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; a searching unit, used to search for a first dataset matching the first hardware model in the first general data structure, a second dataset matching the second hardware model in the second general data structure, and a third dataset matching the third hardware model in the third general data structure; and an assignment unit, used to assign values to the callback dataset of the vehicle camera's calling interface using the first dataset, the second dataset, and the third dataset.
[0022] Optionally, the assignment unit includes: a lookup subunit for looking up the first calling interface of the image sensor, the second calling interface of the serializer, and the third calling interface of the deserializer; and an assignment subunit for assigning a value to the callback dataset of the first calling interface using the first dataset, assigning a value to the callback dataset of the second calling interface using the second dataset, and assigning a value to the callback dataset of the third calling interface using the third dataset.
[0023] Optionally, the device further includes: a receiving module, configured to receive an image output instruction from the vehicle camera after the initialization module assigns values to the callback dataset of the calling interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information; a calling module, configured to call the callback dataset of the vehicle camera based on the image output instruction; and a control module, configured to control the vehicle camera to open the flow and output images using the callback dataset.
[0024] According to another aspect of the embodiments of this application, a storage medium is also provided, the storage medium including a stored program that executes the above steps when the program is run.
[0025] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the programs stored in the memory.
[0026] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the above-described method.
[0027] The beneficial effects of this invention are:
[0028] 1. It solves the configuration difficulty to a certain extent and eliminates the configuration coupling caused by combining different models of image sensors, serializers, and deserializers; when one hardware module changes model and needs to be reconfigured, there is no need to make adaptation settings for the other two hardware modules, and the configuration is highly flexible.
[0029] 2. When non-professional users initialize the vehicle camera, they do not need to configure the entire link from the image sensor through the serializer to the deserializer. They can directly use the business framework information of each hardware for adaptation, which is more convenient, faster and more efficient. Attached Figure Description
[0030] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0031] Figure 1 This is a hardware structure block diagram of a vehicle according to an embodiment of the present invention;
[0032] Figure 2 This is a flowchart of an initialization method for a vehicle-mounted camera according to an embodiment of the present invention;
[0033] Figure 3 This is a hardware schematic diagram of the vehicle-mounted camera in an embodiment of the present invention;
[0034] Figure 4 This is a business logic diagram of the vehicle-mounted camera in an embodiment of the present invention;
[0035] Figure 5 This is a structural block diagram of an initialization device for a vehicle-mounted camera according to an embodiment of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present application can be combined with each other.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] Example 1
[0039] The method embodiment provided in Embodiment 1 of this application can be executed in an automotive chip, vehicle, or similar processing device. Taking its operation in a vehicle as an example, Figure 1 This is a hardware structure block diagram of a vehicle according to an embodiment of the present invention. For example... Figure 1 As shown, a vehicle may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the vehicle may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the vehicle described above. For example, the vehicle may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0040] The memory 104 can be used to store vehicle programs, such as application software programs and modules, like the vehicle program corresponding to the vehicle camera initialization method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the vehicle program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the vehicle via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0041] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the vehicle's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0042] This embodiment provides an initialization method for an in-vehicle camera. Figure 2 This is a flowchart of an initialization method for an in-vehicle camera according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0043] Step S202: Detect the initialization command for the vehicle camera of the target vehicle, wherein the vehicle camera includes an image sensor, a serializer, and a deserializer.
[0044] In this embodiment, the image sensor and serializer are connected via CSI, the serializer and deserializer are connected via GMSL, and the deserializer and SoC (System-on-a-Chip) are connected via I2C and GPIO (General-purpose input / output). Figure 3This is a hardware schematic diagram of the vehicle-mounted camera in an embodiment of the present invention. The sensor and serializer are integrated on the camera module, and the deserializer is integrated on the board (circuit board) where the SoC is located.
[0045] Step S204: Obtain the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer;
[0046] Step S206: Assign values to the callback dataset of the vehicle camera's call interface based on the first business framework information, the second business framework information, and the third business framework information to complete the hardware initialization of the vehicle camera.
[0047] Through the above steps, the initialization instructions for the vehicle-mounted camera of the target car are detected. The vehicle-mounted camera includes an image sensor, a serializer, and a deserializer. First service framework information of the image sensor, second service framework information of the serializer, and third service framework information of the deserializer are obtained. Based on the first, second, and third service framework information, the callback dataset of the vehicle-mounted camera's calling interface is assigned values to complete the hardware initialization of the vehicle-mounted camera. By using the service framework information of each hardware component of the vehicle-mounted camera for initialization, multiple models of the same hardware can be adapted during initialization. This decouples the various hardware components in the vehicle-mounted camera, solving the technical problem of low initialization efficiency caused by high coupling of hardware components in related technologies, and improving the initialization efficiency of the vehicle-mounted camera.
[0048] Figure 4 This is the business logic diagram of the vehicle-mounted camera in this embodiment of the invention. The open-flow diagram of the vehicle-mounted camera has been abstracted and modularized. The data collected by the sensor passes through the serializer (data lines 0-n, lane mapping, controller 0-n, pipe mapping, channel mapping, channel 0-n, GMSL core) and deserializer (GMSL core, channel routing, channel 0-n, controller mapping, controller 0-n, line mapping, data lines 0-n) sequentially from the sensor to the chip. The business framework information (first business framework information, second business framework information, and third business framework information) in this embodiment refers to the business framework information between each of the above-described abstracted logical nodes and between two logical nodes.
[0049] In one embodiment of this example, obtaining the first service framework information of the image sensor includes obtaining the following service settings of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linearity, trigger image output, current on, current off, and reset.
[0050] In one example, for different sensor (image sensor) settings, the following business logic is abstracted: phase-locked loop frequency settings, frame frequency settings, data type settings, again settings, dgain settings, linear settings, trigger image output settings, current on settings, current off settings, and reset settings.
[0051] The configuration logic is consistent across different sensor models; the differences lie only in the specific registers (the registers used to store the dataset of the data structure). This allows for the abstraction and modularization of the business logic of different sensors. A sensor data structure is established, and based on the business logic defined above, members corresponding to the business settings are created within this data structure. Each member represents a specific dataset implementation.
[0052] In one embodiment of this example, obtaining the second service framework information of the serializer includes obtaining the following first service settings of the serializer: mode, lane mapping, channel pipe mapping for port data, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, general purpose input / output (GPIO), and reset.
[0053] The serializer settings can be divided according to the business requirements as follows: mode settings, lane mapping settings, port data mapping to video pipe settings, port enabling, video stream pipe enabling, video stream pipe sending, data format settings, virtual channel settings, GPIO settings, and reset settings.
[0054] In some scenarios, the image sensors connected to the serializer include multiple channels. Obtaining the second service framework information of the serializer includes: parsing the number of image sensors of the target vehicle; if the number of image sensors is multiple, obtaining the following second service settings of the serializer: mode, lane mapping, channel pipe mapping for port data, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, GPIO, reset, serializer I2C (Inter-Integrated Circuit, two-wire serial bus) slave device address change, mapping relationship of I2C slave device address of corresponding image sensor, and correspondence between the serializer's GPIO pins and the image sensor's fsync pin.
[0055] If multiple cameras are outputting images, to avoid overlapping I2C slave addresses between multiple cameras of the same model, the following settings are required: changing the serializer's I2C slave address and mapping the corresponding sensor's I2C slave address to different I2C slave addresses. Considering another issue with multiple cameras outputting images synchronously, the following settings are also required: using the serializer's GPIO pin as a receiver to pass signals from the deserializer's GPIO pin to the sensor's fsync pin.
[0056] The logical business processes of different serializer models remain consistent. Based on the business settings mentioned above, the business processes of different serializers can be abstracted and modularized. A serializer data structure is established, and members corresponding to the aforementioned business settings are created within this data structure, with each member representing a specific implementation dataset.
[0057] In one embodiment of this example, obtaining the third service framework information of the deserializer includes: obtaining the following first service settings of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phycopy, GPIO, and reset.
[0058] For the deserializer settings, the business logic is divided into the following: video stream pipe routing settings, port controller mapping settings, mode settings, lane mapping settings, settings for mapping video stream pipe data from src space to dest space, settings for mapping dest space to port controller, phy copy settings, GPIO settings, and reset settings.
[0059] In some scenarios, the image sensors connected to the serializer include multiple channels. The third service framework information of the deserializer includes: parsing the number of image sensor channels of the target vehicle; if the number of image sensor channels is multiple, the following second service settings of the deserializer are obtained: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0060] If multiple cameras are outputting images, the following settings are also required to ensure synchronized output between cameras: the deserializer's gpio pin is used as the transmitting end, and the serializer is mapped to the sensor's fsync pin.
[0061] The logic for setting up different deserializer models remains consistent. Based on the aforementioned logic, the business logic of different deserializers can be abstracted and modularized. A deserializer data structure is established, and members corresponding to the business settings are created within this data structure based on the abstraction of the business logic. Each member is a specific implementation dataset.
[0062] In one example of this embodiment, assigning values to the callback dataset of the vehicle camera's calling interface based on the first business framework information, the second business framework information, and the third business framework information includes: reading the first general data structure of the image sensor, reading the second general data structure of the serializer, and reading the third general data structure of the deserializer. The first general data structure includes multiple first members, each corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each corresponding to a dataset implementing the third business framework information. The process involves parsing the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; searching for a first dataset matching the first hardware model in the first general data structure, a second dataset matching the second hardware model in the second general data structure, and a third dataset matching the third hardware model in the third general data structure; and assigning values to the callback dataset of the vehicle camera's calling interface using the first, second, and third datasets.
[0063] Optionally, assigning values to the callback dataset of the vehicle camera's calling interface using the first dataset, the second dataset, and the third dataset includes: finding the first calling interface for the image sensor, finding the second calling interface for the serializer, and finding the third calling interface for the deserializer; assigning values to the callback dataset of the first calling interface using the first dataset, assigning values to the callback dataset of the second calling interface using the second dataset, and assigning values to the callback dataset of the third calling interface using the third dataset.
[0064] By establishing a configuration file parsing layer at the call layer, the configuration file records the models of the sensor, serializer, and deserializer to be used, thus achieving flexible and free combination of the sensor, serializer, and deserializer. After parsing the configuration file, the parsing layer obtains the model numbers of the sensor, serializer, and deserializer, respectively. Based on these model numbers, it finds the corresponding datasets in the data structures and assigns the sensor, serializer, and deserializer data structures to the call interfaces, that is, assigns values to the members (callback datasets) of the sensor call interface, serializer call interface, and deserializer call interface.
[0065] In this embodiment, after assigning values to the callback dataset of the vehicle camera's calling interface based on the first business framework information, the second business framework information, and the third business framework information, the method further includes: receiving the image output instruction from the vehicle camera; calling the callback dataset of the vehicle camera based on the image output instruction; and using the callback dataset to control the vehicle camera to open the flow and output the image.
[0066] When the upper-layer application calls the camera to output images, it only needs to call the callback datasets in the sensor, serializer, and deserializer data structures according to the business logic of enabling, initializing, opening the stream to output images, closing the stream to stop outputting images, deinitializing, closing, and resetting. For example, the callback dataset in the sensor call interface is initially empty. Only when the parsing layer finds the corresponding business dataset for the model based on the device ID in the configuration file will the member (callback dataset) in the sensor call interface have specific content, and then the callback dataset in the sensor call interface can be called according to the business logic.
[0067] This embodiment abstracts and modularizes the configuration methods for sensors, serializers, and deserializers according to fixed business logic, providing a unified calling interface for different models of sensors, serializers, and deserializers. In this embodiment, only the configuration methods for different sensors, serializers, and deserializers need to be provided; the caller only needs to select these methods, which to some extent solves the configuration difficulty and eliminates the configuration coupling caused by combining different sensors, serializers, and deserializers. Even if the model of one hardware module changes, only the configuration method for that hardware module within this framework needs to be provided, and then it can be selected and used without needing to configure the other two hardware modules.
[0068] For example, in a successfully generated image combination where the sensor model, serializer model, and deserializer model are all fixed, if the deserializer model is changed, the previous method required re-matching the settings between the deserializer, serializer, and sensor. According to the solution in this embodiment, it is only necessary to abstract these settings of the deserializer according to the business logic under the framework, and the caller only needs to select the setting scheme provided by the new model of deserializer to complete the hardware initialization.
[0069] The solution in this embodiment extracts, abstracts, and modularizes the business logic. When encountering different models of sensors, serializers, and deserializers, this approach can be applied to implement the callback datasets for each component. This allows for efficient flow diagram creation without requiring configuration of the entire chain from the sensor through the serializer to the deserializer. During use, the appropriate callback function is selected based on the specific sensor, serializer, and deserializer models. This approach is also user-friendly for beginners debugging cameras. It reduces workload when replacing hardware modules, decreases the coupling between sensor, deserializer, and serializer settings, and allows callers to better understand the operation of these components, resulting in greater configuration flexibility and greater convenience.
[0070] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0071] Example 2
[0072] This embodiment also provides an initialization device for an in-vehicle camera, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0073] Figure 5This is a structural block diagram of an initialization device for a vehicle-mounted camera according to an embodiment of the present invention, such as... Figure 5 As shown, the device includes:
[0074] The detection module 50 is used to detect the initialization command of the vehicle camera for the target vehicle, wherein the vehicle camera includes an image sensor, a serializer, and a deserializer.
[0075] The acquisition module 52 is used to acquire the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer;
[0076] The initialization module 54 is used to assign values to the callback dataset of the calling interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information, so as to complete the hardware initialization of the vehicle camera.
[0077] Optionally, the acquisition module includes: a first acquisition unit, used to acquire the following service settings of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linearity, trigger image output, current on, current off, and reset.
[0078] Optionally, the acquisition module includes a second acquisition unit, used to acquire the following first service settings of the serializer: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, general purpose input / output (GPIO), and reset.
[0079] Optionally, the acquisition module includes: a first parsing unit, used to parse the number of image sensor channels of the target vehicle; and a third acquisition unit, used to acquire the following second service settings of the serializer if the number of image sensor channels is multiple: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, GPIO, reset, serializer two-wire serial bus I2C slave device address change, mapping relationship of corresponding image sensor I2C slave device address, and correspondence between serializer GPIO pins and image sensor fsync pins.
[0080] Optionally, the acquisition module includes a fourth acquisition unit, used to acquire the following first service settings of the serializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, and reset.
[0081] Optionally, the acquisition module includes: a second parsing unit, used to parse the number of image sensor channels of the target vehicle; and a fifth acquisition unit, used to acquire the following second service settings of the deserializer if the number of image sensor channels is multiple: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
[0082] Optionally, the initialization module includes: a reading unit, used to read a first general data structure of the image sensor, a second general data structure of the serializer, and a third general data structure of the deserializer, wherein the first general data structure includes multiple first members, each first member corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each second member corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each third member corresponding to a dataset implementing the third business framework information; a parsing unit, used to parse the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; a searching unit, used to search for a first dataset matching the first hardware model in the first general data structure, a second dataset matching the second hardware model in the second general data structure, and a third dataset matching the third hardware model in the third general data structure; and an assignment unit, used to assign values to the callback dataset of the vehicle camera's calling interface using the first dataset, the second dataset, and the third dataset.
[0083] Optionally, the assignment unit includes: a lookup subunit for looking up the first calling interface of the image sensor, the second calling interface of the serializer, and the third calling interface of the deserializer; and an assignment subunit for assigning a value to the callback dataset of the first calling interface using the first dataset, assigning a value to the callback dataset of the second calling interface using the second dataset, and assigning a value to the callback dataset of the third calling interface using the third dataset.
[0084] Optionally, the device further includes: a receiving module, configured to receive an image output instruction from the vehicle camera after the initialization module assigns values to the callback dataset of the calling interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information; a calling module, configured to call the callback dataset of the vehicle camera based on the image output instruction; and a control module, configured to control the vehicle camera to open the flow and output images using the callback dataset.
[0085] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0086] Example 3
[0087] Embodiments of the present invention also provide a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0088] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0089] S1, Detect initialization instructions for the vehicle-mounted camera of the target vehicle, wherein the vehicle-mounted camera includes an image sensor, a serializer, and a deserializer;
[0090] S2, obtain the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer;
[0091] S3, assign values to the callback dataset of the vehicle camera's calling interface according to the first business framework information, the second business framework information, and the third business framework information to complete the hardware initialization of the vehicle camera.
[0092] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0093] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0094] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0095] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0096] S1, Detect initialization instructions for the vehicle-mounted camera of the target vehicle, wherein the vehicle-mounted camera includes an image sensor, a serializer, and a deserializer;
[0097] S2, obtain the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer;
[0098] S3, assign values to the callback dataset of the vehicle camera's calling interface according to the first business framework information, the second business framework information, and the third business framework information to complete the hardware initialization of the vehicle camera.
[0099] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0100] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An initialization method for a vehicle-mounted camera, characterized in that, include: Detect initialization commands for the vehicle-mounted camera of the target vehicle, wherein the vehicle-mounted camera includes an image sensor, a serializer, and a deserializer; Obtain the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer; The callback dataset of the in-vehicle camera's calling interface is assigned values based on the first business framework information, the second business framework information, and the third business framework information to complete the hardware initialization of the in-vehicle camera. The process of assigning values to the callback dataset of the vehicle-mounted camera's calling interface based on the first, second, and third business framework information includes: reading the first general data structure of the image sensor, reading the second general data structure of the serializer, and reading the third general data structure of the deserializer. The first general data structure includes multiple first members, each corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each corresponding to a dataset implementing the third business framework information. The process also involves parsing the first hardware model of the image sensor, the second hardware model of the serializer, and the third hardware model of the deserializer; and searching for a match in the first general data structure. The system retrieves a first dataset matching a first hardware model, searches for a second dataset matching a second hardware model in a second general data structure, and searches for a third dataset matching a third hardware model in a third general data structure. It then assigns values to the callback dataset of the vehicle-mounted camera's calling interface using the first dataset, the second dataset, and the third dataset. This assignment includes: searching for the first calling interface of the image sensor, the second calling interface of the serializer, and the third calling interface of the deserializer; assigning values to the callback dataset of the first calling interface using the first dataset, assigning values to the callback dataset of the second calling interface using the second dataset, and assigning values to the callback dataset of the third calling interface using the third dataset.
2. The method according to claim 1, characterized in that, Obtaining the first service framework information of the image sensor includes: Obtain the following service settings of the image sensor: phase-locked loop frequency, frame frequency, data type, analog gain again, digital gain dgain, linearity, trigger image output, current on, current off, and reset.
3. The method according to claim 1, characterized in that, Obtaining the second service framework information of the serializer includes: Obtain the following first service settings of the serializer: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, general purpose input / output (GPIO), and reset.
4. The method according to claim 1, characterized in that, Obtaining the second service framework information of the serializer includes: Analyze the number of image sensors of the target vehicle; If the image sensor has multiple channels, obtain the following second service settings of the serializer: mode, lane mapping, port data channel pipe mapping, port open status, video stream pipe open status, video stream pipe transmission, data format, virtual channel, GPIO, reset, serializer two-wire serial bus I2C slave device address change, mapping relationship of the corresponding image sensor I2C slave device address, and correspondence between the serializer's GPIO pins and the image sensor's fsync pin.
5. The method according to claim 1, characterized in that, Obtaining the third service framework information of the deserializer includes: Obtain the following first service settings of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, and reset.
6. The method according to claim 1, characterized in that, Obtaining the third service framework information of the deserializer includes: Analyze the number of image sensors of the target vehicle; If the image sensor has multiple channels, obtain the following second service settings of the deserializer: video stream pipe crash, port controller mapping, mode, lane mapping, mapping relationship of video stream pipe data from src space to dest space, mapping relationship of dest space to port controller, phy copy, GPIO, reset, and mapping relationship of deserializer GPIO pin to image sensor fsync pin.
7. The method according to claim 1, characterized in that, After assigning values to the callback dataset of the in-vehicle camera's API call interface based on the first business framework information, the second business framework information, and the third business framework information, the method further includes: Receive the image output command from the vehicle-mounted camera; The callback dataset of the vehicle camera is invoked based on the output command; The callback dataset is used to control the output image of the vehicle camera.
8. An initialization device for a vehicle-mounted camera, characterized in that, include: The detection module is used to detect the initialization command of the vehicle camera for the target vehicle, wherein the vehicle camera includes an image sensor, a serializer, and a deserializer; The acquisition module is used to acquire the first service framework information of the image sensor, the second service framework information of the serializer, and the third service framework information of the deserializer; An initialization module is used to assign values to the callback dataset of the calling interface of the vehicle camera according to the first business framework information, the second business framework information, and the third business framework information, so as to complete the hardware initialization of the vehicle camera. The initialization module includes: a reading unit for reading a first general data structure of an image sensor, a second general data structure of a serializer, and a third general data structure of a deserializer, wherein the first general data structure includes multiple first members, each corresponding to a dataset implementing the first business framework information; the second general data structure includes multiple second members, each corresponding to a dataset implementing the second business framework information; and the third general data structure includes multiple third members, each corresponding to a dataset implementing the third business framework information; a parsing unit for parsing a first hardware model of the image sensor, a second hardware model of the serializer, and a third hardware model of the deserializer; a searching unit for searching for a first dataset matching the first hardware model in the first general data structure, a second dataset matching the second hardware model in the second general data structure, and a third dataset matching the third hardware model in the third general data structure; and an assignment unit for assigning values to the callback dataset of the vehicle camera's calling interface using the first dataset, the second dataset, and the third dataset. The assignment unit includes: a lookup subunit for looking up the first calling interface of the image sensor, the second calling interface of the serializer, and the third calling interface of the deserializer; and an assignment subunit for assigning a value to the callback dataset of the first calling interface using the first dataset, assigning a value to the callback dataset of the second calling interface using the second dataset, and assigning a value to the callback dataset of the third calling interface using the third dataset.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 7 when it is run.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 7.