CN110287381A - Lookup method, terminal and the computer readable storage medium of page control node - Google Patents

Lookup method, terminal and the computer readable storage medium of page control node Download PDF

Info

Publication number
CN110287381A
CN110287381A CN201910563505.1A CN201910563505A CN110287381A CN 110287381 A CN110287381 A CN 110287381A CN 201910563505 A CN201910563505 A CN 201910563505A CN 110287381 A CN110287381 A CN 110287381A
Authority
CN
China
Prior art keywords
node
target
target widget
widget
text
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.)
Granted
Application number
CN201910563505.1A
Other languages
Chinese (zh)
Other versions
CN110287381B (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 lookup method, terminal and the computer readable storage mediums of a kind of page control node, belong to communication technique field.The described method includes: the text shown using the view ID (ViewID) of target widget and/or the target widget searches the node of the target widget when the target interface display where target widget in all child nodes under the root node of the target interface;If not finding the target widget, the node of the target widget is searched in all child nodes under the root node of the target interface using the class name of target widget.Using the present invention, known view ID, text or class name can be made full use of to carry out control lookup can also be searched accordingly even when can not know the view ID or text of control in advance according to class name, it is not only adapted to different application interfaces, but also improves the success rate of node checks.

Description

Lookup method, terminal and the computer readable storage medium of page control node
Technical field
The present invention relates to communication technique field more particularly to a kind of lookup method, terminal and the calculating of page control node Machine readable storage medium storing program for executing.
Background technique
With the continuous development of intelligent terminal (such as smart phone), the system of most of intelligent terminals both provides auxiliary clothes The function of business.Ancillary service provides the user interface of enhancing, it is intended to which helping user, (especially body is inconvenient or operation is ineffective User living) application on auxiliary operation intelligent terminal.In order to realize the auxiliary operation to application, ancillary service, which needs to have, is looked into Page control is looked for obtain the function of nodal information and simulated operation.
In the prior art, although many intelligent terminals support miscellaneous function, since each software business man customizes or makes by oneself The control of justice, there is no monolithic standards, and miscellaneous function is caused to can not find the control at interface, thus can not obtain control Nodal information, so that can not realize simulated operation even if there is miscellaneous function.
Therefore, it is necessary to method, terminal and the computer readable storage medium of a kind of page control node checks are provided, with Different application interfaces is adapted to, the node of page control is effectively found, to obtain the nodal information of control.
Summary of the invention
In view of this, the purpose of the present invention is to provide lookup method, terminal and the computers of a kind of page control node Readable storage medium storing program for executing does not adapt to different application interfaces to solve existing terminal system miscellaneous function, cause search less than The node of page control and the problem of obtain the nodal information of control.
It is as follows that the present invention solves technical solution used by above-mentioned technical problem:
According to the first aspect of the invention, page control node described in a kind of lookup method of page control node is provided Lookup method the following steps are included:
When the target interface display where control, shown using the view ID and/or the target widget of target widget Text the node of the target widget is searched in all child nodes under the root node of the target interface;
It is all under the root node of the target interface using the class name of target widget if not finding the target widget The node of the target widget is searched in child node
According to the second aspect of the invention, a kind of terminal is provided, the terminal includes: memory, processor and deposits The computer program that can be run on the memory and on the processor is stored up, the computer program is by the processor The step of being realized as described in relation to the first aspect when execution.
According to the third aspect of the present invention, a kind of computer readable storage medium, the computer-readable storage are provided It is stored with computer program on medium, page control as described in relation to the first aspect is realized when the computer program is executed by processor The step of lookup method of part node
The lookup method of the page control node of the embodiment of the present invention, first with the view ID of target widget and/or described The text that target widget is shown is searched, and when searching failure, is continued with control class name and is searched, can be made full use of Known view ID, text or class name carry out control lookup, accordingly even when the view ID or text of control can not be known in advance, It can be searched according to class name, not only be adapted to different application interfaces, but also improve the success rate of node checks.
Detailed description of the invention
A kind of hardware structural diagram of Fig. 1 mobile terminal of each embodiment to realize the present invention;
Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of the lookup method for page control node that the embodiment of the present invention one provides;
Fig. 4 is the complete flow chart for the feasible scheme that embodiment integrally provides;
Fig. 5 is a kind of modular structure schematic diagram of terminal provided by Embodiment 2 of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit 103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1 Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram, Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, TD SDMA), 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 short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102 Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100 When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103 Audio output relevant to the specific function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042 Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model. Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition) The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.; The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071 Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel 1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example, External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111 Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into Row description.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation 204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203, ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS (Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way, Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201 Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration, each embodiment of the method for the present invention is proposed.
The embodiment of the present invention one provides a kind of page control node checks method.Referring to Fig. 3, method flow includes:
Step 301, when where control target interface display when, using target widget view ID (ViewID) and/or The text that the target widget is shown searches the node of the target widget in all child nodes under the root node of the target interface;
If step 302 does not find the target widget, using the class name of target widget under the root node of the target interface The node of the target widget is searched in all child nodes.
In practical application, the view ID of the control of system is known that, and be it is unified, for this control, The ViewID of control can be checked by a variety of methods, such as:
It goes to check with the ddms of eclipse/as;Or when window change, all nodes are traversed, are beaten Print off corresponding ViewID of node, etc..
For the control of some nonsystematics, the case where being not easy to obtain ViewID, or obtain ViewID failure, if These controls are text box (TextView), and button (Button) etc. shows content of text, then control can be used and show Text quickly find corresponding control.
In practical application, there is also a kind of situations, i.e., application is according to certain algorithm come the ViewID's of dynamic control creation Mode and the text for replacing control to show with picture, such as the view ID of control at interface of Android version wechat is exactly that dynamic is raw At.It in this case, is that can not find the corresponding node of control by the ViewID of control or the text of display, this When can use the class name of control and searched.
In a feasible scheme, after step 302, this method further include:
If do not find with the matched child node of the class name of the target widget, suspend lookup;
After reaching preset duration between when pausing, step 301 and step 302 are repeated, until finding the target control The node of part.
In a feasible scheme, which includes:
The findAccessibilityNodeInfosByViewId () method of calling, under the root node for traversing the target interface Child node, search corresponding with ID child node;
If not finding the child node, findAccessibilityNodeInfosByViewText () method is called, The child node under the root node of the target interface is traversed, child node corresponding with the text that the target widget is shown is searched.
In practical application, child node is searched using ID and can be exchanged using the sequence of text search child node, i.e., First findAccessibilityNodeInfosByViewText () method is called to be searched, if not finding corresponding sub- section Point recalls findAccessibilityNodeInfosByViewId () method and is searched.
In a feasible scheme, step 302 includes:
The AccessibilityNodeInfo.getClassName () method of calling, obtains all child nodes of the target interface Class name;
Search the matched child node of class name with the target widget.
In practical application, by taking Android system as an example, the class name of node is fixed and invariable, even if can not know node The text that ViewID or control are shown, only it is to be understood that the class name of control can find corresponding node, for example, the class of button The class of entitled " bottom ", input frame is entitled " edittext ".
In a feasible scheme, before step 301, this method further includes following steps:
The target interface and target widget for needing to monitor are determined according to ancillary events configuration information;
Whether monitoring system shows the target interface.
In practical application, in order to realize ancillary service function, need a specified ancillary events configuration file handling and The specified event of filtering.Miscellaneous function configuration can be realized by AccessibilityServiceInfo, be taken in miscellaneous function The setServiceInfo of AccessibilityServiceInfo class is called in onServiceConnected () method of business () method configures.
It can specify the operation which application is the miscellaneous function monitor by miscellaneous function configuration, which thing allowed to handle Part, the type of user click event feedback, searches node mode, time-out time, if miscellaneous function is allowed to obtain window node Information etc..
In a feasible scheme, when finding the node of the target widget, this method further include:
Obtain the nodal information of the target widget;
The nodal information is fed back into the miscellaneous function program, the ancillary service journey of the non-cutting time configuration information is provided Sequence or plug-in unit.
In a feasible scheme, before step 301, this method further includes following steps:
The information of all nodes under the root node of the target pages is obtained, which includes the ViewID and section of node At least one of the class name of text and node that the corresponding control of point is shown.
Specifically, current page nodal information AccessibilityNodeInfo can be obtained by the following method:
1, AccessibilityEvent#getSource: AccessibilityNodeInfo Event origin is obtained;
2, all letters of current window root node AccessibilityService#getRootInActiveWindow: are obtained Breath.
Referring to Fig. 4, the complete flow chart of a feasible scheme for the present embodiment, includes the following steps:
Step 401, when target interface display when, call findAccessibilityNodeInfosByViewId () method Search the node of target widget;
Step 402 judges whether to find the node of target widget, if so, step 408 is executed, it is no to then follow the steps 403;
Step 403 calls findAccessibilityNodeInfosByViewText () method to search target widget Node;
Step 404 judges whether to find the node of target widget, if so, execution step 408, otherwise executes step Rapid 405;
Step 405 calls AccessibilityNodeInfo.getClassName () method, searches the section of object space Point;
Step 406 judges whether to find the node of target widget, if so, execution step 408, otherwise executes step Rapid 407;
Step 401 is continued to execute after step 407, pause 200ms;
Specifically, suspending the purpose searched after step 406, to be to ensure that interface control show complete, so that raising is looked into The success rate looked for.
The information of step 408, the node arrived to corresponding ancillary service program or plug-in unit feedback search.
In practical application, corresponding ancillary service program or plug-in unit, which refer to, completes registration in system ancillary service function With the program or plug-in unit of setting.
The lookup method of the page control node of the present embodiment, view ID and/or the target control first with target widget The text that part is shown is searched, and when searching failure, is continued with control class name and is searched, and can be made full use of known View ID, text or class name carry out control lookup, accordingly even when the view ID or text of control can not be known in advance, it can also root It is searched according to class name, is not only adapted to different application interfaces, but also improve the success rate of node checks.
On the basis of previous embodiment, second embodiment of the present invention provides a kind of terminals, referring to Fig. 5, the terminal packet It includes: memory 501, processor 502 and being stored in the computer that can be run on the memory 501 and on the processor 502 Program 503, the computer program 503 realize step as described below when being executed by the processor 502:
When the target interface display where target widget, the view ID (ViewID) of target widget and/or the mesh are utilized The text that mark control is shown searches the node of the target widget in all child nodes under the root node of the target interface;
If not finding the target widget, all sub- sections of the class name of target widget under the root node of the target interface are utilized The node of the target widget is searched in point.
In practical application, the view ID of the control of system is known that, and be it is unified, for this control, The ViewID of control can be checked by a variety of methods, such as:
It goes to check with the ddms of eclipse/as;Or when window change, all node are traversed, are beaten Print off corresponding ViewID of node, etc..
For the control of some nonsystematics, the case where being not easy to obtain ViewID, or obtain ViewID failure, if These controls are text box (TextView), and button (Button) etc. shows content of text, then control can be used and show Text quickly find corresponding control.
In practical application, there is also a kind of situations, i.e., application is according to certain algorithm come the ViewID's of dynamic control creation Mode and the text for replacing control to show with picture, such as the view ID of control at interface of Android version wechat is exactly that dynamic is raw At.It in this case, is that can not find the corresponding node of control by the ViewID of control or the text of display, this When can use the class name of control and searched.
In a feasible scheme, when computer program 503 is executed by the processor 502, the step being somebody's turn to do as follows is also realized It is rapid:
If do not find with the matched child node of the class name of the target widget, suspend lookup;
After reaching preset duration between when pausing, repeat " using target widget view ID (ViewID) and/or should The text that target widget is shown searches the node of the target widget in all child nodes under the root node of the target interface, and When not finding the target widget, looked into all child nodes under the root node of the target interface using the class name of target widget Look for the node of the target widget " the step of, until finding the node of the target widget.
In a feasible scheme, " the view ID (ViewID) of target widget and/or the target widget are utilized in execution The text of display searches the node of the target widget in all child nodes under the root node of the target interface " step when, It is also executed by processor 502, realizes following steps:
The findAccessibilityNodeInfosByViewId () method of calling, under the root node for traversing the target interface Child node, search corresponding with ID child node;
If not finding the child node, findAccessibilityNodeInfosByViewText () method is called, The child node under the root node of the target interface is traversed, child node corresponding with the text that the target widget is shown is searched.
In practical application, child node is searched using ID and can be exchanged using the sequence of text search child node, i.e., First findAccessibilityNodeInfosByViewText () method is called to be searched, if not finding corresponding sub- section Point recalls findAccessibilityNodeInfosByViewId () method and is searched.
In a feasible scheme, in execution " using the class name of target widget under the root node of the target interface The node of the target widget is searched in all child nodes " step when, which is also executed by processor 502, real Existing following steps:
The AccessibilityNodeInfo.getClassName () method of calling, obtains all child nodes of the target interface Class name;
Search the matched child node of class name with the target widget.
In practical application, by taking Android system as an example, the class name of node is fixed and invariable, even if can not know node The text that ViewID or control are shown, only it is to be understood that the class name of control can find corresponding node, for example, the class of button The class of entitled " bottom ", input frame is entitled " edittext ".
In a feasible scheme, " the view ID (ViewID) of target widget and/or the target are utilized executing step The text that control is shown searches the node of the target widget in all child nodes under the root node of the target interface " before, Computer program 503 is also executed by processor 502, realizes following steps:
The target interface and target widget for needing to monitor are determined according to ancillary events configuration information;
Whether monitoring system shows the target interface.
In practical application, in order to realize ancillary service function, need a specified ancillary events configuration file handling and The specified event of filtering.Miscellaneous function configuration can be realized by AccessibilityServiceInfo, be taken in miscellaneous function The setServiceInfo of AccessibilityServiceInfo class is called in onServiceConnected () method of business () method configures.
It can specify the operation which application is the miscellaneous function monitor by miscellaneous function configuration, which thing allowed to handle Part, the type of user click event feedback, searches node mode, time-out time, if miscellaneous function is allowed to obtain window node Information etc..
In a feasible scheme, computer program 503 is also executed by processor 502 and realizes following steps:
When finding the node of the target widget, the nodal information of the target widget is obtained;
The nodal information is fed back to this, the ancillary service program or plug-in unit of non-cutting time configuration information are provided.
In a feasible scheme, " the view ID (ViewID) of target widget and/or the target are utilized executing step The text that control is shown searches the node of the target widget in all child nodes under the root node of the target interface " before, Computer program 503 also by processor 502 voluntarily, realize following steps:
The information of all nodes under the root node of the target pages is obtained, which includes the view ID and section of node At least one of the class name of text and node that the corresponding control of point is shown.
The terminal of the present embodiment is carried out first with the text that the view ID and/or the target widget of target widget are shown It searches, when searching failure, continues with control class name and searched, known view ID, text or class can be made full use of Name carries out control lookup can also be searched accordingly even when can not know the view ID or text of control in advance according to class name, It is not only adapted to different application interfaces, but also improves the success rate of node checks.
On the basis of previous embodiment, the embodiment of the present invention three provides a kind of computer readable storage medium, the meter It is stored with computer program on calculation machine readable storage medium storing program for executing, such as embodiment one is realized when the computer program is executed by processor The step of lookup method of the page control node.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form, all of these belong to the protection of the present invention.

Claims (9)

1. a kind of lookup method of page control node, which is characterized in that the lookup method of the page control node include with Lower step:
When the target interface display where target widget, view ID and/or the target widget using the target widget The text of display searches the node of the target widget in all child nodes under the root node of the target interface;
If not finding the target widget, all sub- sections of the class name of target widget under the root node of the target interface are utilized The node of the target widget is searched in point.
2. the lookup method of page control node as described in claim 1, which is characterized in that the class using target widget Name searches the node of the target widget in all child nodes under the root node of the target interface after, the method is also Include:
If do not find with the matched child node of the class name of the target widget, suspend lookup;
After reaching preset duration between when pausing, step as described in claim 1 is repeated, until finding the target The node of control.
3. the lookup method of page control node as described in claim 1, which is characterized in that the view using target widget Described in the text that figure ID and/or the target widget are shown is searched in all child nodes under the root node of the target interface The step of node of target widget includes:
The findAccessibilityNodeInfosByViewId () method of calling, under the root node for traversing the target interface Child node searches child node corresponding with the view ID;
If not finding the child node, findAccessibilityNodeInfosByViewText () method is called, time The child node under the root node of the target interface is gone through, child node corresponding with the text that the target widget is shown is searched.
4. the lookup method of page control node as described in claim 1, which is characterized in that the class using target widget The step of name searches the node of the target widget in all child nodes under the root node of the target interface include:
The AccessibilityNodeInfo.getClassName () method of calling, obtains all child nodes of the target interface Class name;
Search the matched child node of class name with the target widget.
5. the lookup method of page control node as described in claim 1, which is characterized in that executing the utilization target control The text that the view ID of part and/or the target widget are shown searches the target in all child nodes of the target interface Before the step of node of control, the method also includes following steps:
The target interface and target widget for needing to monitor are determined according to ancillary events configuration information;
Whether monitoring system shows the target interface.
6. the lookup method of page control node as claimed in claim 5, which is characterized in that when finding the target widget Node when, the method also includes:
Obtain the nodal information of the target widget;
The nodal information is fed back to, the ancillary service program or plug-in unit of the non-cutting time configuration information are provided.
7. the lookup method of page control node as described in claim 1, which is characterized in that the view using target widget The text that figure ID and/or the target widget are shown searches the target widget in all child nodes of the target interface Before node, the method also includes:
Obtain the information of all child nodes under the root node of the target pages, the information include node view ID, with At least one of the class name of text and node that the corresponding control of node is shown.
8. a kind of terminal, which is characterized in that the terminal includes: memory, processor and is stored on the memory simultaneously The computer program that can be run on the processor is realized when the computer program is executed by the processor as right is wanted Seek 1 to 7 described in any item steps.
9. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes the page control node as described in any one of claims 1 to 7 when the computer program is executed by processor Lookup method the step of.
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 true CN110287381A (en) 2019-09-27
CN110287381B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112800185A (en) * 2021-04-08 2021-05-14 智道网联科技(北京)有限公司 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

Cited By (1)

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

Also Published As

Publication number Publication date
CN110287381B (en) 2024-02-09

Similar Documents

Publication Publication Date Title
CN109407957A (en) Screen touch control method, terminal and computer readable storage medium
CN109725866A (en) Application interface display methods, terminal and computer readable storage medium
CN107239567A (en) A kind of recognition methods of object scene, equipment and computer-readable recording medium
CN110180181A (en) Screenshot method, device and the computer readable storage medium of Wonderful time video
CN110069167A (en) Touch point sweep-out method, mobile terminal and computer readable storage medium
CN109766119A (en) Restore subregion upgrade method, terminal and computer readable storage medium
CN109584897A (en) Vedio noise reduction method, mobile terminal and computer readable storage medium
CN109254972A (en) A kind of offline order Word library updating method, terminal and computer readable storage medium
CN109117105A (en) A kind of collaboration desktop interaction regulation method, equipment and computer readable storage medium
CN110069458A (en) Method, equipment and the storage medium of invalid resource in a kind of deletion Android system
CN110064196A (en) Method for controlling mobile terminal, mobile terminal and computer readable storage medium
CN109445660A (en) A kind of wearable device control method, mobile terminal and wearable device
CN109683797A (en) A kind of viewing area control method, equipment and computer readable storage medium
CN110167004A (en) A kind of network registering method, mobile terminal and computer readable storage medium
CN110007817A (en) A kind of message treatment method and mobile terminal, computer readable storage medium
CN110096173A (en) Method for controlling mobile terminal, mobile terminal and computer readable storage medium
CN109918101A (en) Terminal and its application component management method, computer readable storage medium
CN110191477A (en) A kind of web search control method, terminal and computer readable storage medium
CN109656649A (en) A kind of desktop application control method, terminal and computer readable storage medium
CN110287381A (en) Lookup method, terminal and the computer readable storage medium of page control node
CN108879117A (en) Mobile terminal and its antenna structure
CN109117036A (en) A kind of notification information interaction regulation method, equipment and computer readable storage medium
CN110377458A (en) Data reconstruction method, mobile terminal and computer readable storage medium
CN110069291A (en) A kind of display control method, mobile terminal and computer readable storage medium
CN109739676A (en) A kind of operational monitoring method, mobile terminal and computer 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