Test method, electronic device, storage medium and chip

By creating instruction communication ports and running camera services in the loading layer, kernel layer and local layer of electronic devices, the problem of inefficient testing in the existing technology is solved, and a fast and successful test process is achieved.

CN118354063BActive Publication Date: 2024-11-22HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410757669.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-11-22
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency of electronic equipment cameras is low, resulting in a long test time and it is difficult to meet the rapid testing needs of the production line.

Method used

Create instruction communication ports in the loading layer, kernel layer and local layer of the device to be tested, and run camera services in these layers to quickly obtain test parameters after power-on on the device, avoiding the inability to create instruction communication ports in traditional technology Problem of successfully running the service.

Benefits of technology

Improves testing efficiency, shortens testing time, ensures successful tests while reducing testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118354063B_ABST
    Figure CN118354063B_ABST
Patent Text Reader

Abstract

The present application discloses a test method, an electronic device, a storage medium and a chip. The method is applied to a device to be tested, comprising: during the power-on process of the device to be tested, a first service is run in the first software layer of the device to be tested, and a first file directory is created in the second software layer of the device to be tested, and an instruction communication port is created in the third software layer of the device to be tested, the third software layer is the loading layer, the kernel layer and the loading layer of the device to be tested, wherein the first software layer, the second software layer and the third software layer are in the same layer, or the first software layer and the second software layer are the lower layers of the third software layer; receiving a first test instruction from the test device for indicating a test of a first test object; in response to receiving the first test instruction, sending the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port. The test method provided based on the present application can improve the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and more specifically, to a testing method, electronic equipment, storage medium and chip. Background Art

[0002] Before electronic devices leave the factory, the manufacturer will test the camera of the electronic device to determine whether the camera of the electronic device passes the test. In actual applications, when the manufacturer tests the camera of the electronic device, the test device usually sends a test instruction to the device to be tested. After the device to be tested receives the test instruction, the device to be tested performs the corresponding operation according to the test instruction. Afterwards, the device to be tested returns the test parameters obtained after executing the operation corresponding to the test instruction to the test device, so that the test device determines whether the camera of the device to be tested passes the test based on the test parameters. When testing the camera of an electronic device based on traditional technology, there is a problem of low test efficiency.

[0003] Therefore, how to improve testing efficiency has become an urgent problem to be solved. Summary of the invention

[0004] The present application provides a testing method, electronic equipment, storage medium and chip, which can improve testing efficiency.

[0005] In a first aspect, the present application provides a testing method, which is applied to a device to be tested, wherein the device to be tested includes a local layer, a kernel layer and a loading layer, and the method includes: during the power-on process of the device to be tested, when a first service in a first software layer of the device to be tested is in a running state and a first file directory is created in a second software layer of the device to be tested, an instruction communication port is created in a third software layer of the device to be tested, and the first service is used to obtain a test parameter associated with a first test object stored in the first file directory, wherein the third software layer is a loading layer, and the first software layer and the second software layer are loading layers, or the third software layer is a kernel layer, the first software layer is a loading layer or a kernel layer, and the second software layer is a loading layer or a kernel layer, or the third software layer is a local layer, the first software layer is a loading layer, a local layer or a kernel layer, and the second software layer is a loading layer, a local layer or a kernel layer; receiving a first test instruction from the test device, the first test instruction is used to instruct to test a first test object of the device to be tested; in response to receiving the first test instruction, sending the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port.

[0006] The device under test includes a local layer, a kernel layer, and a loading layer. When the device under test is powered on, the device under test first runs the loading layer, then runs the kernel layer, and then runs the local layer. Therefore, the loading layer can be called the lower layer of the kernel layer, and the kernel layer is the upper layer of the loading layer. The loading layer can be called the lower layer of the local layer, that is, the local layer is the upper layer of the loading layer. The kernel layer can be called the lower layer of the local layer, that is, the local layer is the upper layer of the kernel layer.

[0007] The third software layer, the second software layer and the first software layer may be the same layer. For example, the third software layer is a loading layer, the first software layer and the second software layer are both loading layers, or the third software layer is a loading layer, the first software layer and the second software layer are both kernel layers, or the third software layer is a loading layer, the first software layer and the second software layer are both local layers.

[0008] The third software layer, the second software layer and the first software layer are not the same layer. The first software layer, the second software layer and the third software layer are not the same layer, which means that the first software layer, the second software layer and the third software layer are all different layers, and the first software layer and the second software layer are the lower layers of the third software layer. For example, the third software layer is a local layer, the first software layer is a loading layer, and the second software layer is a kernel layer. For example, the third software layer is a local layer, the first software layer is a kernel layer, and the second software layer is a loading layer. Or, the first software layer, the second software layer and the third software layer are not the same layer, which means that any two software layers of the first software layer, the second software layer and the third software layer are the same layer, and when the third software layer and the first software layer (or the second software layer) are the same layer, the second software layer (or the first software layer) is the lower layer of the third software layer and the first software layer (or the second software layer), or, when the first software layer and the second software layer are the same layer, the first software layer and the second software layer are the lower layers of the third software layer. For example, the third software layer is a kernel layer, the first software layer is a loading layer, and the second software layer is a loading layer or a kernel layer. For example, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer. For example, the third software layer is the local layer, the first software layer is the loading layer, and the second software layer is the loading layer or the local layer. For example, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer. For example, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the local layer or the kernel layer.

[0009] Exemplarily, taking the device to be tested as an electronic device of the Android system, when the device to be tested is powered on and the device to be tested runs the loading layer, it can be understood that the device to be tested runs the preloading stage or the small system stage after being powered on.

[0010] In the above technical solution, before the device to be tested creates the instruction communication port in the third software layer, the device to be tested has already run the first service in the first software layer, and successfully created the first file directory storing the test parameters in the second software layer. Therefore, after the device to be tested creates the instruction communication port in the third software layer, the instruction communication port of the device to be tested can immediately trigger the relevant operation of obtaining the test parameters from the first file directory through the first service, that is, this method avoids the problem of test failure caused by the failure to successfully run the first service within the preset time after the device to be tested creates the instruction communication port in the traditional technology. In addition, compared with the test method provided by the traditional technology, the instruction communication port in the above test method is created in any one of the loading layer, kernel layer and local layer of the device to be tested, that is, the layer where the instruction communication port is located (for example, the loading layer, kernel layer or local layer) is the layer that runs earlier after the device to be tested is powered on, so this method can improve the test efficiency to a certain extent. In summary, the test method provided in the embodiment of the present application can improve the test efficiency to a certain extent while ensuring the success of the test.

[0011] In one possible implementation, the method also includes: receiving a second test instruction from a test device; in response to receiving the second test instruction, during the power-on process of the device to be tested, running a first service in a first software layer, creating a first file directory in a second software layer, and creating an instruction communication port in a third software layer.

[0012] The second test instruction and the first test instruction may be two instructions sent by the testing device and received by the tested device at the same time, or the second test instruction may be an instruction sent by the testing device and received by the tested device before the tested device receives the first test instruction sent by the testing device, which is not specifically limited.

[0013] In the above technical solution, after receiving the second test instruction from the test device, the device under test triggers the device under test to run the first service in the first software layer, create the first file directory in the second software layer, and create the instruction communication port in the third software layer during power-on.

[0014] Optionally, the device under test may also run the first service in the first software layer, create the first file directory in the second software layer, and create the instruction communication port in the third software layer based on the preset test rules. That is to say, in this implementation, the device under test does not need to receive the second test instruction sent by the test device. During the power-on process of the device under test, the device under test performs the following operations in sequence based on the preset time indicated by the preset test rules: run the first service in the first software layer, create the first file directory in the second software layer, and create the instruction communication port in the third software layer.

[0015] In another possible implementation, the second test instruction includes a first executable file obtained based on the first service, and; in response to receiving the second test instruction, running the first service in the first software layer during the power-on process of the device to be tested, including: in response to receiving the second test instruction, running the first executable file in the first software layer during the power-on process of the device to be tested to run the first service.

[0016] The first executable file is a file carried by the second test instruction sent by the testing device and received by the device under test. The first executable file may be a binary file obtained by compiling the first service by the testing device.

[0017] In the above technical solution, the device to be tested directly runs the first executable file obtained from the test device to run the first service in the first software layer. This method does not require the device to be tested to perform a compilation process to obtain the first executable file, which is beneficial to improve the test efficiency to a certain extent.

[0018] In another possible implementation, the first software layer, the second software layer and the third software layer are loading layers; or, the first software layer, the second software layer and the third software layer are kernel layers; or, the first software layer, the second software layer and the third software layer are local layers; or, the third software layer is the kernel layer, the first software layer is the loading layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer; or, the third software layer is the local layer, the first software layer is the loading layer, and the second software layer is the loading layer, the local layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the loading layer, the local layer or the kernel layer.

[0019] In the above technical scheme, the first software layer running the first service can be any one of the loading layer, local layer and kernel layer of the device to be tested. That is, when the first service is any one of the loading layer, local layer and kernel layer of the device to be tested, the device to be tested can run the first executable file obtained from the test device to enable the first service to run the first service in the corresponding layer (for example, the loading layer, local layer or kernel layer). This method does not require the device to be tested to execute the compilation process to obtain the first executable file, which is beneficial to improve the test efficiency to a certain extent.

[0020] In another possible implementation, the first software layer is a local layer or a kernel layer, and; in response to receiving a second test instruction, during the power-on process of the device to be tested, the first service is run in the first software layer, including: in response to receiving a second test instruction, during the power-on process of the device to be tested, the first service is created in the first software layer and the first service is run.

[0021] The device under test creates the first service and runs the first service in the first software layer, which can be understood as the device under test runs the first service while creating the first service in the first software layer, or can be understood as the device under test first creates the first service in the first software layer and then runs the created first service.

[0022] In the above technical solution, the device to be tested can create the first service and run the first service by itself, which is conducive to improving the flexibility of the testing method.

[0023] In another possible implementation, the first software layer, the second software layer, and the third software layer are kernel layers; or, the first software layer, the second software layer, and the third software layer are local layers; or, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer; or, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the loading layer, the local layer, or the kernel layer.

[0024] In the above technical scheme, the first software layer running the first service can be the local layer or kernel layer of the device to be tested, that is, when the first service is the local layer or kernel layer of the device to be tested, the device to be tested can execute the process of creating the first service and running the first service by itself, so that the first service is run in the first software layer, that is, the method can also set the first service in the local layer or kernel layer as needed, which is conducive to improving the flexibility of the testing method.

[0025] In another possible implementation, the device to be tested also includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, and; during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, an instruction communication port is created in the third software layer of the device to be tested, including: during the power-on process of the device to be tested, when the first service in the first software layer is in a running state and a first file directory is created in the second software layer, the port The port creation module creates an instruction communication port in the third software layer; receives a first test instruction from the test device, including: the instruction parsing module receives the first test instruction from the test device through the first communication module; the instruction parsing module sends the parsed first test instruction to the instruction communication port; in response to receiving the first test instruction, the test parameters obtained by the first service from the first file directory are sent to the test device through the instruction communication port, including: in response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; the instruction parsing module sends the test parameters to the test device through the first communication module.

[0026] In another possible implementation, the device to be tested also includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, the loading layer includes a pattern recognition module, and; during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, an instruction communication port is created in the third software layer of the device to be tested, including: during the power-on process of the device to be tested, when the first service in the first software layer is in a running state and a first file directory is created in the second software layer, the port creation module creates an instruction communication port in the third software layer; receiving a first test instruction from the test device, including: the instruction parsing module receives the first test instruction from the test device through the first communication module; the instruction parsing module sends the parsed first test instruction to the instruction communication port; in response to receiving the first test instruction, The test parameters obtained by the first service from the first file directory are sent to the test device through the instruction communication port, including: in response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; the instruction parsing module sends the test parameters to the test device through the first communication module; receiving the second test instruction from the test device, including: the pattern recognition module receives the second test instruction from the test device; in response to receiving the second test instruction, during the power-on process of the device to be tested, the first service is run in the first software layer, the first file directory is created in the second software layer, and the instruction communication port is created in the third software layer, including: in response to receiving the second test instruction, during the power-on process of the device to be tested, the pattern recognition module triggers the service module to run the first service in the first software layer according to the parsed second test instruction, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer.

[0027] In another possible implementation, the second software layer is a loading layer, and the first file directory is created in the first partition of the virtual memory of the second software layer; and; the method also includes: when the first file directory is created in the first partition, setting a kernel lock on the first partition so that the first file directory of the device to be tested after restarting stores test parameters.

[0028] In the case where the second software layer is a loading layer, the first partition may be referred to as a system partition.

[0029] In the above technical solution, after the first partition creates the first file directory storing the test parameters, a kernel lock is set for the first file directory, so that it can be ensured that the first file directory storing the test parameters still exists in the second software layer after the device to be tested is restarted, that is, the first file directory is not erased. This method can avoid the problem of losing the first file directory in the first partition after the device to be tested is restarted, which is conducive to improving the test efficiency of the device to be tested executing the test method again.

[0030] In another possible implementation manner, the first test object is a camera of the device to be tested, and the test parameter includes a serial number of the camera.

[0031] In a second aspect, the present application provides a testing device, comprising a processing unit for executing any one of the testing methods in the first aspect.

[0032] In a third aspect, the present application provides an electronic device, comprising a unit for executing any one of the test methods in the first aspect. The electronic device may be a terminal device or a chip in the terminal device. The electronic device may include an input unit and a processing unit.

[0033] When the electronic device is a terminal device, the processing unit may be a processor, and the input unit may be a communication interface; the terminal device may also include a memory, which is used to store computer program code. When the processor executes the computer program code stored in the memory, the terminal device executes any one of the test methods in the first aspect above.

[0034] When the electronic device is a chip in a terminal device, the processing unit may be a processing unit inside the chip, and the input unit may be an output interface, a pin or a circuit, etc.; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the test methods in the first aspect above.

[0035] In one possible implementation, a memory is used to store computer program code; a processor executes the computer program code stored in the memory, and when the computer program code stored in the memory is executed, the processor is used to execute any one of the test methods in the first aspect above.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program code. When the computer program code is executed by an electronic device, the electronic device executes any one of the test methods in the first aspect.

[0037] In a fifth aspect, the present application provides a computer program product, which includes: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the test methods in the first aspect.

[0038] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0039] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic diagram of an application scenario of the test method provided in an embodiment of the present application.

[0041] Figure 2 It is a schematic diagram of testing a user version of a device to be tested provided in the traditional technology.

[0042] Figure 3 It is a schematic diagram of testing a traditional factory version of a device to be tested provided in a traditional technology.

[0043] Figure 4 It is a schematic diagram of a software architecture of a device to be tested provided in an embodiment of the present application.

[0044] Figure 5 It is a schematic diagram of a testing method provided in an embodiment of the present application.

[0045] Figure 6It is a schematic diagram comparing the test efficiency of a test method provided by an embodiment of the present application with the test efficiency of a test method provided by a traditional technology.

[0046] Figure 7 It is a schematic diagram of a software architecture of a device to be tested provided in an embodiment of the present application.

[0047] Figure 8 It is a schematic diagram of a testing method provided in an embodiment of the present application.

[0048] Fig. 9 It is a schematic diagram of a software architecture of a device to be tested provided in an embodiment of the present application.

[0049] Fig.10 It is a schematic diagram of a testing method provided in an embodiment of the present application.

[0050] Fig.11 It is a schematic diagram of a testing method provided in an embodiment of the present application.

[0051] Fig.12 is the above Fig.11 Schematic diagram of the test flow corresponding to Case 2 in the provided test method.

[0052] Fig.13 It is a schematic diagram of a testing method provided in an embodiment of the present application.

[0053] Fig.14 It is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0055] The terms "first", "second", etc. in the specification, claims and drawings of this application are used to distinguish different objects, and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the definition of "first" or "second" features may explicitly or implicitly include one or more of the features.

[0056] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0057] In the embodiments of the present application, "factory mode" is also called "factory version", "test factory version", "test version" or "simple version"; "user mode" is also called "user version" or "normal version".

[0058] First, the relevant terms involved in the embodiments of the present application are introduced.

[0059] The boot process of an Android electronic device (e.g., a mobile phone or tablet) is a multi-stage process involving the initialization of multiple software and hardware components. Exemplarily, the boot process of an Android electronic device may include the following five stages: (1) Bootrom stage. When the power is turned on, the bootrom in the chip is activated, responsible for initializing basic hardware settings and loading the preloader into the internal static random access memory (SRAM), because the external random access memory (RAM) has not yet been initialized. (2) Preloader stage. The preloader is executed in the internal SRAM and is responsible for initializing the external RAM and other hardware components, such as the universal asynchronous receiver transmitter (UART), timer, real-time clock (RTC), memory, and power management integrated circuit (PMIC). In addition, the preloader also performs battery checks and safety checks to prepare for jumping to the next stage. (3) Little kernel (LK) stage. After the preloader completes the hardware initialization, LK (a simplified version of the Linux kernel) is loaded and begins to execute. LK is responsible for initializing more hardware components, such as the memory management unit (MMU), cache, etc., and creating an environment for subsequent user space programs (such as the Android system). (4) Kernel (linux kernel) stage. After LK completes its task, control is handed over to the Linux kernel, which is responsible for further initialization and settings of the system, including mounting the file system, starting the initialization (initialization, referred to as init) process, etc. (5) User space (userspace) stage. After the Linux kernel completes the system settings, it begins to search for and start the init process in the system files. The init process is responsible for parsing the rc script, starting services such as zygote and mediaserver, and completing the system startup.

[0060] Before an electronic device (such as a mobile phone or tablet computer) leaves the factory, the manufacturer will test the camera in the electronic device to determine whether the camera of the electronic device meets the specified reliability indicators. Generally speaking, the system version of an electronic device is a factory version or a user version. The difference between a factory version of an electronic device and a user version of an electronic device mainly lies in the difference in their software configurations. Specifically, the factory version is a version used for internal testing by the manufacturer. Compared to the user version, it usually contains more testing tools, debugging information, and higher stability and reliability to ensure that the product meets high quality standards before release. The user version is the final version for consumers. It usually contains more functions and features, but there may be some minor problems or vulnerabilities. In addition, the user version will include some applications and services that users like.

[0061] When manufacturers test the camera of electronic equipment, the test equipment usually sends a test instruction to the device under test. After the device under test receives the test instruction, it performs the corresponding operation according to the test instruction. After that, the device under test returns the test result obtained after executing the operation corresponding to the test instruction to the test equipment.

[0062] For example, Figure 1 Schematic diagram of an application scenario of the test method provided in the embodiment of the present application. Figure 1 The application scenario shown includes at least one device to be tested 101 and at least one test device 102. The device to be tested 101 is connected to the test device 102 via a wireless connection (e.g., wireless fidelity (WIFI) connection) or via a wired connection (e.g., universal serial bus (USB) connection).

[0063] exist Figure 1In the test scenario shown, in response to the device to be tested 101 being powered on, the test device 102 sends a camera test instruction to the device to be tested 101. The device to be tested 101 obtains the camera parameters requested by the camera test instruction based on the camera test instruction and performs corresponding operations, and sends the camera parameters to the test device 102. The test device 102 that receives the camera parameters can make a judgment based on the camera parameters to determine whether the camera of the device to be tested 101 requested to be tested by the camera test instruction passes the test. The above-mentioned camera parameters may include the serial number (SN) of the camera. The test device 102 determines whether the camera in the device to be tested 101 passes the test based on the camera parameters obtained from the device to be tested 101 and the preset camera parameters (i.e., the preset SN) stored in the test device 102. Specifically, if the test device 102 determines that the SN obtained from the device to be tested and the preset camera parameters stored in the test device 102 are the same, it is determined that the camera in the device to be tested 101 has passed the test; if the test device 102 determines that the SN obtained from the device to be tested and the preset camera parameters stored in the test device 102 are different, it is determined that the camera in the device to be tested 101 has not passed the test.

[0064] The triggering condition for powering on the device under test 101 is not specifically limited. For example, the user presses the power button of the device under test 101 in the off state to make the device under test 101 in the off state perform the power-on operation. For example, in response to the test device 102 in the on state and the device under test 101 in the off state being connected via USB, the device under test 101 is triggered to perform the power-on operation.

[0065] The type of the device to be tested 101 and the type of the test device 102 are not specifically limited. The device to be tested 101 may be at least one of a tablet computer, a smart phone, a desktop computer, an augmented reality (AR) / virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a personal digital assistant (PDA), a vehicle-mounted device, and a laptop computer. The device to be tested 101 may generally refer to one of a plurality of terminals, or a collection of a plurality of terminals. The test device 102 may be at least one of a computing device, a plurality of computing devices, a cloud computing platform, and a virtualization center.

[0066] For example, in some specific test scenarios, Figure 1The device to be tested 101 shown may be a smart phone, and the test device 102 may be a computer.

[0067] It should be understood that the above Figure 1 The application scenarios shown are for illustration only and do not constitute any limitation on the application scenarios to which the test method provided in the embodiments of the present application is applicable. Figure 1 The application scenario shown may also include a greater number of devices to be tested 101 and a greater number of test devices 102. The multiple test devices 102 may correspond one-to-one to the multiple devices to be tested 101. Each test device 102 is connected to the corresponding device to be tested to implement the test method provided in the embodiment of the present application.

[0068] The following is the above Figure 1 As an example, the application scenario shown in Figure 2 The following describes a test process for testing a user version of an electronic device provided by conventional technology. For example, Figure 2 The device under test shown can be the above Figure 1 The device to be tested 101 shown in the figure may be the above-mentioned Figure 1 A testing device 102 is shown.

[0069] Figure 2 It is a schematic diagram of testing a user version of a device to be tested provided in the traditional technology.

[0070] For example, Figure 2 As shown, the test device includes a serial port wizard module, which can interact with the USB driver module or WIFI driver module in the device to be tested for data (for example, test instructions or camera parameters requested by the test instructions). Figure 2 The test equipment shown is the above Figure 1 One example of a test device 102 is shown.

[0071] like Figure 2 As shown in the figure, the software system of the device under test includes the application layer, the application framework layer, the native layer, the Linux kernel layer, the loader layer (also known as the loading layer), the power management module and the user space. The user space is also known as the vendor partition of the system, that is, the user space refers to the vendor partition of the system.

[0072] The application layer may include a series of application packages. For example, the application package may include applications such as camera, gallery, chat, voice assistant, call, map, Bluetooth, video, etc. Each application may be used to generate application data, for example, gallery is used to generate photo data. For example, the camera is used to capture an object to be captured to obtain an image.

[0073] The application framework layer includes an instruction communication port creation module, wherein the instruction communication port creation module is used to establish an instruction communication port in the application framework layer 40 seconds after the device under test is powered on, and the instruction communication port is used to interact with the instruction parsing service module in the user space. The instruction parsing service module can be an instruction cache memory (addres tagged cache memory, ATCM) in the device under test, based on which, the instruction parsing service module can also be called an atcmserver module. The instruction communication port can be a PCUI port in the Android system, based on which, the instruction communication port is also called a PCUI port, and the instruction communication port creation module is also called a PCUI port creation module. Optionally, Figure 2 The application framework layer shown may also include a window manager, a notification manager, an activity manager, an input manager, a view system, a content provider, a resource manager, and the like.

[0074] The local layer includes an initialization (init) process module, where the init process module is used to create a camera hardware abstraction layer (camerahal) service in the local layer 30 seconds after the device under test is powered on. The camerahal service is a service that the camera test in the device under test relies on. Optionally, the local layer can also include modules such as the Android Runtime.

[0075] The kernel layer includes a data partition mounting module, wherein the data partition mounting module is used to mount (i.e. create) a camera file directory (also known as a camera node) in the data partition of the physical memory of the kernel layer 30 seconds after the device to be tested is powered on, and the created camera file directory stores the camera parameters requested by the camera test instruction. It can be understood that the data partition is a partition in the physical memory of the kernel layer. Optionally, the kernel layer may also include drivers (e.g., display drivers, camera drivers, and Bluetooth drivers, etc.).

[0076] The loading layer includes the preloading module, which is the boot program before starting the Android system. It mainly checks RAM, initializes hardware parameters and other functions.

[0077] The power management module includes the bootrom module. After the chip of the device under test is powered on, the device under test will first enter the bootrom stage. The bootrom module is a ROM solidified inside the chip, which is used to start and initialize the software system of the device under test. The bootrom module usually contains some pre-written codes to complete the basic initialization and configuration before the system starts, such as initializing the clock, general-purpose input / output (GPIO) controller, interrupt controller, storage device and other hardware resources, detecting the boot device, loading the boot program from the boot device, etc.

[0078] Figure 2 The interaction steps between the modules of the device under test and the modules of the test device can be seen in Figure 2The arrow shown, that is, the process of testing the user version of the device to be tested in the conventional technology is as follows: in response to the bootrom module in the loading layer of the device to be tested being powered on. On the one hand, in response to the 25th second after the device to be tested is powered on, the data partition mounting module of the kernel layer creates a camera file directory in the data partition of the kernel layer. In response to the 30th second after the device to be tested is powered on, the init process module of the local layer creates a camerahal service in the local layer. In response to the 40th second after the device to be tested is powered on, the instruction communication port creation module in the application framework layer creates an instruction communication port in the application framework layer. On the other hand, in response to the device to be tested being powered on, the serial port wizard module of the test device sends a camera test instruction to the USB driver module or the WIFI driver module in the user space of the device to be tested. The USB driver module or the WIFI driver module sends the acquired camera test instruction to the instruction parsing service in the user space. Afterwards, the instruction parsing service module parses the camera test instruction and learns that the camera of the device to be tested needs to be tested. Based on this, the instruction parsing service module sends a camera test instruction to the application framework layer of the device to be tested. It should be emphasized that the moment when the instruction parsing service module sends the camera test instruction to the application framework layer of the device to be tested is earlier than the moment when the instruction communication port creation module establishes the instruction communication port. Since the instruction communication port is established about 40 seconds after the device to be tested is turned on, that is to say, the earliest moment when the instruction communication port can receive the camera test instruction sent by the instruction parsing service module is about 40 seconds after the device to be tested is turned on. It can be understood that the above two conveniently described schemes are executed in parallel. Thereafter, the camerahal service of the device to be tested can access the camera file directory of the data partition located in the kernel layer to obtain the camera parameters, and the camerahal service sends the obtained camera parameters to the instruction parsing service module in the user space through the instruction communication port. The instruction parsing service module returns the camera parameters to the serial port wizard module of the test device through the USB driver module or the WIFI driver module. Afterwards, the test device determines whether the camera of the device to be tested passes the test by comparing whether the camera parameters obtained from the serial port wizard module are consistent with the predefined SN pre-stored in the test device.

[0079] In the above-mentioned traditional technology for testing the user version of electronic devices, since the command communication port is established about 40 seconds after the device to be tested is powered on, based on this, the device to be tested can only access the camera file directory 40 seconds after the device to be tested is powered on. That is, the method for testing the user version of the device to be tested in the traditional technology has the problems of long testing time and low testing efficiency.

[0080] The following is the above Figure 1As an example, the application scenario shown in Figure 3 Introducing the test process provided by conventional technology for testing conventional factory versions of electronic equipment. It can be understood that Figure 3 The device under test shown can be the above Figure 1 The device to be tested 101 shown in the figure may be the above-mentioned Figure 1 A testing device 102 is shown.

[0081] Figure 3 It is a schematic diagram of testing a traditional factory version of a device to be tested provided in a traditional technology.

[0082] contrast Figure 2 and Figure 3 It can be seen that Figure 3 The test equipment shown above Figure 2 The test equipment shown is the same as Figure 3 The device under test and Figure 2 There are differences in the devices to be tested. Specifically, Figure 3 The instruction communication port creation module of the device under test is located in the kernel layer of the device under test. Figure 2 The instruction communication port creation module of the device under test is shown to be located in the application framework layer of the device under test.

[0083] Based on this, Figure 3 The conventional factory version of the DUT is shown when tested with the above Figure 2 The difference shown when testing the user version of the device under test is that Figure 3 In the test method shown, at the 15th second after the device to be tested is powered on, the instruction communication port creation module creates the instruction communication port in the kernel layer. Afterwards, at the 25th second after the device to be tested is powered on, the data partition mounting module of the kernel layer creates a camera file directory in the data partition of the kernel layer, and the data partition is a partition in the physical memory of the kernel layer. Afterwards, at the 30th second after the test device is powered on, the init process module of the local layer creates a camerahal service in the local layer, and the created camerahal service is in the pulled-up state.

[0084] It can be seen that since the command communication port is established about 15 seconds after the device to be tested is powered on, and the camera file directory is established about 25 seconds after the device to be tested is powered on, the device to be tested can only perform camera item testing (i.e., access the camera file directory to obtain camera parameters, and send the camera parameters to the command parsing service module through the command communication port) 10 seconds after the command communication port is created. However, in actual applications, the production line requires that the above-mentioned camera item test be performed within 3 seconds after the command communication port is established. Therefore, the above-mentioned method for testing the traditional factory version of the device to be tested is difficult to meet the requirements of the actual production line. In addition, the camerahal service on which the above-mentioned camera file directory depends is not pulled up until the camera file directory is created, which causes a timing disorder problem, resulting in failure during the testing of the traditional factory version of the device to be tested.

[0085] Therefore, in order to solve the above problems, the applicant found that in order to successfully implement the camera test of the device to be tested, it is necessary to complete the creation of the camera file directory and the start-up of the camera service before creating the command communication port in the device to be tested. In order to improve the test efficiency, the applicant found that the command communication port can be set in any layer of the local layer, kernel layer and loading layer of the device to be tested. Since the running time of the local layer, kernel layer or loading layer of the device to be tested during the power-on process of the device to be tested is earlier than the running time of the application framework layer, the moment of creating the command communication port in any layer of the local layer, kernel layer and loading layer of the device to be tested is earlier than the moment of creating the command communication port in the application framework layer provided by the traditional technology, so that the moment of creating the command communication port can be advanced. In summary, the applicant proposes a test method, the inventive concept of which includes: creating a command communication port in any layer of the local layer, kernel layer and loading layer of the device to be tested, and it is necessary to ensure that the camera file directory is created and the camera service is started (i.e., running) before the command communication port is created, that is, at the moment of creating the command communication port, the camera file directory has been successfully created and the camera service is already in a running state, thereby improving the test efficiency. Based on this, the camera service of the device to be tested in the test method provided in the embodiment of the present application, the camera file directory and the command communication port can be located in the device to be tested, as shown in Table 1 below.

[0086]

[0087] Exemplarily, taking the scheme 1 shown in Table 1 above as an example, the system partition mounting module and the camera service pull-up module are set to the loading layer of the device to be tested, and the instruction port creation module is set to the kernel layer of the device to be tested. Similarly, the devices to be tested shown in schemes 2 to 14 shown in Table 1 above can refer to the understanding of scheme 1, and will not be described in detail here.

[0088] The software architecture of the device to be tested provided by the embodiment of the present application, and the test method corresponding to the software architecture of the device to be tested are described in detail below in conjunction with the accompanying drawings. It should be understood that the software architecture (i.e., software architecture one to software architecture three) provided below is only for illustration, and the test method embodiments corresponding to the software architecture (i.e., embodiment one to embodiment three) are also only for illustration, and do not constitute any limitation on the software architecture and test method of the device to be tested in the test method provided by the present application. It can be understood that the device to be tested in the software architecture one below corresponds to the device to be tested in scheme 1 in Table 1 above, the device to be tested in the software architecture two below corresponds to the device to be tested in scheme 5 in Table 1 above, and the device to be tested in the software architecture three below corresponds to the device to be tested in scheme 8 in Table 1 above. The software architectures corresponding to Scheme 2, Scheme 3, Scheme 4, Scheme 6, Scheme 7, Scheme 9 to Scheme 14 in Table 1 above, which are not shown below, can be derived through simple reasoning based on software architecture 1 to software architecture 3 shown below, that is, the software architectures corresponding to these schemes (i.e., Scheme 2, Scheme 3, Scheme 4, Scheme 6, Scheme 7, Scheme 9 to Scheme 14) will not be described in detail below.

[0089] Software architecture 1, the instruction communication port creation module and the kernel layer of the software architecture of the device to be tested, the camera service pull-up module and the system partition mounting module are located in the loading layer of the software architecture of the device to be tested.

[0090] The following is the above Figure 1 As an example, the application scenario shown in Figure 4 Introducing the software architecture of the factory version of the device to be tested provided by this application. It should be noted that the factory version of the device to be tested provided by this application is also called the new factory version of the device to be tested, that is, the two descriptions below have the same meaning and will not be emphasized below. For example, Figure 4 The device under test shown can be the above Figure 1 A device to be tested 101 in an application scenario is shown.

[0091] Figure 4 Schematic diagram of the software architecture of the factory version of the device to be tested provided in the embodiment of the present application. It can be understood that Figure 4 The interaction steps between the modules are shown below Figure 5 Some of the steps in the test method provided are Figure 5Some steps in the test method provided are not in Figure 4 Shown in.

[0092] For example, Figure 4 As shown, the software system of the device under test includes the application layer, application framework layer, native layer, Linux kernel layer, loader layer (also known as loading layer), power management module and user space. User space is also called the vendor partition of the system.

[0093] The application layer may include a series of application packages. For example, the application package may include applications such as camera, gallery, chat, image processing software, video, voice assistant, clipping, call, map, navigation, calendar, Bluetooth, music, etc. Each of the above applications may be used to generate application data, and each of the above applications may include more specific functional modules. For example, a camera may include a camera module, which is used to capture an object to obtain an image.

[0094] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 4 As shown, the application framework layer may include a window manager, a notification manager, an activity manager, an input manager, a view system, a content provider, a resource manager, and the like.

[0095] The native layer includes the surface manager, media framework, Android Runtime, etc. The Android Runtime includes the core library and the virtual machine. Android Runtime is responsible for the scheduling and management of the Android system. The core library consists of two parts: one part is the function that needs to be called by the programming language (for example, Java language), and the other part is the core library of Android. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the programming files (for example, Java files) of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection. Optionally, the native layer can also include the C standard library (libc), embedded relational database (for example, SQLite), open graphics library for embedded systems (OpenGL ES), etc.

[0096] The kernel layer is the foundation of the Android operating system. The final functions of the Android operating system are completed through the kernel layer. The kernel layer includes the instruction communication port creation module, which is used to create the instruction communication port. The kernel layer can also include various drivers ( Figure 4 (not shown in the figure), such as display driver, audio driver, camera driver and Bluetooth driver.

[0097] The loading layer is the software layer that runs first after the device under test is powered on, that is, the loading layer runs before the kernel layer. Figure 4 As shown, the loading layer includes a pattern recognition module, a camera service pull-up module, and a system partition mounting module. After the device to be tested is powered on, the execution order of each module in the loading layer is: pattern recognition module, camera service pull-up module, and system partition mounting module.

[0098] The power management module includes the bootrom module. After the chip of the device under test is powered on, the device under test will first enter the bootrom stage. The bootrom module is a ROM solidified inside the chip, which is used to start and initialize the software system of the device under test. The bootrom module usually contains some pre-written codes to complete the basic initialization and configuration before the system starts, such as initializing the clock, general-purpose input / output (GPIO) controller, interrupt controller, storage device and other hardware resources, detecting the boot device, loading the boot program from the boot device, etc.

[0099] The pattern recognition module is used to obtain the instructions (for example, the following Figure 5 or Fig.10 Instructions A in the test method provided, Figure 8 Instruction B in the test method provided or Fig.13 The second test instruction in the test method provided) determines which version (for example, the factory version or the user version provided in this application) the device to be tested needs to be tested based on after the device to be tested is powered on. After that, the pattern recognition module triggers the device to be tested to execute the test process of the corresponding version based on the determined version. Optionally, the pattern recognition module is also used to obtain the target binary file (for example, the following Figure 5 or Fig.10 The binary file #1 in the provided test method, or below Fig.13 The first executable file in the method provided is sent to the camera service launch module so that the camera service launch module runs the target binary file. It should be emphasized that the above-mentioned target binary file is compiled by the test device that communicates with the device to be tested, and the device to be tested obtains the target binary file by interacting with the device to be tested. The above-mentioned target binary file can be a file carried in instruction B, or the target binary file is not a file carried in instruction B, which is not specifically limited.

[0100] Optionally, the above-mentioned device to be tested may not include a pattern recognition module. In this implementation, at a preset time after the device to be tested is powered on, the camera service pull-up module, the system partition mounting module and the instruction communication port establishment module in the device to be tested respectively perform corresponding creation operations.

[0101] The camera service launch module is used to run the acquired target binary file (for example, the following Figure 5 , Fig.10 or Fig.11 Binary file #1 in the provided test method, or Fig.13The first executable file in the test method provided) causes the camera service associated with the target binary file to be pulled up. The camera service associated with the target binary file includes the camerahal service and various services that the camerahal service depends on. Exemplarily, the various services that the camerahal service depends on may include, but are not limited to, one or more of the following services: uvent service, apexd service, or power service, etc.

[0102] The system partition mounting module is used to create a camera file directory in the system partition of the loading layer, and the created camera file directory stores camera parameters, which may include the camera SN. It can be understood that the system partition of the loading layer is a partition in the virtual memory of the loading layer.

[0103] The user space includes an instruction parsing service module and a first communication module. The instruction parsing service module can also be called an atcmserver module. The instruction parsing service module and the first communication module can exchange data. For example, the first communication module sends a test instruction to the instruction parsing service module (for example, Figure 5 , Figure 8 or Fig.10 The camera test instructions in the provided test method, or below Fig.13 The first test instruction in the test method provided, the instruction parsing service module sends a test parameter to the first communication module (for example, the following Figure 5 , Figure 8 or Fig.10 The camera parameters in the test method provided, or below Fig.13 The first communication module may also perform data exchange with the second communication module of the test device, for example, the second communication module sends a test instruction to the first communication module, and the first communication module sends a test parameter to the second communication module.

[0104] It should be noted that the above Figure 4 The device under test shown is a factory version, i.e. Figure 4 The device under test shown is the above Figure 2 The simplified version of the user version of the device to be tested is shown. It is understandable that all services in the user version of the device to be tested (such as the camerahal service mentioned above and the various services that the camerahal service depends on) are nested and interdependent. These services cannot be moved forward at will. For example, the camerahal service also has other dependencies, and the services after the camerahal service also depend on it, so adjustments will cause the camerahal service to be unusable. Figure 4The factory version of the device under test shown is a simple version, that is, many functions of the factory version of the device under test can be customized (for example, creating a camera file directory in the system partition of the loading layer, running camera services in the loading layer, etc.), and it is only necessary to ensure that the factory version of the device under test can implement camera-related tests. Figure 4 In the factory version of the device under test shown, in order to avoid system partition memory overflow, the relevant services in the system partition that are not related to the test method can also be moved to the data partition (ie, physical memory) of the device under test that starts slower.

[0105] It should be noted that the application provides Figure 4 The software architecture diagram of the device to be tested is only an example and does not limit the specific module division in different layers of the Android operating system. For details, please refer to the introduction of the Android operating system software structure in conventional technology. In addition, the device to be tested provided by this application can also be implemented based on other operating systems (for example, IOS or Hongmeng, etc.), and this application will not give examples one by one.

[0106] It should also be noted that the above Figure 4 As an example, only some modules of the software system that are closely related to the test method proposed in this application are shown. In actual applications, according to the needs of production testing or factory use, the software architecture may include more Figure 4 More or fewer modules. For example, the application layer of the factory version of the device to be tested provided by this application may also include a power on / off application, and the application framework layer may also include a resource manager for providing various resources (such as localized strings, icons, pictures, layout files, video files, etc.) to the application, and this embodiment of the application does not impose any limitation on this.

[0107] Embodiment 1, a testing method based on software architecture 1.

[0108] Based on the above-mentioned Figure 4 The software architecture shown is combined with Figure 5 The modular interaction steps involved in the test method provided in the embodiment of the present application are described in detail. It can be understood that: Figure 4 The steps shown are Figure 5 Some steps of the test method are shown.

[0109] Figure 5 is a schematic diagram of a test method provided in an embodiment of the present application. It can be understood that, Figure 5 The software architecture of the device A to be tested is shown as above Figure 4 The software architecture of the device under test is shown. Figure 5 The software architecture of the test device A shown above is Figure 5 The software architecture of the test equipment is shown. Figure 5 The device A to be tested shown may be, but is not limited to, Figure 1 In the application scenario shown, the device to be tested 101, the test device A can be but is not limited to Figure 1 The test device 102 in the application scenario shown. Figure 5 As shown, the test method provided in the embodiment of the present application may include steps S501 to S515. Steps S501 to S515 are described in detail below.

[0110] In step S501, the compiling module in the test device A executes the compiling process to obtain a binary file #1.

[0111] Binary file #1 refers to a binary file compiled and generated by the camerahal service and the various services on which the camerahal service depends. It can be understood that the various services on which the camerahal service depends are various services used to ensure the normal operation of the camerahal service. In the embodiment of the present application, the various services on which the camerahal service depends are not specifically limited and can be set according to actual conditions. For example, the various services on which the camerahal service depends may include, but are not limited to, one or more of the following services: uvent service, apexd service, or power service, etc.

[0112] In the embodiment of the present application, the compilation module may also be referred to as a "packetization module".

[0113] In step S502 , the compiling module in the test device A sends the binary file # 1 to the mode setting module in the test device A.

[0114] After executing the above step S502, the mode setting module receives the binary file #1 sent by the compiling module accordingly.

[0115] Exemplarily, the mode setting module may be, but is not limited to, an ATA tool.

[0116] The compiling module and the mode setting module in the above step S501 and step S502 may be the same module or two different modules in the test device A, and this embodiment of the present application does not specifically limit this.

[0117] In the embodiment of the present application, when the testing device A completes the execution of the above steps S501 and S502, the device A to be tested is in a shutdown state.

[0118] In step S503, in response to the device A to be tested being powered on, the mode setting module in the test device A sends instruction A to the mode recognition module in the loading layer of the device to be tested, and the instruction A carries the binary file #1.

[0119] The above step S503 is performed when the device A to be tested is in a powered-on state. In the embodiment of the present application, the triggering condition for the power-on of the device A to be tested is not specifically limited. For example, the user presses the power button of the device A to be tested in the powered-off state to make the device A to be tested in the powered-off state perform the power-on operation. For example, in response to the test device A in the powered-on state and the device A to be tested in the powered-off state being connected via USB, the device A to be tested is triggered to perform the power-on operation.

[0120] Instruction A is used to instruct the device A to be tested to execute a process of testing the factory version of the device A to be tested provided by this application after it is powered on. Instruction A can carry a binary file #1.

[0121] It should be emphasized that in the embodiment of the present application, when the pattern recognition module receives instruction A, the device A to be tested is in the preloading or small system operation stage. It should also be understood that the operations of the loading layer of the device A to be tested are all operations performed when the device A to be tested is in the preloading or small system operation stage.

[0122] In step S504, the second communication module in the test device A sends a camera test instruction to the first communication module in the user space of the device A to be tested.

[0123] After executing the above step S504, the first communication module receives the camera test instruction sent by the serial port wizard module. The first communication module can be a USB driver module or a WIFI driver module in the user space of the device A to be tested.

[0124] The camera test instruction is used to request to test the camera of the device A to be tested.

[0125] In step S505 , the first communication module in the user space of the device A to be tested sends a camera test instruction to the instruction parsing service module located in the user space of the device A to be tested.

[0126] After executing the above step S505, correspondingly, the instruction parsing service module receives the camera test instruction sent by the first communication module.

[0127] In step S506 , after the mode recognition module in the loading layer of the device A to be tested receives the mode instruction A, the mode recognition module sends the binary file # 1 to the camera service launching module in the loading layer of the device A to be tested.

[0128] In the embodiment of the present application, after receiving instruction A, the pattern recognition module knows that the factory version of the device to be tested provided by the present application (for example, the software architecture of the device to be tested A is Figure 4 or Figure 5 Based on this, the pattern recognition module will actively send binary file #1 to the camera service pull-up module to trigger subsequent processes (i.e., the process of pulling up the service associated with binary file #1, the process of creating a camera file directory and the process of creating an instruction communication port), that is, the pattern recognition module sends binary file #1 to trigger the execution of steps S507, S508 and S509 below.

[0129] After executing the above step S506, the camera service launching module receives the binary file #1 sent by the pattern recognition module.

[0130] In step S507 , the camera service launching module in the loading layer of the device A to be tested runs the binary file # 1 to launch the service associated with the binary file # 1 .

[0131] In the embodiment of the present application, after executing the above step S507, the service associated with the binary file #1 is in the started state (ie, running state).

[0132] In step S508 , at the 10th second after the device A to be tested is powered on, the system partition mounting module in the loading layer of the device A to be tested creates a camera file directory in the system partition of the loading layer.

[0133] In the above step S508, the device A under test creates a camera file directory in the system partition located in the loading layer, which can be understood as the device A under test mounting a camera node in the system partition located in the loading layer. In the embodiment of the present application, the camera file directory is also called a "camera node".

[0134] In the embodiment of the present application, the moment when the device A to be tested performs the power-on operation is the 0th second. Based on this, the 10th second after the device A to be tested is powered on refers to the moment 10 seconds after the device A to be tested is powered on. Similarly, the understanding of a certain moment after the device A to be tested is powered on is the same as here, and it will not be emphasized in the following. It should be emphasized that in the case of the 10th second after the device A to be tested is powered on, the device A to be tested is in the preloader / lk operation stage.

[0135] The system partition of the loading layer is a logical partition. Specifically, the system partition is a partition located in the virtual memory of the loading layer. The startup time of the system partition of the loading layer is earlier than the startup time of the data partition of the kernel layer. The data partition of the kernel layer can be a physical partition. The startup time of the system partition refers to the time when the system partition of the device A to be tested starts to start after the device A to be tested and the test device A are connected via USB and the device A to be tested is powered on. The startup time of the data partition refers to the time when the data partition of the device A to be tested starts to start after the device A to be tested is powered on.

[0136] Execute the above step S508, that is, at the 10th second after the device A to be tested is powered on, the device A to be tested creates a camera file directory in the system partition located in the loading layer, including: in response to the 10th second after the device A to be tested is powered on, the device A to be tested creates a camera file directory in the system partition located in the loading layer.

[0137] Exemplarily, in an embodiment of the present application, the startup time of the system partition may be about 10 seconds after the device A to be tested is powered on, and the startup time of the system partition may be about 25 seconds after the device A to be tested is powered on.

[0138] After the device A to be tested creates a camera file directory in the system partition of the loading layer, the created camera file directory stores camera parameters, which may include the SN of the camera.

[0139] It can be understood that after the device A to be tested executes the above step S508, a camera file directory is stored in the system partition of the loading layer of the device A to be tested. Since the system partition in the loading layer is a logical partition, if the camera file directory is created on the system partition, if the device A to be tested performs a shutdown operation and then performs a power-on operation, the camera file directory created in the system partition will disappear (i.e., be deleted). In this way, when the factory version of the device A to be tested provided by this application is repeatedly executed multiple times, the device A to be tested needs to execute the above step S508 each time the test is performed, that is, the device A to be tested needs to repeat the step S508 multiple times, and the implementation steps are too redundant. In order to solve this problem, in other implementations, after the device A to be tested executes the above step S508, the device A to be tested can also perform the following steps: in response to the device A to be tested creating a camera file directory in the system partition located in the loading layer, a kernel lock function is added to the camera file directory in the system partition, wherein the kernel lock function is used to ensure that the camera file directory is not erased when the device to be tested loses power. That is to say, in the implementation method of introducing the kernel lock mechanism, after the device A to be tested executes the shutdown operation and then executes the startup operation, the camera file directory is still stored in the system partition of the device A to be tested. This method can avoid the problem of losing the camera file directory in the system partition after the device A to be tested is started again, thereby improving the test efficiency of the next time the device A to be tested executes the test method.

[0140] It should be noted that after the user performs a flash operation on the device A to be tested, the camera file directory in the system partition of the loading layer of the device A to be tested can be erased. After that, the system partition of the loading layer of the device A to be tested does not include the camera file directory.

[0141] In step S509 , at 15 seconds after the device A to be tested is powered on, the instruction communication port creation module in the kernel layer of the device A to be tested creates an instruction communication port in the kernel layer.

[0142] The kernel layer in the device A to be tested can interact with the instruction parsing service module in the user space of the device to be tested through the established instruction communication port.

[0143] It should be emphasized that before executing the above step S509, there is no instruction communication port in the kernel layer of the device A to be tested, and after executing the above step S509, there is an instruction communication port in the kernel layer of the device A to be tested.

[0144] In step S510, after receiving the camera test instruction, the instruction parsing service module in the user space of the device A to be tested sends the parsed camera test instruction to the instruction communication port of the kernel layer.

[0145] After executing the above step S510, the command communication port receives the parsed camera test command sent by the command parsing service module. The parsed camera test command is used to request to obtain camera parameters for testing the camera, and the camera parameters include the SN of the camera.

[0146] The command communication port is created by the command communication port creation module in the device A under test in the kernel layer 15 seconds after the device A under test is powered on. That is to say, before this, the command communication port does not exist in the kernel layer of the device A under test. Therefore, when the kernel layer of the device A under test does not have the command communication port, after the command parsing service module in the user space of the device A under test receives the camera test command, it sends the camera test command to the kernel layer, and the kernel layer cannot obtain the camera test command.

[0147] Optionally, before executing the above step S510, the instruction parsing service module of the device to be tested A is further used to parse the acquired camera test instruction to obtain the parsed camera test instruction.

[0148] In step S511, the instruction communication port in the kernel layer of the device A to be tested obtains the camera parameters in the camera file directory in the system partition in the loading layer through the service associated with the binary file #1 in the pulled-up state in the loading layer of the device A to be tested according to the parsed camera test instruction.

[0149] After executing the above step S511, the communication port is instructed to obtain the camera parameters.

[0150] In step S512, the device A to be tested sends the camera parameters to the instruction parsing service module in the user space of the device A to be tested through the instruction communication port of the kernel layer.

[0151] After executing the above step S512, the instruction parsing service module receives the camera parameters accordingly.

[0152] In step S513 , the instruction parsing service module in the user space of the device A to be tested sends the camera parameters to the first communication module in the user space of the device A to be tested.

[0153] After executing the above step S513, the instruction parsing service module receives the camera parameters accordingly.

[0154] In step S514 , the first communication module in the device A to be tested sends the camera parameters to the second communication module in the device A under test.

[0155] After executing the above step S514, correspondingly, the second communication module receives the camera parameters sent by the first communication module.

[0156] In step S515 , the second communication module of the testing device A determines whether the camera in the device A to be tested passes the test based on the camera parameters.

[0157] In the above step S515, the second communication module of the test device A determines whether the camera in the device A to be tested passes the test based on the camera parameters, including: the second communication module compares the predefined camera parameters pre-stored in the test device A based on the acquired camera parameters to determine whether the camera of the device A to be tested passes the test; if the camera parameters acquired by the test device A are the same as the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested passes the test; if the camera parameters acquired by the test device A are different from the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested fails the test.

[0158] For example, Figure 6 is a schematic diagram comparing the test efficiency of a test method provided by an embodiment of the present application with the test efficiency of a test method provided by a conventional technology. Figure 6 As shown, Figure 6 Figure (1) shows a timing diagram of creating a camera file directory and a command communication port in the factory version test method provided in an embodiment of the present application. Figure 6 FIG. (2) shows a timing diagram of creating a camera file directory and commanding a communication port in a user version test method in the conventional technology, and Figure 6 Figure (3) shows the timing diagram of creating the camera file directory and command communication port in the factory version test method in the traditional technology. Figure 5 The factory version of the test method of the device to be tested provided by the embodiment of the present application is shown and Figure 6 As can be seen from Figure (1) in the figure, at the 15th second after the device A to be tested is powered on, in the factory version of the test method provided in the embodiment of the present application, the command communication port has been successfully established in the kernel layer of the device A to be tested, and the camera file directory has been successfully created in the system partition of the loading layer of the device A to be tested. In addition, the service associated with the binary file #1 is also in the pull-up state, that is, at the 15th second after the device A to be tested is powered on, the device A to be tested can start executing the camera test item process. Based on the above Figure 2 The conventional technology provided a user version of the device to be tested test method and Figure 6 As shown in Figure (3), the device A can only start executing the camera test item process 40 seconds after the device A is powered on. Figure 3 The conventional technology shown provides a conventional factory version of the device to be tested test method and Figure 6As shown in Figure (3), the test failed in this scenario due to timing disorder. Therefore, the method for testing the factory version of the device to be tested provided by the embodiment of the present application can effectively improve the test efficiency (for example, compared with the test method for the user version of the device to be tested, the test time is shortened by 25 seconds).

[0159] It should be understood that the above Figure 5 The test method provided is for illustration only and does not constitute any limitation to the test method provided in the embodiments of the present application. Figure 5 In the provided test method, taking the loading layer of the device to be tested including a pattern recognition module as an example, after receiving instruction A through the pattern recognition module, the steps of creating a camera file directory, pulling up a camera service, and creating an instruction communication port are triggered. Optionally, in a scenario where the device to be tested A does not include a pattern recognition module, the device to be tested A will automatically execute the steps of creating a camera file directory, pulling up a camera service, and creating an instruction communication port at a preset time after power-on. In this implementation, the above-mentioned instruction A may only include binary file #1. After the camera service pull-up module receives the above-mentioned instruction A sent by the mode setting module of the test device, the camera service pull-up module will automatically run the binary file #1 in instruction A at the preset time to put the camera service in a pulled-up state.

[0160] In the embodiment of the present application, at the 15th second after the device A to be tested is powered on, the instruction communication port has been successfully established in the kernel layer of the device A to be tested, the camera file directory has been successfully created in the system partition of the loading layer of the device A to be tested, and the service associated with the binary file #1 is also in the pull-up state (i.e., running state). In addition, the creation of the camera file directory and the camera service in the pull-up state by the device A to be tested are operations performed before the device to be tested creates the instruction communication port. That is to say, before and after the creation of the instruction communication port in the device A to be tested, the camera file directory has been created in the device A to be tested, and the camera service is already in the pull-up state. Therefore, at the 15th second after the device A to be tested is powered on, the device A to be tested can start to execute the camera test item process. In the test method of the device to be tested provided by the user version of the user version based on the conventional technology, the device A to be tested can start to execute the camera test item process at the 40th second after the device to be tested is powered on. Therefore, compared with the test method provided by traditional technology, the test time of the test method provided by the embodiment of the present application is shortened by 25 seconds, that is, the test method provided by the embodiment of the present application can effectively improve the test efficiency and help reduce the test cost.

[0161] Software architecture two, the command communication port creation module, the camera service pull-up module and the system partition mounting module are located in different layers of the software architecture of the device to be tested, that is, the command communication port creation module is located in the local layer, the camera service pull-up module is located in the kernel layer, and the system partition mounting module is located in the loading layer.

[0162] For example, Figure 7 is a schematic diagram of a software architecture of a device to be tested provided in an embodiment of the present application. It can be understood that, Figure 7 The interaction steps between the modules are shown below Figure 8 Some of the steps in the test method provided are Figure 8 Some steps in the test method provided are not in Figure 7 Shown in.

[0163] contrast Figure 7 and Figure 4 It can be seen that Figure 7 The software architecture of the device under test is shown in the figure. Figure 4 The common point of the software architecture shown is that when the command communication port is created in the device under test, the camera file directory has been successfully created in the device under test, and the camera service is already in the pulled-up state in the device under test; Figure 7 and Figure 4 The difference in the software architecture of the device under test shown is that the instruction communication port creation module, the camera service pull-up module and the system partition mounting module are located in different software layers (ie, the local layer, the kernel layer and the loading layer) of the device under test.

[0164] Understandably, Figure 7 The functions of each module shown are similar to those mentioned above. Figure 4 The functions of the modules shown are basically the same. For details not described in detail here, please refer to the above Figure 4 It is also understandable that Figure 7 The camera service pull-up module shown above Figure 4 The camera service pull-up module shown in FIG. 1 is somewhat different in its function. Specifically, in one example, Figure 7 In the scenario where the test device shown does not include a compilation module, that is, the device to be tested does not obtain the binary file associated with the camera service from the test device, the camera service pull-up module is used to create the camera service so that the created camera service is in a pulled-up state. Figure 7 The test device shown includes a compiling module, that is, in a scenario where the device to be tested obtains a binary file associated with a camera service from the test device, the camera service pull-up module is used to run the binary file associated with the camera service, so that the camera service is in a pulled-up state after running the binary file associated with the camera service.

[0165] It should be noted that the above Figure 7 The device under test shown is a factory version, i.e. Figure 7 The device under test shown is the above Figure 2 The simplified version of the user version of the device to be tested is shown. It is understandable that all services in the user version of the device to be tested (such as the camerahal service mentioned above and the various services that the camerahal service depends on) are nested and interdependent. These services cannot be moved forward at will. For example, the camerahal service also has other dependencies, and the services after the camerahal service also depend on it, so adjustments will cause the camerahal service to be unusable. Figure 7 The factory version of the device under test shown is a simple version, that is, many functions of the factory version of the device under test can be customized (for example, creating a camera file directory in the system partition of the loading layer, running camera services in the loading layer, etc.), and it is only necessary to ensure that the factory version of the device under test can implement camera-related tests. Figure 7 In the factory version of the device under test shown, in order to avoid system partition memory overflow, the relevant services in the system partition that are not related to the test method can also be moved to the data partition (ie, physical memory) of the device under test that starts slower.

[0166] It should be understood that the above Figure 7 The command communication port creation module, the camera service pull-up module and the system partition mounting module shown are located at different layers of the software architecture of the device to be tested for illustration only and are optional. Figure 7 The command communication port creation module, camera service pull-up module and system partition mounting module shown in the software architecture of the device to be tested can also be the settings corresponding to Scheme 1, Scheme 2, Scheme 6, Scheme 9 to Scheme 14 shown in Table 1 above.

[0167] Embodiment 2, a testing method based on software architecture 2.

[0168] Based on the above Figure 7 The software architecture of the test equipment and the software architecture of the device under test are shown, combined with Figure 8 Another test method provided by the embodiment of the present application is described in detail. It can be understood that Figure 8 The above Figure 7 The test equipment shown does not include the compilation module shown by the dotted line for the purpose of illustration. It can also be understood that Figure 7 The steps shown are Figure 8 Some steps of the test method are shown.

[0169] Figure 8is a schematic diagram of a test method provided in an embodiment of the present application. It can be understood that, Figure 8 The software architecture of the device A to be tested is shown as above Figure 7 The software architecture of the device under test is shown. Figure 8 The software architecture of the test device A shown above is Figure 7 The software architecture of the test equipment is shown. Figure 8 The device A to be tested shown may be, but is not limited to, Figure 1 In the application scenario shown, the device to be tested 101, the test device A can be but is not limited to Figure 1 The test device 102 in the application scenario shown. Figure 8 As shown, the test method provided in the embodiment of the present application may include steps S801 to S814. Steps S801 to S814 are described in detail below.

[0170] In step S801 , in response to the device A under test being powered on, the mode setting module in the test device A sends instruction B to the mode recognition module in the loading layer of the device under test.

[0171] In the embodiment of the present application, before the testing device A executes the above step S801, the device A to be tested is in a shutdown state.

[0172] The above step S801 is performed when the device A to be tested is in a powered-on state. In the embodiment of the present application, the triggering condition for the power-on of the device A to be tested is not specifically limited. For example, the user presses the power button of the device A to be tested in the powered-off state to make the device A to be tested in the powered-off state perform the power-on operation. For example, in response to the test device A in the powered-on state and the device A to be tested in the powered-off state being connected via USB, the device A to be tested is triggered to perform the power-on operation.

[0173] Instruction B is used to instruct the device A to be tested to execute the process of testing the factory version of the device A to be tested provided by this application after it is powered on. Instruction B does not carry the above Figure 5 The binary file #1 of step S503 in the provided test method.

[0174] It should be emphasized that in the embodiment of the present application, when the pattern recognition module receives instruction B, the device A to be tested is in the preloading or small system operation stage. It should also be understood that the operations of the loading layer of the device A to be tested are all operations performed when the device A to be tested is in the preloading or small system operation stage.

[0175] In step S802 , the second communication module in the test device A sends a camera test instruction to the first communication module in the user space of the device A to be tested.

[0176] After executing the above step S802, the first communication module receives the camera test instruction sent by the serial port wizard module. The first communication module can be a USB driver module or a WIFI driver module in the user space of the device A to be tested.

[0177] The camera test instruction is used to request to test the camera of the device A to be tested.

[0178] In step S803 , the first communication module in the user space of the device A to be tested sends a camera test instruction to the instruction parsing service module located in the user space of the device A to be tested.

[0179] After executing the above step S803, correspondingly, the instruction parsing service module receives the camera test instruction sent by the first communication module.

[0180] In step S804, after the pattern recognition module in the loading layer of the device A to be tested receives instruction B, the pattern recognition module generates indication information according to instruction B.

[0181] In the embodiment of the present application, after the pattern recognition module receives instruction B, the pattern recognition module parses instruction B and learns based on the parsed instruction B that the factory version of the device to be tested provided by the present application (i.e., the software architecture of the device to be tested A is Figure 7 Based on the software architecture of the device to be tested shown in the figure, the pattern recognition module will actively generate indication information, which is used to trigger subsequent test processes (i.e., the process of creating a camera service and running the camera service, the process of creating a camera file directory, and the process of creating an instruction communication port).

[0182] In step S805 , the pattern recognition module in the loading layer of the device A to be tested sends indication information to the system partition mounting module in the loading layer of the device A to be tested.

[0183] After executing the above step S805, the system partition mounting module receives the indication information sent by the pattern recognition module.

[0184] In step S806 , at the 10th second after the device A to be tested is powered on, the system partition mounting module in the loading layer of the device A to be tested creates a camera file directory in the system partition of the loading layer according to the instruction information.

[0185] In the above step S806, at the 10th second after the device A to be tested is powered on, the method in which the device A to be tested creates a camera file directory in the system partition of the loading layer is similar to the above method. Figure 5 The step S508 in the provided test method is the same, and the contents not described in detail here can refer to the description in the above step S508.

[0186] In step S807 , at 15 seconds after the device A to be tested is powered on, the camera service startup module in the kernel layer of the device A to be tested creates a camera service and runs the camera service, so that the camera service is in a startup state.

[0187] The camera service in the pulled-up state in step S807 is the same as the Figure 5 The service associated with the binary file #1 in step S507 of the provided test method is the same.

[0188] The above-mentioned camera service being in the pulled-up state can be understood as the camera service being in the running state.

[0189] In step S808 , at the 15th second after the device A to be tested is powered on, the instruction communication port creation module in the local layer of the device A to be tested creates an instruction communication port in the local layer.

[0190] The local layer in the device A to be tested can interact with the instruction parsing service module in the user space of the device to be tested through the established instruction communication port.

[0191] It should be emphasized that before executing the above step S808, there is no instruction communication port in the local layer of the device A to be tested, and after executing the above step S808, there is an instruction communication port in the local layer of the device A to be tested.

[0192] In step S809, after receiving the camera test instruction, the instruction parsing service module in the user space of the device A to be tested sends the parsed camera test instruction to the instruction communication port of the local layer.

[0193] After executing the above step S809, the command communication port receives the parsed camera test command sent by the command parsing service module. The parsed camera test command is used to request to obtain camera parameters for testing the camera, and the camera parameters include the SN of the camera.

[0194] The command communication port is created by the command communication port creation module in the device A under test in the local layer 25 seconds after the device A under test is powered on. That is to say, before this, the command communication port does not exist in the local layer of the device A under test. Therefore, when the command communication port does not exist in the local layer of the device A under test, after the command parsing service module in the user space of the device A under test receives the camera test command, it sends the camera test command to the local layer, and the local layer cannot obtain the camera test command.

[0195] Optionally, the command communication port is a port established between the 25th and 30th seconds after the device A to be tested is powered on. For example, the command communication port can also be a port established at the 26th, 28th or 29th second after the device A to be tested is powered on.

[0196] Optionally, before executing the above step S809, the instruction parsing service module of the device to be tested A is further used to parse the acquired camera test instruction to obtain the parsed camera test instruction.

[0197] In step S810, the instruction communication port in the local layer of the device A to be tested obtains the camera parameters in the camera file directory in the system partition of the loading layer through the service associated with the binary file #1 in the pulled-up state in the kernel layer of the device A to be tested according to the parsed camera test instruction.

[0198] After executing the above step S810, the instruction communication port obtains the camera parameters requested by the camera parameters.

[0199] In step S811, the device A to be tested sends camera parameters to the instruction parsing service module in the user space of the device A to be tested through the instruction communication port of the local layer.

[0200] After executing the above step S811, the instruction parsing service module receives the camera parameters accordingly.

[0201] In step S812 , the instruction parsing service module in the user space of the device A to be tested sends the camera parameters to the first communication module in the user space of the device A to be tested.

[0202] After executing the above step S812, the instruction parsing service module receives the camera parameters accordingly.

[0203] In step S813 , the first communication module in the device A to be tested sends the camera parameters to the second communication module in the device A under test.

[0204] After executing the above step S813, correspondingly, the second communication module receives the camera parameters sent by the first communication module.

[0205] In step S814, the second communication module of the testing device A determines whether the camera in the device A to be tested passes the test based on the camera parameters.

[0206] The above step S814 is the same as the above step S814. Figure 5 Step S515 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S515 above.

[0207] It should be understood that the above Figure 8The test method provided is for illustration only and does not constitute any limitation to the test method provided in the embodiments of the present application.

[0208] In the embodiment of the present application, at the 25th second after the device A to be tested is powered on, the command communication port has been successfully established in the local layer of the device A to be tested, the camera file directory has been successfully created in the system partition of the loading layer of the device A to be tested, and the camera service is already in the pull-up state (i.e., running state) in the kernel layer. In addition, the creation of the camera file directory and the camera service in the pull-up state by the device A to be tested are operations performed before the device to be tested creates the command communication port. That is to say, before and after the creation of the command communication port in the device A to be tested, the camera file directory has been created in the device A to be tested, and the camera service is already in the pull-up state. Therefore, at the 25th second after the device A to be tested is powered on, the device A to be tested can start to execute the camera test item process. In the test method of the device to be tested provided by the user version of the user version based on the traditional technology, the device A to be tested can start to execute the camera test item process at the 40th second after the device to be tested is powered on. Therefore, compared with the test method provided by traditional technology, the test time of the test method provided by the embodiment of the present application is shortened by 15 seconds, that is, the test method provided by the embodiment of the present application can effectively improve the test efficiency and help reduce the test cost.

[0209] Software architecture three, the command communication port creation module, the camera service pull-up module and the system partition mounting module are located in the same layer of the software architecture of the device to be tested, which is the loading layer.

[0210] For example, Fig. 9 is a schematic diagram of a software architecture of a device to be tested provided in an embodiment of the present application. It can be understood that, Fig. 9 The interaction steps between the modules are shown below Fig.10 Some of the steps in the test method provided are Fig.10 Some steps in the test method provided are not in Fig. 9 Shown in.

[0211] contrast Fig. 9 and Figure 4 It can be seen that Fig. 9 The software architecture of the device under test is shown in the figure. Figure 4 The common point of the software architecture shown is that when the command communication port is created in the device under test, the camera file directory has been successfully created in the device under test, and the camera service is already in the pulled-up state in the device under test; Fig. 9 and Figure 4The difference in the software architecture of the device under test shown is that the instruction communication port creation module, the camera service pull-up module and the system partition mounting module are located in different software layers (ie, the local layer, the kernel layer and the loading layer) of the device under test.

[0212] Understandably, Fig. 9 The functions of each module shown are similar to those mentioned above. Figure 4 The functions of the modules shown are the same. For details not described in detail here, please refer to the above Figure 4 Description in .

[0213] It should be noted that the above Fig. 9 The device under test shown is a factory version, i.e. Fig. 9 The device under test shown is the above Figure 2 The simplified version of the user version of the device to be tested is shown. It is understandable that all services in the user version of the device to be tested (such as the camerahal service mentioned above and the various services that the camerahal service depends on) are nested and interdependent. These services cannot be moved forward at will. For example, the camerahal service also has other dependencies, and the services after the camerahal service also depend on it, so adjustments will cause the camerahal service to be unusable. Fig. 9 The factory version of the device under test shown is a simple version, that is, many functions of the factory version of the device under test can be customized (for example, creating a camera file directory in the system partition of the loading layer, running camera services in the loading layer, etc.), and it is only necessary to ensure that the factory version of the device under test can implement camera-related tests. Fig. 9 In the factory version of the device under test shown, in order to avoid system partition memory overflow, the relevant services in the system partition that are not related to the test method can also be moved to the data partition (ie, physical memory) of the device under test that starts slower.

[0214] It should be understood that the above Fig. 9 The software architecture 3 shown is for reference only. Fig. 9 Take the command communication port creation module, the camera service pull-up module and the system partition mounting module located in the loading layer of the software architecture of the device to be tested as an example. Optionally, the above Fig. 9 The instruction communication port creation module, the camera service pull-up module and the system partition mounting module may also be located in the local layer or kernel layer of the software architecture of the device to be tested.

[0215] Embodiment 3, testing method based on software architecture 3.

[0216] Based on the above Fig. 9The software architecture of the test equipment and the software architecture of the device under test are shown, combined with Fig.10 Another test method provided by the embodiment of the present application is described in detail. It can also be understood that: Fig. 9 The steps shown are Fig.10 Some steps of the test method are shown.

[0217] Fig.10 is a schematic diagram of a test method provided in an embodiment of the present application. It can be understood that, Fig.10 The software architecture of the device A to be tested is shown as above Fig. 9 The software architecture of the device under test is shown. Fig.10 The software architecture of the test device A shown above is Fig. 9 The software architecture of the test equipment is shown. Fig.10 The device A to be tested shown may be, but is not limited to, Figure 1 In the application scenario shown, the device to be tested 101, the test device A can be but is not limited to Figure 1 The test device 102 in the application scenario shown. Fig.10 As shown, the test method provided in the embodiment of the present application may include steps S1001 to S1015. Steps S1001 to S1015 are described in detail below.

[0218] In step S1001, the compiling module in the test device A executes the compiling process to obtain a binary file #1.

[0219] The above step S1001 is the same as the above step S1002. Figure 5 Step S501 in the provided test method is the same, and for matters not described in detail here, reference can be made to the description of step S501 above.

[0220] In step S1002 , the compiling module in the test device A sends the binary file # 1 to the mode setting module in the test device A.

[0221] The above step S1002 is the same as the above step S1003. Figure 5 Step S502 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S502 above.

[0222] In step S1003, in response to the device A to be tested being powered on, the mode setting module in the test device A sends instruction A to the mode recognition module in the loading layer of the device to be tested, and the instruction A carries the binary file #1.

[0223] The above step S1003 is the same as the above step S1004. Figure 5 Step S503 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S503 above.

[0224] In step S1004 , the second communication module in the test device A sends a camera test instruction to the first communication module in the user space of the device A to be tested.

[0225] The above step S1004 is the same as the above step S1004. Figure 5 Step S504 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S504 above.

[0226] In step S1005 , the first communication module in the user space of the device A to be tested sends a camera test instruction to the instruction parsing service module located in the user space of the device A to be tested.

[0227] In step S1006 , after the mode recognition module in the loading layer of the device A to be tested receives the mode instruction A, the mode recognition module sends the binary file # 1 to the camera service launching module in the loading layer of the device A to be tested.

[0228] The above step S1006 is the same as the above step S1006. Figure 5 Step S506 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S506 above.

[0229] In step S1007 , the camera service launching module in the loading layer of the device A to be tested runs the binary file # 1 to launch the service associated with the binary file # 1 .

[0230] After executing the above step S1007, the service associated with the binary file #1 is in the started state (ie, running state).

[0231] In step S1008 , at the 10th second after the device A to be tested is powered on, the system partition mounting module in the loading layer of the device A to be tested creates a camera file directory in the system partition of the loading layer.

[0232] The above step S1008 is the same as the above step S1008. Figure 5 Step S508 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S508 above.

[0233] In step S1009 , at the 12th second after the device A to be tested is powered on, the instruction communication port creation module in the loading layer of the device A to be tested creates an instruction communication port in the loading layer.

[0234] The loading layer in the device A to be tested can interact with the instruction parsing service module in the user space of the device to be tested through the established instruction communication port.

[0235] It should be emphasized that before executing the above step S1009, there is no instruction communication port in the loading layer of the device A to be tested, and after executing the above step S1009, there is an instruction communication port in the loading layer of the device A to be tested.

[0236] In step S1010, after receiving the camera test instruction, the instruction parsing service module in the user space of the device A to be tested sends the parsed camera test instruction to the instruction communication port of the loading layer.

[0237] After executing the above step S1010, the command communication port receives the parsed camera test command sent by the command parsing service module. The parsed camera test command is used to request to obtain camera parameters for testing the camera, and the camera parameters include the SN of the camera.

[0238] The command communication port is created by the command communication port creation module in the device A under test in the loading layer at the 12th second after the device A under test is powered on. That is to say, before this, the command communication port does not exist in the loading layer of the device A under test. Therefore, when the loading layer of the device A under test does not have the command communication port, after the command parsing service module in the user space of the device A under test receives the camera test command, it sends the camera test command to the loading layer, and the loading layer cannot obtain the camera test command.

[0239] Optionally, the command communication port is a port established between the 10th second and the 15th second after the device A to be tested is powered on.

[0240] Optionally, before executing the above step S1010, the instruction parsing service module of the device to be tested A is further used to parse the acquired camera test instruction to obtain the parsed camera test instruction.

[0241] In step S1011, the instruction communication port in the loading layer of the device A to be tested obtains the camera parameters in the camera file directory in the system partition in the loading layer through the service associated with the binary file #1 in the pulled-up state in the loading layer of the device A to be tested according to the parsed camera test instruction.

[0242] After executing the above step S1011, the communication port is instructed to obtain the camera parameters.

[0243] In step S1012, the device A to be tested sends camera parameters to the instruction parsing service module in the user space of the device A to be tested through the instruction communication port of the loading layer.

[0244] After executing the above step S1012, the instruction parsing service module receives the camera parameters accordingly.

[0245] In step S1013 , the instruction parsing service module in the user space of the device A to be tested sends the camera parameters to the first communication module in the user space of the device A to be tested.

[0246] After executing the above step S1013, the instruction parsing service module receives the camera parameters accordingly.

[0247] In step S1014 , the first communication module in the device A to be tested sends camera parameters to the second communication module in the device A under test.

[0248] After executing the above step S1014, correspondingly, the second communication module receives the camera parameters sent by the first communication module.

[0249] In step S1015 , the second communication module of the testing device A determines whether the camera in the device A to be tested passes the test based on the camera parameters.

[0250] The above step S1015 is the same as the above step S1015. Figure 5 Step S515 in the provided test method is the same, and the contents not described in detail here can refer to the description of step S515 above.

[0251] It should be understood that the above Fig.10 The test method provided is for illustration only and does not constitute any limitation to the test method provided in the embodiments of the present application.

[0252] In an embodiment of the present application, at the 12th second after the device A to be tested is powered on, the command communication port has been successfully established in the loading layer of the device A to be tested, the camera file directory has been successfully created in the system partition of the loading layer, and the camera service is already in the pull-up state (i.e., running state) in the loading layer. In addition, the creation of the camera file directory and the camera service in the pull-up state by the device A to be tested are operations performed before the device to be tested creates the command communication port. That is to say, before and after the creation of the command communication port in the device A to be tested, the camera file directory has been created in the device A to be tested, and the camera service is already in the pull-up state. Therefore, at the 12th second after the device A to be tested is powered on, the device A to be tested can start to execute the camera test item process. In the test method of the user version of the device to be tested provided based on the traditional technology, the device A to be tested can only start to execute the camera test item process at the 40th second after the device to be tested is powered on. Therefore, compared with the test method provided by traditional technology, the test time of the test method provided by the embodiment of the present application is shortened by 28 seconds, that is, the test method provided by the embodiment of the present application can effectively improve the test efficiency and help reduce the test cost.

[0253] Fig.11is a schematic diagram of another test method provided in the embodiment of the present application. It should be understood that, Fig.11 The process of a test method provided by the embodiment of the present application is introduced by taking the execution subject as the test device A and the device to be tested A as an example. For example, the device to be tested A in the embodiment of the present application can be but is not limited to Figure 1 The device to be tested 101 shown, the test device A can be but is not limited to Figure 1 The test equipment 102 is shown. Fig.11 As shown, the test method provided in the embodiment of the present application includes steps S1110 to S1150. Steps S1110 to S1150 are described in detail below.

[0254] In step S1110 , the test device A executes a compilation process to generate a binary file # 1 .

[0255] In the embodiment of the present application, the binary file #1 is compiled by the test device A. Afterwards, when the device A to be tested is powered on, the device A to be tested can obtain the binary file #1 from the test device A by exchanging data with the test device A, and the device A to be tested can run the binary file #1 in the loading stage after being powered on.

[0256] In step S1120 , the device A to be tested performs a power-on operation.

[0257] Before executing the above step S1120, the testing device A is a device in a powered-on state, and the device to be tested A is a device in a powered-off state.

[0258] In step S1130 , the device A to be tested determines whether a new factory version of the device A to be tested needs to be tested.

[0259] It should be noted that the new factory version of the device A to be tested refers to the factory version provided in this application, that is, the software structure of the new factory version of the device A to be tested can be but is not limited to Figure 4 The software structure of the device under test is shown.

[0260] After executing the above step S1130, if the device A to be tested determines that the new factory version of the device A to be tested needs to be tested, the device A to be tested continues to execute the process of executing the test method for the new factory version of the device A to be tested described in step S1140, that is, Fig.11Steps S1141 to S1144 are shown. It should be noted that after the device A to be tested performs the power-on operation, when the device A to be tested is in the preloading or small system (preloader / lk) operation stage, if the device A to be tested receives a feedback message from the test device A (for example, the ATA tool installed in the test device A), the device A to be tested enters the new factory version by default. Based on this, after executing the above step S1130, it will be determined that the version of the device A to be tested is the factory version. That is to say, in this implementation, after the device A to be tested executes the above step S1130 and before executing the above step S1130, the device A to be tested also receives a feedback message from the test device, and controls the device A to be tested to enter the new factory version according to the feedback message.

[0261] After executing the above step S1130, if the device A to be tested determines that the new factory version of the device A to be tested does not need to be tested, that is, in this case, the user version of the device A to be tested needs to be tested. Therefore, after executing the above step S1130, the device A to be tested continues to execute the process of executing the test method on the user version of the device A to be tested described in step S1150, that is, Fig.11 Steps S1151 to S1153 are shown. It should be noted that after the device A to be tested performs the power-on operation and enters the preloader / lk operation stage, if no external operation is performed on the device A to be tested, everything adopts the system default configuration, that is, the device A to be tested enters the user version by default. Based on this, after executing the above step S1130, it will be determined that the version of the device A to be tested is the user version. That is to say, in this implementation, after the device A to be tested executes the above step S1130, the device A to be tested directly executes the above step S1150.

[0262] The following is an introduction to the process of testing the new factory version of the device A to be tested described in step S1140. The process may include: Fig.11 Steps S1141 to S1144 are shown. It can be understood that after executing the above steps S1110, S1120, S1130, and S1140 in sequence, step S1140 is continued to be executed, that is, before the device A to be tested and the test device A are connected, the device A to be tested executes the compilation step in advance, and stores the compiled binary file #1 into the RAM of the device A to be tested. After that, after the device A to be tested in the shutdown state and the test device A in the power-on state are connected, the device A to be tested performs a power-on operation, and the device A to be tested enters the new factory version. Thereafter, the device A to be tested automatically executes the test method based on the new factory version, that is, the test method described in steps S1141 to S1144.

[0263] In step S1141 , when the device A to be tested receives the camera test instruction sent by the test device A, the device A to be tested runs the binary file #1 in the loading layer, so that the service associated with the binary file #1 is started.

[0264] In step S1142 , at the 10th second after the device A to be tested is powered on, the device A to be tested creates a camera file directory in the system partition located in the loading layer.

[0265] In step S1143 , at 15 seconds after the device A to be tested is powered on, the device A to be tested creates a command communication port in the kernel layer.

[0266] In step S1144, the device A to be tested starts to execute the camera test process and sends the acquired camera parameters to the test device A, wherein the camera parameters are stored in the camera file directory of the system partition of the loading layer.

[0267] It should be noted that in the above-described steps S1141 to S1144, the test process is described with the device A to be tested as the execution subject. For the modular interaction steps of each module of the device A to be tested to execute the above steps S1141 to S1144, please refer to the above Figure 5 The test methods provided will not be described in detail here.

[0268] It should be noted that the test method described in step S1140 is based on the above Figure 5 The software architecture provided corresponds to the test method. Optionally, the above step S1140 can also be based on the above Figure 8 The test method corresponding to the software architecture 2 provided, or the above step S1140 can also be based on the above Fig.10 Provides three corresponding testing methods for software architecture, etc.

[0269] The following is an introduction to the process of testing the user version of the device A to be tested described in step S1150. The process may include: Fig.11 Steps S1151 to S1154 are shown for introduction.

[0270] In step S1151, when the device A under test receives the camera test instruction sent by the test device A and 25 seconds after the device A under test is powered on, the device A under test creates a camera file directory in the data partition located in the kernel layer.

[0271] The data partition of the kernel layer is a physical partition, specifically, the data partition is a partition located in the physical memory of the kernel layer. The startup time of the data partition is later than the startup time of the system partition, which can be seen in the description of the above step S1152, and will not be repeated here.

[0272] It should be understood that the camera file directory in the above step S1151 is the same as the camera file directory in the above step S1152. For the contents not described in detail here, please refer to the description in the above step S1152.

[0273] The above step S1151 is executed, that is, in response to the device A under test receiving the camera test instruction sent by the test device A, and 25 seconds after the device A under test is powered on, the device A under test creates a camera file directory in the data partition located in the kernel layer.

[0274] In step S1152 , 30 seconds after the device A to be tested is powered on, the device A to be tested creates camerahal related services in the local layer of the device A to be tested.

[0275] Camerahal related services include camerahal services and various services that camerahal services depend on. In the embodiment of the present application, the various services that camerahal services depend on are not specifically limited and can be set according to actual conditions. For example, the various services that camerahal services depend on may include, but are not limited to, one or more of the following services: uvent services, apexd services, or power services, etc.

[0276] It can be understood that the camerahal related services are the same as the services associated with the binary file #1 in the above step 1141.

[0277] The local layer of the device A to be tested includes an init initialization module (also called an init initialization process). Based on this, the above step S1152 is executed, that is, 30 seconds after the device A to be tested is turned on, the device A to be tested creates camerahal related services in the local layer of the device A to be tested. Exemplarily, the following steps may be included: 30 seconds after the device A to be tested is turned on, the init initialization module creates camerahal related services in the local layer of the device A to be tested.

[0278] The above step S1152 is executed, that is, in response to the 30th second after the device A under test is powered on, the device A under test creates a camerahal related service in the local layer of the device A under test.

[0279] In step S1153 , at the 40th second after the device A under test is powered on, the device A under test creates a command communication port in the application framework layer.

[0280] The above step S1152 is executed, that is, in response to the 40th second after the device A to be tested is powered on, the device A to be tested creates a command communication port in the application framework layer.

[0281] In step S1154 , the device A to be tested starts to execute the camera test process to obtain camera parameters, where the camera parameters are stored in the camera file directory of the data partition of the kernel layer.

[0282] In the above step S1154, the device A to be tested starts to execute the camera test process to obtain camera parameters, wherein the camera parameters are stored in the camera file directory of the data partition, including: the camerahal service in the local layer of the device A to be tested obtains the camera parameters by accessing the camera file directory of the data partition located in the kernel layer; after the camerahal service in the native layer of the device A to be tested obtains the camera parameters, the camerahal service sends the camera parameters to the application framework layer of the device A to be tested; the application framework layer of the device A to be tested sends the camera parameters to the instruction parsing service module in the user space of the device A to be tested through the instruction communication port; after the instruction parsing service module receives the camera parameters, the instruction parsing service module sends the camera parameters to the serial port wizard module of the test device A through the USB driver module in the user space, so that the test device A obtains the camera parameters.

[0283] It can be understood that the test process is described with the device A to be tested as the execution subject in the above steps S1151 to S1154. For the modular steps of the device A to be tested executing the above steps S1151 to S1154, please refer to the following Fig. 9 The test methods provided will not be described in detail here.

[0284] In the embodiment of the present application, after executing the above step S1144 or the above step S1154, the test device A obtains the camera parameters requested by the camera test instruction, and then the test device may further perform the following steps: the test device A compares the obtained camera parameters with the predefined camera parameters pre-stored in the test device A to determine whether the camera of the device A to be tested passes the test. Specifically, if the camera parameters obtained by the test device A are the same as the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested passes the test; if the camera parameters obtained by the test device A are different from the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested fails the test.

[0285] It should be understood that the above Fig.11 The test method provided is for illustration only and does not constitute any limitation to the test method provided in the embodiments of the present application.

[0286] For example, Fig.12 is the above Fig.11 The schematic diagram of the test flow corresponding to Case 2 in the test method provided. It can be understood that, Fig.12 The software architecture of the device A to be tested can be Figure 2 The software architecture of the device A under test is shown in FIG. Fig.12 The software architecture of the test device A shown above can be Figure 2 The software architecture of the test equipment is shown in FIG. Fig.12 As shown, the test method includes steps S1201 to S1211. Steps S1201 to S1211 are introduced below.

[0287] In step S1201 , in response to the device A to be tested being powered on, the second communication module in the testing device A sends a camera test instruction to the first communication module in the user space of the device A to be tested.

[0288] After executing the above step S1201, correspondingly, the first communication module receives the camera test instruction sent by the second communication module.

[0289] For example, Fig.12 The second communication module shown can be understood as the above Figure 2 The serial port wizard module in the test equipment shown, Fig.12 The first communication module shown can be understood as the above Figure 2 The USB driver module or WIFI driver module in the user space of the device to be tested is shown.

[0290] In step S1202 , the first communication module in the user space of the device A to be tested sends a camera test instruction to the instruction parsing service module in the user space of the device A to be tested.

[0291] After executing the above step S1202, the instruction parsing service module receives the camera test instruction sent by the first communication module.

[0292] In step S1203, 25 seconds after the device A to be tested is connected to the card reader, a camera file directory is created in the data partition of the kernel layer of the device A to be tested.

[0293] In step S1204, 30 seconds after the device A to be tested is powered on, camerahal related services are created in the local layer of the device A to be tested and the camerahal related services are started.

[0294] The camerahal related services are the same as the camerahal related services in the above step S1152. For the contents not described in detail here, please refer to the description in the above step S1152.

[0295] In step S1205 , at 40 seconds after the device A to be tested is powered on, the instruction communication port creation module in the application framework layer of the device A to be tested creates an instruction communication port in the application framework layer.

[0296] The command communication port creation module is a module located in the application framework layer of the device A to be tested. At 40 seconds after the device A to be tested is powered on, the command communication port creation module establishes a command communication port in the application framework layer.

[0297] It should be emphasized that before the device A to be tested executes the above step S1205, the application framework layer of the device A to be tested does not include the established command communication port. After the device A to be tested executes the above step S1205, the application framework layer of the device A to be tested includes the established command communication port.

[0298] In step S1206 , the instruction parsing service module in the user space of the device A to be tested sends the parsed camera test instruction to the instruction communication port in the application framework layer of the device A to be tested.

[0299] After executing the above step S1206, the command communication port receives the parsed camera test command sent by the command parsing service module.

[0300] In step S1207, the instruction communication port in the application framework layer of the device A to be tested obtains the camera parameters in the camera file directory through the camerahal related service in the pulled-up state in the local layer of the device A to be tested according to the parsed camera test instruction.

[0301] The above step S1207 involves the interaction between the command communication port and the camerahal related service, and the step of the camerahal related service accessing the camera file directory to obtain the camera parameters. The implementation method of the above step S1207 is not specifically limited.

[0302] In step S1208 , the device A to be tested sends the camera parameters to the instruction parsing service module in the user space of the device A to be tested through the instruction communication port in the application framework layer.

[0303] After executing the above step S1208, the instruction parsing service module receives the camera parameters accordingly.

[0304] In step S1209 , the instruction parsing service module in the user space of the device A to be tested sends the camera parameters to the first communication module in the user space of the device A under test.

[0305] After executing the above step S1209, correspondingly, the first communication module receives the camera parameters sent by the instruction parsing service module.

[0306] In step S1210 , the first communication module in the user space of the device A to be tested sends camera parameters to the second communication module in the test device A.

[0307] After executing the above step S1210, correspondingly, the second communication module receives the camera parameters sent by the first communication module.

[0308] In step S1211 , the second communication module of the testing device A determines whether the camera in the device A to be tested passes the test based on the camera parameters.

[0309] The second communication module of the above-mentioned test device A determines whether the camera in the device A to be tested passes the test based on the camera parameters, including: the second communication module compares the predefined camera parameters pre-stored in the test device A based on the acquired camera parameters to determine whether the camera of the device A to be tested passes the test; if the camera parameters acquired by the test device A are the same as the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested passes the test; if the camera parameters acquired by the test device A are different from the predefined camera parameters pre-stored in the test device A, it is determined that the camera of the device A to be tested fails the test.

[0310] Optionally, the test device A may further include a test module, and after the second communication module receives the camera parameters, the camera parameters are sent to the test module. Thereafter, the test module determines whether the camera in the device A to be tested passes the test based on the camera parameters.

[0311] It should be understood that the above Fig.12 The test method provided is for illustration only and does not constitute any limitation to the test method provided in the embodiments of the present application.

[0312] Fig.13 is a schematic diagram of a test method provided in an embodiment of the present application. The test method provided in an embodiment of the present application can be performed by an electronic device. It is understood that the electronic device can be implemented as software, or a combination of software and hardware. Exemplarily, the device to be tested in the embodiment of the present application can be, but is not limited to, Figure 1 The device to be tested 101 in the application scenario shown in the figure may be, but is not limited to, Figure 1 The test device 102 in the application scenario shown. Fig.13As shown, the test method provided in the embodiment of the present application includes steps S1310 to S1330. Steps S1310 to S1330 are described in detail below.

[0313] Before introducing the test method provided by the embodiment of the present application, the device to be tested provided by the embodiment of the present application is briefly introduced. The test method provided by the embodiment of the present application can be applied to the device to be tested, and the device to be tested includes a local layer, a kernel layer and a loading layer. In response to the device to be tested being powered on, the device to be tested first runs the loading layer, then runs the kernel layer, and then runs the local layer, that is, in the process of powering on the device to be tested, the device to be tested runs the loading layer, the kernel layer and the local layer in sequence. Therefore, according to the order of running each layer during the power-on process of the device to be tested, the loading layer can be called the lower layer of the kernel layer, the loading layer can be called the lower layer of the local layer, and the kernel layer can be called the lower layer of the local layer. Exemplarily, taking the device to be tested as an electronic device of the Android system as an example, when the device to be tested is powered on, and the device to be tested runs the loading layer, it can be understood that after the device to be tested is powered on, the device to be tested runs the preloading stage or the small system stage.

[0314] In step S1310, during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, the device to be tested creates an instruction communication port in the third software layer of the device to be tested, and the first service is used to obtain test parameters associated with the first test object stored in the first file directory, wherein the third software layer is a loading layer, and the first software layer and the second software layer are loading layers, or, the third software layer is a kernel layer, the first software layer is a loading layer or a kernel layer, and the second software layer is a loading layer or a kernel layer, or, the third software layer is a local layer, the first software layer is a loading layer, a local layer or a kernel layer, and the second software layer is a loading layer, a local layer or a kernel layer.

[0315] The process of powering on the device under test refers to the process after the device under test is powered on.

[0316] In an embodiment of the present application, the first software layer, the second software layer, and the third software layer in the device to be tested may be the same layer in the device to be tested (for example, a loading layer, a kernel layer, or a local layer), or the third software layer, the second software layer, and the first software layer are not the same layer.

[0317] The following describes that the third software layer, the second software layer, and the first software layer are not the same layer. In some implementations, the first software layer, the second software layer, and the third software layer are not the same layer, which means that the first software layer, the second software layer, and the third software layer are all different layers, and the first software layer and the second software layer are lower layers of the third software layer. For example, the third software layer is a local layer, the first software layer is a loading layer, and the second software layer is a kernel layer. For example, the third software layer is a local layer, the first software layer is a kernel layer, and the second software layer is a loading layer. In other implementations, the first software layer, the second software layer, and the third software layer are not the same layer, which means that any two software layers of the first software layer, the second software layer, and the third software layer are the same layer, and when the third software layer and the first software layer (or the second software layer) are the same layer, the second software layer (or the first software layer) is the lower layer of the third software layer and the first software layer (or the second software layer), or, when the first software layer and the second software layer are the same layer, the first software layer and the second software layer are the lower layers of the third software layer. For example, the third software layer is the kernel layer, the first software layer is the loading layer, and the second software layer is the loading layer or the kernel layer. For example, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer. For example, the third software layer is the local layer, the first software layer is the loading layer, and the second software layer is the loading layer or the local layer. For example, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer. For example, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the local layer or the kernel layer.

[0318] Before the device under test creates the instruction communication port in the third software layer, the first service in the first software layer of the device under test is in operation, and a first file directory is created in the second software layer of the device under test. Therefore, before executing the above step S1310, the device under test may also execute the process of running the first service in the first software layer and creating the first file directory in the second software layer, and the method of running the first service and creating the first file directory on the device under test is not specifically limited.

[0319] In some implementations, a preset test rule is pre-set in the device to be tested, and the preset test rule is used to instruct the device to be tested to run the first service in the first software layer at a preset time after power-on, and to create a first file directory in the second software layer at a preset time. Therefore, before executing the above step S1310, the device to be tested can also run the first service in the first software layer and create the first file directory in the second software layer at a preset time according to the predicted test rule.

[0320] In other implementations, the device to be tested receives a second test instruction from the testing device; in response to receiving the second test instruction, during power-on of the device to be tested, the device to be tested runs a first service in a first software layer, the device to be tested creates a first file directory in the second software layer, and the device to be tested creates an instruction communication port in a third software layer.

[0321] In the embodiment of the present application, the manner in which the device to be tested runs the first service in the first software layer is associated with the first software layer in which the first service is located.

[0322] In some implementations, the first software layer where the first service is located can be a loading layer, a local layer or a kernel layer. Therefore, the above-mentioned second test instruction includes a first executable file obtained based on the first service, and; in response to receiving the second test instruction, during the power-on process of the device to be tested, running the first service in the first software layer, including: in response to receiving the second test instruction, during the power-on process of the device to be tested, running the first executable file in the first software layer to run the first service.

[0323] The second test instruction sent by the above-mentioned test device to the device to be tested includes a first executable file obtained based on the first service. For example, the test device can perform a compilation process on the first service to obtain a first executable file, and then the test device encapsulates the first executable file to obtain a second test instruction. In the embodiment of the present application, the structure of the test device is not specifically limited and can be set according to actual test requirements. Exemplarily, the test device may include a compilation module that performs the above-mentioned compilation process, and the test device may also include a mode setting module, the mode setting module is used to encapsulate the first executable file obtained from the compilation module to obtain a second test instruction, and send the second test instruction to the device to be tested, and the test device may also include a second communication module, the second communication module is used to send the first test instruction to the device to be tested, and receive the test parameters sent by the device to be tested.

[0324] In the above implementation, the first software layer can be a loading layer, a local layer or a kernel layer. Since the second software layer can be a loading layer, a local layer or a kernel layer, the third software layer can be a loading layer, a local layer or a kernel layer. Therefore, in the above implementation, possible situations of the first software layer, the second software layer and the third software layer are as follows: the first software layer, the second software layer and the third software layer are loading layers; or, the first software layer, the second software layer and the third software layer are kernel layers; or, the first software layer, the second software layer and the third software layer are local layers; or, the third software layer is the kernel layer, the first software layer is the loading layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer; or, the third software layer is the local layer, the first software layer is the loading layer, and the second software layer is the loading layer, the local layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the loading layer, the local layer or the kernel layer.

[0325] In some other implementations, the first software layer where the first service is located is a local layer or a kernel layer, and; in response to receiving a second test instruction, during the power-on process of the device to be tested, the first service is run in the first software layer, including: in response to receiving a second test instruction, during the power-on process of the device to be tested, the first service is created in the first software layer and the first service is run.

[0326] The device under test creates the first service and runs the first service in the first software layer, which can be understood as the device under test runs the first service while creating the first service in the first software layer, or can be understood as the device under test first creates the first service in the first software layer and then runs the created first service.

[0327] In the above implementation, the first software layer can be a local layer or a kernel layer, that is, the first software layer is not a loading layer. Since the second software layer can be a loading layer, a local layer or a kernel layer, the third software layer can be a loading layer, a local layer or a kernel layer. Therefore, in the above implementation, the possible situations of the first software layer, the second software layer and the third software layer are as follows: the first software layer, the second software layer and the third software layer are the kernel layer; or, the first software layer, the second software layer and the third software layer are the local layer; or, the third software layer is the kernel layer, the first software layer is the kernel layer, and the second software layer is the loading layer; or, the third software layer is the local layer, the first software layer is the local layer, and the second software layer is the loading layer or the kernel layer; or, the third software layer is the local layer, the first software layer is the kernel layer, and the second software layer is the loading layer, the local layer or the kernel layer.

[0328] That is, in the embodiment of the present application, when the first service in the above step S1310 is located in the loading layer of the device to be tested, the device to be tested obtains the first executable file associated with the first service from the test device by running, so that the first service is in a running state in the loading layer. When the first service in the above step S1310 is located in the local layer or the kernel layer, the device to be tested obtains the first executable file associated with the first service from the test device by running, so that the first service is in a running state in the corresponding local layer or kernel layer; or, the device to be tested can create the first service in the local layer or the kernel layer and run the first service by itself, so that the first service is in a running state in the corresponding local layer or kernel layer.

[0329] In the embodiment of the present application, a first file directory is created in the second software layer, and the second software layer may be a loading layer, a local layer, or a kernel layer.

[0330] In some implementations, the second software layer in the above-mentioned device to be tested is a loading layer, the first file directory is created in the first partition of the virtual memory of the second software layer, and; the device to be tested can also perform the following steps: when the first file directory is created in the first partition, a kernel lock is set for the first partition so that the first file directory of the device to be tested after restarting stores the test parameters. In this implementation, after the first file directory storing the test parameters is created in the first partition, a kernel lock is set for the first file directory, so that it can be ensured that the first file directory storing the test parameters still exists in the second software layer after the device to be tested is restarted, that is, the first file directory is not erased. This method can avoid the problem of losing the first file directory in the first partition after the device to be tested is turned on again, which is conducive to improving the test efficiency of the device to be tested executing the test method again.

[0331] In some other implementations, the second software layer in the device under test is a local layer or a kernel layer, that is, the second software layer is not a loading layer. In this implementation, the first file directory is created in the physical memory of the second software layer. In this implementation, since the first file directory is stored in the physical content of the second software layer, the content (that is, the test parameters) stored in the first file directory will not be deleted after the device under test is restarted.

[0332] That is, in the embodiment of the present application, when the first file directory in the above step S1310 is located in the kernel layer or the local layer of the device to be tested, the first file directory can be located in the data partition of the physical memory of the kernel layer or the local layer. When the first file directory in the above step S1310 is located in the loading layer of the device to be tested, the first file directory can be located in the data partition of the virtual memory of the loading layer.

[0333] In the embodiment of the present application, the first test object and the test parameters are not specifically limited. In some implementations, the first test object is the camera of the device to be tested, and the test parameters include the serial number of the camera. In this implementation, the above-mentioned first service can also be referred to as a camerahal-related service, wherein the camerahal-related services include camerahal services, and various services on which the camerahal service depends. In the embodiment of the present application, the various services on which the camerahal service depends are not specifically limited and can be set according to actual conditions. For example, the various services on which the camerahal service depends may include, but are not limited to, one or more of the following services: uvent service, apexd service, or power service, etc.

[0334] In step S1320, the device to be tested receives a first test instruction from the testing device, where the first test instruction is used to instruct to test a first test object of the device to be tested.

[0335] The method for the device under test to obtain the first test instruction from the testing device is not specifically limited. For example, the device under test and the testing device can exchange data via a wired connection (such as a USB connection) or a wireless connection, so that the device under test obtains the first test instruction sent by the testing device.

[0336] In step S1330, in response to receiving the first test instruction, the device to be tested sends the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port.

[0337] In the above step S1330, the device to be tested sends the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port, so that the test device determines the test results based on the obtained test parameters. Exemplarily, in some implementations, the test device determines whether the camera in the device to be tested passes the test based on the test parameters obtained from the device to be tested and the preset test parameters stored in the test device. Specifically, if the test device determines that the test parameters obtained from the device to be tested are the same as the preset test parameters stored in the test device, it is determined that the camera in the device to be tested passes the test; if the test device determines that the test parameters obtained from the device to be tested are different from the preset test parameters stored in the test device, it is determined that the camera in the device to be tested fails the test.

[0338] The test method provided in the embodiment of the present application is introduced above with the device to be tested as the execution subject. The following describes the interactive steps of each module executing the above test method when the device to be tested includes each module.

[0339] In some implementations, the device to be tested also includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, and; during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, the device to be tested creates an instruction communication port in the third software layer of the device to be tested, including: during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer, the port creation The construction module creates an instruction communication port in the third software layer; the device to be tested receives a first test instruction from the test device, including: the instruction parsing module receives the first test instruction from the test device through the first communication module; the instruction parsing module sends the parsed first test instruction to the instruction communication port; in response to receiving the first test instruction, the device to be tested sends the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port, including: in response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; the instruction parsing module sends the test parameters to the test device through the first communication module.

[0340] In response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction. Exemplarily, the following steps may be included: in response to receiving the first test instruction, the instruction communication port sends a message to the first service based on the parsed first test instruction; the first service obtains the test parameters from the first file directory based on the message, and sends the test parameters to the instruction communication port; the instruction communication port sends the obtained test parameters to the instruction parsing module.

[0341] In the above implementation, the device under test can run the first service in the first software layer and create a first file directory in the second software layer of the device under test after the device under test is powered on based on the preset test rules described above.

[0342] The first communication module can be, but is not limited to, a USB driver module or a WIFI driver module. Correspondingly, the test device can also include a second communication module, which interacts with the first communication module of the device to be tested. The test device can send a first test instruction to the first communication module or receive a test parameter sent by the first communication module through the second communication module.

[0343] For example, the device to be tested in the above implementation may be, but is not limited to, Figure 4 , Figure 7 or Fig. 9 The device to be tested shown does not include the pattern recognition module shown by the dotted line. For example, the device to be tested in the above implementation is Figure 4 Taking the device to be tested shown as an example, which does not include the pattern recognition module shown by the dotted line, Figure 4 The camera service shown is an example of the first service described above. Figure 4 The camera service pull-up module shown is an example of the above service module. Figure 4 The system partition mounting module shown is an example of the above mounting module. Figure 4 The camera file directory in the system partition shown is an example of the first file directory mentioned above. Figure 4 The instruction communication port establishment module shown is an example of the above-mentioned port creation module. Figure 4 The command communication port shown is an example of the command communication port described above. Figure 4 The first communication module in the user space shown is an example of the above-mentioned first communication module. Figure 4 The instruction parsing service module in the user space shown is an example of the above instruction parsing module. Figure 4 The test device shown is an example of the test device described above.

[0344] In some other implementations, the device to be tested also includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, the loading layer includes a pattern recognition module, and; during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, the device to be tested creates an instruction communication port in the third software layer of the device to be tested, including: during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer, the port creation module creates an instruction communication port in the third software layer; the device to be tested receives a first test instruction from the test device, including: the instruction parsing module receives the first test instruction from the test device through the first communication module; the instruction parsing module sends the parsed first test instruction to the instruction communication port; in response to receiving the first test instruction, the device to be tested The test device sends the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port, including: in response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; the instruction parsing module sends the test parameters to the test device through the first communication module; the device to be tested receives the second test instruction from the test device, including: the pattern recognition module receives the second test instruction from the test device; in response to receiving the second test instruction, during the power-on process of the device to be tested, the device to be tested runs the first service in the first software layer, creates the first file directory in the second software layer, and creates the instruction communication port in the third software layer, including: in response to receiving the second test instruction, during the power-on process of the device to be tested, the pattern recognition module triggers the service module to run the first service in the first software layer according to the parsed second test instruction, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer.

[0345] In the above implementation, the pattern recognition module triggers the service module to run the first service in the first software layer according to the second test instruction after parsing, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer. The steps are not specifically limited. For example, the pattern recognition module triggers the service module to run the first service in the first software layer by sending the first executable file according to the second test instruction after parsing, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer. For example, the pattern recognition module generates indication information according to the second test instruction after parsing; the pattern recognition module triggers the service module to run the first service in the first software layer by sending the indication information, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer.

[0346] For example, the device to be tested in the above implementation may be, but is not limited to, Figure 4 , Figure 7 or Fig. 9 The device to be tested shown includes a pattern recognition module shown by a dotted line. For example, the device to be tested in the above implementation is Figure 4 , Figure 7 or Fig. 9 Taking the device to be tested including the pattern recognition module shown by the dotted line as an example, Figure 4 , Figure 7 or Fig. 9 The camera service shown is an example of the first service described above. Figure 4 , Figure 7 or Fig. 9 The camera service pull-up module shown is an example of the above service module. Figure 4 , Figure 7 or Fig. 9 The system partition mounting module shown is an example of the above mounting module. Figure 4 , Figure 7 or Fig. 9 The camera file directory in the system partition shown is an example of the first file directory mentioned above. Figure 4 , Figure 7 or Fig. 9 The instruction communication port establishment module shown is an example of the above-mentioned port creation module. Figure 4 , Figure 7 or Fig. 9 The command communication port shown is an example of the command communication port described above. Figure 4 , Figure 7 or Fig. 9 The first communication module in the user space shown is an example of the above-mentioned first communication module. Figure 4 , Figure 7or Fig. 9 The instruction parsing service module in the user space shown is an example of the above instruction parsing module. Figure 4 , Figure 7 or Fig. 9 The test equipment shown is an example of the above test equipment. For details not described in detail here, please refer to the above Figure 4 , Figure 7 or Fig. 9 Related description in .

[0347] When the device to be tested in the above implementation is Figure 4 When the device under test including the pattern recognition module shown by the dotted line is shown, Figure 5 Instruction A in the provided test method is a specific example of the second test instruction in the above implementation. Figure 5 The binary file #1 in the provided test method is a specific example of the first executable file in the above implementation. Figure 5 The camera test instruction in the provided test method is a specific example of the first test instruction in the above implementation. Figure 5 The camera parameters in the provided test method are a specific example of the test parameters in the above implementation. Figure 5 The camera file directory in the test method provided is a specific example of the first file directory in the above implementation. For details not described in detail here, please refer to the above Figure 5 Provided test method. Optional, the above Figure 4 The device to be tested shown in FIG. 1 includes a pattern recognition module shown in dashed lines, and can also be replaced by Figure 7 The device to be tested shown includes a pattern recognition module shown by a dotted line, the above Figure 5 The provided test method can also be replaced by Figure 8 The test methods provided are not described in detail here, please refer to the above Figure 8 Provided test method. Optional, the above Figure 4 The device to be tested shown in FIG. 1 includes a pattern recognition module shown in dashed lines, and can also be replaced by Fig. 9 The device to be tested shown includes a pattern recognition module shown by a dotted line, the above Figure 5 The provided test method can also be replaced by Fig.10 The test methods provided are not described in detail here, please refer to the above Fig.10 Test methods provided.

[0348] It should be noted that the above Fig.13 The device to be tested in the embodiment of the present application is the factory version of the device to be tested provided by the embodiment of the present application, that is, the above Fig.13 The device under test shown is the above Figure 2The simplified version of the user version of the device to be tested is shown. It is understandable that all services in the user version of the device to be tested (such as the camerahal service mentioned above and the various services that the camerahal service depends on) are nested and interdependent. These services cannot be moved forward at will. For example, the camerahal service also has other dependencies, and the services after the camerahal service also depend on it, so adjustments will cause the camerahal service to be unusable. Fig.13 The factory version of the device under test shown is a simplified version, that is, many functions of the factory version of the device under test can be customized (for example, running the first service in the first software layer, creating the first file directory in the second software layer, creating the instruction communication port in the third software layer, etc.), and it is only necessary to ensure that the factory version of the device under test can implement camera-related tests. Fig.13 In the factory version of the device under test shown, in order to avoid system partition memory overflow, the relevant services in the system partition that are not related to the test method can also be moved to the data partition (ie, physical memory) of the device under test that starts slower.

[0349] It should be understood that the above Fig.13 The test method shown is for illustration only and does not constitute any limitation on the test method provided in this application. Fig.13 Only combined Figure 4 , Figure 7 or Fig. 9 The software structure of the device under test is introduced in a graphical form, but the software structure of the device under test can also be removed. Figure 4 , Figure 7 and other software structures outside of the diagram. For example, Fig. 9 The command communication port creation module, system partition mounting module and camera service pull-up module shown in the figure can also be located in the kernel layer or local layer of the device to be tested. Figure 4 The command communication port creation module and the system partition mounting module shown may be located in the kernel layer of the device to be tested, and the camera service pull-up module may be located in the loading layer or the local layer of the device to be tested.

[0350] In the embodiment of the present application, before the device to be tested creates the instruction communication port in the third software layer, the device to be tested has already run the first service in the first software layer, and successfully created the first file directory storing the test parameters in the second software layer. Therefore, after the device to be tested creates the instruction communication port in the third software layer, the instruction communication port of the device to be tested can immediately trigger the relevant operation of obtaining the test parameters from the first file directory through the first service, that is, this method avoids the problem of test failure caused by the failure to successfully run the first service within the preset time after the device to be tested creates the instruction communication port in the traditional technology. Moreover, compared with the test method provided by the traditional technology, the instruction communication port in the above test method is created in any one of the loading layer, kernel layer and local layer of the device to be tested, that is, the layer where the instruction communication port is located (for example, the loading layer, kernel layer or local layer) is the layer that runs earlier after the device to be tested is powered on, so this method can improve the test efficiency to a certain extent. In summary, the test method provided in the embodiment of the present application can improve the test efficiency to a certain extent while ensuring the success of the test.

[0351] Combination of the above Figures 1 to 13 , describes in detail the application scenario and test method of the test method of the embodiment of the present application, and will be combined with Fig.14 , describes the electronic device embodiment of the present application in detail. It should be understood that the electronic device in the embodiment of the present application can execute the steps executed by the device to be tested in the various test methods in the aforementioned embodiments of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the aforementioned method embodiments.

[0352] For example, Fig.14 1 is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a power management module 140, a communication management module 150, a display screen 160, etc. It is understandable that the electronic device 100 may be the above Figure 1 A device under test 101 is shown.

[0353] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0354] The processor 110 can implement the functions of the processor 110 in various possible implementations of the electronic device 100, and the electronic device 100 includes a local layer, a kernel layer, and a loading layer. The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). Among them, different processing units can be independent devices or integrated devices.

[0355] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0356] The processor 110 is used to perform the following steps: during the power-on process of the device to be tested, when the first service in the first software layer of the device to be tested is in a running state and a first file directory is created in the second software layer of the device to be tested, an instruction communication port is created in the third software layer of the device to be tested, and the first service is used to obtain test parameters associated with the first test object stored in the first file directory, wherein the third software layer is a loading layer, the first software layer and the second software layer are loading layers, or the third software layer is a kernel layer, the first software layer is a loading layer or a kernel layer, and the second software layer is a loading layer or a kernel layer, or the third software layer is a local layer, the first software layer is a loading layer, a local layer or a kernel layer, and the second software layer is a loading layer, a local layer or a kernel layer; receiving a first test instruction from the test device, the first test instruction is used to instruct to test the first test object of the device to be tested; in response to receiving the first test instruction, sending the test parameters obtained by the first service from the first file directory to the test device through the instruction communication port.

[0357] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0358] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an I2C interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a GPIO interface, a subscriber identity module (SIM) interface, and / or a USB interface, etc.

[0359] It should be understood that Fig.14 The connection relationship between the modules shown is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 may also adopt a combination of multiple connection modes in the above embodiments.

[0360] The power management module 140 is used to supply power to the electronic device 100. The power management module 140 is connected to the processor 110. The power management module 140 receives input of an external power source and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 160, the communication management module 150, and the like.

[0361] The communication management module 150 can provide a communication solution applied to the electronic device 100. Optionally, the communication management module 150 can be a wireless communication module, providing a wireless communication solution including WLAN (such as WIFI), Bluetooth, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the electronic device 100. For example, in an embodiment of the present application, when the electronic device 100 is a test device (such as a computer), the electronic device 100 can establish a USB connection with the device to be tested (such as a mobile phone) through the wireless communication module.

[0362] The communication management module 150 may be one or more devices integrating at least one communication processing module. The communication management module 150 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The communication management module 150 may also receive a signal to be sent from the processor 110, modulate the frequency of the signal, amplify the signal, and convert it into electromagnetic waves for radiation via the antenna.

[0363] The electronic device 100 implements the display function through a GPU, a display screen 160, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 160 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0364] The display screen 160 is used to display images, videos, etc. The display screen 160 includes a display panel.

[0365] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0366] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. For example, in an embodiment of the present application, the processor 110 may execute the instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

[0367] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0368] The present application also provides a computer program product, which, when executed by a processor, implements the testing method described in any method embodiment of the present application.

[0369] The computer program product may be stored in a memory, for example, a program, which is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.

[0370] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the test method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

[0371] The present application also provides a chip, which is applied to an electronic device. The chip includes one or more processors, and the processor is used to call computer instructions so that the electronic device implements the test method described in any method embodiment of the present application when executing.

[0372] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0373] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0374] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0375] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0376] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0377] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0378] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0379] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A testing method, characterized in that: Applied to a device to be tested, the device to be tested includes a local layer, a kernel layer and a loading layer, and the method includes: During the power-on process of the device to be tested, when a first service in a first software layer of the device to be tested is in a running state and a first file directory is created in a second software layer of the device to be tested, an instruction communication port is created in a third software layer of the device to be tested, and the first service is used to obtain a test parameter associated with a first test object stored in the first file directory, wherein: The third software layer is the loading layer, and the first software layer and the second software layer are the loading layer, or, The third software layer is the kernel layer, the first software layer is the loading layer or the kernel layer, and the second software layer is the loading layer or the kernel layer. Or, the third software layer is the local layer, the first software layer is the loading layer, the local layer or the kernel layer, and the second software layer is the loading layer, the local layer or the kernel layer; Receiving a first test instruction from a test device, wherein the first test instruction is used to instruct to test the first test object of the device to be tested; In response to receiving the first test instruction, the test parameters obtained by the first service from the first file directory are sent to the test device through the instruction communication port.

2. The method according to claim 1, characterized in that: The method further comprises: receiving a second test instruction from the test device; In response to receiving the second test instruction, during the power-on process of the device to be tested, the first service is run in the first software layer, and the first file directory is created in the second software layer.

3. The method according to claim 2, characterized in that The second test instruction includes a first executable file obtained based on the first service, and; In response to receiving the second test instruction, during the power-on process of the device to be tested, running the first service in the first software layer includes: In response to receiving the second test instruction, during the power-on process of the device to be tested, the first executable file is run in the first software layer to run the first service.

4. The method according to claim 2, characterized in that: In response to receiving the second test instruction, during the power-on process of the device to be tested, running the first service in the first software layer includes: In the case that the first software layer is the local layer or the kernel layer, in response to receiving the second test instruction, during the power-on process of the device to be tested, the first service is created in the first software layer and the first service is run.

5. The method according to any one of claims 1 to 4, characterized in that: The device to be tested further includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, and; During the power-on process of the device to be tested, when a first service in a first software layer of the device to be tested is in a running state and a first file directory is created in a second software layer of the device to be tested, creating an instruction communication port in a third software layer of the device to be tested includes: During the power-on process of the device to be tested, when the first service in the first software layer is in a running state and the first file directory is created in the second software layer, the port creation module creates the instruction communication port in the third software layer; The receiving a first test instruction from a test device comprises: The instruction parsing module receives the first test instruction from the test device through the first communication module; The instruction parsing module sends the parsed first test instruction to the instruction communication port; In response to receiving the first test instruction, sending the test parameter obtained by the first service from the first file directory to the test device through the instruction communication port includes: In response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; The instruction parsing module sends the test parameters to the test device through the first communication module.

6. The method according to any one of claims 2 to 4, characterized in that: The device to be tested further includes a user space, the user space includes a first communication module and an instruction parsing module, the first software layer includes a service module, the second software layer includes a mounting module, the third software layer includes a port creation module, the loading layer includes a pattern recognition module, and; During the power-on process of the device to be tested, when a first service in a first software layer of the device to be tested is in a running state and a first file directory is created in a second software layer of the device to be tested, creating an instruction communication port in a third software layer of the device to be tested includes: During the power-on process of the device to be tested, when the first service in the first software layer is in a running state and the first file directory is created in the second software layer, the port creation module creates the instruction communication port in the third software layer; The receiving a first test instruction from a test device comprises: The instruction parsing module receives the first test instruction from the test device through the first communication module; The instruction parsing module sends the parsed first test instruction to the instruction communication port; In response to receiving the first test instruction, sending the test parameter obtained by the first service from the first file directory to the test device through the instruction communication port includes: In response to receiving the first test instruction, the instruction communication port sends the test parameters obtained from the first file directory through the first service to the instruction parsing module based on the parsed first test instruction; The instruction parsing module sends the test parameters to the test device through the first communication module; The receiving a second test instruction from the test device comprises: The pattern recognition module receives the second test instruction from the test device; In response to receiving the second test instruction, during the power-on process of the device to be tested, running the first service in the first software layer, creating the first file directory in the second software layer, and creating the instruction communication port in the third software layer, comprises: In response to receiving the second test instruction, during the power-on process of the device to be tested, the pattern recognition module triggers the service module to run the first service in the first software layer according to the parsed second test instruction, the mounting module creates the first file directory in the second software layer, and the port creation module creates the instruction communication port in the third software layer.

7. The method according to any one of claims 1 to 4, characterized in that: The first file directory is created in a first partition of the virtual memory of the second software layer, and; The method further comprises: When the second software layer is the loading layer and the first file directory is created in the first partition, a kernel lock is set for the first partition so that the first file directory of the restarted device to be tested stores the test parameters.

8. The method according to any one of claims 1 to 4, characterized in that: The first test object is a camera of the device to be tested, and the test parameter includes a serial number of the camera.

9. An electronic device, characterized in that: The electronic device comprises one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, and when the one or more processors execute the computer program, the electronic device executes the test method as described in any one of claims 1 to 8.

10. A chip, which is applied to electronic equipment, and includes one or more processors, characterized in that: The processor is used to call computer instructions so that the electronic device executes the testing method according to any one of claims 1 to 8.

11. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the testing method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Debugging method, electronic equipment and storage medium

    CN114020621A

  • Vehicle-mounted operating system, debugging system and method, electronic equipment and storage medium

    CN116414589A

  • Computing device and debugging method thereof

    CN116909957A

  • Test equipment and test method of vehicle-mounted terminal application

    CN117851248A

  • Method and apparatus for remotely debugging computer software over a serial bus

    WO2001040940A2