Debugging method, system, electronic device and storage medium

By configuring the target running environment and debugging the UBIFS image of the embedded device in it, the problem of not being able to debug UBIFS when the operating environment of the embedded device is abnormal, and the determination and processing of UBIFS exception files are realized.

CN114996120BActive Publication Date: 2025-05-06FIBOCOM WIRELESS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210434446.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-24
Publication Date
2025-05-06
Estimated Expiration
2042-04-24

AI Technical Summary

Technical Problem

When the operating environment of the embedded device is abnormal, it is impossible to enter the unsorted block image file system (UBIFS) for debugging, resulting in the failure to determine the cause of the software program through UBIFS.

Method used

By configuring the target running environment, obtain the UBIFS image exported by the embedded device, and debug the image in the target running environment to determine the exception files in UBIFS. The method includes loading the driver, simulating the target flash, exporting and parsing the image, and performing debugging and analysis.

Benefits of technology

When the operating environment of an embedded device is abnormal, the UBIFS image can be debugged in the target operating environment to determine the exception file, thereby restoring the normal operation of the device, solving the problem of not being able to enter UBIFS for debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996120B_ABST
    Figure CN114996120B_ABST
Patent Text Reader

Abstract

The present application relates to a debugging method, system, electronic device and storage medium. The debugging method is applied to the debugging device, including: after determining that the operating environment of the embedded device is abnormal, configuring the target operating environment; obtaining the image of the unsorted block mirror file system of the embedded device, debugging the image in the target operating environment to obtain the debugging result; determining the abnormal files of the unsorted block mirror file system according to the debugging result. In the present application, when the operating environment of the embedded device is abnormal, the image of the unsorted block mirror file system of the embedded device is debugged in the target operating environment, and the abnormal files in the unsorted block mirror file system are determined, so as to make corresponding adjustments and restore the normal operation of the embedded device, thereby solving the problem that when the operating environment of the embedded device is abnormal, the unsorted block mirror file system cannot be entered to determine the cause of the software program abnormality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a debugging method, system, electronic device and storage medium. Background Art

[0002] Unsorted block image file system (UBIFS) is a file system used on solid-state storage devices and is currently widely used in embedded devices. The file system is a method and data structure used in the operating system to identify files on storage devices (commonly disks, but also solid-state drives based on NAND flash memory) or partitions, that is, a method of organizing files on storage devices or partitions. The development process of products such as software programs relies on debugging of UBIFS. Generally, operations such as adding, deleting, modifying, and checking files in UBIFS are performed, and debugging means are used to check the file content, file size, number of files, and file attributes in the UBIFS file system after adding, deleting, modifying, and checking operations to determine whether the running process of the software program is consistent with expectations, and determine whether there are defects in the software program based on the judgment results.

[0003] In the prior art, most embedded devices support debug serial port debugging or Android debug bridge (ADB) debugging, which can enter UBIFS and perform debugging during the running of the software program to determine the abnormal cause of the software program.

[0004] However, in the prior art, serial port debugging or ADB debugging are all online debugging, that is, debugging UBIFS during the running of the software program. If the software program runs abnormally, the running environment of the software program is abnormal, such as the system is stuck, the system cannot be started normally, or if there is a problem with the debugging function, UBIFS cannot be entered for debugging, resulting in the inability to determine the abnormal cause of the software program through UBIFS. Summary of the invention

[0005] The present application provides a debugging method, system, electronic device and storage medium to solve the problem that the abnormal cause of the software program cannot be determined through UBIFS due to failure to enter UBIFS for debugging.

[0006] In a first aspect, the present application provides a debugging method, the method comprising:

[0007] After determining that the operating environment of the embedded device is abnormal, configure the target operating environment;

[0008] Obtaining an image of an unordered block image file system exported by the embedded device, and debugging the image in the target operating environment to obtain a debugging result;

[0009] According to the debugging result, abnormal files of the unsorted block mirror file system are determined.

[0010] Optionally, the target operating environment includes a first driver and a target flash;

[0011] The configuration target operating environment includes:

[0012] Load the first driver in the Ubuntu operating system;

[0013] Determining flash simulation parameters through the first driver;

[0014] The target flash is simulated by using the first driver according to the flash simulation parameters, and the target flash matches the operating environment of the embedded device.

[0015] Optionally, before debugging the image in the target operating environment and obtaining the debugging result, the method further includes:

[0016] The image is written into the target flash.

[0017] Optionally, the target operating environment further includes a second driver and a third driver;

[0018] The configuration target operating environment further includes:

[0019] Loading the second driver and the third driver in the Ubuntu operating system;

[0020] The image is debugged in the target operating environment, and before obtaining the debugging result, the method further includes:

[0021] The image in the target flash is parsed by the second driver and the third driver to obtain a parsing result, wherein the parsing result includes each file in the image.

[0022] Optionally, the debugging the image in the target operating environment to obtain a debugging result includes:

[0023] Comparing each file in the image with a preset image file, and determining the file in each file that is different from the preset image file as a target file;

[0024] Perform add, delete, modify and query operations on the target files in each of the files to obtain the target image;

[0025] The target image is debugged in the target operating environment to obtain a debugging result, where the debugging result is used to indicate whether there is an abnormality in the target operating environment.

[0026] Optionally, determining the abnormal files of the unsorted block mirror file system according to the debugging result includes:

[0027] If the debugging result shows that there is no abnormality in the target operating environment, the file corresponding to the target file in the unordered block mirror file system is determined as an abnormal file in the unordered block mirror file system.

[0028] In a second aspect, the present application provides a debugging method, applied to an embedded device, the method comprising:

[0029] Detect whether the operating environment is abnormal and obtain the detection results;

[0030] If the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device.

[0031] Optionally, exporting the image of the unordered block image file system to the debugging device includes:

[0032] Exporting the image of the unsorted block image file system through a preset image export tool; the preset image export tool is an image export tool provided by a flash tool or a chip in the embedded device;

[0033] The image is sent to the debugging device.

[0034] In a third aspect, the present application provides a debugging device, the debugging device comprising:

[0035] A configuration module, used to configure a target operating environment after determining that the operating environment of the embedded device is abnormal;

[0036] A debugging module, used for obtaining an image of the unordered block image file system exported by the embedded device, and debugging the image in the target operating environment to obtain a debugging result;

[0037] A determination module is used to determine abnormal files of the unsorted block mirror file system according to the debugging result.

[0038] In a fourth aspect, the present application provides a debugging device, the debugging device comprising:

[0039] A detection module is used to detect whether the operating environment is abnormal and obtain the detection result;

[0040] The notification module is used to notify the debugging device that the operating environment of the embedded device is abnormal if the detection result is that the operating environment is abnormal, and export the image of the unsorted block image file system to the debugging device.

[0041] In a fifth aspect, the present application provides a debugging system, which includes a debugging device and an embedded device, wherein the debugging device is communicatively connected with the embedded device; wherein:

[0042] The embedded device is used to detect whether the operating environment is abnormal and obtain a detection result; if the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device;

[0043] The debugging device is used to configure a target operating environment after determining that the operating environment of the embedded device is abnormal; obtain an image of an unsorted block mirror file system exported by the embedded device, and debug the image in the target operating environment to obtain a debugging result; and determine abnormal files of the unsorted block mirror file system based on the debugging result.

[0044] In a sixth aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0045] Memory, used to store computer programs;

[0046] The processor is used to implement the steps of the debugging method described in any one of the embodiments of the first aspect or the second aspect when executing the program stored in the memory.

[0047] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the debugging method as described in any one of the embodiments of the first aspect or the second aspect are implemented.

[0048] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0049] The debugging method provided in the embodiment of the present application debugs the image of the unordered block mirror file system of the embedded device in the target operating environment when the operating environment of the embedded device is abnormal, determines the abnormal files in the unordered block mirror file system, and adjusts the abnormal files to restore the normal operation of the embedded device, thereby solving the problem of being unable to enter the unordered block mirror file system to determine the cause of the software program abnormality when the operating environment of the embedded device is abnormal. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

[0052] Figure 1 A schematic diagram of a debugging method provided in an embodiment of the present application Figure 1 ;

[0053] Figure 2 A schematic diagram of a debugging method provided in an embodiment of the present application Figure 2 ;

[0054] Figure 3 A schematic diagram of a debugging method provided in an embodiment of the present application Figure 3 ;

[0055] Figure 4 A schematic diagram of a debugging process provided in an embodiment of the present application;

[0056] Figure 5 A schematic diagram of a debugging system provided in an embodiment of the present application;

[0057] Figure 6 A schematic diagram of a debugging device provided in an embodiment of the present application Figure 1 ;

[0058] Figure 7 A schematic diagram of a debugging device provided in an embodiment of the present application Figure 2 ;

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

[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0061] In order to solve the problem that the abnormal cause of the software program cannot be determined through UBIFS due to failure to enter UBIFS for debugging, the embodiment of the present application provides a debugging method, which is applied to a debugging device, such as Figure 1 As shown, the debugging method includes steps 101 to 103:

[0062] Step 101: After determining that the operating environment of the embedded device is abnormal, configure the target operating environment.

[0063] In a possible implementation, the debugging device receives a notification message sent by the embedded device, and the notification message is used to notify the debugging device that the operating environment of the embedded device is abnormal. At this time, the debugging device determines that the operating environment of the embedded device is abnormal based on the communication message it receives. Subsequently, the debugging device configures the target operating environment.

[0064] Optionally, the debugging device configures the operating environment of the debugging device based on the operating environment of the embedded device to obtain a target operating environment that matches the operating environment of the embedded device. In other words, the image file system of the embedded device can run in the target operating environment.

[0065] There is a strong correlation between the properties of the unsorted block image file system and its flash. If the flash in the target operating environment does not match the flash in the embedded device, the image of the unsorted block image file system cannot be parsed. Therefore, in a possible implementation, the target operating environment includes a first driver and a target flash. At this time, in the process of configuring the target operating environment, the first driver is first loaded in the Ubuntu operating system of the debugging device, and then the flash simulation parameters are determined by the first driver. After that, the first driver is used to simulate the target flash that matches the operating environment of the embedded device according to the flash simulation parameters. In this way, the target operating environment of the debugging device is the same as the operating environment of the embedded device, thereby enhancing the accuracy of abnormal files determined in the target operating environment.

[0066] Among them, the Ubuntu operating system is a Linux operating system that mainly focuses on desktop applications.

[0067] Specifically, the kernel version of the Ubuntu operating system on the debugging device supports MTD driver, UBI driver and nandsim driver. In other words, the Linux kernel version of the Ubuntu operating system on the debugging device is 2.6 and above.

[0068] Exemplarily, the Ubuntu operating system on the debugging device is Ubuntu 14.04 version.

[0069] In addition, the first driver is a nandsim driver, which is used to simulate flash on the debugging device.

[0070] In another possible implementation, the target operating environment further includes a second driver and a third driver. Accordingly, the process of configuring the target operating environment also includes loading the second driver and the third driver in the Ubuntu operating system.

[0071] At this time, before debugging the image of the unordered block image file system exported by the embedded device, that is, the image of the unordered block image file system of the embedded device, and obtaining the debugging result, the image in the target flash is parsed by the second driver and the third driver to obtain the parsing result, so as to debug the image based on each file in the image. Among them, the parsing result includes each file in the image. Of course, each file in the image corresponds one-to-one to each file in the unordered block image file system in the embedded device.

[0072] The second driver is a memory technology device (MTD) driver, which is used to access a Linux subsystem of a memory technology device (such as NOR Flash, NAND Flash).

[0073] In addition, the third driver is an unsorted block image (UBI) driver. The UBI driver and the MTD driver are used to parse the image.

[0074] Step 102: Obtain an image of the unordered block image file system exported by the embedded device, and debug the image in the target operating environment to obtain a debugging result.

[0075] Optionally, the image is debugged in the target operating environment, and before the debugging result is obtained, the debugging device writes the acquired image into the target flash. In this way, the image is in the target flash that matches (is the same as) the flash provided by the embedded operating environment, thereby enhancing the reliability of subsequent debugging results.

[0076] For an introduction to the embedded device exporting an image of an unordered block image file system, please refer to the next embodiment, which will not be described in detail here.

[0077] Optionally, in the process of debugging the image to obtain the debugging result, each file in the image is compared with the preset image file, and the file in each file that is different from the preset image file is determined as the target file. Subsequently, the target file in each file is added, deleted, modified, and checked to obtain the target image. Finally, the target image is debugged in the target operating environment to obtain a debugging result indicating whether there is an abnormality in the target operating environment. The specific debugging process can refer to the prior art and will not be described in detail here.

[0078] The preset image file may be an image of an unsorted block image file system exported by the embedded device and obtained by the debugging device when the operating environment of the embedded device is normal.

[0079] Step 103: According to the debugging result, the abnormal files of the unsorted block mirror file system are determined.

[0080] Optionally, if the debugging result shows that there is no abnormality in the target operating environment, the file corresponding to the target file in the unordered block mirror file system is determined as an abnormal file in the unordered block mirror file system.

[0081] Correspondingly, if the debugging result is that an abnormality exists in the target operating environment, the file corresponding to the target file in the unordered block mirror file system is determined as a normal file in the unordered block mirror file system.

[0082] The number of the target files may be one or more.

[0083] In a possible implementation, when there are multiple target files, add, delete, modify and check operations are performed on any file in the target file to obtain the corresponding target image and debug it to obtain the debugging result corresponding to the any file. If there is a debugging result that there is no abnormality in the operating environment, then the file corresponding to the debugging result in the unsorted block image file system is determined to be an abnormal file. If not, add, delete, modify and check operations are performed on any two or more files in the target file to obtain the corresponding target image and debug it to obtain the corresponding debugging results. At this time, if there is a debugging result that there is no abnormality in the target operating environment, then the files corresponding to the two or more files corresponding to the debugging result in the unsorted block image file system are abnormal files. If not, the target file can be re-determined and debugged based on the target file to determine the abnormal file in the unsorted block image file system.

[0084] For example, taking the number of target files as one,

[0085] Exemplarily, the above debugging device may be, for example, a personal computer (PC).

[0086] It should be noted that, through the above process, when the operating environment of the embedded device is abnormal, in the target operating environment that matches the operating environment of the embedded device, the image of the unsorted block mirror file system of the embedded device is debugged, and the abnormal files in the unsorted block mirror file system are determined so that the abnormal files can be adjusted to restore the normal operation of the embedded device. When the embedded device is operating normally, the unsorted block mirror file system of the embedded device can be entered for debugging to determine the cause of the software program abnormality through the file system, thereby solving the problem of being unable to enter the unsorted block mirror file system to determine the cause of the software program abnormality when the operating environment of the embedded device is abnormal.

[0087] In order to solve the problem that the abnormal cause of the software program cannot be determined through UBIFS due to the inability to enter UBIFS for debugging, the embodiment of the present application provides a debugging method, which is applied to an embedded device, such as Figure 2 As shown, the debugging method includes steps 201-202:

[0088] Step 201: Detect whether the operating environment is abnormal and obtain the detection result.

[0089] Optionally, the embedded device detects in real time whether its own operating environment is abnormal and obtains the detection result.

[0090] The detection result is that the operating environment is abnormal or the operating environment is normal.

[0091] Step 202: If the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device.

[0092] In a possible implementation, if the detection result is that the operating environment is abnormal, a notification message is sent to the debugging device to inform the debugging device through the notification message that the operating environment of the embedded device is abnormal, so that the debugging device can determine that the operating environment of the embedded device is abnormal based on the notification message.

[0093] Correspondingly, if the detection result is that the operating environment is normal, no operation is performed. Alternatively, if the detection result is normal, the debugging device is notified that the current operating environment of the embedded device is normal.

[0094] In a possible implementation, while notifying the debugging device that the operating environment of the embedded device is abnormal, or before or after notifying the debugging device that the operating environment of the embedded device is abnormal, the embedded device exports the image of the unsorted image file system to the debugging device. Accordingly, the debugging device obtains the image of the unsorted image file system exported by the embedded device.

[0095] Specifically, the embedded device exports the image of the unordered image file system through a preset image export tool, and sends the image to the debugging device, so that the debugging device obtains the image.

[0096] The preset image export tool may be a flash tool or an image export tool provided by a chip in an embedded device.

[0097] That is to say, when the operating environment of the embedded device is abnormal, for example, the system cannot be started due to an abnormality or the online debugging function cannot be used, resulting in the inability to enter the unsorted block image file system, the image of the unsorted block image file system in the current embedded device is exported through the flash tool or the image export tool provided by the chip manufacturer in the embedded device, and the image is sent to the debugging device.

[0098] In another possible implementation, when the detection result shows that the operating environment is normal, the embedded device exports an image of an unsorted block image export file system and sends the image to the debugging device so that the debugging device saves the image as a preset image file, so that when it is determined that the operating environment of the embedded device is abnormal, the preset image file can be used to determine the target file.

[0099] At this time, the preset image file saved in the debugging device can be updated in real time.

[0100] In order to solve the problem that the abnormal cause of the software program cannot be determined through UBIFS due to the inability to enter UBIFS for debugging, the embodiment of the present application provides a debugging method, which is applied to an embedded device, such as Figure 3 As shown, the debugging method includes steps 301 to 303:

[0101] Step 301: The embedded device detects whether the operating environment is abnormal and obtains the detection result.

[0102] Step 302: If the detection result is that the operating environment is abnormal, the embedded device notifies the debugging device that the operating environment of the embedded device is abnormal, and exports the image of the unsorted block image file system to the debugging device.

[0103] Step 303: After the debugging device determines that the operating environment of the embedded device is abnormal, it configures the target operating environment.

[0104] Step 304: The debugging device obtains the image of the unordered block image file system exported by the embedded device, and debugs the image in the target operating environment to obtain a debugging result.

[0105] Step 305: The debugging device determines abnormal files in the unsorted block mirror file system according to the debugging result.

[0106] The implementation of steps 301 to 305 can be found in the above content and will not be described in detail here.

[0107] Exemplarily, after determining that the operating environment of the embedded device is abnormal, the debugging process is as follows: Figure 4 As shown, the debugging device configures the target operating environment, that is, loads the MTD driver, the UBI driver, and the nandsim driver, and adjusts the parameters of the nandsim driver so that the flash simulated by the nandsim driver, that is, the above-mentioned target flash, matches the operating environment in the embedded device. In addition, the embedded device uses the flash tool or the image export tool provided by the chip manufacturer in the embedded device to export the image of the unsorted block image file system in the embedded device. Subsequently, the debugging device writes the acquired image of the unsorted block image file system of the embedded device into the flash simulated by the nandsim driver in the Ubuntu system on the debugging device. Finally, the debugging device uses the MTD driver and the UBI driver to parse and debug the image, so as to determine the abnormal file in the unsorted block image file system based on the obtained debugging results, so as to facilitate the adjustment of the abnormal file and restore the normal operation of the embedded device, thereby solving the problem that when the operating environment of the embedded device is abnormal, it is impossible to enter the unsorted block image file system to determine the cause of the software program abnormality.

[0108] It should be noted that, through the above process, when the operating environment of the embedded device is abnormal, by exporting the image of the unsorted block mirror file system and debugging to determine the abnormal files in the file system, the debugging work can be independent of the normal operation of the operating environment in the embedded device. When the system is stuck or other abnormalities occur, the embedded device can be disconnected to achieve offline debugging of the unsorted block mirror file system and determine the abnormal files.

[0109] In addition, in the prior art, debug serial port debugging requires the debugging device to support the serial port debugging function in software, and a debug serial port needs to be reserved in the hardware design. ADB debugging is similar to debug. ADB debugging requires the debugging device to support the ADB function in software, and the hardware needs to rely on USB. In the present application, it is possible to debug the image of the unsorted block image file system of the embedded device and determine the abnormal files without relying on the software support and hardware support for the serial port debugging or ADB function provided by the debugging device.

[0110] In order to solve the problem that the abnormal cause of the software program cannot be determined through UBIFS due to the inability to enter UBIFS for debugging, the embodiment of the present application provides a debugging system for implementing the above Figure 1-Figure 3 The debugging method shown is as follows Figure 5 As shown, the debugging system includes a debugging device and an embedded device.

[0111] Among them, the embedded device is used to detect whether the operating environment is abnormal and obtain the detection result; if the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device.

[0112] The debugging device is used to configure the target operating environment after determining that the operating environment of the embedded device is abnormal; obtain the image of the unsorted block image file system exported by the embedded device, and debug the image in the target operating environment to obtain the debugging result; determine the abnormal files of the unsorted block image file system according to the debugging result.

[0113] like Figure 6 As shown, an embodiment of the present application provides a debugging device, which includes a configuration module 601, a debugging module 602 and a determination module 603.

[0114] The configuration module 601 is used to configure the target operating environment after determining that the operating environment of the embedded device is abnormal.

[0115] The debugging module 602 is used to obtain the image of the unordered block image file system exported by the embedded device, and debug the image in the target operating environment to obtain a debugging result.

[0116] The determination module 603 is used to determine abnormal files of the unsorted block mirror file system according to the debugging result.

[0117] like Figure 7 As shown, an embodiment of the present application provides a debugging device, which includes a detection module 701 and a notification module 702.

[0118] The detection module 701 is used to detect whether the operating environment is abnormal and obtain the detection result;

[0119] The notification module 702 is used to notify the debugging device that the operating environment of the embedded device is abnormal if the detection result is that the operating environment is abnormal, and export the image of the unsorted block image file system to the debugging device.

[0120] like Figure 8 As shown, an embodiment of the present application provides an electronic device, including a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.

[0121] Memory 803, used for storing computer programs;

[0122] In one embodiment of the present application, the processor 801 is used to implement the steps of the debugging method provided by any of the aforementioned method embodiments when executing the program stored in the memory 803.

[0123] It should be noted that, when the processor in the electronic device is used to execute the program stored in the memory, the following is achieved: Figure 1 When the processor in the electronic device is used to execute the program stored in the memory, the following steps are implemented: Figure 2 When performing the steps of the debugging method, the electronic device may be an embedded device.

[0124] The electronic device provided in the embodiment of the present application may specifically be a module capable of realizing a communication function or a terminal device including the module, etc. The terminal device may be a mobile terminal or a smart terminal. The mobile terminal may specifically be at least one of a mobile phone, a tablet computer, a laptop computer, etc.; the smart terminal may specifically be a terminal including a wireless communication module such as a smart car, a smart watch, a shared bicycle, a smart cabinet, etc.; the module may specifically be a wireless communication module, such as any one of a 2G communication module, a 3G communication module, a 4G communication module, a 5G communication module, and a NB-IOT communication module.

[0125] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the debugging method provided in any of the aforementioned method embodiments are implemented.

[0126] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0127] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A debugging method, characterized in that: Applied to debugging equipment, the method comprises: After determining that the operating environment of the embedded device is abnormal, configuring the target operating environment, wherein configuring the target operating environment includes: loading a first driver, a second driver, and a third driver in the Ubuntu operating system; determining flash simulation parameters through the first driver; using the first driver to simulate the target flash according to the flash simulation parameters, the target flash matches the operating environment of the embedded device, wherein the target operating environment includes the first driver, the second driver, the third driver and the target flash, the second driver is a memory technology device driver for accessing the Linux subsystem of the memory technology device, and the third driver is an unsorted block image driver for parsing the image; After configuring the target operating environment, the image of the unsorted block image file system exported by the embedded device is obtained, the image is written into the target flash, the image in the target flash is parsed through the second driver and the third driver to obtain a parsing result, the parsing result includes each file in the image, and the image is debugged in the target operating environment to obtain a debugging result, wherein the debugging of the image to obtain the debugging result includes: comparing each file in the image with a preset image file, and determining the files in each file that are different from the preset image file as the target file; performing addition, deletion, modification and query operations on the target files in each file to obtain the target image; debugging the target image in the target operating environment to obtain a debugging result, the debugging result is used to indicate whether the target operating environment is abnormal, wherein the preset image file is the image of the unsorted block image file system exported by the embedded device obtained by the debugging device when the operating environment of the embedded device is normal; After obtaining the debugging result, the abnormal files of the unsorted block mirror file system are determined according to the debugging result, wherein determining the abnormal files comprises: if the debugging result is that there is no abnormality in the target operating environment, then determining the files corresponding to the target files in the unsorted block mirror file system as abnormal files in the unsorted block mirror file system; if the debugging result is that there is an abnormality in the target operating environment, then determining the files corresponding to the target files in the unsorted block mirror file system as normal files in the unsorted block mirror file system.

2. A debugging method, characterized in that: Applied to an embedded device, the method comprises: Detect whether the operating environment is abnormal and obtain the detection results; If the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device, wherein the debugging device is used to execute the method described in claim 1.

3. The debugging method according to claim 2, characterized in that: The exporting of the image of the unsorted block image file system to the debugging device includes: Exporting the image of the unsorted block image file system through a preset image export tool; the preset image export tool is an image export tool provided by a flash tool or a chip in the embedded device; The image is sent to the debugging device.

4. A debugging system, characterized in that: The debugging system comprises a debugging device and an embedded device, wherein the debugging device is communicatively connected with the embedded device; The embedded device is used to detect whether the operating environment is abnormal and obtain a detection result; if the detection result is that the operating environment is abnormal, the debugging device is notified that the operating environment of the embedded device is abnormal, and the image of the unsorted block image file system is exported to the debugging device; The debugging device is used to configure a target operating environment after determining that the operating environment of the embedded device is abnormal, wherein configuring the target operating environment includes: loading a first driver, a second driver, and a third driver in an Ubuntu operating system; determining flash simulation parameters through the first driver; using the first driver to simulate a target flash according to the flash simulation parameters, wherein the target flash matches the operating environment of the embedded device, wherein the target operating environment includes the first driver, the second driver, the third driver, and the target flash, wherein the second driver is a memory technology device driver for accessing the Linux subsystem of the memory technology device, and the third driver is an unsorted block image driver for parsing the image; after configuring the target operating environment, obtaining an image of an unsorted block image file system exported by the embedded device, writing the image into the target flash, parsing the image in the target flash through the second driver and the third driver to obtain a parsing result, wherein the parsing result includes each file in the image, and debugging the image in the target operating environment to obtain a debugging result. The debugging result is a test result, wherein debugging the image to obtain the debugging result includes: comparing each file in the image with a preset image file, and determining the file in each file that is different from the preset image file as a target file; performing add, delete, modify and query operations on the target file in each file to obtain the target image; debugging the target image in the target operating environment to obtain the debugging result, and the debugging result is used to indicate whether there is an abnormality in the target operating environment, wherein the preset image file is an image of an unsorted block image file system exported by an embedded device and obtained by a debugging device when the operating environment of the embedded device is normal; after obtaining the debugging result, determining the abnormal file of the unsorted block image file system according to the debugging result, wherein determining the abnormal file includes: if the debugging result is that there is no abnormality in the target operating environment, determining the file corresponding to the target file in the unsorted block image file system as an abnormal file in the unsorted block image file system, and if the debugging result is that there is an abnormality in the target operating environment, determining the file corresponding to the target file in the unsorted block image file system as a normal file in the unsorted block image file system.

5. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the debugging method according to any one of claims 1 to 3 when executing a program stored in a memory.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the debugging method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • File debugging method and device, terminal equipment and storage medium

    CN108334453A