Sensor drive loading method, device, equipment, medium and program product
By obtaining the model information of the camera device sensor, it directly loads the driver file, which solves the long loading time of the sensor driver and memory management problems, achieving faster startup speed and more stable operation.
Patent Information
- Application Number
- CN202310492635.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-04
- Publication Date
- 2024-11-05
AI Technical Summary
The startup time of existing camera devices is long due to the sensor driver loading method when starting up, and frequent loading and unloading of drivers may lead to memory fragmentation and memory application failure.
By obtaining the model information of the sensor, directly load the corresponding driver files, avoiding repeated loading and unloading the driver process, reducing loading and unloading operations, improving startup speed and avoiding memory fragmentation.
It reduces the startup time of the camera device, improves operation stability and memory management efficiency, and avoids the possibility of memory application failure.
Smart Images

Figure CN118900361A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of sensor technology, and in particular to a sensor drive loading method, device, equipment, medium and program product. Background Art
[0002] With the development of information technology, video equipment has been widely used in various fields such as video conferencing, telemedicine and real-time monitoring.
[0003] Camera equipment mainly uses sensors to collect images of the external environment. Taking a network camera as an example, after the network camera is started, the sensor driver collects images of the external environment. Therefore, each time the network camera is started, the sensor driver in the network camera needs to be loaded.
[0004] However, the sensor driver loading method in the related art causes a long startup time of the camera device. Summary of the invention
[0005] Based on this, it is necessary to provide a sensor driver loading method, device, equipment, medium and program product to address the above technical problems, thereby reducing the startup time of the camera device.
[0006] In a first aspect, the present application provides a sensor drive loading method, the method comprising:
[0007] In response to a sensor drive loading instruction of the camera device, obtaining a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor;
[0008] Obtaining sensor model information from a register of the camera device according to the register storage address;
[0009] Load the sensor driver of the camera device according to the sensor model information.
[0010] In one embodiment, the sensor information table includes a plurality of communication addresses and a register storage address corresponding to each communication address;
[0011] Obtaining the register storage address corresponding to the target communication address of the sensor in the camera device according to the preset sensor information table, including:
[0012] determining a target communication address of the sensor from a plurality of communication addresses;
[0013] According to the register storage addresses corresponding to the communication addresses, the register storage address corresponding to the target communication address is obtained.
[0014] In one embodiment, determining a target communication address of a sensor from a plurality of communication addresses includes:
[0015] Based on the serial communication interface protocol and the storage order of the plurality of communication addresses, a communication connection is established with the sensor through each communication address;
[0016] The communication address with successful communication connection is determined as the target communication address.
[0017] In one embodiment, establishing a communication connection with the sensor through each communication address includes:
[0018] For any communication address, a communication connection request is sent to the sensor via the communication address;
[0019] If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
[0020] In one embodiment, loading a sensor driver of a camera device according to the model information of the sensor includes:
[0021] According to the model information of the sensor, obtain the driver file corresponding to the model information from the sensor information table;
[0022] Load the sensor driver of the camera device by running the driver file.
[0023] In one embodiment, the method further comprises:
[0024] If the communication address that successfully establishes a communication connection with the sensor does not exist in the sensor information table, it is determined that the sensor driver loading of the camera device has failed.
[0025] In a second aspect, the present application further provides a sensor driven loading device, the device comprising:
[0026] An address acquisition module, for responding to a sensor drive loading instruction of the camera device, and acquiring a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for establishing a successful communication connection with the sensor;
[0027] A model acquisition module, used to acquire the model information of the sensor in the register of the camera device according to the register storage address;
[0028] The loading module is used to load the sensor driver of the camera device according to the model information of the sensor.
[0029] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method provided in any embodiment of the first aspect when executing the computer program.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in any embodiment of the first aspect above.
[0031] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method provided in any embodiment of the first aspect above.
[0032] The sensor driver loading method, device, equipment, medium and program product described above, in response to the sensor driver loading instruction of the camera device, obtains the register storage address corresponding to the target communication address of the sensor in the camera device according to the preset sensor information table, obtains the model information of the sensor in the register of the camera device according to the register storage address, and loads the sensor driver of the camera device according to the model information of the sensor; the target communication address represents the communication address that successfully establishes a communication connection with the sensor. In this method, the corresponding register storage address is obtained by the target communication address that successfully establishes a communication connection with the sensor of the camera device, the model information of the sensor is obtained by the register storage address corresponding to the target communication address, and then the sensor driver is loaded according to the model information of the sensor. This method does not need to repeatedly execute the process of loading and unloading the driver, only needs to first obtain the model information of the sensor, and directly loads the sensor driver of the camera device on the basis of successfully obtaining the sensor model information, and does not need to match the loaded sensor driver with the sensor of the camera device, which reduces the process of loading and unloading the driver, thereby reducing the startup time of the camera device; and, the driver is not repeatedly loaded and unloaded, which avoids the memory fragmentation of the camera device and reduces the possibility of memory application failure when loading the sensor driver. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A diagram of an application environment of a sensor driving loading method in an embodiment;
[0034] Figure 2 A schematic diagram of a flow chart of a sensor driving loading method in one embodiment;
[0035] Figure 3 A schematic diagram of a flow chart of a sensor driving loading method in another embodiment;
[0036] Figure 4 A schematic diagram of a flow chart of a sensor driving loading method in another embodiment;
[0037] Figure 5 A schematic diagram of a flow chart of a sensor driving loading method in another embodiment;
[0038] Figure 6 A schematic diagram of a flow chart of a sensor driving loading method in another embodiment;
[0039] Figure 7 A schematic diagram of a flow chart of a sensor driving loading method in another embodiment;
[0040] Figure 8 is a structural block diagram of a sensor driven loading device in one embodiment;
[0041] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] The sensor driving loading method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the camera device 101 includes a processor 102, a sensor 103 and a register 104. The camera device 101 may be a device with a camera function, including but not limited to a video camera, a network camera, a still camera and the like. The sensor 103 may be an image sensor (CIS).
[0044] At present, in order to increase the mass production speed of consumer electronic products, most manufacturers will use a set of firmware to adapt multiple sensors. The firmware includes multiple types of sensor driver execution files. Due to the small memory of consumer electronic products, all types of sensor drivers cannot be added to the kernel or root file system of consumer electronic products. As a result, each time the consumer electronic product is started, the sensor driver corresponding to all driver files in the firmware needs to be loaded to detect whether it matches the actual sensor model in the consumer electronic product. When there are many sensor driver files in the firmware, the matching process will take a long time, resulting in a long startup time for the consumer electronic product.
[0045] In one method, the image signal processor (ISP) configures the configuration file name for matching, and in another method, the driver adds a tag for checking. If the match fails, the driver is uninstalled and the next driver is loaded until the match is successful.
[0046] However, the existing sensor driving methods all load the corresponding driver files after traversal. This method requires loading the driver file. If the match is unsuccessful, the current driver needs to be unloaded. Driver loading will apply for memory, and unloading the driver will release memory. Frequent loading and unloading can easily cause memory fragmentation. Memory application failures may occur when the device runs for a long time. In addition, multiple loading and unloading of drivers also consumes device startup time.
[0047] Based on this, the present application proposes a sensor driver loading method, which directly obtains the model information of the sensor in the camera device, and loads the corresponding sensor driver based on the sensor model information. This method does not require frequent loading and unloading of drivers, thereby reducing the startup time of the camera device. In addition, infrequent loading and unloading of drivers can ensure the success of loading the sensor driver, and there will be no failure in applying for memory, thereby improving the operating stability of the camera device.
[0048] In one embodiment, Figure 2 As shown, a sensor drive loading method is provided, and the embodiment includes the following steps:
[0049] S201 , in response to a sensor drive loading instruction of an imaging device, obtaining a register storage address corresponding to a target communication address of a sensor in the imaging device according to a preset sensor information table.
[0050] The target communication address indicates the communication address that successfully establishes a communication connection with the sensor.
[0051] The sensor driver loading instruction may be a sensor driver loading instruction directly generated after the processor is powered on when the sensor is started, and the sensor driver loading instruction may include a sensor information table.
[0052] After the processor responds to the sensor drive loading instruction of the camera device, it can obtain the register address corresponding to the target communication address that successfully establishes a communication connection with the sensor of the camera device according to the sensor information table in the sensor drive instruction.
[0053] Optionally, after the sensor responds to the sensor driver loading instruction of the camera device, the processor can also read the information in the sensor information table from the memory of the camera device, and determine the target communication address for successfully establishing a communication connection with the sensor based on the information in the sensor information table, and obtain the register storage address corresponding to the target communication address based on the target communication address.
[0054] In one embodiment, the target communication address of a sensor in a camera device can be determined through a preset detection model. Specifically, the information in a sensor information table is input into the detection model, the information in the sensor information table is analyzed through the detection model, and the target communication address of the sensor in the camera device is output; based on the target communication address, a method for obtaining a register storage address corresponding to the target communication address of the sensor in the camera device can be that after determining the target communication address, the register storage address stored in the target communication address is read.
[0055] In another method, the register storage address corresponding to the target communication address of the sensor in the camera device can also be directly determined through a preset address acquisition model. Specifically, the information in the sensor information table is input into the address acquisition model. The address acquisition model analyzes the information in the sensor information table and outputs the register storage address corresponding to the target communication address of the sensor in the camera device.
[0056] It should be noted that the target communication address may be the communication address of a sensor in the camera device, and the processor may successfully establish a communication connection with the sensor through the target communication address.
[0057] S202: Acquire the model information of the sensor in the register of the camera device according to the register storage address.
[0058] The register is a storage area inside the processor for storing data. It can be used to store data involved in calculations and calculation results. The register may include sensor model information.
[0059] Therefore, the value in the corresponding storage location in the register storage address can be directly read according to the register storage address, and the value in the register can be determined as the model information of the sensor.
[0060] Optionally, the register may store a hexadecimal number, and the sensor model information may also be obtained by reading the number in the register of the camera device according to the register address, and converting each bit of the number in the register into an ASCII code of a character to obtain the sensor model information.
[0061] The method of reading the value in the register according to the register storage address may be to use the device control interface function ioctl() for reading.
[0062] S203: Load the sensor driver of the camera device according to the model information of the sensor.
[0063] After obtaining the model information of the sensor, the processor may generate an execution script corresponding to the sensor model based on the model information of the sensor, and load the sensor driver of the camera device based on the execution script.
[0064] Optionally, an execution script corresponding to the model information of the sensor can be generated according to the script generation model. Specifically, the model information of the sensor is input into the script generation model, and the execution script corresponding to the model information is generated according to the analysis of the model information by the script generation model; wherein the execution script is a driver execution script for the sensor, and after the driver execution script for the sensor is generated, the driver execution script is run to obtain the sensor driver of the camera device.
[0065] In the sensor driver loading method provided by the embodiment of the present application, in response to the sensor driver loading instruction of the camera device, the register storage address corresponding to the target communication address of the sensor in the camera device is obtained according to the preset sensor information table, the model information of the sensor is obtained in the register of the camera device according to the register storage address, and the sensor driver of the camera device is loaded according to the model information of the sensor; the target communication address represents the communication address that successfully establishes a communication connection with the sensor. In this method, the corresponding register storage address is obtained by the target communication address that successfully establishes a communication connection with the sensor of the camera device, the model information of the sensor is obtained by the register storage address corresponding to the target communication address, and then the sensor driver is loaded according to the model information of the sensor. This method does not need to repeatedly execute the process of loading and unloading the driver, only needs to obtain the model information of the sensor first, and directly load the sensor driver of the camera device on the basis of successfully obtaining the sensor model information, and does not need to match the loaded sensor driver with the sensor of the camera device, which reduces the process of loading and unloading the driver, thereby reducing the startup time of the camera device; and, the driver is not repeatedly loaded and unloaded, which avoids the memory fragmentation of the camera device and reduces the possibility of memory application failure when loading the sensor driver.
[0066] The sensor information table includes multiple communication addresses and register storage addresses corresponding to each communication address; on this basis, the process of obtaining the register storage address corresponding to the target communication address of the sensor in the camera device is described through an embodiment. In one embodiment, Figure 3 As shown, obtaining the register storage address corresponding to the target communication address of the sensor in the camera device according to the preset sensor information table includes the following steps:
[0067] S301, determining a target communication address of a sensor from a plurality of communication addresses.
[0068] The sensor information table includes communication addresses of various sensor models and corresponding storage addresses.
[0069] A plurality of communication addresses in the sensor information table are obtained, and a communication connection is established with the sensor based on the plurality of communication addresses, and a communication address that successfully establishes a communication connection with the sensor is determined as a target communication address.
[0070] In one embodiment, Figure 4 As shown, determining the target communication address of the sensor from multiple communication addresses includes the following steps:
[0071] S401, based on the serial communication interface protocol and the storage order of multiple communication addresses, establish a communication connection with the sensor through each communication address.
[0072] According to the storage order of multiple communication addresses, the processor establishes a communication connection with the sensor through each communication address in a communication manner of a serial communication interface protocol, wherein when each communication address establishes a communication connection with the sensor, it establishes a communication connection with the sensor in sequence according to the storage order of the multiple communication addresses.
[0073] For example, multiple communication addresses in the sensor information table may correspond to a storage sequence number, and the communication address first stored in the sensor information table corresponds to the storage sequence number 1, followed by 2, 3, and so on.
[0074] Taking the sensor information table including three communication addresses as an example, the sensor information table includes, in order of storage: communication address 1, communication address 2 and communication address 3. First, based on the serial communication interface protocol, a communication connection is established with the sensor through communication address 1. If the communication address 1 is successfully connected to the sensor, there is no need to establish a communication connection with the sensor through communication address 2 and communication address 3. If the communication address 1 fails to establish a communication connection with the sensor, the communication connection with the sensor is established through communication address 2. If the communication address 2 is successfully connected to the sensor, there is no need to establish a communication connection with the sensor through communication address 3. If the communication address 2 fails to establish a communication connection with the sensor, a communication connection is established with the sensor through communication address 3.
[0075] If the communication address 3 still fails to establish a communication connection with the sensor, it is determined that there is no communication address in the sensor information table that successfully establishes a communication connection with the sensor, and it is determined that the sensor driver loading of the camera device has failed. That is, if there is no communication address in the sensor information table that successfully establishes a communication connection with the sensor, it is determined that the sensor driver loading of the camera device has failed.
[0076] It should be noted that, based on the serial communication interface protocol and the historical communication connection success rates of the multiple communication addresses, a communication connection with the sensor may be established through each communication address.
[0077] Specifically, the historical communication connection success rate corresponding to each communication address is obtained, and communication connections are established with the sensor through the corresponding communication addresses in order of the historical communication connection success rates.
[0078] Optionally, the serial communication interface protocol may be an Inter-Integrated Circuit (i2c) protocol.
[0079] S402, determining the communication address with successful communication connection as the target communication address.
[0080] The communication address successfully connected to the sensor is determined as the target communication address.
[0081] Optionally, if a communication address successfully establishes a communication connection with the sensor, there is no need to continue to establish a communication connection with the sensor through a subsequent communication address.
[0082] S302, acquiring the register storage address corresponding to the target communication address according to the register storage address corresponding to each communication address.
[0083] Based on the register storage addresses corresponding to the communication addresses in the sensor information table, the register storage address corresponding to the target communication address is obtained.
[0084] When establishing a communication connection with the sensor, the position of the target communication address in the sensor information table may be determined, and based on the position of the target communication address in the sensor information table, the register address corresponding to the target communication address in the sensor information table may be acquired.
[0085] Optionally, based on the target communication address, the communication addresses in the sensor information table may be traversed in sequence in the sensor information table, and the register storage address corresponding to the communication address matching the target communication address may be determined as the register storage address corresponding to the target communication address.
[0086] It should be noted that the sensor information table may have the same communication address but different register storage addresses. Therefore, from the register addresses corresponding to the communication addresses in the sensor information table, there may be multiple register storage addresses corresponding to the target communication address.
[0087] Correspondingly, the model information of the sensor is obtained in the register of the camera device according to the register storage address, including: obtaining the model information of the sensor in the register of the camera device according to each register storage address, specifically, according to the storage order of each register, reading the model information of the sensor in the register of the camera device according to each register storage address in turn until the model information of the sensor is successfully obtained; optionally, in each register storage address, there is a register storage address where the model information of the sensor is unsuccessful to obtain, that is, there is no register in the register storage address.
[0088] If the sensor model information is not successfully obtained according to the register storage address, it means that each register storage address in the sensor information table does not have the storage address of the register in the camera device, and it is determined that the sensor driver loading of the camera device fails.
[0089] In the sensor driver loading method provided in the embodiment of the present application, the target communication address of the sensor is determined from multiple communication addresses, and the register storage address corresponding to the target communication address is obtained according to the register storage address corresponding to each communication address. In this method, the target communication address of the sensor is directly obtained from multiple communication addresses. Since the target communication address is a communication address for establishing a communication connection with the sensor of the camera device, the register storage address of the camera device can be successfully obtained according to the target communication address, and the model information of the sensor can be directly obtained based on the register storage address corresponding to the target communication address in the subsequent step, thereby improving the speed of obtaining the model information of the sensor.
[0090] The specific process of establishing a communication connection with a sensor according to a communication address is described below by an embodiment. In one embodiment, Figure 5 As shown, a communication connection is established with the sensor through each communication address, including:
[0091] S501, for any communication address, sending a communication connection request to the sensor via the communication address.
[0092] For any communication address, the process of establishing a communication connection with the sensor is described.
[0093] The location of the sensor can be determined through the communication address. Based on the location of the sensor, a communication connection request is sent to the sensor through the serial communication interface protocol, wherein the communication connection request includes the processor identifier, the communication address of the processor, and the purpose of the communication connection.
[0094] S502: If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
[0095] After receiving the communication connection request sent by the processor, the sensor generates a connection success response message and returns the connection success response message to the processor based on the communication address of the processor in the communication connection request. If the processor receives the connection success response message returned by the sensor according to the communication connection request, it determines that the communication connection with the sensor is successfully established according to the communication address.
[0096] Optionally, the connection success response message may include: the purpose of the communication connection in the communication connection request, the communication address of the sensor, etc.
[0097] In the sensor driver loading method provided in the embodiment of the present application, for any communication address, a communication connection request is sent to the sensor through the communication address, and if a connection success response message is received from the sensor according to the communication connection request, it is determined that the communication address communication connection is successful. In this method, a communication connection with the sensor is established according to the communication address, and whether the communication connection is successful is verified, thereby ensuring the reliability and security of the communication.
[0098] In one embodiment, Figure 6 As shown, according to the model information of the sensor, the sensor driver of the camera device is loaded, including the following steps:
[0099] S601, according to the model information of the sensor, obtain a driver file corresponding to the model information from the sensor information table.
[0100] The sensor information table includes multiple communication addresses, as well as register storage addresses corresponding to each communication address, sensor model information and driver files.
[0101] Therefore, according to the model information of the sensor, the sensor model information in the sensor information table is traversed to obtain the driver file corresponding to the sensor model information that is consistent with the sensor model information.
[0102] The driver file is the driver file corresponding to the model information of the sensor in the camera device.
[0103] S602, loading the sensor driver of the camera device by running the driver file.
[0104] After obtaining the driver file corresponding to the model information of the sensor in the camera device, the sensor driver of the camera device can be successfully installed by running the driver file.
[0105] In the sensor driver loading method provided in the embodiment of the present application, according to the model information of the sensor, the driver file corresponding to the model information is obtained from the sensor information table, and the sensor driver of the camera device is loaded by running the driver file. In this method, the driver file corresponding to the model information of the sensor is obtained, and the sensor driver is directly loaded according to the real driver file of the sensor in the camera device, so as to realize the function of fast matching between the sensor and the sensor driver, achieve the effect of fast installation of the sensor driver, avoid frequent loading and unloading of the sensor driver in the camera device, reduce the startup time of the camera device, and improve the startup speed of the camera device.
[0106] In the sensor driver loading method in the embodiment of the present application, it is not necessary to load the sensor driver in advance for matching. The i2c0 node is opened at the application layer, and the register values in the sensor are read in sequence according to the sensor information table through ioctl to determine the model of the current sensor. After the sensor model is successfully obtained, the corresponding sensor driver is directly loaded, and there is no need to frequently load and unload the driver, which will not cause memory fragmentation to the camera device, and the operation of loading and unloading the driver is omitted. The loading and recognition speed is fast, and the startup speed of the camera device is improved.
[0107] In one embodiment, the present application also provides a sensor driver loading method, taking the camera device as a network camera as an example, such as Figure 7 As shown, this embodiment includes the following steps:
[0108] S701, read the sensor power control and reset pins.
[0109] S702, distribute power control and reset pins according to the sensor power control and reset pins.
[0110] S703, execute the reset pin and configure the master control to output a 24 MHz driving clock to the sensor.
[0111] S704, turning on the sensor, and establishing a communication connection with the sensor according to each communication address in the sensor information table.
[0112] S705, determining whether there is a target communication address in the sensor information table that has successfully communicated with the sensor, if so, executing step S706, otherwise, executing step S711.
[0113] S706, obtaining a register storage address corresponding to a target communication address that is successfully connected to the sensor for communication.
[0114] S707, reading the model information of the sensor stored in the register according to the register storage address.
[0115] S708, determining whether there is a driver file corresponding to the sensor model information in the sensor information table, if yes, executing step S709, otherwise, executing step S711.
[0116] S709, obtaining a driver file corresponding to the sensor model information from the sensor information table.
[0117] S710, load the sensor driver of the network camera by running the driver file.
[0118] S711, close the communication connection with the sensor, control the output clock to be disabled, and close the general input and output interface.
[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0120] Based on the same inventive concept, the embodiment of the present application also provides a sensor drive loading device for implementing the sensor drive loading method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more sensor drive loading device embodiments provided below can refer to the above limitations on the sensor drive loading method, and will not be repeated here.
[0121] In one embodiment, Figure 8 As shown, a sensor driving loading device 800 is provided, comprising: an address acquisition module 801, a model acquisition module 802 and a loading module 803, wherein:
[0122] The address acquisition module 801 is used to respond to the sensor drive loading instruction of the camera device and obtain the register storage address corresponding to the target communication address of the sensor in the camera device according to the preset sensor information table, where the target communication address represents the communication address for successfully establishing a communication connection with the sensor;
[0123] A model acquisition module 802 is used to acquire the model information of the sensor in the register of the camera device according to the register storage address;
[0124] The loading module 803 is used to load the sensor driver of the camera device according to the model information of the sensor.
[0125] In one embodiment, the sensor information table includes multiple communication addresses and register storage addresses corresponding to each communication address; the address acquisition module 801 includes:
[0126] A first acquisition unit, used to determine a target communication address of a sensor from a plurality of communication addresses;
[0127] The second acquisition unit is used to acquire the register storage address corresponding to the target communication address according to the register storage address corresponding to each communication address.
[0128] In one embodiment, the first acquisition unit includes:
[0129] A communication connection subunit, used to establish a communication connection with the sensor through each communication address based on a serial communication interface protocol and a storage order of multiple communication addresses;
[0130] The first determining subunit is used to determine the communication address with successful communication connection as the target communication address.
[0131] In one embodiment, the communication connection subunit includes:
[0132] A sending subunit, for sending a communication connection request to the sensor via the communication address for any communication address;
[0133] The second determining subunit is configured to determine that the communication address communication connection is successful if a connection success response message returned by the sensor according to the communication connection request is received.
[0134] In one embodiment, the loading module 803 includes:
[0135] A third acquisition unit is used to acquire a driver file corresponding to the model information from the sensor information table according to the model information of the sensor;
[0136] The loading unit is used to load the sensor driver of the camera device by running the driver file.
[0137] In one embodiment, the apparatus 800 further includes:
[0138] The determination module is used to determine that the sensor driver loading of the camera device fails if there is no communication address in the sensor information table that successfully establishes a communication connection with the sensor.
[0139] Each module in the above-mentioned sensor drive loading device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0140] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sensor drive loading data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a sensor drive loading method is implemented.
[0141] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0142] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0143] In response to a sensor drive loading instruction of the camera device, obtaining a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor;
[0144] Obtaining sensor model information from a register of the camera device according to the register storage address;
[0145] Load the sensor driver of the camera device according to the sensor model information.
[0146] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0147] determining a target communication address of the sensor from a plurality of communication addresses;
[0148] According to the register storage addresses corresponding to the communication addresses, the register storage address corresponding to the target communication address is obtained.
[0149] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0150] Based on the serial communication interface protocol and the storage order of the plurality of communication addresses, a communication connection is established with the sensor through each communication address;
[0151] The communication address with successful communication connection is determined as the target communication address.
[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0153] For any communication address, a communication connection request is sent to the sensor via the communication address;
[0154] If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0156] According to the model information of the sensor, obtain the driver file corresponding to the model information from the sensor information table;
[0157] Load the sensor driver of the camera device by running the driver file.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] If the communication address that successfully establishes a communication connection with the sensor does not exist in the sensor information table, it is determined that the sensor driver loading of the camera device has failed.
[0160] The implementation principles and technical effects of each step implemented by the processor in the embodiment of the present application are similar to the principles of the above-mentioned sensor drive loading method, and will not be repeated here.
[0161] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0162] In response to a sensor drive loading instruction of the camera device, obtaining a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor;
[0163] Obtaining sensor model information from a register of the camera device according to the register storage address;
[0164] Load the sensor driver of the camera device according to the sensor model information.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] determining a target communication address of the sensor from a plurality of communication addresses;
[0167] According to the register storage addresses corresponding to the communication addresses, the register storage address corresponding to the target communication address is obtained.
[0168] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0169] Based on the serial communication interface protocol and the storage order of the plurality of communication addresses, a communication connection is established with the sensor through each communication address;
[0170] The communication address with successful communication connection is determined as the target communication address.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0172] For any communication address, a communication connection request is sent to the sensor via the communication address;
[0173] If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] According to the model information of the sensor, obtain the driver file corresponding to the model information from the sensor information table;
[0176] Load the sensor driver of the camera device by running the driver file.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] If the communication address that successfully establishes a communication connection with the sensor does not exist in the sensor information table, it is determined that the sensor driver loading of the camera device has failed.
[0179] The implementation principles and technical effects of the various steps implemented when the computer program in the embodiment of the present application is executed by the processor are similar to the principles of the above-mentioned sensor drive loading method, and will not be repeated here.
[0180] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0181] In response to a sensor drive loading instruction of the camera device, obtaining a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor;
[0182] Obtaining sensor model information from a register of the camera device according to the register storage address;
[0183] Load the sensor driver of the camera device according to the sensor model information.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0185] determining a target communication address of the sensor from a plurality of communication addresses;
[0186] According to the register storage addresses corresponding to the communication addresses, the register storage address corresponding to the target communication address is obtained.
[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0188] Based on the serial communication interface protocol and the storage order of the plurality of communication addresses, a communication connection is established with the sensor through each communication address;
[0189] The communication address with successful communication connection is determined as the target communication address.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] For any communication address, a communication connection request is sent to the sensor via the communication address;
[0192] If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] According to the model information of the sensor, obtain the driver file corresponding to the model information from the sensor information table;
[0195] Load the sensor driver of the camera device by running the driver file.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0197] If the communication address that successfully establishes a communication connection with the sensor does not exist in the sensor information table, it is determined that the sensor driver loading of the camera device has failed.
[0198] The implementation principles and technical effects of the various steps implemented when the computer program in the embodiment of the present application is executed by the processor are similar to the principles of the above-mentioned sensor drive loading method, and will not be repeated here.
[0199] It should be noted that the data involved in this application (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0200] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0201] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0202] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A sensor drive loading method, characterized in that: The method comprises: In response to a sensor drive loading instruction of the camera device, obtaining a register storage address corresponding to a target communication address of a sensor in the camera device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor; Acquire the model information of the sensor in the register of the camera device according to the register storage address; The sensor driver of the camera device is loaded according to the model information of the sensor.
2. The method according to claim 1, characterized in that The sensor information table includes a plurality of communication addresses and a register storage address corresponding to each of the communication addresses; The step of obtaining the register storage address corresponding to the target communication address of the sensor in the camera device according to the preset sensor information table includes: determining a target communication address of the sensor from the plurality of communication addresses; According to the register storage addresses corresponding to the communication addresses, the register storage address corresponding to the target communication address is obtained.
3. The method according to claim 2, characterized in that The determining the target communication address of the sensor from the multiple communication addresses comprises: Based on a serial communication interface protocol and a storage order of the plurality of communication addresses, establishing a communication connection with the sensor through each of the communication addresses; The communication address with successful communication connection is determined as the target communication address.
4. The method according to claim 3, characterized in that The establishing a communication connection with the sensor through each of the communication addresses includes: For any communication address, sending a communication connection request to the sensor via the communication address; If a connection success response message returned by the sensor according to the communication connection request is received, it is determined that the communication address communication connection is successful.
5. The method according to claims 1-4, characterized in that: The step of loading the sensor driver of the camera device according to the model information of the sensor includes: According to the model information of the sensor, obtaining a driver file corresponding to the model information from the sensor information table; The sensor driver of the camera device is loaded by running the driver file.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: If the communication address that successfully establishes a communication connection with the sensor does not exist in the sensor information table, it is determined that the sensor driver loading of the camera device has failed.
7. A sensor driven loading device, characterized in that: The device comprises: An address acquisition module, configured to respond to a sensor drive loading instruction of an imaging device and acquire a register storage address corresponding to a target communication address of a sensor in the imaging device according to a preset sensor information table, wherein the target communication address indicates a communication address for successfully establishing a communication connection with the sensor; A model acquisition module, used for acquiring the model information of the sensor in the register of the camera device according to the register storage address; A loading module is used to load the sensor driver of the camera device according to the model information of the sensor.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Sensor driving operation detection method and storage medium
CN119718804A
Adaptive method and system of image sensor
CN120475252A
