WO2023240558A1 - Firmware debugging method and apparatus - Google Patents

Firmware debugging method and apparatus Download PDF

Info

Publication number
WO2023240558A1
WO2023240558A1 PCT/CN2022/099240 CN2022099240W WO2023240558A1 WO 2023240558 A1 WO2023240558 A1 WO 2023240558A1 CN 2022099240 W CN2022099240 W CN 2022099240W WO 2023240558 A1 WO2023240558 A1 WO 2023240558A1
Authority
WO
WIPO (PCT)
Prior art keywords
firmware
debugging
debugged
read
storage partition
Prior art date
Application number
PCT/CN2022/099240
Other languages
French (fr)
Chinese (zh)
Inventor
杨冬东
李芳�
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2022/099240 priority Critical patent/WO2023240558A1/en
Priority to CN202280004135.8A priority patent/CN117597668A/en
Publication of WO2023240558A1 publication Critical patent/WO2023240558A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Abstract

The present invention provides a firmware debugging method and an apparatus, applied to the technical field of computers. The method comprises: obtaining installation data of firmware to be debugged and a debugging tool for said firmware; obtaining a read-only storage partition and a read-write storage partition which are independent of each other in a memory of a debug device; deploying said firmware in the read-only storage partition on the basis of the installation data; deploying the debugging tool for said firmware in the read-write storage partition; and running the debugging tool, and debugging said firmware in the read-only storage partition. The debugging tool is deployed in the read-write storage partition, so that said firmware in the read-only storage partition is debugged by means of the debugging tool in the read-write storage partition; because the read-only storage partition is independent of a system in a debugging process, operation of the system is not affected in the debugging process, and the safety of the operation of the system is improved; furthermore, debugging of system stability can be performed in a development stage, and product research and development are accelerated to quickly reach a maturity expectation.

Description

一种固件的调试方法及其装置Firmware debugging method and device 技术领域Technical field
本公开涉及系统开发技术领域,尤其涉及一种固件的调试方法及其装置。The present disclosure relates to the technical field of system development, and in particular, to a firmware debugging method and a device thereof.
背景技术Background technique
当前技术中,在系统开发的阶段,考虑到最终发布给用户的设备上的安全性问题,是不会部署设备连接工具和各种系统权限的,使得不能对于相同功能版本在开发阶段进行系统稳定性监控和调试。In the current technology, during the system development stage, considering the security issues on the devices that are eventually released to users, device connection tools and various system permissions will not be deployed, making it impossible to stabilize the system during the development stage for the same functional version. performance monitoring and debugging.
发明内容Contents of the invention
本公开实施例提供一种固件的调试方法及其装置,可以应用于系统开发技术领域,用于解决在系统开发阶段无法进行稳定性监控和调试的问题。Embodiments of the present disclosure provide a firmware debugging method and device, which can be applied in the technical field of system development to solve the problem that stability monitoring and debugging cannot be performed during the system development stage.
第一方面,本公开实施例提供了一种固件的调试方法,其特征在于,方法包括:获取待调试固件的安装数据和待调试固件的调试工具;获取调试设备内存中相互独立的只读存储分区和可读写存储分区;基于安装数据在只读存储分区中部署待调试固件;将待调试固件的调试工具部署在可读写存储分区中;运行调试工具,对只读存储分区内的待调试固件进行调试。In a first aspect, embodiments of the present disclosure provide a method for debugging firmware, which is characterized in that the method includes: obtaining the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged; obtaining mutually independent read-only storage in the memory of the debugging device partition and read-write storage partition; deploy the firmware to be debugged in the read-only storage partition based on the installation data; deploy the debugging tool of the firmware to be debugged in the read-write storage partition; run the debugging tool to perform debugging on the read-only storage partition. Debug the firmware for debugging.
本公开实施例中通过将待调试固件的调试工具部署在可读写存储分区中,由于该可读写存储分区与存储待调试固件的只读存储分区相互独立,使得调试过程对系统运行不会造成影响,从而可以解决在系统开发阶段无法进行稳定性监控和调试的问题。In the embodiment of the present disclosure, the debugging tool of the firmware to be debugged is deployed in a read-write storage partition. Since the read-write storage partition is independent of the read-only storage partition that stores the firmware to be debugged, the debugging process will not affect the system operation. impact, thus solving the problem of being unable to perform stability monitoring and debugging during the system development stage.
第二方面,本公开实施例提供了一种导频位置信息确定装置,其特征在于,装置包括:In a second aspect, an embodiment of the present disclosure provides a device for determining pilot location information, which is characterized in that the device includes:
第一获取模块,用于获取待调试固件的安装数据和待调试固件的调试工具;The first acquisition module is used to obtain the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged;
第二获取模块,用于获取调试设备内存中相互独立的只读存储分区和可读写存储分区;The second acquisition module is used to acquire mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device;
第一部署模块,用于基于安装数据在只读存储分区中部署待调试固件;The first deployment module is used to deploy the firmware to be debugged in the read-only storage partition based on the installation data;
第二部署模块,用于将待调试固件的调试工具部署在可读写存储分区中;The second deployment module is used to deploy the debugging tool of the firmware to be debugged in a read-write storage partition;
运行模块,用于运行调试工具,对只读存储分区内的待调试固件进行调试。The running module is used to run debugging tools and debug the firmware to be debugged in the read-only storage partition.
第三方面,本公开提出了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以实现如本公开第一方面实施例所述的固件的调试方法。In a third aspect, the present disclosure proposes an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be executed by the at least one processor. Instructions, which are executed by the at least one processor to implement the firmware debugging method described in the embodiment of the first aspect of the present disclosure.
第四方面,本公开提出了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于实现如本公开第一方面实施例所述的固件的调试方法。In a fourth aspect, the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the firmware debugging method described in the embodiment of the first aspect of the present disclosure.
第五方面,本公开提出了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时用于实现如本公开第一方面实施例所述的固件的调试方法。In a fifth aspect, the present disclosure proposes a computer program product, which includes a computer program that, when executed by a processor, is used to implement the debugging method of firmware as described in the embodiment of the first aspect of the present disclosure.
附图说明Description of the drawings
为了更清楚地说明本公开实施例或背景技术中的技术方案,下面将对本公开实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the disclosure or the background technology, the drawings required to be used in the embodiments or the background technology of the disclosure will be described below.
图1是本公开实施例提供的一种固件的调试方法的流程示意图;Figure 1 is a schematic flow chart of a firmware debugging method provided by an embodiment of the present disclosure;
图2是本公开实施例提供的另一种固件的调试方法流程示意图;Figure 2 is a schematic flowchart of another firmware debugging method provided by an embodiment of the present disclosure;
图3是本公开实施例提供的另一种固件的调试方法流程示意图;Figure 3 is a schematic flowchart of another firmware debugging method provided by an embodiment of the present disclosure;
图4是本公开实施例提供的另一种固件的调试方法流程示意图;Figure 4 is a schematic flowchart of another firmware debugging method provided by an embodiment of the present disclosure;
图5是本公开实施例提供的一种固件的调试装置的结构示意图;Figure 5 is a schematic structural diagram of a firmware debugging device provided by an embodiment of the present disclosure;
图6是本公开实施例提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with aspects of the disclosure as detailed in the appended claims.
在本公开实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开实施例。在本公开实施例和所附权利要求书中所使用的单数形式的“一种”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the embodiments of the present disclosure is for the purpose of describing specific embodiments only and is not intended to limit the embodiments of the present disclosure. As used in the embodiments of the present disclosure and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
应当理解,尽管在本公开实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”It should be understood that although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of the present disclosure, the first information may also be called second information, and similarly, the second information may also be called first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to determining"
出于简洁和便于理解的目的,本文在表征大小关系时,所使用的术语为“大于”或“小于”、“高于”或“低于”。但对于本领域技术人员来说,可以理解:术语“大于”也涵盖了“大于等于”的含义,“小于”也涵盖了“小于等于”的含义;术语“高于”涵盖了“高于等于”的含义,“低于”也涵盖了“低于等于”的含义。For the purpose of simplicity and ease of understanding, the terms used in this article are "greater than" or "less than", "higher than" or "lower than" when characterizing size relationships. But for those skilled in the art, it can be understood that: the term "greater than" also covers the meaning of "greater than or equal to", and "less than" also covers the meaning of "less than or equal to"; the term "higher than" covers the meaning of "higher than or equal to". "The meaning of "less than" also covers the meaning of "less than or equal to".
下面结合附图对本公开所提供的固件的调试方法及其装置进行详细地介绍。The firmware debugging method and device provided by the present disclosure will be introduced in detail below with reference to the accompanying drawings.
请参见图1,图1是本公开实施例提供的一种固件的调试方法的流程示意图。如图1所示,可以包括但不限于如下步骤:Please refer to FIG. 1 , which is a schematic flowchart of a firmware debugging method provided by an embodiment of the present disclosure. As shown in Figure 1, it may include but is not limited to the following steps:
S11,获取待调试固件的安装数据和待调试固件的调试工具。S11: Obtain the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged.
需要说明的是,本公开实施例中的固件(firmware)是指设备内部保存的设备“驱动程序”,通过固件,操作系统才能按照标准的设备驱动实现特定机器的运行动作,有的系统固件可以让用户更新。系统固件可以应用在非常广泛的电子产品中,从遥控器、计算器到电脑中的键盘和硬盘,甚至工业机器人中都可见到它的身影。固件是担任着一个系统最基础 最底层工作的软件。而在硬件设备中,固件就是硬件设备的灵魂,因为一些硬件设备除了固件以外没有其它软件组成,因此固件也就决定着硬件设备的功能及性能。It should be noted that the firmware in the embodiment of the present disclosure refers to the device "driver" stored inside the device. Through the firmware, the operating system can implement the operating actions of a specific machine according to the standard device driver. Some system firmware can Let users update. System firmware can be used in a wide range of electronic products, from remote controls and calculators to keyboards and hard drives in computers, and even in industrial robots. Firmware is the software that performs the most basic and bottom-level work of a system. In hardware devices, firmware is the soul of the hardware device, because some hardware devices have no other software components except firmware, so the firmware determines the function and performance of the hardware device.
本公开实施例中,为了在调试设备上对固件进行调试,可以获取到待调试固件的安装数据,以基于该安装数据在该调试设备上对待调试固件进行安装,安装完成后调试设备可以使用该固件进行驱动调试设备的操作系统运行。In the embodiment of the present disclosure, in order to debug the firmware on the debugging device, the installation data of the firmware to be debugged can be obtained, and the firmware to be debugged can be installed on the debugging device based on the installation data. After the installation is completed, the debugging device can use the The firmware drives the debugging device's operating system to run.
本公开实施例中的待调试固件可以为任一类型的固件,例如固件可以为计算机主板上的基本输入/输出系统BIOS(Basic Input/output System)、统一可扩展固件接口(Unified Extensible Firmware Interface,UEFI)等,需要说明的是此处仅为示例,本公开实施例中对固件的类型不做限定。The firmware to be debugged in the embodiment of the present disclosure can be any type of firmware. For example, the firmware can be the Basic Input/Output System BIOS (Basic Input/output System) or the Unified Extensible Firmware Interface on the computer motherboard. UEFI), etc. It should be noted that this is only an example, and the type of firmware is not limited in the embodiments of the present disclosure.
可以理解的是,不同的待调试固件安装数据不同,此处不作任何限定。对应的,不同的固件需要的调试工具也可以相同或不同,具体需要根据实际的监控和调试的目的去选择和设定。It is understandable that the installation data of different firmwares to be debugged are different, and there is no limitation here. Correspondingly, different firmwares may require the same or different debugging tools, which need to be selected and set according to the actual monitoring and debugging purposes.
可选地,调试工具还可包括所有固件的调试内容,在针对不同的待调试固件时,可选择不同的调试选项。在本公开实施例中,调试工具可包含多种选项或者多种工具,举例来说,可包括各种trace(strace,ftrace,ptrace,gtrace)及其控制工具,还可包含异常监控工具如kpanic,softlockup,watchdog,native crash等,及其对应的日志(log)和内存(dump)工具,还可包含异系统各个状态的统计工具及提供的信息的采集工具,如procrank,netstat等,通过网络工具和自动化脚本来部署。Optionally, the debugging tool can also include debugging content for all firmware, and different debugging options can be selected for different firmware to be debugged. In the embodiment of the present disclosure, debugging tools may include multiple options or tools. For example, they may include various traces (strace, ftrace, ptrace, gtrace) and their control tools, and may also include exception monitoring tools such as kpanic. , softlockup, watchdog, native crash, etc., and their corresponding log (log) and memory (dump) tools, and can also include statistical tools for various states of different systems and information collection tools such as procrank, netstat, etc., through the network Tools and automated scripts to deploy.
需要说明的是,调试工具可通过模拟用户对固件来进行自动化测试,例如可以对固件进行压力测试、异常检查等,例如调试工具可以通过打桩的方式,获取到固件的监控数据和/或监控日志,通过监控数据和/或监控日志可以识别固件是否存在异常和/或出现异常的位置等。通过监控数据和/或监控日志可以识别固件的压力情况。It should be noted that the debugging tool can perform automated testing on the firmware by simulating the user's testing of the firmware. For example, the debugging tool can perform stress testing, abnormality checking, etc. on the firmware. For example, the debugging tool can obtain monitoring data and/or monitoring logs of the firmware through piling. , through monitoring data and/or monitoring logs, it is possible to identify whether there are abnormalities in the firmware and/or where the abnormalities occur, etc. Stress conditions in the firmware can be identified through monitoring data and/or monitoring logs.
S12,获取调试设备内存中相互独立的只读存储分区和可读写存储分区。S12: Obtain mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device.
本公开实施例中,可以通过调试设备在固件发布之前,对固件进行调试,以实现向用户设备发布稳定和安全的调试后的固件。为了使得固件的调试过程并不影响固件本身的安装数据,可以从调试设备的内存中识别出相互独立的只读存储分区和可读写存储分区。需要说明的是,用户或调试人员对存储在只读存储分区的内容仅具有读操作的权限,对该内容不能进行写操作。用户或调试人员对存储在可读写存储分区的内容具有读操作和写操作的权限,也就是说可以对存储在可读写存储分区的内容进行编辑。In the embodiment of the present disclosure, the firmware can be debugged by a debugging device before the firmware is released, so as to release stable and safe debugged firmware to user equipment. In order to prevent the firmware debugging process from affecting the installation data of the firmware itself, independent read-only storage partitions and read-write storage partitions can be identified from the memory of the debugging device. It should be noted that the user or debugger only has read operation permissions on the content stored in the read-only storage partition, and cannot write operations on the content. Users or debuggers have read and write permissions on the content stored in the read-write storage partition, which means they can edit the content stored in the read-write storage partition.
需要说明的是,固件一般存储于设备中的只读存储分区,例如,只读存储分区可以为电可擦可编程只读存储器(Electrically Erasable Programmable Read Only Memory,EEPROM),一般为可由用户通过特定的刷新程序进行升级的程序。一般来说,担任着一个数码产品最基础、最底层工作的软件才可以称之为固件。It should be noted that firmware is generally stored in a read-only storage partition in the device. For example, the read-only storage partition can be an Electrically Erasable Programmable Read Only Memory (EEPROM), which is generally accessible by the user through a specific The refresh program is a program for upgrading. Generally speaking, software that is responsible for the most basic and bottom-level work of a digital product can be called firmware.
为了考虑到固件最终发布到用户设备上的安全性和稳定性,不会在只读存储分区部署设备连接工具和各种系统权限,使得不能对于相同功能版本在开发阶段进行系统稳定性监 控和调试。在本公开实施例中,调试设置可为人为设置的,也可为通过脚本自动进行操作的,此处不作任何限制。In order to consider the security and stability of the final release of the firmware to user devices, device connection tools and various system permissions will not be deployed in the read-only storage partition, making it impossible to monitor and debug system stability during the development phase for the same functional version. . In the embodiment of the present disclosure, the debugging settings may be set manually or automatically operated through a script, without any limitation here.
可读写存储分区是一种可重写的存储器芯片,并且其内容在掉电的时候也不会丢失。例如,可读写存储分区可以为可擦可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)。换句话说,它是非易失性的。它通过EPROM编程器进行编程,EPROM编程器能够提供比正常工作电压更高的电压对EPROM编程。一旦经过编程,EPROM只有在强紫外线的照射下才能够进行擦除。The read-write storage partition is a rewritable memory chip, and its contents will not be lost when the power is turned off. For example, the readable and writable storage partition can be an Erasable Programmable Read Only Memory (EPROM). In other words, it is non-volatile. It is programmed through an EPROM programmer, which can provide a higher voltage than the normal operating voltage to program the EPROM. Once programmed, EPROM can only be erased by exposure to strong ultraviolet light.
S13,基于安装数据在只读存储分区中部署待调试固件。S13, deploy the firmware to be debugged in the read-only storage partition based on the installation data.
在本公开实施例中,可通过在只读存储分区中运行安装数据,以此在只读存储分区中部署待调试固件,从而实现将对应的只读存储分区的对应调试设置中涉及的功能进行调用或打开,为后续的调试操作提供基础。In the embodiment of the present disclosure, the firmware to be debugged can be deployed in the read-only storage partition by running the installation data in the read-only storage partition, thereby realizing the functions involved in the corresponding debugging settings of the corresponding read-only storage partition. Call or open to provide the basis for subsequent debugging operations.
系统需要识别出来部署的过程,启动引导分区里面调试设置,将这些分区替换成能有调试能力的只读存储分区的内容。通过调试工具对只读存储分区的访问权限进行管理,可确定具有访问权限的只读存储分区,从而对该具有访问权限的只读存储分区进行调试,获取监控数据。The system needs to identify the deployment process, enable the debugging settings in the boot partition, and replace these partitions with the contents of read-only storage partitions with debugging capabilities. By managing the access permissions of read-only storage partitions with debugging tools, you can determine the read-only storage partitions with access permissions, thereby debugging the read-only storage partitions with access permissions and obtaining monitoring data.
S14,将待调试固件的调试工具部署在可读写存储分区中。S14, deploy the debugging tool of the firmware to be debugged in a read-write storage partition.
在本公开实施例中,可读写存储分区是和系统独立的,该可读写存储分区可以供用户使用。本公开提出的调试设备可以在待调试固件发布至用户设备前,对待调试固件进行异常检测,并且对待调试固件进行稳定性调试,由于该可读写存储分区与系统相互独立,在调试过程中占用这部分可读写存储分区,从而调试过程并不会影响系统的运行过程,有利于系统的稳定运行。In the embodiment of the present disclosure, the readable and writable storage partition is independent from the system, and the readable and writable storage partition can be used by users. The debugging equipment proposed in this disclosure can perform anomaly detection on the firmware to be debugged before it is released to the user device, and perform stability debugging on the firmware to be debugged. Since the readable and writable storage partition is independent of the system, it occupies a lot of space during the debugging process. This part of the storage partition can be read and written, so the debugging process will not affect the running process of the system and is conducive to the stable operation of the system.
可选地,由于可读写存储分区是分别给用户使用的存储分区,本公开实施例中在待调试固件发布至用户设备时,还可释放调试工具占用的可读写存储分区,以将该可读写存储分区重新配置给用户来使用。本公开实施例中占用可恢复的可读写存储分区进行调试,可以避免占用不能还给用户的系统空间来做监控和调试的问题,在调试完成后可以恢复给用户使用,从而可以为用户节省更多的存储空间,提升用户的使用资源。Optionally, since the readable and writable storage partitions are storage partitions used by users respectively, in the embodiment of the present disclosure, when the firmware to be debugged is released to the user device, the readable and writable storage partition occupied by the debugging tool can also be released to use the debugging tool. Read-write storage partitions are reconfigured for users to use. In the disclosed embodiment, the recoverable read-write storage partition is occupied for debugging, which can avoid the problem of occupying system space that cannot be returned to the user for monitoring and debugging. After debugging is completed, it can be restored to the user for use, thereby saving money for the user. More storage space improves user resources.
在本公开实施例中,在获取到调试工具后,将调试工具部署于可读写存储分区中,以便于在需要对只读存储分区内的待调试固件进行调试时,可以从该可读写存储分区中调用相关的调试工具。In the embodiment of the present disclosure, after obtaining the debugging tool, the debugging tool is deployed in a read-write storage partition, so that when it is necessary to debug the firmware to be debugged in the read-only storage partition, the debug tool can be debugged from the read-write storage partition. Call related debugging tools in the storage partition.
S15,运行调试工具,对只读存储分区内的待调试固件进行调试。S15, run the debugging tool to debug the firmware to be debugged in the read-only storage partition.
需要说明的是,对只读存储分区内的待调试固件进行调试,可包括运行的调试工具,对固件的运行进行状态跟踪、压力测试或者是基于结果对固件的异常数据进行分析和故障排查等。It should be noted that debugging the firmware to be debugged in the read-only storage partition can include running debugging tools, performing status tracking and stress testing on the running of the firmware, or analyzing and troubleshooting abnormal data of the firmware based on the results, etc. .
在本公开实施例中,首先获取待调试固件的安装数据和待调试固件的调试工具,然后获取调试设备内存中相互独立的只读存储分区和可读写存储分区,而后基于安装数据在只读存储分区中部署待调试固件,将待调试固件的调试工具部署在可读写存储分区中,最后 运行调试工具,对只读存储分区内的待调试固件进行调试。本公开实施例中通过将调试工具部署在可读写存储分区中,从而通过可读写存储分区中的调试工具,对只读存储分区内的待调试固件进行调试,在调试过程中由于只读存储分区与系统独立,调试过程不会影响系统运行,提高系统运行的安全性。进一步地,能够在开发阶段进行系统稳定性的调试,提供性能稳定性评估结果和各种异常的调试数据,使得系统具备高效的稳定性监控和调试能力,加速产品研发速度快速达到成熟度预期。In the embodiment of the present disclosure, the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged are first obtained, and then the independent read-only storage partition and read-write storage partition in the memory of the debugging device are obtained, and then based on the installation data, the read-only storage partition is obtained. Deploy the firmware to be debugged in the storage partition, deploy the debugging tool of the firmware to be debugged in the read-write storage partition, and finally run the debugging tool to debug the firmware to be debugged in the read-only storage partition. In the embodiment of the present disclosure, the debugging tool is deployed in the read-write storage partition, so that the firmware to be debugged in the read-only storage partition is debugged through the debugging tool in the read-write storage partition. During the debugging process, due to the read-only The storage partition is independent from the system, and the debugging process will not affect the system operation, improving the security of the system operation. Furthermore, system stability debugging can be carried out during the development phase, and performance stability evaluation results and various abnormal debugging data can be provided, so that the system has efficient stability monitoring and debugging capabilities, accelerating product development and quickly reaching maturity expectations.
请参见图2,图2是本公开实施例提供的另一种固件的调试方法的流程示意图,如图2所示,调试工具的部署过程,可包括但不限于如下步骤:Please refer to Figure 2. Figure 2 is a schematic flow chart of another firmware debugging method provided by an embodiment of the present disclosure. As shown in Figure 2, the deployment process of the debugging tool may include but is not limited to the following steps:
S21,获取调试工具的调试源文件,并对调试源文件链接生成调试工具的可执行文件。S21: Obtain the debugging source file of the debugging tool, and link the debugging source file to generate an executable file of the debugging tool.
在编译器中预先编译调试工具的调试源文件,其中调试源文件中包括调试环境参数、调试的内容,调试参数和调试逻辑等。本公开实施例中在获取到调试源文件后,为了能使得调试源文件可以被执行,需要对调试源文件进行链接以生成调试工具的可执行文件。需要说明的是,每一个源文件即.c文件对应有零碎文件即.h文件,通过预编译(#include)把.c和.h文件整合成一个组合C文件,这个组合C文件的扩展名为.i。把组合C文件编译成汇编文件.s,目标文件为机器指令放在一个.o文件当中,单个目标文件是不能工作的,因为各个目标文件是相互支撑工作的,进一步地把各个目标文件整合为可执行文件,例如,在windows系统中可执行文件后缀为.exe,Linux系统中后缀为.out。The debugging source file of the debugging tool is pre-compiled in the compiler. The debugging source file includes debugging environment parameters, debugging content, debugging parameters, debugging logic, etc. In the embodiment of the present disclosure, after the debugging source file is obtained, in order to enable the debugging source file to be executed, the debugging source file needs to be linked to generate an executable file of the debugging tool. It should be noted that each source file, that is, a .c file, corresponds to a fragmented file, that is, a .h file. The .c and .h files are integrated into a combined C file through precompilation (#include). The extension of this combined C file for.i. Compile the combined C file into an assembly file .s. The target file is the machine instruction and is placed in a .o file. A single target file cannot work because each target file supports each other. Further integrate each target file into Executable files, for example, the suffix of the executable file is .exe in Windows system and .out in Linux system.
S22,在可读写存储分区中部署可执行文件。S22, deploy the executable file in a read-write storage partition.
通过上述链接过程生成调试工具对应的可执行文件后,可以将可执行文件部署到课读写存储分区中,由于可读写存储分区为与只读存储分区相互独立,可以与只读存储分区的待调试固件进行隔离。After the executable file corresponding to the debugging tool is generated through the above linking process, the executable file can be deployed to the read-write storage partition. Since the read-write storage partition is independent of the read-only storage partition, it can be combined with the read-only storage partition. The firmware to be debugged is isolated.
可选地,调试设备可以配置有人机互动界面(User Interface,UI),在生成可执行文件后,可以在UI界面上向用户展示可执行文件,用户可以在UI界面上方便和直观地根据实际的调试需要,对可执行文件进行选择,即对调试功能进行灵活选择,不仅可以可以增加调试的灵活性,而且提高了调试的针对性和实用性。Optionally, the debugging equipment can be configured with a User Interface (UI). After generating the executable file, the executable file can be displayed to the user on the UI interface. The user can conveniently and intuitively configure the executable file based on the actual situation on the UI interface. According to the debugging needs, the selection of executable files, that is, the flexible selection of debugging functions, can not only increase the flexibility of debugging, but also improve the pertinence and practicality of debugging.
调试设备中有多个存储分区,不同的存储分区可能对应不同的类型,例如,类型可以包括只读存储分区和可读写存储分区。调试设备的内存可以预先划分好各个存分区的类型,并且标记各个存储分区的类型标识。本公开实施例中获取调试设备内存中相互独立的只读存储分区和可读写存储分区,包括:获取调试设备内存中存储分区的类型标识,根据类型标识,区分只读存储分区和可读写存储分区。需要说明的是类型标识为提前设定好的,此处不作任何限定。There are multiple storage partitions in the debugging device, and different storage partitions may correspond to different types. For example, the types may include read-only storage partitions and read-write storage partitions. The memory of the debugging device can be pre-divided into the types of each storage partition, and the type identifier of each storage partition can be marked. In this disclosed embodiment, obtaining mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device includes: obtaining the type identifier of the storage partition in the memory of the debugging device, and distinguishing the read-only storage partition and the read-write storage partition based on the type identifier. storage partition. It should be noted that the type identifier is set in advance and is not limited here.
请参见图3,图3是本公开实施例提供的另一种固件的调试方法的流程示意图,运行调试工具,对只读存储分区内的待调试固件进行调试,如图3所示,可以包括但不限于如下步骤:Please refer to Figure 3. Figure 3 is a schematic flow chart of another firmware debugging method provided by an embodiment of the present disclosure. Run the debugging tool to debug the firmware to be debugged in the read-only storage partition. As shown in Figure 3, it may include But not limited to the following steps:
S31,通过脚本启动调试工具。S31, start the debugging tool through the script.
需要说明的是,脚本是使用一种特定的描述性语言,依据一定的格式编写的可执行文 件。脚本语言又被称为扩建的语言,或者动态语言,是一种编程语言,用来控制软件应用程序,脚本通常是以文本(ASCⅡ)保存,只是在被调用时进行解释或者编译。当执行脚本时,计算机会执行一连串的操作。It should be noted that a script is an executable file written in a certain format using a specific descriptive language. Scripting language, also known as extended language, or dynamic language, is a programming language used to control software applications. Scripts are usually saved in text (ASCⅡ) and are only interpreted or compiled when called. When a script is executed, the computer performs a series of operations.
本公开实施例中,可以预先生成启动调试工具的脚本,通过的脚本运行,实现自动调取调试工具,以对待调试固件进行调试,并采集调试过程中产生的调试数据。In the embodiment of the present disclosure, a script for starting the debugging tool can be generated in advance, and by running the script, the debugging tool can be automatically called to debug the firmware to be debugged and collect debugging data generated during the debugging process.
需要说明的是,可通过生成脚本来进行自动化测试,将按键事件提前录制好,包括进入到各个应用的各个按键序列,并通过配置进入各个应用服务的频率、间隔和随机的各个应用服务的进入次序及次数,和进入应用和服务后随机的按键触发的可配置个数等策略,实现压力测试检查。由此实现对待调试固件的自动调试,提升调试的效率,降低待调试固件调试的成本。It should be noted that automated testing can be carried out by generating scripts, recording key events in advance, including key sequences to enter each application, and configuring the frequency, interval and random entry of each application service. Strategies such as the sequence and times, as well as the configurable number of random key triggers after entering applications and services, implement stress testing and inspection. This enables automatic debugging of the firmware to be debugged, improves debugging efficiency, and reduces the cost of debugging the firmware to be debugged.
S32,通过调试工具对只读存储分区的访问权限进行管理,以获取待调试固件运行过程中监控数据。S32, use the debugging tool to manage the access rights of the read-only storage partition to obtain monitoring data during the operation of the firmware to be debugged.
在本公开实施例中,为了获取待调试固件运行过程中监控数据,需要打开待调试固件对应的一些功能的权限。In the embodiment of the present disclosure, in order to obtain monitoring data during the operation of the firmware to be debugged, it is necessary to open permissions for some functions corresponding to the firmware to be debugged.
调试工具通过识别有调试能力的只读存储分区的内容,从而对该具有访问权限的只读存储分区进行调试,获取监控数据。The debugging tool identifies the contents of the read-only storage partition with debugging capabilities, thereby debugging the read-only storage partition with access permissions and obtaining monitoring data.
需要说明的是,当脚本完全运行完毕,即运行完成调试工具中设置好的的调试事件,最终可获取到固件运行的日志数据和/或运行结果数据,从而生成待调试固件运行过程中监控数据。It should be noted that when the script is completely run, that is, the debugging event set in the debugging tool is completed, the log data and/or running result data of the firmware running can finally be obtained, thereby generating monitoring data during the running of the firmware to be debugged. .
S33,根据监控数据对待调试固件进行调试。S33, debug the firmware to be debugged based on the monitoring data.
在本公开实施例中,在获取到待调试数据后,可对监控数据进行分析,确定异常数据,然后基于异常数据对待调试固件进行调试。In the embodiment of the present disclosure, after obtaining the data to be debugged, the monitoring data can be analyzed to determine the abnormal data, and then the firmware to be debugged can be debugged based on the abnormal data.
需要说明的是,异常数据可包含多种,举例来说,如果执行脚本过程中,出现了一些进程中无访问权限或者反馈的监控数据与预期的数据差距较大等,则需要对待调试固件进行调试,或者反馈给用户,等待进一步地优化处理。It should be noted that abnormal data can include many types. For example, if during the execution of the script, there are some processes that do not have access rights or the feedback monitoring data is significantly different from the expected data, etc., the firmware to be debugged needs to be Debugging, or feedback to users, waiting for further optimization.
在本公开实施例中,首先通过脚本启动调试工具,然后通过调试工具对只读存储分区的访问权限进行管理,以获取待调试固件运行过程中监控数据,最后根据监控数据对待调试固件进行调试。由此,通过脚本启动调试工具,自动启动系统压力测试,可以实现自动对待调试固件进行调试,提升调试的效率。In the embodiment of the present disclosure, the debugging tool is first started through a script, and then the access rights of the read-only storage partition are managed through the debugging tool to obtain monitoring data during the operation of the firmware to be debugged, and finally the firmware to be debugged is debugged based on the monitoring data. Therefore, by starting the debugging tool through a script and automatically starting the system stress test, you can automatically debug the firmware to be debugged and improve debugging efficiency.
进一步地,在确定待调试固件的调试结束后,释放调试工具占用的可读写存储分区。Further, after it is determined that the debugging of the firmware to be debugged is completed, the readable and writable storage partition occupied by the debugging tool is released.
请参见图4,图4是本公开实施例提供的另一种固件的调试方法的流程示意图。如图4所示,在上述实施例的基础之上,该方法可以包括但不限于如下步骤:Please refer to FIG. 4 , which is a schematic flowchart of another firmware debugging method provided by an embodiment of the present disclosure. As shown in Figure 4, based on the above embodiment, the method may include but is not limited to the following steps:
S41,通过脚本启动调试工具。S41, start the debugging tool through the script.
关于步骤S41的具体实现可参见上述实施例中相关内容的记载,此处不再赘述。Regarding the specific implementation of step S41, please refer to the relevant content records in the above embodiments, and will not be described again here.
S42,通过调试设备的内存和块设备的打桩位置,获取内存和块设备的跟踪数据。S42: Obtain the tracking data of the memory and block device by debugging the memory of the device and the piling position of the block device.
需要说明的是,调试设备可为多形态的系统,举例来说可为车机设备、手机终端或者 嵌入式设备等,此处不作任何限定。It should be noted that the debugging equipment can be a multi-form system, for example, it can be a vehicle equipment, a mobile phone terminal or an embedded device, etc., without any limitation here.
块设备也就是存储以“块”为单位数据的设备,比较典型的如磁盘设备、光盘或者优盘。本公开中的块设备指的是只读存储分区中块设备。A block device is a device that stores data in "blocks", typically such as a magnetic disk device, optical disk, or USB flash drive. The block device in this disclosure refers to the block device in the read-only storage partition.
在本公开实施例中,可以在内存和块设备上进行打桩,调试工具可以基于内存和块设备内的打桩位置,对内存和块设备的运行状态进行跟踪数据。In the embodiment of the present disclosure, piling can be performed on the memory and block device, and the debugging tool can track data on the running status of the memory and block device based on the piling position in the memory and block device.
S43,统计待调试固件的日志信息,以对待调试固件进行异常监控,获取待调试固件的异常监控数据。S43, collect log information of the firmware to be debugged to perform abnormal monitoring of the firmware to be debugged, and obtain abnormal monitoring data of the firmware to be debugged.
待调试固件在运行过程中会产生日志信息,在本公开实施例中,可以统计待调试固件的日志信息,将日志信息与预设信息进行对比,以确定待调试固件的异常数据。例如,可以日志信息中可以包括某些指令的响应时长,若响应时长大于设定值,可以确定响应异常。再例如,日志信息中可以包括应用占用资源的时长和/或数量,占用的时长和/或占用的数量超出各自的设定值,可以确定该应用存在异常。The firmware to be debugged will generate log information during operation. In the embodiment of the present disclosure, the log information of the firmware to be debugged can be counted, and the log information can be compared with the preset information to determine the abnormal data of the firmware to be debugged. For example, the log information may include the response time of certain instructions. If the response time is longer than the set value, it may be determined that the response is abnormal. For another example, the log information may include the duration and/or quantity of resources occupied by the application. If the duration and/or quantity occupied exceeds their respective set values, it may be determined that the application is abnormal.
在获取到异常监控数据后,可以将异常监控数据通过UI界面展示给调试人员,以由调试人员进行调试和/或故障分析。After obtaining the abnormal monitoring data, the abnormal monitoring data can be displayed to the debugger through the UI interface, so that the debugger can perform debugging and/or fault analysis.
S44,模拟待调试固件的压力测试事件,基于压力测试事件对待调试固件进行压力测试,获取待调试固件的压力测试数据。S44: Simulate the stress test event of the firmware to be debugged, perform a stress test on the firmware to be debugged based on the stress test event, and obtain the stress test data of the firmware to be debugged.
在本公开实施例中,可以通过调试工具模拟对待调试固件的压力测试事件,并执行模拟出的压力测试事件,来对待调试固件进行压力测试,获取待调试固件在执行压力测试事件时的压力测试数据。压力测试数据可以包括按键的响应,或者按键时占用的资源等。In the embodiment of the present disclosure, the debugging tool can be used to simulate the stress test event of the firmware to be debugged, and execute the simulated stress test event to perform the stress test on the firmware to be debugged, and obtain the stress test of the firmware to be debugged when executing the stress test event. data. Stress test data can include key response, or resources occupied when a key is pressed, etc.
在一些实现中,可以将压力测试事件提前录制好,其中压力测试事件可以包括各个应用的交互序列。举例说明,在应用上执行频繁的按键操作,往往会对应用造成压力,本公开中可以模拟在应用的一系列按键操作,该一系列按键操作构成压力测试事件。交互序列可以理解为应用对应的按键序列。需要说明的是,系统的压力往往来自于多个应用的频繁按键操作,本公开中可以模拟多个应用的一系列按键操作来构成压力测试事件。也就是说,该交互序列中包括进入到各个应用的时刻、在应用中的按键操作等。In some implementations, stress test events can be recorded in advance, where the stress test events can include interaction sequences of each application. For example, performing frequent key operations on an application often puts pressure on the application. In the present disclosure, a series of key operations on the application can be simulated, and the series of key operations constitute a stress test event. The interaction sequence can be understood as the key sequence corresponding to the application. It should be noted that system pressure often comes from frequent key operations of multiple applications. In this disclosure, a series of key operations of multiple applications can be simulated to constitute a stress test event. That is to say, the interaction sequence includes the time of entering each application, key operations in the application, etc.
本公开实施例中,调试工具可以从压力测试事件中获取各个应用的应用标识,在进入应用标识所标识的应用后,按照交互时序对所标识的应用进行交互操作,在交互操作过程中采集待测试固件在压力测试事件执行过程中的状态信息,以生成压力测试数据。需要说明的是,各个应用的应用标识为提前设定好的,并且不同的应用的应用标识可为不同,以用来区分,此处不作任何限定。In this disclosed embodiment, the debugging tool can obtain the application identifier of each application from the stress test event. After entering the application identified by the application identifier, it can interact with the identified application according to the interaction sequence, and collect data to be processed during the interactive operation. Test the status information of the firmware during the execution of the stress test event to generate stress test data. It should be noted that the application identifiers of each application are set in advance, and the application identifiers of different applications can be different for differentiation, and there is no limitation here.
可选地,压力测试事件还包括:每个应用的测试进入频次、测试进入间隔和测试进入时序中的至少一个测试配置信息。可选地,还可以通过配置确定进入各个应用的频率,例如,可以按照一个小时内进入10次。或者,配置各个应用的时间间隔,例如包括5个应用,每个应用可以间隔10分钟进入,也可以5个应用之间的间隔时间不同,可以根据实际需求进行配置。可选地,还可以随机的确定各个应用的进入次序及次数;可选地,还可以随机确定进入应用后随机的按键操作,还可以配置按键的个数等。本公开实施例中可以通过按 键事件实现对固件的压力测试和/或异常检查。Optionally, the stress test event also includes: at least one test configuration information of each application's test entry frequency, test entry interval, and test entry timing. Optionally, you can also determine the frequency of entering each application through configuration. For example, you can enter 10 times in an hour. Or, configure the time interval for each application, for example, including 5 applications, each application can be entered at a 10-minute interval, or the interval between the 5 applications can be different, which can be configured according to actual needs. Optionally, the entry order and number of times for each application can also be randomly determined; optionally, random key operations after entering the application can also be randomly determined, and the number of keys can also be configured. In the embodiment of the present disclosure, stress testing and/or abnormality checking of firmware can be implemented through key events.
需要说明的是,压力测试事件是固件在运行调试工具的可执行文件中的设置选项,该选项可包含多种,具体可见上述实施例中描述的内容,此处不再赘述。It should be noted that the stress test event is a setting option of the firmware in the executable file running the debugging tool. This option may include a variety of options. For details, see the content described in the above embodiments, which will not be described again here.
步骤S42、步骤S43和步骤S44可以按照设定的顺序执行,也可以并行执行,本公开中实施例中对步骤S42、步骤S43和步骤S44的执行顺序不做限定。Steps S42, S43 and S44 may be executed in a set order or in parallel. In the embodiments of the present disclosure, the execution order of steps S42, S43 and S44 is not limited.
在本公开实施例中,首先通过脚本启动调试工具,不仅可以对内存和块设备进行状态跟踪,确定内存和块设备是否存在异常,并且可以对日志信息进行统计获取异常监控数据,而且还可以启动系统压力测试。本公开实施例中的调试工具具有多种调试能力,使得待调试固件的调试更加灵活和准确,而且自动化调试提升调试的效率。进一步地,将调试工具部署在可读写存储分区上,该调试工具配置各自调试能力,并打桩监控内存、块设备和各种系统异常,并可自动启动系统压力测试,并提供性能稳定性评估结果,和各种异常的调试数据,使得系统具备高效的稳定性监控和调试能力,加速产品研发速度快速达到成熟度预期。In the embodiment of the present disclosure, the debugging tool is first started through a script. It can not only track the status of the memory and block devices, determine whether there are abnormalities in the memory and block devices, collect statistics on the log information and obtain abnormal monitoring data, but also start System stress testing. The debugging tool in the embodiment of the present disclosure has multiple debugging capabilities, making the debugging of the firmware to be debugged more flexible and accurate, and automated debugging improves debugging efficiency. Furthermore, the debugging tool is deployed on a read-write storage partition. The debugging tool configures its own debugging capabilities, and piles and monitors memory, block devices and various system abnormalities. It can also automatically start system stress testing and provide performance stability assessment. As a result, and various abnormal debugging data, the system has efficient stability monitoring and debugging capabilities, accelerating product development and quickly reaching maturity expectations.
与上述几种实施例提供的固件的调试方法相对应,本公开的一个实施例还提供了一种固件的调试装置,由于本公开实施例提供的固件的调试装置与上述几种实施例提供的固件的调试方法相对应,因此上述固件的调试方法的实施方式也适用于本公开实施例提供的固件的调试装置,在下述实施例中不再详细描述。Corresponding to the firmware debugging methods provided by the above embodiments, one embodiment of the present disclosure also provides a firmware debugging device. Since the firmware debugging device provided by the embodiments of the present disclosure is different from the firmware debugging method provided by the above embodiments, The firmware debugging method corresponds to the firmware debugging method. Therefore, the above implementation of the firmware debugging method is also applicable to the firmware debugging device provided by the embodiments of the present disclosure, and will not be described in detail in the following embodiments.
请参见图5,为本公开实施例提供的一种固件的调试装置500的结构示意图。图5所示的通信装置500可包括第一获取模块51、第二获取模块52、第一部署模块53、第二部署模块54和运行模块55。Please refer to FIG. 5 , which is a schematic structural diagram of a firmware debugging device 500 provided by an embodiment of the present disclosure. The communication device 500 shown in FIG. 5 may include a first acquisition module 51 , a second acquisition module 52 , a first deployment module 53 , a second deployment module 54 and an operation module 55 .
其中,第一获取模块51,用于获取待调试固件的安装数据和待调试固件的调试工具。Among them, the first acquisition module 51 is used to acquire the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged.
第二获取模块52,用于获取调试设备内存中相互独立的只读存储分区和可读写存储分区.The second acquisition module 52 is used to acquire mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device.
第一部署模块53,用于基于安装数据在只读存储分区中部署待调试固件。The first deployment module 53 is used to deploy the firmware to be debugged in the read-only storage partition based on the installation data.
第二部署模块54,用于将待调试固件的调试工具部署在可读写存储分区中。The second deployment module 54 is used to deploy the debugging tool of the firmware to be debugged in a readable and writable storage partition.
运行模块55,用于运行调试工具,对只读存储分区内的待调试固件进行调试。The running module 55 is used to run the debugging tool to debug the firmware to be debugged in the read-only storage partition.
在本公开的一个实施例中,运行模块55,还用于:通过脚本启动调试工具;通过调试工具对只读存储分区的访问权限进行管理,以获取待调试固件运行过程中监控数据;根据监控数据对待调试固件进行调试。In one embodiment of the present disclosure, the running module 55 is also used to: start the debugging tool through a script; manage the access permissions of the read-only storage partition through the debugging tool to obtain monitoring data during the operation of the firmware to be debugged; according to the monitoring The data is used to debug the firmware to be debugged.
在本公开的一个实施例中,运行模块55,还用于:确定待调试固件调试结束后,对只读存储分区的访问权限进行恢复。In one embodiment of the present disclosure, the running module 55 is also used to: restore the access rights to the read-only storage partition after determining that the debugging of the firmware to be debugged is completed.
在本公开的一个实施例中,运行模块55,还用于:确定待调试固件的调试结束后,释放调试工具占用的可读写存储分区。In one embodiment of the present disclosure, the running module 55 is also configured to release the readable and writable storage partition occupied by the debugging tool after determining that debugging of the firmware to be debugged is completed.
在本公开的一个实施例中,第一部署模块53,还用于:获取调试工具的调试源文件,并对调试源文件链接生成调试工具的可执行文件;在可读写存储分区中部署可执行文件。In one embodiment of the present disclosure, the first deployment module 53 is also used to: obtain the debugging source file of the debugging tool, and link the debugging source file to generate the executable file of the debugging tool; deploy the executable file in the read-write storage partition. executable file.
在本公开的一个实施例中,第一部署模块53,还用于:通过调试设备的内存和块设备的打桩位置,获取内存和块设备的跟踪数据;统计待调试固件的日志信息,以对待调试固件进行异常监控,获取待调试固件的异常监控数据;模拟待调试固件的压力测试事件,基于压力测试事件对待调试固件进行压力测试,获取待调试固件的压力测试数据。In one embodiment of the present disclosure, the first deployment module 53 is also used to: obtain the tracking data of the memory and block devices by debugging the memory of the device and the piling position of the block device; and collect statistics on the log information of the firmware to be debugged to treat Debug the firmware for abnormal monitoring and obtain the abnormal monitoring data of the firmware to be debugged; simulate the stress test events of the firmware to be debugged, perform a stress test on the firmware to be debugged based on the stress test events, and obtain the stress test data of the firmware to be debugged.
在本公开的一个实施例中,第一部署模块53,还用于:启动压力测试脚本,通过压力测试脚本启动压力测试事件,其中,压力测试事件中包括每个应用对应的交互时序;从压力测试事件中获取各个应用的应用标识;在进入应用标识所标识的应用后,按照交互时序对所标识的应用进行交互操作;采集待测试固件在压力测试事件执行过程中的状态信息,以生成压力测试数据。In one embodiment of the present disclosure, the first deployment module 53 is also used to: start a stress test script, and start a stress test event through the stress test script, where the stress test event includes the interaction sequence corresponding to each application; Obtain the application identification of each application in the test event; after entering the application identified by the application identification, interact with the identified application according to the interaction sequence; collect the status information of the firmware to be tested during the execution of the stress test event to generate stress Test Data.
在本公开的一个实施例中,第二获取模块52,还用于:获取调试设备内存中存储分区的类型标识;根据类型标识,区分只读存储分区和可读写存储分区。In one embodiment of the present disclosure, the second acquisition module 52 is also used to: acquire the type identifier of the storage partition in the memory of the debugging device; and distinguish the read-only storage partition from the read-write storage partition according to the type identifier.
在本公开实施例中,首先获取待调试固件的安装数据和待调试固件的调试工具,然后获取调试设备内存中相互独立的只读存储分区和可读写存储分区,而后基于安装数据在只读存储分区中部署待调试固件,将待调试固件的调试工具部署在可读写存储分区中,最后运行调试工具,对只读存储分区内的待调试固件进行调试。本公开实施例中通过将调试工具部署在可读写存储分区中,从而通过可读写存储分区中的调试工具,对只读存储分区内的待调试固件进行调试,在调试过程中由于只读存储分区与系统独立,调试过程不会影响系统运行,提高系统运行的安全性。In the embodiment of the present disclosure, the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged are first obtained, and then the independent read-only storage partition and read-write storage partition in the memory of the debugging device are obtained, and then based on the installation data, the read-only storage partition is obtained. Deploy the firmware to be debugged in the storage partition, deploy the debugging tool of the firmware to be debugged in the read-write storage partition, and finally run the debugging tool to debug the firmware to be debugged in the read-only storage partition. In the embodiment of the present disclosure, the debugging tool is deployed in the read-write storage partition, so that the firmware to be debugged in the read-only storage partition is debugged through the debugging tool in the read-write storage partition. During the debugging process, due to the read-only The storage partition is independent from the system, and the debugging process will not affect the system operation, improving the security of the system operation.
进一步地,能够在开发阶段进行系统稳定性的调试,提供性能稳定性评估结果和各种异常的调试数据,使得系统具备高效的稳定性监控和调试能力,加速产品研发速度快速达到成熟度预期。Furthermore, system stability debugging can be carried out during the development phase, and performance stability evaluation results and various abnormal debugging data can be provided, so that the system has efficient stability monitoring and debugging capabilities, accelerating product development and quickly reaching maturity expectations.
本领域技术人员还可以了解到本公开实施例列出的各种说明性逻辑块(illustrative logical block)和步骤(step)可以通过电子硬件、电脑软件,或两者的结合进行实现。这样的功能是通过硬件还是软件来实现取决于特定的应用和整个系统的设计要求。本领域技术人员可以对于每种特定的应用,可以使用各种方法实现所述的功能,但这种实现不应被理解为超出本公开实施例保护的范围。Those skilled in the art can also understand that the various illustrative logical blocks and steps listed in the embodiments of the present disclosure can be implemented by electronic hardware, computer software, or a combination of both. Whether such functionality is implemented in hardware or software depends on the specific application and overall system design requirements. Those skilled in the art can use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present disclosure.
为了实现上述实施例,本公开实施例还提出一种电子设备600,如图6所示,该电子设备600包括:处理器61和处理器通信连接的存储器62,存储器62存储有可被至少一个处理器执行的指令,指令被至少一个处理器61执行,以实现如本公开第一方面实施例的固件的调试方法。In order to implement the above embodiments, the embodiment of the present disclosure also proposes an electronic device 600. As shown in Figure 6, the electronic device 600 includes: a processor 61 and a memory 62 communicatively connected to the processor. The memory 62 stores information that can be used by at least one The instructions executed by the processor are executed by at least one processor 61 to implement the firmware debugging method according to the embodiment of the first aspect of the present disclosure.
本公开还提供一种可读存储介质,其上存储有指令,该指令被计算机执行时实现上述任一方法实施例的功能。The present disclosure also provides a readable storage medium on which instructions are stored, and when the instructions are executed by a computer, the functions of any of the above method embodiments are implemented.
本公开还提供一种计算机程序产品,该计算机程序产品被计算机执行时实现上述任一方法实施例的功能。The present disclosure also provides a computer program product, which, when executed by a computer, implements the functions of any of the above method embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。 当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机程序。在计算机上加载和执行所述计算机程序时,全部或部分地产生按照本公开实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机程序可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机程序可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,高密度数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs. When the computer program is loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present disclosure are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program may be stored in or transferred from one computer-readable storage medium to another, for example, the computer program may be transferred from a website, computer, server, or data center Transmission to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains one or more available media integrated. The usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVD)), or semiconductor media (e.g., solid state disks, SSD)) etc.
本领域普通技术人员可以理解:本公开中涉及的第一、第二等各种数字编号仅为描述方便进行的区分,并不用来限制本公开实施例的范围,也表示先后顺序。Those of ordinary skill in the art can understand that the first, second, and other numerical numbers involved in this disclosure are only for convenience of description and are not used to limit the scope of the embodiments of the disclosure, nor to indicate the order.
本公开中的至少一个还可以描述为一个或多个,多个可以是两个、三个、四个或者更多个,本公开不做限制。在本公开实施例中,对于一种技术特征,通过“第一”、“第二”、“第三”、“A”、“B”、“C”和“D”等区分该种技术特征中的技术特征,该“第一”、“第二”、“第三”、“A”、“B”、“C”和“D”描述的技术特征间无先后顺序或者大小顺序。At least one in the present disclosure can also be described as one or more, and the plurality can be two, three, four or more, and the present disclosure is not limited. In the embodiment of the present disclosure, for a technical feature, the technical feature is distinguished by “first”, “second”, “third”, “A”, “B”, “C” and “D” etc. The technical features described in "first", "second", "third", "A", "B", "C" and "D" are in no particular order or order.
本公开中各表所示的对应关系可以被配置,也可以是预定义的。各表中的信息的取值仅仅是举例,可以配置为其他值,本公开并不限定。在配置信息与各参数的对应关系时,并不一定要求必须配置各表中示意出的所有对应关系。例如,本公开中的表格中,某些行示出的对应关系也可以不配置。又例如,可以基于上述表格做适当的变形调整,例如,拆分,合并等等。上述各表中标题示出参数的名称也可以采用通信装置可理解的其他名称,其参数的取值或表示方式也可以通信装置可理解的其他取值或表示方式。上述各表在实现时,也可以采用其他的数据结构,例如可以采用数组、队列、容器、栈、线性表、指针、链表、树、图、结构体、类、堆、散列表或哈希表等。The corresponding relationships shown in each table in this disclosure can be configured or predefined. The values of the information in each table are only examples and can be configured as other values, which is not limited by this disclosure. When configuring the correspondence between information and each parameter, it is not necessarily required to configure all the correspondences shown in each table. For example, in the table in this disclosure, the corresponding relationships shown in some rows may not be configured. For another example, appropriate deformation adjustments can be made based on the above table, such as splitting, merging, etc. The names of the parameters shown in the titles of the above tables may also be other names understandable by the communication device, and the values or expressions of the parameters may also be other values or expressions understandable by the communication device. When implementing the above tables, other data structures can also be used, such as arrays, queues, containers, stacks, linear lists, pointers, linked lists, trees, graphs, structures, classes, heaps, hash tables or hash tables. wait.
本公开中的预定义可以理解为定义、预先定义、存储、预存储、预协商、预配置、固化、或预烧制。Predefinition in this disclosure may be understood as definition, pre-definition, storage, pre-storage, pre-negotiation, pre-configuration, solidification, or pre-burning.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered to be beyond the scope of this disclosure.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装 置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
以上所述,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure. should be covered by the protection scope of this disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims (13)

  1. 一种固件的调试方法,其特征在于,包括:A firmware debugging method is characterized by including:
    获取待调试固件的安装数据和所述待调试固件的调试工具;Obtain the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged;
    获取调试设备内存中相互独立的只读存储分区和可读写存储分区;Obtain mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device;
    基于所述安装数据在所述只读存储分区中部署所述待调试固件;Deploy the firmware to be debugged in the read-only storage partition based on the installation data;
    将所述待调试固件的调试工具部署在所述可读写存储分区中;Deploy the debugging tool of the firmware to be debugged in the read-write storage partition;
    运行所述调试工具,对所述只读存储分区内的所述待调试固件进行调试。Run the debugging tool to debug the firmware to be debugged in the read-only storage partition.
  2. 根据权利要求1所述的方法,其特征在于,所述运行所述调试工具,对所述只读存储分区内的所述待调试固件进行调试,包括:The method according to claim 1, characterized in that said running the debugging tool to debug the firmware to be debugged in the read-only storage partition includes:
    通过脚本启动所述调试工具;Launch the debugging tool through a script;
    通过所述调试工具对所述只读存储分区的访问权限进行管理,以获取所述待调试固件运行过程中监控数据;Manage the access rights of the read-only storage partition through the debugging tool to obtain monitoring data during the operation of the firmware to be debugged;
    根据所述监控数据对所述待调试固件进行调试。The firmware to be debugged is debugged according to the monitoring data.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, further comprising:
    确定所述待调试固件调试结束后,对所述只读存储分区的访问权限进行恢复。After it is determined that the debugging of the firmware to be debugged is completed, the access permission of the read-only storage partition is restored.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:
    确定所述待调试固件的调试结束后,释放所述调试工具占用的所述可读写存储分区。After it is determined that the debugging of the firmware to be debugged is completed, the readable and writable storage partition occupied by the debugging tool is released.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述待调试固件的调试工具的部署过程,包括:The method according to any one of claims 1 to 4, characterized in that the deployment process of the debugging tool of the firmware to be debugged includes:
    获取所述调试工具的调试源文件,并对所述调试源文件链接生成所述调试工具的可执行文件;Obtain the debugging source file of the debugging tool, and link the debugging source file to generate an executable file of the debugging tool;
    在所述可读写存储分区中部署所述可执行文件。Deploy the executable file in the read-write storage partition.
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述待调试固件运行过程中监 控数据,包括:The method according to claim 5, characterized in that said obtaining monitoring data during the operation of the firmware to be debugged includes:
    通过所述调试设备的内存和块设备的打桩位置,获取所述内存和块设备的跟踪数据;Obtain the tracking data of the memory and block device through the piling position of the memory of the debugging device and the block device;
    统计所述待调试固件的日志信息,以对所述待调试固件进行异常监控,获取所述待调试固件的异常监控数据;Statistics of the log information of the firmware to be debugged are performed to monitor the abnormality of the firmware to be debugged and obtain abnormal monitoring data of the firmware to be debugged;
    模拟所述待调试固件的压力测试事件,基于所述压力测试事件对所述待调试固件进行压力测试,获取所述待调试固件的压力测试数据。Simulate a stress test event of the firmware to be debugged, perform a stress test on the firmware to be debugged based on the stress test event, and obtain stress test data of the firmware to be debugged.
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述压力测试事件对所述待调试固件进行压力测试,获取所述待调试固件的压力测试数据,包括:The method according to claim 6, wherein the step of performing a stress test on the firmware to be debugged based on the stress test event and obtaining the stress test data of the firmware to be debugged includes:
    启动压力测试脚本,通过所述压力测试脚本启动压力测试事件,其中,所述压力测试事件中包括每个应用对应的交互时序;Start the stress test script, and start the stress test event through the stress test script, where the stress test event includes the interaction sequence corresponding to each application;
    从所述压力测试事件中获取各个应用的应用标识;Obtain the application identification of each application from the stress test event;
    在进入所述应用标识所标识的应用后,按照所述交互时序对所述所标识的应用进行交互操作;After entering the application identified by the application identifier, perform interactive operations on the identified application according to the interaction sequence;
    采集所述待测试固件在所述压力测试事件执行过程中的状态信息,以生成所述压力测试数据。Collect status information of the firmware to be tested during execution of the stress test event to generate the stress test data.
  8. 根据权利要求6所述的方法,其特征在于,所述压力测试事件还包括:每个应用的测试进入频次、测试进入间隔和测试进入时序中的至少一个测试配置信息。The method according to claim 6, wherein the stress test event further includes: at least one test configuration information among test entry frequency, test entry interval and test entry timing of each application.
  9. 根据权利要求1-4中任一项所述的方法,其特征在于,所述获取调试设备内存中相互独立的只读存储分区和可读写存储分区,包括:The method according to any one of claims 1 to 4, characterized in that obtaining mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device includes:
    获取所述调试设备内存中存储分区的类型标识;Obtain the type identifier of the storage partition in the memory of the debugging device;
    根据所述类型标识,区分所述只读存储分区和所述可读写存储分区。According to the type identifier, the read-only storage partition and the read-write storage partition are distinguished.
  10. 一种固件的调试装置,其特征在于,包括:A firmware debugging device, characterized by including:
    第一获取模块,用于获取待调试固件的安装数据和所述待调试固件的调试工具;The first acquisition module is used to acquire the installation data of the firmware to be debugged and the debugging tool of the firmware to be debugged;
    第二获取模块,用于获取调试设备内存中相互独立的只读存储分区和可读写存储分区;The second acquisition module is used to acquire mutually independent read-only storage partitions and read-write storage partitions in the memory of the debugging device;
    第一部署模块,用于基于所述安装数据在所述只读存储分区中部署所述待调试固件;A first deployment module configured to deploy the firmware to be debugged in the read-only storage partition based on the installation data;
    第二部署模块,用于将所述待调试固件的调试工具部署在所述可读写存储分区中;a second deployment module, configured to deploy the debugging tool of the firmware to be debugged in the readable and writable storage partition;
    运行模块,用于运行所述调试工具,对所述只读存储分区内的所述待调试固件进行调试。An operation module is used to run the debugging tool and debug the firmware to be debugged in the read-only storage partition.
  11. 一种电子设备,其特征在于,包括存储器、处理器;An electronic device, characterized by including a memory and a processor;
    其中,所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,使如权利要求1至9中任一项所述的方法被实现。Wherein, the processor reads the executable program code stored in the memory and runs a program corresponding to the executable program code, so that the method according to any one of claims 1 to 9 is implemented.
  12. 一种计算机可读存储介质,用于存储有指令,当指令被执行时,使如权利要求1至9中任一项所述的方法被实现。A computer-readable storage medium is used to store instructions, and when the instructions are executed, the method according to any one of claims 1 to 9 is implemented.
  13. 一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据权利要求1至9中任一项所述的方法。A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 9.
PCT/CN2022/099240 2022-06-16 2022-06-16 Firmware debugging method and apparatus WO2023240558A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2022/099240 WO2023240558A1 (en) 2022-06-16 2022-06-16 Firmware debugging method and apparatus
CN202280004135.8A CN117597668A (en) 2022-06-16 2022-06-16 Firmware debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/099240 WO2023240558A1 (en) 2022-06-16 2022-06-16 Firmware debugging method and apparatus

Publications (1)

Publication Number Publication Date
WO2023240558A1 true WO2023240558A1 (en) 2023-12-21

Family

ID=89192810

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099240 WO2023240558A1 (en) 2022-06-16 2022-06-16 Firmware debugging method and apparatus

Country Status (2)

Country Link
CN (1) CN117597668A (en)
WO (1) WO2023240558A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10133654B1 (en) * 2017-02-28 2018-11-20 American Megatrends, Inc. Firmware debug trace capture
CN109189485A (en) * 2018-08-08 2019-01-11 烽火通信科技股份有限公司 A kind of system starting management of embedded device, operating system configuration method
WO2020145973A1 (en) * 2019-01-10 2020-07-16 Hewlett-Packard Development Company, L.P. Event logs with firmware debug information
CN113645052A (en) * 2020-04-27 2021-11-12 中移物联网有限公司 Firmware debugging method and related equipment
CN114036047A (en) * 2021-11-08 2022-02-11 南京百敖软件有限公司 Method for realizing firmware instant debugger based on serial port
CN114035855A (en) * 2021-09-30 2022-02-11 鸣芯信息科技(上海)有限公司 Firmware debugging method, device, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10133654B1 (en) * 2017-02-28 2018-11-20 American Megatrends, Inc. Firmware debug trace capture
CN109189485A (en) * 2018-08-08 2019-01-11 烽火通信科技股份有限公司 A kind of system starting management of embedded device, operating system configuration method
WO2020145973A1 (en) * 2019-01-10 2020-07-16 Hewlett-Packard Development Company, L.P. Event logs with firmware debug information
CN113645052A (en) * 2020-04-27 2021-11-12 中移物联网有限公司 Firmware debugging method and related equipment
CN114035855A (en) * 2021-09-30 2022-02-11 鸣芯信息科技(上海)有限公司 Firmware debugging method, device, terminal and storage medium
CN114036047A (en) * 2021-11-08 2022-02-11 南京百敖软件有限公司 Method for realizing firmware instant debugger based on serial port

Also Published As

Publication number Publication date
CN117597668A (en) 2024-02-23

Similar Documents

Publication Publication Date Title
Chen et al. An exploratory study of performance regression introducing code changes
US7392148B2 (en) Heterogeneous multipath path network test system
US9146831B2 (en) Sampling based runtime optimizer for efficient debugging of applications
US20070168736A1 (en) Breakpoint groups
KR20140053542A (en) Automatic testing apparatus for embedded software, automatic testing method thereof and test scenario composing method
US10579513B2 (en) Test run control method and apparatus
US7546585B2 (en) Method, system and computer program product for testing computer programs
CN111462811A (en) Automatic testing method and device, storage medium and electronic equipment
US9195562B2 (en) Recording external processes
CA2811617C (en) Commit sensitive tests
GB2460407A (en) Using coverage data to choose software regression tests
US10846206B2 (en) Adaptive software testing
US11163924B2 (en) Identification of changes in functional behavior and runtime behavior of a system during maintenance cycles
US8850407B2 (en) Test script generation
US20200104244A1 (en) Scriptless software test automation
US8997048B1 (en) Method and apparatus for profiling a virtual machine
US20050049814A1 (en) Binding a GUI element to a control in a test executive application
WO2023240558A1 (en) Firmware debugging method and apparatus
US20200272553A1 (en) Configurable system for interaction with system or processor states in development tools
US10922249B2 (en) Input/output control code filter
CN108563564B (en) Terminal man-machine interface testing method and system
CN113031964A (en) Management method, device, equipment and storage medium for big data application
JP5592828B2 (en) Patch impact analysis apparatus, method and program
CN115017059B (en) Fuzzy test method and system for graphical user interface program
WO2023238262A1 (en) Information processing device, testing method, and testing program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22946247

Country of ref document: EP

Kind code of ref document: A1