Disclosure of Invention
The embodiment of the invention aims to provide a driver debugging method and a driver debugging system, which avoid the situation that a developer manually searches for a file related to a driver as much as possible, reduce the labor cost and have higher intelligent degree.
In order to solve the above technical problem, an embodiment of the present invention provides a driver debugging method, including:
acquiring a project name and a project path corresponding to a driver to be debugged;
detecting whether N directory files meeting preset requirements exist under the project path; the preset requirement is that the file name is matched with a certain character string in the preset N character strings; n is an integer greater than 2;
and if N directory files meeting the preset requirement exist in the project path, acquiring the project configuration files in the folders corresponding to the project names in the directory files, and debugging the contents in the project configuration files.
The embodiment of the present invention further provides a driver debugging system, including: the device comprises an acquisition module, a detection module and a debugging module;
the acquisition module is used for acquiring a project name and a project path corresponding to a driver to be debugged;
the detection module is used for detecting whether N directory files meeting preset requirements exist under the project path according to the project path acquired by the acquisition module; the preset requirement is that the file name is matched with a certain character string in the preset N character strings; n is an integer greater than 2;
the debugging module is used for acquiring the project configuration files in the folders corresponding to the project names acquired by the acquisition module under the directory files when the detection module detects that N directory files meeting the preset requirements exist in the project path, and debugging the contents in the project configuration files.
Compared with the prior art, the driver debugging system can detect whether N directory files meeting the preset requirement exist in the project path under the condition of acquiring the project name and the project path corresponding to the driver to be debugged, so as to conveniently authenticate whether the project path is correct. The preset requirement is that the file name is matched with a certain character string in the preset N character strings; n is an integer greater than 2. If N directory files meeting the conditions exist in the project path, the project path is correct, and at the moment, the driver debugging system can automatically find the project configuration files in the folder corresponding to the driver according to the project name and debug the contents in the project configuration files, so that the situation that developers manually find the files related to the driver is avoided as much as possible, the labor cost is reduced, and the intelligent degree is high.
In addition, acquiring the project configuration files in the folders corresponding to the project names under the directory files specifically includes: and under the directory file, acquiring a file with a folder name of an item name, wherein the file name comprises a file of a Config character string. Thus, a concrete implementation form for acquiring the project configuration file is provided, and the feasibility of the embodiment of the invention is increased.
In addition, debugging the content in the project configuration file specifically includes: detecting whether the number of the files of which the acquired file names comprise the Config character strings is greater than 1; if the number is more than 1, randomly selecting a file with the file name comprising the Config character string, debugging the content in the file, and storing debugging information; the debugging information is synchronized to the content of the file with the file name including the Config character string, so that the project configuration files do not need to be debugged one by one, the debugging efficiency is high, omission is avoided, and mistakes are not easy to occur.
In addition, N is 3; the preset N character strings are as follows: device, kernel, vendor. In this way, whether the project path is correct or not is verified by detecting whether the project global configuration file (device file), the operating system kernel file (kernel file) and the platform manufacturer customized file (vendor file) exist in the project path, so that the operation is simple and convenient, and the feasibility is high.
In addition, after debugging the content in the project configuration file, the method further comprises the following steps: detecting whether the file name of the directory file is device; and if the file name of the directory file is not device, acquiring a drive file in a folder of a platform manufacturer under the directory file, and debugging the content in the drive file. By the method, the driver debugging system can also debug the kernel file of the operating system and the driver file under the customized file of the platform manufacturer, thereby further avoiding the situation that developers manually search for the file related to the driver and effectively improving the intelligent degree of the driver debugging system.
In addition, under the directory file, the drive file in the file folder of the platform manufacturer is obtained, which specifically includes: detecting whether a folder with a folder name of an item name exists in a folder of a platform manufacturer under a directory file; if a folder with a folder name of the project name exists in the folder of the platform manufacturer, acquiring a drive file in the folder with the folder name of the project name; and if the folder with the folder name being the project name does not exist in the folder of the platform manufacturer, acquiring the platform name corresponding to the driver to be debugged, and acquiring the drive file in the folder with the folder name being the platform name. Therefore, when the folder with the folder name of the project name does not exist in the folder of the platform manufacturer, the driver debugging system can still search the driver file in the folder of the platform manufacturer, and the feasibility of the implementation mode of the invention is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the invention relates to a driver debugging method, and the specific flow is shown in fig. 1. The implementation mode can be implemented on the basis of a driver debugging system, and comprises the following steps:
step 101, acquiring a project name and a project path corresponding to a driver to be debugged.
Specifically, the developer may input the project name and the project path corresponding to the driver to be debugged into the driver debugging system, so that the driver debugging system can obtain the project name and the project path corresponding to the driver to be debugged. The following description will be made by taking the M1612 project camera driver as an example: for example, the driver to be debugged has the item name of M1612 and the item path of Y:// project/z193_ 1202.
Step 102, detecting whether N directory files meeting preset requirements exist in the project path. If the detection result is yes, step 103 is executed, otherwise step 101 is executed.
Specifically, the preset requirement is that the file name is matched with a certain character string in preset N character strings, wherein N is an integer greater than 2. In the present embodiment, N is 3. The preset N character strings are as follows: device, kernel, vendor.
More specifically, because the project global configuration file (device file), the operating system kernel file (kernel file), and the platform vendor customized file (vendor file) exist simultaneously in the correct project path, according to this feature, in the embodiment, the driver debug system detects whether the project global configuration file (device file), the operating system kernel file (kernel file), and the platform vendor customized file (vendor file) exist in the project path by detecting whether N directory files meeting preset requirements exist in the project path, so as to verify whether the project path is correct, and the operation is simple and convenient, and the feasibility is high.
In this embodiment, when detecting that a directory file with a kernel word name exists in the project path, the driver debug system also returns the full name of the directory file for recording. Therefore, when debugging is carried out next time, the directory file can be directly searched according to the recorded full name of the directory file, and the method is accurate and rapid.
Step 103, acquiring the project configuration files in the folders corresponding to the project names under the directory files, and debugging the contents in the project configuration files.
Specifically, the project configuration files are generally named in a manner including a Config string, such as a file with a project Config file name, a file with a Config file name, and the like. Therefore, the driver debugging system can acquire the project configuration file by acquiring the file with the file name including the Config character string in the folder with the folder name as the project name in the directory file. If the project name of the driver to be debugged is M1612 and the project path is Y:// project/z193_1202, the driver debugging system can obtain the project global configuration file, the operating system kernel file and the platform vendor customized file respectively under Y:// project/z193_1202, wherein the file name comprises the file of the Config character string in the folder with the folder name of M1612.
More specifically, there may be multiple project profiles that need to be debugged due to project global profiles, operating system kernel files, or platform vendor customized files. Therefore, when the driver debugging system debugs the content in the project configuration file, it can also detect whether the number of the files with the file names including the Config character strings is greater than 1. If the number is larger than 1, a file with the file name comprising the Config character string is randomly selected, the content in the file is debugged, debugging information is stored, then the driver debugging system synchronizes the debugging information to the content of the file with the file name comprising the Config character string, so that the engineering configuration files do not need to be debugged one by one, the debugging efficiency is high, omission is avoided, and mistakes are not easy to occur.
Compared with the prior art, in the embodiment, the driver debugging system can automatically find the project configuration file in the folder corresponding to the driver according to the acquired project name and project path, and debug the content in the project configuration file, so that the situation that a developer manually searches for the file related to the driver is avoided as much as possible, the labor cost is reduced, and the intelligent degree is high.
The second embodiment of the present invention relates to a driver debugging method, and the specific flow is shown in fig. 2. The second embodiment is improved on the basis of the first embodiment, and the main improvement lies in that: in the second embodiment of the present invention, the driver debugging system also debugs the driver file corresponding to the driver, thereby further avoiding a situation that a developer manually searches for a file related to the driver, and effectively improving the intelligence degree of the driver debugging system. The following is specifically described:
in this embodiment, steps 201 to 203 are substantially the same as steps 101 to 103 in the first embodiment, and for avoiding redundancy, description is omitted here, and different parts are described below:
step 204, detecting whether the file name of the directory file is device. If the detected result is yes, the process is ended, otherwise step 205 is executed.
Specifically, the driver debugging system detects whether the file name of the directory file is device, so as to obtain the kernel file of the operating system and the customized file of the platform manufacturer.
Step 205, obtaining the drive file in the platform manufacturer folder under the directory file, and debugging the content in the drive file.
Specifically, the folder in which the drive file in the platform manufacturer folder is located may be named by the name of the project or by the name of the platform, and the priority of the folder established by the name of the project is higher than that of the folder established by the name of the platform, so that the driver debugging system can detect whether the folder with the name of the folder called the name of the project exists in the platform manufacturer folder under the directory file when the drive file in the platform manufacturer folder is obtained under the directory file. And debugging the content in the folder with the folder name of the project name if the folder with the folder name of the project name exists in the folder of the platform manufacturer. And if the folder with the folder name as the project name does not exist in the folder of the platform manufacturer, acquiring the platform name corresponding to the driver to be debugged, and debugging the content in the folder with the folder name as the platform name. Therefore, when the folder with the folder name being the project name does not exist in the folder of the platform manufacturer, the driver debugging system can still search the driver file in the folder of the platform manufacturer, and the feasibility is high. The platform name corresponding to the driver to be debugged can be input into the driver debugging system by a developer.
The following description will be given by taking the M1612 entry camera driver and the directory file as the kernel file of the operating system as examples:
for example, under the kernel file of the operating system, the folder in which the driver file in the platform manufacturer folder is located is an src folder. Thus, the driver debugging system firstly judges whether a folder with a folder name of M1612 exists under the src folder, and if the folder with the folder name of M1612 exists, the driver debugging system debugs the content in the folder with the folder name of M1612 under the src folder; if there is no folder with folder name M1612, the driver debugging system debugs the contents in the folder with folder name mt6755 according to the platform name corresponding to the driver to be debugged, such as the platform name mt 6755.
More specifically, since the folder named by the platform name is mostly a folder beginning with "mt", the driver debugging system does not need to acquire the platform name corresponding to the driver to be debugged. If the drive file in the platform manufacturer folder is obtained under the directory file, when the content in the drive file is debugged, the drive program debugging system directly detects whether the folder with the folder name of the project name exists in the platform manufacturer folder under the directory file, and when the folder with the folder name of the project name exists in the platform manufacturer folder, the content in the folder with the folder name of the project name is debugged; when detecting that no folder with the folder name of the project name exists in the folder of the platform manufacturer, acquiring all folders with the folder names beginning with the mt and displaying the folders to facilitate the selection of developers, so that the driver debugging system acquires the correct drive file. In this embodiment, no limitation is made on the specific implementation form of the driver file in the folder of the platform manufacturer under the condition of acquiring the directory file.
Compared with the prior art, in the embodiment: the driver debugging system can also debug the kernel file of the operating system and the driver file under the customized file of the platform manufacturer, thereby further avoiding the situation that developers manually search for the file related to the driver and effectively improving the intelligent degree of the driver debugging system.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the steps contain the same logical relationship, which is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to a driver debugging system, as shown in fig. 3, including: the device comprises an acquisition module 1, a detection module 2 and a debugging module 3.
The obtaining module 1 is configured to obtain a project name and a project path corresponding to a driver to be debugged.
Specifically, the developer may input the project name and the project path corresponding to the driver to be debugged into the obtaining module 1, so that the obtaining module 1 obtains the project name and the project path corresponding to the driver to be debugged. The following description will be made by taking the M1612 project camera driver as an example: for example, the driver to be debugged has the item name of M1612 and the item path of Y:// project/z193_ 1202.
The detection module 2 is configured to detect whether N directory files meeting preset requirements exist under the item path according to the item path acquired by the acquisition module 1.
Specifically, the preset requirement is that the file name is matched with a certain character string in preset N character strings, wherein N is an integer greater than 2. In the present embodiment, N is 3. The preset N character strings are as follows: device, kernel, vendor.
More specifically, because the project global configuration file (device file), the operating system kernel file (kernel file) and the platform vendor customized file (vendor file) exist simultaneously in the correct project path, according to this feature, in the present embodiment, the detection module 2 detects whether the project global configuration file (device file), the operating system kernel file (kernel file) and the platform vendor customized file (vendor file) exist in the project path in a manner of detecting whether N directory files meeting preset requirements exist in the project path acquired by the acquisition module 1, so as to verify whether the project path is correct, and the operation is simple and convenient, and the feasibility is high.
In this embodiment, when detecting that a directory file with a kernel word format exists in the project path, the detection module 2 returns the full name of the directory file for recording. Therefore, when debugging is carried out next time, the directory file can be directly searched according to the recorded full name of the directory file, and the method is accurate and rapid.
The debugging module 3 is configured to, when the detecting module 2 detects that N directory files meeting the preset requirement exist in the project path, acquire the project configuration file in the folder corresponding to the project name acquired by the acquiring module 1 under each directory file, and debug the content in the project configuration file.
Specifically, the project configuration files are generally named in a manner including a Config string, such as a file with a project Config file name, a file with a Config file name, and the like. Therefore, the debugging module 3 may obtain the project configuration file by obtaining the file with the file name including the Config character string in the folder with the folder name as the project name in the directory file. If the project name of the driver to be debugged is M1612 and the project path is Y:// project/z193_1202, the driver debugging system can obtain the project global configuration file, the operating system kernel file and the platform vendor customized file respectively under Y:// project/z193_1202, wherein the file name comprises the file of the Config character string in the folder with the folder name of M1612.
More specifically, there may be multiple project profiles that need to be debugged due to project global profiles, operating system kernel files, or platform vendor customized files. Therefore, in the present embodiment, the debug module 3 includes: the device comprises a judgment submodule, a processing submodule and a synchronization submodule. The judgment submodule is used for detecting whether the number of the acquired files with the file names including the Config character strings is larger than 1; the processing submodule is used for randomly selecting a file with a file name comprising a Config character string for debugging when the detection submodule detects that the number of the detection submodules is more than 1, and storing debugging information; the synchronization submodule is used for synchronizing the debugging information stored by the processing submodule into the acquired files of which the file names comprise the Config character strings. Therefore, the project configuration files do not need to be debugged one by one, the debugging efficiency is high, omission is avoided, and mistakes are not easy to occur.
It should be understood that this embodiment is a system example corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
Those skilled in the art can understand that all or part of the steps in the method of the foregoing embodiments may be implemented by a program to instruct related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.