CN110287381B - Page control node searching method, terminal and computer readable storage medium - Google Patents

Page control node searching method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN110287381B
CN110287381B CN201910563505.1A CN201910563505A CN110287381B CN 110287381 B CN110287381 B CN 110287381B CN 201910563505 A CN201910563505 A CN 201910563505A CN 110287381 B CN110287381 B CN 110287381B
Authority
CN
China
Prior art keywords
node
target control
target
control
searching
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.)
Active
Application number
CN201910563505.1A
Other languages
Chinese (zh)
Other versions
CN110287381A (en
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201910563505.1A priority Critical patent/CN110287381B/en
Publication of CN110287381A publication Critical patent/CN110287381A/en
Application granted granted Critical
Publication of CN110287381B publication Critical patent/CN110287381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method for searching page control nodes, a terminal and a computer-readable storage medium, and belongs to the technical field of communication. The method comprises the following steps: when a target interface where a target control is located is displayed, searching nodes of the target control in all child nodes under a root node of the target interface by utilizing view ID (ViewID) of the target control and/or characters displayed by the target control; if the target control is not found, searching nodes of the target control in all child nodes under the root node of the target interface by using class names of the target control. By adopting the invention, the known view ID, text or class name can be fully utilized to search the control, so that the control can be searched according to the class name even if the view ID or text of the control cannot be known in advance, the invention not only can be suitable for different application interfaces, but also can improve the success rate of node searching.

Description

Page control node searching method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, a terminal, and a computer readable storage medium for searching a page control node.
Background
With the continuous development of smart terminals (such as smartphones), most systems of smart terminals provide auxiliary service functions. The auxiliary service provides an enhanced user interface aimed at assisting a user, in particular a physically inconvenient or inflexible user, in operating an application on the intelligent terminal. In order to realize auxiliary operation of the application, the auxiliary service needs to have the functions of searching the page control to acquire node information and simulating operation.
In the prior art, although many intelligent terminals support auxiliary functions, because each software is agreed with or customized to control, and the standard is not completely unified, the auxiliary functions cannot find the control of the interface, and thus node information of the control cannot be obtained, so that simulation operation cannot be realized even if the auxiliary functions exist.
Therefore, it is necessary to provide a method, a terminal and a computer readable storage medium for searching the nodes of the page control, so as to adapt to different application interfaces, effectively search the nodes of the page control, and obtain the node information of the control.
Disclosure of Invention
Accordingly, the present invention is directed to a method, a terminal, and a computer readable storage medium for searching a page control node, so as to solve the problem that the existing auxiliary function of the terminal system cannot adapt to different application interfaces, resulting in that the node of the page control cannot be searched and node information of the control cannot be obtained.
The technical scheme adopted by the invention for solving the technical problems is as follows:
according to a first aspect of the present invention, there is provided a method for searching a page control node, the method for searching a page control node including the steps of:
when a target interface where a control is located is displayed, searching nodes of the target control in all child nodes under a root node of the target interface by utilizing view IDs of the target control and/or characters displayed by the target control;
if the target control is not found, searching nodes of the target control in all child nodes under the root node of the target interface by using class names of the target control
According to a second aspect of the present invention, there is provided a terminal comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the steps as described in the first aspect.
According to a third aspect of the present invention there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method of searching for page control nodes according to the first aspect
According to the page control node searching method, firstly, the view ID of the target control and/or the characters displayed by the target control are used for searching, when searching fails, the control class name is used for searching, and known view IDs, characters or class names can be fully used for searching the control, so that even if the view ID or characters of the control cannot be known in advance, the searching can be performed according to the class name, the method is suitable for different application interfaces, and the success rate of node searching is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention;
fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for searching a page control node according to a first embodiment of the present invention;
FIG. 4 is a complete flow chart of one possible implementation provided integrally with the embodiments;
fig. 5 is a schematic block diagram of a terminal according to a second embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, the terminals described in the present invention may include mobile terminals such as cell phones, tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, wearable devices, smart bracelets, pedometers, and fixed terminals such as digital TVs, desktop computers, and the like.
The following description will be given taking a mobile terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 is not limiting of the mobile terminal and that the mobile terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving downlink information of the base station, processing the downlink information by the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code Division Multiple Access, CDMA 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of a mobile terminal, and can be omitted entirely as required within a range that does not change the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the mobile terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the mobile terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected with the mobile terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based will be described below.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based will be described below.
Referring to fig. 2, fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention, where the communication network system is an LTE system of a general mobile communication technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network ) 202, an epc (Evolved Packet Core, evolved packet core) 203, and an IP service 204 of an operator that are sequentially connected in communication.
Specifically, the UE201 may be the terminal 100 described above, and will not be described herein.
The E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. The eNodeB2021 may be connected with other eNodeB2022 by a backhaul (e.g., an X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide access from the UE201 to the EPC 203.
EPC203 may include MME (Mobility Management Entity ) 2031, hss (Home Subscriber Server, home subscriber server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, pgw (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function, policy and tariff function entity) 2036, and so on. The MME2031 is a control node that handles signaling between the UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location registers (not shown) and to hold user specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034 and PGW2035 may provide IP address allocation and other functions for UE201, PCRF2036 is a policy and charging control policy decision point for traffic data flows and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem ), or other IP services, etc.
Although the LTE system is described above as an example, it should be understood by those skilled in the art that the present invention is not limited to LTE systems, but may be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure, various embodiments of the method of the present invention are provided.
The embodiment of the invention provides a page control node searching method. Referring to fig. 3, the method flow includes:
step 301, when a target interface where a control is located is displayed, searching nodes of the target control in all child nodes under a root node of the target interface by using a view ID (ViewID) of the target control and/or characters displayed by the target control;
step 302, if the target control is not found, searching nodes of the target control in all child nodes under the root node of the target interface by using class names of the target control.
In practical applications, the view ID of the control of the system is known and uniform, and for such a control, the view ID of the control can be viewed by various methods, for example:
looking at with eclipse/as ddms; or traversing all nodes in the window change, printing out the ViewID corresponding to the node, and the like.
For some non-system controls, the ViewID is not easy to obtain, or if the ViewID is failed to obtain, if the controls are text boxes (textView), buttons (Button) and the like, text content is displayed, the corresponding controls can be quickly found by using the characters displayed by the controls.
In practical applications, there is also a case that a mode of dynamically generating the view ID of the control according to a certain algorithm is applied and the text displayed by the control is replaced by the picture, for example, the view ID of the control of the android WeChat interface is dynamically generated. In this case, the node corresponding to the control cannot be found by the ViewID or the displayed text of the control, and the class name of the control can be used for finding.
In one possible scenario, after step 302, the method further comprises:
if the child node matched with the class name of the target control is not found, the searching is suspended;
and after the pause time reaches the preset duration, repeating the steps 301 and 302 until the node of the target control is found.
In one possible scenario, this step 301 includes:
calling a findAcess ibilityNodeInfo ByViewId () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the ID;
if the child node is not found, calling a findaccessibilityNodeInfo ByViewText () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the text displayed by the target control.
In practical application, the order of searching the child nodes by using the ID and searching the child nodes by using the text can be exchanged, namely, firstly, a findAcess NodeInfo ByViewText () method is called for searching, and if the corresponding child node is not found, a findAcess NodeInfo ByViewId () method is called for searching.
In one possible scenario, step 302 includes:
calling an accessibilitiyNodeInfo.getClassName () method to obtain class names of all child nodes of the target interface;
and searching the child node matched with the class name of the target control.
In practical application, taking an android system as an example, the class name of a node is fixed, even if the ViewID of the node or the text displayed by the control cannot be known, the corresponding node can be found only by knowing the class name of the control, for example, the class name of a button is "bottom" and the class name of an input box is "edition".
In one possible scenario, prior to step 301, the method further comprises the steps of:
determining a target interface and a target control to be monitored according to the auxiliary event configuration information;
and monitoring whether the target interface is displayed by the system.
In practice, to implement auxiliary service functions, an auxiliary event profile needs to be specified to process and filter specified events. The auxiliary function configuration may be implemented by accessibilitiyserviceinfo, and the setServiceInfo () method of the accessibilitiyserviceinfo class is called in the onserviceconnect () method of the auxiliary function service to configure.
The auxiliary function configuration can be used for designating the operation of which application the auxiliary function monitors, allowing which events to be processed, clicking the type of event feedback by a user, searching the node mode, timeout time, whether the auxiliary function is allowed to obtain window node information, and the like.
In one possible implementation, when the node of the target control is found, the method further includes:
acquiring node information of the target control;
and feeding the node information back to an auxiliary service program or a plug-in unit for providing the auxiliary time configuration information by the auxiliary function program.
In one possible scenario, before step 301, the method further comprises the steps of:
and acquiring information of all nodes under the root node of the target page, wherein the information comprises at least one of a ViewID of the node, characters displayed by a control corresponding to the node and class names of the node.
Specifically, the current page node information accessibilitiyodeinfo can be obtained by the following method:
1. obtaining an accessibilitiyEvent#getSource, namely obtaining an accessibilitiyNodeInfo event source;
2. and (3) obtaining all information of the current window root node by the Access ibilityService #getRaootInActiveWindow.
Referring to fig. 4, a complete flow chart of one possible implementation of the present embodiment includes the following steps:
step 401, when a target interface is displayed, calling a findaccessibilityNodeInfosByViewId () method to search a node of a target control;
step 402, judging whether a node of the target control is found, if so, executing step 408, otherwise, executing step 403;
step 403, calling a findAccessimilyindenoInfosByViewText () method to search a node of the target control;
step 404, judging whether to find out the node of the target control, if so, executing step 408, otherwise, executing step 405;
step 405, calling an accessibilityNodeInfo. GetClassName () method, and searching for a node of the target space;
step 406, judging whether to find out the node of the target control, if so, executing step 408, otherwise, executing step 407;
step 407, after 200ms of suspension, continuing to execute step 401;
specifically, the purpose of suspending the search after step 406 is to ensure that the interface control display is complete, thereby improving the success rate of the search.
Step 408, feeding back the information of the searched nodes to the corresponding auxiliary service program or plug-in.
In practical application, the corresponding auxiliary service program or plug-in refers to a program or plug-in which registration and setting are completed in the auxiliary service function of the system.
According to the method for searching the page control node, firstly, the view ID of the target control and/or the characters displayed by the target control are used for searching, when searching fails, the control class name is used for searching, and known view IDs, characters or class names can be fully utilized for searching the control, so that even if the view ID or characters of the control cannot be known in advance, the searching can be performed according to the class name, the method is suitable for different application interfaces, and the success rate of node searching is improved.
On the basis of the foregoing embodiments, a second embodiment of the present invention provides a terminal, referring to fig. 5, including: a memory 501, a processor 502 and a computer program 503 stored on the memory 501 and executable on the processor 502, the computer program 503 when executed by the processor 502 performing the steps of:
when a target interface where a target control is located is displayed, searching nodes of the target control in all child nodes under a root node of the target interface by utilizing view ID (ViewID) of the target control and/or characters displayed by the target control;
if the target control is not found, searching nodes of the target control in all child nodes under the root node of the target interface by using the class name of the target control.
In practical applications, the view ID of the control of the system is known and uniform, and for such a control, the view ID of the control can be viewed by various methods, for example:
looking at with eclipse/as ddms; or at the time of window change, traversing all nodes, printing out the ViewID corresponding to the node, and the like.
For some non-system controls, the ViewID is not easy to obtain, or if the ViewID is failed to obtain, if the controls are text boxes (textView), buttons (Button) and the like, text content is displayed, the corresponding controls can be quickly found by using the characters displayed by the controls.
In practical applications, there is also a case that a mode of dynamically generating the view ID of the control according to a certain algorithm is applied and the text displayed by the control is replaced by the picture, for example, the view ID of the control of the android WeChat interface is dynamically generated. In this case, the node corresponding to the control cannot be found by the ViewID or the displayed text of the control, and the class name of the control can be used for finding.
In one possible implementation, the computer program 503, when executed by the processor 502, further performs the steps of:
if the child node matched with the class name of the target control is not found, the searching is suspended;
and repeatedly executing the steps of searching the node of the target control in all the child nodes under the root node of the target interface by utilizing the view ID (ViewID) of the target control and/or characters displayed by the target control after the pause time reaches the preset time, and searching the node of the target control in all the child nodes under the root node of the target interface by utilizing the class name of the target control when the target control is not searched until the node of the target control is searched.
In one possible solution, when the step of "searching for the node of the target control in all child nodes under the root node of the target interface by using the view ID (ViewID) of the target control and/or the text displayed by the target control" is performed, the following steps are implemented by the processor 502:
calling a findAcess ibilityNodeInfo ByViewId () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the ID;
if the child node is not found, calling a findaccessibilityNodeInfo ByViewText () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the text displayed by the target control.
In practical application, the order of searching the child nodes by using the ID and searching the child nodes by using the text can be exchanged, namely, firstly, a findAcess NodeInfo ByViewText () method is called for searching, and if the corresponding child node is not found, a findAcess NodeInfo ByViewId () method is called for searching.
In one possible implementation, the computer program 503 is further executed by the processor 502 when executing the step of "searching all child nodes under the root node of the target interface for the node of the target control by using the class name of the target control", to implement the following steps:
calling an accessibilitiyNodeInfo.getClassName () method to obtain class names of all child nodes of the target interface;
and searching the child node matched with the class name of the target control.
In practical application, taking an android system as an example, the class name of a node is fixed, even if the ViewID of the node or the text displayed by the control cannot be known, the corresponding node can be found only by knowing the class name of the control, for example, the class name of a button is "bottom" and the class name of an input box is "edition".
In one possible scenario, before performing the step of "searching for the node of the target control in all child nodes under the root node of the target interface using the view ID (ViewID) of the target control and/or the text displayed by the target control", the computer program 503 is further executed by the processor 502, to implement the following steps:
determining a target interface and a target control to be monitored according to the auxiliary event configuration information;
and monitoring whether the target interface is displayed by the system.
In practice, to implement auxiliary service functions, an auxiliary event profile needs to be specified to process and filter specified events. The auxiliary function configuration may be implemented by accessibilitiyserviceinfo, and the setServiceInfo () method of the accessibilitiyserviceinfo class is called in the onserviceconnect () method of the auxiliary function service to configure.
The auxiliary function configuration can be used for designating the operation of which application the auxiliary function monitors, allowing which events to be processed, clicking the type of event feedback by a user, searching the node mode, timeout time, whether the auxiliary function is allowed to obtain window node information, and the like.
In one possible approach, the computer program 503 is further executed by the processor 502 to implement the steps of:
when the node of the target control is found, acquiring node information of the target control;
and feeding back the node information to the auxiliary service program or plug-in providing the auxiliary time configuration information.
In one possible scenario, before performing the step of "searching for the node of the target control in all child nodes under the root node of the target interface using the view ID (ViewID) of the target control and/or the text displayed by the target control", the computer program 503 is further executed by the processor 502, to implement the following steps:
and acquiring information of all nodes under the root node of the target page, wherein the information comprises at least one of view IDs of the nodes, characters displayed by controls corresponding to the nodes and class names of the nodes.
The terminal of the embodiment searches by using the view ID of the target control and/or the text displayed by the target control, and when the searching fails, continues to search by using the control class name, and can search by fully using the known view ID, text or class name, so that even if the view ID or text of the control cannot be known in advance, the searching can be performed according to the class name, and the terminal is not only suitable for different application interfaces, but also improves the success rate of node searching.
On the basis of the foregoing embodiments, a third embodiment of the present invention provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the steps of the method for searching for a page control node according to the first embodiment.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (5)

1. The searching method of the page control node is applied to the mobile terminal and is characterized by comprising the following steps of:
when a target interface where a target control is located is displayed, searching nodes of the target control in all child nodes under a root node of the target interface by utilizing view IDs of the target control and/or characters displayed by the target control;
if the target control is not found, searching nodes of the target control in all child nodes under the root node of the target interface by using class names of the target control;
the step of searching the node of the target control in all the child nodes under the root node of the target interface by utilizing the view ID of the target control and/or the text displayed by the target control comprises the following steps:
invoking a findaccessibilityNodeInfosByViewId () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the view ID;
if the child node is not found, calling a findAcess ibilityNodeInfo ByViewText () method, traversing the child node under the root node of the target interface, and searching the child node corresponding to the text displayed by the target control;
the step of searching the node of the target control in all the child nodes under the root node of the target interface by using the class name of the target control comprises the following steps:
calling an accessibilitiyNodeInfo.getClassName () method to obtain class names of all child nodes of the target interface;
searching a child node matched with the class name of the target control;
before executing the step of searching nodes of the target control in all child nodes of the target interface by using the view ID of the target control and/or the text displayed by the target control, the method further comprises the following steps:
determining a target interface and a target control to be monitored according to the auxiliary event configuration information;
monitoring whether the target interface is displayed by the system or not;
when the node of the target control is found, the method further comprises:
acquiring node information of the target control;
and feeding the node information back to an auxiliary service program or a plug-in for providing the auxiliary event configuration information.
2. The method for searching for a page control node according to claim 1, wherein after searching for the node of the target control in all child nodes under a root node of the target interface by using the class name of the target control, the method further comprises:
if the child node matched with the class name of the target control is not found, the searching is suspended;
and when the pause time reaches the preset duration, repeating the steps as set forth in claim 1 until the node of the target control is found.
3. The method of claim 1, wherein before the searching for the node of the target control in all child nodes of the target interface by using the view ID of the target control and/or the text displayed by the target control, the method further comprises:
and acquiring information of all child nodes under the root node of the target interface, wherein the information comprises at least one of view IDs of the nodes, characters displayed by controls corresponding to the nodes and class names of the nodes.
4. A terminal, the terminal comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, which when executed by the processor performs the steps of any one of claims 1 to 3.
5. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the method of finding a page control node according to any of claims 1 to 3.
CN201910563505.1A 2019-06-26 2019-06-26 Page control node searching method, terminal and computer readable storage medium Active CN110287381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910563505.1A CN110287381B (en) 2019-06-26 2019-06-26 Page control node searching method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910563505.1A CN110287381B (en) 2019-06-26 2019-06-26 Page control node searching method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110287381A CN110287381A (en) 2019-09-27
CN110287381B true CN110287381B (en) 2024-02-09

Family

ID=68006180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910563505.1A Active CN110287381B (en) 2019-06-26 2019-06-26 Page control node searching method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110287381B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800185B (en) * 2021-04-08 2021-07-13 智道网联科技(北京)有限公司 Method and device for generating and matching text of interface node in mobile terminal

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368298A (en) * 2017-06-22 2017-11-21 努比亚技术有限公司 A kind of text control simulation touch control method, terminal and computer-readable recording medium
CN108052255A (en) * 2017-10-30 2018-05-18 努比亚技术有限公司 Quick method, terminal and the computer storage media searched and start application program
CN108234295A (en) * 2017-12-29 2018-06-29 努比亚技术有限公司 Display control method, terminal and the computer readable storage medium of group's functionality controls
CN109086204A (en) * 2018-07-20 2018-12-25 北京小米移动软件有限公司 The foundation of node relationships tree, page marks and recognition methods, device and storage medium
CN109388400A (en) * 2018-10-29 2019-02-26 深圳同耕科技股份有限公司 A kind of automatic production of HTML page method and device
WO2019061040A1 (en) * 2017-09-26 2019-04-04 华为技术有限公司 File management method and device
CN109840119A (en) * 2018-12-28 2019-06-04 努比亚技术有限公司 A kind of terminal applies starting method, terminal and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368298A (en) * 2017-06-22 2017-11-21 努比亚技术有限公司 A kind of text control simulation touch control method, terminal and computer-readable recording medium
WO2019061040A1 (en) * 2017-09-26 2019-04-04 华为技术有限公司 File management method and device
CN108052255A (en) * 2017-10-30 2018-05-18 努比亚技术有限公司 Quick method, terminal and the computer storage media searched and start application program
CN108234295A (en) * 2017-12-29 2018-06-29 努比亚技术有限公司 Display control method, terminal and the computer readable storage medium of group's functionality controls
CN109086204A (en) * 2018-07-20 2018-12-25 北京小米移动软件有限公司 The foundation of node relationships tree, page marks and recognition methods, device and storage medium
CN109388400A (en) * 2018-10-29 2019-02-26 深圳同耕科技股份有限公司 A kind of automatic production of HTML page method and device
CN109840119A (en) * 2018-12-28 2019-06-04 努比亚技术有限公司 A kind of terminal applies starting method, terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN110287381A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN108391025B (en) Network access management method, mobile terminal and computer readable storage medium
CN109195143B (en) Network access method, mobile terminal and readable storage medium
CN112799577B (en) Method, terminal and storage medium for projecting small window
CN109618316B (en) Network sharing method, mobile terminal and storage medium
CN109982402B (en) Terminal voice calling method, mobile terminal and computer readable storage medium
CN109144705B (en) Application management method, mobile terminal and computer readable storage medium
CN107423238B (en) Screen projection connection method and device and computer readable storage medium
CN109195213B (en) Mobile terminal screen control method, mobile terminal and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN109890022B (en) Data transmission control method, mobile terminal and computer readable storage medium
CN107832032B (en) Screen locking display method and mobile terminal
CN110020386B (en) Application page sharing method, mobile terminal and computer readable storage medium
CN110052024B (en) Game vibration adjusting method, adjusting device, mobile terminal and storage medium
CN112667339B (en) Screen refresh rate setting method, terminal and computer readable medium
CN107517487B (en) Call control method and mobile terminal
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN109669616B (en) Side screen interaction control method and device and computer readable storage medium
CN109711850B (en) Secure payment method, device and computer readable storage medium
CN109684020B (en) Theme switching method, device and computer readable storage medium
CN109388947B (en) Background management method, device and computer readable storage medium
CN109561221B (en) Call control method, device and computer readable storage medium
CN109062688B (en) Memory allocation method, server and mobile terminal
CN108183833B (en) Response processing method and device and computer readable storage medium
CN110287381B (en) Page control node searching method, terminal and computer readable storage medium
CN108040330B (en) WiFi directional transmission method, mobile terminal and readable 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
GR01 Patent grant
GR01 Patent grant