Equipment debugging method and system, module, equipment and readable storage medium
By configuring device tree parameters for device debugging, the problem of modifying kernel driver code in the existing technology is solved, which improves debugging efficiency and ensures system security.
Patent Information
- Application Number
- CN202510179806.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-05-27
AI Technical Summary
When debugging external devices connected to Android or Qualcomm platform, the prior art needs to modify the kernel driver code and recompile, resulting in low debugging efficiency, easy introduction of errors and consume a lot of resources.
By configuring device tree parameters, debugging of devices connected to the platform is achieved without modifying the platform kernel driver code. The specific method includes determining the device tree parameters of the device to be debugged in response to the driver parameter configuration instruction, generating a target driver parameter file, and storing it in the driver parameter storage area of the driver platform.
It improves the efficiency of equipment debugging, saves resources such as manpower and material resources, avoids errors that may be introduced when modifying the kernel driver code, and ensures the security of the driver platform and equipment.
Smart Images

Figure CN120045234A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a device debugging method, system, module, device, and readable storage medium. Background Art
[0002] Some external devices are usually connected to the Android platform or Qualcomm platform, such as a Liquid Crystal Display (LCD), a TouchPad (TP), etc. In order to make the external devices connected to the platform meet the application requirements, it is usually necessary to debug the external devices.
[0003] When debugging external devices, it is usually necessary to modify the platform kernel driver code and recompile the kernel. This debugging method is likely to introduce new errors or defects during the debugging process. At the same time, modifying the driver code and recompiling also consume a lot of time and resources, thus resulting in low debugging efficiency of external devices. Summary of the Invention
[0004] Embodiments of this application provide a device debugging method, system, module, device, and readable storage medium, which can achieve the debugging of devices connected to the platform by configuring device tree parameters, without modifying the platform kernel driver code, effectively improving the device debugging efficiency and saving resources such as manpower and material resources.
[0005] On the one hand, embodiments of this application provide a device debugging method, which is applied to a configuration terminal, and the method includes:
[0006] In response to a driver parameter configuration instruction, determine the first device tree parameters of the device to be debugged, where the first device tree parameters include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes;
[0007] Generate a target driver parameter file according to the first device tree parameters;
[0008] Store the target driver parameter file in the driver parameter storage area of the driver platform, so that the driver platform drives the device to be debugged according to the target driver parameter file stored in the driver parameter storage area.
[0009] On the other hand, embodiments of this application provide another device debugging method, which is applied to a driver platform, and the method includes:
[0010] In response to a drive trigger instruction, read a target drive parameter file from a drive parameter storage area, where the target drive parameter file is generated by a configuration terminal according to first device tree parameters of a device to be debugged, and the first device tree parameters of the device to be debugged are determined by the configuration terminal in response to a drive parameter configuration instruction;
[0011] Determine a first device tree of the device to be debugged based on the target drive parameter file;
[0012] Drive the device to be debugged according to the first device tree of the device to be debugged.
[0013] On the one hand, an embodiment of the present application provides a device debugging system, which includes a configuration terminal, a drive platform, and a device to be debugged, where:
[0014] The configuration terminal is configured to determine first device tree parameters of the device to be debugged in response to a drive parameter configuration instruction;
[0015] The configuration terminal is further configured to generate a target drive parameter file according to the first device tree parameters;
[0016] The drive platform is configured to store the target drive parameter file;
[0017] The drive platform is further configured to, in response to a drive trigger instruction, determine a first device tree of the device to be debugged based on the target drive parameter file;
[0018] The drive platform is further configured to drive the device to be debugged according to the first device tree of the device to be debugged.
[0019] On the one hand, an embodiment of the present application provides a device debugging module, which includes:
[0020] A determination unit, configured to determine first device tree parameters of a device to be debugged in response to a drive parameter configuration instruction, where the first device tree parameters include device tree attributes of the device to be debugged and attribute values corresponding to the device tree attributes;
[0021] A generation unit, configured to generate a target drive parameter file according to the first device tree parameters;
[0022] A processing unit, configured to store the target drive parameter file in a drive parameter storage area of the drive platform, so that the drive platform drives the device to be debugged according to the target drive parameter file stored in the drive parameter storage area.
[0023] On the one hand, an embodiment of the present application provides another device debugging module, which includes:
[0024] A reading unit, configured to read a target driver parameter file from a driver parameter storage area in response to a driver trigger instruction, where the target driver parameter file is generated by a configuration terminal according to first device tree parameters of a device to be debugged, and the first device tree parameters of the device to be debugged are determined by the configuration terminal in response to a driver parameter configuration instruction;
[0025] An execution unit, configured to determine a first device tree of the device to be debugged based on the target driver parameter file;
[0026] A driving unit, configured to drive the device to be debugged according to the first device tree of the device to be debugged.
[0027] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a communication interface, and a memory. The processor, the communication interface, and the memory are interconnected. Wherein, the memory stores computer instructions, and the processor is configured to call the computer instructions to implement the device debugging method provided by the embodiment of the present application.
[0028] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are run on a computer device, the computer device is enabled to implement the device debugging method provided by the embodiment of the present application.
[0029] Correspondingly, an embodiment of the present application further provides a computer program product, where the computer program product includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, so that the computer device implements the device debugging method provided by the embodiment of the present application.
[0030] Through the device debugging method provided by the embodiment of the present application, the driver platform can be made to read a target driver parameter file (the target driver parameter file is generated according to the first device tree parameters of the device to be debugged) from a driver parameter storage area in response to a driver trigger instruction, and determine the device tree of the device to be debugged based on the target driver parameter file, and then drive the device to be debugged according to the device tree; when the device tree parameters change, the device tree also changes, and further the device to be debugged also makes corresponding changes, so as to realize the debugging of the device to be debugged. The device debugging method provided by the present application does not need to modify the kernel driver code of the driver platform, will not introduce new errors or defects, can ensure the security of the driver platform and the device to be debugged. At the same time, only by modifying the device tree parameters to implement device debugging can also effectively improve the efficiency of device debugging, and effectively save resources such as manpower and material resources. Description of the Drawings
[0031] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 It is a schematic diagram of the system architecture of a device debugging system provided by an embodiment of the present application;
[0033] Figure 2 It is a schematic diagram of the process flow of a device debugging method provided by an embodiment of the present application;
[0034] Figure 3 It is a schematic diagram of a driving parameter configuration interface provided by an embodiment of the present application;
[0035] Figure 4 It is a schematic diagram of a driving parameter file provided by an embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of a device debugging method provided by an embodiment of the present application;
[0037] Figure 6 It is a comparison schematic diagram of a device debugging method provided by an embodiment of the present application;
[0038] Figure 7 It is a schematic diagram of the process flow of another device debugging method provided by an embodiment of the present application;
[0039] Figure 8 It is a schematic diagram of yet another device debugging method provided by an embodiment of the present application;
[0040] Figure 9 It is a schematic diagram of the process flow of yet another device debugging method provided by an embodiment of the present application;
[0041] Figure 10 It is a structural block diagram of a device debugging module provided by an embodiment of the present application;
[0042] Figure 11 It is a structural block diagram of another device debugging module provided by an embodiment of the present application;
[0043] Figure 12 It is a structural block diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0044] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0045] It should be noted that the descriptions such as "first" and "second" involved in the embodiments of the present application are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Therefore, the technical features defined with "first" and "second" may explicitly or implicitly include at least one such feature.
[0046] In the actual application process, the debugging methods for devices accessing the Android or Qualcomm platforms mainly involve modifying the kernel driver code, compiling the code, and testing and debugging the code. The following aspects of work are mainly involved in the debugging process: 1. Analyze the problem phenomenon: clarify the specific problem manifestations of the accessed device or component (such as the device cannot be recognized, function abnormality, etc.). 2. Consult relevant documents: consult the technical manual of the device to understand important information such as its interface protocol and working mode; consult the kernel documents of the platform to understand the relevant driver architecture and interfaces. 3. Log recording and analysis: obtain the key debugging information of the platform; analyze the logs to determine the context and conditions when the problem occurs. 4. Check the driver code: check the driver code logic (such as checking for obvious errors or potential problems); verify whether the interaction between the driver and the hardware meets the expectations. 5. Simulation and emulation: use simulators or emulation tools to simulate the hardware behavior. 6. Modify and test: modify the driver code according to the analysis results, correct errors or optimize the logic; recompile the kernel, load the driver and conduct functional tests. 7. Performance tuning: evaluate the performance of the driver (such as response time, throughput and other indicators). 8. Stability verification: conduct long-term stress tests to ensure that the driver can work stably under various conditions. 9. Documentation writing and maintenance: write a detailed debugging report to record the problems encountered during the debugging process and the solutions. 10. Code submission and version control: use a version control system to manage code changes; submit code changes to the code repository.
[0047] As can be seen from the above description, when debugging a device accessing the platform using the existing method, it is necessary to modify the kernel driver code of the platform and recompile the kernel image. During the process of modifying the kernel driver code, new errors or defects are likely to be introduced, and the stability of the system may also be affected. In addition, each modification and recompilation of the kernel consumes a large amount of time and resources, resulting in low device debugging efficiency and large consumption of human resources.
[0048] Based on this, an embodiment of the present application provides a device debugging method. Among them, the configuration terminal can, in response to a driver parameter configuration instruction, determine the first device tree parameters of the device to be debugged. The first device tree parameters include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes; generate a target driver parameter file according to the first device tree parameters; and store the target driver parameter file in the driver parameter storage area of the driver platform. The driver platform can, in response to a driver trigger instruction, read the target driver parameter file from the driver parameter storage area; determine the first device tree of the device to be debugged based on the target driver parameter file; and drive the device to be debugged according to the first device tree of the device to be debugged. Through the method provided by the embodiment of the present application, the debugging of the device connected to the platform can be realized by configuring the device tree parameters, without modifying the platform kernel driver code, effectively improving the efficiency of device debugging and saving resources such as manpower and material resources.
[0049] The device debugging method provided by the present application can be applied to the Android platform or the Qualcomm platform. The Android platform is a mobile operating system based on the Linux kernel and is mainly applied to mobile devices (such as smartphones, tablets, etc.). The system architecture of the Android platform is divided into four layers, namely the application layer, the application framework layer, the system runtime library layer, and the Linux kernel layer. Among them, the Linux kernel is the basis of the Android platform and also serves as an abstraction layer between the hardware and the software stack. Using the Linux kernel can endow the Android platform with main security functions and at the same time allow the Android platform to access other external devices (such as adding hardware driver programs in the kernel). The Qualcomm platform is a series of hardware and software solutions provided by Qualcomm Incorporated and can be applied to various types of products (such as smartphones, wearable devices, Internet of Things devices, smart home devices, etc.). The Qualcomm platform mainly includes the Snapdragon processor series, which is famous for its high performance and low power consumption, supports multiple wireless connection technologies such as 5G, Wi-Fi 6E, and Bluetooth, and integrates an artificial intelligence processing unit to provide powerful computing capabilities and rich functions. Both the Android platform and the Qualcomm platform can be externally connected to some devices, such as: Liquid Crystal Display (LCD), TouchPad (TP), etc. When debugging the devices connected to the platform, the device debugging method provided by the present application can be used to realize the debugging of the devices by configuring the device tree parameters of the devices, without modifying the platform kernel driver code, effectively improving the efficiency of device debugging and also saving resources such as manpower and material resources.
[0050] Next, the architecture of the device debugging system provided by the embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0051] Please refer to Figure 1 , Figure 1It is a schematic diagram of the system architecture of a device debugging system provided by an embodiment of the present application. The device debugging system includes a configuration terminal 101, a driver platform 102, and an access device 103. Among them:
[0052] The configuration terminal 101 can interact with an object (such as a device debugger) and can also perform data transmission with the driver platform 102. The configuration terminal 101 can be a handheld device with communication functions (such as a tablet computer), a computing device (such as a personal computer (Personal Computer, PC), an intelligent voice interaction device, a wearable device, etc., but is not limited thereto.
[0053] The driver platform 102 can store the data sent by the configuration terminal 101, read the data sent by the configuration terminal 101 when starting up, and can also access external devices, such as: a display, a touch screen, a sensor, etc. The driver platform 102 can be a handheld device with communication functions (such as a smart phone, a tablet computer), a computing device (such as a personal computer (Personal Computer, PC), a vehicle-mounted terminal, an intelligent voice interaction device, a wearable device, a device configured with an embedded system, or other intelligent devices, etc., but is not limited thereto. Figure 1 Among them, the driver platform 102 accesses three external devices, namely a display, a touch screen, and a temperature sensor.
[0054] The access device 103 is an external device accessing the driver platform 102. The driver platform 102 can drive the access device 103 through kernel driver code. Figure 1 Among them, the access device 103 accessing the driver platform 102 includes an access device 103a ( Figure 1 which is a display in Figure 1 ), an access device 103b ( Figure 1 which is a touch screen in
[0055] The following will elaborate in detail on Figure 1 the working principle of the device debugging system shown as follows:
[0056] The configuration terminal 101 and the drive platform 102 can be connected via a data cable. The configuration terminal 101 can interact with the device debugger and, in response to a drive parameter configuration instruction, determine the first device tree parameters of the device to be debugged. The device to be debugged can be any one of an access device such as a display, a touch screen, and a temperature sensor. The first device tree parameters can include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes. The configuration terminal 101 can generate a target drive parameter file based on the first device tree parameters and store the target drive parameter file in the drive parameter storage area of the drive platform 102 via the data cable.
[0057] The drive platform 102 can, in response to a drive trigger instruction, read the target drive parameter file from the drive parameter storage area and determine the first device tree of the device to be debugged based on the target drive parameter file. The drive platform 102 can determine the device to be debugged according to the first device tree of the device to be debugged, thereby realizing the debugging of the device to be debugged. Through the device debugging method provided by the embodiments of the present application, the debugging of the devices connected to the platform can be realized by configuring the device tree parameters, without modifying the platform kernel driver code, effectively improving the efficiency of device debugging and saving resources such as manpower and material resources.
[0058] The architecture schematic diagram of the device debugging system described in the embodiments of the present application is for more clearly explaining the device debugging method of the embodiments of the present application, and does not constitute a limitation on the device debugging method provided by the embodiments of the present application. For example, the device debugging method provided by the embodiments of the present application can be executed not only by the configuration terminal 101 and the drive platform 102, but also by other devices. As is known to those of ordinary skill in the art, Figure 1 the numbers of the configuration terminal 101, the drive platform 102, and the access device 103 in
[0059] are merely illustrative. According to the needs of business implementation, devices with any number can be configured. And, with the evolution of the system architecture and the emergence of new business scenarios, the device debugging method provided by the embodiments of the present application is equally applicable to similar technical problems. Figure 2 , Figure 2 Please refer to
[0060] S201. In response to a drive parameter configuration instruction, determine the first device tree parameters of the device to be debugged, where the first device tree parameters include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes.
[0061] In the embodiments of the present application, the device tree is a data model used to describe the hardware data structure, and the tree structure is adopted to describe the device information in the system. When the driver platform starts up, the driver platform can determine the device tree according to the device tree parameters, and the device tree can take effect in the kernel driver of the platform, so that the kernel driver corresponds to the external device (also called the access device). The device tree contains device tree attributes and the corresponding attribute values. For example, for an access device that is a display, the attribute value corresponding to the device tree attribute "compatible" (indicating "compatible") is "A, B, C", which means that the three driver programs A, B, and C in the kernel of the driver platform can all be used to drive the display. When the kernel of the driver platform starts up, the driver programs for this display will be found in the order of A, B, and C.
[0062] The configuration terminal can, in response to a driver parameter configuration instruction for the device to be debugged, determine the first device tree parameters of the device to be debugged. The first device tree parameters include the device tree attributes of the device to be debugged and the corresponding attribute values. The driver parameter configuration instruction for the device to be debugged can be input by the device debugger or generated by the configuration terminal itself. The configuration terminal can determine the first device tree parameters of the device to be debugged, and the first device tree parameters are used for the subsequent driver platform to drive the device to be debugged.
[0063] In one embodiment, the driver parameter configuration instruction is used to indicate at least one of the following operations: deleting the device tree attributes and the corresponding attribute values, adding new device tree attributes and the corresponding attribute values, and modifying the device tree attributes and / or the corresponding attribute values. When debugging the device to be debugged, the existing device tree attributes and the corresponding attribute values of the device to be debugged can be deleted, new device tree attributes and the corresponding attribute values of the device to be debugged can be added, the existing device tree attributes of the device to be debugged or the attribute values corresponding to the device tree attributes can be modified, and the existing device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes can be modified simultaneously. For example, the attribute value corresponding to the existing device tree attribute of the device to be debugged is modified from "1080" to "720", or the existing device tree attributes and the corresponding attribute values can be modified simultaneously. The operations indicated by the driver parameter configuration instruction can be adaptively modified according to different application requirements. Through the method provided by the embodiments of the present application, the device tree attributes and the corresponding attribute values can be arbitrarily configured, with high operability, and only the device tree parameters need to be configured, without modifying the kernel driver code of the driver platform, which can effectively improve the configuration efficiency and further improve the device debugging efficiency.
[0064] In some cases, when configuring device tree parameters, the difference between the device tree parameters configured previously and those configured subsequently can be made small (for example: only modifying the property value corresponding to a certain device tree property), and the running conditions of the device to be debugged after the device tree parameters are configured before and after can be compared, so as to clarify the influence of a certain device tree property on the device to be debugged. It can be seen from this that through the method provided by the embodiments of the present application, the effects of different parameter settings can be easily compared, and fine-tuning of the accessed device can be achieved.
[0065] In an embodiment, there are multiple accessed devices in the drive platform, and the device to be debugged is any one of the multiple accessed devices; then, in response to the drive parameter configuration instruction, the specific implementation manner of determining the first device tree parameter of the device to be debugged can be: in response to the parameter configuration tool startup instruction, display the drive parameter configuration interface, where the drive parameter configuration interface includes parameter display areas corresponding to each of the multiple accessed devices, and the parameter display areas display the initial device tree parameters of the corresponding accessed devices; in response to the drive parameter configuration instruction for the device to be debugged, determine the first device tree parameter of the device to be debugged, and display the first device tree parameter in the parameter display area corresponding to the device to be debugged.
[0066] Specifically, a parameter configuration tool can be configured in the configuration terminal. This parameter configuration tool is used to display the drive parameter configuration interface and determine the device tree parameters of the configured device in response to the drive parameter configuration instruction. In response to the parameter configuration tool startup instruction, the configuration terminal can display the drive parameter configuration interface, and the drive parameter configuration interface can also include parameter display areas corresponding to each of the multiple accessed devices, and the parameter display areas display the initial device tree parameters of the corresponding accessed devices. For example: there are 3 accessed devices, then the drive parameter configuration interface can display the parameter display areas corresponding to these 3 accessed devices respectively, and the initial device tree parameters of the 3 accessed devices are respectively displayed in the 3 parameter display areas. The initial device tree parameters can be obtained by the configuration terminal from the drive platform. The drive parameter configuration interface includes the parameter display area corresponding to the device to be debugged, and the initial device tree parameters of the device to be debugged are displayed in this parameter display area.
[0067] In response to the drive parameter configuration instruction for the device to be debugged, the configuration terminal can determine the first device tree parameter of the device to be debugged and can display the first device tree parameter in the parameter display area corresponding to the device to be debugged. The method provided by the embodiments of the present application can visualize the device tree parameters of the accessed device by using the drive parameter configuration interface, which is convenient for device debuggers to adjust the device tree parameters of the accessed device. At the same time, managing the device tree parameters through the parameter configuration tool can reduce code changes and maintenance costs, enabling device debuggers to get started faster and reducing the learning cost.
[0068] In some cases, when the device tree parameters of the access devices on the drive platform are adjusted for the first time using the parameter configuration tool, the configuration terminal can display a drive parameter configuration interface including parameter display areas corresponding to each access device, and the initial device tree parameters of the corresponding access device are displayed in the parameter display area; when the device tree parameters of the access devices on the drive platform are adjusted for the Nth (N is an integer greater than 1) time using the parameter configuration tool, the configuration terminal can display a drive parameter configuration interface including parameter display areas corresponding to each access device, and the device tree parameters after the (N - 1)th configuration of the access device are displayed in the parameter display area. That is, when multiple debuggings are performed, the device tree parameters after the previous configuration can be displayed in the parameter display area, rather than necessarily the initial device tree parameters. This enables device debuggers to perform further configuration based on the device tree parameters after the previous configuration, which can effectively save the time spent on configuring the device tree parameters, improve the device debugging efficiency. At the same time, it is also beneficial to compare the differences caused by the device tree parameters of the two configurations before and after, significantly shortening the debugging cycle of the access device, saving resources such as manpower and material resources, and reducing the device debugging cost.
[0069] In one embodiment, the specific implementation method for the configuration terminal to obtain the initial device tree parameters of the access device from the drive platform can be: obtaining the platform drive parameter file from the drive parameter storage area of the drive platform; performing parsing processing on the platform drive parameter file to obtain the initial device tree parameters of multiple access devices. Specifically, the platform drive parameter file is stored in the drive parameter storage area of the drive platform, and the platform drive parameter file contains the initial device tree parameters of each access device (similar to factory setting information). Since the drive platform is in an unstarted state when configuring the device tree parameters, the configuration terminal can obtain the platform drive parameter file from the drive platform through a data acquisition tool (such as a burning tool). The configuration terminal can perform parsing processing on the platform drive parameter file (for example: performing format conversion on the data contained in the platform drive parameter file, extracting the required data from the platform drive parameter file, etc.) to determine each access device and the initial device tree parameters of each access device. Through the method provided by the embodiments of the present application, the initial device tree parameters of the access device can be determined according to the platform drive parameter file, thereby providing a debugging benchmark for device tree parameters for device debuggers, enabling device debuggers to adjust parameters based on the initial device tree parameters, reducing the debugging difficulty, and also reducing the probability of parameter debugging errors, which can improve the security of the device debugging system.
[0070] It should be noted that in the above embodiments, the device to be debugged is any one of the access devices. In actual application scenarios, the configuration terminal can respond to the drive parameter configuration instruction for multiple access devices, determine the configured device tree parameters of each access device, and perform subsequent operations based on the configured device tree parameters of each access device, so as to debug multiple access devices in one debugging process. Through the method provided by the embodiments of the present application, combined debugging of any access devices can be realized, which can improve the device debugging efficiency and flexibility at the same time.
[0071] In one embodiment, the device debugging method provided by the present application may further include the following steps: in response to the device addition operation for the device to be added, display the parameter display area corresponding to the device to be added on the drive parameter configuration interface; in response to the parameter configuration operation for the device to be added, determine the second device tree parameter of the device to be added, and display the second device tree parameter in the parameter display area corresponding to the device to be added.
[0072] Specifically, the drive platform can access multiple external devices, and the configuration terminal can determine multiple access devices and the initial device tree parameters of each access device by parsing the platform drive parameter file. However, in some cases, when a device is connected to the drive platform but the configuration terminal fails to parse the device from the platform drive parameter file (at this time, the device can be called the device to be added), the device debugging personnel need to manually add the relevant parameters of the device in the parameter configuration tool. In other cases, when debugging the devices of the drive platform, a new device is connected to the drive platform, and since the drive platform is in an unstarted state at this time and cannot update the platform drive parameter file, the configuration terminal cannot obtain the initial device tree parameters of the newly connected device from the platform drive parameter file (at this time, the device can be called the device to be added), then the device debugging personnel need to manually add the relevant parameters of the device in the parameter configuration tool.
[0073] When there is a device to be added, in response to the device addition operation for the device to be added (this operation can be performed by the device debugging personnel), the configuration terminal can display the parameter display area corresponding to the device to be added in the drive parameter configuration interface, and this parameter display area can be used to display the device tree parameters of the device to be added. In response to the parameter configuration operation for the device to be added, the configuration terminal can determine the second device tree parameter of the device to be added, and display the second device tree parameter in the parameter display area corresponding to the device to be added.
[0074] The second device tree parameter includes the device tree attribute of the device to be added and the attribute value corresponding to the device tree attribute. After adding the device to be added to the parameter configuration tool, the device to be added can be transformed into an access device. Through the method provided by the embodiments of the present application, in response to a device addition operation, a parameter display area corresponding to the device to be added can be displayed, avoiding the situation of device omission, having a good error tolerance. At the same time, the method provided by the present application is applicable to a variety of different application scenarios and has good universality.
[0075] Please refer to Figure 3 , Figure 3 which is a schematic diagram of a driver parameter configuration interface provided by the embodiments of the present application. In response to a parameter configuration tool startup instruction, the configuration terminal can display a driver parameter configuration interface as shown in Figure 3 . The driver parameter configuration interface includes parameter display areas corresponding to three access devices of the driver platform. The three access devices are a display (lcd), an input / output interface (gpio), and a touch screen (tp). Figure 3 Among them, the display is the device to be debugged, and the driver parameter configuration interface can display the parameter display area corresponding to the display. In response to a driver parameter configuration instruction for the display, the configuration terminal can determine the first device tree parameter of the display and display the first device tree parameter in the parameter display area corresponding to the device to be debugged. As shown in Figure 3 , the parameter display area corresponding to the display displays the first device tree parameter, including the device tree attribute (i.e., Figure 3 "Device tree attribute - identifier" in Figure 3 ) and the attribute value corresponding to the device tree attribute (i.e.,
[0076] The parameter display area corresponding to the device to be debugged further includes an "Add Attribute" control, which is used to add the device tree attributes of the device to be debugged and the corresponding attribute values. The drive parameter configuration interface further includes an "Add Device" control, which is used to add the parameter display area corresponding to the device to be added. When there is a device to be added, in response to the triggering operation on the "Add Device" control, the configuration terminal can display the parameter display area corresponding to the device to be added in the drive parameter configuration interface. The drive parameter configuration interface further includes a "Generate File" control, which is used to generate a drive parameter file according to the device tree parameters of each access device. Through the method provided by the embodiments of the present application, the device tree parameters of the access devices on the drive platform can be visualized, which is convenient for configuring the device tree parameters and improving the device debugging efficiency; in addition, configuring the device tree parameters through the parameter configuration tool is equivalent to providing a unified and unique input box to adjust the device tree parameters, reducing the possibility of errors and making the debugging process of the device tree parameters more intuitive.
[0077] S202. Generate a target drive parameter file according to the first device tree parameter.
[0078] In the embodiments of the present application, after the device tree parameters of the device to be debugged are configured, the configuration terminal can generate a target drive parameter file according to the first device tree parameter. The target drive parameter file is used for the subsequent drive platform to obtain the device tree parameters of the device to be debugged and determine the device tree of the device to be debugged. Through the method provided by the embodiments of the present application, a target drive parameter file can be generated, so that the subsequent drive platform can determine the corresponding device tree based on the target drive parameter file to implement the debugging of the device to be debugged.
[0079] In one embodiment, there are multiple access devices on the drive platform, and the device to be debugged is any one of the multiple access devices; then the specific implementation manner of generating the target drive parameter file according to the first device tree parameter can be: obtaining the initial device tree parameters of the access devices other than the device to be debugged among the multiple access devices, and the initial device tree parameters are obtained from the drive platform; performing a combination process on the first device tree parameter and the initial device tree parameters to obtain a device tree parameter file; performing a format conversion process on the device tree parameter file to obtain a target drive parameter file, and the format of the target drive parameter file is a binary format.
[0080] Specifically, when only configuring the device tree parameters of the device to be debugged, the configuration terminal can obtain the initial device tree parameters of the access devices other than the device to be debugged among multiple access devices. The initial device tree parameters are obtained from the driver platform, and the specific obtaining method is as shown in the embodiment in step S201 above. The configuration terminal can combine and process the first device tree parameters and the initial device tree parameters to obtain a device tree parameter file. In some cases, there is a unique device number for multiple access devices connected to the driver platform. The configuration terminal can obtain the device numbers of each access device and combine and process the first device tree parameters and the initial device tree parameters according to the device numbers of the access devices to obtain a device tree parameter file.
[0081] After determining the device tree parameter file, the configuration terminal can perform format conversion processing on the device tree parameter file to obtain a target driver parameter file, and the format of the target driver parameter file is binary format. The format of the data in the device tree parameter file is character format, for example: "width: 1080". When representing the same content, the storage space occupied by the data in character format is larger than that occupied by the data in binary format. Therefore, the storage space occupied by the target driver parameter file is smaller than that occupied by the device tree parameter file. In addition, when the driver platform reads a file, the reading and writing speed of binary format data is higher than that of character format data. Through the method provided in the embodiments of the present application, a target driver parameter file can be generated, which is beneficial to saving storage space, improving security, and can also improve the speed at which the driver platform reads the target driver parameter file, reducing the processing overhead when the driver platform loads the parameter file, and can be directly used without additional parsing, improving the processing performance and reliability of the driver platform and effectively simplifying the data processing process.
[0082] In some cases, when the device tree parameters of the device to be debugged are adjusted, if the device tree parameters of the device that has been debugged (the device that has been debugged can be one or more of the multiple access devices) have been configured, the specific method for generating the device tree parameter file can be: obtaining the configured device tree parameters of the device that has been debugged, and the configured device tree parameters can be parameters that have been adjusted and are different from the initial device tree parameters; combining and processing the first device tree parameters of the device to be debugged, the configured device tree parameters of the device that has been debugged, and the initial device tree parameters of other devices to obtain a device tree parameter file, where other devices are access devices other than the device to be debugged and the device that has been debugged among multiple access devices. That is, the method provided in the embodiments of the present application can configure the device tree parameters for multiple access devices respectively, and can configure the parameters for the device to be debugged based on the device that has been debugged, realizing the individual debugging of access devices and the combined debugging of multiple access devices, with great flexibility and being able to meet various different application requirements.
[0083] In some other cases, the configuration terminal can configure the device tree parameters of multiple devices to be debugged during one debugging process. At this time, the configuration terminal can perform combination processing based on the configured device tree parameters and the initial device tree parameters of the multiple devices to be debugged to obtain a device tree parameter file.
[0084] It should be noted that in the method provided in this application, there is no limit on the length of the device tree parameters of the access device. During one debugging, if the length of the device tree parameters of the target access device increases (for example, the attribute value corresponding to the device tree attribute increases), then in the generated target driver parameter file, the number of bytes occupied by the device tree parameters of the target access device increases, and the storage positions of the device tree parameters of the access devices arranged after the target access device will move backward adaptively, so as to ensure the integrity of the device tree parameters of each access device and ensure the security and reliability of data storage.
[0085] In an embodiment, when there is a device to be added, the configuration terminal can, in response to a device addition operation for the device to be added, display a parameter display area corresponding to the device to be added in the driver parameter configuration interface; in response to a parameter configuration operation for the device to be added, determine the second device tree parameters of the device to be added and display the second device tree parameters in the parameter display area corresponding to the device to be added. At this time, the specific implementation manner of performing combination processing on the first device tree parameters and the initial device tree parameters to obtain a device tree parameter file can be: performing combination processing on the first device tree parameters, the second device tree parameters, and the initial device tree parameters to obtain a device tree parameter file.
[0086] Specifically, when there is a device to be added, the configuration terminal can determine the second device tree parameters of the device to be added through parameter configuration operations for the device to be added, and combine and process the first device tree parameters, the second device tree parameters, and the initial device tree parameters of the device to be debugged according to the device numbers of multiple access devices and the device number of the device to be added to obtain a device tree parameter file. In some cases, when the device number of the device to be added is not determined, the device to be added can be determined as the latest access device, and the device number of the device to be added is also the latest device number; correspondingly, in the generated target driver parameter file, the device tree parameters of the device to be added are located at the end of the file (or at the end of the device tree parameters of the access devices). For example: there are 3 access devices with device numbers 1, 2, and 3 respectively, and now there is a device to be added, then the device number of the device to be added can be determined as 4. When generating the device tree parameter file, the device tree parameters of the device to be added are located after the device tree parameters of other access devices. In the target driver parameter file, the device tree parameters of the device to be added are located at the end of the target driver parameter file. Through the method provided in the embodiments of the present application, when there is a device to be added, the device tree parameters of the device to be added can be added to the target driver parameter file to achieve the addition of the device tree parameters of the device, which has good scalability. In addition, when adding new device tree parameters, adding the new device tree parameters to the end of the device tree parameters of the access devices can avoid overwriting or modifying the device tree parameters of the access devices, ensuring the security and reliability of the device tree parameters of the access devices.
[0087] Please refer to Figure 4 , Figure 4 which is a schematic diagram of a driver parameter file provided by the embodiments of the present application. The configuration terminal can display a driver parameter configuration interface as shown in Figure 3 . In response to the triggering operation on the "Generate File" control in the driver parameter configuration interface, the configuration terminal can generate a device tree parameter file according to the device tree parameters of each access device, and perform combination processing on the device tree parameter file to obtain a target driver parameter file. Figure 4The data storage layout in the target-driven parameter file is shown. The target-driven parameter file contains device tree parameters of each access module (including the display module, input / output interface module, etc.). Among them, "part1-id" represents the device number of the first access device (i.e., the display) in the file, "part1-length" represents the data length of the device tree parameters of the first access device, "prop1-id" represents the number of the first device tree attribute of the first access device, "prop1-length" represents the data length of the first device tree attribute, "prop1-label-len" represents the data length of the identifier (or property name) of the first device tree attribute, and "prop1-label" represents the identifier of the first device tree attribute. "data1" to "datan" represent the attribute values of the first device tree attribute (a set containing n values); "propn-id" represents the number of the nth (n is an integer greater than 1) device tree attribute of the first access device; "part2-id" represents the device number of the second access device (i.e., the input / output interface) in the file.
[0088] Figure 4 In it, the storage locations of the device tree parameters of the first access device and the second access device in the target-driven parameter file are consecutive, and the storage locations of the device tree parameters of the second access device and other access devices in the target-driven parameter file are consecutive. The contents represented by other fields in the figure are similar to those represented by the above fields. From Figure 4 it can be seen that in the target-driven parameter file, the device tree parameters of multiple access devices can be stored consecutively in sequence according to the device numbers of the access devices, and one device tree attribute can correspond to multiple attribute values, and one device can correspond to multiple device tree attributes. Through the method provided by the embodiments of the present application, a target-driven parameter file can be generated, which is beneficial for the subsequent drive platform to quickly obtain device tree parameters from the target-driven parameter file, improve the reading and writing efficiency of the platform, and save storage resources.
[0089] It should be noted that as described above Figure 4As shown, the device tree parameters of the access device may include "partn-length", which represents the byte length of the device tree parameters of access device n. Since the present application does not limit the byte length of the device tree parameters of the access device, the determination method of "partn-length" can be that the configuration terminal calculates the byte length of the device tree parameters of the access device and determines the value of "partn-length". By this method, when the byte length of the device tree parameters of the access device increases or decreases, "part1-length" can accurately indicate the byte length of the device tree parameters, which is beneficial to the driver platform to read the device tree parameters from the driver parameter file and improve the effectiveness of device debugging.
[0090] In an embodiment, the specific implementation manner of performing format conversion processing on the device tree parameter file to obtain the target driver parameter file may be: performing format conversion processing on the device tree parameter file to obtain an initial driver parameter file; determining the relationship between the storage capacity corresponding to the driver parameter storage area and the size of the initial driver parameter file; when the storage capacity corresponding to the driver parameter storage area is greater than or equal to the initial driver parameter file, determining the initial driver parameter file as the target driver parameter file; when the storage capacity corresponding to the driver parameter storage area is less than the initial driver parameter file, performing deletion processing on the device tree parameter file to obtain a deleted device tree parameter file, and performing format conversion processing on the deleted device tree parameter file to obtain the target driver parameter file.
[0091] Specifically, the configuration terminal can perform format conversion processing on the device tree parameter file to obtain an initial driver parameter file, and the format of the initial driver parameter file is binary. The configuration terminal can determine the relationship between the storage capacity corresponding to the driver parameter storage area and the size of the initial driver parameter file, or the configuration terminal can agree with the driver platform on the data volume threshold of the driver parameter file. When the storage capacity corresponding to the driver parameter storage area is greater than or equal to the initial driver parameter file, the configuration terminal can determine the initial driver parameter file as the target driver parameter file. When the storage capacity corresponding to the driver parameter storage area is less than the initial driver parameter file, the configuration terminal can perform deletion processing on the device tree parameter file to obtain a deleted device tree parameter file, and perform format conversion processing on the deleted device tree parameter file to obtain the target driver parameter file. For example: the storage capacity corresponding to the driver parameter storage area is 1MB, the configuration terminal can judge the size of the generated initial driver parameter file. If the initial driver parameter file is greater than 1MB, the configuration terminal can perform deletion processing on the device tree parameter file and perform format conversion processing on the deleted device tree parameter file to obtain the target driver parameter file. Through the method provided by the embodiments of the present application, the size of the initial driver parameter file can be detected and processed to ensure that the target driver parameter file can be normally stored in the driver platform, ensuring the stability of the driver platform.
[0092] In some cases, when the storage capacity corresponding to the driver parameter storage area is less than the initial driver parameter file, the configuration terminal can also calculate the difference between the storage capacity corresponding to the driver parameter storage area and the size of the initial driver parameter file to obtain the data volume to be deleted. The configuration terminal can output an alarm message on the driver parameter configuration interface to prompt the device debugger to delete the device tree parameters. The alarm message can include the data volume to be deleted. For example: the alarm message can be "The length of the device tree parameters exceeds the storage space, please delete 20KB of data." After the configuration terminal outputs the alarm message, if it is detected that the device tree parameters of each connected device have not changed, the generation of the target driver parameter file can be prohibited. When it is detected that the device tree parameters of the connected device have changed, the configuration terminal can generate an initial driver parameter file according to the changed device tree parameters, and judge the size of the initial driver parameter file again to finally determine the target driver parameter file.
[0093] S203. Store the target driver parameter file in the driver parameter storage area of the driver platform, so that the driver platform drives the device to be debugged according to the target driver parameter file stored in the driver parameter storage area.
[0094] In the embodiments of the present application, the configuration terminal may store the target driver parameter file in the driver parameter storage area of the driver platform. For example, the configuration terminal may burn the target driver parameter file into the driver parameter storage area of the driver platform through a burning tool. The driver platform may drive the device to be debugged according to the target driver parameter file stored in the driver parameter storage area. Adjusting the device tree parameters of the device to be debugged may cause corresponding changes to the target driver parameter file, and thus the debugging of the device to be debugged connected to the driver platform may be realized. The method provided in the embodiments of the present application can avoid modifying the kernel driver code of the driver platform and does not require compilation, realizing a device debugging solution without compilation, reducing the occurrence of new errors or defects introduced due to code changes, and reducing the stability risk.
[0095] In an embodiment, the specific implementation manner of storing the target driver parameter file in the driver parameter storage area of the driver platform may be: obtaining the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file includes the initial device tree parameters of each connected device of the driver platform; the device to be debugged is any one of the connected devices; storing the target driver parameter file in the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform; the device debugging method provided by the present application may further include the following steps: in response to a device debugging exception instruction, obtaining the previously read platform driver parameter file and storing the platform driver parameter file in the storage location of the target driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file is read from the driver parameter storage area of the driver platform.
[0096] Specifically, the configuration terminal may obtain the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file includes the initial device tree parameters of each connected device of the driver platform, and the device to be debugged is any one of the connected devices. After determining the target driver parameter file, the configuration terminal may store the target driver parameter file in the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform to overwrite the platform driver parameter file stored in the driver parameter storage area. In some cases, when debugging the connected devices of the driver platform multiple times, the configuration terminal may store the target driver parameter file in the storage location of the driver parameter file determined in the previous debugging in the driver parameter storage area of the driver platform, that is, when debugging multiple times, the configuration terminal may use the target driver parameter file to overwrite the driver parameter file obtained in the previous debugging process stored in the driver parameter storage area. This method can enable the driver platform to read the driver parameter file completely and correctly when reading the driver parameter file, and there will be no mixing of data in the storage space.
[0097] In some cases, after writing the target-driven parameter file to the drive platform, the drive platform or the access device may operate abnormally (also known as debugging exception). At this time, in response to the device debugging exception instruction (for example: the device debugger initiates the device debugging exception instruction), the configuration terminal can obtain the pre-read platform drive parameter file and store the platform drive parameter file in the storage location of the target-driven parameter file in the drive parameter storage area of the drive platform. Since the platform drive parameter file contains the initial device tree parameters of the access device, through the above method, the device tree parameters of the access device in the drive platform can be initialized (or referred to as "restoring to factory settings"), thereby solving the problem of abnormal operation of the drive platform or the access device during the debugging process. The platform drive parameter file can be read by the configuration terminal from the drive parameter storage area of the drive platform. After reading the platform drive parameter file, the configuration terminal can perform a backup process on the platform drive parameter file (for example: storing the platform drive parameter file in the cloud or storing it in the database of the configuration terminal). Through the method provided by the embodiments of the present application, data backup can be performed on the platform drive parameter file, and data recovery can be performed using the platform drive parameter file when the platform or device operates abnormally, which is beneficial to improving the parameter management efficiency and can also effectively ensure the stability of the device debugging system.
[0098] Please refer to Figure 5 , Figure 5 which is a schematic diagram of a device debugging method provided by the embodiments of the present application. The configuration terminal can implement as Figure 5The device debugging method shown below. Specifically, the configuration terminal can be connected to the driver platform through a data cable, and the driver platform includes multiple access devices. The configuration terminal can compile an initial version based on the base package of the driver platform for subsequent operations such as file reading and data storage. The base package of the driver platform may include a software base package adapted to the driver platform. The configuration terminal can read the platform driver parameter file from the driver parameter storage area of the driver platform. The configuration terminal can also respond to the parameter configuration tool startup instruction to display the driver parameter configuration interface, and respond to the driver parameter configuration instruction to determine the first device tree parameter of the device to be debugged. The configuration terminal device can generate a target driver parameter file according to the first device tree parameter and store the target driver parameter file in the driver parameter storage area of the driver platform. The configuration terminal can determine whether the device to be debugged reaches the target debugging effect; if so, the debugging process for the device to be debugged ends, if not, the configuration terminal can respond to the driver parameter configuration instruction again to determine the new first device tree parameter of the device to be debugged, and execute the subsequent process according to the new first device tree parameter until the device to be debugged reaches the target debugging effect. The method for determining whether the device to be debugged reaches the target debugging effect can be determined according to the running log, running effect, etc. of the device to be debugged. Through the method provided by the embodiments of the present application, the debugging of external devices of the driver platform can be achieved by modifying the device tree parameters without modifying the kernel driver code of the platform, effectively simplifying the device debugging process, and can also achieve the rapid switching and instant application of device tree parameters, without performing a complete compilation and test cycle every time debugging is performed, which can significantly shorten the development cycle and improve the device debugging efficiency.
[0099] Please refer to Figure 6 , Figure 6 which is a comparison schematic diagram of a device debugging method provided by an embodiment of the present application. Figure 6 Both the existing device debugging method and the device debugging method provided by the present application are shown in [Figure]. Among them, the implementation process of the existing device debugging method is that the device debugger understands the platform kernel code architecture; refers to the peripheral driver code provided by the device supplier; modifies the driver to adapt to the platform; compiles the modified driver code; determines whether the target effect is achieved, if so, the debugging is completed, if not, then the operation of modifying the driver to adapt to the platform is performed again. This method requires modifying the kernel driver code of the platform, which is likely to introduce new errors or defects, increasing the stability risk and security risk. At the same time, the time spent on modifying the driver and compiling is relatively long, resulting in an extended development cycle, and the increase in driver code will lead to an increase in maintenance costs.
[0100] While Figure 6In this application, the implementation process of the device debugging method is as follows: configure the terminal to compile the initial version; use the parameter configuration tool to modify the device tree parameters of the device to be debugged and generate a target driver parameter file; store the target driver parameter file in the driver parameter storage area of the driver platform; determine whether the operation of the device to be debugged reaches the target effect. If so, the debugging is completed. If not, then execute again the step of using the parameter configuration tool to modify the device tree parameters of the device to be debugged. The method provided by this application can implement the debugging of external devices of the platform without modifying the kernel driver code of the platform, will not introduce new errors or defects, effectively reduces the stability risk and security risk, also shortens the development cycle, reduces the maintenance cost, and improves the device debugging efficiency.
[0101] Through the device debugging method provided by the embodiments of this application, the debugging of the access device of the driver platform can be realized by modifying the device tree parameters of the device, without modifying and compiling the kernel driver code of the platform, and a debugging solution without compilation is realized, reducing the stability risk and security risk; the configuration of the device tree parameters can be realized by using the parameter configuration tool, making the debugging process of the device tree parameters more intuitive, effectively simplifying the device debugging process, and also reducing the technical threshold of device debugging; in addition, the method provided by this application can be applied to scenarios where the access device needs to be frequently debugged, can realize the quick switching and instant application of the device tree parameters, effectively shortens the development cycle, improves the device debugging efficiency, reduces code changes, reduces the maintenance cost, and saves resources such as manpower and material resources; the method provided by this application can also store the platform driver parameter file in the driver platform to realize the storage and backup of the file. When a debugging exception occurs, the access device of the driver platform can be initialized by using the backup platform driver parameter file, which has a data recovery function and ensures the security of the access device.
[0102] Please refer to Figure 7 , Figure 7 FIG. is a schematic flowchart of another device debugging method provided by the embodiments of this application. This device debugging method can be implemented by the above-mentioned driver platform 102, or can be implemented by other devices that can implement this device debugging method. The following takes the implementation of this device debugging method by the above-mentioned driver platform 102 as an example for description. The process of the device debugging method provided by the embodiments of this application includes but is not limited to:
[0103] S701. In response to a driver trigger instruction, read a target driver parameter file from the driver parameter storage area. The target driver parameter file is generated by a configuration terminal according to the first device tree parameters of the device to be debugged, and the first device tree parameters of the device to be debugged are determined by the configuration terminal in response to a driver parameter configuration instruction.
[0104] In the embodiment of the present application, the configuration device may store the target driver parameter file in the driver parameter storage area of the driver platform. In response to a driver trigger instruction (for example, a driver platform startup instruction, which is used to indicate starting the operating system of the driver platform), the driver platform may read the target driver parameter file from the driver storage area. The target driver parameter file is generated by the configuration terminal according to the first device tree parameters of the device to be debugged, and the first device tree parameters of the device to be debugged are determined by the configuration terminal in response to a driver parameter configuration instruction. The first device tree parameters may include device tree attributes and the corresponding attribute values of the device tree attributes. Specifically, the driver platform may read the target driver parameter file from the driver storage area during the applications bootloader (abl) phase. The applications bootloader phase will complete the initialization of the remaining hardware in the driver platform except for the basic hardware (such as the Central Processing Unit (CPU), Memory Management Unit (MMU), etc.). The driver platform may read the target driver parameter file from the driver storage area during the abl phase, so as to subsequently determine the device tree of the device to be debugged by using the device tree parameters included in the target driver parameter file, and further implement the debugging of the device to be debugged.
[0105] S702. Determine the first device tree of the device to be debugged based on the target driver parameter file.
[0106] In the embodiment of the present application, the driver platform may read the target driver parameter file and, based on the set rules, split the devices, device tree attributes, and the corresponding attribute values of the device tree attributes in the target driver parameter file. For example, if the data storage layout of the target driver parameter file is as shown above Figure 4 shown, then the respective device tree attributes of the first access device and the corresponding attribute values of the device tree attributes may be obtained from the target driver parameter file according to "part1-id" and "part1-length"; the first device tree attribute of the first access device and its corresponding attribute value may be obtained according to "prop1-id" and "prop1-length". By splitting the target driver parameter file, the device tree parameters of each access device (including the first device tree parameters of the device to be debugged) can be obtained.
[0107] After obtaining the device tree parameters of each access device, the assignment function (such as the fdt_setprop function) can be used to assign values to the attributes of the default device tree of the corresponding access device (or update the default device tree of the corresponding access device) according to the device tree parameters of each access device, so as to obtain the updated device tree of the access device (or the device tree containing new driver parameters). That is, the first device tree parameter of the device to be debugged can be used to update the default device tree of the device to be debugged, and the first device tree of the device to be debugged can be obtained. The default device tree is based on the device tree solidified in the firmware of the driver platform. Through the method provided in the embodiments of the present application, the attributes of the default device tree of the device can be updated by using the target driver parameter file, so as to realize the debugging of the access device without modifying the kernel driver code and without changing the framework process of the kernel driver, avoiding the introduction of new errors or defects, ensuring the security and stability of the platform. At the same time, not adding new code can also effectively reduce the system maintenance cost.
[0108] In one embodiment, the device debugging method provided in the present application may further include the following steps: obtaining platform device tree data, and constructing a second device tree of the device to be debugged based on the platform device tree data, where the platform device tree data is the solidified data in the driver platform; when no file is stored in the drive parameter storage area, driving the device to be debugged according to the second device tree of the device to be debugged.
[0109] Specifically, in the abl stage, the driver platform can obtain the platform device tree data, which is the solidified data solidified in the driver platform. The platform device tree data includes the solidified device tree parameters of the device to be debugged. The solidified device tree parameters and the initial device tree parameters included in the platform driver parameter file may be the same or different. The driver platform can construct a second device tree (also called the default device tree) of the device to be debugged based on the platform device tree data. The platform device tree data is also similar to the factory setting information and can realize the initialization of each external device accessing the driver platform.
[0110] Before the driving platform reads the target driving parameter file from the driving parameter storage area, it can also detect whether there is a file stored in the driving parameter storage area. If there is a file stored in the driving parameter storage area and the file is the target driving parameter file, the above step S702 can be executed, which is equivalent to updating the default device tree of the device to be debugged with the first device tree parameter in the target driving parameter file to obtain the first device data. If there is a file stored in the driving parameter storage area and the file is the platform driving parameter file (the platform driving parameter file can be stored in the platform itself or stored by the configuration terminal after device debugging exceptions occur), the driving platform can update the default device tree of the device to be debugged based on the platform driving parameter file to obtain the initial device tree, and drive the device to be debugged according to the initial device tree. If there is no file stored in the driving parameter storage area, the driving platform can directly drive the device to be debugged according to the second device tree (i.e., the default device tree) of the device to be debugged. Through the method provided by the embodiments of the present application, it can ensure the normal operation of the driving platform and the access device when there is no file stored in the driving parameter storage area, and ensure the integrity of the solution.
[0111] In one embodiment, when it is necessary to initialize the access device of the driving platform, the configuration terminal can store the platform driving parameter file in the driving parameter storage area of the driving platform, so that the driving platform realizes the initialization of the access device by reading the platform driving parameter file; the configuration terminal can also empty the driving parameter storage area of the driving platform (that is, there is no file stored in the driving parameter storage area of the driving platform). Since in the abl stage, the driving platform only updates the device tree of the access device in real time with the device tree parameters in the target driving parameter file, but does not cause substantial changes to the device tree solidified in the platform, when it is necessary to initialize the access device, the driving parameter storage area can be emptied, so that the driving platform obtains the platform device tree data and drives the access device based on the platform device tree data. Through the method provided by the embodiments of the present application, various different methods can be used to initialize the access device of the driving platform, which has good flexibility. At the same time, without causing substantial changes to the device tree solidified in the platform, it can also ensure the security and stability of the platform and the access device.
[0112] S703. Drive the device to be debugged according to the first device tree of the device to be debugged.
[0113] In the embodiment of the present application, after the driving platform determines the first device tree of the device to be debugged, when the kernel is initialized, the first device tree will be loaded so that the first device tree can take effect in the driver, thereby driving the device to be debugged to achieve the purpose of debugging the device to be debugged. Through the method provided by the embodiment of the present application, the debugging of the access devices of the driving platform can be realized by using the device tree parameters, effectively simplifying the debugging process, reducing the stability risk and security risk, and effectively improving the device debugging efficiency.
[0114] Please refer to Figure 8 , Figure 8 which is a schematic diagram of another device debugging method provided by the embodiment of the present application. Figure 8 The device debugging method shown can be applied to the driving platform. Specifically, the driving platform can execute the device startup process in response to a driving trigger operation (i.e., a device startup instruction); in the application program boot loading stage, the driving platform can obtain the platform device tree data and determine the default device tree of each access device based on the platform device tree data; the driving platform can search for the driving parameter storage area and determine whether the driving parameter storage area is empty (or whether there is a file stored in the driving parameter storage area); if the driving parameter storage area is empty, the driving platform can load the default device tree of each access device into the kernel driver (i.e., the kernel initializes the drivers of each access device according to the default device tree), and then drive each access device, and then enter the operating system. If the driving parameter storage area is not empty (and there is a target driving parameter file stored in the driving parameter storage area), the driving platform can read the target driving parameter file and parse the file to obtain the configured device tree parameters of each access device (i.e., the device tree parameters determined by the parameter configuration tool of the configuration terminal), and use the configured device tree parameters of each access device to update the default device tree of the corresponding access device to obtain the updated device tree of each access device (i.e., update the default device tree with the configured device tree parameters); the driver loads the updated device tree of each access device into the kernel driver (i.e., the kernel initializes the drivers of each access device according to the updated device tree), drives each access device, and then enters the operating system. Through the method provided by the embodiment of the present application, the debugging of the access devices of the driving platform can be realized by using the device tree parameters, effectively simplifying the debugging process, reducing the stability risk and security risk, and effectively improving the device debugging efficiency.
[0115] Through the device debugging method provided by this application, during the abl stage, the driver platform can update the device tree attributes of the access device based on the driver parameter file stored in the driver parameter storage area, without modifying the kernel code and without changing the driver framework process of the kernel. An uncompiled and storable device debugging method is achieved, effectively improving the device debugging efficiency, reducing errors that may be caused by modifying the kernel code, and ensuring the security of the driver platform and the access device; only the real-time attributes of the device tree in the kernel of the driver platform are updated, without substantially changing the solidified device tree, which can achieve fast switching and immediate application of device tree parameters, ensure the recoverability of the device tree, and also ensure the stability of the driver platform.
[0116] Please refer to Figure 9 , Figure 9 FIG. is a schematic flowchart of another device debugging method provided by an embodiment of this application. This device debugging method can be implemented by the above-mentioned configuration terminal 101 and driver platform 102, or can be implemented by other device debugging systems that can implement this device debugging method. The following takes the implementation of this device debugging method by the above-mentioned configuration terminal 101 and driver platform 102 as an example for illustration. The process of the device debugging method provided in the embodiments of this application includes but is not limited to:
[0117] S901. The configuration terminal responds to a driver parameter configuration instruction and determines the first device tree parameters of the device to be debugged. The first device tree parameters include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes.
[0118] In the embodiments of this application, the configuration terminal can respond to a driver parameter configuration instruction and determine the first device tree parameters of the device to be debugged. The driver parameter configuration instruction can indicate adding device tree attributes and corresponding attribute values, can indicate deleting device tree attributes and corresponding attribute values, and can also indicate modifying device tree attributes and / or corresponding attribute values. There can be multiple access devices on the driver platform, and the access device is an external device accessing the driver platform. The device to be debugged can be any one of the multiple access devices. The first device tree parameters of the device to be debugged can include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes.
[0119] In one embodiment, after the configuration terminal is connected to the driver platform through a data cable, the configuration terminal can respond to a parameter configuration tool startup instruction, start the parameter configuration tool (this parameter configuration tool can be used to display a driver parameter configuration interface), and read the platform driver parameter file from the driver parameter storage area of the driver platform. The platform driver parameter file can include the initial device tree parameters of each access device accessing the driver platform. The configuration terminal can store or back up the platform driver parameter file for use in case of device debugging exceptions later.
[0120] In some cases, the parameter configuration tool may have a logging function. Specifically, after generating the device tree parameter file based on the device tree parameters of each access device, the parameter configuration tool can generate a log, which may include the device tree parameters of each access device after this debugging. When debugging again, the parameter configuration tool can read the log, determine the device tree parameters of each receiving device after the previous debugging, and display the device tree parameters after the previous debugging on the driver parameter configuration interface.
[0121] In one embodiment, the parameter configuration tool may include an "Add Device" control and an "Add Attribute" control, as described above Figure 3 shown, enabling device debuggers to flexibly adjust the device tree attributes of the device and different devices according to application requirements, and enabling combined debugging of different devices or combined debugging of different device tree attributes, improving the flexibility of device debugging and also improving the efficiency of device debugging.
[0122] When a device debugging exception occurs, the method provided in this application can also reproduce the problem. For example: in the first debugging, three device tree attributes (P1, P2, and P3 respectively) of a certain device were modified, and the result of the first debugging was that the device connected to the driver platform ran abnormally. Then it is necessary to reproduce the problem and clarify the device tree attributes with abnormal configuration (that is, determine the device tree attributes that cause the device to run abnormally); then in the second debugging, only the device tree attribute P1 of a certain device can be modified, and the other two device tree attributes are saved with the initial settings. The result of the second debugging is that the device connected to the driver platform runs normally; in the third debugging, only the device tree attribute P2 of a certain device can be modified, and the other two device tree attributes are saved with the initial settings. The result of the third debugging is that the device connected to the driver platform runs abnormally, and the problem is reproduced, so that the device tree attributes with abnormal configuration can be determined. Through the method provided in the embodiments of this application, the problem can be reproduced, which is beneficial to quickly locate the configuration item (that is, the device tree attribute) with an exception, and can also effectively improve the debugging efficiency of the device.
[0123] S902. The configuration terminal generates a target driver parameter file according to the first device tree parameter.
[0124] In the embodiments of this application, the configuration terminal can generate a target driver parameter file according to the first device tree parameter of the device to be debugged. When there are multiple access devices, the configuration terminal can generate a target driver parameter file according to the first device tree parameter and the device tree parameters of the access devices other than the device to be debugged among the multiple access devices. The data storage layout of the target driver parameter file can be as described above Figure 4 shown. By Figure 4It can be known that the device tree parameters of the access devices in the target-driven parameter file are stored in the form of modules. When there is a device to be added, the device tree parameters of the device to be added can be directly determined by using the parameter configuration tool. When generating the target-driven parameter file, the device tree parameters of the device to be added can be added to the end of the device tree parameters of the access devices without affecting the device tree parameters of other access devices, ensuring the integrity and reasonableness of the device tree parameters. In addition, the method provided in this application allows the filling of device tree parameters with variable lengths (that is, there is no limit to the byte length of the device tree parameters, as long as the size of the driver parameter file does not exceed the storage capacity of the driver parameter storage area). When the byte count of the device tree parameters of an access device increases, the starting address of the device tree parameters of the access devices arranged after this access device will shift backward accordingly (when the byte count of the device tree parameters decreases, the starting address of the device tree parameters of the access devices arranged after this access device will shift forward accordingly), ensuring that the device tree parameters of the access devices will not be overwritten and guaranteeing the security and reliability of data storage.
[0125] S903. The configuration terminal stores the target-driven parameter file in the driver parameter storage area of the driver platform.
[0126] In the embodiment of this application, the configuration terminal can store the target-driven parameter file in the driver parameter storage area of the driver platform, and the driver parameter storage area is used to store the device tree parameters of the access devices of the driver platform. In some cases, the configuration terminal can store the target-driven parameter file at the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform, so as to overwrite the platform driver parameter file, ensuring that the subsequent driver platform can read the target-driven parameter file completely and correctly.
[0127] In some cases, during the debugging process, when a running exception occurs in the driver platform or the access device after reading the target-driven parameter file, the configuration terminal can store the backed-up platform driver parameter file at the storage location of the target-driven parameter file in the driver parameter storage area of the driver platform, so as to overwrite the target-driven parameter file, thereby realizing the initialization of the device tree parameters of the access device. The configuration terminal can also clear the driver parameter storage area of the driver platform, enabling the driver platform to drive each access device with the default device tree, realizing the running initialization of the access device. Through the method provided in the embodiment of this application, device recovery can be achieved, ensuring the security of the driver platform and the access devices.
[0128] S904. The driver platform reads the target-driven parameter file from the driver parameter storage area in response to the driver trigger instruction.
[0129] In the embodiment of the present application, the drive platform can execute a startup process in response to a drive trigger instruction and enter the abl stage. In the abl stage, the drive platform can load the default device tree of the access device and search for the drive parameter storage area; if a target drive parameter file is stored in the drive parameter storage area, the drive platform can drive the target drive parameter file to update the default device tree of the access device subsequently. If no file is stored in the drive parameter storage area, the kernel of the drive platform can directly load the default device tree of the access device into the drive and drive each access device. In the present application, the size of the target drive parameter file can be 1M and can contain a large amount of data. The prior art involves configuring relevant parameters of the kernel drive, which makes it necessary for the drive platform to obtain relevant parameters of the kernel drive from the storage partition and initialize the drive during operation. However, since the block device has not been initialized to generate device nodes in the initial stage of kernel initialization, it is impossible to directly read the data stored in the storage partition at this stage, which will further increase the time consumed for device debugging. The method provided by the present application does not involve modifying the kernel and the drive, which can effectively avoid the above situation and effectively improve the device debugging efficiency. At the same time, the target drive parameter file can include a large number of device tree parameters, enabling multiple access devices to be debugged in one debugging, thereby reducing the debugging workload of device debuggers.
[0130] S905. The drive platform determines a first device tree of the device to be debugged based on the target drive parameter file.
[0131] In the embodiment of the present application, after reading the target drive parameter file, the drive platform can obtain the first device tree parameters of the device to be debugged in the target drive parameter file. The drive platform can use the first device tree parameters to update the device tree attributes of the default device tree of the device to be debugged to obtain the first device tree of the device to be debugged. When there are multiple access devices, the drive platform can update the device tree attributes of the default device tree of the corresponding access device according to the device tree parameters of each access device to obtain the updated device trees of each access device.
[0132] S906. The drive platform drives the device to be debugged according to the first device tree of the device to be debugged.
[0133] In the embodiment of the present application, at the kernel initialization node, the driver platform can load the first device tree of the device to be debugged into the kernel driver, making the first device tree take effect, and then driving the device to be debugged, so as to achieve the purpose of debugging the device to be debugged. In the present application, without modifying the kernel driver code of the driver platform, the startup process of the driver platform can also be modified. By only modifying the device tree parameters of the connected device, the debugging of the connected device can be realized, and a device debugging method without compilation can be achieved. At the same time, the configuration terminal can back up or store the platform driver parameter file, making the device debugging system recoverable, and realizing a storable device debugging method. In addition, since modifying the device tree parameters usually does not involve sensitive operations, compared with the method of directly modifying the kernel driver code to implement device debugging, the method provided in the present application has higher security.
[0134] Through the device debugging method provided by the present application, the debugging of the connected device of the driver platform can be realized by modifying the device tree parameters of the device, without modifying and compiling the kernel driver code of the platform, realizing a debugging solution without compilation, and improving stability and security. The configuration of the device tree parameters can be realized by using a parameter configuration tool, making the debugging process of the device tree parameters more intuitive, effectively simplifying the device debugging process, and also reducing the technical threshold of device debugging. In addition, the method provided by the present application can be applied to scenarios where the connected device needs to be frequently debugged, can realize the quick switching and instant application of the device tree parameters, effectively shorten the development cycle, improve the device debugging efficiency, reduce code changes, and reduce the maintenance cost. It can realize the storage and backup of files. When a debugging exception occurs, the initialization of the connected device of the driver platform can be realized by using the backed-up platform driver parameter file, having a data recovery function. It can make the driver platform realize the real-time update of the device tree attributes of the connected device based on the driver parameter file stored in the driver parameter storage area, without substantially changing the solidified device tree, can realize the quick switching and instant application of the device tree parameters, can ensure the recoverability of the device tree, and also ensure the stability of the driver platform.
[0135] Please refer to Figure 10 , Figure 10 which is a structural block diagram of a device debugging module provided by an embodiment of the present application. This device debugging module corresponds to the configuration terminal 101 in the above Figure 1 and the module includes:
[0136] A determination unit 1001, configured to determine the first device tree parameters of the device to be debugged in response to a driver parameter configuration instruction, where the first device tree parameters include the device tree attributes of the device to be debugged and the attribute values corresponding to the device tree attributes;
[0137] A generation unit 1002, configured to generate a target driver parameter file according to the first device tree parameters;
[0138] A processing unit 1003 is configured to store the target driver parameter file into a driver parameter storage area of a driver platform, so that the driver platform drives the device to be debugged according to the target driver parameter file stored in the driver parameter storage area.
[0139] In an embodiment, there are multiple access devices on the driver platform, and the device to be debugged is any one of the multiple access devices; when generating the target driver parameter file according to the first device tree parameter, the generating unit 1002 is specifically configured to:
[0140] Obtain initial device tree parameters of access devices other than the device to be debugged among the multiple access devices, where the initial device tree parameters are obtained from the driver platform;
[0141] Perform a combination process on the first device tree parameter and the initial device tree parameters to obtain a device tree parameter file;
[0142] Perform a format conversion process on the device tree parameter file to obtain a target driver parameter file, and the format of the target driver parameter file is a binary format.
[0143] In an embodiment, when the generating unit 1002 determines the first device tree parameter of the device to be debugged in response to a driver parameter configuration instruction, it is specifically configured to:
[0144] In response to a parameter configuration tool startup instruction, display a driver parameter configuration interface, where the driver parameter configuration interface includes a parameter display area corresponding to each access device among the multiple access devices, and the initial device tree parameters of the corresponding access device are displayed in the parameter display area;
[0145] In response to a driver parameter configuration instruction for the device to be debugged, determine the first device tree parameter of the device to be debugged, and display the first device tree parameter in the parameter display area corresponding to the device to be debugged.
[0146] In an embodiment, the generating unit 1002 is further configured to:
[0147] In response to a device addition operation for a device to be added, display a parameter display area corresponding to the device to be added in the driver parameter configuration interface;
[0148] In response to a parameter configuration operation for the device to be added, determine the second device tree parameter of the device to be added, and display the second device tree parameter in the parameter display area corresponding to the device to be added;
[0149] When the generating unit 1002 combines and processes the first device tree parameter and the initial device tree parameter to obtain a device tree parameter file, it specifically is used for:
[0150] Combining and processing the first device tree parameter, the second device tree parameter and the initial device tree parameter to obtain a device tree parameter file.
[0151] In one embodiment, when the generating unit 1002 performs format conversion processing on the device tree parameter file to obtain a target driver parameter file, it specifically is used for:
[0152] Performing format conversion processing on the device tree parameter file to obtain an initial driver parameter file;
[0153] Determining the size relationship between the storage capacity corresponding to the driver parameter storage area and the size of the initial driver parameter file;
[0154] When the storage capacity corresponding to the driver parameter storage area is greater than or equal to the initial driver parameter file, determining the initial driver parameter file as the target driver parameter file;
[0155] When the storage capacity corresponding to the driver parameter storage area is less than the initial driver parameter file, performing deletion processing on the device tree parameter file to obtain a deleted device tree parameter file, and performing format conversion processing on the deleted device tree parameter file to obtain a target driver parameter file.
[0156] In one embodiment, when the processing unit 1003 stores the target driver parameter file into the driver parameter storage area of the driver platform, it specifically is used for:
[0157] Obtaining the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file includes the initial device tree parameters of each access device of the driver platform; the device to be debugged is any one of the access devices;
[0158] Storing the target driver parameter file into the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform;
[0159] The processing unit 1003 is further used for:
[0160] In response to a device debugging exception instruction, obtaining the pre-read platform driver parameter file, and storing the platform driver parameter file into the storage location of the target driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file is read from the driver parameter storage area of the driver platform.
[0161] In one embodiment, the drive parameter configuration instruction is used to indicate at least one of the following operations: deleting a device tree attribute and its corresponding attribute value, adding a device tree attribute and its corresponding attribute value, and modifying a device tree attribute and / or its corresponding attribute value.
[0162] It can be understood that the functions of the functional units of the device debugging module in the embodiments of the present application can be specifically implemented according to the device debugging method in the device debugging method embodiments described above. The specific implementation process can refer to the relevant descriptions in the device debugging method embodiments described above, and will not be elaborated here. In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other relevant parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0163] Through the device debugging module provided by the embodiments of the present application, the debugging of the access device of the drive platform can be realized by modifying the device tree parameters of the device, without modifying and compiling the kernel driver code of the platform, realizing a non-compilation debugging solution, reducing the stability risk and security risk; the configuration of the device tree parameters can be realized by using a parameter configuration tool, making the debugging process of the device tree parameters more intuitive, effectively simplifying the device debugging process, and also reducing the technical threshold of device debugging; in addition, the method provided by the present application can be applied to scenarios where the access device needs to be frequently debugged, can realize the rapid switching and instant application of the device tree parameters, effectively shorten the development cycle, improve the device debugging efficiency, reduce code changes, and reduce the maintenance cost; the method provided by the present application can also store the platform driver parameter file in the drive platform to realize the storage and backup of the file. When a debugging exception occurs, the access device of the drive platform can be initialized by using the backup platform driver parameter file, having a data recovery function, and ensuring the security of the access device.
[0164] Please refer to Figure 11 , Figure 11 which is a structural block diagram of another device debugging module provided by the embodiments of the present application. This device debugging module corresponds to the drive platform 102 in the above Figure 1 , and the module includes:
[0165] A reading unit 1101, configured to read a target drive parameter file from a drive parameter storage area in response to a drive trigger instruction, where the target drive parameter file is generated by a configuration terminal according to first device tree parameters of a device to be debugged, and the first device tree parameters of the device to be debugged are determined by the configuration terminal in response to a drive parameter configuration instruction;
[0166] An execution unit 1102 is configured to determine a first device tree of the device to be debugged based on the target driver parameter file;
[0167] The driving unit 1103 is configured to drive the device to be debugged according to the first device tree of the device to be debugged.
[0168] In one embodiment, the reading unit 1101 is further used for:
[0169] Acquire platform device tree data, and determine a second device tree of the device to be debugged based on the platform device tree data, wherein the platform device tree data is solidified data in the driver platform;
[0170] When no file is stored in the driving parameter storage area, the device to be debugged is driven according to the second device tree of the device to be debugged.
[0171] Through the device debugging module provided in the embodiment of the present application, the driver platform can implement the device tree attribute update of the access device in the abl stage based on the driver parameter file stored in the driver parameter storage area, without modifying the kernel code or changing the kernel driver framework process, thereby realizing a compilation-free and storable device debugging method, effectively improving the device debugging efficiency, reducing the errors that may be caused by modifying the kernel code, and ensuring the security of the driver platform and the access device; only the device tree in the kernel of the driver platform is updated in real time, without making substantial changes to the solidified device tree, so that the device tree parameters can be quickly switched and applied instantly, and the recoverability of the device tree can be guaranteed, while also ensuring the stability of the driver platform.
[0172] See also Figure 12 , Figure 12 It is a structural block diagram of a computer device provided in an embodiment of the present application. Figure 12 The computer device shown can be the above Figure 1 The configuration terminal 101 or the driving platform 102 in. Figure 12 The computer device shown includes at least a processor 1201, an input interface 1202, an output interface 1203, and a computer-readable storage medium 1204. The processor 1201, the input interface 1202, the output interface 1203, and the computer-readable storage medium 1204 may be connected via a bus or other means.
[0173] The computer-readable storage medium 1204 can be stored in the memory of the computer device. The computer-readable storage medium 1204 is used to store a computer program, and the computer program includes computer instructions. The processor 1201 is used to execute the computer program stored in the computer-readable storage medium 1204. The processor 1201 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing the computer program, specifically suitable for loading and executing the computer program to implement the corresponding method flow or corresponding function.
[0174] The embodiments of the present application also provide a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in the computer device, which is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the computer device is stored in this storage space. And, a computer program suitable for being loaded and executed by the processor is also stored in this storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located far from the aforementioned processor.
[0175] In the embodiments of the present application, Figure 12 The computer device shown can correspond to the configuration terminal 101 described above, and the computer program stored in the computer-readable storage medium 1204 can be loaded and executed by the processor 1201 to implement the corresponding steps in the device debugging method related to the above Figure 1 shown device. Specifically, in the implementation, the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to perform the following steps: Figure 2 In response to the drive parameter configuration instruction, determine the first device tree parameter of the device to be debugged, where the first device tree parameter includes the device tree attribute of the device to be debugged and the attribute value corresponding to the device tree attribute;
[0176] Generate a target drive parameter file according to the first device tree parameter;
[0177] Store the target drive parameter file in the drive parameter storage area of the drive platform, so that the drive platform drives the device to be debugged according to the target drive parameter file stored in the drive parameter storage area.
[0178]
[0179] In one embodiment, there are multiple access devices on the drive platform, and the device to be debugged is any one of the multiple access devices; when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to generate a target drive parameter file according to the first device tree parameter, it is specifically used to perform the following steps:
[0180] Obtain the initial device tree parameters of the access devices other than the device to be debugged among the multiple access devices, and the initial device tree parameters are obtained from the drive platform;
[0181] Perform a combination process on the first device tree parameter and the initial device tree parameters to obtain a device tree parameter file;
[0182] Perform a format conversion process on the device tree parameter file to obtain a target drive parameter file, and the format of the target drive parameter file is a binary format.
[0183] In one embodiment, when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to determine the first device tree parameter of the device to be debugged in response to a drive parameter configuration instruction, it is specifically used to perform the following steps:
[0184] In response to a parameter configuration tool startup instruction, display a drive parameter configuration interface, and the drive parameter configuration interface includes a parameter display area corresponding to each access device among the multiple access devices, and the initial device tree parameters of the corresponding access device are displayed in the parameter display area;
[0185] In response to a drive parameter configuration instruction for the device to be debugged, determine the first device tree parameter of the device to be debugged, and display the first device tree parameter in the parameter display area corresponding to the device to be debugged.
[0186] In one embodiment, when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201, it is further used to perform the following steps:
[0187] In response to a device addition operation for a device to be added, display a parameter display area corresponding to the device to be added in the drive parameter configuration interface;
[0188] In response to a parameter configuration operation for the device to be added, determine the second device tree parameter of the device to be added, and display the second device tree parameter in the parameter display area corresponding to the device to be added;
[0189] When the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to perform combined processing on the first device tree parameter and the initial device tree parameter to obtain a device tree parameter file, it is specifically used to perform the following steps:
[0190] Perform combined processing on the first device tree parameter, the second device tree parameter, and the initial device tree parameter to obtain a device tree parameter file.
[0191] In one embodiment, when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to perform format conversion processing on the device tree parameter file to obtain a target driver parameter file, it is specifically used to perform the following steps:
[0192] Perform format conversion processing on the device tree parameter file to obtain an initial driver parameter file;
[0193] Determine the size relationship between the storage capacity corresponding to the driver parameter storage area and the size of the initial driver parameter file;
[0194] When the storage capacity corresponding to the driver parameter storage area is greater than or equal to the initial driver parameter file, determine the initial driver parameter file as the target driver parameter file;
[0195] When the storage capacity corresponding to the driver parameter storage area is less than the initial driver parameter file, perform deletion processing on the device tree parameter file to obtain a deleted device tree parameter file, and perform format conversion processing on the deleted device tree parameter file to obtain a target driver parameter file.
[0196] In one embodiment, when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201 to store the target driver parameter file in the driver parameter storage area of the driver platform, it is specifically used to perform the following steps:
[0197] Obtain the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform, where the platform driver parameter file includes the initial device tree parameters of each access device of the driver platform; the device to be debugged is any one of the access devices;
[0198] Store the target driver parameter file at the storage location of the platform driver parameter file in the driver parameter storage area of the driver platform;
[0199] When the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201, it is further used to perform the following steps:
[0200] In response to a device debugging exception instruction, the pre-read platform drive parameter file is obtained, and the platform drive parameter file is stored in the storage location of the target drive parameter file in the drive parameter storage area of the drive platform, and the platform drive parameter file is read from the drive parameter storage area of the drive platform.
[0201] In one embodiment, the driver parameter configuration instruction is used to instruct at least one of the following operations: deleting a device tree attribute and a corresponding attribute value, adding a device tree attribute and a corresponding attribute value, and modifying a device tree attribute and / or a corresponding attribute value.
[0202] In one embodiment, Figure 12 The computer device shown may correspond to the above Figure 1 The driving platform 102 in the embodiment can load and execute the computer program stored in the computer-readable storage medium 1204 by the processor 1201 to implement the above-mentioned Figure 7 In a specific implementation, the computer program in the computer-readable storage medium 1204 is loaded by the processor 1201 and executes the following steps:
[0203] In response to the drive trigger instruction, read a target drive parameter file from a drive parameter storage area, wherein the target drive parameter file is generated by the configuration terminal according to a first device tree parameter of the device to be debugged, and the first device tree parameter of the device to be debugged is determined by the configuration terminal in response to the drive parameter configuration instruction;
[0204] Determine a first device tree of the device to be debugged based on the target driver parameter file;
[0205] The device to be debugged is driven according to the first device tree of the device to be debugged.
[0206] In one embodiment, when the computer program in the computer-readable storage medium 1204 is loaded and executed by the processor 1201, it is also used to perform the following steps:
[0207] Acquire platform device tree data, and determine a second device tree of the device to be debugged based on the platform device tree data, wherein the platform device tree data is solidified data in the driver platform;
[0208] When no file is stored in the driving parameter storage area, the device to be debugged is driven according to the second device tree of the device to be debugged.
[0209] Through the computer device provided by this application, it is possible to debug the access devices of the driver platform by modifying the device tree parameters of the device, without modifying and compiling the kernel driver code of the platform, realizing a non-compilation debugging solution, and improving stability and security; the parameter configuration tool can be used to configure the device tree parameters, making the debugging process of the device tree parameters more intuitive, effectively simplifying the device debugging process, and also reducing the technical threshold of device debugging; in addition, the method provided by this application can be applied to scenarios where access devices need to be frequently debugged, enabling quick switching and immediate application of device tree parameters, effectively shortening the development cycle, improving the device debugging efficiency, reducing code changes, and lowering the maintenance cost; it is possible to implement the storage and backup of files. When a debugging exception occurs, the access devices of the driver platform can be initialized using the backup platform driver parameter file, having a data recovery function; it can enable the driver platform to realize the real-time update of the device tree attributes of the access devices based on the driver parameter files stored in the driver parameter storage area, without substantially changing the fixed device tree, enabling quick switching and immediate application of device tree parameters, ensuring the recoverability of the device tree, and also ensuring the stability of the driver platform.
[0210] The embodiments of this application also provide a computer-readable storage medium, in which computer instructions are stored. When they run on a computer device, the computer device is enabled to execute the steps in the method embodiments of this application to implement the device debugging method provided by the embodiments of this application. The specific implementation manner can refer to the foregoing description and will not be elaborated here.
[0211] The embodiments of this application also provide a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or computer instructions from the computer-readable storage medium, and the processor executes the computer program or computer instructions, enabling the computer device to execute the steps in the method embodiments of this application to implement the device debugging method provided by the embodiments of this application. The specific implementation manner can refer to the foregoing description and will not be elaborated here.
[0212] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0213] In the above embodiments, the descriptions of the respective embodiments each have their own emphasis. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments. Essentially, the technical solution of the present application, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a computer, a server, or a network device, etc., specifically, the processor in the computer device) to execute all or part of the steps of the above methods in the respective embodiments of the present application. Among them, the aforementioned storage medium may include: various media that can store program codes such as USB flash drives, mobile hard disks, magnetic disks, optical disks, read-only memory (English: Read-Only Memory, abbreviation: ROM), or random access memory (English: Random Access Memory, abbreviation: RAM).
[0214] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood that: it is still possible to modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the respective embodiments of the present application.
Claims
1. A device debugging method, characterized in that: The method is applied to configure a terminal, and the method includes: In response to the driver parameter configuration instruction, determine a first device tree parameter of the device to be debugged, wherein the first device tree parameter includes a device tree attribute of the device to be debugged and an attribute value corresponding to the device tree attribute; Generate a target driver parameter file according to the first device tree parameters; The target driving parameter file is stored in a driving parameter storage area of a driving platform, so that the driving platform drives the device to be debugged according to the target driving parameter file stored in the driving parameter storage area.
2. The method according to claim 1, characterized in that The driving platform has multiple access devices, and the device to be debugged is any one of the multiple access devices; The step of generating a target driver parameter file according to the first device tree parameter includes: Acquire initial device tree parameters of access devices other than the device to be debugged among the multiple access devices, wherein the initial device tree parameters are acquired from the driver platform; Combining the first device tree parameter and the initial device tree parameter to obtain a device tree parameter file; The device tree parameter file is format converted to obtain a target driver parameter file, wherein the target driver parameter file is in a binary format.
3. The method according to claim 2, characterized in that The step of determining the first device tree parameter of the device to be debugged in response to the driver parameter configuration instruction includes: In response to a parameter configuration tool startup instruction, displaying a driver parameter configuration interface, the driver parameter configuration interface including a parameter display area corresponding to each of the plurality of access devices, the parameter display area displaying an initial device tree parameter of the corresponding access device; In response to the driver parameter configuration instruction for the device to be debugged, a first device tree parameter of the device to be debugged is determined, and the first device tree parameter is displayed in a parameter display area corresponding to the device to be debugged.
4. The method according to claim 3, characterized in that The method further comprises: In response to a device adding operation for a device to be added, displaying a parameter display area corresponding to the device to be added on the driving parameter configuration interface; In response to a parameter configuration operation for the device to be added, determining a second device tree parameter of the device to be added, and displaying the second device tree parameter in a parameter display area corresponding to the device to be added; The combining and processing the first device tree parameter and the initial device tree parameter to obtain a device tree parameter file includes: The first device tree parameter, the second device tree parameter, and the initial device tree parameter are combined to obtain a device tree parameter file.
5. The method according to any one of claims 2 to 4, characterized in that: The process of converting the device tree parameter file to obtain a target driver parameter file includes: Performing format conversion processing on the device tree parameter file to obtain an initial driver parameter file; Determine the relationship between the storage capacity corresponding to the driving parameter storage area and the size of the initial driving parameter file; When the storage capacity corresponding to the driving parameter storage area is greater than or equal to the initial driving parameter file, determining the initial driving parameter file as a target driving parameter file; When the storage capacity corresponding to the drive parameter storage area is smaller than the initial drive parameter file, the device tree parameter file is deleted to obtain a deleted device tree parameter file, and the deleted device tree parameter file is format converted to obtain a target drive parameter file.
6. The method according to any one of claims 1 to 4, characterized in that: The step of storing the target drive parameter file in a drive parameter storage area of the drive platform includes: Obtaining a storage location of a platform driver parameter file in a driver parameter storage area of the driver platform, wherein the platform driver parameter file includes initial device tree parameters of each access device of the driver platform; the device to be debugged is any access device; Storing the target drive parameter file in the drive parameter storage area of the drive platform at the storage location of the platform drive parameter file; The method further comprises: In response to a device debugging exception instruction, the pre-read platform drive parameter file is obtained, and the platform drive parameter file is stored in the storage location of the target drive parameter file in the drive parameter storage area of the drive platform, and the platform drive parameter file is read from the drive parameter storage area of the drive platform.
7. The method according to any one of claims 1 to 4, characterized in that: The driver parameter configuration instruction is used to instruct at least one of the following operations: deleting a device tree attribute and a corresponding attribute value, adding a device tree attribute and a corresponding attribute value, and modifying a device tree attribute and / or a corresponding attribute value.
8. A device debugging method, characterized in that: The method is applied to a driving platform, and the method comprises: In response to the drive trigger instruction, read a target drive parameter file from a drive parameter storage area, wherein the target drive parameter file is generated by the configuration terminal according to a first device tree parameter of the device to be debugged, and the first device tree parameter of the device to be debugged is determined by the configuration terminal in response to the drive parameter configuration instruction; Determine a first device tree of the device to be debugged based on the target driver parameter file; The device to be debugged is driven according to the first device tree of the device to be debugged.
9. The method according to claim 8, characterized in that The method further comprises: Acquire platform device tree data, and determine a second device tree of the device to be debugged based on the platform device tree data, wherein the platform device tree data is solidified data in the driver platform; When no file is stored in the driving parameter storage area, the device to be debugged is driven according to the second device tree of the device to be debugged.
10. A device debugging system, comprising a configuration terminal, a driving platform and a device to be debugged, wherein: A configuration terminal, used for determining a first device tree parameter of a device to be debugged in response to a driver parameter configuration instruction; The configuration terminal is further used to generate a target driver parameter file according to the first device tree parameters; A driving platform, used for storing the target driving parameter file; The driver platform is further configured to determine, in response to a driver trigger instruction, a first device tree of the device to be debugged based on the target driver parameter file; The driving platform is further used to drive the device to be debugged according to the first device tree of the device to be debugged.
11. A device debugging module, characterized in that: The module includes: A determining unit, configured to determine, in response to a drive parameter configuration instruction, a first device tree parameter of a device to be debugged, wherein the first device tree parameter includes a device tree attribute of the device to be debugged and an attribute value corresponding to the device tree attribute; A generating unit, configured to generate a target driver parameter file according to the first device tree parameters; The processing unit is used to store the target driving parameter file in the driving parameter storage area of the driving platform, so that the driving platform drives the device to be debugged according to the target driving parameter file stored in the driving parameter storage area.
12. A device debugging module, characterized in that: The module includes: a reading unit, configured to read a target driving parameter file from a driving parameter storage area in response to a driving trigger instruction, wherein the target driving parameter file is generated by the configuration terminal according to a first device tree parameter of the device to be debugged, and the first device tree parameter of the device to be debugged is determined by the configuration terminal in response to the driving parameter configuration instruction; An execution unit, configured to determine a first device tree of the device to be debugged based on the target driver parameter file; A driving unit is used to drive the device to be debugged according to the first device tree of the device to be debugged.
13. A computer device, characterized in that: include: A processor, a communication interface and a memory, wherein the processor, the communication interface and the memory are interconnected, wherein the memory stores computer instructions, and the processor is used to call the computer instructions to implement the device debugging method according to any one of claims 1 to 7, or to implement the device debugging method according to any one of claims 8 to 9.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed on a computer device, enable the computer device to implement the device debugging method as described in any one of claims 1 to 7, or implement the device debugging method as described in any one of claims 8 to 9.