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

By calling the diagram interface function and the register recovery function, the camera link failure is quickly diagnosed, the problem of low failure diagnosis efficiency in existing technologies has been solved, and efficient fault positioning and diagnosis is achieved.

CN119363964AActive Publication Date: 2025-01-24CHENGDU CELIS TECH CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when the camera link fails, it is necessary to check each link in the camera link one by one, resulting in low fault diagnosis efficiency.

Method used

By calling the first -frame image of the target camera collected by the pre -set drawing interface function set in the first driver file, and save it to the target file under the target path; Reading the register back to read the status value of the register in the target solution, and write it into the log information. In the case of a link failure in the target camera, the target file and log information is exported, and the fault diagnosis is performed based on this.

Benefits of technology

Through the above methods, the camera link failure can be quickly diagnosed, and the defects of various links need to be checked one by one in the existing technology, thereby improving the fault diagnosis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363964A_ABST
    Figure CN119363964A_ABST
Patent Text Reader

Abstract

The invention relates to a camera link fault diagnosis method and device, electronic equipment and a storage medium, and the method comprises the steps: calling a preset image output interface function in a first drive file to output a first frame image collected by a target camera, so as to store the first frame image in a target file under a target path; calling a register read-back function preset in the second drive file to read back a state value of a register in the target deserializer, and writing the state value of the register into the log information; and under the condition that the target camera has the link fault, exporting the target file and the log information, and performing fault diagnosis based on the target file and the log information. Therefore, fault diagnosis can be rapidly carried out based on the target file and the log information, the defect that in the prior art, all links in the camera link need to be checked one by one is overcome, and therefore the fault diagnosis efficiency of the camera link is improved.
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 more intelligent, on-board cameras play an increasingly important role in vehicles. For example, on-board cameras can be used as image acquisition terminals 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 the prior art, when a camera link fails (such as a distorted screen or a black screen), each link in the camera link needs to be checked one by one, resulting in low fault diagnosis efficiency. Therefore, how to improve the fault diagnosis efficiency of the camera link has become a technical problem that needs to be solved urgently. 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, the target path and the target file are determined based on the target camera and a preset corresponding relationship, and the preset corresponding relationship is used to characterize a mapping relationship between a camera, a path, and a 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 into 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 under 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 the target file under the target path, the method further includes:

[0014] Obtaining a target identifier corresponding to the target camera, and assigning a target global variable based on the target identifier, wherein the assigned target global variable is used to indicate the identifier 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 image 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 under the target path, the method further includes:

[0018] The assigned target global variable is restored 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 into 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 flow start 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 to obtain a chip identifier of the target deserializer;

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

[0025] Call the pre-set stream start function in the second driver file to enable the register in the target deserializer, and execute the steps: call the pre-set register read back function 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 into the log information.

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

[0027] Determine whether the first frame image in the target file is abnormal, and determine whether the hardware module of the target camera is abnormal according to 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 start 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 used to call a pre-set output interface function in a first driving 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 driving file is used to drive an image front-end engine, the target camera is a currently turned-on camera, the target path and the target file are determined based on the target camera and a preset corresponding relationship, and the preset corresponding relationship is used to characterize a mapping relationship between a camera, a path, and a file;

[0031] A second calling module, used 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 used 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, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0034] Memory, used to store 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 having a computer program stored thereon, and 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 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, 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 camera currently turned on, 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 into 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, a quick diagnosis can be performed based on the target file and log information, avoiding the defect of the prior art 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

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

[0042] Figure 2 An architectural block diagram of a camera link 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0046] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings 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 A schematic diagram 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 pre-set 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 the preset corresponding relationship, and the preset corresponding 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 (Image front-end engine, referred to as IFE) and a camera serial interface (Camera Serial Interface, referred to as CSI) driver - an image processing engine - a client (i.e., the application corresponding to the camera), such as Figure 2 As shown. Among them, 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 the deserializer use Gigabit Multimedia Serial Links (GMSL) for high-speed communication, and generally use coaxial cables or twisted pairs for data transmission. The image front-end engine IFE is mainly responsible for processing the original image data captured by the camera, including color correction, noise reduction, image enhancement and other operations 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 to ensure that the camera data can be efficiently and accurately transmitted to the image front-end engine for further processing. Among them, the above-mentioned deserializer, image front-end engine IFE, camera serial interface driver and image front-end engine all belong to Ais_sever, and all run on the QNX operating system (i.e., a Unix-like real-time operating system); the above-mentioned client belongs to Ais_client, and runs on the Android (i.e., Android) operating system. Ais_sever interacts with Ais_client through sockets (i.e., Socket).

[0051] Specifically, the first driver file is a driver file for driving the image front-end engine IFE. The output interface function is pre-set in the first driver file, and the output interface function is mainly 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 the camera, the path and the file, and the preset correspondence relationship is pre-defined. In this way, the path and file for storing the first frame image of each camera can be determined based on the preset correspondence relationship and the identification information of each camera.

[0052] In the entire camera link, since the serializer and the deserializer use coaxial cable or twisted pair cable for data transmission, it is impossible to perform image output (i.e., transfer image frames) 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 image output interface function in the driver file of the image front-end engine IFE (i.e., the first driver file) to enable the camera's image frame to 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 into 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.

[0054] Specifically, the 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 state value of the above register may include, but is not limited to, a combination of one or more of the state values ​​of the lock state register, the count register, the video signal state register, and the start-up register in the target deserializer, or a combination with other register state values, which is not specifically limited in the embodiment of the present application. It should be noted that the lock state register here is used to identify the connection state between the adder and the deserializer. If the connection between the adder and the deserializer is normal, the register bit is 1; if the connection between the adder and the deserializer is abnormal, the register bit is 0. The video signal status register here is used to identify the state of the target deserializer receiving video information. If the target deserializer receives the first frame of the image, the register bit is 1, and if the target deserializer does not receive the first frame of the image, the register bit is 0. The count register here is used to identify the number of image frames received by the target deserializer, and the register bit is increased by 1 for each frame of the image received. The stream start register here is used to identify whether the stream is started. If the stream is started, the register bit is the specified value written; if the stream is not started, the register bit is a non-specified 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, when a link failure is found in the target camera, such as a distorted screen or a black screen, etc., 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 image 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 of the prior art 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] Further, the above step 101, calling the output interface function pre-set 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 the first library function CameraOpenFile, the second library function fwrite and the 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, calling the output interface function pre-set 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:

[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 identifier 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 following 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 collected 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 (i.e., cameraid) corresponding to the target camera can be obtained first, and then the target global variable (i.e., CameraID) can be 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 collected 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 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] Further, in the above step 101, 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 the 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, and when 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 that, it is also necessary to restore the assigned target global variable CameraID to the initial value (such as -1, etc.) 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 into the log information, includes:

[0075] Calling a register readback function to read the status value of a register in a 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 flow 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 the image, the register bit is 1; if the target deserializer does not receive the first frame of the 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 the image is received, the register bit is increased by 1. The flow start register here is used to identify whether the flow is started. If the flow is started, the register bit is the specified value written; if the flow is not started, the register bit is a non-specified value.

[0078] In one embodiment, the register readback function can be called to read the status value of the above register in the target deserializer, and then the status value of the above register is written into the log information. In this way, it is convenient to determine whether the link of the target camera is abnormal based on the status value of each register in the log information, such as whether the connection between the target deserializer and the serializer is abnormal, whether the connection between the target deserializer and the camera module is abnormal, whether the camera module normally outputs image frames to the target deserializer, whether the stream is started, etc., so as to quickly diagnose the camera link failure.

[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 into the log information, the method further includes:

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

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

[0082] Call the pre-set stream start function in the second driver file to enable the register in the target deserializer, and execute the steps: call the pre-set register readback function 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 into the log information.

[0083] Specifically, the 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, referred to as IIC) to read the chip identification (i.e., chipid) of the target deserializer. The 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 stream register to zero. The start 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, and 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 into 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, and the register readback function can be called each time the flow starts to obtain the status of the key registers, so as 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 according to 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 start register in the log information is abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

[0089] In one embodiment, when there is a link failure in the 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 whether the hardware module of the target camera is abnormal is determined based on the judgment result, that is, whether the hardware module of the target camera is damaged and the camera displays an abnormal picture. 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 whether the link of the target camera is disconnected is determined based on the judgment result, that is, whether a link in the target camera is disconnected, resulting in no picture display (black screen).

[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] The first calling module 301 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 the preset corresponding relationship, and the preset corresponding relationship is used to characterize the mapping relationship between the camera, the path and the file;

[0093] A second calling module 302 is used to call a register read-back 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 a target camera, and the second driver file is used to drive the target deserializer;

[0094] The fault diagnosis module 303 is used to export the target file and log information when a link failure occurs in the target camera, and perform fault diagnosis based on the target file 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 also includes:

[0100] An acquisition module, used to acquire 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 identifier 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 also 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 a status value of a register in a target deserializer, wherein the status value of the register includes a status value of a lock status register, a status value of a counting register, a status value of a video signal status register and / or a 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 flow start register into the log information.

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

[0109] A 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, 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 pre-set in the second driver file to enable the register in the target deserializer, and execute the steps: call the register readback function pre-set 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 into the log information.

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

[0113] A first judgment submodule is used 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 according to 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 counting register, the status value of the video signal status register and / or the status value of the flow register in the log information is 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 can achieve the same technical effect, which will not be described one by one 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, used for storing computer programs;

[0118] In one embodiment of the present application, the processor 411 is used 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, the camera link fault diagnosis method provided by any of the aforementioned method embodiments is implemented.

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

[0121] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for 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 some parts of the embodiments.

[0122] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence 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 interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0123] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be 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 will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A camera link fault diagnosis method, characterized in that: The method comprises: 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, the target path and the target file are determined based on the target camera and a preset corresponding relationship, and the preset corresponding relationship is used to characterize a mapping relationship between a camera, a path, and a file; 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 into 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 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 the target file under the 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 target global variable based on the target identifier, wherein the assigned target global variable is used to indicate the identifier 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 image 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 the target file under the target path, the method further includes: The assigned target global variable is restored to its initial value.

5. The method according to claim 1, characterized in that: The calling of the register readback function pre-set 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 includes: 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; 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 start register are written into the log information.

6. The method according to claim 5, characterized in that 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 to obtain a chip identifier of the target deserializer; Calling the initialization setting function preset in the second driver file to initialize the register in the target deserializer according to the chip identifier; Call the pre-set stream start function in the second driver file to enable the register in the target deserializer, and execute the steps: call the pre-set register read back function 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 into the log information.

7. The method according to claim 5, characterized in that The performing fault diagnosis based on the target file and the log information includes: Determine whether the first frame image in the target file is abnormal, and determine whether the hardware module of the target camera is abnormal according to 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 start register in the log information are abnormal, and determine whether the link of the target camera is disconnected based on the judgment result.

8. A camera link fault diagnosis device, characterized in that: The device comprises: A first calling module is used to call a pre-set output interface function in a first driving 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 driving file is used to drive an image front-end engine, the target camera is a currently turned-on camera, the target path and the target file are determined based on the target camera and a preset corresponding relationship, and the preset corresponding relationship is used to characterize a mapping relationship between a camera, a path, and a file; A second calling module, used 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 used to drive the target deserializer; 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.

9. 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 through the communication bus; Memory, used to store computer programs; A processor, used to implement the camera link fault diagnosis method described in any one of claims 1 to 7 when executing a program stored in a memory.

10. 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 described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Server fault diagnosis test method and device, terminal and storage medium

    CN115454704A

  • Vehicle camera state monitoring method and device, computer equipment and storage medium

    CN116320379A

  • Camera interface fault diagnosis method and system for chip or equipment

    CN116366833A

  • Position estimation self-diagnosis method and device of multi-camera system, and storage medium

    CN116543047A

  • Automobile fault diagnosis method and application thereof

    CN116661285A