Adaptive method of software version type adb function, electronic equipment and medium

The self-adaptive adb function method aligns the adb state with the software version type, addressing inconsistent test results by determining the debugging mode based on the adb flag, thereby improving software testing reliability.

CN119088434APending Publication Date: 2024-12-06SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411112510.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The existing Android software version testing process lacks automation for enabling or disabling the adb function, leading to inconsistent test results and uncertainty due to modifications in the source code, which deviates from the officially released user version.

Method used

A method for self-adapting the adb function based on the software version type, involving reading the adb flag, determining the debugging mode, and assigning a corresponding value to the adb flag bit in the target data partition, ensuring consistency between test and release versions.

Benefits of technology

Ensures consistent test results by aligning the adb function state with the target software version type, enhancing the reliability and quality of software testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088434A_ABST
    Figure CN119088434A_ABST
Patent Text Reader

Abstract

The invention provides a software version type adb function self-adaption method, electronic equipment and a medium, and the software version type adb function self-adaption method comprises the following steps: reading an adb flag bit in a target data partition; the assignment of the adb flag bit is determined according to the target software version type of the software; and determining a debugging mode of the target software version type according to the adb flag bit. According to the method, the debugging mode suitable for the target version type of the software is determined through the assignment of the adb flag bit determined according to the target software version type of the software, so that the consistency of the test version type and the release version type of the software can be ensured as far as possible, and the quality of a software product is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to an adaptive method for a software version type adb function, an electronic device and a medium. Background Art

[0002] When developing and testing software, Android usually has the following three types of software versions: 1. debug version (a type of software version under debugging, which contains complete debugging information and is less optimized to make it easier for developers to find and solve errors in the program), used for normal debugging, with root permissions (the highest user permissions); 2. userdebug version (a type of software version with limited debugging capabilities), used for debugging close to mass production versions, with root permissions; 3. user version, used for mass production versions, cannot be debugged, and has no root permissions.

[0003] Currently in the development and testing phase of the Android platform, for automated testing of software versions, the adb (Android Debug Bridge) function of the software version cannot be automatically turned on or off. The existing technology directly modifies the source code to compile a temporary version to complete the automated testing, which is different from the officially released user version. From the perspective of test results, this results in irrationality and uncertainty. Summary of the invention

[0004] The technical problem to be solved by the present disclosure is to overcome the defects in the prior art that the software version during the test process is inconsistent with the officially released user version and the test results are unreliable, and to provide an adaptive method, electronic device and medium for the adb function of the software version type.

[0005] The present invention solves the above technical problems through the following technical solutions:

[0006] The present disclosure provides a method for self-adapting a software version type adb function, which is applied to a terminal device. The method for self-adapting a software version type adb function includes:

[0007] Reading the adb flag in the target data partition; the value of the adb flag is determined according to the target software version type of the software;

[0008] The debugging mode of the target software version type is determined according to the adb flag bit.

[0009] Preferably, the step of reading the adb flag bit in the target data partition includes:

[0010] Download software;

[0011] determining a target software version type of the software;

[0012] Determine the debugging mode according to the target software version type;

[0013] According to the debugging mode, the adb flag bit is assigned a corresponding value in the target data partition.

[0014] Preferably, the step of determining the debugging mode of the target software version type according to the adb flag bit includes:

[0015] Generate corresponding pubilc attribute according to the adb flag bit;

[0016] The debugging mode of the target software version type is determined according to the pubilc attribute.

[0017] Preferably, the step of generating a corresponding pubilc attribute according to the adb flag bit includes:

[0018] Sending the adb flag to the kernel of the terminal device in the form of a command line;

[0019] Parsing the command line by an initialization process;

[0020] The pubilc attribute of the target software version type is determined according to the parsing result.

[0021] Preferably, the target software version type includes a software test version type or a software release version type.

[0022] Preferably, the debugging mode is used to represent the on state or off state of the adb function.

[0023] The present disclosure also provides a method for self-adapting adb functions of software version types, which is applied to a terminal device. The method for self-adapting adb functions of software version types includes:

[0024] Download software;

[0025] determining a target software version type of the software;

[0026] Determine the debugging mode according to the target software version type;

[0027] According to the debugging mode, the adb flag bit is assigned a corresponding value in the target data partition.

[0028] Preferably, the self-adaptation method of the software version type adb function further includes:

[0029] The assignment of the adb flag bit in the target data partition is updated according to the update instruction.

[0030] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor implements the above-mentioned software version type adb function adaptive method when executing the computer program.

[0031] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the self-adaptation method of the adb function of the software version described above is implemented.

[0032] The present disclosure also provides a chip, which is applied to an electronic device, and the chip is used to execute the adaptive method of the software version type adb function as described above.

[0033] The present disclosure also provides a chip module, which is applied to electronic equipment, including a transceiver component and a chip, wherein the chip is used to execute the adaptive method of the software version type adb function as described above.

[0034] The present disclosure also provides a computer program product, including a computer program, which implements the above-mentioned software version type adb function adaptive method when executed by a processor.

[0035] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.

[0036] The positive and progressive effects of this disclosure are:

[0037] The present invention determines the debugging mode suitable for the target version type of the software by assigning the value of the adb flag bit according to the target software version type of the software, thereby ensuring the consistency of the test version type and the release version type of the software as much as possible and ensuring the quality of the software product. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A flowchart of a method for self-adapting adb functions of a software version type provided in Embodiment 1 of the present disclosure;

[0039] Figure 2 An overall framework design diagram of an example of a method for self-adapting adb functions of a software version type provided in Embodiment 1 of the present disclosure;

[0040] Figure 3 A flowchart of an example of a method for self-adapting adb functions of a software version type provided in Embodiment 1 of the present disclosure;

[0041] Figure 4 A structural diagram of an adaptive system of a software version type adb function provided in Embodiment 2 of the present disclosure;

[0042] Figure 5 A flowchart of a method for self-adapting adb functions of a software version type provided in Embodiment 3 of the present disclosure;

[0043] Figure 6 A structural diagram of an adaptive system of a software version type adb function provided in Embodiment 4 of the present disclosure;

[0044] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Example 5 of the present disclosure. DETAILED DESCRIPTION

[0045] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.

[0046] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0047] It should be noted that the execution subject of the adaptive method of the software version type adb function provided in the embodiment of the present disclosure may be a separate chip, a chip module or a UE, or a chip or a chip module integrated in the UE.

[0048] The adaptive system of the software version type adb function described in the embodiments of the present disclosure may specifically be a separate chip, a chip module or a UE, or a chip or a chip module integrated in a UE. The various modules / units included in the adaptive system of the software version type adb function may be software modules / units, hardware modules / units, or partly software modules / units and partly hardware modules / units. For example, for various devices and products applied to or integrated in a chip, the various modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining modules / units may be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in a chip module, the various modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, a circuit module, etc.) or in different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining modules / units may be implemented in the form of hardware such as circuits; / unit can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in the UE, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the UE, and the remaining modules / units can be implemented in the form of hardware such as circuits.

[0049] Example 1

[0050] This embodiment provides an adaptive method for software version type adb function, which is applied to terminal devices. Figure 1 , the adaptive methods of the software version type adb function include:

[0051] S1. Read the adb flag bit in the target data partition.

[0052] The value of the adb (debug bridge) flag is determined according to the target software version type of the software. The target software version type includes the software test version type (for example, debug version and userdebug version) or the software release version type (for example, user version). The target software version type is determined according to the test instructions or release instructions of the test developer.

[0053] S2. Determine the debugging mode of the target software version type according to the adb flag.

[0054] The debug mode is used to represent the on or off state of the adb function. That is, the debug mode corresponding to the software test version type is adb function on, and the adb flag bit is assigned a value of 1; the debug mode corresponding to the software release version type is adb function off, and the adb flag bit is assigned a value of 0.

[0055] This embodiment determines the debugging mode suitable for the target version type of the software by assigning the value of the adb flag bit according to the target software version type of the software, thereby ensuring the consistency of the test version type and the release version type of the software as much as possible and ensuring the quality of the software product.

[0056] In an optional embodiment, before step S1, the following steps are included:

[0057] S01. Download the software.

[0058] S02. Determine the target software version type of the software.

[0059] S03. Determine the debugging mode according to the target software version type.

[0060] S04. Assign corresponding values ​​to the adb flag bit in the target data partition according to the debugging mode.

[0061] In this embodiment, the target software version type of the software is determined according to the test instructions or release instructions of the test developer, and the debugging mode is determined according to the target software version type, and the adb flag is assigned a corresponding value, so that the adb flag assignment corresponds to the target software version type, which is convenient for testers to determine the current target software version type of the software.

[0062] In an optional embodiment, step S2 includes:

[0063] S21. Generate corresponding pubilc attributes according to the adb flag.

[0064] Among them, public attributes are usually used to represent data or functions that can be publicly accessed and operated.

[0065] S22. Determine the debugging mode of the target software version type according to the pubilc attribute.

[0066] In this implementation, the adb flag is expressed in the form of a public attribute, so that the terminal device can determine the corresponding debugging mode by reading the public attribute, thereby improving the compatibility between the software and the terminal device.

[0067] In an optional implementation, step S21 includes:

[0068] S211. Send the adb flag to the kernel of the terminal device in the form of a command line.

[0069] S212. Parse the command line through the initialization process.

[0070] S213: Determine the pubilc attribute of the target software version type according to the parsing result.

[0071] In this implementation, the pubilc attribute corresponding to the target software version type is determined by means of a command line, an initialization process, etc., so as to realize the automation of the terminal device program operation and improve the adaptive efficiency of the adb function.

[0072] The following is a specific example to describe in detail the adaptive method of the software version type adb function of this embodiment.

[0073] Figure 2 This is the overall framework design diagram of this example. It can be seen that this example is applied in an Android terminal device and requires the support of programs such as the boot mode (uboot) and the Android initialization process (Andorid init). In the boot mode, in response to the download mode, the Android terminal device interacts with the download tool software and supports updating the adbFlag (adb flag) of miscdata (target data partition). When the production line is in normal production, no update is required. When performing automated software testing, the download tool software is also required to update adbFlag.

[0074] Android Init is mainly responsible for loading components related to the root function (users obtain the highest permissions of the system). If the adbFlag of miscdata is assigned to 1, in boot mode, Android init parses the cmdline passed to the terminal kernel and generates public properties. In addition, Android Init sets the working mode of the USB (interface) (i.e., debugging mode) according to this public property. Client is used to meet the different needs of different test developers.

[0075] Figure 3 This is the flowchart of this example. In general, this example runs mainly for the two working modes of the boot mode, download mode and startup mode. The download mode mainly supports updating the raw partition (i.e., the miscdata partition), and the startup mode mainly supports reading adbFlag and passing it to the kernel (kernel), and Android Init parses and generates a public attribute function switch, and determines the USB mode according to this function switch.

[0076] Here is the specific process:

[0077] S301, start the Android terminal device.

[0078] S302: Determine whether it is in download mode, if so, execute step S303, if not, execute step S304.

[0079] S303, update the value of adbFlag in the miscdata partition, and execute step S304.

[0080] S304, start the startup mode.

[0081] S305 , adding the read adbFlag value to the kernel cmdline.

[0082] S306. Utilize the init program to parse cmdline, generate pubilc attributes, and set the USB working mode according to adbFlag.

[0083] Example 2

[0084] This embodiment provides an adaptive system for software version type adb function, which is applied to terminal devices. Figure 4 , the software version type adb function's adaptive system includes:

[0085] The reading module 401 is used to read the adb flag in the target data partition.

[0086] The value of the adb flag is determined according to the target software version type of the software, which includes a software test version type or a software release version type.

[0087] The first determining module 402 is used to determine the debugging mode of the target software version type according to the adb flag bit.

[0088] The debug mode is used to indicate whether the adb function is turned on or off.

[0089] In an alternative embodiment, see Figure 4 , the adaptive system of software version type adb function also includes:

[0090] The first download module 403 is used to download software.

[0091] The first determination module 402 is further used to determine the target software version type of the software.

[0092] The first determining module 402 is further configured to determine a debugging mode according to the target software version type.

[0093] The first assignment module 404 is used to assign a corresponding value to the adb flag bit in the target data partition according to the debugging mode.

[0094] In an alternative embodiment, see Figure 4 , the adaptive system of software version type adb function also includes:

[0095] The generating module 405 is used to generate the corresponding pubilc attribute according to the adb flag.

[0096] The first determining module 402 is further configured to determine the debugging mode of the target software version type according to the pubilc attribute.

[0097] In an alternative embodiment, see Figure 4 , the adaptive system of software version type adb function also includes:

[0098] The sending module 406 is used to send the adb flag to the kernel of the terminal device in the form of a command line.

[0099] The parsing module 407 is used to parse the command line through the initialization process.

[0100] The first determining module 402 is further configured to determine the pubilc attribute of the target software version type according to the parsing result.

[0101] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, in which the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution.

[0102] Example 3

[0103] This embodiment provides an adaptive method for software version type adb function, which is applied to terminal devices. Figure 5 , the adaptive methods of the software version type adb function include:

[0104] S501. Download software.

[0105] S502: Determine the target software version type of the software.

[0106] S503: Determine a debugging mode according to the target software version type.

[0107] S504: assign corresponding values ​​to the adb flag bit in the target data partition according to the debugging mode.

[0108] In this embodiment, the target software version type of the software is determined according to the test instructions or release instructions of the test developer, and the debugging mode is determined according to the target software version type, and the adb flag is assigned a corresponding value, so that the adb flag assignment corresponds to the target software version type, which is convenient for testers to determine the current target software version type of the software.

[0109] In an optional implementation, the adaptive method of the software version type adb function further includes:

[0110] S505: Update the value of the adb flag in the target data partition according to the update instruction.

[0111] In this embodiment, the tester can issue an update instruction and update the value of the adb flag according to the test requirements or the release requirements, thereby achieving the effect of switching different software version types and realizing the unification of the test software version type and the release software version type.

[0112] Example 4

[0113] This embodiment provides an adaptive system for software version type adb function, which is applied to terminal devices. Figure 6 , the software version type adb function's adaptive system includes:

[0114] The second download module 601 is used to download software.

[0115] The second determination module 602 is used to determine the target software version type of the software.

[0116] The second determining module 602 is further configured to determine a debugging mode according to the target software version type.

[0117] The second assignment module 603 is used to assign a corresponding value to the adb flag bit in the target data partition according to the debugging mode.

[0118] In an alternative embodiment, see Figure 6 , the adaptive system of software version type adb function also includes:

[0119] The updating module 604 is used to update the value of the adb flag in the target data partition according to the updating instruction.

[0120] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, in which the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution.

[0121] Example 5

[0122] Figure 7 This is a structural schematic diagram of an electronic device shown in an example embodiment of the present disclosure, the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and the processor implements the adaptive method of the software version type adb function of any of the above embodiments when executing the computer program. Figure 7 The electronic device 70 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0123] like Figure 7 As shown, the electronic device 70 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 70 may include, but are not limited to: at least one processor 71, at least one memory 72, and a bus 73 connecting different system components (including the memory 72 and the processor 71).

[0124] The bus 73 includes a data bus, an address bus, and a control bus.

[0125] The memory 72 may include a volatile memory, such as a random access memory (RAM) 721 and / or a cache memory 722 , and may further include a read-only memory (ROM) 723 .

[0126] The memory 72 may also include a program tool 725 (or utility) having a set (at least one) of program modules 724, such program modules 724 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.

[0127] The processor 71 executes various functional applications and data processing by running the computer program stored in the memory 72, such as the adaptive method of the software version type adb function provided in any of the above embodiments.

[0128] The electronic device 70 may also communicate with one or more external devices 74 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 75. Furthermore, the electronic device 70 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 76. As shown, the network adapter 76 communicates with other modules of the electronic device 70 via a bus 73. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 70, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0129] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0130] Example 6

[0131] The embodiment of the present disclosure also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the adaptive method of the software version type adb function provided in any of the above embodiments is implemented.

[0132] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0133] Example 7

[0134] The embodiment of the present disclosure also provides a computer program product, including a computer program, which implements any of the above-mentioned software version type adb function adaptive methods when the computer program is executed by a processor.

[0135] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0136] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A method for adapting software version type adb function, characterized in that: Applied to the terminal device, the adaptive method of the software version type adb function includes: Reading the adb flag in the target data partition; the value of the adb flag is determined according to the target software version type of the software; The debugging mode of the target software version type is determined according to the adb flag bit.

2. The method for self-adapting software version type adb function according to claim 1, characterized in that: The step of reading the adb flag bit in the target data partition includes: Download software; determining a target software version type of the software; Determine the debugging mode according to the target software version type; According to the debugging mode, the adb flag bit is assigned a corresponding value in the target data partition.

3. The method for self-adapting software version type adb function according to claim 1, characterized in that: The step of determining the debugging mode of the target software version type according to the adb flag bit comprises: Generate corresponding pubilc attribute according to the adb flag bit; The debugging mode of the target software version type is determined according to the pubilc attribute.

4. The method for self-adapting software version type adb function according to claim 3, characterized in that: The step of generating the corresponding pubilc attribute according to the adb flag bit comprises: Sending the adb flag to the kernel of the terminal device in the form of a command line; Parsing the command line by an initialization process; The pubilc attribute of the target software version type is determined according to the parsing result.

5. The method for self-adapting software version type adb function according to claim 1, characterized in that: The target software version type includes a software test version type or a software release version type.

6. The method for self-adapting software version type adb function according to claim 1, characterized in that: The debugging mode is used to indicate whether the adb function is turned on or off.

7. An adaptive method for software version type adb function, characterized in that: Applied to the terminal device, the adaptive method of the software version type adb function includes: Download software; determining a target software version type of the software; Determine the debugging mode according to the target software version type; According to the debugging mode, the adb flag bit is assigned a corresponding value in the target data partition.

8. The method for self-adapting software version type adb function according to claim 7, characterized in that: The adaptive method of the software version type adb function also includes: The assignment of the adb flag bit in the target data partition is updated according to the update instruction.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the adaptive method of the software version type adb function according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for implementing the self-adaptation of the software version adb function according to any one of claims 1 to 8 is implemented.

11. A chip, applied to electronic equipment, characterized in that: The chip is used to execute the adaptive method of the software version type adb function according to any one of claims 1-8.

12. A chip module, applied to electronic equipment, characterized in that: The invention comprises a transceiver component and a chip, wherein the chip is used to execute the adaptive method of the software version type adb function according to any one of claims 1 to 8.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for adapting the software version type adb function according to any one of claims 1 to 8 is implemented.