A testing method and apparatus

CN115934557BActive Publication Date: 2026-09-01DINGDAO ZHILIAN (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211649308.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-09-01
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明实施例提供一种测试方法、装置、电子设备及计算机可读存储介质,用以解决现有测试过程为半自动化测试、仍需人工参与以及无法执行细粒度测试的问题

Benefits of technology

[0064]前述方案利用不同的差异软件包,生成多个镜像文件,并通过每个差异软件包的镜像文件对目标设备的软件系统进行升级、性能测试。最终可得到每个差异软件包对软件系统的影响。解决了现有测试过程为半自动化测试,仍需人工参与以及无法执行细粒度测试的问题。实现了自动化测试,节省人工成本,提高研发效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934557B_ABST
    Figure CN115934557B_ABST
Patent Text Reader

Abstract

This invention discloses a testing method, apparatus, electronic device, and computer-readable storage medium, relating to the field of computer applications. The method includes: acquiring at least one differential software package; if the differential software package is in an SBOM file, generating a first-type image file for each differential software package; upgrading the software system of a target device using the first-type image file, and performing performance testing on the upgraded software system to obtain test results; repeating the aforementioned steps until the test results of the upgraded software system for each first-type image file are obtained. This invention achieves automated testing, saves labor costs, and improves R&D efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer applications, and more particularly to a testing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Currently, after a system version is upgraded, the upgraded system version needs to be tested to clarify the changes in system performance indicators before and after the upgrade.

[0003] Typically, the complete process of system version upgrade and testing is as follows: 1) Create a system image file for the target machine. This can be done using continuous integration tools such as Jenkins to complete system compilation and image generation. 2) After the system image file is created, manually (or automatically) upgrade the target machine's system to the target version using methods such as USB flash drive or Over-the-Air Technology (OTA). 3) Perform performance testing on the target version. This can be done by running performance analysis tools such as PTS and UnixBench to analyze metrics such as CPU, memory, and graphics, and to indicate which metrics have increased and which have decreased compared to the previous (or previous) tests, thus obtaining a test report.

[0004] However, while the above testing process has a certain degree of automation, it still requires human intervention throughout the entire process. Furthermore, the performance testing process mentioned in step 3) only applies to the upgraded overall system version, meaning it is a coarse-grained test (as some components may have changed within the upgraded system version), and cannot perform fine-grained testing. For example, it cannot assess the impact of different versions of a software package or different patches for the same software package version on the system version, or their permutations and combinations. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a testing method, apparatus, electronic device, and computer-readable storage medium to solve the problems that existing testing processes are semi-automated, still require manual intervention, and cannot perform fine-grained testing.

[0006] In a first aspect, embodiments of the present invention provide a testing method, the method being applied to an electronic device, the method comprising:

[0007] Obtain at least one difference package, wherein the difference package is the package with the highest version that has version changes between adjacent versions;

[0008] If the difference package is in the SBOM file, then for each difference package, a first type image file is generated, and the first type image file contains one difference package;

[0009] The software system of the target device is upgraded using the first type of image file, and the performance of the upgraded software system is tested to obtain the test results.

[0010] Repeat the process of generating a first type image file for each differential software package and upgrading the software system of the target device using the first type image file, and perform performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained.

[0011] At least one test result is stored so that, after the user obtains multiple test results, the impact of each differential package on the software system performance can be analyzed and determined.

[0012] In conjunction with the first aspect, in a first possible implementation, obtaining at least one difference package specifically includes:

[0013] Obtain the software packages included in the first file of the first version and the software packages included in the first file of the second version;

[0014] From multiple first files, obtain different versions of the same software package;

[0015] The package containing the first version among the different versions of the same software is referred to as the differentiated package;

[0016] The second version is the version to be released, and the first version is the version preceding the second version; the first file includes an SBOM file and a DAP file.

[0017] In conjunction with the first aspect, in a second possible implementation, the method further includes:

[0018] If the difference package is in the SBOM file, then a second type of image file is generated for any combination of multiple difference packages;

[0019] The software system is upgraded using the second type of image file, and the upgraded software system is tested again to obtain the test results.

[0020] Repeatedly execute the combined difference package for any number of difference packages to generate a second type of image file, and use the second type of image file to upgrade the software system. Then, perform performance testing on the upgraded software system again to obtain test results, until the test results of the upgraded software system for each second type of image file are obtained.

[0021] In conjunction with the first aspect, in a third possible implementation, after obtaining at least one difference package, the method further includes:

[0022] Determine if each difference package exists in the SBOM file;

[0023] If so, generate a first-type image file for each difference package.

[0024] In conjunction with the third possible implementation, the fourth possible implementation is characterized in that the method further includes:

[0025] If not, the software system of the target device shall remain in the first version;

[0026] For each difference package, generate a third type of image file;

[0027] The software system is upgraded using the third type of image file, and the performance of the upgraded software system is tested to obtain the test results.

[0028] The upgraded software system will be reverted to the first version.

[0029] The process of generating a third-type image file for each differential software package, upgrading the software system to version two using the third-type image file, performing performance tests on the upgraded software system to obtain test results, and then reverting the upgraded software system back to version one, is repeated until the test results for the upgraded software system for each third-type image file are obtained.

[0030] In conjunction with the fourth possible implementation, the method further includes the following in the fifth possible implementation:

[0031] For any combination of multiple difference packages, generate a fourth type of image file;

[0032] Using the fourth type of image file, the software system is upgraded to the second version, and performance testing is performed on the upgraded software system to obtain the test results;

[0033] The upgraded software system will be reverted to the first version.

[0034] Repeatedly execute the combined difference package for any number of difference packages to generate a fourth type image file; use the fourth type image file to upgrade the software system to the second version; perform performance testing on the upgraded software system to obtain test results; and then revert the upgraded software system back to the first version until the test results of the upgraded software system for each fourth type image file are obtained.

[0035] In conjunction with the first aspect or the fourth possible implementation, in the sixth possible implementation, the method further includes:

[0036] At least one test result is stored so that, after the user obtains multiple test results, the impact of each differential package on the software system performance can be analyzed and determined.

[0037] Secondly, embodiments of the present invention provide a testing apparatus, which is applied to an electronic device, and the apparatus includes:

[0038] An acquisition unit is used to acquire at least one difference package, wherein the difference package is a package with version changes between adjacent versions and the highest version;

[0039] The generation unit is configured to generate a first type image file for each difference package if the difference package is in an SBOM file, wherein the first type image file contains one difference package.

[0040] The testing unit is used to upgrade the software system of the target device using the first type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0041] The generation unit and the testing unit repeatedly execute the process of generating a first type image file for each differential software package, upgrading the software system of the target device using the first type image file, and performing performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained.

[0042] In conjunction with the second aspect, in the first possible implementation, the acquisition unit is specifically used to acquire the software package included in the first file in the first version and the software package included in the first file in the second version;

[0043] From multiple first files, obtain different versions of the same software package;

[0044] The package containing the first version among the different versions of the same software is referred to as the differentiated package;

[0045] The second version is the version to be released, and the first version is the version preceding the second version; the first file includes an SBOM file and a DAP file.

[0046] In conjunction with the first aspect, in a second possible implementation, the generation unit is further configured to generate a second type of image file for a combination of multiple difference packages if the difference package is in an SBOM file;

[0047] The testing unit is also used to upgrade the software system using the second type of image file, and to perform performance testing on the upgraded software system again to obtain test results.

[0048] The generation unit and the testing unit repeatedly execute the combined difference package for any number of difference packages, generate a second type of image file, upgrade the software system using the second type of image file, and perform performance testing on the upgraded software system again to obtain test results, until the test results of the upgraded software system for each second type of image file are obtained.

[0049] In conjunction with the first aspect, in a third possible implementation, the apparatus further includes: a determination unit, configured to determine whether each difference package exists in the SBOM file;

[0050] The generation unit is also used to, if so, generate a first type of image file for each differential package.

[0051] In conjunction with the third possible implementation, in the fourth possible implementation, the apparatus further includes: a maintenance unit, used to maintain the software system of the target device in a first version if not;

[0052] The generation unit is also used to generate a third type of image file for each difference package;

[0053] The testing unit is also used to upgrade the software system using the third type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0054] The device further includes: a rollback unit, used to roll back the upgraded software system to the first version;

[0055] The generation unit, the testing unit, and the rollback unit repeatedly execute the following steps: generating a third-type image file for each differential software package; upgrading the software system to the second version using the third-type image file; performing performance testing on the upgraded software system to obtain test results; and then rolling back the upgraded software system to the first version, until the test results of the upgraded software system for each third-type image file are obtained.

[0056] In conjunction with the fourth possible implementation, in the fifth possible implementation, the generation unit is further configured to generate a fourth type of image file for a combination of multiple difference packages;

[0057] The testing unit is also used to upgrade the software system to the second version using the fourth type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0058] The rollback unit is also used to revert the upgraded software system back to the first version;

[0059] The generation unit, the testing unit, and the rollback unit repeatedly execute the combined difference package for any number of difference packages to generate a fourth type of image file. The software system is then upgraded to the second version using the fourth type of image file, and performance testing is performed on the upgraded software system to obtain the test results. Finally, the upgraded software system is rolled back to the first version. This process continues until the test results of the upgraded software system for each fourth type of image file are obtained.

[0060] In conjunction with the second or fourth possible implementation, in the sixth possible implementation, the apparatus further includes: a storage unit for storing at least one test result, so that after the user obtains multiple test results, the impact of each differential software package on the performance of the software system can be analyzed and determined.

[0061] Thirdly, embodiments of the present invention provide an electronic device, the electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed within the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the test method described in the first aspect above.

[0062] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the testing method described in the first aspect.

[0063] This invention provides a testing method, apparatus, electronic device, and computer-readable storage medium. The electronic device acquires at least one differential software package, which is a package with version changes between adjacent versions and the highest version. If the differential software package is in an SBOM file, the electronic device generates a first-type image file for each differential software package, the first-type image file containing one differential software package. The first-type image file is used to upgrade the software system of the target device, and performance testing is performed on the upgraded software system, yielding test results. The electronic device repeatedly executes the process of generating a first-type image file for each differential software package, upgrading the software system of the target device using the first-type image file, and performing performance testing on the upgraded software system, until test results for the upgraded software system of each first-type image file are obtained.

[0064] The aforementioned solution utilizes different differential software packages to generate multiple image files, and then uses each differential software package's image file to upgrade and perform performance testing on the target device's software system. Ultimately, the impact of each differential software package on the software system can be determined. This solves the problems of existing testing processes being semi-automated, still requiring manual intervention, and unable to perform fine-grained testing. It achieves automated testing, saves labor costs, and improves R&D efficiency. Attached Figure Description

[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0066] Figure 1 A flowchart of a testing method provided in an embodiment of the present invention;

[0067] Figure 2 A flowchart of another testing method provided in an embodiment of the present invention;

[0068] Figure 3 This is a schematic diagram of the testing device structure provided in an embodiment of the present invention;

[0069] Figure 4This is a schematic diagram of an electronic device structure provided in an embodiment of the present invention. Detailed Implementation

[0070] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0071] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0072] The following is in conjunction with the appendix Figure 1 The solution provided by the embodiments of the present invention will be described in detail. Figure 1 This is a flowchart illustrating a testing method provided in an embodiment of the present invention. In this embodiment, the implementing entity is an electronic device. This electronic device can be a server, desktop computer, PC, etc. Figure 1 As shown, the method in this embodiment specifically includes the following steps:

[0073] Step 110: Obtain at least one differential package, wherein the differential package is the package with version changes between adjacent versions and the highest version.

[0074] In this step, the electronic device obtains at least one differential package from the system files. This differential package is the package with version changes between adjacent versions and is the highest version.

[0075] The software package can also be referred to as the software installation file. Adjacent versions are specifically different versions that are close to each other. For example, V1.0 and V1.1, where V1.1 is a higher version than V1.0; V2.0 and V2.1, where V2.1 is a higher version than V2.0.

[0076] The acquisition of the difference package will be described in detail in subsequent embodiments, and will not be repeated here.

[0077] Step 120: If the difference package is in the SBOM file, then for each difference package, generate a first type image file, which contains one difference package.

[0078] Optionally, after obtaining at least one difference package, the electronic device determines whether each difference package exists in the SBOM file. If the difference package is in the SBOM file, the electronic device generates a first-type image file for each difference package.

[0079] It is understandable that the electronic device generates a first-type image file for each difference package, and the first-type image file contains one difference package but does not include other difference packages.

[0080] In one example, the electronic device acquires one difference package, namely, difference package 1. The electronic device generates a first-type image file, namely, image file 1. Image file 1 contains difference package 1.

[0081] In another example, the electronic device acquires two difference packages: difference package 1 and difference package 2. The electronic device then generates two Type I image files: image file 1 and image file 2. Image file 1 contains difference package 1, and image file 2 contains difference package 2.

[0082] It should be noted that electronic devices can generate first-type image files using existing automatic compilation algorithms. The specific generation process is the same as the existing generation process and will not be repeated here.

[0083] In subsequent embodiments, information regarding the absence of differential software packages in the SBOM file will be provided, and will not be repeated here.

[0084] Step 130: Use the first type of image file to upgrade the software system of the target device, and perform performance testing on the upgraded software system to obtain the test results.

[0085] In this step, after the electronic device generates a first-type image file, it uses this image file to upgrade the target device's software system. Simultaneously, the electronic device performs performance testing on the upgraded software system and obtains the test results.

[0086] It should be noted that the upgrade process involved in this step refers to burning the first type of image file to the target device. The burning process described above is the same as the existing burning process and will not be repeated here.

[0087] This step involves performing performance testing on the software system. Specifically, this means executing different commands or different options within the same command to complete tests on the entire system, a specific subsystem, or one or more aspects of the system, and obtaining the results, i.e., the test results.

[0088] In this embodiment of the invention, since the first type of image file includes only one differential package, that is, only one version upgrade package, the impact of this version upgrade package on system performance can be tested when performing performance testing on the software system.

[0089] Step 140: Repeat the process of generating a first type image file for each differential software package and upgrading the software system of the target device using the first type image file, and perform performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained.

[0090] In this step, after the electronic device obtains the test result of the software system upgraded from a first type image file, it will repeat the aforementioned steps 120-130 until the test result of each software system upgraded from a first type image file is obtained.

[0091] Understandably, the electronic device generates at least one Type I image file corresponding to each differential software package. The target device's software system is then upgraded at least once using at least one Type I image file, and improved performance testing is performed on the software system after each upgrade, yielding at least one test result.

[0092] The aforementioned solution utilizes different differential software packages to generate multiple image files, and then uses each differential software package's image file to upgrade and perform performance testing on the target device's software system. Ultimately, the impact of each differential software package on the software system can be determined. This solves the problems of existing testing processes being semi-automated, still requiring manual intervention, and unable to perform fine-grained testing. It achieves automated testing, saves labor costs, and improves R&D efficiency.

[0093] The following is in conjunction with the appendix Figure 2 The solution provided by the embodiments of the present invention will be described in detail. Figure 2 A flowchart illustrating another testing method provided in an embodiment of the present invention. Figure 2 As shown, the method in this embodiment specifically includes the following steps:

[0094] Step 200: Obtain at least one differential software package through the SBOM file and DAP file.

[0095] In this step, the electronic device obtains the software package included in the first file of the first version and the software package included in the first file of the second version; from multiple first files, the electronic device obtains software packages belonging to different versions of the same software; the electronic device uses the software package with the first version among the software packages belonging to different versions of the same software as the difference software package.

[0096] The second version is the version to be released, and the first version is the version preceding the second version; the first file includes the SBOM file and the DAP file.

[0097] For example, the system version to be released this time is V1.1 for the second version and V1.0 for the first version. The following 10 packages have been upgraded for version V1.0: kernel, mesa, qtcreator, docker, wps, Tencent Meeting, vscode, Python, binutils, and libdrm. These 10 packages are the difference packages; other packages that have not been upgraded will not be acquired.

[0098] The aforementioned 10 difference packages can exist in either the SBOM file or the DAP file. Generally, system-related packages are located in the SBOM file, while user-customized packages are located in the DAP file.

[0099] Step 201: Determine if each difference package exists in the SBOM file.

[0100] In this step, for each difference package, the electronic device determines whether the difference package exists in the SBOM file.

[0101] If yes, proceed to step 202; otherwise, proceed to step 210.

[0102] Step 202: If it exists in the SBOM file, then determine whether all difference packages have been traversed.

[0103] In this step, if the difference package exists in the SBOM file, the electronic device determines whether all the difference packages in the SBOM file have been traversed.

[0104] If yes, proceed to step 206; otherwise, proceed to step 203.

[0105] Step 203: If not all packages are traversed, generate a first-type image file for a single differential package.

[0106] In this step, if not all the difference packages in the SBOM file are traversed, the electronic device generates a first-class image file for one difference package.

[0107] Understandably, if several difference packages exist in the SBOM file, the electronic device will generate a corresponding number of Type I image files. Each Type I image file contains one and only one difference package.

[0108] Step 204: Upgrade the software system of the target device using the first type of image file.

[0109] In this step, the electronic device upgrades the target device's software system using the first type of image file.

[0110] It should be noted that the upgrade process involved in this step refers to burning the first type of image file to the target device. The burning process described above is the same as the existing burning process and will not be repeated here.

[0111] Step 205: Perform performance testing on the upgraded software system and obtain the test results.

[0112] In this step, the electronic device performs performance testing on the upgraded software system and obtains the test results.

[0113] It should be noted that the performance testing of the software system in this step specifically refers to executing different commands or different options within the same command to complete tests on the entire system, a specific subsystem, or one or more aspects of the system, and obtaining the results, i.e., the test results.

[0114] In this embodiment of the invention, since the first type of image file includes only one differential package, that is, only one version upgrade package, the impact of this version upgrade package on system performance can be tested when performing performance testing on the software system.

[0115] Step 206: If all have been traversed, determine whether to perform a combined difference package test.

[0116] In this step, if all the difference packages in the SBOM file have been traversed, the electronic device determines whether to perform a combined difference package test.

[0117] In this embodiment of the invention, the electronic device can determine whether to perform a test of the combined difference software package based on the configuration of the administrator.

[0118] For example, administrators can enter configuration commands via command line to request electronic devices to perform tests on combined difference software packages.

[0119] If the electronic device is determined not to undergo combined difference software package testing, then this process ends.

[0120] Step 207: If so, generate a second type of image file for any combination of multiple difference packages.

[0121] In this step, if the electronic device determines to perform a combined difference package test, then for a combined difference package of any number of difference packages, the electronic device generates a second type of image file.

[0122] Based on the previous example, if all 10 difference packages are in the SBOM file, then after the electronic device generates 10 Type 1 image files and determines to perform a combined difference package test, the electronic device can combine any number of difference packages to generate a Type 2 image file. That is, the Type 2 image file includes at least one version upgrade package.

[0123] Any combination of multiple difference packages, including any two, any three, any four, any five, etc.

[0124] Step 208: Upgrade the software system using the second type of image file.

[0125] In this step, the electronic device upgrades the target device's software system using the first type of image file.

[0126] It should be noted that the upgrade process involved in this step refers to burning the first type of image file to the target device. The burning process described above is the same as the existing burning process and will not be repeated here.

[0127] Step 209: Perform performance testing on the upgraded software system and obtain the test results.

[0128] In this step, the electronic device performs performance testing on the upgraded software system and obtains the test results.

[0129] It should be noted that the performance testing of the software system in this step specifically refers to executing different commands or different options within the same command to complete tests on the entire system, a specific subsystem, or one or more aspects of the system, and obtaining the results, i.e., the test results.

[0130] In this embodiment of the invention, the second type of image file includes a combined difference package, that is, it includes at least one version upgrade package. Therefore, when performing performance testing on the software system, the impact of at least one version upgrade package on system performance can be tested.

[0131] Step 210: If it does not exist in the SBOM file, then keep the target device's software system in version 1.

[0132] In this step, if the difference package does not exist in the SBOM file, the electronic device will maintain the target device's software system at version 1. That is, the electronic device will not perform any upgrade actions.

[0133] Understandably, if the difference package does not exist in the SBOM file, the electronic device can determine that the difference package exists in the DAP file.

[0134] Step 211: Determine whether all the different packages have been traversed.

[0135] In this step, the electronic device determines whether all the difference packages in the DAP file have been traversed.

[0136] If yes, proceed to step 206; otherwise, proceed to step 212.

[0137] Step 212: If not all packages are traversed, generate a third type of image file for each difference package.

[0138] In this step, if not all the difference packages in the SBOM file are traversed, a third type of image file is generated for each difference package.

[0139] Understandably, if several difference packages exist in the SBOM file, the electronic device will generate a corresponding number of third-type image files. Each third-type image file includes one and only one difference package.

[0140] Step 213: Upgrade the software system of the target device using a third-type image file.

[0141] In this step, the electronic device upgrades the target device's software system using a third-type image file.

[0142] It should be noted that the upgrade process involved in this step refers to the electronic device automatically loading the third type of image file into the target device. The loading process described above is the same as the existing loading process (for example, via command line), and will not be repeated here.

[0143] Step 214: Perform performance testing on the upgraded software system and obtain the test results.

[0144] In this step, the electronic device performs performance testing on the upgraded software system and obtains the test results.

[0145] It should be noted that the performance testing of the software system in this step specifically refers to executing different commands or different options within the same command to complete tests on the entire system, a specific subsystem, or one or more aspects of the system, and obtaining the results, i.e., the test results.

[0146] In this embodiment of the invention, since the third type of image file includes only one differentiated software package, that is, only one version upgrade software package, the impact of this version upgrade software package on system performance can be tested when performing performance testing on the software system.

[0147] Step 215: Revert the upgraded software system back to the first version.

[0148] In this step, after the electronic device obtains the test result of a difference package, it repeats steps 211-215 until the electronic device determines that all difference packages in the DAP file have been traversed.

[0149] Understandably, if all the difference packages in the DAP file have been traversed, the electronic device can repeat steps 206-209.

[0150] Optionally, after the electronic device obtains at least one test result of a single difference package or a combined difference package from the SBOM file, DAP file, it can also store at least one test result so that after the user obtains multiple test results, the impact of each difference package on the software system performance can be analyzed and determined.

[0151] The electronic device uploads at least one test result to a specified location, such as a specified server or a specified database.

[0152] Users can obtain at least one test result by accessing a specified location. Using at least one test result, analyze and determine the impact of each differential software package on the software system performance.

[0153] Figure 3 This is a schematic diagram of a process monitoring device provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the process monitoring device of this embodiment is applied to an electronic device and may include: an acquisition unit 310, a generation unit 320, a testing unit 330, and a storage unit 340.

[0154] The acquisition unit 310 is used to acquire at least one difference package, wherein the difference package is a package with version changes between adjacent versions and the highest version.

[0155] The generation unit 320 is configured to generate a first type image file for each difference package if the difference package is in an SBOM file, wherein the first type image file contains one difference package.

[0156] Test unit 330 is used to upgrade the software system of the target device using the first type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0157] The generation unit 320 and the testing unit 330 repeatedly execute the process of generating a first type image file for each differential software package, upgrading the software system of the target device using the first type image file, and performing performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained.

[0158] Optionally, the acquisition unit 310 is specifically used to acquire the software package included in the first file in the first version and the software package included in the first file in the second version;

[0159] From multiple first files, obtain different versions of the same software package;

[0160] The package containing the first version among the different versions of the same software is referred to as the differentiated package;

[0161] The second version is the version to be released, and the first version is the version preceding the second version; the first file includes an SBOM file and a DAP file.

[0162] Optionally, the generation unit 320 is further configured to generate a second type of image file for a combination of multiple difference packages if the difference package is in an SBOM file;

[0163] The test unit 330 is further configured to upgrade the software system using the second type of image file, and then perform performance testing on the upgraded software system again to obtain test results.

[0164] The generation unit 320 and the testing unit 330 repeatedly execute the combined difference package for any number of difference packages, generate a second type of image file, upgrade the software system using the second type of image file, and perform performance testing on the upgraded software system again to obtain test results, until the test results of the upgraded software system for each second type of image file are obtained.

[0165] Optionally, the apparatus further includes: a determination unit (not shown in the figure), used to determine whether each difference package exists in the SBOM file;

[0166] The generation unit 320 is further configured to, if so, generate a first type of image file for each differential software package.

[0167] Optionally, the apparatus further includes: a maintenance unit (not shown in the figure) for maintaining the software system of the target device in a first version if not;

[0168] The generation unit 320 is further configured to generate a third type of image file for each differential package;

[0169] The test unit 330 is also used to upgrade the software system using the third type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0170] The device further includes: a rollback unit (not shown in the figure), used to roll back the upgraded software system to the first version;

[0171] The generation unit 320, the testing unit 330, and the rollback unit repeatedly execute the process of generating a third-type image file for each differential software package, upgrading the software system to the second version using the third-type image file, performing performance testing on the upgraded software system to obtain test results, and then rolling back the upgraded software system to the first version, until the test results of the upgraded software system for each third-type image file are obtained.

[0172] Optionally, the generation unit 320 is further configured to generate a fourth type of image file for a combination of multiple difference packages;

[0173] The test unit 330 is also used to upgrade the software system to the second version using the fourth type of image file, and to perform performance testing on the upgraded software system to obtain test results.

[0174] The rollback unit (not shown in the figure) is also used to roll back the upgraded software system to the first version;

[0175] The generation unit 320, the testing unit 330, and the rollback unit repeatedly execute the combined difference package for any number of difference packages to generate a fourth type image file, use the fourth type image file to upgrade the software system to the second version, perform performance testing on the upgraded software system to obtain test results, and then roll back the upgraded software system to the first version, until the test results of the upgraded software system for each fourth type image file are obtained.

[0176] Optionally, the apparatus further includes a storage unit (not shown) for storing at least one test result, so that after the user obtains multiple test results, the impact of each differential software package on the performance of the software system can be analyzed and determined.

[0177] The apparatus of this embodiment can be used to perform Figures 1-2 The technical solutions of the method embodiments shown are similar in principle and in effect, and will not be described again here.

[0178] Accordingly, the power consumption testing device provided in this embodiment of the invention can also be implemented using another structure. Figure 4 This is a schematic diagram of an embodiment of an electronic device provided by the present invention, which can realize the present invention. Figures 1-2 The process of the illustrated embodiment is as follows: Figure 4 As shown, the above-mentioned electronic device may include: a housing 41, a processor 42, a memory 43, a circuit board 44, and a power supply circuit 45, wherein the circuit board 44 is disposed inside the space enclosed by the housing 41, and the processor 45 and the memory 43 are disposed on the circuit board 44; the power supply circuit 45 is used to supply power to the various circuits or devices of the above-mentioned electronic device; the memory 43 is used to store executable program code; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 43, for executing the methods described in the foregoing embodiments.

[0179] For details on the specific execution process of the above steps by processor 42, and the steps further executed by processor 42 through running executable program code, please refer to the present invention. Figures 1-2 The description of the illustrated embodiments will not be repeated here.

[0180] The electronic device is a device that provides computing services. It consists of a processor, hard drive, memory, system bus, etc. The electronic device is similar to the general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0181] It should be noted that, in this document, terms such as "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0182] The various embodiments in this specification are described in a related manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0183] In particular, the device embodiment is basically similar to the method embodiment, so the description is relatively simple. For relevant details, please refer to the description of the method embodiment.

[0184] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0185] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0186] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof.

[0187] In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0188] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0189] For ease of description, the above apparatus is described by dividing it into various functional units / modules. Of course, in implementing this invention, the functions of each unit / module can be implemented in one or more software and / or hardware.

[0190] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

Claims

1. A testing method, characterized in that, The method is applied to an electronic device, and the method includes: Obtain at least one difference package, wherein the difference package is the package with the highest version that has version changes between adjacent versions; If the difference package is in the SBOM file, then for each difference package, a first type image file is generated, and the first type image file contains one difference package; The software system of the target device is upgraded using the first type of image file, and the performance of the upgraded software system is tested to obtain the test results. Repeat the process of generating a first type image file for each differential software package and upgrading the software system of the target device using the first type image file, and perform performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained. At least one test result is stored so that after the user obtains multiple test results, the impact of each difference package on the software system performance can be analyzed and determined. Specifically, obtaining at least one difference package includes: Obtain the software packages included in the first file of the first version and the software packages included in the first file of the second version; From multiple first files, obtain different versions of the same software package; The package containing the first version of the software package belonging to different versions of the same software is referred to as the differentiated package; wherein, the second version is the version to be released, and the first version is the version preceding the second version; the first file includes an SBOM file and a DAP file.

2. The method according to claim 1, characterized in that, The method further includes: If the difference package is in the SBOM file, then a second type of image file is generated for any combination of multiple difference packages; The software system is upgraded using the second type of image file, and the upgraded software system is subjected to performance testing again to obtain the test results. Repeatedly execute the combined difference package for any number of difference packages to generate a second type of image file, and use the second type of image file to upgrade the software system. Then, perform performance testing on the upgraded software system again to obtain test results, until the test results of the upgraded software system for each second type of image file are obtained.

3. The method according to claim 1, characterized in that, After obtaining at least one difference package, the method further includes: Determine if each difference package exists in the SBOM file; If so, generate a first-type image file for each difference package.

4. The method according to claim 3, characterized in that, The method further includes: If not, the software system of the target device shall remain in the first version; For each difference package, generate a third type of image file; The software system is upgraded using the third type of image file, and the performance of the upgraded software system is tested to obtain the test results. The upgraded software system will be reverted to the first version. The process of generating a third-type image file for each differential software package, upgrading the software system to version two using the third-type image file, performing performance tests on the upgraded software system to obtain test results, and then reverting the upgraded software system back to version one, is repeated until the test results for the upgraded software system for each third-type image file are obtained.

5. The method according to claim 4, characterized in that, The method further includes: For any combination of multiple difference packages, generate a fourth type of image file; Using the fourth type of image file, the software system is upgraded to the second version, and performance testing is performed on the upgraded software system to obtain the test results; The upgraded software system will be reverted to the first version. Repeatedly execute the combined difference package for any number of difference packages to generate a fourth type image file; use the fourth type image file to upgrade the software system to the second version; perform performance testing on the upgraded software system to obtain test results; and then revert the upgraded software system back to the first version until the test results of the upgraded software system for each fourth type image file are obtained.

6. A testing apparatus, characterized in that, include: An acquisition unit is used to acquire at least one difference package, wherein the difference package is a package with version changes between adjacent versions and the highest version; The generation unit is configured to generate a first type image file for each difference package if the difference package is in an SBOM file, wherein the first type image file contains one difference package. The testing unit is used to upgrade the software system of the target device using the first type of image file, and to perform performance testing on the upgraded software system to obtain test results. The generation unit and the testing unit repeatedly execute the process of generating a first type image file for each difference package and upgrading the software system of the target device using the first type image file, and performing performance testing on the upgraded software system to obtain test results, until the test results of the upgraded software system for each first type image file are obtained. A storage unit is used to store at least one test result so that, after the user obtains multiple test results, the impact of each differential package on the software system performance can be analyzed and determined. Specifically, the acquisition unit is used to acquire the software package included in the first file in the first version and the software package included in the first file in the second version; From multiple first files, obtain different versions of the same software package; The package containing the first version among the different versions of the same software is referred to as the differentiated package; The second version is the version to be released, and the first version is the version preceding the second version; the first file includes an SBOM file and a DAP file.

7. An electronic device, characterized in that, The electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the test method of any one of claims 1-5.

8. A computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the test method of any one of claims 1-5.

Citation Information

Patent Citations

  • Software upgrading method and device, electronic equipment and storage medium

    CN114860283A

  • Automatic pressure testing method, device and equipment for software upgrading and storage medium

    CN115408304A