Camera link fault diagnosis method, device, electronic device and storage medium

By calling the output interface function to save the camera image frame and read back the deserializer register status value, the problem of low efficiency in camera link fault diagnosis in the existing technology is solved, and fast and efficient fault diagnosis is achieved.

CN119363964BActive Publication Date: 2025-10-03CHENGDU CELIS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411279823.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-10-03
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

In the prior art, when a camera link fails, each link needs to be checked one by one, resulting in low fault diagnosis efficiency.

Method used

By calling the output interface function in the driver file, the camera's image frames are saved to the target file, and the register status values ​​in the deserializer are read back. Fault diagnosis is performed based on the target file and log information.

Benefits of technology

The fault diagnosis efficiency of the camera link is improved, which avoids the need to check each link one by one and realizes rapid diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363964B_ABST
    Figure CN119363964B_ABST
Patent Text Reader

Abstract

The present application relates to a camera link fault diagnosis method, device, electronic device and storage medium, the method comprising: calling a pre-set output interface function in a first driver file to output the first frame image captured by a target camera, so as to save the first frame image to a target file under a target path; calling a pre-set register readback function in a second driver file to read back the status value of a register in a target deserializer, and writing the status value of the register to a log message; in the event that a link fault occurs in the target camera, exporting the target file and log message, and performing fault diagnosis based on the target file and log message. In this way, fault diagnosis can be quickly performed based on the target file and log message, avoiding the defect in the prior art of needing to check each link in the camera link one by one, thereby improving the efficiency of camera link fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle fault diagnosis, and in particular to a camera link fault diagnosis method, device, electronic device and storage medium. Background Art

[0002] As vehicles become increasingly intelligent, onboard cameras are playing an increasingly important role. For example, they serve as image acquisition devices for digital video recorders (DVRs), camera monitor systems (CMSs), driver monitoring systems (DMSs), and around-view monitors (AVMs). Therefore, the stability of the camera link is crucial.

[0003] In existing technologies, when a camera link fails (e.g., a distorted or black screen), each link in the link must be checked individually, resulting in low fault diagnosis efficiency. Therefore, improving the efficiency of camera link fault diagnosis has become a pressing technical issue. Summary of the Invention

[0004] The present application provides a camera link fault diagnosis method, device, electronic device and storage medium to solve the problem in the prior art that when a camera link fails, each link in the camera link needs to be checked one by one, resulting in low fault diagnosis efficiency.

[0005] In a first aspect, an embodiment of the present application provides a camera link fault diagnosis method, the method comprising:

[0006] Calling a pre-set output interface function in a first driver file to output a first frame of image captured by a target camera, so as to save the first frame of image to a target file under a target path, wherein the first driver file is used to drive an image front-end engine, the target camera is a currently turned on camera, and the target path and the target file are determined based on the target camera and a preset correspondence relationship, wherein the preset correspondence relationship is used to characterize a mapping relationship between the camera, the path, and the file;

[0007] Calling a register readback function preset in a second driver file to read back a status value of a register in a target deserializer, and writing the status value of the register to log information, wherein the target deserializer is a deserializer connected to the target camera, and the second driver file is used to drive the target deserializer;

[0008] In the event that a link failure occurs in the target camera, the target file and the log information are exported, and fault diagnosis is performed based on the target file and the log information.

[0009] Optionally, calling a pre-set output interface function in the first driver file to output the first frame image captured by the target camera to save the first frame image to a target file in a target path includes:

[0010] Calling the first library function encapsulated in the output interface function to open the target file;

[0011] Calling the second library function encapsulated in the image output interface function to write the first frame image into the target file;

[0012] The third library function encapsulated in the output interface function is called to close the target file under the target path.

[0013] Optionally, before calling the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to a target file in the target path, the method further includes:

[0014] Obtaining a target identifier corresponding to the target camera, and assigning a value to a target global variable based on the target identifier, wherein the assigned target global variable is used to indicate identification information of the currently turned-on camera;

[0015] Based on the assigned target global variable, determining whether the image frame currently received by the image front-end engine is sent by the target camera;

[0016] When it is determined that the image frame currently received by the image front-end engine is sent by the target camera, the steps are executed: calling the output interface function to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path.

[0017] Optionally, after calling the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to a target file in the target path, the method further includes:

[0018] Restore the assigned target global variable to its initial value.

[0019] Optionally, calling a register readback function preset in the second driver file to read a status value of a register in the target deserializer and writing the status value of the register to the log information includes:

[0020] Calling the register readback function to read the status value of the register in the target deserializer, wherein the status value of the register includes the status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the stream start register;

[0021] The status value of the lock status register, the status value of the counting register, the status value of the video signal status register and / or the status value of the current starting register are written into the log information.

[0022] Optionally, before calling the register readback function preset in the second driver file to read the status value of the register in the target deserializer and writing the status value of the register into the log information, the method further includes:

[0023] Calling a device detection function preset in the second driver file to detect the target deserializer and obtain a chip identifier of the target deserializer;

[0024] Calling the initialization setting function preset in the second driver file to initialize the registers in the target deserializer according to the chip identifier;

[0025] Call the streaming function preset in the second driver file to enable the register in the target deserializer, and execute the steps: call the register readback function preset in the second driver file to read the status value of the register in the target deserializer, and write the status value of the register to the log information.

[0026] Optionally, the performing fault diagnosis based on the target file and the log information includes:

[0027] Determining whether the first frame image in the target file is abnormal, and determining whether the hardware module of the target camera is abnormal based on the determination result; and

[0028] Determine whether the status value of the lock status register, the status value of the counting register, the status value of the video signal status register and / or the status value of the flow register in the log information are abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

[0029] In a second aspect, an embodiment of the present application further provides a camera link fault diagnosis device, the device comprising:

[0030] A first calling module is configured to call a pre-set output interface function in a first driver file to output a first frame of image captured by a target camera, so as to save the first frame of image to a target file under a target path, wherein the first driver file is configured to drive an image front-end engine, the target camera is a currently turned-on camera, and the target path and the target file are determined based on the target camera and a preset correspondence relationship, wherein the preset correspondence relationship is configured to characterize a mapping relationship between the camera, the path, and the file;

[0031] A second calling module is configured to call a register readback function preset in a second driver file to read back a status value of a register in a target deserializer, and write the status value of the register into log information, wherein the target deserializer is a deserializer connected to the target camera, and the second driver file is configured to drive the target deserializer;

[0032] A fault diagnosis module is used to export the target file and the log information when a link failure occurs in the target camera, and to perform fault diagnosis based on the target file and the log information.

[0033] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0034] Memory for storing computer programs;

[0035] The processor is used to implement the camera link fault diagnosis method described in the first aspect when executing the program stored in the memory.

[0036] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the camera link fault diagnosis method described in the first aspect is implemented.

[0037] The above-mentioned technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application outputs the first frame image captured by the target camera by calling the output interface function pre-set in the first driver file to save the first frame image to the target file under the target path, wherein the first driver file is used to drive the image front-end engine, the target camera is the currently turned-on camera, the target path and the target file are determined based on the target camera and the preset correspondence relationship, and the preset correspondence relationship is used to characterize the mapping relationship between the camera, the path and the file; calling the register readback function pre-set in the second driver file to read back the status value of the register in the target deserializer, and writing the status value of the register to the log information, wherein the target deserializer is a deserializer connected to the target camera, and the second driver file is used to drive the target deserializer; in the event of a link failure in the target camera, the target file and the log information are exported, and fault diagnosis is performed based on the target file and the log information. Through the above method, the output interface function can be called to save the first frame image of the target camera to the target file under the target path, and the register read back function can be called to write the status value of the register in the target deserializer connected to the target camera into the log information. In this way, when there is a link failure in the target camera, it can be quickly diagnosed based on the target file and log information, avoiding the defect of the existing technology that each link in the camera link needs to be checked one by one, thereby improving the fault diagnosis efficiency of the camera link. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0040] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0041] Figure 1 A flowchart of a camera link fault diagnosis method provided in an embodiment of the present application;

[0042] Figure 2 This is a block diagram of the camera link architecture provided in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of the structure of a camera link fault diagnosis device provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0046] The disclosure below provides many different embodiments or examples for implementing different configurations of the present invention. To simplify the disclosure of the present invention, the components and configurations of specific examples are described below. Of course, these are merely examples and are not intended to limit the present invention. In addition, the present invention may repeat reference numerals and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or configurations discussed.

[0047] In order to solve the problem in the prior art that when a camera link fails, each link in the camera link needs to be checked one by one, resulting in low fault diagnosis efficiency, the present application provides a camera link fault diagnosis method, device, electronic device and storage medium, which can improve the fault diagnosis efficiency of the camera link.

[0048] See also Figure 1 , Figure 1 This is a flow chart of a camera link fault diagnosis method provided in an embodiment of the present application. Figure 1 As shown, the camera link fault diagnosis method may include the following steps:

[0049] Step 101: Call the output interface function preset in the first driver file to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path, wherein the first driver file is used to drive the image front-end engine, the target camera is the currently turned on camera, and the target path and target file are determined based on the target camera and the preset correspondence relationship, and the preset correspondence relationship is used to characterize the mapping relationship between the camera, the path and the file.

[0050] It should be noted that the camera link fault diagnosis method provided in the embodiment of the present application can be used to diagnose the camera link of various cameras on the vehicle. The camera link can be a camera module (including other hardware such as a serializer and a lens) - a deserializer - an image front-end engine (IFE) and a camera serial interface (CSI) driver - an image processing engine - a client (i.e., the application corresponding to the camera), such as Figure 2 As shown in the figure, the serializer is used to convert parallel data into serial data for transmission. The deserializer is used to convert serial data back into parallel data for reception. The serializer and deserializer use Gigabit Multimedia Serial Links (GMSL) for high-speed communication, typically using coaxial cables or twisted pair cables for data transmission. The image front-end engine (IFE) is primarily responsible for processing the raw image data captured by the camera, including operations such as color correction, noise reduction, and image enhancement to improve image quality. CSI is a high-speed serial interface standard for connecting the camera and the image front-end engine. The CSI driver is responsible for managing and controlling the CSI interface, ensuring that camera data is efficiently and accurately transmitted to the image front-end engine for further processing. The deserializer, image front-end engine (IFE), camera serial interface driver, and image front-end engine all belong to the Ais_server and run on the QNX operating system (a Unix-like real-time operating system). The client is the Ais_client and runs on the Android operating system. The Ais_server and Ais_client interact via sockets.

[0051] Specifically, the first driver file is a driver file for driving the image front-end engine (IFE). The image output interface function is pre-set in the first driver file. This image output interface function is primarily responsible for writing the first frame image of the corresponding camera into the file system and storing it in a specified path. The preset correspondence relationship can be used to characterize the mapping relationship between cameras, paths, and files. This preset correspondence relationship is predefined. In this way, based on this preset correspondence relationship and the identification information of each camera, the path and file for storing the first frame image of each camera can be determined.

[0052] In the entire camera link, since coaxial cable or twisted pair cable is used for data transmission between the serializer and the deserializer, it is impossible to output the image (i.e., transfer the image frame) on the coaxial cable or twisted pair cable. If you want to check whether the image output on the module end of the link is abnormal, you can add an output interface function in the driver file (i.e., the first driver file) of the image front-end engine IFE, so that the image frame of the camera can be output when passing through the image front-end engine IFE to obtain the first frame image, and save the first frame image to the target file under the target path.

[0053] Step 102: Call the register readback function pre-set in the second driver file to read back the status value of the register in the target deserializer, and write the status value of the register to the log information, wherein the target deserializer is the deserializer connected to the target camera, and the second driver file is used to drive the target deserializer.

[0054] Specifically, the above-mentioned second driver file is a driver file for driving the target deserializer, and the target deserializer is a deserializer connected to the target camera. The status value of the above-mentioned register may include but is not limited to a combination of one or more of the status values ​​of the lock status register, count register, video signal status register and flow register in the target deserializer, or a combination with other register status values, which is not specifically limited in the embodiment of the present application. It should be noted that the lock status register here is used to identify the connection status between the serializer and the deserializer. If the connection between the serializer and the deserializer is normal, the register bit is 1; if the connection between the serializer and the deserializer is abnormal, the register bit is 0. The video signal status register here is used to identify the status of the target deserializer receiving video information. If the target deserializer receives the first frame of image, the register bit is 1. If the target deserializer does not receive the first frame of image, the register bit is 0. The count register here is used to identify the number of image frames received by the target deserializer. Each time a frame of image is received, the register bit is increased by 1. The stream start register here is used to identify whether streaming is enabled. If streaming is enabled, the register bit is written to the specified value; if streaming is not enabled, the register bit is written to an unspecified value. Different types of target deserializers may have different internal register types.

[0055] Step 103: When a link failure occurs in the target camera, the target file and log information are exported, and fault diagnosis is performed based on the target file and log information.

[0056] In this step, if a link failure is found in the target camera, such as a distorted screen or a black screen, the target file and log information can be exported and the fault diagnosis can be performed based on the target file and log information.

[0057] In this embodiment, the output interface function can be called to save the first frame image of the target camera to the target file under the target path, and the register read back function can be called to write the status value of the register in the target deserializer connected to the target camera into the log information. In this way, when there is a link failure in the target camera, a quick diagnosis can be performed based on the target file and log information, avoiding the defect in the existing technology that each link in the camera link needs to be checked one by one, thereby improving the fault diagnosis efficiency of the camera link.

[0058] Furthermore, the above step 101, calling the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to the target file under the target path, includes:

[0059] Call the first library function encapsulated in the output interface function to open the target file;

[0060] Call the second library function encapsulated in the output interface function to write the first frame image into the target file;

[0061] Call the third library function encapsulated in the output interface function to close the target file under the target path.

[0062] In one embodiment, the output interface function CameraWriteFile is pre-encapsulated with a first library function CameraOpenFile, a second library function fwrite, and a third library function CameraCloseFile, wherein the first library function CameraOpenFile is a function encapsulated by fopen, and its function is to open a file with a specified path and a specified file name to store a frame of image to be written. As an optional implementation, the specified path here can be / qnxlog, and the file name can be: framenum_cameraid.yuv (where framenum refers to the image frame number, and cameraid refers to the corresponding camera identification information). The second library function fwrite is used to write the image frame into the opened file. The third library function CameraCloseFile is a function encapsulated by fclose, which closes the opened file after completing the writing of the image frame into the file system.

[0063] It can be seen that when calling the output interface function pre-set in the first driver file to output the first frame image captured by the target camera, the first library function CameraOpenFile, the second library function fwrite and the third library function CameraCloseFile can be called in sequence to save the first frame image to the target file under the target path.

[0064] Furthermore, before the above step 101, in which the output interface function preset in the first driver file is called to output the first frame image captured by the target camera to save the first frame image to the target file under the target path, the method further includes:

[0065] Obtain the target identifier corresponding to the target camera, and assign a value to the target global variable based on the target identifier, wherein the assigned target global variable is used to indicate the identification information of the currently turned on camera;

[0066] Based on the assigned target global variable, determine whether the image frame currently received by the image front-end engine is sent by the target camera;

[0067] When it is determined that the image frame currently received by the image front-end engine is sent by the target camera, the steps are executed: calling the output interface function to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path.

[0068] In one embodiment, before calling the output interface function pre-set in the first driver file to output the first frame of image captured by the target camera, it is also possible to determine whether it is necessary to call the output interface function based on the target identifier corresponding to the target camera. Specifically, the target identifier corresponding to the target camera (i.e., cameraid) can be obtained first, and then the target global variable (i.e., CameraID) is assigned based on the target identifier, i.e., CameraID = cameraid. Then, based on the assigned target global variable CameraID, it can be determined whether the image frame currently received by the image front-end engine IFE is sent by the target camera. If it is determined that the image frame currently received by the image front-end engine IFE is sent by the target camera, the output interface function can be called to output the first frame of image captured by the target camera. If it is determined that the image frame currently received by the image front-end engine IFE is not sent by the target camera, the output interface function is not called.

[0069] In this embodiment, an identification information can be defined for each camera. When the data of a certain camera flows into the image front-end engine IFE, it can be determined whether it is the data of the camera that has just been turned on based on the identification information carried in the data, so as to accurately call the output interface function.

[0070] Furthermore, after the above step 101, in which the output interface function preset in the first driver file is called to output the first frame image captured by the target camera to save the first frame image to a target file under the target path, the method further includes:

[0071] Restore the assigned target global variable to its initial value.

[0072] Specifically, the above initial value can be set according to actual needs, such as any negative number.

[0073] In one embodiment, based on the assigned target global variable CameraID, it is determined whether the image frame currently received by the image front-end engine IFE is sent by the target camera. If it is determined that the image frame currently received by the image front-end engine IFE is sent by the target camera, the image output interface function can be called to output the first frame of the image captured by the target camera. After this, it is also necessary to restore the assigned target global variable CameraID to its initial value (such as -1) so that when the next camera is turned on, the target global variable CameraID is reassigned and, based on the newly assigned target global variable, it is determined whether the image output interface function needs to be called.

[0074] Furthermore, the above step 102, calling the register readback function preset in the second driver file to read the status value of the register in the target deserializer, and writing the status value of the register to the log information, includes:

[0075] Calling a register readback function to read the status value of a register in the target deserializer, wherein the status value of the register includes the status value of a lock status register, the status value of a count register, the status value of a video signal status register, and / or the status value of a stream start register;

[0076] The status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the current start register are written into the log information.

[0077] See also Figure 2, since the camera code framework of the QNX operating system is an ais architecture, based on this framework, it is optimal to add a register readback mechanism in the second driver file (such as the max96722 driver file). The second driver file can be located in the ImagingInputs / SensorLibs directory. The register readback solution is based on the existing logic of the second driver file, and a new register readback function is added. Since the driver will only be loaded once when the QNX operating system is started, the register readback function dumpreg will be called each time the flow starts. The register readback function dumpreg is mainly responsible for obtaining the status value of the register in the target deserializer. The status value of the register in the target deserializer may include but is not limited to a combination of one or more of the status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the flow register, or a combination with other register status values, which is not specifically limited in the embodiments of the present application. It should be noted that the lock status register here is used to identify the connection status between the serializer and the deserializer. If the connection between the serializer and the deserializer is normal, the register bit is 1; if the connection between the serializer and the deserializer is abnormal, the register bit is 0. The video signal status register here is used to identify the status of the target deserializer receiving video information. If the target deserializer receives the first frame of image, the register bit is 1; if the target deserializer does not receive the first frame of image, the register bit is 0. The count register here is used to identify the number of image frames received by the target deserializer. Each time a frame of image is received, the register bit is incremented by 1. The stream start register here is used to identify whether streaming is started. If streaming is started, the register bit is the specified value written; if streaming is not started, the register bit is an unspecified value.

[0078] In one embodiment, a register readback function can be called to read the status values ​​of the aforementioned registers in the target deserializer, and then the status values ​​of the aforementioned registers can be written to the log information. This facilitates subsequent determination of whether the target camera link is abnormal based on the status values ​​of the various registers in the log information, such as whether there is an abnormal connection between the target deserializer and the serializer, whether there is an abnormal connection between the target deserializer and the camera module, whether the camera module is normally outputting image frames to the target deserializer, and whether streaming is occurring, thereby enabling rapid diagnosis of camera link failures.

[0079] Furthermore, before the above step 102, calling the register readback function preset in the second driver file to read the status value of the register in the target deserializer and writing the status value of the register to the log information, the method further includes:

[0080] Calling the device detection function pre-set in the second driver file to detect the target deserializer and obtain the chip identifier of the target deserializer;

[0081] Call the initialization setting function pre-set in the second driver file to initialize the registers in the target deserializer according to the chip identification;

[0082] Call the streaming function preset in the second driver file to enable the register in the target deserializer, and execute the steps: call the register readback function preset in the second driver file to read the status value of the register in the target deserializer, and write the status value of the register to the log information.

[0083] Specifically, the above-mentioned device detection function can be the interface function max96722_sensor_detect_device in the second driver file, which is mainly responsible for detecting the target deserializer, that is, using the integrated circuit bus (Inter-Integrated Circuit, abbreviated as IIC) to read the chip identification (i.e., chipid) of the target deserializer. The above-mentioned initialization setting function can be the interface function max96722_sensor_init_setting in the second driver file, which is mainly used to initialize the status values ​​of the registers in the target deserializer, such as setting the status value of the lock status register, the status value of the count register, the status value of the video signal status register, and the status value of the start-up stream register to zero. The above-mentioned start-up stream function can be the interface function max96722_sensor_start_stream in the second driver file, which is mainly used to enable the mipi_out related registers of the target deserializer and call the register readback function dumpreg.

[0084] In one embodiment, the device detection function pre-set in the second driver file can be called first to detect the target deserializer and obtain the chip identification of the target deserializer. Then, the initialization setting function pre-set in the second driver file can be called to initialize the register status in the target deserializer according to the chip identification. Then, the streaming function pre-set in the second driver file can be called to enable the register in the target deserializer, and the register readback function pre-set in the second driver file can be called to read the status value of the register in the target deserializer, and write the status value of the register to the log information.

[0085] Through the above method, the register status in each target deserializer can be initialized before calling the register readback function to ensure the authenticity of the register status value read back by the register readback function. In addition, the register readback function can be called each time the flow is started to obtain the status of key registers, making it easier to directly view the relevant status from the log and locate the problem.

[0086] Furthermore, the above step 103, performing fault diagnosis based on the target file and log information, includes:

[0087] Determine whether the first frame image in the target file is abnormal, and determine whether the hardware module of the target camera is abnormal based on the determination result; and

[0088] Determine whether the status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the flow register in the log information are abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

[0089] In one embodiment, when a link failure occurs in a target camera, the target file and log information can be exported, and fault diagnosis can be performed based on the target file and log information. Specifically, it can be determined whether the first frame image in the target file is abnormal (such as a flower screen, a green screen, a color cast, etc.), and based on the judgment result, it can be determined whether the hardware module of the target camera is abnormal, that is, whether the hardware module of the target camera is damaged and the camera display screen is abnormal. In addition, it can also be determined whether the status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the flow register in the log information are abnormal, and based on the judgment result, it can be determined whether the link of the target camera is disconnected, that is, whether the situation of no picture display (black screen) is caused by the disconnection of a certain link in the target camera.

[0090] Through the above method, the camera link fault can be quickly diagnosed directly based on the target file and log information, avoiding the defect of the existing technology that each link in the camera link needs to be checked one by one, thereby improving the fault diagnosis efficiency of the camera link.

[0091] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a camera link fault diagnosis device provided in an embodiment of the present application. Figure 3 As shown, the camera link fault diagnosis device 300 includes:

[0092] A first calling module 301 is configured to call a pre-set output interface function in a first driver file to output a first frame of image captured by a target camera, so as to save the first frame of image to a target file under a target path, wherein the first driver file is configured to drive an image front-end engine, the target camera is a currently activated camera, and the target path and target file are determined based on a preset correspondence between the target camera and a preset correspondence, wherein the preset correspondence is configured to characterize a mapping relationship between the camera, the path, and the file;

[0093] A second calling module 302 is configured to call a register readback function pre-set in a second driver file to read back a status value of a register in a target deserializer, and write the status value of the register to a log message, wherein the target deserializer is a deserializer connected to a target camera, and the second driver file is configured to drive the target deserializer;

[0094] The fault diagnosis module 303 is used to export target files and log information when a link failure occurs in the target camera, and perform fault diagnosis based on the target files and log information.

[0095] Furthermore, the first calling module 301 includes:

[0096] The first calling submodule is used to call the first library function encapsulated in the output interface function to open the target file;

[0097] The second calling submodule is used to call the second library function encapsulated in the image output interface function to write the first frame image into the target file;

[0098] The third calling submodule is used to call the third library function encapsulated in the output interface function to close the target file under the target path.

[0099] Furthermore, the camera link fault diagnosis device 300 further includes:

[0100] An acquisition module is used to obtain a target identifier corresponding to a target camera and assign a value to a target global variable based on the target identifier, wherein the assigned target global variable is used to indicate the identification information of the currently turned-on camera;

[0101] A judgment module is used to judge whether the image frame currently received by the image front-end engine is sent by the target camera based on the assigned target global variable;

[0102] The execution module is used to execute the steps of calling the output interface function to output the first frame image captured by the target camera when it is determined that the image frame currently received by the image front-end engine is sent by the target camera, so as to save the first frame image to the target file under the target path.

[0103] Furthermore, the camera link fault diagnosis device 300 further includes:

[0104] The recovery module is used to restore the target global variable to its initial value after assignment.

[0105] Furthermore, the second calling submodule includes:

[0106] A fourth calling submodule is used to call a register readback function to read the status value of a register in the target deserializer, wherein the status value of the register includes the status value of a lock status register, the status value of a count register, the status value of a video signal status register and / or the status value of a stream start register;

[0107] The writing submodule is used to write the status value of the lock status register, the status value of the counting register, the status value of the video signal status register and / or the status value of the current starting register into the log information.

[0108] Furthermore, the camera link fault diagnosis device 300 further includes:

[0109] The third calling module is used to call the device detection function preset in the second driver file to detect the target deserializer and obtain the chip identifier of the target deserializer;

[0110] A fourth calling module is used to call the initialization setting function preset in the second driver file to initialize the registers in the target deserializer according to the chip identifier;

[0111] The fifth calling module is used to call the streaming function preset in the second driver file to enable the register in the target deserializer, and execute the steps: calling the register readback function preset in the second driver file to read the status value of the register in the target deserializer, and writing the status value of the register to the log information.

[0112] Furthermore, the fault diagnosis module 303 includes:

[0113] A first judgment submodule is configured to judge whether the first frame image in the target file is abnormal, and determine whether the hardware module of the target camera is abnormal based on the judgment result; and

[0114] The second judgment submodule is used to judge whether the status value of the lock status register, the status value of the count register, the status value of the video signal status register and / or the status value of the flow register in the log information are abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

[0115] It should be noted that the camera link fault diagnosis device 300 can implement the camera link fault diagnosis method provided by any of the aforementioned method embodiments and achieve the same technical effects, which will not be described in detail here.

[0116] like Figure 4 As shown, the embodiment of the present application further provides an electronic device, including a processor 411, a communication interface 412, a memory 413 and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other through the communication bus 414.

[0117] Memory 413, for storing computer programs;

[0118] In one embodiment of the present application, the processor 411 is configured to implement the camera link fault diagnosis method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 413 .

[0119] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the camera link fault diagnosis method provided by any of the aforementioned method embodiments.

[0120] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0121] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.

[0122] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0123] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A camera link fault diagnosis method, characterized in that: The camera link includes a camera module, a deserializer, an image front-end engine, a camera serial interface driver, an image processing engine and a client, and the method includes: Call the output interface function preset in the first driver file to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path, wherein the first driver file is used to drive the image front-end engine, the target camera is the currently turned on camera, the target path and the target file are determined based on the target camera and a preset correspondence relationship, the preset correspondence relationship is used to characterize the mapping relationship between the camera, the path and the file, the output interface function is pre-encapsulated with a first library function, a second library function and a third library function, the first library function is used to open the target file, the second library function is used to write the first frame image to the target file, and the third library function is used to close the target file under the target path; Calling a register readback function preset in a second driver file to read back a status value of a register in a target deserializer, and writing the status value of the register to log information, wherein the target deserializer is a deserializer connected to the target camera, and the second driver file is used to drive the target deserializer, and the status value of the register includes a status value of a lock status register, a status value of a count register, a status value of a video signal status register, and / or a status value of a stream start register; In the event that a link failure occurs in the target camera, the target file and the log information are exported, and fault diagnosis is performed based on the target file and the log information.

2. The method according to claim 1, characterized in that The calling of the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to a target file under a target path includes: Calling the first library function encapsulated in the output interface function to open the target file; Calling the second library function encapsulated in the image output interface function to write the first frame image into the target file; The third library function encapsulated in the output interface function is called to close the target file under the target path.

3. The method according to claim 1, characterized in that Before calling the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to the target file under the target path, the method further includes: Obtaining a target identifier corresponding to the target camera, and assigning a value to a target global variable based on the target identifier, wherein the assigned target global variable is used to indicate identification information of the currently turned-on camera; Based on the assigned target global variable, determining whether the image frame currently received by the image front-end engine is sent by the target camera; When it is determined that the image frame currently received by the image front-end engine is sent by the target camera, the steps are executed: calling the output interface function to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path.

4. The method according to claim 3, characterized in that After calling the output interface function preset in the first driver file to output the first frame image captured by the target camera to save the first frame image to a target file under the target path, the method further includes: Restore the assigned target global variable to its initial value.

5. The method according to claim 1, wherein Before calling the register readback function preset in the second driver file to read the status value of the register in the target deserializer and writing the status value of the register into the log information, the method further includes: Calling a device detection function preset in the second driver file to detect the target deserializer and obtain a chip identifier of the target deserializer; Calling the initialization setting function preset in the second driver file to initialize the registers in the target deserializer according to the chip identifier; Call the streaming function preset in the second driver file to enable the register in the target deserializer, and execute the steps: call the register readback function preset in the second driver file to read the status value of the register in the target deserializer, and write the status value of the register to the log information.

6. The method according to claim 1, characterized in that The performing fault diagnosis based on the target file and the log information includes: Determining whether the first frame image in the target file is abnormal, and determining whether the hardware module of the target camera is abnormal based on the determination result; and Determine whether the status value of the lock status register, the status value of the counting register, the status value of the video signal status register and / or the status value of the flow register in the log information are abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

7. A camera link fault diagnosis device, characterized in that: The camera link includes a camera module, a deserializer, an image front-end engine, a camera serial interface driver, an image processing engine and a client, and the device includes: A first calling module is used to call the output interface function preset in the first driving file to output the first frame image captured by the target camera, so as to save the first frame image to the target file under the target path, wherein the first driving file is used to drive the image front-end engine, the target camera is the currently turned on camera, the target path and the target file are determined based on the target camera and a preset correspondence relationship, the preset correspondence relationship is used to characterize the mapping relationship between the camera, the path and the file, the output interface function is pre-encapsulated with a first library function, a second library function and a third library function, the first library function is used to open the target file, the second library function is used to write the first frame image to the target file, and the third library function is used to close the target file under the target path; A second calling module is configured to call a register readback function preset in a second driver file to read back a status value of a register in a target deserializer, and write the status value of the register into log information, wherein the target deserializer is a deserializer connected to the target camera, and the second driver file is configured to drive the target deserializer, and the status value of the register includes a status value of a lock status register, a status value of a count register, a status value of a video signal status register, and / or a status value of a stream start register; A fault diagnosis module is used to export the target file and the log information when a link failure occurs in the target camera, and to perform fault diagnosis based on the target file and the log information.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; The processor is configured to implement the camera link fault diagnosis method according to any one of claims 1 to 6 when executing a program stored in the memory.

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 camera link fault diagnosis method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Automobile fault diagnosis method and application thereof

    CN116661285A

  • Vehicle camera fault detection and recovery method, system and device

    CN117579811A