Camera driving method, device, vehicle and storage medium
By generating a virtual camera and using it to power on the communication bus, the problem of slow camera startup speed in the prior art is solved, and the camera's fast drive detection and efficiency improvement is achieved.
Patent Information
- Application Number
- CN202410980162.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The prior art requires repeated up and down detection of each camera drive during the camera startup process, resulting in slower startup speed and affecting the performance of the camera.
By integrating the power-on parameters corresponding to the device tree and the component identification address of the camera component, a virtual camera is generated, and the communication bus power-on is controlled by using the virtual camera, and the component identification address is accessed based on the power-on bus, and the target configuration information is determined. Drive the camera.
It realizes the one-time power-on during the camera startup process to identify the target camera actually installed on the camera interface, quickly detects the configuration information of the target camera, and improves the camera driving efficiency.
Smart Images

Figure CN118524277B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera technology, and in particular to a camera driving method, device, vehicle and storage medium. Background Art
[0002] With the continuous upgrading of smart products, many smart products will be equipped with multiple different camera devices according to demand. As the number of camera peripheral models gradually increases, the camera drivers corresponding to each camera are also gradually diversified. In related technologies, relatively independent drivers are generally set for each camera or camera component, and the camera components and power-on methods included in each driver are also different. Each power-on requires a separate power-on detection for each driver. During the camera startup process, all camera drivers need to be detected to determine the final target driver to realize camera startup, resulting in the need to repeatedly power on and off to realize detection, causing the camera startup speed to slow down and affecting performance. Summary of the invention
[0003] The embodiments of the present application provide a camera driving method, device, vehicle and storage medium to at least partially solve the above-mentioned technical problems.
[0004] In order to achieve the above objective, according to a first aspect of the present application, a camera driving method is provided, comprising:
[0005] Integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface;
[0006] Controlling the communication bus to power on according to the power-on parameter through the virtual camera, and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on to obtain the first component identification;
[0007] Determine target configuration information according to the first component identifier and the matching degree of the second component identifier in the configuration information corresponding to the camera interface, wherein the first component identifier is determined according to the target camera actually mounted on the camera interface;
[0008] The target camera actually mounted on the camera interface is driven according to the target driving information corresponding to the target configuration information.
[0009] Optionally, the step of integrating the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain the virtual camera includes:
[0010] Get the configuration information of each camera bound to the device tree;
[0011] For each of the camera configuration information, extract the camera component identification address of each camera component in each of the camera configuration information and the power-on parameters in each of the camera configuration information;
[0012] The extracted component identification addresses and power-on parameters are respectively processed as a union to generate a virtual camera.
[0013] Optionally, the accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on to obtain the first component identification includes:
[0014] Accessing a storage unit connected to the communication bus based on the communication bus after power-on, and sequentially reading the component identification addresses in the virtual camera in the storage unit;
[0015] The component identification obtained from the component identification address is used as the first component identification.
[0016] Optionally, the method further comprises:
[0017] For each of the camera interfaces, obtaining the camera component identification of each camera component in the target camera actually mounted on the camera interface, and the component identification address corresponding to the camera component identification;
[0018] The camera component identification and the component identification address corresponding to the camera component identification are associated and stored in a storage unit connected to the communication bus.
[0019] Optionally, associating the camera component identification with a component identification address corresponding to the camera component identification and storing the associations in a storage unit connected to the communication bus comprises:
[0020] If the reading and writing modes of the camera component identifications are different, encoding the camera component identifications according to a preset encoding rule;
[0021] storing the encoded component identification and the corresponding component identification address in association with each other in a storage unit connected to the communication bus;
[0022] The method further comprises:
[0023] If a component identification is stored in any of the component identification addresses accessed, the component identification is acquired and decoded to obtain a decoded first component identification.
[0024] Optionally, determining the target configuration information according to the first component identification obtained through access and the matching degree of the second component identification in each configuration information corresponding to the camera interface includes:
[0025] Comparing the first component identification obtained by access with the second component identification in each of the camera configuration information in sequence;
[0026] If all the second component identifiers in any of the camera configuration information are the same as all the first component identifiers, the camera configuration information is used as the target configuration information.
[0027] Optionally, driving a target camera actually mounted on the camera interface according to target driving information corresponding to the target configuration information includes:
[0028] Extracting the drive power-on data and the drive operation data in the target configuration information to obtain the target drive information;
[0029] The target drive information is updated into the universal driver corresponding to the camera interface to obtain the camera driver corresponding to the camera interface of the camera;
[0030] A target camera actually mounted on the camera interface is driven according to the camera.
[0031] Optionally, the method further comprises:
[0032] If the first power-on instruction of the camera is received, the steps of controlling the communication bus to power on according to the power-on parameters through the virtual camera and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on are executed;
[0033] If the second power-on instruction of the camera is received, the historical target configuration information corresponding to each of the camera interfaces is obtained, and the step of driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information is executed;
[0034] The first power-on instruction represents a power-off power-on instruction for the core of the camera device, and the second power-on instruction represents a power-on instruction for the core of the camera device without powering off.
[0035] According to a second aspect of the present application, a camera driving device is provided, the camera driving device comprising:
[0036] An integration module, used for integrating power-on parameters corresponding to a device tree and component identification addresses of camera components to obtain a virtual camera, wherein the device tree is created according to configuration information of each camera compatible with a camera interface;
[0037] An access module, used to control the communication bus to be powered on according to the power-on parameters through the virtual camera, and access each of the component identification addresses corresponding to the virtual camera based on the communication bus after power-on;
[0038] a determination module, configured to determine target configuration information according to a matching degree between the first component identification obtained through access and the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to a target camera actually mounted on the camera interface;
[0039] A driving module is used to drive the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information.
[0040] According to a third aspect of the present application, a vehicle is provided, comprising:
[0041] one or more processors;
[0042] Memory; and
[0043] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement any one of the camera driving methods.
[0044] According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program is loaded by a processor to execute the steps in any one of the camera driving methods.
[0045] The camera driving method, device, vehicle and storage medium provided in the present application integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface; the communication bus is controlled to be powered on according to the power-on parameters by the virtual camera, and the component identification addresses corresponding to the virtual camera are accessed based on the communication bus after power-on; the target configuration information is determined according to the first component identification obtained by the access and the matching degree of the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface; the target camera actually mounted on the camera interface is driven according to the target driving information corresponding to the target configuration information. This scheme constructs a virtual camera according to the camera configuration information corresponding to the camera interface, and according to the integrated information in the virtual camera, a one-time power-on is performed to identify the first component identification corresponding to the target camera actually mounted on the camera interface at one time, and further detects the camera configuration information corresponding to the camera interface according to the first component identification, identifies the target configuration information corresponding to the target camera, realizes rapid drive detection of the target camera, and improves the camera driving efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0047] In order to more completely understand the present application and its beneficial effects, the following description will be given in conjunction with the accompanying drawings, wherein the same figure numbers represent the same parts in the following description.
[0048] Figure 1 is a schematic diagram of a scene of a camera driving method provided in an embodiment of the present application;
[0049] Figure 2 is a schematic flow chart of an embodiment of a camera driving method provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of a structure constructed for the virtual camera in one embodiment of a camera driving method;
[0051] Figure 4 A schematic diagram of a flow chart of one implementation scheme for obtaining a first component identifier in a camera driving method provided in an implementation scheme of the present application;
[0052] Figure 5 A schematic diagram of the structure of one implementation scheme of a storage unit in a camera driving method provided in an implementation scheme of the present application;
[0053] Figure 6 A schematic diagram of a flow chart of one implementation scheme for determining target configuration information in a camera driving method provided in an implementation scheme of the present application;
[0054] Figure 7 A schematic diagram of a flow chart of one implementation of the camera driving method provided in the embodiment of the present application;
[0055] Figure 8 is a schematic structural diagram of an embodiment of a camera driving device provided in an embodiment of the present application;
[0056] Fig. 9 It is a schematic diagram of the structure of an embodiment of a vehicle provided in the embodiments of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0058] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0059] In the embodiment of the present application, "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
[0060] In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to implement and use the invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in this application.
[0061] In recent years, with the continuous development of industries such as mobile phones, security, machine vision, and vehicle intelligence, the demand for cameras has exploded, and various differentiated CMOS models have emerged one after another. In order to ensure stable supply and convenient hardware upgrades, various manufacturers will design redundancy on the same platform to be compatible with camera devices of different specifications. Even if the specifications are the same, there are often multiple suppliers to ensure supply.
[0062] For the purpose of self-control, most of the OEM platforms choose the free Linux / Android system. Add multiple Camera drivers in Linux / Android. Usually, each driver is independent of each other. Each driver configures the required MCLK, VANA, VDIG, VIO, VAF, RESET, STANDBY and other power supplies, and sets the device identification model of CMOS, AF, flashlight / RGBIC. For those who need to transmit long-distance mipi signals, deSer, Ser, and ISP devices will also be used, which are also set in each driver. After booting up, power on according to the power-on configuration of each driver, and then compare the bus addresses and identification addresses of camera components such as CMOS, AF, flashlight / RGB IC, deSer, Ser, ISP, etc. one by one to read the identification content. If read, the driver will recognize it correctly and register it to the system.
[0063] However, the above technology has the following technical defects: each device requires a device tree, and each new device requires a new device tree; each device detection requires power on and off; CMOS, AF, flashlight / RGB IC, deSer, Ser, ISP and other camera components have different bus addresses and device identification addresses, and must be identified multiple times; driver identification must detect all possibilities one by one, and the last one may be detected as the device installed on the host.
[0064] In summary, it can be seen that the existing technology has complicated configuration of newly added components, and as the number of camera peripheral models gradually increases, the startup time of the added devices will become longer and longer. When the host needs to be compatible with dozens or hundreds of combined devices, the startup time may increase by several seconds.
[0065] In car computers and other IOT scenarios, the host and camera are often separated, and the camera needs to be compatible with a large number of model components in the later stage. According to the existing technology, in some scenarios that require fast response (such as getting in the car, turning on the computer and reversing), a delay of several seconds will result in a very poor user experience.
[0066] Therefore, the embodiments of the present application provide a camera driving method, apparatus, device, and computer-readable storage medium, which are described in detail below.
[0067] The camera driving method in an embodiment of the present invention is applied to a camera driving device, which is arranged in a vehicle. The vehicle is provided with one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the camera driving method.
[0068] like Figure 1 As shown, Figure 1 This is a scene diagram of the camera driving method of an embodiment of the present application. The camera driving scene in the embodiment of the present invention includes a vehicle 100 (a camera driving device is integrated in the vehicle 100), and a computer-readable storage medium corresponding to the camera driving method is run in the vehicle 100 to execute the steps in the camera driving method.
[0069] In the embodiment of the present invention, the vehicle 100 is mainly used for: integrating the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface; controlling the power-on of the communication bus according to the power-on parameters through the virtual camera, and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on; determining the target configuration information according to the first component identification obtained by the access and the matching degree with the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface; and driving the target camera actually mounted on the camera interface according to the target drive information corresponding to the target configuration information.
[0070] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or fewer vehicles, or vehicle network connections, such as Figure 1 Only one vehicle is shown. It can be understood that the scene of the camera driving method can also include one or more other vehicles, which are not limited here. The vehicle 100 can also include a memory for storing data, for example, storing image information obtained by shooting.
[0071] In addition, in the scenario of the camera driving method of the present application, a display device may be provided on the vehicle 100 to output the result of the camera driving method in the vehicle. The vehicle 100 may access a backend database 200 (the backend database may be in the local memory of the vehicle, or may be provided in the cloud), and the backend database 200 stores information related to the camera driving, for example, the backend database 200 stores data corresponding to the vehicle camera driving.
[0072] It should be noted that Figure 1 The scene diagram of the camera driving method shown is only an example. The scene of the camera driving method described in the embodiment of the present invention is to more clearly illustrate the technical solution of the embodiment of the present invention, and does not constitute a limitation on the technical solution provided by the embodiment of the present invention.
[0073] Based on the scenario of the above camera driving method, an embodiment of the camera driving method is proposed.
[0074] like Figure 2 FIG. 2 is a flow chart of an embodiment of a camera driving method in an embodiment of the present application. The camera driving method includes steps S201-S204:
[0075] S201 , integrating power-on parameters corresponding to a device tree and component identification addresses of camera components to obtain a virtual camera, wherein the device tree is created according to configuration information of each camera compatible with a camera interface.
[0076] The virtual camera includes component identification addresses and all power-on parameters representing all camera components corresponding to the camera interface;
[0077] Among them, the camera interface is the interface corresponding to the connection of the camera device, and the camera device can be a mobile phone, a vehicle, etc.
[0078] The implementation scheme of the present application takes a vehicle as an example. Multiple camera devices can be connected to the vehicle through an interface, and each camera interface is compatible with connecting multiple camera devices of different models. The camera elements or driver power-on requirements included in each camera device are also different. In the implementation scheme of the present application, for each camera interface, a device tree is constructed and an association relationship between the device tree and the camera configuration information corresponding to the camera interface is created. The device tree includes the camera configuration information compatible with the camera interface, and a virtual camera is created for each device tree. The virtual camera includes the identification addresses and all power-on parameters of all camera elements corresponding to the camera interface.
[0079] Specifically, in the implementation scheme of the present application, when driving detection is performed for each camera interface, the device tree corresponding to the camera interface is obtained, and according to the camera configuration information corresponding to the device tree, all component identification addresses and all power-on parameters in the camera configuration information are extracted, and all component identification addresses are integrated to integrate the repeated component identification addresses among all component identification addresses, and only one of the repeated component identification addresses is retained to reduce the number of component identification addresses. Furthermore, all power-on parameters are integrated to integrate the repeated power-on parameters among all power-on parameters, and only one of the repeated power-on parameters is retained to obtain the integrated component identification addresses and power-on parameters to constitute a virtual camera corresponding to the device tree, so as to provide the virtual camera to represent all component identification addresses and all power-on parameters corresponding to the camera interface.
[0080] S202: Controlling the communication bus to power on according to the power-on parameters through the virtual camera, and accessing each of the component identification addresses corresponding to the virtual camera based on the powered-on communication bus.
[0081] Specifically, in the implementation scheme of the present application, after constructing the virtual camera, all power-on parameters in the virtual camera are extracted, and the power required by the communication bus is determined according to the power-on parameters to control the power-on of the communication bus, thereby achieving one-time power-on.
[0082] Furthermore, after power-on, each component identification address corresponding to the virtual camera is accessed through the communication bus, and the first component identification corresponding to each component identification address in the storage unit corresponding to the communication bus is read at one time.
[0083] That is, it can be understood that the first component identification may be read multiple times or not read.
[0084] S203, determining target configuration information according to the first component identification obtained through access and the matching degree of the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface.
[0085] Specifically, in the implementation scheme of the present application, the communication bus peripheral storage unit stores all camera component identifiers and component identifier addresses of the target cameras actually equipped with each camera interface, that is, during the access process, if the component identifier address accessed has component identifier content stored in it, the stored component identifier content is used as the first component identifier. After all the first component identifiers are obtained, all the first components are compared with the second component identifiers in each configuration information corresponding to the camera interface to determine the target configuration information that matches the first component identifier.
[0086] S204: Drive the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information.
[0087] In one implementation manner of the present application, the target drive information is the target drive of the target camera actually mounted on the camera interface, and the target camera can be driven according to the target drive.
[0088] Specifically, in another implementation of the present application, the target drive information is the differentiated drive information of the target camera actually mounted on the camera interface. By combining the differentiated drive information and the universal drive information corresponding to the camera interface, a complete target drive can be formed, and the target camera is driven according to the target drive.
[0089] It is understandable that some drivers are the same between different cameras, and the differentiated driving information is mainly manifested as power-on information and driving operation information. Therefore, in the implementation scheme of the present application, the differentiated information and power-on information in the target configuration information are used as target driving information, combined with the general driving information corresponding to the camera interface, to obtain a complete target drive.
[0090] In this solution, all component identification addresses and power-on parameters corresponding to each camera interface are combined to build a virtual camera, and a one-time power-on of the communication bus is implemented according to the power-on parameters. The component identifications corresponding to all addresses are read at one time according to the combined component identification addresses to determine the first component identification of the target camera. The camera configuration information corresponding to the camera interface is further detected for the first component identification, and the target configuration information corresponding to the target camera is identified, that is, the driver corresponding to the target camera. Rapid drive detection of the target camera is completed, thereby improving the camera drive efficiency.
[0091] Furthermore, in another embodiment of the present application, a virtual camera determination implementation scheme is also provided, which specifically includes the steps of:
[0092] (1) Obtain the configuration information of each camera bound to the device tree;
[0093] (2) extracting the camera component identification address of each camera component in each of the camera configuration information and the power-on parameters in each of the camera configuration information;
[0094] (3) The extracted component identification addresses and power-on parameters are respectively subjected to union processing, and a virtual camera is generated according to the component identification address set and the power-on parameter set after the union processing.
[0095] The configuration information of each camera is a driver configuration file bound to the device tree, wherein each driver configuration file at least includes a component identification address of a camera component and a power-on parameter of the camera component.
[0096] In the implementation scheme of the present application, the configuration information of each camera under the same device tree is taken and combined to form a virtual camera, which includes at least a power-on parameter set and a component identification address set. The virtual camera is only used to identify the components contained in the camera and does not perform actual work. And only the communication bus of the device is powered, and the memory with unified storage specifications in the camera is directly read. If the device follows the unified specification, only one read is needed to obtain the identification information of all camera components, thereby improving the efficiency of drive detection.
[0097] For example, see Figure 3 , Figure 3 It is a schematic diagram of a structure constructed for the virtual camera in one embodiment of the camera driving method.
[0098] Among them, a certain camera interface is compatible with cameras cam0, cam1 and cam2, wherein the corresponding CMOS (Complementary Metal-Oxide Semiconductor, digital image sensor), flashlight (flashlight), ISP (Image Signal Processor, image signal processor), Ser (Serializer serializer, used to convert parallel data into serial data. In the camera, it can be used to output data to the processor or other devices), and eeprom (component identification storage address) in each camera are respectively the configuration information of each camera. Specifically, in the implementation scheme of the present application, all power-on parameters and camera components in cam0, cam1 and cam2 are extracted and processed by taking the union to obtain a virtual camera.
[0099] Further, in the implementation scheme of the present application, the present application also provides an implementation scheme for reading the first element identification. For details, see Figure 4 , Figure 4 A schematic flow chart of one implementation scheme for obtaining the first component identification in the camera driving method provided in the implementation scheme of the present application, specifically including steps S401-S402:
[0100] S401 . Access a storage unit connected to the communication bus based on the communication bus after power-on, and read the component identification addresses in the virtual camera in the storage unit in sequence.
[0101] Specifically, in the specific implementation process, the storage unit connected to the communication bus is accessed based on the communication bus after power-on. It can be understood that since the power-on parameters for powering on the communication bus are all power-on parameters corresponding to the camera interface, that is, only one power-on is required for the communication bus to read the corresponding component identification in the storage unit at one time, so as to complete the subsequent detection of all drive information, avoid repeated power on and off, and improve the drive detection efficiency.
[0102] S402: Use the component identification obtained from the component identification address as the first component identification.
[0103] Specifically, in the implementation scheme of the present application, the component identification address in the virtual camera in the storage unit is read in sequence. If it is read, the read component identification is recorded. If it is not read, the next component identification address is read until all the component identification addresses are read. The recorded component identification is used as the first component identification, that is, the first component identification may include multiple.
[0104] In some other implementation schemes of the present application, if no component identification is read until all the component identification addresses are read, the existing reading method can be used to read again to ensure the compatibility of the reading method.
[0105] Specifically, in one embodiment of the present application, a method for determining storage content in a storage unit is also provided, comprising the steps of:
[0106] (1) for each of the camera interfaces, obtaining a camera component identifier of each camera component in a target camera actually mounted on the camera interface, and a component identifier address corresponding to the camera component identifier;
[0107] (2) Associating the camera component identification with the component identification address corresponding to the camera component identification and storing the associations in a storage unit connected to the communication bus.
[0108] It is understandable that a camera interface can carry one target camera at a time, but can be compatible with different cameras. Each compatible camera has corresponding camera configuration information, including the physical port information of each camera (such as 0). The physical port information is the interface identifier of the camera interface. The camera configuration information includes but is not limited to: power-on parameters, device identifier reading address, device identifier address expected content (second component identifier), device driver operation mode and other information.
[0109] For each of the camera interfaces, the acquirer actually carries a target camera, and uses the camera component identifier of each camera component of the actually carried camera as the first component identifier, and the component identifier address corresponding to the camera component identifier, and stores them in a storage unit in association.
[0110] In actual application, a virtual camera is created corresponding to all component identification addresses in the camera interface, and the storage unit is accessed according to all component identification addresses in the virtual camera, so that the first component identification of the camera component compatible with the camera interface can be obtained at one time. The read first component identification can represent the camera component of the target camera actually mounted. After obtaining the first component identification of the target camera, component identification matching can be performed corresponding to the camera configuration information of each camera to find the target configuration information corresponding to the target camera, wherein the target configuration information is one of the target camera configuration information.
[0111] It is understandable that the data in the storage unit can be updated according to the above process according to a preset update frequency, or updated when it is detected that the camera interface is replaced with the mounted camera, or updated in response to a user instruction.
[0112] Specifically, in some other embodiments of the present application, different camera components may be stored from different manufacturers, which may lead to inconsistencies in the reading method of the component identification or the identification length. Therefore, in this solution, a storage unit is provided for storing the camera component identification according to this scenario, which specifically includes the steps of:
[0113] (1) If the reading and writing methods of the camera component identification are different, encoding the camera component identification according to a preset encoding rule;
[0114] (2) The encoded component identification and the corresponding component identification address are stored in association in a storage unit connected to the communication bus.
[0115] Specifically, in the implementation scheme of the present application, after obtaining the camera component identification of the target camera, if the length and reading and writing method of the camera component identification are different, each camera component identification is encoded according to a preset encoding rule to unify the reading and writing method of the component identification, and further, the encoded component identification and the corresponding component identification address are associated and stored in a storage unit connected to the communication bus.
[0116] In the implementation scheme of this application, the drivers (camera configuration information) under the same device tree are combined to form a virtual camera. The virtual camera is only used to identify the components contained in the camera and does not perform actual work. In addition, the communication bus of the device is only powered, and the memory with unified storage specifications in the camera is directly read. Only a one-time reading of a storage unit is required to obtain the identification information of all camera components, thereby improving the efficiency of driver detection.
[0117] For example, see Figure 5 , Figure 5 A schematic diagram of the structure of one implementation scheme of the storage unit in the camera driving method provided in the implementation scheme of the present application, wherein the unified bus address is the bus address corresponding to the communication bus, the identification address corresponds to the component identification address, the identification content corresponds to the component identification, and the component identification address and the component identification in each row correspond to each other.
[0118] Specifically, in the implementation scheme of the present application, after accessing any of the component identification addresses storing the component identification and obtaining the component identification, the component identification needs to be decoded to obtain the decoded first component identification. It can be understood that the decoding method corresponds to the encoding rule.
[0119] Furthermore, the present application also provides an implementation scheme for determining target configuration information, see Figure 6 , Figure 6 A schematic flow chart of one implementation scheme for determining target configuration information in a camera driving method provided in the implementation scheme of the present application, specifically including steps S601-S602:
[0120] S601: Compare the first component identification obtained through access with the second component identification in each of the camera configuration information in sequence.
[0121] S602: If all the second component identifiers in any of the camera configuration information are the same as all the first component identifiers, use the camera configuration information as the target configuration information.
[0122] Specifically, in the implementation scheme of the present application, after obtaining the first component identifier, the first component identifier is compared with the second component identifier in each of the camera configuration information in turn to see which camera configuration information has the second component identifier that is exactly the same as the read first component identifier, and then the camera configuration information is determined to be the target configuration information corresponding to the target camera.
[0123] Specifically, in one implementation scheme of the present application, after determining the target configuration information, driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information specifically includes the steps of:
[0124] (1) extracting the driver power-on data and driver operation data (i.e., the operation mode corresponding to the device driver) from the target configuration information to obtain target driver information;
[0125] (2) updating the target driver information to the universal driver corresponding to the camera interface to obtain the camera driver corresponding to the camera interface of the camera;
[0126] (3) Driving the target camera actually mounted on the camera interface according to the camera.
[0127] Specifically, in the implementation scheme of the present application, a universal driver is designed in the kernel, and there is no need to keep adding new drivers in the kernel like traditional drivers. Different drivers are embodied in the form of differentiated parameter configurations, and the differentiated parameters are stored in the user space. In this way, the Camera driver can be added at will without upgrading the system. This reduces the difficulty of development and improves development efficiency.
[0128] Furthermore, in one of the embodiments of the present application, a camera driving method implementation scheme for different power-on modes is also provided. Specifically, if a first power-on instruction of the camera is received, the power-on parameters corresponding to the device tree and the component identification address of the camera component are integrated and processed to obtain a virtual camera, and the steps of controlling the power-on of the communication bus according to the power-on parameters through the virtual camera and accessing each of the component identification addresses corresponding to the virtual camera based on the communication bus after power-on are executed.
[0129] In other embodiments of the present application, if a second power-on command of the camera is received, the power-on parameters corresponding to the device tree and the component identification address of the camera component are integrated to obtain a virtual camera, and the historical target configuration information corresponding to each of the camera interfaces is obtained, and the step of driving the target camera actually mounted on the camera interface according to the target drive information corresponding to the target configuration information is executed.
[0130] Specifically, the first power-on instruction represents a power-off power-on instruction for the core of the camera device, and the second power-on instruction represents a power-on instruction for the core of the camera device without powering off.
[0131] It can be understood that obtaining the historical target configuration information corresponding to each of the camera interfaces can be determined by obtaining the detection records corresponding to each of the camera interfaces.
[0132] For details, see Figure 7 , Figure 7 A schematic flow chart of one implementation scheme of the camera driving method provided in the embodiment of the present application, specifically comprising the steps of:
[0133] 1. When booting, the user space (Android system serves CameraHAL) calls the character device cdev through the device / dev / videox to enter the kernel space.
[0134] 2. The kernel space calls the platform's v4l2 driver and enters the Camera device detection process.
[0135] 3. The user space traverses all driver configuration files corresponding to the first classification tree according to the device tree classification (the driver configuration file is the camera configuration information described in the full text), takes the full set of power-on parameters and camera component identification addresses in the configuration files, and generates a virtual camera device faker_cam that does not exist in the system.
[0136] 4. The virtual camera device detection calls the universal driver we implemented, only powers on the power required by the communication bus, and starts to read the identification (that is, access the component identification address corresponding to the virtual camera based on the communication bus after power-on).
[0137] 5. When reading the identification, first read the memory with unified storage specifications in the camera. If it is read, record the read identification in the kernel and power off the camera (only bus power).
[0138] 6. If the unified storage specification storage identifier is not read, look for other customized non-universal location identifier information. If it exists, continue reading; if it is read, record the read identifier in the kernel and power off the camera (only bus power).
[0139] 7. The above unified storage specifications and customized non-universal identification attempts were all unsuccessful, and the camera was powered off directly (only bus power), and the identification record was empty. This means that no driver was detected under this device tree, and a mark was generated in the kernel to record that the current device tree has been detected.
[0140] 8. After the identification is read, the identification information is returned to the user space, and all driver configuration files under this device tree are traversed to match the identification information (the target configuration information is determined based on the matching degree of the first component identification obtained by access and the second component identification in each configuration information corresponding to the camera interface).
[0141] 9. After matching the driver identifier, send the complete driver configuration corresponding to the identifier from the user space to the kernel space, use the universal driver to load the driver configuration, and instantiate the driver of the current device tree (according to the target driver information corresponding to the target configuration information, drive the target camera actually mounted on the camera interface).
[0142] 10. The driver instance is completed and the detection success result is returned to the platform v4l2 framework driver. The platform v4l2 framework driver registers the device with the v4l2 core layer.
[0143] 11. If the current device tree is not detected, jump to the next device tree driver set to continue detecting until all device tree driver sets corresponding to the driver configuration files are detected.
[0144] It can be understood that the above implementation scheme corresponds to the process scenario corresponding to the first startup instruction, that is, the scenario is the core power-off startup process.
[0145] It can be understood that in some implementation scenarios, the core is powered on without powering off, which corresponds to the second power-on instruction; the camera driving method in this scenario specifically includes the following process steps:
[0146] 1. Execute the first three steps of the kernel power-off and power-on driver identification process. For devices that have identification records in the device tree, skip steps 4-8 above and start directly from step 9 to complete device registration.
[0147] 2. There is no identification record in the device tree, but there is a detected record mark. Skip steps 4-10 and go directly to step 11. There is no device under the current device tree.
[0148] 3. If there is no identification record in the device tree and the record mark has not been detected, re-detect according to steps 4-11.
[0149] Through the above-mentioned Camera driver fast identification and registration method execution steps, we have reduced the driver identification and registration time in each link of power-on, reading, identification, and registration, and minimized the time spent on the camera driver when booting and restarting the service.
[0150] In this solution, the device tree is no longer dead-bound to each driver. Each device tree is an abstract device. Multiple drivers share one device tree (that is, each device tree includes all cameras compatible with the camera interface, and corresponds to all camera configuration information corresponding to the camera interface). The device tree is determined by the identified device identifier to which driver it is bound (binding target configuration information). There is no need to increase the device tree to add a new replacement driver, which is more efficient and stable than the traditional one-by-one addition method. Even if there are multiple types of drivers under a device tree, the driver power supply logic is different, and only the communication bus needs to be powered during identification and detection. In the implementation scheme of the present application, the driver identification method is unified, and the device identifier can be detected with only one bus read, without trying to identify camera components such as CMOS, AF, flashlight / RGB IC, deSer, Ser, ISP, etc. one by one. Compared with the traditional one-by-one detection method, the boot time is shorter and the camera opens faster.
[0151] Furthermore, the implementation scheme of the present application is based on the general implementation of the Linux / Android v4l2 camera framework to create a virtual camera. The Arm architecture on the market is customized and developed based on the v4l2 camera. This solution has strong universality and can be easily ported across platforms. In this solution, all device identifications will be recorded in the kernel after the first startup. The identification information will not be cleared unless the kernel is powered on. When the host is restarted or the camera service crashes, device identification will no longer be required. The device registration can be completed by directly matching the recorded identification. Compared with traditional solutions, the time from camera service restart to camera recovery will be greatly improved.
[0152] Compared with the traditional method, no matter how many possible drivers the current device tree has, this method only needs to perform device detection once for the same device tree, which greatly improves the efficiency of driver detection.
[0153] In order to better implement the camera driving method in the embodiment of the present application, based on the camera driving method, the embodiment of the present application also provides a camera driving device, such as Figure 8 As shown, the camera driving device includes modules 801-804:
[0154] An integration module 801 is used to integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface;
[0155] An access module 802, configured to control the communication bus to be powered on according to the power-on parameters through the virtual camera, and access each of the component identification addresses corresponding to the virtual camera based on the powered-on communication bus;
[0156] A determination module 803 is used to determine target configuration information according to a matching degree between the first component identifier obtained through access and the second component identifier in each configuration information corresponding to the camera interface, wherein the first component identifier is determined according to a target camera actually mounted on the camera interface;
[0157] The driving module 804 is used to drive the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information.
[0158] In some embodiments of the present application, the integration module 801 is used to integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, including:
[0159] Get the configuration information of each camera bound to the device tree;
[0160] Extracting the camera component identification address of each camera component in each of the camera configuration information and the power-on parameters in each of the camera configuration information;
[0161] The extracted component identification addresses and power-on parameters are respectively subjected to union processing, and a virtual camera is generated according to the component identification address set and the power-on parameter set after the union processing.
[0162] In some embodiments of the present application, the access module 802 is used to access the component identification addresses corresponding to the virtual camera based on the communication bus after power-on, including:
[0163] Accessing a storage unit connected to the communication bus based on the communication bus after power-on, and sequentially reading the component identification addresses in the virtual camera in the storage unit;
[0164] The component identification obtained from the component identification address is used as the first component identification.
[0165] In some embodiments of the present application, the access module 802 is further used to:
[0166] For each of the camera interfaces, obtaining the camera component identification of each camera component in the target camera actually mounted on the camera interface, and the component identification address corresponding to the camera component identification;
[0167] The camera component identification and the component identification address corresponding to the camera component identification are associated and stored in a storage unit connected to the communication bus.
[0168] In some embodiments of the present application, the access module 802 is used to associate the camera component identification with the component identification address corresponding to the camera component identification and store them in a storage unit connected to the communication bus, including:
[0169] If the reading and writing modes of the camera component identifications are different, encoding the camera component identifications according to a preset encoding rule;
[0170] storing the encoded component identification and the corresponding component identification address in association with each other in a storage unit connected to the communication bus;
[0171] The method further comprises:
[0172] If a component identification is stored in any of the component identification addresses accessed, the component identification is acquired and decoded to obtain a decoded first component identification.
[0173] In some embodiments of the present application, the determination module 803 is used to determine the target configuration information according to the matching degree of the first component identification obtained by access and the second component identification in each configuration information corresponding to the camera interface, including:
[0174] Comparing the first component identification obtained by access with the second component identification in each of the camera configuration information in sequence;
[0175] If all the second component identifiers in any of the camera configuration information are the same as all the first component identifiers, the camera configuration information is used as the target configuration information.
[0176] In some implementation schemes of the present application, the driving module 804 is used to drive the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information, including:
[0177] Extracting the drive power-on data and the drive operation data in the target configuration information to obtain the target drive information;
[0178] The target drive information is updated into the universal driver corresponding to the camera interface to obtain the camera driver corresponding to the camera interface of the camera;
[0179] A target camera actually mounted on the camera interface is driven according to the camera.
[0180] In some embodiments of the present application, the device further includes an instruction execution module, which is used to:
[0181] If the first power-on instruction of the camera is received, the steps of controlling the communication bus to power on according to the power-on parameters through the virtual camera and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on are executed;
[0182] If the second power-on instruction of the camera is received, the historical target configuration information corresponding to each of the camera interfaces is obtained, and the step of driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information is executed;
[0183] The first power-on instruction represents a power-off power-on instruction for the core of the camera device, and the second power-on instruction represents a power-on instruction for the core of the camera device without powering off.
[0184] The provided camera driving device is provided with an integration module for integrating the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface; an access module for controlling the power-on of the communication bus according to the power-on parameters through the virtual camera, and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on; a determination module for determining the target configuration information according to the first component identification obtained by the access and the matching degree of the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface; and a driving module for driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information. This solution constructs a virtual camera according to the camera configuration information corresponding to the camera interface, and according to the integration information in the virtual camera, a one-time power-on is performed to identify the first component identification corresponding to the target camera actually mounted on the camera interface at one time, and further detects the camera configuration information corresponding to the camera interface according to the first component identification, identifies the target configuration information corresponding to the target camera, realizes the rapid drive detection of the target camera, and improves the camera drive efficiency.
[0185] Further, it can be understood that in some other embodiments of the present application, a vehicle is further provided, the vehicle integrating any camera driving device provided in the embodiments of the present invention, the vehicle comprising:
[0186] one or more processors;
[0187] Memory; and
[0188] One or more applications, wherein the one or more applications are stored in the memory and are configured so that the processor executes the steps of the camera driving method described in any of the above camera driving method embodiments.
[0189] In combination with the above-mentioned embodiments, it can be known that in some of the embodiments of the present application, the processor or multiple processors and memories in the vehicle part are integrated on a circuit board body included in the vehicle, and the circuit board body is arranged in the vehicle.
[0190] It is understandable that in some other embodiments of the present application, the processor and memory in the vehicle may not be integrated in the vehicle, that is, the processor and memory are respectively arranged in the vehicle as components of the vehicle.
[0191] like Fig. 9 As shown, Fig. 9 It is a schematic diagram of the structure of an embodiment of a vehicle provided in the embodiments of the present application.
[0192] Specifically, the vehicle may include one or more processing core processors 1001, one or more computer-readable storage media memories 1002, a power supply 1003, an input unit 1004, and other components. Those skilled in the art will appreciate that Fig. 9 The vehicle structure shown in the figure does not constitute a limitation on the vehicle, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0193] The processor 1001 is the camera driving center, which uses various interfaces and lines to connect various parts of the entire vehicle. By running or executing software programs and / or modules stored in the memory 1002, and calling the data stored in the memory 1002, it performs various functions of the vehicle and processes data, thereby monitoring the vehicle as a whole. It can be understood that the processor 1001 transmits signals with the controller. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1001.
[0194] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the vehicle, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0195] In some embodiments of the present application, the camera driving device can be implemented in the form of a computer program. The computer program can be Fig. 9 The vehicle's memory may store various program modules constituting the camera driving device, such as: Figure 8 The integrated module 801, the access module 802, the determination module 803, and the driving module 804 are shown. The computer program composed of various program modules enables the processor to execute the steps of the camera driving method of each embodiment of the present application described in this specification.
[0196] For example, Fig. 9 The vehicle shown can be Figure 8 The integration module 801 in the camera driving device shown executes step S201. The vehicle can execute step S202 through the access module 802. The vehicle can execute step S203 through the determination module 803. The vehicle can execute step S204 through the driving module 804. The vehicle includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the vehicle is used to provide computing and control capabilities. The memory of the vehicle includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the vehicle is used to communicate with an external vehicle through a network connection. When the computer program is executed by the processor, a camera driving method is implemented.
[0197] The vehicle further includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 1003 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0198] The vehicle may further include an input unit 1004, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0199] Although not shown, the vehicle may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 1001 in the vehicle will load the executable files corresponding to the processes of one or more applications into the memory 1002 according to the following instructions, and the processor 1001 will run the applications stored in the memory 1002, thereby realizing various functions, as follows:
[0200] Integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface;
[0201] Controlling the communication bus to power on according to the power-on parameters through the virtual camera, and accessing each of the component identification addresses corresponding to the virtual camera based on the communication bus after power-on;
[0202] Determine target configuration information according to the first component identification obtained by access and the matching degree of the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface;
[0203] The target camera actually mounted on the camera interface is driven according to the target driving information corresponding to the target configuration information.
[0204] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0205] To this end, an embodiment of the present invention provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any camera driving method provided in an embodiment of the present invention. For example, the computer program may be loaded by a processor to execute the following steps:
[0206] Integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface;
[0207] Controlling the communication bus to power on according to the power-on parameters through the virtual camera, and accessing each of the component identification addresses corresponding to the virtual camera based on the communication bus after power-on;
[0208] Determine target configuration information according to the first component identification obtained by access and the matching degree of the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to the target camera actually mounted on the camera interface;
[0209] The target camera actually mounted on the camera interface is driven according to the target driving information corresponding to the target configuration information.
[0210] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0211] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0212] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0213] The above is a detailed introduction to a camera driving method, device, vehicle and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A camera driving method, characterized in that: include: Integrate the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera, wherein the device tree is created according to the configuration information of each camera compatible with the camera interface; Controlling the communication bus to power on according to the power-on parameter through the virtual camera, and accessing the component identification address corresponding to the virtual camera based on the communication bus after power-on to obtain the first component identification; Determine target configuration information according to the first component identifier and the matching degree of the second component identifier in the configuration information corresponding to the camera interface, wherein the first component identifier is determined according to the target camera actually mounted on the camera interface; According to the target driving information corresponding to the target configuration information, driving the target camera actually mounted on the camera interface; The step of controlling the communication bus to power on according to the power-on parameter through the virtual camera, and accessing the component identification address corresponding to the virtual camera based on the communication bus after power-on to obtain the first component identification includes: Extracting all power-on parameters in the virtual camera, and controlling the communication bus according to the power-on parameters to achieve one-time power-on; Each of the component identification addresses corresponding to the virtual camera is accessed through the communication bus, and the first component identification corresponding to each of the component identification addresses in the storage unit corresponding to the communication bus is read at one time.
2. The camera driving method according to claim 1, characterized in that: The step of integrating the power-on parameters corresponding to the device tree and the component identification address of the camera component to obtain a virtual camera includes: Get the configuration information of each camera bound to the device tree; For each of the camera configuration information, extract the camera component identification address and power-on parameters of each camera component in the camera configuration information; The extracted component identification addresses and power-on parameters are respectively processed as a union to generate a virtual camera.
3. The camera driving method according to claim 1, characterized in that: The method further comprises: For each of the camera interfaces, obtaining the camera component identification of each camera component in the target camera actually mounted on the camera interface, and the component identification address corresponding to the camera component identification; The camera component identification and the component identification address corresponding to the camera component identification are associated and stored in a storage unit connected to the communication bus.
4. The camera driving method according to claim 3, characterized in that: The associating the camera component identification with the component identification address corresponding to the camera component identification and storing the associating with the camera component identification in a storage unit connected to the communication bus comprises: If the reading and writing modes of the camera component identifications are different, encoding the camera component identifications according to a preset encoding rule; storing the encoded component identification and the corresponding component identification address in association with each other in a storage unit connected to the communication bus; The method further comprises: If a component identification is stored in any of the component identification addresses accessed, the component identification is acquired and decoded to obtain a decoded first component identification.
5. The camera driving method according to claim 1, characterized in that: The determining target configuration information according to the matching degree between the first component identifier and the second component identifier in the configuration information corresponding to the camera interface includes: Comparing the first component identification obtained by access with the second component identification in each of the camera configuration information in sequence; If all the second component identifiers in any of the camera configuration information are the same as all the first component identifiers, the camera configuration information is used as the target configuration information.
6. The camera driving method according to claim 1, characterized in that: The step of driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information includes: Extracting the drive power-on data and the drive operation data in the target configuration information to obtain the target drive information; Updating the target drive information to the universal driver corresponding to the camera interface to obtain a camera driver corresponding to the camera interface of the camera; A target camera actually mounted on the camera interface is driven according to the camera.
7. The camera driving method according to any one of claims 1 to 6, characterized in that: The method further comprises: If the first power-on instruction of the camera is received, the steps of controlling the communication bus to power on according to the power-on parameters through the virtual camera and accessing the component identification addresses corresponding to the virtual camera based on the communication bus after power-on are executed; If the second power-on instruction of the camera is received, the historical target configuration information corresponding to each of the camera interfaces is obtained, and the step of driving the target camera actually mounted on the camera interface according to the target driving information corresponding to the target configuration information is executed; The first power-on instruction represents a power-off power-on instruction for the core of the camera device, and the second power-on instruction represents a power-on instruction for the core of the camera device without powering off.
8. A camera driving device, characterized in that: The camera driving device comprises: An integration module, used for integrating power-on parameters corresponding to a device tree and component identification addresses of camera components to obtain a virtual camera, wherein the device tree is created according to configuration information of each camera compatible with a camera interface; An access module, used to control the communication bus to power on according to the power-on parameter through the virtual camera, and access each component identification address corresponding to the virtual camera based on the communication bus after power-on to obtain a first component identification; a determination module, configured to determine target configuration information according to a matching degree between the first component identification obtained through access and the second component identification in each configuration information corresponding to the camera interface, wherein the first component identification is determined according to a target camera actually mounted on the camera interface; A driving module, used to drive a target camera actually mounted on the camera interface according to target driving information corresponding to the target configuration information; The access module is further used to extract all power-on parameters in the virtual camera, and control the communication bus according to the power-on parameters to achieve one-time power-on; Each of the component identification addresses corresponding to the virtual camera is accessed through the communication bus, and the first component identification corresponding to each of the component identification addresses in the storage unit corresponding to the communication bus is read at one time.
9. A vehicle, characterized in that: The vehicle comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the camera driving method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the camera driving method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Vehicle-mounted camera calling method and device
CN112363767A
Server starting method and device, computer equipment and storage medium
CN113934463A
Device initialization method, electronic equipment and readable storage medium
CN117707628A