CN117668835A - Application detection method, electronic device and storage medium - Google Patents

Application detection method, electronic device and storage medium Download PDF

Info

Publication number
CN117668835A
CN117668835A CN202211047270.9A CN202211047270A CN117668835A CN 117668835 A CN117668835 A CN 117668835A CN 202211047270 A CN202211047270 A CN 202211047270A CN 117668835 A CN117668835 A CN 117668835A
Authority
CN
China
Prior art keywords
page
detection
application
target instruction
log
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
CN202211047270.9A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211047270.9A priority Critical patent/CN117668835A/en
Publication of CN117668835A publication Critical patent/CN117668835A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The application provides an application detection method, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a detection task sent by second equipment, wherein the detection task comprises an application installation package and a detection strategy of an application to be detected; installing the tested application based on the application installation package; opening the tested application, and detecting the page of the tested application by using the detection strategy to obtain a page detection result; and sending the page detection result to the second device, so that the second device determines the detection result of the tested application based on the page detection result. The method provided by the embodiment of the application is beneficial to improving the efficiency of application detection.

Description

Application detection method, electronic device and storage medium
Technical Field
The application relates to the field of intelligent terminals, in particular to an application detection method, electronic equipment and a storage medium.
Background
As the functions of electronic devices such as mobile phones become more powerful, applications installed on the electronic devices become more and more, and types of the electronic devices become more and more abundant. Various application stores will put on top of a large number of applications each day, which may also contain some malicious applications that may present security compliance problems. Therefore, how to effectively detect whether there is a safety compliance hidden trouble in these applications is a problem that needs to be solved at present.
Disclosure of Invention
The application detection method, the electronic device and the storage medium are beneficial to improving the efficiency of application detection.
In a first aspect, the present application provides an application detection method, applied to a first device, including:
receiving a detection task sent by second equipment, wherein the detection task comprises an application installation package and a detection strategy of an application to be detected;
installing the tested application based on the application installation package;
opening the tested application, and detecting the page of the tested application by using the detection strategy to obtain a page detection result;
and sending the page detection result to the second device, so that the second device determines the detection result of the tested application based on the page detection result.
According to the method and the device, the page of the tested application is analyzed and operated at the terminal equipment, so that the traditional application detection flow led by the server can be simplified, the layout of elements in the redundant page is not required to be acquired and transmitted in the detection process, the data interaction quantity and interaction time are saved, and the detection efficiency is improved.
In one possible implementation manner, the method further includes:
in the page detection process, determining a target instruction based on a first page of the tested application, wherein the target instruction is an instruction for simulating a user to operate the page;
If the target instruction is not an ending instruction, acquiring a second page according to the target instruction, and detecting the second page;
and repeating the page detection step until the target instruction is an ending instruction, and stopping page detection.
In the method, the specified scene is detected by simulating the instruction of the user, so that invalid and repeated detection scenes can be avoided, the efficiency caused by blind traversal is low, the detection time is saved, and the condition that the specific scene is not detected due to a large number of invalid and repeated detection scenes can be avoided.
In one possible implementation manner, before the determining the target instruction based on the first page of the application under test, the method further includes:
pre-analyzing the first page of the tested application;
and determining whether a Document Object Model (DOM) tree is needed according to the pre-analysis result, wherein the DOM tree is used for assisting in detecting the page.
In the method, the DOM tree can be prevented from being acquired as required, so that a large amount of data interaction with the server equipment is avoided, and resources and time can be saved.
In one possible implementation manner, the method further includes:
If the Document Object Model (DOM) tree is determined to be needed, requesting the DOM tree from the second equipment, and detecting the first page based on the DOM tree and the screenshot of the first page; or alternatively, the first and second heat exchangers may be,
and if the DOM tree is not needed, detecting the first page based on the screenshot of the first page.
In the method, the DOM tree is obtained, and the DOM tree and the page screenshot are stored on the terminal equipment, so that the resource utilization rate can be improved, and the storage resources of the server equipment can be saved.
In one possible implementation manner, the determining the target instruction based on the first page of the application under test includes:
and if the DOM tree is acquired, determining a target instruction based on the DOM tree and the screenshot of the first page.
In the method, the target instruction is determined through combination of the DOM tree and the page screenshot, so that the accuracy of the target instruction can be improved, a specific test scene can be found more accurately, and the test efficiency can be improved.
In one possible implementation manner, the sending the page detection result to the second device includes:
acquiring a log; the log is generated in the detection process of the application to be detected;
And sending the log and the page detection result to the second equipment.
In the method, the log auxiliary page detection result is analyzed, so that the accuracy of the detection result of the detected application is improved.
In one possible implementation manner, the log includes a user behavior log and an event response log, where the user behavior log is a log generated by the first device by simulating the user behavior, and the event response log is a log generated by the first device by responding to the simulated user behavior.
In one possible implementation manner, the determining the target instruction based on the first page of the application under test includes:
if the page type of the first page is a preset test scene, detecting the first page to obtain a detection result of the first page, and determining a target instruction based on a preset detection requirement in the detection strategy and a page screenshot of the first page; or alternatively, the first and second heat exchangers may be,
if the page type of the first page is not a preset test scene, determining a target instruction based on the page type of the first page.
In the method, the specified test scene is quickly found in the page detection process, and the instruction of the simulation user is triggered through the efficient event in the specified test scene to detect, so that a large number of invalid and repeated test scenes can be avoided, resource consumption of a server can be saved, and the detection efficiency is improved.
In one possible implementation manner, the determining the target instruction based on the preset detection requirement in the detection policy and the screenshot of the first page includes:
identifying a screenshot of the first page to obtain element information in the first page, wherein the element information comprises an element name and an element position;
and determining a target instruction based on the preset detection requirement in the detection strategy and the element information.
In one possible implementation manner, the detection strategy includes a plurality of detection items, and the method further includes:
in the page detection process, for any page, after the detection of the plurality of detection items is executed, the detection of the next page is executed; or alternatively, the first and second heat exchangers may be,
in the page detection process, for any detection item, after detection of a plurality of pages is performed, detection of the next detection item is performed.
In the application, detection is performed through different dimensions, so that the detection flexibility can be improved.
In a second aspect, the present application provides a first apparatus comprising means/units for performing the method of the first aspect or any one of the possible designs of the first aspect; these modules/units may be implemented by hardware, or may be implemented by hardware executing corresponding software.
In a third aspect, the present application provides a first apparatus comprising: a processor and a memory for storing a computer program; the processor is configured to run the computer program to implement the application detection method as described in the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored therein, which when run on a computer causes the computer to implement the application detection method as described in the first aspect.
Drawings
FIG. 1 is a schematic structural view of one embodiment of a first apparatus provided herein;
fig. 2 is an application scenario architecture diagram provided in an embodiment of the present application;
fig. 3 is a schematic software architecture of a detection application according to an embodiment of the present application;
fig. 4 is a schematic system architecture diagram of an online detection platform according to an embodiment of the present application;
FIG. 5 is a flow chart of one embodiment of an application detection method provided herein;
FIG. 6 is a flowchart illustrating another embodiment of an application detection method provided in the present application;
fig. 7 is a schematic structural diagram of another embodiment of the first device provided in the present application.
Detailed Description
In the embodiment of the present application, unless otherwise specified, the character "/" indicates that the front-rear association object is one or a relationship. For example, A/B may represent A or B. "and/or" describes an association relationship of an association object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone.
It should be noted that the terms "first," "second," and the like in the embodiments of the present application are used for distinguishing between description and not necessarily for indicating or implying a relative importance or number of features or characteristics that are indicated, nor does it imply a sequential order.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. Furthermore, "at least one item(s)" below, or the like, refers to any combination of these items, and may include any combination of single item(s) or plural items(s). For example, at least one (one) of A, B or C may represent: a, B, C, a and B, a and C, B and C, or A, B and C. Wherein each of A, B, C may itself be an element or a collection comprising one or more elements.
In this application embodiments, "exemplary," "in some embodiments," "in another embodiment," etc. are used to indicate an example, instance, or illustration. Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the term use of an example is intended to present concepts in a concrete fashion.
"of", "corresponding" and "corresponding" in the embodiments of the present application may be sometimes used in combination, and it should be noted that the meaning to be expressed is consistent when the distinction is not emphasized. In the embodiments of the present application, communications and transmissions may sometimes be mixed, and it should be noted that, when the distinction is not emphasized, the meaning expressed is consistent. For example, a transmission may include sending and/or receiving, either nouns or verbs.
The equal to that relates to in this application embodiment can be with being greater than even using, is applicable to the technical scheme that adopts when being greater than, also can be with being less than even using, is applicable to the technical scheme that adopts when being less than. It should be noted that when the number is equal to or greater than the sum, the number cannot be smaller than the sum; when the value is equal to or smaller than that used together, the value is not larger than that used together.
As the functions of electronic devices such as mobile phones become more powerful, applications installed on the electronic devices become more and more, and types of the electronic devices become more and more abundant. Various application stores will put on top of a large number of applications each day, which may also contain some malicious applications that may present security compliance problems.
At present, the common application detection methods are: the server device firstly acquires a document object model (Document Object Model, DOM) tree structure and a screenshot of a page to be tested of the electronic device, and then traverses all the controls in the page layer by layer sequentially according to the DOM tree structure. Triggering as many events as possible on the tested application within a specified duration, and finally completing the detection task by analyzing the screenshot of the page, the user behavior and the event response log. Therefore, the detection mode of the traversal can traverse most repeated and invalid scenes to influence the detection effect, and illegal scenes can not be traversed in the appointed time, so that detection omission is caused, and the efficiency is low; in addition, the above traversal detection method also needs a large amount of information interaction between the server and the electronic device, so as to interact with the screenshot of the page and the DOM file, which consumes a large amount of transmission resources and a large amount of storage resources. Therefore, how to effectively detect whether there is a safety compliance hidden trouble in these applications is a problem that needs to be solved at present.
Based on the above problems, an embodiment of the present application provides an application detection method, which is applied to an electronic device. The electronic device may be a stationary device, such as a notebook computer, desktop computer, smart screen, or the like. The electronic device may also be a mobile device, such as a cell phone, pad, car set, etc., which may also be referred to as a User Equipment (UE), access terminal, subscriber unit, subscriber station, mobile station, remote terminal, terminal device, user terminal, wireless communication device, user agent, or User Equipment. The mobile device may be a Station (ST) in a WLAN, which may be a cellular telephone, a cordless telephone, a session initiation protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital assistant (Personal Digital Assistant, PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a car networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite radio, a wireless modem card, a television Set Top Box (STB), a customer premises equipment (customer premise equipment, CPE) and/or other devices for communicating over a wireless system as well as next generation communication systems, such as a mobile terminal in a 5G network or a mobile device in a future evolved public land mobile network (Public Land Mobile Network, PLMN) network, etc.
Fig. 1 first shows a schematic configuration of an electronic device 100.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present invention is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (FLED), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of thesusa, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip machine, the electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the detected opening and closing state of the leather sheath or the opening and closing state of the flip, the characteristics of automatic unlocking of the flip and the like are set.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode. When sufficient reflected light is detected, it may be determined that there is an object in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 may determine that there is no object in the vicinity of the electronic device 100. The electronic device 100 can detect that the user holds the electronic device 100 close to the ear by using the proximity light sensor 180G, so as to automatically extinguish the screen for the purpose of saving power. The proximity light sensor 180G may also be used in holster mode, pocket mode to automatically unlock and lock the screen.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
The application detection method provided in the embodiment of the present application will now be described with reference to fig. 2 to 6.
Fig. 2 is a schematic view of an application scenario provided in an embodiment of the present application. As shown in fig. 2, the application scenario may include a user, an online detection platform, a first device, and a second device. Wherein,
the online detection platform is a unified management platform facing to users and can be provided for users in a page portal management mode, wherein the users can be developers, application detectors and other types of users. The user can log in the online detection platform to create detection tasks and distribute the detection tasks.
The second device may be a server device, where the server device may be a local personal computer, or may be a cloud server. The second device may be, for example, a computer device of a Windows or Linux operating system. It will be appreciated that the second device may also be equipped with other operating systems, which embodiments of the present application are not particularly limited. The second device is responsible for managing the detection task of the first device, and has the capability of acquiring the DOM. The second device can detect the detected application in the one or more first devices, and can upload detection results to the online detection platform for users to view.
The first device may be the electronic device 100 described above, and the user may perform security compliance detection on the application under test in the first device through the second device. The first device is provided with a tested application and a detection application, wherein the tested application is an application for detecting whether the safety compliance hidden danger exists or not, and the detection application is used for detecting the tested application. The first device may be an electronic device of the android system or the hong-and-mong system, for example. It will be appreciated that the first device may also be equipped with other systems, and embodiments of the present application are not particularly limited in this regard.
It may be understood that the connection between the first device and the second device may be a universal serial bus (Universal Serial Bus, USB) connection, or may be a wired network connection or a wireless network connection (for example, WIFI, etc.), and the connection manner between the first device and the second device is not limited in this embodiment.
Fig. 3 is a software architecture diagram of a detection application according to an embodiment of the present application. As shown in fig. 3, the detection application may include a task processing unit, an artificial intelligence unit, and an access control unit. The task processing unit is used for performing task scheduling and communicating with the second device, and periodically updating the detection strategy. The artificial intelligence unit has artificial intelligence recognition capability for performing page recognition. The access control unit is used for performing page action monitoring, screenshot acquisition and user operation simulation.
Fig. 4 is a system architecture diagram of an online detection platform according to an embodiment of the present application. As shown in fig. 4, the online detection platform may include a file service function module, a task management function module, and a policy management function module, where the file service function module is used for managing applications, the task management function module is used for distributing tasks, and the policy management function module is used for configuration management of policies.
Fig. 5 is a schematic flow chart of an embodiment of an application detection method provided in the present application, which specifically includes the following steps:
in step 501, the online detection platform creates a detection task, where the detection task includes an application installation package of the application under test and a detection policy.
Specifically, the user may log into the online detection platform, for example, the online detection platform may have the user's account number and password. After the user inputs the account number and the corresponding password on the online detection platform, the user can log in the online detection platform. After logging into the online detection platform, the user may create one or more detection tasks on the online detection platform, where any detection task may include an application installation package and a detection policy for the application under test.
The application installation package is an installation package of the tested application, and it can be understood that when the first device receives the detection task, the first device can install the tested application according to the application installation package in the detection task, so as to install the tested application in the first device.
The detection strategy may include one or more detection items, and a detection duration, a detection order, etc. of each detection item. The detection items may include privacy, rights, and other items, but are not limited to embodiments of the present application, and in some embodiments, more detection items may be included.
In some alternative embodiments, keywords and/or privacy monitoring points may also be included in the detection item for detection based on the particular keywords and/or privacy detection points.
In step 502, the online detection platform distributes the detection task to the second device. Correspondingly, the second equipment receives the detection task sent by the online detection platform.
Specifically, the online detection platform may first detect an operational state of the second device. For example, if the second device is in an idle state, the idle state may be used to characterize that no detection task is running in the second device. If the second device is in an idle state, the online detection platform may distribute detection tasks to the second device.
It can be appreciated that if there is one detection task, the online detection platform may send the detection task to any one of the one or more idle second devices; if there are multiple detection tasks, the online detection platform may send the detection tasks to any of the multiple idle second devices.
In step 503, the second device establishes a connection with the first device and sends the detection task to the first device. Correspondingly, the first device receives the detection task sent by the second device.
Specifically, after receiving the detection task sent by the online detection platform, the second device may establish a connection with the first device. The connection may be a wired connection, for example, a USB connection or a network cable connection, or may be a wireless connection, and may send the detection task to the task processing unit of the first device after the connection is established.
In step 504, the task processing unit of the first device is initialized.
Specifically, after the task processing unit of the first device receives the detection task sent by the second device, the task processing unit may perform initialization. The initialization may include obtaining information in a detection task, such as an installation package of the application under test and a detection policy. In addition, the method can further comprise the step of installing according to an application installation package of the tested application in the detection task so as to install the tested application in the first device, and therefore the tested application can be detected.
In some alternative embodiments, after the application to be tested is installed, the type of the application to be tested may be obtained, where the type of the application to be tested may include a fast application type, a normal application type, and the like.
In some alternative embodiments, logging may also be initiated, where the logging may include a user behavior log and an event response log. The user behavior log may be a log generated by the first device simulating the user behavior, and the event response log is a log generated by the first device responding to the simulated user behavior.
In step 505, the task processing unit of the first device instructs the access control unit to launch the application under test.
Specifically, the task processing unit of the first device may send a start instruction to the access control unit, for instructing the access control unit to start the application under test.
In step 506, the access control unit of the first device starts the application under test.
Specifically, the access control unit of the first device may send a start instruction to the application under test for opening the application under test.
In step 507, the application under test sends a notification of successful start-up to the access control unit of the first device.
Specifically, if the application under test is successfully opened, a start success notification may be sent to the access control unit of the first device, for notifying the access control unit of the first device that the application under test has been successfully opened.
In step 508, the access control unit of the first device captures a page of the application under test.
Specifically, after the access control unit of the first device receives the start success notification, the page of the tested application may be monitored, and the page of the tested application may be screenshot.
In step 509, the access control unit of the first device sends a screenshot of the application under test to the artificial intelligence unit of the first device. Correspondingly, the artificial intelligence unit of the first device receives the screenshot of the tested application sent by the access control unit of the first device.
At step 510, the artificial intelligence unit of the first device pre-analyzes the screenshot of the page of the application under test.
Specifically, after the artificial intelligence unit of the first device receives the page screenshot of the application to be tested, the page screenshot of the application to be tested can be pre-analyzed, and whether the DOM tree needs to be requested to the second device or not can be determined according to the pre-analysis result, so that the DOM tree can be requested according to the need, the link bandwidth of the first device and the second device can be saved, a large amount of occupation of communication resources caused by frequent communication between the first device and the second device can be avoided, and the detection efficiency can be improved. Wherein the DOM tree may be used to assist in detecting pages. In addition, by the first device requesting the DOM tree and storing the DOM tree in the first device, storage resources of the second device can be saved. The pre-analysis may be to identify a screenshot of the application under test to identify a page type of the screenshot of the application under test. By way of example, the page types may include search pages, presentation pages, advertisement popup pages, privacy popup pages, rights popup pages, privacy text pages, and the like. It will be appreciated that the above page types are merely exemplary and are not limiting of embodiments of the present application, and in some embodiments, more or fewer types may be included.
After pre-analyzing the page shots of the application under test, it may be determined whether a DOM tree needs to be requested. For example, if the page type of the screenshot of the tested application can be identified, and the elements in the screenshot of the tested application can be accurately identified and effectively detected, that is, the detection result of the page can be obtained, it can be determined that no DOM tree need to be requested, and step 512 can be further performed. If the page type of the screenshot of the tested application cannot be identified, or the page type of the screenshot of the tested application cannot be identified, but the elements in the screenshot of the tested application cannot be detected, that is, the detection result of the page cannot be obtained, it may be determined that a DOM tree needs to be requested, and step 511a may be further performed, so as to detect the page of the tested application according to the combination of the DOM tree and the screenshot.
In step 511a, the artificial intelligence unit of the first device sends a DOM request to the task processing unit. Correspondingly, the task processing unit of the first device receives the DOM request sent by the artificial intelligence unit.
Specifically, after determining that the DOM tree needs to be requested, the first device may send, through the artificial intelligence unit, a DOM request to the task processing unit for requesting the DOM tree.
In step 511b, the task processing unit of the first device forwards the DOM request to the second device. Correspondingly, the second device receives the DOM request sent by the task processing unit of the first device.
In step 511c, the second device obtains the DOM tree.
Specifically, after receiving the DOM request sent by the task processing unit of the first device, the second device may acquire a DOM tree. Illustratively, taking the android system as an example, the manner of obtaining the DOM tree may be through an android debug bridge (Android Debug Bridge, ADB) command.
In step 511d, the second device sends the DOM tree to the task processing unit of the first device. Correspondingly, the task processing unit of the first device receives the DOM tree sent by the second device.
In step 511e, the task processing unit of the first device forwards the DOM tree to the artificial intelligence unit of the first device.
In step 511f, the artificial intelligence unit of the first device detects the page of the application under test based on the DOM tree and the page screenshot.
Specifically, after receiving the DOM tree sent by the task processing unit of the first device, the artificial intelligence unit of the first device may detect, according to the DOM tree and the screenshot of the page, the current page of the tested application, so as to obtain a detection result of the page, and may further execute step 513.
At step 512, the artificial intelligence unit of the first device detects the page of the application under test based on the page screen shots.
Specifically, the artificial intelligence unit of the first device may detect the current page of the application under test based on the screenshot of the page, so that the detection result of the page may be obtained, and step 513 may be further performed.
In step 513, the artificial intelligence unit of the first device determines the target instruction based on the current page shot.
Specifically, after the artificial intelligence unit of the first device identifies the current screenshot of the tested application, a target instruction may be determined based on the screenshot, where the target instruction may be an instruction simulating the user to operate on the page. It can be understood that the target instruction is an instruction used for detecting the application to be tested, and in order to avoid blind traversal of all the controls of the application to be tested, the target instruction can be determined for the current page, so that the specified test scene can be triggered as much as possible, the test efficiency can be improved, and the efficiency reduction caused by blind traversal is avoided.
In some alternative embodiments, if the first device obtains a DOM tree, the target instruction may be determined based on the DOM tree and the current page screenshot.
The artificial intelligence unit of the first device sends 514 the target instruction to the access control unit. Correspondingly, the access control unit of the first device receives the target instruction sent by the artificial intelligence unit.
In step 515, the access control unit of the first device manipulates the application under test based on the target instruction.
Specifically, after receiving the target instruction, the access control unit of the first device may simulate the target instruction to control the tested application in the first device, so that part of the content of the current page may be changed or the whole page may be skipped.
In step 516, the access control unit of the first device obtains the changed page.
Specifically, if the target instruction is not an end instruction, the access control unit of the first device may acquire the changed page. The altered page may be further detected and the steps of page detection (e.g., steps 508-516) may be repeated until the target instruction is an end instruction. The detection manner of the changed page may refer to the related description in the above embodiment, which is not described herein.
It will be appreciated that in the process of detecting the changed page, if the target instruction is an end instruction, the detection of the application under test may be ended, and step 517 may be further performed.
In step 517, the artificial intelligence unit of the first device sends the log and the detection result of the page to the second device. Correspondingly, the second device receives the log and the detection result of the page sent by the artificial intelligent unit of the first device.
Specifically, after determining to end the detection of the application under test, the artificial intelligence unit of the first device may send the recorded log and the detection result of each page to the second device.
In step 518, the second device determines a detection result of the application under test based on the log and the detection result of the page.
Specifically, after the second device receives the detection results of the log and the page sent by the artificial intelligent unit of the first device, the detection results of the application to be tested can be determined by combining the detection results of the log and the page. The detection result of the tested application may be the result of whether the tested application is safe and compliant.
It will be appreciated that if the detection result of the application is determined from the detection result of the page only, errors may occur due to the artificial intelligence recognition, thereby causing errors in the detection result of the application under test. Therefore, the detection result of the detected application can be determined by combining the detection results of the log and the page, and the accuracy of the detection of the detected application can be further improved by combining the behavior, the event and the corresponding page display result because the behavior of the user and the event responding to the behavior of the user are recorded in the log.
In step 519, the second device sends the detection result of the detected application to the online detection platform.
Specifically, each second device may send the detection result of the detected application to the online detection platform, so that the online detection platform may aggregate the detection results of the detected application sent by the plurality of second devices, and thus detection of the plurality of applications may be completed. After the detection of the plurality of applications is completed, the online detection platform can also generate a detection report containing the detection results of the plurality of applications, and the user can watch the detection report containing the detection results of the plurality of applications on the online detection platform.
In the embodiment of the application detection method, the device and the system, the page of the detected application is analyzed and operated through the terminal equipment, so that the traditional application detection flow led by the server can be simplified, the data interaction quantity and interaction time are saved, and the detection efficiency is improved. The specified scene is detected by simulating the instruction of the user, so that invalid and repeated detection scenes can be avoided, the lower efficiency caused by blind traversal is avoided, the detection time is saved, and the condition that the specific scene is not detected due to a large number of invalid and repeated detection scenes can be avoided. In addition, by acquiring the DOM tree as needed, it is possible to avoid acquiring the DOM tree of all pages, whereby resources and time can be saved. And the DOM tree and the page screenshot are stored on the terminal equipment, so that the resource utilization rate can be improved, and the storage resource of the server equipment can be saved.
The general flow of application detection is illustrated above by figures 2-5. Next, an exemplary description is made below of a privacy box detection scenario of application detection by fig. 6.
Fig. 6 is a schematic flow chart of another embodiment of the application detection method provided in the present application, which specifically includes the following steps:
in step 601, the second device detects a state of the first device.
Specifically, the second device may first detect the state of the first device before sending the detection task to the first device. The state of the first device may include a power-on state, an electric quantity state, a network state, and the like, where the power-on state is used to represent whether the first device is in the power-on state, the electric quantity state is used to represent the current electric quantity of the first device, and the network state is used to represent whether the connection between the first device and the network is stable. It will be appreciated that by detecting the state of the first device, it may be determined whether the state of the first device is normal. When the first equipment is in a normal state, the first equipment detects the application, so that the efficiency of application detection is improved. For example, the application detection may be performed when the first device is in a power-on state, and/or the application detection may be performed when the first device is in a sufficient power, and/or the application detection may be performed when the connection of the first device to the network is stable.
In some optional embodiments, in addition to the above detecting the state of the first device, it may also detect whether an upgrade requirement exists for a detection application in the first device, and if the upgrade requirement exists for the detection application, it may detect the detected application after upgrading the detection application; if the detection application does not have the upgrading requirement, the detected application can be directly detected.
The second device sends 602 a detection task to the first device.
Specifically, the detection task may include application information and a detection item configuration, for example, the application information may be an application installation package of the application under test, and the detection item configuration may be one or more detection items. The specific detection items may refer to the related descriptions in the above embodiments, and are not described herein.
In step 603, the first device installs the application under test.
Specifically, after receiving the detection task, the first device may obtain an application installation package of the application to be detected in the detection task. Then, the application installation package can be used for installation, thereby completing the installation of the application under test.
In step 604, the first device opens the application under test.
Specifically, after the first device installs the tested application, the opening operation of the user can be simulated, so that the tested application can be opened, and after the tested application is opened, the page of the tested application can be monitored.
In some alternative embodiments, after the application under test is opened, a log may also be opened to record the behavior and event response of the user. The specific manner of recording the behavior and event response of the user may refer to the related description in the above embodiment, which is not described herein.
In step 605, the first device captures a page of the application under test.
In step 606, the first device pre-analyzes the screenshot of the application under test.
Specifically, the first device performs pre-analysis through the screenshot of the tested application, and can identify the page type, so that whether the current page is a preset test scene or not can be determined, and the preset test scene can be a privacy popup scene, for example. If the current page is a privacy frame scene, step 607a may be performed. If the current page is not a privacy box scene, step 608 may be performed.
In step 607a, the first device performs privacy popup compliance detection on the current page.
Specifically, when the current page is determined to be a privacy popup scene, the first device may perform privacy popup compliance detection on the current page to obtain a detection result of the current page. When privacy popup compliance detection is performed on a current page, it may be first determined whether a DOM tree needs to be requested. The manner of determining whether the DOM tree needs to be requested may specifically refer to the related description in the above embodiment, and will not be described herein.
If the DOM tree does not need to be requested, the first device can directly identify the current page screenshot and is used for acquiring the element names and the corresponding position information in the page screenshot.
If a DOM tree needs to be requested, the first device can send a DOM request to the second device for obtaining the DOM tree, and can identify the DOM tree and the current screenshot according to the DOM tree after obtaining the DOM tree, and is used for obtaining element names and corresponding position information in the screenshot.
The manner of identifying the screenshot of the page may be by Computer Vision (CV). For example, the first device may enter a screen shot (screen shot) into the artificial intelligence unit for identifying elements in the screen shot. The interface definition code may be as follows:
ret=AIModel.element_detect(screen_shot)
after the artificial intelligence unit of the first device is identified, the following element names and location information thereof can be obtained:
{
"0": "cell phone number entry box, 263.5,759.0,0.244,0.338,0.236,0.023",
"1": "checked boxes, 160.5,1305.5,0.149,0.582,0.040,0.017",
"2": "verification code entry box, 268.5,979.5,0.249,0.436,0.232,0.017",
"3": "login account number 594.5,1189.0,0.550,0.530,0.199,0.045",
"4": "obtain verification code, 812.5,758.0,0.752,0.338,0.168,0.023",
"5": "i have read and agree to the promise text in detail, 301.0,1310.0,0.279,0.584,0.165,0.014",
"6": "privacy protocol link, 198.0,1367.0,0.183,0.609,0.093,0.016",
"7": "user protocol link, 645.5,1311.5,0.598,0.584,0.132,0.015",
}
wherein, the numbers of 0-7 are id identifiers for representing the elements which are sequentially identified. For example, "0" means element 0, "1" means element 1, and so on. The id-identified information is used to represent identification information. Taking the "mobile phone number input box, 263.5,759.0,0.244,0.338,0.236,0.023" as an example, the "mobile phone number input box" is used to indicate that the content of the identified element is a mobile phone number input box, the "263.5,759.0" is used to indicate that the width of the element is 263.5, the length is 759.0, and the "0.244,0.338,0.236,0.023" is used to indicate the upper left-hand abscissa x1, the upper left-hand ordinate y1, the lower right-hand abscissa x2, and the lower right-hand ordinate y2 of the element.
When the first device recognizes the element, detection can be performed based on the detection item, and thus a detection result of the current page can be obtained.
In step 607b, the first device determines a second target instruction.
Specifically, the first device may determine the second target instruction according to the screenshot and a preset detection requirement in the detection item. Taking a preset detection requirement as a privacy detection point requirement as an example, after the first device identifies the element name and the position information thereof, the first device may further determine the second target instruction according to the element information and the preset detection requirement in the detection item, where the element information may include the element name and the position information thereof.
In step 607c, the first device simulates user operation based on the second target instruction, and changes the page of the tested application.
Specifically, after the first device determines the second target instruction, if the second target instruction is not the end instruction, the user operation may be simulated based on the second target instruction, so that the current page may be skipped, so that the skipped page may be detected as being in compliance with the privacy popup again, and step 605 may be further executed. If the second target instruction is an end instruction, step 610 may be further performed.
In some alternative embodiments, if the page of the application under test does not jump, but the element of the page changes slightly, the detection can be directly performed according to the current screenshot of the page, without requesting a DOM tree.
At step 608, the first device determines a first target instruction.
Specifically, the first device may determine the first target instruction based on a page type of the current page.
In step 609, the first device simulates a user operation based on the first target instruction, and changes the page of the tested application.
Specifically, after the first device determines the first target instruction, if the first target instruction is not the end instruction, the user operation may be simulated based on the first target instruction, so that the current page may be skipped, and thus the skipped page may be detected as being in compliance with the privacy popup again, and step 605 may be further executed. If the first target instruction is an end instruction, step 610 may be further performed.
In step 610, the first device sends the page detection result to the second device.
In particular, the specific implementation of this step 610 may refer to the related description of the above embodiment, which is not repeated here.
It may be appreciated that the above detection policy may include a plurality of detection items, so that in the above page detection process, the detection may be performed in the dimension of the detection item, for example, the detection may be performed on a plurality of pages sequentially using the same detection item; the detection may also be performed in the page dimension, for example, multiple detection items may be used in the same page. That is to say:
For any page, after performing the detection of a plurality of detection items, the detection of the next page may be performed; or alternatively, the first and second heat exchangers may be,
for any one detection item, after detection of a plurality of pages is performed, detection of the next detection item may be performed.
In the embodiment of the application, the appointed test scene is quickly found in the page detection process, and the instruction of the simulation user is triggered through the efficient event in the appointed test scene to detect, so that a large number of invalid and repeated test scenes can be avoided, resource consumption of a server side can be saved, and the detection efficiency is improved.
Fig. 7 is a schematic structural diagram of another embodiment of the first device of the present application, as shown in fig. 7, where the first device 70 may include: a receiving module 71, an installing module 72, a detecting module 73 and a transmitting module 74; wherein,
the receiving module 71 is configured to receive a detection task sent by the second device, where the detection task includes an application installation package and a detection policy of the application to be detected;
an installation module 72 for installing the application under test based on the application installation package;
the detection module 73 is configured to open the tested application, and detect a page of the tested application by using the detection policy, so as to obtain a page detection result;
And a sending module 74, configured to send the page detection result to the second device, so that the second device determines a detection result of the tested application based on the page detection result.
In one possible implementation, the detection module 73 is further configured to
In the page detection process, determining a target instruction based on a first page of the tested application, wherein the target instruction is an instruction for simulating a user to operate the page;
if the target instruction is not an ending instruction, acquiring a second page according to the target instruction, and detecting the second page;
and repeating the page detection step until the target instruction is an ending instruction, and stopping page detection.
In one possible implementation, the detection module 73 is further configured to
Pre-analyzing the first page of the tested application;
and determining whether a Document Object Model (DOM) tree is needed according to the pre-analysis result, wherein the DOM tree is used for assisting in detecting the page.
In one possible implementation, the detection module 73 is further configured to
If the Document Object Model (DOM) tree is determined to be needed, requesting the DOM tree from the second equipment, and detecting the first page based on the DOM tree and the screenshot of the first page; or alternatively, the first and second heat exchangers may be,
And if the DOM tree is not needed, detecting the first page based on the screenshot of the first page.
In one possible implementation, the detection module 73 is further configured to
In one possible implementation manner, if the DOM tree is obtained, a target instruction is determined based on the DOM tree and a screenshot of the first page.
In one possible implementation, the sending module 74 is further configured to
Acquiring a log; the log is generated in the detection process of the application to be detected;
and sending the log and the page detection result to the second equipment.
In one possible implementation manner, the log includes a user behavior log and an event response log, where the user behavior log is a log generated by the first device by simulating the user behavior, and the event response log is a log generated by the first device by responding to the simulated user behavior.
In one possible implementation, the detection module 73 is further configured to
If the page type of the first page is a preset test scene, detecting the first page to obtain a detection result of the first page, and determining a target instruction based on a preset detection requirement in the detection strategy and a page screenshot of the first page; or alternatively, the first and second heat exchangers may be,
If the page type of the first page is not a preset test scene, determining a target instruction based on the page type of the first page.
In one possible implementation, the detection module 73 is further configured to
Identifying a screenshot of the first page to obtain element information in the first page, wherein the element information comprises an element name and an element position;
and determining a target instruction based on the preset detection requirement in the detection strategy and the element information.
In one possible implementation, the detection policy includes a plurality of detection items, and the detection module 73 is further configured to
In the page detection process, for any page, after the detection of the plurality of detection items is executed, the detection of the next page is executed; or alternatively, the first and second heat exchangers may be,
in the page detection process, for any detection item, after detection of a plurality of pages is performed, detection of the next detection item is performed.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
The functional units in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic or optical disk, and the like.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. An application detection method, applied to a first device, the method comprising:
receiving a detection task sent by second equipment, wherein the detection task comprises an application installation package and a detection strategy of an application to be detected;
installing the tested application based on the application installation package;
opening the tested application, and detecting the page of the tested application by using the detection strategy to obtain a page detection result;
and sending the page detection result to the second device, so that the second device determines the detection result of the tested application based on the page detection result.
2. The method according to claim 1, wherein the method further comprises:
in the page detection process, determining a target instruction based on a first page of the tested application, wherein the target instruction is an instruction for simulating a user to operate the page;
If the target instruction is not an ending instruction, acquiring a second page according to the target instruction, and detecting the second page;
and repeating the page detection step until the target instruction is an ending instruction, and stopping page detection.
3. The method of claim 2, wherein prior to determining a target instruction based on the first page of the application under test, the method further comprises:
pre-analyzing the first page of the tested application;
and determining whether a Document Object Model (DOM) tree is needed according to the pre-analysis result, wherein the DOM tree is used for assisting in detecting the page.
4. A method according to claim 3, characterized in that the method further comprises:
if the Document Object Model (DOM) tree is determined to be needed, requesting the DOM tree from the second equipment, and detecting the first page based on the DOM tree and the screenshot of the first page; or alternatively, the first and second heat exchangers may be,
and if the DOM tree is not needed, detecting the first page based on the screenshot of the first page.
5. The method of claim 4, wherein the determining a target instruction based on the first page of the application under test comprises:
And if the DOM tree is acquired, determining a target instruction based on the DOM tree and the screenshot of the first page.
6. The method according to any one of claims 1-5, wherein the sending the page detection result to the second device includes:
acquiring a log; the log is generated in the detection process of the application to be detected;
and sending the log and the page detection result to the second equipment.
7. The method of claim 6, wherein the log comprises a user behavior log and an event response log, the user behavior log being generated by the first device in response to simulating user behavior, the event response log being generated by the first device in response to simulating user behavior.
8. The method of claim 2, wherein the determining a target instruction based on the first page of the application under test comprises:
if the page type of the first page is a preset test scene, detecting the first page to obtain a detection result of the first page, and determining a target instruction based on a preset detection requirement in the detection strategy and a page screenshot of the first page; or alternatively, the first and second heat exchangers may be,
If the page type of the first page is not a preset test scene, determining a target instruction based on the page type of the first page.
9. The method of claim 8, wherein the determining the target instruction based on the preset detection requirement in the detection policy and the screenshot of the first page comprises:
identifying a screenshot of the first page to obtain element information in the first page, wherein the element information comprises an element name and an element position;
and determining a target instruction based on the preset detection requirement in the detection strategy and the element information.
10. The method of claim 8, wherein the detection strategy comprises a plurality of detection terms, the method further comprising:
in the page detection process, for any page, after the detection of the plurality of detection items is executed, the detection of the next page is executed; or alternatively, the first and second heat exchangers may be,
in the page detection process, for any detection item, after detection of a plurality of pages is performed, detection of the next detection item is performed.
11. A first device, comprising: a processor and a memory for storing a computer program; the processor is configured to run the computer program to implement the application detection method according to any one of claims 1-10.
12. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when run on a computer, implements the application detection method according to any of claims 1-10.
CN202211047270.9A 2022-08-29 2022-08-29 Application detection method, electronic device and storage medium Pending CN117668835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211047270.9A CN117668835A (en) 2022-08-29 2022-08-29 Application detection method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211047270.9A CN117668835A (en) 2022-08-29 2022-08-29 Application detection method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN117668835A true CN117668835A (en) 2024-03-08

Family

ID=90083177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211047270.9A Pending CN117668835A (en) 2022-08-29 2022-08-29 Application detection method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN117668835A (en)

Similar Documents

Publication Publication Date Title
CN110347269B (en) Empty mouse mode realization method and related equipment
WO2021023032A1 (en) Device unlocking method and system, and related device
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
WO2022089000A1 (en) File system check method, electronic device, and computer readable storage medium
CN113973398B (en) Wireless network connection method, electronic equipment and chip system
CN111343326A (en) Method and related device for acquiring test log
CN114422340A (en) Log reporting method, electronic device and storage medium
CN113490291B (en) Data downloading method and device and terminal equipment
CN111104295A (en) Method and equipment for testing page loading process
CN110806994B (en) Signal transmission method and device
CN113901485B (en) Application program loading method, electronic device and storage medium
WO2022170856A1 (en) Method for establishing connection, and electronic device
CN114915747B (en) Video call method, electronic device and readable storage medium
CN114828098B (en) Data transmission method and electronic equipment
CN112579425B (en) Method, device and medium for testing applet method interface
CN117668835A (en) Application detection method, electronic device and storage medium
CN113867851A (en) Electronic equipment operation guide information recording method, electronic equipment operation guide information acquisition method and terminal equipment
CN116321265B (en) Network quality evaluation method, electronic device and storage medium
CN112583651B (en) Method, device and medium for testing applet communication interface
WO2024093795A1 (en) Device replacement configuration method and apparatus
CN114077732A (en) Resource access control method, terminal device and computer readable storage medium
CN115562901A (en) Data tracking method and electronic equipment
CN117666820A (en) Mouse connection method and electronic equipment
CN118057858A (en) Data processing method, device and system
CN114490006A (en) Task determination method, device, 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