Compatibility test method and apparatus, and storage medium and electronic device
By parsing the compatibility test package and recording process marking information, the problem of CTS test processes being intercepted or frozen was solved, improving the test success rate and device performance.
Patent Information
- Application Number
- PCT/CN2024/090383
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2025-11-06
AI Technical Summary
During compatibility testing (CTS testing), the compatibility testing process (CTS process) is often intercepted or frozen by the Android system, causing the test to fail and certification to be unsuccessful.
By parsing the compatibility test package and recording the package information, and recording the process tag information when the process package information matches after the compatibility test process is started, the system can allow the process to proceed and avoid system interception or freezing.
This effectively prevents the compatibility testing process from being blocked or frozen by the system, improving the success rate of testing and enhancing the performance of the device.
Smart Images

Figure CN2024090383_06112025_PF_FP_ABST
Abstract
Description
Compatibility test method and device, storage medium and electronic equipment TECHNICAL FIELD
[0001] The present application relates to the technical field of software, in particular to a compatibility test method and device, a storage medium and an electronic equipment. BACKGROUND
[0002] In order to use the Google Play store and other Google services, a device using an Android system, such as a mobile phone, a tablet, a television, etc., usually needs to pass the compatibility test suite (CTS) test of Google to verify whether the device meets a series of requirements and specifications of the Android system, has good compatibility and stability. However, at present, when the compatibility test (i.e., the CTS test) is performed, the compatibility test process (CTS process) is often intercepted or frozen by the Android system, resulting in a failed compatibility test and failing to pass the authentication. TECHNICAL PROBLEM
[0003] At present, when the compatibility test (i.e., the CTS test) is performed, the compatibility test process (CTS process) is often intercepted or frozen by the Android system, resulting in a failed compatibility test and failing to pass the authentication. TECHNICAL SOLUTION
[0004] The embodiments of the present application provide a compatibility test scheme, which can effectively improve the success rate of the compatibility test in the device, thereby improving the use performance of the device.
[0005] The embodiments of the present application provide the following technical scheme:
[0006] According to an embodiment of the present application, a compatibility test method is applied to a device to be tested, and the method comprises the following steps: receiving a compatibility test program package sent by a compatibility test suite in a test host; if compatibility test information is parsed from the compatibility test program package, recording program package information corresponding to the compatibility test program package; starting a compatibility test process in response to a compatibility test instruction; and if process package information corresponding to the compatibility test process is detected to be matched with the program package information, recording process marker information, the process marker information being used for releasing the compatibility test process.
[0007] According to an embodiment of the present application, a compatibility test method applied to a test host comprises: detecting whether a compatibility test is started; if yes, sending a compatibility test program package to a device to be tested through a compatibility test suite, so that the device to be tested records corresponding program package information when compatibility test information is parsed from the compatibility test program package; and if the process package information corresponding to the started compatibility test process matches the program package information, the device to be tested records process mark information, which is used for releasing the compatibility test process.
[0008] According to an embodiment of the present application, a compatibility test device applied to a device to be tested comprises: a receiving module, configured to receive a compatibility test program package sent by a compatibility test suite in a test host; a first marking module, configured to record program package information corresponding to the compatibility test program package if compatibility test information is parsed from the compatibility test program package; a starting module, configured to start a compatibility test process in response to a compatibility test instruction; and a second marking module, configured to record process mark information if process package information corresponding to the compatibility test process matches the program package information, which is used for releasing the compatibility test process.
[0009] According to an embodiment of the present application, a compatibility test device applied to a test host comprises: a detecting module, configured to detect whether a compatibility test is started; and a transmitting module, configured to send a compatibility test program package to a device to be tested through a compatibility test suite if the compatibility test is started, so that the device to be tested records corresponding program package information when compatibility test information is parsed from the compatibility test program package; and if the process package information corresponding to the started compatibility test process matches the program package information, the device to be tested records process mark information, which is used for releasing the compatibility test process.
[0010] According to another embodiment of the present application, a storage medium has a computer program stored thereon, and when the computer program is executed by a processor of a computer, the computer executes the method provided by the embodiments of the present application.
[0011] According to another embodiment of the present application, an electronic device can include a memory storing a computer program, and a processor reading the computer program stored in the memory to execute the method provided by the embodiments of the present application.
[0012] According to another embodiment of the present application, a computer program product or computer program includes computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in various optional implementations described in embodiments of the present application. Advantages
[0013] In embodiments of the present application, the device to be tested can: receive a compatibility test program package sent by a compatibility test suite in a test host; if compatibility test information is parsed from the compatibility test program package, record program package information corresponding to the compatibility test program package; in response to a compatibility test instruction, start a compatibility test process; if process package information corresponding to the compatibility test process matches the program package information, record process marker information, which is used to release the compatibility test process.
[0014] In this way, during compatibility test (CTS test), when compatibility test information is parsed from the received compatibility test program package, the program package information is recorded. Further, after starting the compatibility test process, if process package information corresponding to the compatibility test process matches the program package information, process marker information is recorded. The system in the device to be tested can confirm and release the compatibility test process (CTS process) based on the process marker information, thereby effectively avoiding the compatibility test process (CTS process) from being intercepted or frozen by the system, resulting in test failure, and thereby improving the success rate of compatibility test in the device, and improving the use performance of the device. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0016] FIG. 1 shows a compatibility test system interaction flowchart according to an embodiment of the present application.
[0017] FIG. 2 shows a flowchart of a compatibility test method according to an embodiment of the present application.
[0018] FIG. 3 shows a flowchart of a compatibility test method according to another embodiment of the present application.
[0019] FIG. 4 shows a system architecture diagram for performing compatibility test in a scenario.
[0020] FIG. 5 shows a flowchart of a process of performing compatibility testing in one scenario.
[0021] FIG. 6 shows a flowchart of a process of performing compatibility testing in another scenario.
[0022] FIG. 7 shows a flowchart of a compatibility testing apparatus according to one embodiment of the present application.
[0023] FIG. 8 shows a flowchart of a compatibility testing apparatus according to another embodiment of the present application.
[0024] FIG. 9 shows a block diagram of an electronic device according to one embodiment of the present application.
[0025] Embodiments of the present application
[0026] The present disclosure will be further described by way of example with reference to the accompanying drawings and embodiments. It is to be understood that the embodiments provided herein are merely examples to explain the present disclosure and are not intended to limit the present disclosure. In addition, the embodiments provided below are used to implement part of the present disclosure, and the technical solutions described in the embodiments of the present disclosure can be implemented in any combination without conflict.
[0027] It should be noted that in the embodiments of the present disclosure, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the method or device comprising a series of elements not only includes the elements explicitly described, but also includes other elements not explicitly listed, or includes elements inherent in the implementation of the method or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of other related elements (such as steps in the method or units in the device, for example, the unit can be part of the circuit, part of the processor, part of the program or software, etc.) in the method or device comprising the element.
[0028] For example, the compatibility testing method provided by the embodiments of the present disclosure comprises a series of steps, but the compatibility testing method provided by the embodiments of the present disclosure is not limited to the steps described. Similarly, the compatibility testing device provided by the embodiments of the present disclosure comprises a series of units, but the device provided by the embodiments of the present disclosure is not limited to comprising the units explicitly described, and can also comprise units required to be set when obtaining relevant information or processing based on information.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present disclosure belongs. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.
[0030] It is understood that in the specific implementation of this application, data such as package information and test information are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0031] Currently, in technologies related to compatibility testing (CTS testing), to prevent the system from intercepting or freezing the compatibility testing process (CTS process), the compatibility testing process is added to the freeze whitelist in the dynamic feature configuration file, and this whitelist is added to the component interception / freeze module in the system to prevent the component interception / freeze module from intercepting or freezing the compatibility testing process.
[0032] However, these related technologies are not conducive to the unified management of the compatibility testing process. The compatibility testing process will still be frequently blocked or frozen, resulting in the failure of compatibility tests. Moreover, the whitelist needs to be reconfigured frequently, which is inefficient and has high maintenance costs.
[0033] In the embodiment of this application, by parsing the compatibility test package, if compatibility test information exists, the package information is recorded. After the compatibility test process is started, if the package information matches the process package information, the process marking information is further recorded to mark the compatibility test process, so that the component interception / freezing module in the system will allow the compatibility test process.
[0034] Furthermore, the solution proposed in this application can comprehensively cover the identification of compatibility testing processes, effectively avoid Android system interception or freezing of compatibility testing processes causing test failures, improve the success rate of compatibility testing in the device, and thus improve device performance; moreover, it eliminates the need for frequent configuration maintenance and management, freeing up the maintenance of compatibility testing related to functions such as interception / freezing in the system, thereby improving testing efficiency and reducing maintenance costs.
[0035] Figure 1 schematically illustrates an interactive flowchart of a compatibility testing system according to an embodiment of this application. Figure 2 schematically illustrates a flowchart of a compatibility testing method according to an embodiment of this application. As shown in Figure 2, the executing entity of this compatibility testing method can be any device under test with processing capabilities, such as a television, computer, mobile phone, smartwatch, and home appliance.
[0036] Referring to Figures 1 and 2, the compatibility test method that can be performed in the device under test may include steps S110 to S140.
[0037] Step S110, receiving the compatibility test program package sent by the compatibility test suite in the test host; step S120, if the compatibility test information is parsed from the compatibility test program package, recording the program package information corresponding to the compatibility test program package; step S130, starting the compatibility test process in response to the compatibility test instruction; step S140, if the process package information corresponding to the compatibility test process is detected to be matched with the program package information, recording the process marking information, and the process marking information is used for releasing the compatibility test process.
[0038] The test host and the device to be tested can be connected through wired or wireless connection mode, and the test host can also be any device with processing function, for example, the test host can be a computer, a mobile phone and the like.
[0039] The compatibility test suite (CTS) can run on the test host, and the test host can be a Linux host. The Android system can run on the device to be tested, and the test host and the device to be tested can transmit information through a data transmission channel. The data transmission channel can be an Android debug bridge (adb) channel. The adb channel refers to the data transmission channel between the device to be tested and the externally connected test host.
[0040] The test host can send the compatibility test program package (android application package, APK) to the device to be tested through the CTS. After receiving the compatibility test program package sent by the compatibility test suite in the test host, the device to be tested can install the compatibility test program package.
[0041] The device to be tested needs to parse the compatibility test program package during the installation process. If the device to be tested finds that the compatibility test information can be parsed from the compatibility test program package, the program package information corresponding to the compatibility test program package is recorded. The program package information can uniquely identify the compatibility test program package. The program package information can be a package name or first predetermined information. The program package information can be recorded in a first predetermined position in the compatibility test process for checking.
[0042] The to-be-tested device, in response to the compatibility test instruction (i.e., the instruction of starting to execute the compatibility test), starts a compatibility test process locally, and meanwhile, the to-be-tested device can find process package information corresponding to the started compatibility test process, the process package information being information uniquely identifying a compatibility test program package corresponding to the compatibility test process, and the process package information can also be a package name or second predetermined information, the first predetermined information and the second predetermined information having a predetermined unique correspondence relationship.
[0043] The to-be-tested device can detect whether the process package information corresponding to the compatibility test process matches the program package information in the first predetermined position, and if the two match, it indicates that the started compatibility test process is a test process generated by installing the received compatibility test program package, i.e., the started compatibility test process is a process for performing compatibility test.
[0044] In one mode, the program package information is specifically a package name, and the process package information is also a package name, at this time, the process package information matching the program package information specifically means that the program package information and the process package information are consistent; alternatively, in other modes, the program package information can be first predetermined information, and the process package information can be second predetermined information, at this time, the process package information matching the program package information specifically means that the program package information and the process package information satisfy a predetermined unique correspondence relationship.
[0045] Further, if the two match, the to-be-tested device can record process marker information for uniquely identifying the compatibility test process at a second predetermined position in the compatibility test process, i.e., mark the compatibility test process. Further, in the process of executing the compatibility test process, the system of the to-be-tested device can identify that the compatibility test process is a process for performing compatibility test based on the process marker information, thereby releasing the compatibility test process without interception or freezing.
[0046] In this way, during the compatibility test (CTS test), when the received compatibility test program package is parsed to obtain the compatibility test information, the program package information is recorded, and further, after the compatibility test process is started, if it is detected that the process package information corresponding to the compatibility test process matches the program package information, the process marker information is recorded, and the system in the to-be-tested device can confirm and release the compatibility test process (CTS process) based on the process marker information, thereby effectively avoiding the compatibility test process from being intercepted or frozen by the system, resulting in test failure, and further, improving the success rate of compatibility test in the device, thereby improving the use performance of the device.
[0047] The following describes further optional specific embodiments of each step during the compatibility test according to the embodiment of FIG. 2.
[0048] In an embodiment, if compatibility test information is parsed from the compatibility test package, package information corresponding to the compatibility test package is recorded, which can specifically include: parsing a program configuration information definition file in the compatibility test package through a package management service to obtain file parsing content; if it is detected that the compatibility test information is included in the file parsing content, adding package information corresponding to the compatibility test package in a new array variable of the package management service; and installing the compatibility test package based on the file parsing content.
[0049] A package management service (PMS) in the system can parse and install the received compatibility test APK.
[0050] The resource file in the compatibility test package includes a program configuration information definition file (AndroidManifest.xml file), and the package management service (PMS) can obtain corresponding file parsing content by parsing the program configuration information definition file (AndroidManifest.xml file).
[0051] If it is detected that the compatibility test information is included in the file parsing content, it can be accurately confirmed that the received compatibility test package is a package for compatibility test. Then, package information is added in a new array variable (mCtsTest) of the package management service (PMS), so that the compatibility test package can be marked as a package for compatibility test. The compatibility test information is information indicating compatibility test, and the compatibility test information can be a cts identifier.
[0052] Then, the package management service (PMS) can install the compatibility test package based on the file parsing content. Specifically, the package management service (PMS) can register four-component information included in the parsed file parsing content in the package management service (PMS). It can be understood that the compatibility test package can also include dex files and other files, and the package management service (PMS) can parse the other files and perform corresponding installation operations. After the installation of the compatibility test package is completed, a corresponding compatibility test process is generated in the system for compatibility test.
[0053] In this embodiment, the package management service (PMS) parses the AndroidManifest.xml file to determine whether the file contains compatibility test information (e.g., a cts identifier), and thus accurately identifies the compatibility test package as a package for compatibility testing. The package management service (PMS) then effectively marks the package in a newly added array variable (mCtsTest) of the package management service (PMS) for checking.
[0054] In this embodiment, the first predetermined location is the newly added array variable (mCtsTest) of the package management service (PMS). It should be understood that in other embodiments, the first predetermined location can be another specified location, but the package management service (PMS) can effectively mark the package in the newly added array variable (mCtsTest) of the package management service (PMS).
[0055] In one embodiment, before the step of installing the compatibility test package, the method can further include receiving an installation instruction sent by the compatibility test suite, the installation instruction being used to instruct the device under test to start installing the compatibility test package.
[0056] The test host can send the compatibility test package (compatibility test APK) to the device under test through the compatibility test suite (CTS: Compatibility Test Suite), and then send an installation instruction to the device under test through the compatibility test suite (CTS: Compatibility Test Suite).
[0057] The installation instruction is used to instruct the device under test to start installing the compatibility test package. After receiving the installation instruction, the device under test can start installing the APK. The process of installing the APK can include parsing the APK and then completing the installation according to the parsed file parsing content. After completing the installation, the device under test locally obtains the compatibility test process that can be used for compatibility testing.
[0058] It should be understood that in some other optional embodiments, the device under test can start installing the received APK autonomously after receiving the APK. In this embodiment of the present application, the device under test starts installing the received APK only under the instruction of the installation instruction sent by the test host, which can further effectively guarantee the controllability of the compatibility test process.
[0059] Further, in some other optional embodiments, before the step of installing the compatibility test package, the method can further include receiving an installation start condition sent by the compatibility test suite, the installation start condition being a condition that needs to be met by the device under test to start installing the compatibility test package.
[0060] The compatibility test suite in the test host can send the installation start condition together with the compatibility test program package to the device under test. If the device under test detects that the local installation start condition is met, the device under test can automatically trigger the installation of the compatibility test program package.
[0061] In an example, the installation start condition is a start time. If the device under test detects that the local start time is reached since the compatibility test program package is received, the device under test can automatically trigger the installation of the compatibility test program package. In some other examples, the installation start condition can be a predetermined device state, and the like.
[0062] Further, in an embodiment, before the step of starting the compatibility test process in response to the compatibility test instruction, the method further includes: sending installation completion information to the test host; and receiving the compatibility test instruction generated and sent by the compatibility test suite in response to the installation completion information.
[0063] After the device under test installs the APK, the device under test feeds back the installation completion information to the test host. Thus, the test host can know that the installation of the APK in the device under test is completed.
[0064] Then, the compatibility test suite in the test host generates and sends the compatibility test instruction to the device under test in response to the installation completion information. Thus, the device under test can start the compatibility test process to perform the compatibility test.
[0065] Further, the device under test starts the compatibility test only under the indication of the compatibility test instruction sent by the test host. Thus, the controllability of the compatibility test process can be further ensured.
[0066] In some other optional embodiments, before the step of starting the compatibility test process in response to the compatibility test instruction, the method can further include: receiving the instruction trigger condition sent by the compatibility test suite. The instruction trigger condition is a condition required to be met by the device under test to trigger the compatibility test instruction.
[0067] The compatibility test suite in the test host can send the instruction trigger condition together with the compatibility test program package to the device under test. If the device under test detects that the local instruction trigger condition is met, the device under test can automatically trigger the compatibility test instruction.
[0068] In one example, the instruction triggering condition is a triggering time period. If the local device detects that the triggering time period has been reached since the installation of the compatibility test package, the compatibility test instruction can be triggered automatically. In another example, the instruction triggering condition can be a target device state after the installation of the compatibility test package in the device to be tested.
[0069] Further, in one embodiment, if the process package information corresponding to the compatibility test process matches the package information, the process mark information is recorded, which can include: detecting, by the component management service, whether the package management service has the process package information in the added array variable; if yes, adding the process mark information corresponding to the compatibility test process in the added array variable of the component management service.
[0070] The component management service (AMS) in the system can start a local compatibility test process to perform compatibility test. During the execution of the compatibility test process, the test command in the compatibility test suite in the test host can be executed to complete the compatibility test.
[0071] The component management service (AMS) can detect whether the package management service (PMS) has the process package information in the added array variable. If yes, it means that the process package information exists in the added array variable of the package management service (PMS), which means that the compatibility test process started is the process for compatibility test.
[0072] Further, the component management service (AMS) adds the process mark information corresponding to the compatibility test process in the added array variable (mCtsTest) to effectively mark the compatibility test process for the system to check.
[0073] In this embodiment, the second predetermined position is the added array variable (mCtsTest) of the component management service (AMS). It can be understood that in other embodiments, the second predetermined position can be other specified positions, but the added array variable (mCtsTest) of the component management service (AMS) can be more effectively marked.
[0074] Further, in some embodiments, before the step of starting the compatibility test process in response to the compatibility test instruction sent in response to the compatibility test suite, the method can further comprise: if no compatibility test information is parsed from the compatibility test package, not recording the package information of the received compatibility test package; and after the step of starting the compatibility test process, the method can further comprise: if no package information is detected to be recorded, not recording the process marker information.
[0075] After the device to be tested receives the compatibility test package, if no compatibility test information is parsed from the compatibility test package, the package information of the received compatibility test package is not recorded, but the compatibility test package is still installed. After the compatibility test process is started subsequently, if no package information is detected to be recorded in the first predetermined location, the process marker information is also not recorded in the second predetermined location.
[0076] Thus, in this embodiment, when it cannot be determined that the started compatibility test process is a process for performing compatibility test, the started compatibility test process is not marked. The component handling service in the system detects that no process marker information is recorded locally, and then the component handling service in the system cannot check the related comparison for the compatibility test process, and cannot confirm whether the compatibility test process is a process for performing compatibility test by checking the process marker information.
[0077] Further, in some embodiments, after the step of recording the process marker information, the method can further comprise: detecting by the component handling service whether the process marker information is recorded locally; and if yes, releasing the compatibility test process.
[0078] The component handling service is a service in the system for performing component interception or freezing. After the compatibility test process is started, the component handling service can detect whether the process marker information is recorded in the second predetermined location, and if yes, the component handling service can confirm that the compatibility test process is a process for performing compatibility test, and thus release the compatibility test process.
[0079] Further, in some embodiments, after the component handling service in the system detects that no process marker information is recorded locally, in some optional embodiments, whether the compatibility test process is intercepted or frozen is completely determined by the component handling service in the system according to its predetermined interception or freezing strategy, that is, at this time, the compatibility test process can be intercepted or can not be intercepted.
[0080] Further, in the system, after the component processing service detects that the process mark information is not recorded locally, in some optional embodiments, the component processing service can: acquire process-related information of the started compatibility test process; score according to the process-related information to obtain a score of the compatibility test process as a process for performing compatibility test; and determine whether to release the compatibility test process according to the score.
[0081] In this way, the component processing service analyzes the process-related information (such as the location of the folder where the process is located and the called resources, etc.) of the compatibility test process, scores according to the process-related information to obtain a score of the compatibility test process as a process for performing compatibility test (for example, the predetermined scores corresponding to all information in the process-related information can be weighted and summed to obtain the score). Then, according to the score, it is determined whether to release the compatibility test process, so that when the APK mark process fails to pass the analysis, the possibility of the compatibility test process for compatibility test being intercepted or frozen can be further reduced, and the success rate of the compatibility test can be further improved.
[0082] In some embodiments, the determining whether to release the compatibility test process according to the score can include: if the score is higher than a first predetermined threshold, releasing the compatibility test process.
[0083] In some embodiments, the determining whether to release the compatibility test process according to the score can include: if the score is higher than a second predetermined threshold, sending confirmation information to the compatibility test suite; receiving identity information returned by the compatibility test suite in response to the confirmation information; and if the identity information indicates that the compatibility test process is a process for performing compatibility test, releasing the compatibility test process.
[0084] Further, FIG. 3 schematically shows a flowchart of a compatibility test method according to another embodiment of the present application. The execution subject of the compatibility test method can be any test host with processing capability, such as a computer, a mobile phone, a tablet computer, and other devices, etc.
[0085] Referring to FIGS. 1 and 3, the compatibility test method executed in the test host can include steps S210 to S220.
[0086] Step S210, detecting whether to start the compatibility test; step S220, if yes, sending a compatibility test program package to the device to be tested through the compatibility test suite, so that the device to be tested records the corresponding program package information when the compatibility test information is parsed from the compatibility test program package, wherein the device to be tested records the process mark information if the process package information corresponding to the started compatibility test process matches the program package information, and the process mark information is used for releasing the compatibility test process in the device to be tested.
[0087] The test host can send a compatibility test program package (compatibility test APK) APK to the device to be tested through the compatibility test suite (CTS: Compatibility Test Suite) when detecting that the compatibility test needs to be started (for example, when monitoring the test start execution instruction). After the device to be tested receives the compatibility test program package sent by the compatibility test suite in the test host, the compatibility test program package can be installed. When the device to be tested parses the received compatibility test program package and parses the compatibility test information therefrom, the program package information is recorded. Further, after starting the compatibility test process, if the process package information corresponding to the compatibility test process matches the program package information, the process mark information is recorded. The device to be tested can confirm and release the compatibility test process (CTS process) based on the process mark information, so that the compatibility test process (CTS process) is effectively prevented from being intercepted or frozen by the system in the device to be tested, thereby improving the success rate of the compatibility test in the device and improving the use performance of the device.
[0088] The following describes further optional specific embodiments of each step when performing the compatibility test in the embodiment of FIG. 3.
[0089] In an embodiment, after the step of sending the compatibility test program package to the device to be tested through the compatibility test suite, the method can further include sending an installation instruction to the device to be tested through the compatibility test suite, and the installation instruction is used to instruct the device to be tested to start installing the compatibility test program package.
[0090] The installation instruction is used to instruct the device to be tested to start installing the compatibility test program package. After receiving the installation instruction, the device to be tested can start installing the APK. It can be understood that in some other optional embodiments, the device to be tested can start installing the program package autonomously after receiving the APK. In this embodiment of the present application, the device to be tested starts installing the received APK only under the instruction of the installation instruction sent by the test host, which can further effectively guarantee the controllability of the compatibility test process.
[0091] In one embodiment, after the step of sending the compatibility test program package to the device to be tested by the compatibility test suite, the method can further comprise: receiving installation completion information sent by the device to be tested; and sending a compatibility test instruction to the device to be tested according to the installation completion information, the compatibility test instruction being used to trigger the device to be tested to start the compatibility test process.
[0092] After the device to be tested installs the APK, the device to be tested feeds back installation completion information to the test host, and then the test host can know that the installation of the APK in the device to be tested has been completed.
[0093] Then, the compatibility test suite in the test host generates and sends a compatibility test instruction to the device to be tested in response to the installation completion information, and the compatibility test process in the device to be tested is triggered to perform compatibility testing.
[0094] Further, the device to be tested starts the compatibility test only under the indication of the compatibility test instruction sent by the test host, and the controllability of the compatibility test process can be further effectively guaranteed.
[0095] In one embodiment, before the step of sending the compatibility test program package to the device to be tested by the compatibility test suite, the method can further comprise: obtaining a test command to be executed; and adding the test command to be executed to a command scheduling queue, the test command to be executed in the command scheduling queue being used for the compatibility test process to perform execution.
[0096] Before the compatibility test program package is sent to the device to be tested by the compatibility test suite, the compatibility test suite (CTS) can analyze the input test command to obtain a test command to be executed, and then add the test command to be executed to a command scheduling queue, the test command to be executed in the command scheduling queue being used for the compatibility test process to perform execution, so as to complete the compatibility test.
[0097] In order to better implement the compatibility test method provided in the foregoing embodiments of the present application, the foregoing embodiments are further described below in combination with a process of performing compatibility test in one scenario.
[0098] The system architecture for performing the compatibility test in this scenario is shown in FIG. 4, which includes a test host (Linux host) 310 and a device to be tested (Android Device) 320. The test host (Linux host) 310 includes a compatibility test suite (CTS), which includes a command parsing module 311, a command scheduling module 312, a command execution module 313, a push function module 314, and a test execution module 315. The device to be tested (Android Device) 320 includes a system (Android System), which includes a package management service (PMS) 321, a component management service (AMS) 322, and a component processing service 323.
[0099] The process for performing the compatibility test in this scenario can include steps S410-S4180 shown in FIG. 5 and steps S510-S530 shown in FIG. 6.
[0100] In step S410, the CTS is started. Specifically, the compatibility test suite (CTS) is started in the test host 310.
[0101] In step S420, the command is parsed. Specifically, the command parsing module 311 in the compatibility test suite (CTS) obtains a test command to be run, which can be obtained by parsing an input test command.
[0102] In step S430, the command is scheduled. Specifically, the command scheduling module 312 in the compatibility test suite (CTS) adds the test command to be run to a command scheduling queue, and the test command to be run in the command scheduling queue is used for the compatibility test process to be executed.
[0103] In step S440, the command is executed. Specifically, the command execution module 313 in the compatibility test suite (CTS) receives or triggers a test start execution instruction.
[0104] In step S450, the push (pushFile) is performed. Specifically, the push function module 314 in the compatibility test suite (CTS) sends an APK to the device to be tested, and the compatibility test package is used for installation in the device to be tested. After the command execution module 313 receives or triggers the test start execution instruction, it is considered that the compatibility test is started, and then the push function module 314 sends the APK to the device to be tested through the adb channel by the pushFile function.
[0105] Step S460, APK is received. Specifically, the device under test receives the APK sent by the compatibility test suite in the test host, and stores the APK in the / data / local / tmp directory.
[0106] Step S470, installation instruction is sent. Specifically, the compatibility test suite sends an installation instruction (pminstall -r filename) to the device under test, which is used to instruct the device under test to start installing the compatibility test package.
[0107] Step S480, PMS is started. Specifically, the package management service (PMS) 321 in the device under test is started in response to the installation instruction.
[0108] Step S490, APK is parsed. Specifically, the program configuration information definition file in the compatibility test package is parsed by the package management service to obtain file parsing content.
[0109] Step S4100, it is judged whether the CTS string is recognized. Specifically, it is detected whether the compatibility test information (CTS string) is included in the file parsing content. If yes, step S4110 is entered; if no, the package information is not recorded, and step S4120 is directly entered.
[0110] Step S4110, CTS is marked. Specifically, if it is detected that the compatibility test information is included in the file parsing content, the package information corresponding to the compatibility test package is added to the new array variable of the package management service.
[0111] Step S4120, APK is installed. Specifically, the compatibility test package is installed based on the file parsing content.
[0112] Step S4130, compatibility test instruction is sent. Specifically, the compatibility test suite: receives the installation completion information sent by the device under test; according to the installation completion information, sends a compatibility test instruction to the device under test, which is used to trigger the device under test to start the compatibility test process.
[0113] Step S3440, AMS is started. Specifically, the component management service (AMS) 322 in the device under test is started in response to the compatibility test instruction.
[0114] Step S4150, test process is started. Specifically, the device under test starts the compatibility test process by the component management service (AMS) 322 in response to the compatibility test instruction sent by the compatibility test suite.
[0115] Step S4160, judging whether the CTS mark exists. Specifically, the test device detects whether the process package information corresponding to the compatibility test process matches the program package information, that is, whether the program package information matching the process package information exists in the newly added array variable of the package management service (PMS).
[0116] Step S4170, marking the process. Specifically, if the process package information corresponding to the compatibility test process matches the program package information, the process mark information is recorded, including: detecting, by the component management service, whether the program package information matching the process package information exists in the newly added array variable of the package management service; if yes, adding the process mark information corresponding to the compatibility test process in the newly added array variable of the component management service.
[0117] Step S4180, ending the marking process. If the program package information is not detected in step S4160, the process mark information is not recorded and the process directly enters step S4180.
[0118] After the marking process is completed, the component processing service 323 in the system of the test device can perform steps S510 to S530 as shown in FIG. 6.
[0119] Step S510, judging whether the CTS mark exists. Specifically, the component processing service (i.e., the service of the component interception or freezing processing function) detects whether the process mark information is recorded locally, that is, whether the process mark information is recorded in the newly added array variable of the component management service.
[0120] Step S520, intercepting or freezing the process. Specifically, if the process mark information is not detected in the newly added array variable of the component management service, the started compatibility test process is intercepted or frozen.
[0121] Step S530, ending. Specifically, ending the process, wherein if the process mark information is detected in the newly added array variable of the component management service, the process is ended, meaning that the started compatibility test process is released in the system.
[0122] In this scenario, the management of the compatibility test is implemented by applying some of the foregoing embodiments of the present application, which has at least the following beneficial effects: the test process is avoided from being intercepted by the CTS identification method, which reduces cost and increases efficiency; the CTS test process is identified by the APK internal AndroidManifest.xml file information, which is fast and accurate; the CTS test process is identified when the process is just created, which ensures accurate interception / freeze identification; the process mark information is used for judgment before interception / freeze, which is fast.
[0123] To facilitate better implementation of the compatibility test method provided by the embodiments of the present application, the embodiments of the present application further provide a compatibility test device based on the above-mentioned compatibility test method. The meanings of the terms are the same as those in the above-mentioned compatibility test method, and the specific implementation details can be referred to the description in the method embodiments.
[0124] FIG. 7 shows a block diagram of a compatibility test device according to one embodiment of the present application. As shown in the compatibility test device 600 in FIG. 7, the compatibility test device 600 can be applied to a device to be tested, and can include: a receiving module 610, which can be configured to receive a compatibility test program package sent by a compatibility test suite in a test host; a first marking module 620, which can be configured to record program package information corresponding to the compatibility test program package if compatibility test information is parsed from the compatibility test program package; a starting module 630, which can be configured to start a compatibility test process in response to a compatibility test instruction; and a second marking module 640, which can be configured to record process marking information if process package information corresponding to the compatibility test process is detected to match the program package information, the process marking information being used to release the compatibility test process.
[0125] In some embodiments, before the step of starting the compatibility test process in response to the compatibility test instruction sent by the compatibility test suite, the first marking module 620 can be configured to not record the program package information if compatibility test information is not parsed from the compatibility test program package; and after the step of starting the compatibility test process, the second marking module 640 can be configured to not record the process marking information if the program package information is not detected to be recorded.
[0126] In some embodiments, the first marking module 620 can be configured to: parse a program configuration information definition file in the compatibility test program package to obtain file parsing content through a package management service; if the compatibility test information is detected to be included in the file parsing content, add program package information corresponding to the compatibility test program package in a newly added array variable of the package management service; and install the compatibility test program package based on the file parsing content.
[0127] In some embodiments, the second marking module 640 can be configured to: detect whether the program package information matching the process package information exists in the newly added array variable of the package management service through a component management service; if yes, add process marking information corresponding to the compatibility test process in a newly added array variable of the component management service.
[0128] In some embodiments, before the step of installing the compatibility test package, the device further comprises a command response module configured to: receive an installation instruction sent by the compatibility test suite, the installation instruction being configured to instruct the to-be-tested device to start installing the compatibility test package.
[0129] In some embodiments, before the step of starting the compatibility test process in response to the compatibility test instruction, the device further comprises an installation feedback module configured to: send installation completion information to the test host; and receive the compatibility test instruction generated and sent by the compatibility test suite in response to the installation completion information.
[0130] In some embodiments, before the step of installing the compatibility test package, the receiving module is configured to: receive an installation start condition sent by the compatibility test suite, the installation start condition being a condition required to be met in the to-be-tested device to start installing the compatibility test package.
[0131] In some embodiments, before the step of starting the compatibility test process in response to the compatibility test instruction, the receiving module is configured to: receive an instruction trigger condition sent by the compatibility test suite, the instruction trigger condition being a condition required to be met in the to-be-tested device to trigger the compatibility test instruction.
[0132] In some embodiments, after the step of recording the process marker information, the device further comprises a process control module configured to: detect, by a component processing service, whether the process marker information is recorded locally; and if yes, release the compatibility test process.
[0133] In some embodiments, the process control module is configured to: if no, obtain process-related information of the started compatibility test process; score according to the process-related information to obtain a score of the compatibility test process as a process for performing compatibility test; and determine whether to release the compatibility test process according to the score.
[0134] In some embodiments, the process control module is configured to: if the score is higher than a first predetermined threshold, release the compatibility test process.
[0135] In some embodiments, the process control module is configured to: if the score is higher than a second predetermined threshold, send confirmation information to the compatibility test suite; receive identity information returned by the compatibility test suite in response to the confirmation information; and if the identity information indicates that the compatibility test process is a process for performing compatibility test, release the compatibility test process.
[0136] Fig. 8 shows a block diagram of a compatibility testing device according to another embodiment of the present application. As shown in Fig. 8, the compatibility testing device 700 can be applied to a testing host, and the compatibility testing device 700 can include: a detection module 710, which can be configured to detect whether a compatibility testing is initiated; and a transmission module 720, which can be configured to, if so, send a compatibility testing program package to a device to be tested through a compatibility testing suite, so that the device to be tested records corresponding program package information when the device to be tested parses compatibility testing information from the compatibility testing program package, wherein the device to be tested records process marker information if the device to be tested detects that process package information corresponding to an initiated compatibility testing process matches the program package information, and the process marker information is used for the system of the device to be tested to release the compatibility testing process.
[0137] In an embodiment, after the step of sending the compatibility testing program package to the device to be tested through the compatibility testing suite, the device further includes a testing management module, configured to: receive installation completion information sent by the device to be tested; and send a compatibility testing instruction to the device to be tested according to the installation completion information, wherein the compatibility testing instruction is used to trigger the device to be tested to initiate the compatibility testing process.
[0138] In an embodiment, after the step of sending the compatibility testing program package to the device to be tested through the compatibility testing suite, the device further includes an installation management module, configured to: send an installation instruction to the device to be tested through the compatibility testing suite, wherein the installation instruction is used to instruct the device to be tested to initiate installation of the compatibility testing program package.
[0139] In an embodiment, before the step of sending the compatibility testing program package to the device to be tested through the compatibility testing suite, the device further includes a command parsing module, configured to: obtain a to-be-run testing command; and add the to-be-run testing command to a command scheduling queue, wherein the to-be-run testing command in the command scheduling queue is used for the compatibility testing process to perform.
[0140] It should be noted that, although several modules or units of a device for action execution are mentioned in the foregoing detailed description, such a division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units.
[0141] In addition, the embodiments of the present application also provide an electronic device, as shown in Fig. 9, which shows a block diagram of an electronic device according to an embodiment of the present application, in particular:
[0142] The electronic device can include a processor 801 having one or more processing cores, a memory 802 having one or more computer-readable storage media, a power supply 803, and an input unit 804, etc. Those skilled in the art can understand that the electronic device structure shown in FIG. 9 does not constitute a limitation on the electronic device, and can include more or fewer components than shown, or combine certain components, or different component arrangements. Among them:
[0143] The processor 801 is the control center of the electronic device, connects various parts of the entire computer device through various interfaces and lines, executes various functions and processes data of the computer device by running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, thereby overall monitoring the electronic device. Optionally, the processor 801 can include one or more processing cores; preferably, the processor 801 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 801.
[0144] The memory 802 can be used to store software programs and modules, and the processor 801 executes various functions and data processing by running the software programs and modules stored in the memory 802. The memory 802 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; the data storage area can store data created according to the use of the computer device, etc. In addition, the memory 802 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 802 can also include a memory controller to provide access for the processor 801 to the memory 802.
[0145] The electronic device also includes a power supply 803 for powering various components, and preferably the power supply 803 can be logically connected to the processor 801 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 803 can also include one or more direct or alternating current power supplies, a recharging system, a power supply failure detection circuit, a power supply converter or inverter, a power supply state indicator, etc. any component.
[0146] The electronic device can also include an input unit 804, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0147] Although not shown, the electronic device can further include a display unit, etc., which will not be described herein. Specifically, in the present embodiment, the processor 801 in the electronic device will load executable files corresponding to processes of one or more computer programs into the memory 802 according to the following instructions, and run the computer programs stored in the memory 802 by the processor 801, so as to realize various functions in the foregoing embodiments of the present application.
[0148] For example, when the electronic device is implemented as a device to be tested, the processor 801 can perform: receiving a compatibility test program package sent by a compatibility test suite in a test host; recording package information corresponding to the compatibility test program package if compatibility test information is parsed from the compatibility test program package; starting a compatibility test process in response to a compatibility test instruction; and recording process mark information if process package information corresponding to the compatibility test process matches the package information, the process mark information being used for releasing the compatibility test process.
[0149] For example, when the electronic device is implemented as a test host, the processor 801 can perform: detecting whether a compatibility test is started; if so, sending a compatibility test program package to a device to be tested through a compatibility test suite, so that the device to be tested records corresponding package information when compatibility test information is parsed from the compatibility test program package, wherein the device to be tested records process mark information if process package information corresponding to a started compatibility test process matches the package information, the process mark information being used for releasing the compatibility test process by the device to be tested.
[0150] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or by relevant hardware controlled by a computer program, which can be stored in a computer readable storage medium and loaded and executed by a processor.
[0151] Therefore, the embodiments of the present application further provide a storage medium having a computer program stored therein, which can be loaded by a processor to execute steps in any method provided by the embodiments of the present application.
[0152] The storage medium can be a computer readable storage medium, which can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0153] Since the computer program stored in the storage medium can execute the steps in any of the methods provided by the embodiments of the present application, the beneficial effects that can be achieved by the methods provided by the embodiments of the present application can be achieved, which are described in detail in the foregoing embodiments and will not be described here.
[0154] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
[0155] It will be understood that the application is not limited to the embodiments above-described and illustrated in the drawings; changes and modifications can be made to the application without departing from its scope.
Claims
1. A compatibility test method characterized by, The method is applied to a device to be tested, and comprises the following steps: receiving a compatibility test program package sent by a compatibility test suite in a test host; if compatibility test information is parsed from the compatibility test program package, recording program package information corresponding to the compatibility test program package; starting a compatibility test process in response to a compatibility test instruction; if process package information corresponding to the compatibility test process is detected to match the program package information, recording process marker information, which is used for releasing the compatibility test process.
2. The method of claim 1, wherein, The step of recording the program package information if the compatibility test information is parsed from the compatibility test program package comprises the following steps: parsing a program configuration information definition file in the compatibility test program package to obtain file parsing content through a package management service; if the compatibility test information is detected in the file parsing content, adding the program package information corresponding to the compatibility test program package in a new array variable of the package management service; installing the compatibility test program package based on the file parsing content.
3. The method of claim 2, wherein, The step of recording the process marker information if the process package information corresponding to the compatibility test process is detected to match the program package information comprises the following steps: detecting, through a component management service, whether the program package information consistent with the process package information exists in the new array variable of the package management service; if yes, adding process marker information corresponding to the compatibility test process in a new array variable of the component management service.
4. The method of claim 2, wherein, Before the step of installing the compatibility test program package, the method further comprises the following steps: receiving an installation instruction sent by the compatibility test suite, the installation instruction being used for instructing the device to be tested to start installing the compatibility test program package.
5. The method of claim 1, wherein, Before the step of starting the compatibility test process in response to the compatibility test instruction, the method further comprises the following steps: sending installation completion information to the test host; receiving the compatibility test instruction generated and sent by the compatibility test suite in response to the installation completion information.
6. The method of claim 2, wherein, Before the step of installing the compatibility test program package, the method further comprises the following steps: receiving an installation start condition sent by the compatibility test suite, the installation start condition being a condition required to be met by the device to be tested to start installing the compatibility test program package.
7. The method of claim 1, wherein, Before the step of starting the compatibility test process in response to the compatibility test instruction, the method further comprises the following steps: receiving an instruction trigger condition sent by the compatibility test suite, the instruction trigger condition being a condition required to be met by the device to be tested to trigger the compatibility test instruction.
8. The method of claim 1, wherein, Before the step of starting the compatibility test process in response to the compatibility test instruction sent by the compatibility test suite, the method further comprises the following steps: if the compatibility test information is not parsed from the compatibility test program package, not recording the program package information; After the step of starting the compatibility test process, the method further comprises the following steps: if the program package information is not detected to be recorded, not recording the process marker information.
9. The method according to any one of claims 1 to 8, characterized in that, After the step of recording the process mark information, the method further comprises: detecting whether the process mark information is recorded locally by a component processing service; if yes, releasing the compatibility test process.
10. The method of claim 9, wherein, The method further comprises: if no, obtaining process related information of the started compatibility test process; scoring according to the process related information to obtain a score of the compatibility test process as a process for performing compatibility test; determining whether to release the compatibility test process according to the score.
11. The method of claim 10, wherein, The determining whether to release the compatibility test process according to the score comprises: if the score is higher than a first predetermined threshold, releasing the compatibility test process.
12. The method of claim 10, wherein, The determining whether to release the compatibility test process according to the score comprises: if the score is higher than a second predetermined threshold, sending confirmation information to the compatibility test suite; receiving identity information returned by the compatibility test suite in response to the confirmation information; if the identity information indicates that the compatibility test process is a process for performing compatibility test, releasing the compatibility test process.
13. A compatibility test method characterized by, Applied to a test host, the method comprises: detecting whether compatibility test is started; if yes, sending a compatibility test program package to a device to be tested by a compatibility test suite, so that the device to be tested records corresponding program package information when compatibility test information is parsed from the compatibility test program package, wherein the device to be tested records process mark information if it detects that process package information corresponding to a started compatibility test process matches the program package information, and the process mark information is used for releasing the compatibility test process in the device to be tested.
14. The method of claim 13, wherein, After the step of sending the compatibility test program package to the device to be tested by the compatibility test suite, the method further comprises: receiving installation completion information sent by the device to be tested; sending a compatibility test instruction to the device to be tested according to the installation completion information, the compatibility test instruction being used for triggering the device to be tested to start the compatibility test process.
15. The method of claim 13, wherein, After the step of sending the compatibility test program package to the device to be tested by the compatibility test suite, the method further comprises: sending an installation instruction to the device to be tested by the compatibility test suite, the installation instruction being used for instructing the device to be tested to start installing the compatibility test program package.
16. The method of claim 13, wherein, Before the step of sending the compatibility test program package to the device to be tested by the compatibility test suite, the method further comprises: obtaining a to-be-run test command; adding the to-be-run test command to a command scheduling queue, the to-be-run test command in the command scheduling queue being used for the compatibility test process to perform execution.
17. A compatibility testing device, characterized by Applied to a device to be tested, the apparatus comprises: a receiving module, configured to receive a compatibility test program package sent by a compatibility test suite in a test host; a first marking module, configured to record, if compatibility test information is parsed from the compatibility test program package, program package information corresponding to the compatibility test program package; a starting module, configured to start a compatibility test process in response to a compatibility test instruction; The second marking module is configured to record process marking information if it is detected that the process package information corresponding to the compatibility test process matches the program package information, and the process marking information is used to release the compatibility test process.
18. A compatibility testing apparatus, comprising: The device is applied to a test host and includes: A detection module is configured to detect whether a compatibility test is started. A transmission module is configured to send a compatibility test program package to a to-be-tested device through a compatibility test suite if the compatibility test is started, so that the to-be-tested device records corresponding program package information when compatibility test information is parsed from the compatibility test program package, and the to-be-tested device records process marking information if it is detected that process package information corresponding to a started compatibility test process matches the program package information, and the process marking information is used to release the compatibility test process in the to-be-tested device.
19. A storage medium, characterized by A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method in any one of claims 1 to 12 or 13 to 16.
20. An electronic device, comprising: The device includes: A memory is configured to store a computer program; A processor is configured to read the computer program stored in the memory to execute the method in any one of claims 1 to 12 or 13 to 16.
Citation Information
Patent Citations
Method and electronic device for protecting processes
CN103677978A
Process processing method and device, electronic equipment and computer readable storage medium
CN109992965A
Operating system test management method and device and computing equipment
CN116244186A
Determining compatibility of an application with different versions of an operating system
US20130185708A1