CN110704148B - Acquisition method and device of equipment page element, server and storage medium - Google Patents

Acquisition method and device of equipment page element, server and storage medium Download PDF

Info

Publication number
CN110704148B
CN110704148B CN201910894917.3A CN201910894917A CN110704148B CN 110704148 B CN110704148 B CN 110704148B CN 201910894917 A CN201910894917 A CN 201910894917A CN 110704148 B CN110704148 B CN 110704148B
Authority
CN
China
Prior art keywords
equipment
page element
target
acquiring
event
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
CN201910894917.3A
Other languages
Chinese (zh)
Other versions
CN110704148A (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.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya 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 Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN201910894917.3A priority Critical patent/CN110704148B/en
Publication of CN110704148A publication Critical patent/CN110704148A/en
Application granted granted Critical
Publication of CN110704148B publication Critical patent/CN110704148B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of acquisition of page elements of terminal equipment, and provides an acquisition method, a device, a server and a storage medium of equipment page elements, wherein the acquisition method of the equipment page elements comprises the steps of receiving event messages which are sent by a web interface and are used for acquiring the equipment page elements; pushing the event message to a service logic layer through a message queue; calling a corresponding capturing tool to acquire an equipment page element of target equipment according to the type of an operating system of the target equipment through the service logic layer; and receiving equipment page elements returned by the target equipment, and returning the equipment page elements to the web interface. The acquisition scheme of the equipment page elements reduces the operation difficulty and is beneficial to improving the acquisition efficiency of the equipment page elements of the terminal equipment.

Description

Acquisition method and device of equipment page element, server and storage medium
Technical Field
The application relates to the technical field of acquisition of page elements of terminal equipment, in particular to an acquisition method, an acquisition device, a server and a storage medium of page elements of equipment.
Background
With the wide application of terminal equipment, testers often need to acquire event messages of applications when writing UI automation use cases, and different tools are needed to be used for acquiring different operating systems in the current operation mode, for example, for Android equipment, the event messages are acquired through a WebDriverAgent test framework mainly through tool event messages provided by Android SDK, and for iOS equipment. The method relates to more specific event information, namely, page elements of viewing equipment are acquired, and page controls are acquired for Android equipment mainly through a tool uiAutomaker tool provided by an Android SDK and through an insactor function provided by a WebDriverAlgent test framework for iOS equipment. In the process, the testers need to install the environments of the two frames respectively, the process is complicated, the testers have higher requirements, and the execution efficiency is lower.
Disclosure of Invention
In order to solve the problems of complicated process, low efficiency and the like caused by the acquisition of the page elements of the current equipment, the application provides the following technical scheme:
in a first aspect, the present application provides a method for acquiring a device page element, including the following steps:
receiving an event message sent by a web interface for acquiring a device page element;
pushing the event message to a service logic layer through a message queue; calling a corresponding capturing tool to acquire an equipment page element of target equipment according to the type of an operating system of the target equipment through the service logic layer;
and receiving equipment page elements returned by the target equipment, and returning the equipment page elements to the web interface.
In one embodiment, before pushing the event message to the business logic process through the message queue, the method further includes:
and establishing a corresponding event channel according to the event message, and monitoring by utilizing the event channel.
In one embodiment, the step of utilizing the event channel to monitor includes:
adding the event channel into a monitoring queue, and setting the event message as a subscription theme of the event channel;
and monitoring the event message of the subscription theme by using the event channel.
In one embodiment, the acquire device page element is set to a screen. Dump event;
the step of receiving the event message sent by the web interface and used for acquiring the page element of the equipment comprises the following steps:
and when the receiving web interface sends a screen. Dump event, the screen. Dump event is packaged into an event message of the Screen dumpMessgae.
In one embodiment, the step of calling, by the service logic layer, a corresponding capturing tool according to an operating system type of a target device to obtain a page element of the target device includes:
the service logic layer acquires the type of the operating system of the target equipment according to the event message;
and according to the type of the operating system, calling a corresponding capturing tool by utilizing the service logic layer, and driving the target equipment to execute the event message.
In one embodiment, the step of the driving target device executing the event message includes:
the business logic layer drives the target equipment to execute the event message through an application program installed on the target equipment.
In one embodiment, before the step of executing the event message, the driving target device further includes:
acquiring attribute information of target equipment, and performing drive verification on the capture tool;
and if the verification is successful, sending a capturing command by using the capturing tool to the target device so as to acquire the device page element.
In one embodiment, the step of calling the corresponding capture tool by using the service logic layer according to the operating system type includes:
when the type of the operating system of the target equipment is an Android system, invoking ADB for the target equipment by utilizing the business logic layer;
and when the type of the operating system of the target equipment is an IOS system, calling WebDriverAlgent for the target equipment by utilizing the service logic layer.
In one embodiment, before the step of receiving the device page element returned by the target device, the method further includes:
and acquiring a local file stored in the target equipment through the service logic layer, and resolving and converting the local file into a json file.
In one embodiment, the step of receiving the device page element returned by the target device includes:
receiving a local file returned by the target equipment and analyzing and acquiring a corresponding json file;
reading the json file to obtain a corresponding page tag;
and obtaining the equipment page element of the target equipment according to the page tag.
In one embodiment, the step of returning the device page element to the web interface comprises:
and displaying the equipment page element on the web interface by using a reaction frame.
In a second aspect, the present application further provides an apparatus for acquiring a device page element, including:
the receiving module is used for receiving event messages which are sent by the web interface and are used for acquiring page elements of the equipment;
the calling module is used for pushing the event message to a service logic layer through a message queue; calling a corresponding capturing tool to acquire an equipment page element of target equipment according to the type of an operating system of the target equipment through the service logic layer;
and the return module is used for receiving the equipment page element returned by the target equipment and returning the equipment page element to the web interface.
In a third aspect, the present application also provides a server, comprising:
one or more processors;
a memory;
one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to perform the method of acquiring device page elements according to any embodiment of the first aspect.
In a fourth aspect, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement a method for acquiring a device page element according to any embodiment of the first aspect.
According to the method, the device, the server and the storage medium for acquiring the equipment page element, the event message for acquiring the equipment page element is sent to the target equipment, and the type of an operating system of the target equipment is not required to be considered. The event message is pushed to a business logic layer through a message queue, then the type of an operating system of target equipment is judged, a corresponding capturing tool is called to capture equipment page elements, and the equipment page elements are returned to a web interface through a server to be displayed. The application only needs to send the event message for acquiring the equipment page element to the server which is in data connection with the target equipment through the web interface, and the server calls the corresponding capturing tool to acquire the equipment page element according to the type of the operating system of the target equipment, and uniformly displays the equipment page element returned by the target equipment.
According to the equipment page element acquisition scheme provided by the application, the user uniformly transmits the event message and acquires the equipment page element through the web interface, so that the executed program is simplified, and the operation amount of the server is reduced; in addition, the user does not need to send corresponding event messages according to the type of the operating system of the target device as in the prior art, so that the operating difficulty is reduced, and the operating efficiency of acquiring the page elements of the device is improved.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is an application environment diagram of an embodiment of the application executing an acquisition scheme for device page elements;
FIG. 2 is a flow chart of a method of acquiring device page elements in one embodiment of the application;
fig. 3a is a schematic diagram of a target device selection interface of a method for obtaining a device page element according to the present application;
fig. 3b is a schematic diagram of an operation interface of a method for obtaining a device page element according to the present application;
FIG. 4 is a flow chart of a method of acquiring device page elements in accordance with another embodiment of the present application;
FIG. 5 is a flow chart showing the steps of step S220 of the present application;
FIG. 6 is a flow chart showing the sub-steps of step S230 of the present application;
FIG. 7 is a flowchart of a method for obtaining a device page element according to another embodiment of the present application;
FIG. 8 is a schematic diagram of a device page element acquiring apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, but do not preclude the presence or addition of one or more other features, integers, steps, operations, and/or groups thereof. It will be understood by those skilled in the art that all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs unless defined otherwise. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
As used herein, a "terminal" or "terminal device" includes both a device of a wireless signal receiver having no transmitting capability and a device of receiving and transmitting hardware having receiving and transmitting hardware capable of performing bi-directional communications over a bi-directional communication link, as will be appreciated by those skilled in the art.
Referring to fig. 1, fig. 1 is an application environment diagram of an embodiment of the present application for executing an acquisition scheme of a device page element. In this embodiment, the technical solution of the present application is that, based on the device cluster platform 110, an event message for obtaining a device page element is sent to the target device 130 through the server 120 by network connection, where the target device 130 obtains the device page element according to the event message and returns the device page element to the interface of the device cluster platform 110 in the original path.
In order to reduce the difficulty of acquiring the equipment page elements of the terminal equipment of different operating systems and improve the acquisition efficiency, the application provides an acquisition method of the equipment page elements. Referring to fig. 2, fig. 2 is a flowchart of a method for acquiring a device page element according to an embodiment of the present application, the method for acquiring a device page element includes the steps of:
s210, receiving an event message sent by the web interface for acquiring the page element of the equipment.
And the user sends an event message for acquiring the page element of the device to the target device through the server through the web interface of the control terminal. In this embodiment, the web interface is a web interface that performs an operation on the device cluster platform. The device cluster platform is provided with operation links of different terminal devices, and the operation links can display the expression forms such as icons of the corresponding terminal devices. The user can send event information to the corresponding terminal equipment through the operation link.
And the server performs data processing according to the event message of acquiring the equipment page element, which is sent by the user through the web interface of the equipment cluster platform, so as to send an instruction of acquiring the equipment page element to the target equipment.
In this step, reference may be made to fig. 3a-3b, fig. 3a is a schematic diagram of a target device selection interface of a method for obtaining a device page element provided by the present application, and fig. 3b is a schematic diagram of an operation interface of a method for obtaining a device page element provided by the present application. As shown in fig. 3a, a user selects a target device for acquiring a device page element through a web device selection interface of the device cluster platform. The web interface jumps to the operation interface acquired by the device page element according to the selection, as shown in fig. 4. On the operation interface, the user sends out a corresponding event message to the server by clicking the checker control on the interface. The server establishes an Xpath path corresponding to the inspector control, and obtains an event message for the device page element of the target device through the Xpath path.
S220, pushing the event message to a service logic layer through a message queue; and calling a corresponding capturing tool according to the type of the operating system of the target equipment through the service logic layer to acquire the equipment page element of the target equipment.
In the application, after the server receives the event message sent by the user through the web interface of the control terminal through the middle layer, the server takes the event message as the theme of the message queue, adds the event message into the message queue and pushes the event message to the service logic layer through the message queue.
The message queue may be a message queue formed by the server obtaining the device serial number of the target device through the acquired event message.
And after the service logic layer receives the event message, acquiring the type of the operating system of the target equipment according to the event message, wherein the type of the operating system can be Android, IOS, microsoft or the like. And calling a capturing tool corresponding to the type of the operating system according to the type of the operating system of the target equipment, sending an instruction for acquiring the equipment page element corresponding to the target equipment according to the communication address of the target equipment, and driving the target equipment to execute the operation for acquiring the equipment page element.
And S230, receiving the equipment page element returned by the target equipment, and returning the equipment page element to the web interface. In the step, the target device executes the operation of acquiring the device page element, and returns the device page element to the web interface for display after the analysis and data conversion of the server.
According to the original acquisition method of the equipment page, provided by the application, the event information of the user for acquiring the equipment page elements of the target equipment with different operation system types is acquired through the web interface in a unified way, the server correspondingly calls the corresponding acquisition tool according to the operation system type of the target equipment obtained by the event information, sends an instruction for acquiring the equipment page elements to the target equipment, and displays the unified display through the web interface. According to the scheme, the event message and the presentation of the equipment page element are sent to target equipment of different operating system types and are unified to the web interface to finish, so that the operation of acquiring the equipment page element of the target equipment is simplified, and the acquisition efficiency of the equipment page element is improved.
Before step S220, the method further includes:
and establishing a corresponding event channel according to the event message, and monitoring by utilizing the event channel.
The server receives the event message and establishes a corresponding time channel for the event message. The server listens for the event message using the event channel. When the user sends the event message through the web interface, the event channel monitors the event message and pushes the event message to a service logic layer through a message queue. And when the target equipment returns the equipment page element to the business logic layer, the event channel monitors the return information of the event message, and the return information is returned to the web interface.
Referring to fig. 4, fig. 4 is a flowchart of a method for acquiring a device page element according to another embodiment of the present application.
For the step of establishing the corresponding event channel according to the event message and monitoring by using the event channel, the method may further include:
s2101, adding the event channel into a monitoring queue, and setting the event message as a subscription theme of the event channel;
s2102, monitoring the event message of the subscription theme by utilizing the event channel.
For steps S2101-S2102, the server establishes corresponding event channels according to different event messages, and then adds each event channel to the listening queue. And each of the event channels listens only for the corresponding event message. And each event channel is set as a subscription theme of the event channel by the event message, so that the event channel monitors and transmits the event message or return information corresponding to the event message. By using the event channel and the subscription theme set as the event channel for the event message, the event message can be ensured to be transmitted to the corresponding target equipment, and the operation result of acquiring the equipment page element is received by the target equipment, so that the purpose of accurately transmitting and receiving data is achieved.
In this embodiment, the acquiring device page element is set to a screen.
On this basis, step S210 may include:
and when the receiving web interface sends a screen. Dump event, the screen. Dump event is packaged into an event message of the Screen dumpMessgae.
And setting the acquisition equipment page element as a screen. Dump event, and encapsulating the screen. Dump event in the middle layer through a server to form an event message of the screen dumpMessae. And taking the event message of the Screen dumpMessgae as a theme of a message queue, adding the event message to the message queue, and pushing the event message to the service logic layer. In the embodiment, according to the setting and packaging processing of the event, the task of acquiring the equipment page element is more conveniently identified by the server, the corresponding command is responded timely, and the efficiency of acquiring the mouse page element is improved.
Referring to fig. 5, fig. 5 is a flow chart illustrating the sub-steps of step S220 according to the present application.
The step of calling, by the service logic layer, a corresponding capturing tool according to the operating system type of the target device to obtain the page element of the target device in step S220 includes:
s221, the service logic layer acquires the type of the operating system of the target equipment according to the event message;
s222, according to the type of the operating system, the corresponding capture tool is called by utilizing the service logic layer, and the target equipment is driven to execute the event message.
For steps S221-S222, when the service logic layer obtains an event message through the middle layer, the service logic layer obtains the device parameters of the target device according to the event message. The device information includes the content such as the device model number and the operating system type of the device.
And the service logic layer calls a capturing tool for acquiring the page element of the equipment corresponding to the type of the operating system according to the obtained type of the operating system about the target equipment. And the business logic layer calls the capture tool and sends a corresponding capture command to the corresponding target device so as to drive the target device to execute the event message for acquiring the device page element.
In contrast, in the present embodiment, the step of the driving target device executing the event message includes:
the business logic layer drives the target equipment to execute the event message through an application program installed on the target equipment.
And installing a corresponding application program for executing and acquiring the equipment page element on the target equipment. When the business logic layer sends a capture command to the target device, an application in the target device is driven. The application program obtains the current UI (User Interface) according to the capture command transmitted by the service logic layer.
According to the method, the device and the system, the program for directly executing the device page element is respectively installed on each executed terminal device, the method that different event messages are respectively transmitted to different target devices of different operating system types in the prior art is changed, the event messages are conveniently transmitted to different target devices through a unified web interface, the operation difficulty of acquiring the device page element is further reduced, and the device page element acquisition efficiency is improved.
On this basis, before the step of executing the event message, the driving target device further includes:
acquiring attribute information of target equipment, and performing drive verification on the capture tool;
and if the verification is successful, sending a capturing command by using the capturing tool to the target device so as to acquire the device page element.
In this embodiment, when the target device obtains the capture command, the service logic layer obtains attribute information of the target device, obtains an operating system type of the target device, and performs driving verification of the operating system type on a capture tool corresponding to the capture command.
After verification, a result that the type of the operating system corresponding to the capturing tool is consistent with the type of the operating system obtained from the attribute information of the target equipment is obtained, and verification is successful. And the service logic layer directly sends the capturing command of the capturing tool to the target equipment according to the result of successful self-verification so as to drive the target equipment to execute the event message. Therefore, the capturing command received by the target device can be ensured, the event message can be executed, the situation that the target device executes an error command is reduced, and the efficiency of the target device for executing and acquiring the page element of the device is improved.
For step S222, the step of calling the corresponding capturing tool by using the service logic layer according to the operating system type may further include:
when the type of the operating system of the target equipment is an Android system, invoking ADB for the target equipment by utilizing the business logic layer;
and when the type of the operating system of the target equipment is an IOS system, calling WebDriverAlgent for the target equipment by utilizing the service logic layer.
In steps S2221-S2222, different capture tools are invoked correspondingly for the operating system type of the target device to perform the acquisition of the device page elements.
And if the operation system type of the corresponding target equipment is Android system according to the event message, the business logic call ADB and send an ADB command to the target equipment so as to drive the target equipment to execute the event message for acquiring the equipment page element.
And if the operation system type of the corresponding target equipment is the IOS system according to the event message, the service logic calls WebDrivergent, starts an application program of the target equipment through an insactor instruction provided by a WebDrivergent test framework, and directly executes the event message for acquiring the equipment page element on the terminal equipment through XCTest.
Before the step of receiving the device page element returned by the target device in step S230, the method further includes:
and acquiring a local file stored in the target equipment through the service logic layer, and resolving and converting the local file into a json file.
After receiving and executing the capturing command sent by the capturing tool, the target device stores the currently acquired device page element in the local file. The server obtains the local file through the service logic layer and reads the local file, and then analyzes and converts the local file into a json file
Referring to fig. 6, fig. 6 is a flow chart illustrating the sub-steps of step S230 of the present application.
On this basis, for the step of receiving the device page element returned by the target device in step S230, the method includes:
s231, receiving a local file returned by the target device and analyzing and acquiring a corresponding json file;
s232, reading the json file to obtain a corresponding page tag;
s233, obtaining the device page element of the target device according to the page tag.
In step S231-S233, when the server receives the local file returned by the target device through the service logic layer, the local file is parsed to obtain a corresponding json file, and the json file is transmitted to the device cluster platform. And analyzing the json file to obtain a corresponding page tag. And obtaining the equipment page element displayed by the UI of the target equipment according to the page tag.
On this basis, the step of returning the device page element to the web interface for the step S230 includes:
s234, displaying the equipment page element on the web interface by using a reaction frame.
And displaying the equipment page element displayed by the UI obtained by the equipment cluster platform on a web interface of the equipment cluster platform by using a reaction frame for a user to use.
In order to better illustrate the execution process of the method for acquiring the device page element of the present application, a specific embodiment is described below. Meanwhile, referring to fig. 7, fig. 7 is a flowchart of a method for acquiring a device page element according to still another embodiment of the present application.
S701, receiving a selection and a screen. Dump event of a target device from a user in a device cluster platform;
s702, creating an event channel according to a screen. Dump event, and adding the event channel into a monitoring queue;
s703, encapsulating the screen. Dump event into an event message of a Screen DumpMessgae, and pushing the event message to a service logic layer by a message queue;
s704, judging the type of the operating system of the target equipment; if the type of the operating system of the target device is an Android system, step S705 is performed; if the operating system type of the target device is IOS system, go to step S706;
s705, calling ADB for the target equipment by utilizing the service logic layer;
s706, using the business logic layer to call WebDriverAlgent for target equipment;
s707, the target equipment acquires equipment page elements of the UI according to the capturing instruction and stores the equipment page elements in a local file;
s708, the business logic layer reads the local file and analyzes and acquires a corresponding json file;
s709, reading the json file to obtain a corresponding page tag;
s710, obtaining the equipment page element of the target equipment according to the page tag, and returning to the web interface of the equipment cluster platform for display.
According to the embodiment, the user uniformly passes through the web interface of the device cluster platform, sends out the event message for acquiring the device page element, calls a corresponding capturing tool according to the type of the operating system of the target device so as to acquire the device page element, and finally uniformly displays the device page element through the web interface. According to the embodiment, corresponding event messages do not need to be sent out for target devices of different operating system types respectively, the event messages are sent to the target devices through the web interface of the device cluster platform in a unified mode, and device page elements returned by the target devices are displayed in a unified mode. Therefore, the difficulty of acquiring the equipment page element is reduced, the corresponding operation process is simplified, the error condition in the operation process can be reduced, and the acquisition efficiency of the equipment page element is improved.
Based on the same inventive concept as the above-mentioned method for acquiring the device page element, the embodiment of the present application further provides an apparatus for acquiring the device page element, referring to fig. 8, fig. 8 is a schematic structural diagram of an apparatus for acquiring the device page element according to an embodiment of the present application, where the apparatus for acquiring the device page element includes:
a receiving module 810, configured to receive an event message sent by a web interface to acquire a device page element;
a calling module 820, configured to push the event message to a service logic layer through a message queue; calling a corresponding capturing tool to acquire an equipment page element of target equipment according to the type of an operating system of the target equipment through the service logic layer;
and a returning module 830, configured to receive an equipment page element returned by the target equipment, and return the equipment page element to the web interface.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a server according to an embodiment of the application. As shown in fig. 9, the server includes a processor 910, a storage medium 920, a memory 930, and a network interface 940 connected by a system bus. The storage medium 920 of the server stores an operating system, a database, and computer readable instructions, where a control information sequence may be stored in the database, where the computer readable instructions when executed by the processor 910 may cause the processor 910 to implement a method for acquiring a device page element, and the processor 910 may implement functions of the receiving module 810, the calling module 820, and the returning module 830 in an apparatus for acquiring a device page element in the embodiment shown in fig. 8. The processor 910 of the server is used to provide computing and control capabilities, supporting the operation of the entire server. The memory 930 of the server may have stored therein computer readable instructions that, when executed by the processor 910, may cause the processor 910 to perform a method of fetching device page elements. The network interface 940 of the server is used for communication with the terminal connection. It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the server to which the present inventive arrangements are applied, and that a particular server may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, the application provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of a method of acquiring a device page element: receiving an event message sent by a web interface for acquiring a device page element; pushing the event message to a service logic layer through a message queue; calling a corresponding capturing tool to acquire an equipment page element of target equipment according to the type of an operating system of the target equipment through the service logic layer; and receiving equipment page elements returned by the target equipment, and returning the equipment page elements to the web interface.
As can be seen from the above embodiments, the beneficial effects of the present application are as follows:
according to the method, the device, the server and the storage medium for acquiring the equipment page element, the event message for acquiring the equipment page element is sent to the target equipment, and the type of an operating system of the target equipment is not required to be considered. The method comprises the steps of pushing event information to a business logic layer through an information queue, judging the type of an operating system of target equipment, calling a corresponding capturing tool to capture equipment page elements, and returning the equipment page elements to a web interface through a server for display. The application only needs to send the event message for acquiring the equipment page element to the server which is in data connection with the target equipment through the web interface, and the server calls the corresponding capturing tool to acquire the equipment page element according to the type of the operating system of the target equipment, and uniformly displays the equipment page element returned by the target equipment.
According to the equipment page element acquisition scheme provided by the application, the user uniformly transmits the event message and acquires the equipment page element through the web interface, so that the executed program is simplified, and the operation amount of the server is reduced; in addition, the user does not need to send corresponding event messages according to the type of the operating system of the target device as in the prior art, so that the operating difficulty is reduced, and the operating efficiency of acquiring the page elements of the device is improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application, and it should be noted that it will be apparent to those skilled in the art that modifications and adaptations can be made without departing from the principles of the present application, and such modifications and adaptations are intended to be comprehended within the scope of the present application.

Claims (11)

1. The method for acquiring the page element of the equipment is characterized by comprising the following steps of:
receiving an event message sent by a web interface for acquiring a device page element;
pushing the event message to a service logic layer through a message queue; the service logic layer acquires the type of an operating system of the target device according to the event message, and invokes a corresponding capturing tool to send a capturing command to the target device according to the type of the operating system by using the service logic layer to drive an application program installed on the target device to execute the event message for acquiring the page element of the device; the application program acquires a current user interface according to the capture command transmitted by the service logic layer;
receiving a device page element returned after the target device executes the event message, and returning the device page element to the web interface;
before the step of driving the application program installed on the target device to execute the execution event message of acquiring the device page element, the method further comprises the following steps:
acquiring attribute information of target equipment, and performing drive verification on the capture tool;
and if the type of the operating system corresponding to the capturing tool is consistent with the type of the operating system obtained from the attribute information of the target equipment, sending a capturing command to the target equipment by using the capturing tool so as to acquire the equipment page element.
2. The method of claim 1, wherein pushing the event message to a business logic process via a message queue further comprises:
and establishing a corresponding event channel according to the event message, and monitoring by utilizing the event channel.
3. The method of claim 2, wherein the step of listening with the event channel comprises:
adding the event channel into a monitoring queue, and setting the event message as a subscription theme of the event channel;
and monitoring the event message of the subscription theme by using the event channel.
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
setting the acquisition equipment page element as a screen. Dump event;
the step of receiving the event message sent by the web interface and used for acquiring the page element of the equipment comprises the following steps:
and when the receiving web interface sends a screen. Dump event, the screen. Dump event is packaged into an event message of the Screen dumpMessgae.
5. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the step of calling the corresponding capturing tool by using the service logic layer according to the type of the operating system comprises the following steps:
when the type of the operating system of the target equipment is an Android system, invoking ADB for the target equipment by utilizing the business logic layer;
and when the type of the operating system of the target equipment is an IOS system, calling WebDriverAlgent for the target equipment by utilizing the service logic layer.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
before the step of receiving the device page element returned by the target device, the method further comprises the following steps:
and acquiring a local file stored in the target equipment through the service logic layer, and resolving and converting the local file into a json file.
7. The method of claim 6, wherein,
the step of receiving the device page element returned by the target device comprises the following steps:
receiving a local file returned by the target equipment and analyzing and acquiring a corresponding json file;
reading the json file to obtain a corresponding page tag;
and obtaining the equipment page element of the target equipment according to the page tag.
8. The method of claim 7, wherein,
the step of returning the device page element to the web interface comprises:
and displaying the device page element on the web interface by using a compact framework.
9. An apparatus for acquiring a device page element, comprising:
the receiving module is used for receiving event messages which are sent by the web interface and are used for acquiring page elements of the equipment;
the calling module is used for pushing the event message to a service logic layer through a message queue; the service logic layer acquires the type of an operating system of the target device according to the event message, and invokes a corresponding capturing tool to send a capturing command to the target device according to the type of the operating system by using the service logic layer to drive an application program installed on the target device to execute the event message for acquiring the page element of the device; the application program acquires a current user interface according to the capture command transmitted by the service logic layer;
the return module is used for receiving the equipment page element returned after the target equipment executes the event message and returning the equipment page element to the web interface;
before the step of driving the application program installed on the target device to execute the execution event message of acquiring the device page element, the method further comprises the following steps:
acquiring attribute information of target equipment, and performing drive verification on the capture tool;
and if the type of the operating system corresponding to the capturing tool is consistent with the type of the operating system obtained from the attribute information of the target equipment, sending a capturing command to the target equipment by using the capturing tool so as to acquire the equipment page element.
10. A server, comprising:
one or more processors;
a memory;
one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to perform the method of fetching device page elements of any of claims 1 to 8.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the method of acquiring device page elements according to any of claims 1 to 8.
CN201910894917.3A 2019-09-20 2019-09-20 Acquisition method and device of equipment page element, server and storage medium Active CN110704148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910894917.3A CN110704148B (en) 2019-09-20 2019-09-20 Acquisition method and device of equipment page element, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910894917.3A CN110704148B (en) 2019-09-20 2019-09-20 Acquisition method and device of equipment page element, server and storage medium

Publications (2)

Publication Number Publication Date
CN110704148A CN110704148A (en) 2020-01-17
CN110704148B true CN110704148B (en) 2023-09-05

Family

ID=69195917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910894917.3A Active CN110704148B (en) 2019-09-20 2019-09-20 Acquisition method and device of equipment page element, server and storage medium

Country Status (1)

Country Link
CN (1) CN110704148B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428171B (en) * 2020-03-23 2023-06-30 郑州悉知信息科技股份有限公司 Interface call processing method and system
CN113032080B (en) * 2021-03-31 2023-06-27 广州虎牙科技有限公司 Page implementation method, application program, electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014029265A1 (en) * 2012-08-24 2014-02-27 Tencent Technology (Shenzhen) Company Limited Method and system for pushing message box
CN107004032A (en) * 2016-11-17 2017-08-01 华为技术有限公司 Image file conversion method and device
CN107066377A (en) * 2017-01-18 2017-08-18 青岛海信电器股份有限公司 Page elements acquisition methods and terminal device based on android system
CN108052365A (en) * 2017-12-19 2018-05-18 深圳市四格互联信息技术有限公司 The component generation method and device of user interface
CN108089967A (en) * 2017-12-12 2018-05-29 成都睿码科技有限责任公司 A kind of method for crawling Android mobile phone App data
CN108121650A (en) * 2016-11-29 2018-06-05 腾讯科技(深圳)有限公司 A kind of test method and device for page user interface
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information
CN108984389A (en) * 2018-06-01 2018-12-11 平安科技(深圳)有限公司 A kind of applied program testing method and terminal device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7668798B2 (en) * 2000-04-04 2010-02-23 Red Hat, Inc. System and method for accessing data in disparate information sources

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014029265A1 (en) * 2012-08-24 2014-02-27 Tencent Technology (Shenzhen) Company Limited Method and system for pushing message box
CN107004032A (en) * 2016-11-17 2017-08-01 华为技术有限公司 Image file conversion method and device
CN108121650A (en) * 2016-11-29 2018-06-05 腾讯科技(深圳)有限公司 A kind of test method and device for page user interface
CN107066377A (en) * 2017-01-18 2017-08-18 青岛海信电器股份有限公司 Page elements acquisition methods and terminal device based on android system
CN108089967A (en) * 2017-12-12 2018-05-29 成都睿码科技有限责任公司 A kind of method for crawling Android mobile phone App data
CN108052365A (en) * 2017-12-19 2018-05-18 深圳市四格互联信息技术有限公司 The component generation method and device of user interface
CN108415804A (en) * 2018-01-23 2018-08-17 平安普惠企业管理有限公司 Obtain method, terminal device and the computer readable storage medium of information
CN108984389A (en) * 2018-06-01 2018-12-11 平安科技(深圳)有限公司 A kind of applied program testing method and terminal device

Also Published As

Publication number Publication date
CN110704148A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN111083225B (en) Data processing method and device in Internet of things platform and Internet of things platform
US8843895B2 (en) Debugger connection
CN111274510A (en) Page rendering method, device and equipment and readable storage medium
CN109618225B (en) Video frame extraction method, device, equipment and medium
CN109101228B (en) Application program execution method and device
CN110232091B (en) Method, system and apparatus for synchronizing data
CN110704148B (en) Acquisition method and device of equipment page element, server and storage medium
CN110209967B (en) Page loading method and device, terminal equipment and computer readable medium
CN111818136A (en) Data processing method and device, electronic equipment and computer readable medium
CN113900834A (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN113672405A (en) Data interaction system and page display method based on data interaction system
CN106454403B (en) Data display method, equipment and system
CN111008054A (en) Page display method and equipment and electronic equipment
CN114168853A (en) Data visualization display method, device, medium and electronic equipment
CN114218052A (en) Service interaction graph generation method, device, equipment and storage medium
CN102479082A (en) Method and system for providing client end interface information, and client end interface generating device
CN107704365B (en) Monitoring data reporting method and device for mobile terminal hybrid application
CN113360413A (en) Code testing method and device
CN115809056B (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN114546775A (en) Web monitoring method, device, equipment and medium based on client application
CN114036060A (en) Method, system and computer readable medium for chip testing
CN112416698B (en) Expansion method and device of monitoring system, storage medium and electronic equipment
CN108108369B (en) Method and device for processing calling error of common interface library
CN111124907A (en) Mobile phone game testing method and device and server

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