CN111352790A - Test method and device for reporting input event, mobile terminal and storage medium - Google Patents

Test method and device for reporting input event, mobile terminal and storage medium Download PDF

Info

Publication number
CN111352790A
CN111352790A CN202010105110.XA CN202010105110A CN111352790A CN 111352790 A CN111352790 A CN 111352790A CN 202010105110 A CN202010105110 A CN 202010105110A CN 111352790 A CN111352790 A CN 111352790A
Authority
CN
China
Prior art keywords
event
operation instruction
test
operating system
action
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010105110.XA
Other languages
Chinese (zh)
Inventor
林进全
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN202010105110.XA priority Critical patent/CN111352790A/en
Publication of CN111352790A publication Critical patent/CN111352790A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a test method and device for reporting an input event, a mobile terminal and a storage medium, and relates to the technical field of mobile terminals. The method is applied to a mobile terminal, the mobile terminal is provided with an operating system, and the method comprises the following steps: the method comprises the steps of obtaining an operation instruction issued by an application layer of an operation system, analyzing the operation instruction, obtaining a test event corresponding to the operation instruction, and triggering a bottom layer of the operation system to report an input event based on the test event. The method, the device, the mobile terminal and the storage medium for testing the reporting of the input event, provided by the embodiment of the application, acquire the test event by acquiring the operation instruction issued by the application layer, and trigger the bottom layer to report the input event based on the test event, so that the problem that the performance test in the system directly realizes different application operations in the application layer, the process reported by equipment cannot be truly restored, and the reliability of software quality and user experience are improved.

Description

Test method and device for reporting input event, mobile terminal and storage medium
Technical Field
The present application relates to the field of mobile terminal technologies, and in particular, to a method and an apparatus for testing reporting of an input event, a mobile terminal, and a storage medium.
Background
With the development of science and technology, mobile terminals are widely used and have more functions, and the mobile terminals become one of the necessary things in daily life of people. At present, a performance test is generally performed on a mobile terminal before the mobile terminal leaves a factory, however, the performance test method at present has the problem of inaccurate performance test.
Disclosure of Invention
In view of the above problems, the present application provides a method and an apparatus for testing input event reporting, a mobile terminal, and a storage medium, so as to solve the above problems.
In a first aspect, an embodiment of the present application provides a method for testing reporting of an input event, where the method is applied to a mobile terminal, and the mobile terminal is provided with an operating system, and the method includes: acquiring an operation instruction issued by an application layer of the operation system; analyzing the operation instruction to obtain a test event corresponding to the operation instruction; and triggering the bottom layer of the operating system to report the input event based on the test event.
In a second aspect, an embodiment of the present application provides a device for testing reporting of an input event, which is applied to a mobile terminal, where the mobile terminal is installed with an operating system, and the method includes: the operation instruction acquisition module is used for acquiring an operation instruction issued by an application layer of the operation system; the test event obtaining module is used for analyzing the operation instruction to obtain a test event corresponding to the operation instruction; and the input event reporting triggering module is used for triggering the bottom layer of the operating system to report the input event based on the test event.
In a third aspect, an embodiment of the present application provides a mobile terminal, including a memory and a processor, where the memory is coupled to the processor, and the memory stores instructions, and the processor executes the above method when the instructions are executed by the processor.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
The method, the device, the mobile terminal and the storage medium for testing the reporting of the input event, provided by the embodiment of the application, are used for acquiring the operation instruction issued by the application layer of the operation system, analyzing the operation instruction, acquiring the test event corresponding to the operation instruction, and triggering the bottom layer of the operation system to report the input event based on the test event, so that the test event is acquired by acquiring the operation instruction issued by the application layer, and the bottom layer is triggered to report the input event based on the test event, thereby solving the problem that the performance test in the system directly realizes different application operations on the application layer, being incapable of truly restoring the process reported by the equipment, and improving the reliability of software quality and user experience.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a block diagram illustrating a mobile terminal according to an embodiment of the present application, configured to execute a test method for reporting an input event;
fig. 2 is a block diagram illustrating an operating system of a mobile terminal according to an embodiment of the present application;
fig. 3 is a block diagram illustrating another operating system of a mobile terminal according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a testing method for reporting an input event according to an embodiment of the present application;
fig. 5 is a schematic flow chart illustrating a bottom-layer reporting event according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a testing method for reporting an input event according to another embodiment of the present application;
fig. 7 is a flowchart illustrating an application layer triggering an underlying reporting event according to an embodiment of the present application;
fig. 8 is a flowchart illustrating a testing method for reporting an input event according to yet another embodiment of the present application;
fig. 9 is a schematic flowchart illustrating a testing method for reporting an input event according to another embodiment of the present application;
fig. 10 is a flowchart illustrating a testing method for reporting an input event according to yet another embodiment of the present application;
fig. 11 shows a block diagram of a testing apparatus for reporting an input event according to an embodiment of the present application;
fig. 12 illustrates a storage unit, according to an embodiment of the present application, for storing or carrying program codes for implementing a test method for reporting an input event according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
At present, a terminal manufacturer usually needs to perform a large amount of automated performance tests in order to better optimize terminal equipment before the mobile terminal leaves the factory. The mobile terminal can trigger reporting events to an application system of the mobile terminal through actual physical devices, such as external devices such as a power key, a volume key, a touch display screen and the like, as real hardware devices, so as to realize performance tests of different operations, generally, the physical devices can be automatically clicked through the external devices such as a mechanical arm and the like to realize the performance tests, when the external devices such as the mechanical arm and the like are lacked, automatic pressure tests can be carried out in a mode of presetting applications in the system, different application operations are directly realized in an application layer when the automatic pressure tests are carried out in the mode of presetting applications in the system, instead of reducing a reporting flow from a bottom layer to an application layer triggered by the physical devices, and as the method cannot restore the operation of the real physical devices, the real reporting flows of the physical devices cannot be triggered, the accuracy and the authenticity of the reporting process are reduced.
In view of the above problems, the inventor finds, through long-term research, that a test method, an apparatus, a mobile terminal, and a storage medium for reporting an input event provided in the embodiments of the present application are provided, where a test event is obtained by obtaining an operation instruction issued by an application layer, and a bottom layer is triggered to report the input event based on the test event, so as to solve the problem that a performance test in a system directly implements different application operations in the application layer, and cannot truly restore a process reported by a device, thereby improving reliability of software quality and user experience. The specific test method for reporting the input event is described in detail in the following embodiments.
Referring to fig. 1, a block diagram of a mobile terminal 100 according to an embodiment of the present disclosure is shown. The mobile terminal 100 may be a smart phone, a tablet computer, an electronic book, or the like, which is installed with an operating system. The mobile terminal 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a touch display 130, physical keys 140, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores, among other things. The processor 110 interfaces with various components throughout the mobile terminal 100 using various interfaces and lines, and performs various functions of the mobile terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the mobile terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The touch screen 130 is used for displaying information input by a user, information provided to the user, and various graphic user interfaces of the electronic device 100, which may be composed of graphics, text, icons, numbers, videos, and any combination thereof, and in one example, the touch screen 130 may be a Liquid Crystal Display (LCD) or an Organic Light-Emitting Diode (OLED), which is not limited herein.
The physical keys 140 may include a volume key, a power key, a fingerprint key, etc., which are not limited herein.
Taking an operating system as an Android (Android) system as an example, programs and data stored in the memory 120 are shown in fig. 2, and a Linux kernel layer 220, a system runtime layer 240, an application framework layer 260, and an application layer 280 are stored in the memory 120. The Linux kernel layer 220 provides underlying drivers for various hardware of the mobile terminal 100, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, power management, and the like. The system runtime library layer 240 provides the main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system Runtime layer 240 is an Android Runtime library (Android Runtime), which mainly provides some core libraries that can allow developers to write Android applications using the Java language. The application framework layer 260 provides various APIs that may be used in building applications, and developers may build their own applications by using these APIs, such as activity management, window management, view management, notification management, content provider, package management, session management, resource management, and location management. At least one application program runs in the application layer 280, and the application programs may be a contact program, a short message program, a clock program, a camera application, etc. of the operating system; or an application program developed by a third-party developer, such as an instant messaging program, a photo beautification program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 3, and the IOS system includes: a Core operating system Layer 320(Core OS Layer), a Core Services Layer 340(Core Services Layer), a Media Layer 360(Media Layer), and a touchable Layer 380(Cocoa Touch Layer). The kernel operating system layer 320 includes an operating system kernel, drivers, and underlying program frameworks that provide functionality closer to hardware for use by program frameworks located in the kernel services layer 340. The core services layer 340 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, that are needed by the application. The media layer 360 provides audiovisual interfaces for applications, such as graphics-related interfaces, audio-related interfaces, video-related interfaces, and audio/video transmission technology wireless broadcast (AirPlay) interfaces. Touchable layer 380 provides various common interface-related frameworks for application development, and touchable layer 380 is responsible for user touch interaction operations on mobile terminal 100. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework illustrated in FIG. 3, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 340 and a UIKit framework in the touchable layer 380. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a basic library of UI classes for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and the like.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a testing method for reporting an input event according to an embodiment of the present application. The test method for reporting the input event is used for obtaining the test event by obtaining the operation instruction issued by the application layer, and reporting the input event based on the bottom layer triggered by the test event, so that the problem that the performance test in the system directly realizes different application operations in the application layer, the process reported by equipment cannot be truly restored, and the reliability of software quality and user experience are improved. In a specific embodiment, the test method for reporting the input event is applied to the test apparatus 400 for reporting the input event shown in fig. 11 and the mobile terminal 100 (fig. 1) configured with the test apparatus 400 for reporting the input event. The following will describe a specific process of this embodiment by taking a mobile terminal as an example, and it is understood that the mobile terminal applied in this embodiment may be an electronic device with an operating system, such as a smart phone, a tablet computer, and a wearable electronic device, and is not limited herein. As will be described in detail with respect to the flow shown in fig. 4, the method for testing the input event report may specifically include the following steps:
step S110: and acquiring an operation instruction issued by an application layer of the operation system.
In this embodiment, an operation instruction issued by an application layer of an operating system may be obtained. As a mode, the operation instruction of the application layer may be preset and stored locally in the mobile terminal, and is issued to the bottom layer of the operating system when the test of input event reporting is performed; as another mode, the operation instruction of the application layer may be preset and stored in the server, and when the test for reporting the input event is performed, the operation instruction is sent to the application layer of the operating system of the mobile terminal through the server, and is issued to the bottom layer of the operating system by the application layer of the operating system.
In some embodiments, the operation instruction issued by the application layer of the operating system may include, but is not limited to: starting up, shutting down, unlocking a screen, locking the screen, playing music, increasing volume, reducing volume, taking pictures and the like.
In some embodiments, when performing a test of reporting an input event, an application layer of the operating system may issue an operation instruction in real time, may issue the operation instruction at preset time intervals, may issue the operation instruction at preset time, may issue the operation instruction based on a trigger operation, may issue the operation instruction based on other preset manners, and the like, which is not limited herein.
In some embodiments, the operation instructions issued by the application layer of the operating system each time may be the same or different, for example, the operation instructions issued by the application layer of the operating system each time may all be power on, power off, screen lock, and the like, and for example, the operation instructions issued by the application layer of the operating system each time may be a cycle of power on, power off, screen unlock, screen lock, music playing, volume increase, volume reduction, photographing, and the like, which is not limited herein.
In some embodiments, when performing a test of reporting an input event, the number of times of an operation instruction issued by an application layer of an operating system may be set, for example, when performing the test of reporting the input event, the number of times of the same operation instruction issued by the application layer of the operating system may be set as a preset number of times, for example, the number of times of booting issued by the application layer of the operating system is set as a first preset number of times, the number of times of screen locking issued by the application layer of the operating system is set as a second preset number of times, and the like, which is not limited herein. When the input event report is tested, the number of times of the operation instruction issued by the application layer of the operating system within the preset time may be set, for example, when the input event report is performed, the number of times of the same operation instruction issued by the application layer of the operating system within the preset time may be set as a preset number of times, for example, the number of times of booting the application layer of the operating system within the preset time is set as a first preset number of times, and the number of times of screen locking issued by the application layer of the operating system within the preset time is set as a second preset number of times, and the like, which are not limited herein.
Step S120: and analyzing the operation instruction to obtain a test event corresponding to the operation instruction.
In some embodiments, after receiving an operation instruction issued by an application layer, a bottom layer of an operating system may analyze the operation instruction to obtain a test event corresponding to the operation instruction. The operating system can register a simulation input processing driver in advance, and accordingly, after the bottom layer of the operating system receives an operating instruction issued by the application layer, the operating instruction can be analyzed through the simulation input processing driver so as to obtain a test event corresponding to the operating instruction.
In some embodiments, the operation instruction issued by the application layer of the operating system may be set according to a preset format, that is, the operation instruction issued by the application layer of the operation instruction may be in the preset format, and then, when the operation instruction in the preset format issued by the application layer is received by the bottom layer of the operating system, the preset format may be analyzed to obtain the test event corresponding to the operation instruction in the preset format. As a manner, different operation instructions issued by the application layer of the operating system may correspond to different preset formats, for example, when the operation instructions issued by the application layer of the operating system are power-on, the operation instructions may correspond to a first preset format, and when the operation instructions issued by the application layer of the operating system are screen-lock, the operation instructions may correspond to a second preset format, which is not limited herein. The preset format may be a command format according to a combination of numbers or characters.
In some embodiments, the test event corresponding to the operation instruction obtained by parsing the operation instruction may include: the event type, the event action for the event type, the action duration for the event action, the action distance for the event action, etc., are not limited herein. The event type may include a physical key event type or a touch display event type. Wherein the event action for the event type may include: a pressing action or a lifting action on a physical key, or a clicking action or a sliding action on a touch display screen. Wherein, the action duration for the event action may include: the pressing duration acting on the physical key, or the clicking duration or the sliding duration acting on the touch display screen. Wherein, the action distance for the event action may include: a pressing distance acting on a physical key, or a click record or sliding distance acting on a touch display screen.
Step S130: and triggering the bottom layer of the operating system to report the input event based on the test event.
In this embodiment, when a test event corresponding to the operation instruction is obtained, the bottom layer of the operating system may be triggered to report the input event based on the test event. In some embodiments, when the operation instruction is analyzed by the simulation input processing driver to obtain the test event corresponding to the operation instruction, the bottom layer of the operation system may be triggered to report the input event by the simulation input event. For example, when the test event is a pressing action acting on a physical key, the simulation input processing driver may trigger the bottom layer of the operating system to report the physical key pressing event, and when the test event is a sliding action acting on the touch display screen, the simulation input processing driver may trigger the bottom layer of the operating system to report the sliding event of the touch display screen.
In some embodiments, as shown in fig. 5, taking an operating system as an android system as an example, when a bottom layer of the operating system reports an input event based on a test event, an event hub layer of an android subsystem is reported by triggering a bottom layer input event and processing the input code core layer, and then an application layer of an input of the android system receives the report of the input event and implements different operations according to the report of the input event, thereby restoring a real reporting flow.
For example, when the operation instruction issued by the application layer is "shutdown", the test event corresponding to the operation instruction obtained by analyzing the operation instruction may be "the pressing action acting on the power key exceeds 5 seconds", then the simulation input processing driver may trigger the bottom layer of the operation system to report the input event based on the test event "the pressing action acting on the power key exceeds 5 seconds", and the simulation input processing driver triggers the bottom layer input event based on the "the pressing action acting on the power key exceeds 5 seconds", and reports the event hub layer of the android subsystem through the processing of the input code core layer, and then the application layer of the input of the android system receives the report of the input event and shuts down according to the report of the input event, thereby restoring the real reporting flow.
For example, when the operation instruction issued by the application layer is "unlock", the test event corresponding to the operation instruction obtained by analyzing the operation instruction may be "the sliding distance acting on the touch display screen is the preset distance", then, the simulation input processing driver may trigger the bottom layer of the operation system to report the input event based on "the sliding distance acting on the touch display screen is the preset distance" of the test event, the simulation input processing driver triggers the bottom layer input event based on "the sliding distance acting on the touch display screen is the preset distance", the bottom layer input event is reported through the processing of the input code core layer, and then the application layer of the input of the android system receives the report of the input event and unlocks according to the report of the input event, so that the real reported flow is restored.
According to the method for testing the reporting of the input event, the operation instruction issued by the application layer of the operation system is obtained, the operation instruction is analyzed, the test event corresponding to the operation instruction is obtained, the bottom layer of the operation system is triggered to report the input event based on the test event, the test event is obtained by obtaining the operation instruction issued by the application layer, the bottom layer is triggered to report the input event based on the test event, the problem that different application operations are directly realized on the application layer by performance testing in the system is solved, the process reported by equipment cannot be truly restored, and the reliability of software quality and user experience are improved.
Referring to fig. 6, fig. 6 is a schematic flowchart illustrating a testing method for reporting an input event according to another embodiment of the present application. The method is applied to the mobile terminal, the mobile terminal is provided with an operating system, and the following will explain in detail with respect to the flow shown in fig. 6, where the method for testing the input event report specifically includes the following steps:
step S210: and monitoring a test scene of an application layer of the operating system.
In some embodiments, a plurality of test scenarios for the application layer of the operating system may be preset, and the plurality of test scenarios for the application layer of the operating system may be stored locally in the mobile terminal after the setting is completed, or may be stored in a server in communication connection with the mobile terminal after the setting is completed. When the test scenario for the application layer of the operating system is stored in the local of the mobile terminal and a test for reporting the input event is performed, the mobile terminal may directly read the test scenario for the application layer of the operating system from the local, and when the test scenario for the application layer of the operating system is stored in a server in communication connection with the mobile terminal and a test for reporting the input event is performed, the mobile terminal may obtain the test scenario for the application layer of the operating system from the server, which is not limited herein.
In some approaches, a test scenario for an application layer of an operating system may include: a video playing scene, an unlocking scene, a screen locking scene, a starting scene, a shutdown scene, a photographing scene, a music playing scene, and the like, which are not limited herein.
As one mode, the mobile terminal may randomly apply a test scenario of an application layer of the operating system and monitor the applied test scenario, for example, the mobile terminal may randomly select a test scenario of the application layer from test scenarios such as a video playing scenario, an unlocking scenario, a screen locking scenario, a power-on scenario, a power-off scenario, a photographing scenario, and a music playing scenario. As another way, the mobile terminal may sequentially apply test scenes of an application layer of the operating system and monitor the applied test scenes, for example, the mobile terminal may sequentially select a test scene of the application layer from test scenes such as a video playing scene, an unlocking scene, a screen locking scene, a power-on scene, a power-off scene, a photographing scene, and a music playing scene. As another way, the mobile terminal may repeatedly apply the test scenario of the application layer of the operating system within the preset time, and monitor the applied test scenario, for example, the mobile terminal may repeatedly select a certain test scenario from the test scenarios such as a video playing scenario, an unlocking scenario, a screen locking scenario, a power-on scenario, a power-off scenario, a photographing scenario, and a music playing scenario within the preset time as the test scenario of the application layer.
Step S220: and acquiring an operation instruction which is generated and issued by the application layer of the operating system based on the test scene.
In some embodiments, after monitoring a test scenario of an application layer of an operating system, an operation instruction generated and issued by the application layer of the operating system based on the test scenario may be obtained. For example, when it is monitored that the test scenario of the application layer of the operating system is the "photographing scenario", the operation instruction "start, unlock, enter photographing application" may be generated based on the test scenario.
Step S230: analyzing the operation instruction to obtain an event type corresponding to the operation instruction, wherein the event type comprises a physical key event type or a touch display screen event type.
In some embodiments, after receiving an operation instruction issued by an application layer, a bottom layer of an operating system may analyze the operation instruction to obtain an event type corresponding to the operation instruction, where the event type may include a physical key event type or a touch display screen event type, and the physical key event type may include: a power key event type, a volume key event type, a fingerprint key event type, etc., which are not limited herein.
In some embodiments, as shown in fig. 7, taking an operating system as an android system as an example, linux bottom-layer file nodes may be registered in the operating system in advance, where the linux bottom-layer file nodes mainly register two event types, that is, a physical key event type and a touch display screen event type, so that an operation instruction can be issued to the linux bottom-layer file nodes to obtain an event type corresponding to the operation instruction, and triggering of reporting an event is performed by simulating an input processing driver.
Step S240: and triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
In some embodiments, a timer with a variable period may be registered in the operating system in advance, and the reporting frequency of the test event may be set as the preset reporting frequency based on the timer with the variable period registered in advance. Therefore, in this embodiment, when the test event corresponding to the operation instruction is obtained, the preset reporting frequency set by the timer with the variable period may be obtained, and based on the test event and the preset reporting frequency, the bottom layer of the operating system is triggered to report the input event. For example, when the preset reporting frequency set by the timer with the variable period is to report a test event every 1 minute, the bottom layer of the operating system may be triggered to report an input event every 1 minute when the test event corresponding to the operation instruction is obtained.
In another embodiment of the present application, a test scenario of an application layer of an operating system is monitored, an operation instruction generated and issued by the application layer of the operating system based on the test scenario is obtained, the operation instruction is analyzed, an event type corresponding to the operation instruction is obtained, where the event type includes a physical key event type and a touch display screen event type, and based on the test event and a preset reporting frequency, a bottom layer of the operating system is triggered to report the input event. Compared with the test method for reporting the input event shown in fig. 4, the embodiment also generates and issues the operation instruction based on the test scenario of the application layer, so as to improve the accuracy and the rationality of the operation instruction. In addition, the embodiment also obtains the event type corresponding to the operation instruction so as to accurately restore the report of the physical device.
Referring to fig. 8, fig. 8 is a flowchart illustrating a testing method for reporting an input event according to yet another embodiment of the present application. The method is applied to the mobile terminal, the mobile terminal is provided with an operating system, and the following will explain in detail with respect to the flow shown in fig. 8, where the method for testing the input event report specifically includes the following steps:
step S310: and monitoring a test scene of an application layer of the operating system.
Step S320: and acquiring an operation instruction which is generated and issued by the application layer of the operating system based on the test scene.
For the detailed description of steps S310 to S320, please refer to steps S210 to S220, which are not described herein again.
Step S330: analyzing the operation instruction to obtain an event type corresponding to the operation instruction and an event action aiming at the event type, wherein the event action comprises a pressing action or a lifting action acting on a physical key, or a clicking action or a sliding action acting on a touch display screen.
In some embodiments, after receiving an operation instruction issued by an application layer, a bottom layer of an operating system may analyze the operation instruction to obtain an event type corresponding to the operation instruction and an event action for the event type, where the event type may include a physical key event type or a touch display screen event type, and the physical key event type may include: a power key event type, a volume key event type, a fingerprint key event type, etc., without limitation, and the event action may include a pressing action or a lifting action on a physical key, or a clicking action or a sliding action for a touch display screen.
Step S340: and triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
For detailed description of step S340, please refer to step S240, which is not described herein.
In another embodiment of the present application, a test scenario of an application layer of an operating system is monitored, an operation instruction generated and issued by the application layer of the operating system based on the test scenario is obtained, the operation instruction is analyzed, an event type corresponding to the operation instruction and an event action for the event type are obtained, where the event type includes a physical key event type and a touch display screen event type, the event action includes a pressing action or a lifting action acting on a physical key, or a clicking action or a sliding action acting on a touch display screen, and based on the test event and a preset reporting frequency, a bottom layer of the operating system is triggered to report the input event. Compared with the test method for reporting the input event shown in fig. 4, the embodiment also generates and issues the operation instruction based on the test scenario of the application layer, so as to improve the accuracy and the rationality of the operation instruction. In addition, the embodiment also obtains the event type corresponding to the operation instruction and the event action aiming at the event type so as to accurately restore the report of the physical device.
Referring to fig. 9, fig. 9 is a schematic flowchart illustrating a testing method for reporting an input event according to another embodiment of the present application. The method is applied to the mobile terminal, the mobile terminal is provided with an operating system, and the following will explain in detail with respect to the flow shown in fig. 9, where the method for testing the input event report specifically includes the following steps:
step S410: and monitoring a test scene of an application layer of the operating system.
Step S420: and acquiring an operation instruction which is generated and issued by the application layer of the operating system based on the test scene.
For the detailed description of steps S410 to S420, refer to steps S210 to S220, which are not described herein again.
Step S430: analyzing the operation instruction to obtain an event type corresponding to the operation instruction, an event action aiming at the event type and operation duration aiming at the event action, wherein the operation duration comprises pressing duration acting on a physical key or clicking duration or sliding duration acting on a touch display screen.
In some embodiments, after receiving an operation instruction issued by an application layer, a bottom layer of an operating system may analyze the operation instruction to obtain an event type corresponding to the operation instruction, an event action for the event type, and an operation duration for the event action, where the event type may include a physical key event type or a touch display screen event type, and the physical key event type may include: the event action may include a pressing action or a lifting action acting on a physical key, or a clicking action or a sliding action used on a touch display screen, and the operation duration includes a pressing duration acting on the physical key, or a clicking duration or a sliding duration acting on the touch display screen, wherein the pressing duration may be 500ms, the clicking duration may be 500ms, and the sliding duration may be 1 s.
Step S440: and triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
For detailed description of step S440, please refer to step S240, which is not described herein.
In another embodiment of the present application, a test method for reporting an input event monitors a test scenario of an application layer of an operating system, obtains an operation instruction generated and issued by the application layer of the operating system based on the test scenario, analyzing the operation instruction to obtain an event type corresponding to the operation instruction, an event action aiming at the event type and an operation duration aiming at the event action, wherein the event type comprises a physical key event type and a touch display screen event type, the event action comprises a pressing action or a lifting action acted on the physical key, or a click action or a slide action acting on the touch display screen, the operation duration comprises a pressing duration acting on the physical key, or the click duration or the sliding duration acts on the touch display screen, and the bottom layer of the operating system is triggered to report the input event based on the test event and the preset reporting frequency. Compared with the test method for reporting the input event shown in fig. 4, the embodiment also generates and issues the operation instruction based on the test scenario of the application layer, so as to improve the accuracy and the rationality of the operation instruction. In addition, the embodiment further obtains an event type corresponding to the operation instruction, an event action for the event type, and an operation duration for the event action, so as to accurately restore the report of the physical device.
Referring to fig. 10, fig. 10 is a schematic flowchart illustrating a testing method for reporting an input event according to yet another embodiment of the present application. The method is applied to the mobile terminal, the mobile terminal is provided with an operating system, and the following will explain in detail with respect to the flow shown in fig. 10, where the method for testing the input event report specifically includes the following steps:
step S510: and monitoring a test scene of an application layer of the operating system.
Step S520: and acquiring an operation instruction which is generated and issued by the application layer of the operating system based on the test scene.
For the detailed description of steps S410 to S420, refer to steps S210 to S220, which are not described herein again.
Step S530: analyzing the operation instruction to obtain an event type corresponding to the operation instruction, an event action aiming at the event type and an operation distance aiming at the event action, wherein the operation distance comprises a pressing distance acting on a physical key or a clicking distance or a sliding distance acting on a touch display screen.
In some embodiments, after receiving an operation instruction issued by an application layer, a bottom layer of an operating system may analyze the operation instruction to obtain an event type corresponding to the operation instruction, an event action for the event type, and an operation distance for the event action, where the event type may include a physical key event type or a touch display screen event type, and the physical key event type may include: a power key event type, a volume key event type, a fingerprint key event type, etc., which are not limited herein, the event action may include a pressing action or a lifting action on a physical key, or a clicking action or a sliding action for a touch display screen, and the operation distance includes a pressing distance on the physical key, or a clicking distance or a sliding distance on the touch display screen, wherein the pressing distance may be 0, the clicking distance may be 0, and the sliding distance may be a distance from x1y1 to x100y 100.
Step S540: and triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
For detailed description of step S540, please refer to step S240, which is not described herein again.
In another embodiment of the present application, a test method for reporting an input event is provided, which monitors a test scenario of an application layer of an operating system, obtains an operation instruction generated and issued by the application layer of the operating system based on the test scenario, analyzing the operation instruction to obtain an event type corresponding to the operation instruction, an event action aiming at the event type and an operation distance aiming at the event action, wherein the event type comprises a physical key event type and a touch display screen event type, the event action comprises a pressing action or a lifting action acted on the physical key, or a click action or a slide action acting on the touch display screen, the operating distance comprising a pressing distance acting on the physical key, or the click distance or the sliding distance acts on the touch display screen, and the bottom layer of the operating system is triggered to report the input event based on the test event and the preset reporting frequency. Compared with the test method for reporting the input event shown in fig. 4, the embodiment also generates and issues the operation instruction based on the test scenario of the application layer, so as to improve the accuracy and the rationality of the operation instruction. In addition, the embodiment further obtains an event type corresponding to the operation instruction, an event action for the event type, and an operation distance for the event action, so as to accurately restore the report of the physical device.
Referring to fig. 11, fig. 11 is a block diagram illustrating a testing apparatus 400 for reporting an input event according to an embodiment of the present disclosure. The test device 400 for reporting the input event is applied to the mobile terminal, the mobile device is installed with an operating system, and as will be explained below with reference to the block diagram shown in fig. 11, the test device 400 for reporting the input event includes: an operation instruction obtaining module 410, a test event obtaining module 420 and an input event reporting triggering module 430, wherein:
an operation instruction obtaining module 410, configured to obtain an operation instruction issued by an application layer of the operating system.
Further, the operation instruction obtaining module 410 includes: the test scene monitoring submodule and the operation instruction acquisition submodule, wherein:
and the test scene monitoring submodule is used for monitoring the test scene of the application layer of the operating system.
And the operation instruction acquisition sub-module is used for acquiring an operation instruction which is generated and issued by the application layer of the operation system based on the test scene.
The test event obtaining module 420 is configured to analyze the operation instruction to obtain a test event corresponding to the operation instruction.
Further, the test event obtaining module 420 includes: an event type obtaining submodule, wherein:
and the event type obtaining submodule is used for analyzing the operation instruction to obtain an event type corresponding to the operation instruction, wherein the event type comprises a physical key event type or a touch display screen event type.
Further, the event type obtaining sub-module includes: event action obtaining unit for
And the event action obtaining unit is used for analyzing the operation instruction to obtain the event type and an event action aiming at the event type, wherein the event action comprises a pressing action or a lifting action acting on a physical key or a clicking action or a sliding action acting on a touch display screen.
Further, the event action obtaining unit includes: an operation duration obtaining subunit, wherein:
and the operation duration obtaining submodule is used for analyzing the operation instruction and obtaining the operation duration of the event action, wherein the operation duration comprises press duration acting on a physical key or click duration or sliding duration acting on a touch display screen.
Further, the event action obtaining unit includes: an operating distance obtaining subunit, wherein:
and the operation distance obtaining subunit is configured to analyze the operation instruction to obtain an operation distance of the event action, where the operation distance includes a pressing distance acting on a physical key, or a clicking distance or a sliding distance acting on the touch display screen.
An input event reporting triggering module 430, configured to trigger a bottom layer of the operating system to report an input event based on the test event.
Further, the input event reporting triggering module 430 includes: an input event reporting triggering submodule, wherein:
and the input event reporting triggering submodule is used for triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 12, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 500 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 500 includes a non-volatile computer-readable storage medium. The computer readable storage medium 500 has storage space for program code 510 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 510 may be compressed, for example, in a suitable form.
To sum up, the method, the device, the mobile terminal and the storage medium for testing reporting of an input event provided in the embodiment of the present application acquire an operation instruction issued by an application layer of an operation system, analyze the operation instruction, acquire a test event corresponding to the operation instruction, and trigger a bottom layer of the operation system to report the input event based on the test event, so that the test event is acquired by acquiring the operation instruction issued by the application layer, and the bottom layer is triggered to report the input event based on the test event, thereby solving the problem that a performance test in the system directly realizes different application operations on the application layer, and cannot truly restore a flow reported by a device, and improving reliability of software quality and user experience.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A test method for reporting an input event is applied to a mobile terminal, wherein the mobile terminal is provided with an operating system, and the method comprises the following steps:
acquiring an operation instruction issued by an application layer of the operation system;
analyzing the operation instruction to obtain a test event corresponding to the operation instruction;
and triggering the bottom layer of the operating system to report the input event based on the test event.
2. The method of claim 1, wherein the monitoring the operation command issued by the application layer of the operating system comprises:
monitoring a test scene of an application layer of the operating system;
and acquiring an operation instruction which is generated and issued by the application layer of the operating system based on the test scene.
3. The method according to claim 1, wherein the analyzing the operation instruction to obtain the test event corresponding to the operation instruction comprises:
analyzing the operation instruction to obtain an event type corresponding to the operation instruction, wherein the event type comprises a physical key event type or a touch display screen event type.
4. The method according to claim 3, wherein the analyzing the operation instruction to obtain the event type corresponding to the operation instruction comprises:
analyzing the operation instruction to obtain the event type and an event action aiming at the event type, wherein the event action comprises a pressing action or a lifting action acting on a physical key or a clicking action or a sliding action acting on a touch display screen.
5. The method of claim 4, wherein the parsing the operation instruction to obtain the event type and the event action for the event type comprises:
analyzing the operation instruction to obtain the operation duration of the event action, wherein the operation duration comprises press duration acting on a physical key, or click duration or sliding duration acting on a touch display screen.
6. The method of claim 4, wherein the parsing the operation instruction to obtain the event type and the event action for the event type comprises:
and analyzing the operation instruction to obtain an operation distance of the event action, wherein the operation distance comprises a pressing distance acting on a physical key, or a clicking distance or a sliding distance acting on a touch display screen.
7. The method according to any one of claims 1 to 6, wherein the triggering, based on the test event, the underlying layer of the operating system to report the input event comprises:
and triggering the bottom layer of the operating system to report the input event based on the test event and the preset reporting frequency.
8. A testing device for reporting an input event is applied to a mobile terminal, wherein the mobile terminal is provided with an operating system, and the method comprises the following steps:
the operation instruction acquisition module is used for acquiring an operation instruction issued by an application layer of the operation system;
the test event obtaining module is used for analyzing the operation instruction to obtain a test event corresponding to the operation instruction;
and the input event reporting triggering module is used for triggering the bottom layer of the operating system to report the input event based on the test event.
9. A mobile terminal comprising a memory and a processor, the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN202010105110.XA 2020-02-20 2020-02-20 Test method and device for reporting input event, mobile terminal and storage medium Pending CN111352790A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010105110.XA CN111352790A (en) 2020-02-20 2020-02-20 Test method and device for reporting input event, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010105110.XA CN111352790A (en) 2020-02-20 2020-02-20 Test method and device for reporting input event, mobile terminal and storage medium

Publications (1)

Publication Number Publication Date
CN111352790A true CN111352790A (en) 2020-06-30

Family

ID=71198009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010105110.XA Pending CN111352790A (en) 2020-02-20 2020-02-20 Test method and device for reporting input event, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111352790A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024819A (en) * 2021-09-29 2022-02-08 苏州浪潮智能科技有限公司 Event information reporting method and device
CN114546549A (en) * 2022-01-24 2022-05-27 中国第一汽车股份有限公司 Application program control method, gesture processing device, intelligent terminal and vehicle
CN117692483A (en) * 2023-08-18 2024-03-12 荣耀终端有限公司 Input event transmission method, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911059A (en) * 1996-12-18 1999-06-08 Applied Microsystems, Inc. Method and apparatus for testing software
CN1773473A (en) * 2004-11-10 2006-05-17 张冉 Method for realizing electronic music signal inputting equipment utilizing software virtual technique combined with hardware
CN101859272A (en) * 2009-04-09 2010-10-13 大唐移动通信设备有限公司 Method, system and device for simulating embedded software system
CN104317715A (en) * 2014-10-30 2015-01-28 南京富士通南大软件技术有限公司 Simulator based automatic functional test implementation method for central processing unit instruction sets
CN106126424A (en) * 2016-06-29 2016-11-16 厦门美图移动科技有限公司 A kind of visual automated testing method of script, device and mobile terminal
CN109388532A (en) * 2018-09-26 2019-02-26 Oppo广东移动通信有限公司 Test method, device, electronic equipment and computer-readable storage medium
CN109885245A (en) * 2019-02-21 2019-06-14 Oppo广东移动通信有限公司 Application control method, apparatus, terminal device and computer-readable storage medium
CN109992464A (en) * 2019-03-25 2019-07-09 东风航盛(武汉)汽车控制系统有限公司 A kind of VCU automatic test approach that integrated application layer software is write with a brush dipped in Chinese ink
DE102019003851A1 (en) * 2018-06-01 2019-12-05 The Mathworks, Inc. Systems and methods for the automatic realization of models for co-simulation

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5911059A (en) * 1996-12-18 1999-06-08 Applied Microsystems, Inc. Method and apparatus for testing software
CN1773473A (en) * 2004-11-10 2006-05-17 张冉 Method for realizing electronic music signal inputting equipment utilizing software virtual technique combined with hardware
CN101859272A (en) * 2009-04-09 2010-10-13 大唐移动通信设备有限公司 Method, system and device for simulating embedded software system
CN104317715A (en) * 2014-10-30 2015-01-28 南京富士通南大软件技术有限公司 Simulator based automatic functional test implementation method for central processing unit instruction sets
CN106126424A (en) * 2016-06-29 2016-11-16 厦门美图移动科技有限公司 A kind of visual automated testing method of script, device and mobile terminal
DE102019003851A1 (en) * 2018-06-01 2019-12-05 The Mathworks, Inc. Systems and methods for the automatic realization of models for co-simulation
CN109388532A (en) * 2018-09-26 2019-02-26 Oppo广东移动通信有限公司 Test method, device, electronic equipment and computer-readable storage medium
CN109885245A (en) * 2019-02-21 2019-06-14 Oppo广东移动通信有限公司 Application control method, apparatus, terminal device and computer-readable storage medium
CN109992464A (en) * 2019-03-25 2019-07-09 东风航盛(武汉)汽车控制系统有限公司 A kind of VCU automatic test approach that integrated application layer software is write with a brush dipped in Chinese ink

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王世好等: "嵌入式系统软硬件协同验证中软件验证方法" *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024819A (en) * 2021-09-29 2022-02-08 苏州浪潮智能科技有限公司 Event information reporting method and device
CN114024819B (en) * 2021-09-29 2023-08-08 苏州浪潮智能科技有限公司 Event information reporting method and device
CN114546549A (en) * 2022-01-24 2022-05-27 中国第一汽车股份有限公司 Application program control method, gesture processing device, intelligent terminal and vehicle
CN117692483A (en) * 2023-08-18 2024-03-12 荣耀终端有限公司 Input event transmission method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108763012B (en) Card pause information acquisition method and device and terminal
CN107889070B (en) Picture processing method, device, terminal and computer readable storage medium
CN111352790A (en) Test method and device for reporting input event, mobile terminal and storage medium
CN111427803B (en) Automated random test method, apparatus, computer device and medium
CN111459586B (en) Remote assistance method, device, storage medium and terminal
CN114779987B (en) Method, device, terminal and storage medium for displaying content
CN107608550B (en) Touch operation response method and device
CN105260082B (en) A kind of test data methods of exhibiting and exploitation terminal
CN109446025B (en) Operation behavior playback method and device, electronic equipment and readable medium
CN110442267B (en) Touch operation response method and device, mobile terminal and storage medium
CN112653670A (en) Service logic vulnerability detection method, device, storage medium and terminal
CN109976966A (en) A kind of application program launching time counting method, apparatus and system
CN109391734A (en) Data transmission method for uplink, device, terminal and storage medium
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
US20130290934A1 (en) Monitoring applications executing on a computer device using programmatic triggers
CN112650959B (en) Page loading time length statistical method, device, equipment and storage medium
CN117632746A (en) Pile inserting processing method and device, storage medium and electronic equipment
CN112423024A (en) Video transcoding method and device, computer equipment and storage medium
CN111124627B (en) Method and device for determining call initiator of application program, terminal and storage medium
CN107765858B (en) Method, device, terminal and storage medium for determining face angle
CN108289056B (en) Method and device for sharing dynamic chart and computing equipment
CN113825022B (en) Method and device for detecting play control state, storage medium and electronic equipment
CN111556482B (en) Virtual SIM card switching method and device, storage medium and terminal
CN113342341A (en) Page creating method, device and system and storage medium
CN112685045A (en) Page source file processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200630