CN113971059A - Method, device, equipment and storage medium for recovering equipment connection state - Google Patents

Method, device, equipment and storage medium for recovering equipment connection state Download PDF

Info

Publication number
CN113971059A
CN113971059A CN202010714232.9A CN202010714232A CN113971059A CN 113971059 A CN113971059 A CN 113971059A CN 202010714232 A CN202010714232 A CN 202010714232A CN 113971059 A CN113971059 A CN 113971059A
Authority
CN
China
Prior art keywords
connection state
preset
information
user interface
recovery
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010714232.9A
Other languages
Chinese (zh)
Inventor
李括
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN202010714232.9A priority Critical patent/CN113971059A/en
Publication of CN113971059A publication Critical patent/CN113971059A/en
Pending legal-status Critical Current

Links

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for recovering an equipment connection state, which relate to the technical field of equipment maintenance, and the method comprises the following steps: when the change of the connection state is detected, creating a user interface automation operation object; acquiring current page window information through the user interface automation operation object; acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script; and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state. The invention can respond to the change of the connection state of the equipment in time and acquire the information of the current page window through the created user interface automation operation object; and meanwhile, a preset recovery script is obtained, a preset operation sequence in the script is executed, automatic operation on the page is realized, and then the connection state of the equipment is recovered in time.

Description

Method, device, equipment and storage medium for recovering equipment connection state
Technical Field
The present invention relates to the field of device maintenance technologies, and in particular, to a method, an apparatus, a device, and a storage medium for recovering a device connection status.
Background
The communication or data transmission between devices requires connection establishment, and debugging or charging the devices depends on a specific connection state. At present, the connection state between the devices needs to be maintained manually, and when a maintainer finds that the connection between the devices is disconnected, the maintainer needs to restore the connection manually. In most cases, too much manpower cannot be set to monitor the equipment in real time, so that the equipment cannot be found and recovered in time after the equipment is disconnected or the connection mode is changed, and the equipment cannot run for a long time, thereby causing many adverse effects.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, a device, equipment and a storage medium for recovering an equipment connection state, and aims to solve the technical problem that the equipment connection state cannot be recovered in time when the equipment connection state is changed in the prior art.
In order to achieve the above object, the present invention provides a device connection state recovery method, including the steps of:
when the change of the connection state is detected, creating a user interface automation operation object;
acquiring current page window information through the user interface automation operation object;
acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script;
and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
Optionally, the step of creating a user interface automation operation object when detecting that the connection state changes includes:
when detecting that the connection state changes, initializing a thread operation object and a user interface automation operation object;
and calling a user interface automation operation object constructing function through a preset reflection path to create a user interface automation operation object.
Optionally, the step of obtaining information of the current page form through the user interface automation operation object specifically includes:
calling a connection function of an automatic operation object of the user interface through the preset reflection path to be connected with a preset application program interface;
and calling the auxiliary form object through the preset application program interface to acquire the current page form information.
Optionally, after the step of calling an auxiliary function object to execute the interface operation sequence based on the current page form information to restore the connection state to the target connection state, the method further includes:
when the connection state is detected to be restored to the target connection state, calling a cut-off function of a user interface automation operation object through the preset reflection path to be disconnected with the preset application program interface;
and calling a resource release function of the thread operation object to release the user interface automation operation object.
Optionally, the step of calling an auxiliary function object to execute the interface operation sequence based on the current page form information to restore the connection state to the target connection state specifically includes:
determining a control to be operated according to the interface operation sequence;
determining a corresponding target control in the current page form information according to the control to be operated;
and calling an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to a target connection state.
Optionally, the step of calling an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to the target connection state specifically includes:
calling an auxiliary function object to operate the target control according to the interface operation sequence so as to operate a user interface to modify the connection state;
judging whether the execution of the interface operation sequence is finished or not;
when the interface operation sequence is not executed, acquiring an unexecuted control corresponding to the uncompleted sequence;
calling the auxiliary window object through the preset application program interface to acquire intermediate page window information;
and determining a corresponding target control in the intermediate page form information according to the unexecuted control, and returning to the step of calling an auxiliary function object to operate the target control according to the interface operation sequence until the execution of the interface operation sequence is completed so as to restore the connection state to a target connection state.
Optionally, before the step of creating the user interface automation operation object when the change of the connection state is detected, the method further includes:
when connection establishment with external equipment is detected, connection port information is acquired;
determining a current connection state according to the connection port information, and recording first maintenance time of the current connection state;
judging whether the first maintenance time is greater than a first preset threshold value or not;
and when the first maintenance time is greater than the first preset threshold, determining the current connection state as a target connection state.
Optionally, the step of creating a user interface automation operation object when detecting that the connection state changes includes:
when detecting that the connection state changes, acquiring the connection state before changing;
judging whether the connection state before change is the same as the target connection state;
and creating a user interface automation operation object when the connection state before the change is the same as the target connection state.
Optionally, the step of creating a user interface automation operation object when the connection state before the change is the same as the target connection state specifically includes:
acquiring a changed connection state, and recording second maintenance time of the changed connection state;
judging whether the second maintaining time is greater than a second preset threshold value when the connection state before change is the same as the target connection state;
and when the second maintenance time is greater than the second preset threshold value, creating a user interface automation operation object.
Optionally, the step of obtaining a preset recovery script and determining a corresponding interface operation sequence according to the preset recovery script specifically includes:
acquiring target connection state information;
searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script;
and analyzing the preset recovery script to obtain an interface operation sequence.
Optionally, after the step of searching for the corresponding preset recovery script in the preset mapping relationship according to the target connection state, the method further includes:
when the corresponding preset recovery script is not found, acquiring historical connection state recording information;
acquiring reference connection state information from the historical connection state recording information according to a preset reference condition, and taking the reference connection state information as target connection state information;
and returning to the step of searching the corresponding preset recovery script in the preset mapping relation according to the target connection state information.
Optionally, after the step of searching for the corresponding preset recovery script in the preset mapping relationship according to the target connection state, the method further includes:
when the corresponding preset recovery script is not found, displaying the target connection state information through a preset window;
when a file input based on the preset window is received, file information of the file is obtained;
judging whether the file information meets a preset condition or not;
and when the file information meets the preset condition, taking the file as a preset recovery script.
In addition, to achieve the above object, the present invention further provides an apparatus for recovering a device connection state, including:
the object creation model is used for creating a user interface automation operation object when the change of the connection state is detected;
the window information acquisition model is used for acquiring current page window information through the user interface automation operation object;
the sequence generation module is used for acquiring a preset recovery script and determining a corresponding interface operation sequence according to the preset recovery script;
and the execution model is used for calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
Optionally, the object creation model is further configured to initialize the thread operation object and the user interface automation operation object when detecting that the connection state changes;
the object creation model is also used for calling a user interface automation operation object construction function to create a user interface automation operation object through a preset reflection path.
Optionally, the window information obtaining model is further configured to call a connection function of an automation operation object of the user interface through the preset reflection path to connect with a preset application program interface;
and the form information acquisition model is also used for calling an auxiliary form object through the preset application program interface to acquire the current page form information.
Optionally, the execution model is further configured to determine a control to be operated according to the interface operation sequence;
the execution model is further used for determining a corresponding target control in the current page form information according to the control to be operated;
the execution model is further used for calling an auxiliary function object according to the interface operation sequence to operate the target control so as to enable the connection state to be restored to the target connection state.
Optionally, the device connection state recovery apparatus further includes a connection state judgment module;
the connection state judgment module is used for acquiring connection port information when connection establishment with external equipment is detected;
the connection state judgment module is further used for determining the current connection state according to the connection port information and recording the first maintenance time of the current connection state;
the connection state judgment module is further configured to judge whether the first maintenance time is greater than a first preset threshold;
the connection state judgment module is further configured to judge the current connection state as a target connection state when the first maintenance time is greater than the first preset threshold.
Optionally, the sequence generating module is further configured to obtain target connection state information;
the sequence generation module is also used for searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script;
and the sequence generation module is also used for analyzing the preset recovery script to obtain an interface operation sequence.
In addition, to achieve the above object, the present invention further provides an apparatus connection state recovery apparatus, including: a memory, a processor and a device connection state recovery program stored on the memory and executable on the processor, the device connection state recovery program when executed by the processor implementing the steps of the device connection state recovery method as described above.
Furthermore, to achieve the above object, the present invention also provides a storage medium having a device connection state recovery program stored thereon, which when executed by a processor implements the steps of the device connection state recovery method as described above.
In the invention, when the change of the connection state is detected, an automatic operation object of a user interface is created; acquiring current page window information through the user interface automation operation object; acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script; and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state. The invention can respond to the change of the connection state of the equipment in time and acquire the information of the current page window through the created user interface automation operation object; and meanwhile, a preset recovery script is obtained, a preset operation sequence in the script is executed, automatic operation on the page is realized, and then the connection state of the equipment is recovered in time.
Drawings
Fig. 1 is a schematic structural diagram of a device connection state recovery device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for recovering connection status of a device according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for recovering connection status of a device according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a method for recovering a connection status of a device according to the present invention;
FIG. 5 is a flowchart illustrating a method for recovering connection status of a device according to a fourth embodiment of the present invention;
fig. 6 is a flowchart illustrating a fifth embodiment of a method for recovering a connection status of a device according to the present invention;
fig. 7 is a block diagram of a device connection state recovery apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a device connection state recovery device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the device connection state recovery device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), and the optional user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the device connection state restoration device, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, identified as one type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a device connection state recovery program.
In the device connection state recovery device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting user equipment; the device connection state recovery device calls a device connection state recovery program stored in the memory 1005 through the processor 1001, and executes the device connection state recovery method provided by the embodiment of the present invention.
Based on the above hardware structure, an embodiment of the device connection state recovery method of the present invention is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for recovering a device connection state according to a first embodiment of the present invention.
In a first embodiment, the device connection state recovery method includes the steps of:
step S10: and when the change of the connection state is detected, creating a user interface automation operation object.
It should be understood that the execution subject of this embodiment is an apparatus connection state recovery apparatus, where the apparatus connection state recovery apparatus has functions of data communication and program operation, and the apparatus connection state recovery apparatus may be a computer apparatus such as a mobile phone, a tablet, a computer, or a server, and of course, other apparatuses having similar functions may also be used, and this embodiment is not limited thereto.
It should be noted that the connection state refers to a connection mode between devices, and is exemplified by a connection between a mobile phone and a computer. The mobile phone is connected with the computer through the USB line, and at the moment, the selectable connection state comprises a charging mode, a data transmission mode or a debugging mode and the like. When a user needs to execute a corresponding function after the mobile phone is connected with the computer, a corresponding mode needs to be set. For example, when a user needs to debug a mobile phone through a computer, the connection state needs to be set to a debugging mode; at this time, if the connection mode between the mobile phone and the computer is changed to the charging mode, it is determined that the connection state is changed. Of course, the connection status may have other modes, even other types of devices connected, and this embodiment does not limit this.
Taking a mobile phone as an example, the embodiment can be operated in a mobile phone background in a Java process manner, and when it is detected that the mobile phone is connected with a computer, the process is automatically invoked, and the connection state is polled in real time. And when detecting that the connection state is changed, creating a user interface automation operation object. The ui automation object refers to a UiAutomation object, and the UiAutomation object is described below.
Step S20: and acquiring the current page window information through the user interface automation operation object.
It should be noted that the current page form information refers to display information of the current device UI interface, and includes page width, a control included in a page, position information of the control in the page, and the like.
It should be noted that the UiAutomation object can register an auxiliary function to implement automatic operation of the device, and the auxiliary function can provide operations such as obtaining, operating, and sensing changes of a display page of the device. In this example, the method in the UiAutomation object is called through a reflection mechanism to realize the calling of the function of acquiring the window information of the page, and the window information of the current device display page is acquired.
Step S30: and acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script.
The interface operation sequence refers to an operation flow in a user page, and for example, an application icon is clicked, a page is slid, an option is clicked, and the like. The interface operation sequence comprises position information of an application icon, position information of an option control, page sliding distance and the like. The information is written into the script in a code form, and a preset recovery script is formed.
It should be noted that, in this embodiment, a script library is preset, and a maintenance person may store a prepared script in the script library, so that the device connection state recovery device can obtain a corresponding recovery script from the script library.
Step S40: and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
It should be noted that the corresponding operation flow in the interface operation sequence may be implemented by an auxiliary function, so that the auxiliary function is called by the UiAutomation object to sequentially implement the corresponding page operations according to the operation flow in the interface operation sequence, thereby implementing the recovery of the connection state.
For example, the connection between the mobile phone and the computer is in the debugging mode, but the connection is interrupted because the USB cable between the mobile phone and the computer may have a poor contact problem. Although the connection is restored again, the connection state is the charging mode, and it is necessary to restore the connection state to the debug mode for normal use of the corresponding function. At this time, a debugging mode recovery script is obtained, wherein the preset operation flow comprises returning to a main page, clicking a setting icon, sliding the page, clicking a connection option and clicking a debugging option. And calling an auxiliary function through the UiAutomation object to sequentially realize a click function and a sliding function, and simultaneously determining position information and sliding distance of the set icon, the connection option and the debugging option according to the current page window information during clicking and sliding.
In the first embodiment, the user interface automation operation object is created when the change of the connection state is detected; acquiring current page window information through the user interface automation operation object; acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script; and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state. The embodiment can respond to the change of the connection state of the equipment in time, and acquire the information of the current page window through the created user interface automation operation object; and meanwhile, a preset recovery script is obtained, a preset operation sequence in the script is executed, automatic operation on the page is realized, and then the connection state of the equipment is recovered in time.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for recovering a device connection state according to a second embodiment of the present invention, and the method for recovering a device connection state according to the second embodiment of the present invention is proposed based on the first embodiment illustrated in fig. 2.
In the second embodiment, the step S10 specifically includes:
step S101: and initializing the thread operation object and the user interface automation operation object when detecting that the connection state is changed.
It should be noted that the thread operation object is a handlethread object. The method runs in the background of the mobile phone in a Java process mode, and calls the process by initializing the HandlerThread object after detecting that the mobile phone is connected with the computer. Meanwhile, the UiAutomation object is initialized, specifically, the UiAutomation connection object is initialized. The specific initialization process is common knowledge in the art and will not be described herein.
Step S102: and calling a user interface automation operation object constructing function through a preset reflection path to create a user interface automation operation object.
Because the Java process is already running and cannot directly call the UiAutomation object, a reflection mechanism needs to be established, and the UiAutomation object is created by calling a UiAutomation construction method according to a reflection path. To enable cross-process execution.
In the second embodiment, the step S20 specifically includes:
step S201: and calling a connection function of the user interface automation operation object through the preset reflection path to be connected with a preset application program interface.
It should be noted that the preset application program interface refers to a program interface of the UiAutomation API library, and similarly, the UiAutomation # connection method is called through reflection to connect the UiAutomation API library. Thereby establishing a basis for subsequently calling the UiAutomation API.
Step S202: and calling the auxiliary form object through the preset application program interface to acquire the current page form information.
It should be noted that, various auxiliary function objects can be called through the UiAutomation API library, so as to implement corresponding automation operations. For example, an interface click operation, a page sliding operation, a form information acquisition operation, or the like. In this embodiment, the frame information of the current user page is obtained through the auxiliary frame object in the UiAutomation API.
In the second embodiment, after the step S40, the method further includes:
s50: and when the connection state is detected to be restored to the target connection state, calling a cut-off function of the user interface automation operation object through the preset reflection path to be disconnected with the preset application program interface.
It should be noted that when the Java process runs the automation operation service, it is not allowed to run other registered services, so that the automation operation service needs to be released in time, so that the system allows the execution of the automation test case.
In specific implementation, when the connection state is recovered, the disconnect function of the UiAutomation object is called through reflection to disconnect so as to log out the automation operation service.
S60: and calling a resource release function of the thread operation object to release the user interface automation operation object.
It should be noted that after the automatic operation service is cancelled, the Java process has completed the corresponding function, and can be released at the same time, saving resources, and awakening again when detecting that the connection state changes next time. Specifically, calling the quite method (i.e., the resource release function) of the handlethread object releases the Java process resource.
In the second embodiment, a cross-process execution auxiliary function is performed through a UiAutomation object, the UiAutomation object is connected with a UiAutomation API library through the UiAutomation, and the auxiliary function is registered, so that page window information is acquired. In addition, the automatic operation function registration and cancellation functions are realized in the Java process through a reflection system interface, and resources are released to allow the system to execute the automatic test case, so that the resource occupation is avoided.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method for recovering a device connection state according to a third embodiment of the present invention, and the method for recovering a device connection state according to the third embodiment of the present invention is proposed based on the first embodiment and the second embodiment. The present embodiment is explained based on the first embodiment.
In the third embodiment, the step S40 specifically includes:
step S401: and determining a control to be operated according to the interface operation sequence.
The interface operation sequence refers to an operation flow in a user page, and for example, an application icon is clicked, a page is slid, an option is clicked, and the like. The interface operation sequence comprises position information of an application icon, position information of an option control, page sliding distance and the like.
Taking the recovery debugging mode as an example, the interface operation sequence includes returning to the main page, clicking the setting icon, sliding the page, clicking the connection option, and clicking the debugging option. In order to ensure the accuracy of subsequent operation, a control to be operated is determined, and specifically, the control to be operated comprises a main interface key, a setting icon key, a connection option and a debugging option.
Step S402: and determining a corresponding target control in the current page form information according to the control to be operated.
It should be noted that, in order to ensure that the corresponding control to be operated can be accurately operated, the control to be operated needs to be positioned according to the current page window information, and specifically, an operable target control in the current page window information can be determined according to matching between the control information in the current page window information and the control to be operated.
Step S403: and calling an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to a target connection state.
Since the pages where different controls are located are different, there may not be a corresponding control in the current page frame information. For example, there is a set icon in the main page, but there is no connection option and no debug option. Therefore, step S403 may specifically include: calling an auxiliary function object to operate the target control according to the interface operation sequence so as to operate a user interface to modify the connection state; judging whether the execution of the interface operation sequence is finished or not; when the interface operation sequence is not executed, acquiring an unexecuted control corresponding to the uncompleted sequence; calling the auxiliary window object through the preset application program interface to acquire intermediate page window information; and determining a corresponding target control in the intermediate page form information according to the unexecuted control, and returning to the step of calling an auxiliary function object to operate the target control according to the interface operation sequence until the execution of the interface operation sequence is completed so as to restore the connection state to a target connection state.
In specific implementation, firstly, operation is performed according to the control existing in the current page form information, for example, an image is set by clicking in a main interface. At this point, the operational sequence is terminated because there is no connection option in the main page. However, due to the fact that the page changes, the connection options can be repositioned by acquiring the page window information again, and then clicking of the connection options is achieved. Therefore, the execution of the interface operation sequence is completed, and the user interface is operated to restore the connection state to the target connection state.
In the third embodiment, the accuracy of the operation is ensured by positioning the control to be operated in the interface operation sequence in the page form information. Meanwhile, when the user page is changed, the page window information is obtained again to position the unexecuted control in the interface operation sequence, so that the interface operation sequence is completely executed, and the connection state is restored to the target connection state.
Referring to fig. 5, fig. 5 is a flowchart illustrating a fourth embodiment of the method for recovering the connection state of the device according to the present invention, and the fourth embodiment of the method for recovering the connection state of the device according to the present invention is proposed based on the first embodiment and the second embodiment. The present embodiment is explained based on the first embodiment.
In the fourth embodiment, before the step S10, the method further includes:
step S001: and acquiring connection port information when the connection establishment with the external equipment is detected.
It should be noted that, in order to monitor the connection state of the device in real time, in this embodiment, when it is detected that the connection with the external device is established, monitoring is started. The external device may include a mobile phone, a computer, a tablet, or the like.
It should be noted that the connection establishment method includes USB connection or wireless network connection, and when detecting that a USB port is inserted, it is determined to establish connection with an external device; or when the WiFi port is detected to be connected, judging that the connection is established with the external equipment. And meanwhile, acquiring corresponding connection port information for real-time monitoring, wherein the connection port information comprises port states.
Step S002: and determining the current connection state according to the connection port information, and recording the first maintenance time of the current connection state.
It should be noted that the connection state of the current port can be determined by monitoring the status state. Typically, when the device establishes a preliminary connection, it is set to a default connection mode, such as a charging mode. The operator needs to switch the states, and in some cases, the states need to be switched for many times due to misoperation. Therefore, in the initial stage of establishing connection of the device, in order to guarantee the false start of Java, a corresponding limitation condition needs to be set. The present embodiment uses the state maintaining time as a limiting condition.
Step S003: and judging whether the first maintenance time is greater than a first preset threshold value.
In general, the operator immediately switches the unnecessary connection state and holds the necessary connection state. Thus, the operator's desired connection can be determined by the maintenance. For example, the first preset threshold is 1 minute or 2 minutes, but may also be other values, which is not limited in this embodiment.
Step S004: and when the first maintenance time is greater than the first preset threshold, determining the current connection state as a target connection state.
It can be understood that when the maintaining time of the connection state exceeds the preset threshold, it indicates that the corresponding connection state is the connection state required by the operator, sets the connection state as the target connection state, and registers the automated operation service when the target connection state is changed, so as to recover the connection state. If the maintaining time of the connection state does not exceed the preset threshold, it indicates that the corresponding connection state is not the connection state required by the operator, and the process returns to step S002 to continue the detection.
In the fourth embodiment, the step S10 specifically includes: when detecting that the connection state changes, acquiring the connection state before changing; judging whether the connection state before change is the same as the target connection state; and creating a user interface automation operation object when the connection state before the change is the same as the target connection state.
When the operator has an erroneous operation, it is necessary to determine whether the state before the change is the target connection state in order to further prevent the process from being erroneously started, and if not, the process is not started. For example, an operator connects the device, the default connection state is a charging mode, and the operator needs to switch the device to a debugging mode. At this time, the connection state is changed, but since neither the charge mode nor the transfer mode is the target connection state, the start-up is not performed.
Further, in actual operation, when the connection state is changed due to an erroneous operation, the operator finds the situation and manually restores the connection state. Therefore, in order to avoid conflict between the process operation and the manual operation, the step of creating the user interface automation operation object when the connection state before the change is the same as the target connection state specifically includes: acquiring a changed connection state, and recording second maintenance time of the changed connection state; judging whether the second maintaining time is greater than a second preset threshold value when the connection state before change is the same as the target connection state; and when the second maintenance time is greater than the second preset threshold value, creating a user interface automation operation object.
It should be noted that the time during which the operator can find the situation is often short, and therefore, the time condition can be set to avoid the collision as well. For example, the second maintenance time is set to 30 seconds, and if the connection state is not restored after 30 seconds, it indicates that the operator does not find it, and at this time, it is necessary to perform an automated operation to restore the connection state.
In the fourth embodiment, by monitoring the maintenance time of the connection state, the target connection state can be determined; and when the connection state is changed, whether the user interface automation operation object needs to be created to execute the automation operation and recover the connection state can be judged, and the false start is avoided.
Referring to fig. 6, fig. 6 is a flowchart illustrating a fifth embodiment of the method for recovering connection status of a device according to the present invention, and the fifth embodiment of the method for recovering connection status of a device according to the present invention is proposed based on the first embodiment and the second embodiment. The present embodiment is explained based on the first embodiment.
In a fifth embodiment, the step S30 specifically includes:
step S301: and acquiring target connection state information.
It can be understood that when the connection state is recovered, the corresponding target connection state information needs to be determined. Generally, the connection state information before change is taken as the target connection state information. The target connection status information may be embodied as a status category, such as debug mode or transport mode.
Step S302: and searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises the corresponding relation between the connection state and the recovery script.
It should be noted that, in this embodiment, a script library is preset, and a maintenance person may store a prepared script in the script library, so that the device connection state recovery device can obtain a corresponding recovery script from the script library. Meanwhile, a corresponding relation between the recovery script and the connection state is established, for example, the debugging mode corresponds to the script A, and the transmission mode corresponds to the script B. When the target connection state is in the debug mode, script A is acquired.
Step S303: and analyzing the preset recovery script to obtain an interface operation sequence.
The interface operation sequence refers to an operation flow in a user page, and for example, an application icon is clicked, a page is slid, an option is clicked, and the like. The interface operation sequence comprises position information of an application icon, position information of an option control, page sliding distance and the like. The information is written into the script in a code form, and the interface operation sequence can be obtained by analyzing the recovery script.
It should be noted that, in order to further ensure that the recovery script corresponding to the target connection state can be found, after the step of finding the corresponding preset recovery script in the preset mapping relationship according to the target connection state, the method further includes: when the corresponding preset recovery script is not found, acquiring historical connection state recording information; acquiring reference connection state information from the historical connection state recording information according to a preset reference condition, and taking the reference connection state information as target connection state information; and returning to the step of searching the corresponding preset recovery script in the preset mapping relation according to the target connection state information.
The historical connection state record information is a recorded target connection state, and since the operator operates the device in a plurality of connection states in sequence, the present embodiment records the connection mode determined as the target connection state, and obtains the historical connection state record information. The preset reference condition may be a threshold value of relevance between the connection mode corresponding to the historical connection state recording information and the current target connection state information, the relevance may be determined according to functions that can be realized by the connection mode, the more the same functions that can be realized, the higher the relevance is, and when the relevance is greater than the preset threshold value, the reference condition is determined to be satisfied.
It should be noted that, because the operator may not store the corresponding script of the corresponding connection mode, the corresponding recovery script cannot be found according to the mapping relationship. At this time, a recovery script corresponding to the connection state with the related function can be searched according to the historical connection state recording information. For example, the target connection state is a data transmission mode, but the corresponding script cannot be found according to the mapping relationship. However, the historical connection state record information includes a debug mode, and the debug mode can be used as a target connection state because the debug mode has a specific data transmission function.
In this embodiment, in order to ensure the accuracy of connection state recovery, the target connection state information may be displayed through a preset window when a corresponding preset recovery script is not found; when a file input based on the preset window is received, file information of the file is obtained; judging whether the file information meets a preset condition or not; and when the file information meets the preset condition, taking the file as a preset recovery script.
The window is used to prompt the user, and for example, "xx-mode recovery script missing" may be displayed in the window. And simultaneously, the window also comprises an input window for a user to input a file, the user can input a file path in the input window, and the window acquires a corresponding file according to the file path. The file information includes information such as file format and size. Wherein the file format can be judged by identifying the suffix name of the file. In this embodiment, the script is similar to a shell script, and therefore, the preset condition may be that the file format is a shell file.
In the fifth embodiment, the corresponding preset recovery script is searched through the mapping relationship, so that the corresponding script can be quickly acquired, and the connection state recovery efficiency is improved. Meanwhile, when the corresponding preset recovery script is not found, the recovery script corresponding to the reference connection state is selected for recovery, and the connection modes after recovery have the same function. Or, the stable operation of the connection state recovery process is ensured by providing a window for prompting the user and waiting for the user to input the recovery script.
In addition, an embodiment of the present invention further provides a storage medium, where the storage medium stores a device connection state recovery program, and the device connection state recovery program, when executed by a processor, implements the steps of the device connection state recovery method described above.
Since the storage medium adopts all technical solutions of all the embodiments, at least all the beneficial effects brought by the technical solutions of the embodiments are achieved, and no further description is given here.
In addition, referring to fig. 7, an embodiment of the present invention further provides an apparatus connection state recovery device, where the apparatus connection state recovery device includes:
and the object creation model 10 is used for creating a user interface automation operation object when detecting that the connection state is changed.
It should be noted that the connection state refers to a connection mode between devices, and is exemplified by a connection between a mobile phone and a computer. The mobile phone is connected with the computer through the USB line, and at the moment, the selectable connection state comprises a charging mode, a data transmission mode or a debugging mode and the like. When a user needs to execute a corresponding function after the mobile phone is connected with the computer, a corresponding mode needs to be set. For example, when a user needs to debug a mobile phone through a computer, the connection state needs to be set to a debugging mode; at this time, if the connection mode between the mobile phone and the computer is changed to the charging mode, it is determined that the connection state is changed. Of course, the connection status may have other modes, even other types of devices connected, and this embodiment does not limit this.
And the form information acquisition model 20 is used for acquiring the current page form information through the user interface automation operation object.
It should be noted that the current page form information refers to display information of the current device UI interface, and includes page width, a control included in a page, position information of the control in the page, and the like.
It should be noted that the UiAutomation object can register an auxiliary function to implement automatic operation of the device, and the auxiliary function can provide operations such as obtaining, operating, and sensing changes of a display page of the device. In this example, the method in the UiAutomation object is called through a reflection mechanism to realize the calling of the function of acquiring the window information of the page, and the window information of the current device display page is acquired.
The sequence generating module 30 is configured to obtain a preset recovery script, and determine a corresponding interface operation sequence according to the preset recovery script.
The interface operation sequence refers to an operation flow in a user page, and for example, an application icon is clicked, a page is slid, an option is clicked, and the like. The interface operation sequence comprises position information of an application icon, position information of an option control, page sliding distance and the like. The information is written into the script in a code form, and a preset recovery script is formed.
It should be noted that, in the present embodiment, a script library is preset, and a maintenance person may store the prepared script in the script library, so that the execution model 30 can obtain the corresponding recovery script from the script library.
And the execution model 40 is used for calling an auxiliary function object to execute the interface operation sequence based on the current page window information so as to restore the connection state to a target connection state.
It should be noted that the corresponding operation flow in the interface operation sequence may be implemented by an auxiliary function, so that the auxiliary function is called by the UiAutomation object to sequentially implement the corresponding page operations according to the operation flow in the interface operation sequence, thereby implementing the recovery of the connection state.
For example, the connection between the mobile phone and the computer is in the debugging mode, but the connection is interrupted because the USB cable between the mobile phone and the computer may have a poor contact problem. Although the connection is restored again, the connection state is the charging mode, and it is necessary to restore the connection state to the debug mode for normal use of the corresponding function. At this time, a debugging mode recovery script is obtained, wherein the preset operation flow comprises returning to a main page, clicking a setting icon, sliding the page, clicking a connection option and clicking a debugging option. And calling an auxiliary function through the UiAutomation object to sequentially realize a click function and a sliding function, and simultaneously determining position information and sliding distance of the set icon, the connection option and the debugging option according to the current page window information during clicking and sliding.
In the embodiment, the user interface automation operation object is created when the change of the connection state is detected; acquiring current page window information through the user interface automation operation object; acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script; and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state. The embodiment can respond to the change of the connection state of the equipment in time, and acquire the information of the current page window through the created user interface automation operation object; and meanwhile, a preset recovery script is obtained, a preset operation sequence in the script is executed, automatic operation on the page is realized, and then the connection state of the equipment is recovered in time.
In one embodiment, the object creation model 10 is further configured to initialize thread operands and user interface automation operands upon detecting a change in connection status; the object creation model is also used for calling a user interface automation operation object construction function to create a user interface automation operation object through a preset reflection path.
In an embodiment, the form information obtaining model 20 is further configured to call a connection function of an automation operation object of the user interface through the preset reflection path to connect with a preset application program interface; and the form information acquisition model is also used for calling an auxiliary form object through the preset application program interface to acquire the current page form information.
In an embodiment, the execution model 40 is further configured to determine a control to be operated according to the interface operation sequence; the execution model is further used for determining a corresponding target control in the current page form information according to the control to be operated; the execution model is further used for calling an auxiliary function object according to the interface operation sequence to operate the target control so as to enable the connection state to be restored to the target connection state.
In an embodiment, the device connection state recovery apparatus further includes a connection state determination module; the connection state judgment module is used for acquiring connection port information when connection establishment with external equipment is detected; the connection state judgment module is further used for determining the current connection state according to the connection port information and recording the first maintenance time of the current connection state; the connection state judgment module is further configured to judge whether the first maintenance time is greater than a first preset threshold; the connection state judgment module is further configured to judge the current connection state as a target connection state when the first maintenance time is greater than the first preset threshold.
In an embodiment, the sequence generating module 30 is further configured to obtain target connection status information; the sequence generation module is also used for searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script; and the sequence generation module is also used for analyzing the preset recovery script to obtain an interface operation sequence.
Other embodiments or specific implementation manners of the device connection state recovery apparatus according to the present invention may refer to the above method embodiments, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order, but rather the words first, second, third, etc. are to be interpreted as names.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a Read Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, an optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
The invention discloses A1 and an equipment connection state recovery method, which comprises the following steps:
when the change of the connection state is detected, creating a user interface automation operation object;
acquiring current page window information through the user interface automation operation object;
acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script;
and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
A2, the method for restoring connection status of device as in a1, wherein the step of creating an automation operation object of the user interface when detecting that the connection status changes includes:
when detecting that the connection state changes, initializing a thread operation object and a user interface automation operation object;
and calling a user interface automation operation object constructing function through a preset reflection path to create a user interface automation operation object.
A3, the method for restoring connection status of device as described in a2, wherein the step of obtaining information of the current page form through the user interface automation operation object specifically includes:
calling a connection function of an automatic operation object of the user interface through the preset reflection path to be connected with a preset application program interface;
and calling the auxiliary form object through the preset application program interface to acquire the current page form information.
A4, the method for restoring connection state of device as in A3, wherein after the step of calling an auxiliary function object based on the current page form information to execute the interface operation sequence to restore the connection state to the target connection state, the method further comprises:
when the connection state is detected to be restored to the target connection state, calling a cut-off function of a user interface automation operation object through the preset reflection path to be disconnected with the preset application program interface;
and calling a resource release function of the thread operation object to release the user interface automation operation object.
A5, the method for restoring connection state of device as in any one of a1-a4, where the step of invoking an auxiliary function object based on the current page form information to execute the interface operation sequence to restore the connection state to a target connection state specifically includes:
determining a control to be operated according to the interface operation sequence;
determining a corresponding target control in the current page form information according to the control to be operated;
and calling an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to a target connection state.
A6, the method for restoring connection state of device as in a5, where the step of invoking an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to the target connection state specifically includes:
calling an auxiliary function object to operate the target control according to the interface operation sequence so as to operate a user interface to modify the connection state;
judging whether the execution of the interface operation sequence is finished or not;
when the interface operation sequence is not executed, acquiring an unexecuted control corresponding to the uncompleted sequence;
calling the auxiliary window object through the preset application program interface to acquire intermediate page window information;
and determining a corresponding target control in the intermediate page form information according to the unexecuted control, and returning to the step of calling an auxiliary function object to operate the target control according to the interface operation sequence until the execution of the interface operation sequence is completed so as to restore the connection state to a target connection state.
A7, the method for restoring connection state of device as in any one of A1-A4, further comprising, before the step of creating a user interface automation operation object when a change in connection state is detected:
when connection establishment with external equipment is detected, connection port information is acquired;
determining a current connection state according to the connection port information, and recording first maintenance time of the current connection state;
judging whether the first maintenance time is greater than a first preset threshold value or not;
and when the first maintenance time is greater than the first preset threshold, determining the current connection state as a target connection state.
A8, the method for restoring connection status of device as in a7, wherein the step of creating an automation operation object of the user interface when detecting that the connection status changes includes:
when detecting that the connection state changes, acquiring the connection state before changing;
judging whether the connection state before change is the same as the target connection state;
and creating a user interface automation operation object when the connection state before the change is the same as the target connection state.
A9, the method for restoring connection status of device as in A8, wherein the step of creating a ui automation object when the connection status before the change is the same as the target connection status specifically includes:
acquiring a changed connection state, and recording second maintenance time of the changed connection state;
judging whether the second maintaining time is greater than a second preset threshold value when the connection state before change is the same as the target connection state;
and when the second maintenance time is greater than the second preset threshold value, creating a user interface automation operation object.
A10, in the method for restoring an equipment connection state according to any one of a1-a4, the step of obtaining a preset restoring script and determining a corresponding interface operation sequence according to the preset restoring script specifically includes:
acquiring target connection state information;
searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script;
and analyzing the preset recovery script to obtain an interface operation sequence.
A11, the method for restoring connection status of device as in a10, further comprising, after the step of searching for a corresponding preset restoring script in a preset mapping relationship according to the target connection status:
when the corresponding preset recovery script is not found, acquiring historical connection state recording information;
acquiring reference connection state information from the historical connection state recording information according to a preset reference condition, and taking the reference connection state information as target connection state information;
and returning to the step of searching the corresponding preset recovery script in the preset mapping relation according to the target connection state information.
A12, the method for restoring connection status of device as in a10, further comprising, after the step of searching for a corresponding preset restoring script in a preset mapping relationship according to the target connection status:
when the corresponding preset recovery script is not found, displaying the target connection state information through a preset window;
when a file input based on the preset window is received, file information of the file is obtained;
judging whether the file information meets a preset condition or not;
and when the file information meets the preset condition, taking the file as a preset recovery script.
The invention also discloses B13, an apparatus connection state recovery device, the apparatus connection state recovery device includes:
the object creation model is used for creating a user interface automation operation object when the change of the connection state is detected;
the window information acquisition model is used for acquiring current page window information through the user interface automation operation object;
the sequence generation module is used for acquiring a preset recovery script and determining a corresponding interface operation sequence according to the preset recovery script;
and the execution model is used for calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
B14, the device connection state recovery apparatus as described in B13, the object creation model is further used for initializing the thread operation object and the user interface automation operation object when detecting the change of the connection state;
the object creation model is also used for calling a user interface automation operation object construction function to create a user interface automation operation object through a preset reflection path.
B15, the device connection state recovery apparatus as described in B14, where the form information acquisition model is further configured to invoke a connection function of an automation operation object of a user interface through the preset reflection path to connect with a preset application program interface;
and the form information acquisition model is also used for calling an auxiliary form object through the preset application program interface to acquire the current page form information.
B16, the device connection state recovery device as any one of B13-B15, the execution model is further used for determining a control to be operated according to the interface operation sequence;
the execution model is further used for determining a corresponding target control in the current page form information according to the control to be operated;
the execution model is further used for calling an auxiliary function object according to the interface operation sequence to operate the target control so as to enable the connection state to be restored to the target connection state.
B17, the device connection state recovery device as any one of B13-B15, further comprising a connection state judgment module;
the connection state judgment module is used for acquiring connection port information when connection establishment with external equipment is detected;
the connection state judgment module is further used for determining the current connection state according to the connection port information and recording the first maintenance time of the current connection state;
the connection state judgment module is further configured to judge whether the first maintenance time is greater than a first preset threshold;
the connection state judgment module is further configured to judge the current connection state as a target connection state when the first maintenance time is greater than the first preset threshold.
B18, the device connection status recovery method according to any one of B13-B15, the sequence generating module being further configured to obtain target connection status information;
the sequence generation module is also used for searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script;
and the sequence generation module is also used for analyzing the preset recovery script to obtain an interface operation sequence.
The invention also discloses C19, an equipment connection state recovery device, which comprises: a memory, a processor and a device connection state recovery program stored on the memory and executable on the processor, the device connection state recovery program when executed by the processor implementing the steps of the device connection state recovery method as described above.
The invention also discloses D20 and a storage medium, wherein the storage medium is stored with a device connection state recovery program, and the device connection state recovery program realizes the steps of the device connection state recovery method when being executed by a processor.

Claims (10)

1. A device connection state recovery method, characterized by comprising the steps of:
when the change of the connection state is detected, creating a user interface automation operation object;
acquiring current page window information through the user interface automation operation object;
acquiring a preset recovery script, and determining a corresponding interface operation sequence according to the preset recovery script;
and calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
2. The method for restoring the connection state of the device according to claim 1, wherein the step of creating the automation operation object of the user interface when detecting that the connection state is changed specifically includes:
when detecting that the connection state changes, initializing a thread operation object and a user interface automation operation object;
and calling a user interface automation operation object constructing function through a preset reflection path to create a user interface automation operation object.
3. The method for restoring the connection state of the device according to claim 2, wherein the step of obtaining the information of the current page form through the user interface automation operation object specifically comprises:
calling a connection function of an automatic operation object of the user interface through the preset reflection path to be connected with a preset application program interface;
and calling the auxiliary form object through the preset application program interface to acquire the current page form information.
4. The method for restoring the connection state of a device according to claim 3, wherein after the step of calling an auxiliary function object based on the current page form information to execute the sequence of interface operations to restore the connection state to the target connection state, further comprising:
when the connection state is detected to be restored to the target connection state, calling a cut-off function of a user interface automation operation object through the preset reflection path to be disconnected with the preset application program interface;
and calling a resource release function of the thread operation object to release the user interface automation operation object.
5. The method for restoring a connection state of a device according to any one of claims 1 to 4, wherein the step of invoking an auxiliary function object based on the current page form information to execute the interface operation sequence to restore the connection state to a target connection state specifically includes:
determining a control to be operated according to the interface operation sequence;
determining a corresponding target control in the current page form information according to the control to be operated;
and calling an auxiliary function object according to the interface operation sequence to operate the target control so as to restore the connection state to a target connection state.
6. The device connection state recovery method of any one of claims 1-4, wherein the step of creating a user interface automation operation object upon detecting a change in connection state further comprises:
when connection establishment with external equipment is detected, connection port information is acquired;
determining a current connection state according to the connection port information, and recording first maintenance time of the current connection state;
judging whether the first maintenance time is greater than a first preset threshold value or not;
and when the first maintenance time is greater than the first preset threshold, determining the current connection state as a target connection state.
7. The device connection state recovery method according to any one of claims 1 to 4, wherein the step of obtaining a preset recovery script and determining a corresponding interface operation sequence according to the preset recovery script specifically includes:
acquiring target connection state information;
searching a corresponding preset recovery script in a preset mapping relation according to the target connection state information, wherein the mapping relation comprises a corresponding relation between the connection state and the recovery script;
and analyzing the preset recovery script to obtain an interface operation sequence.
8. An apparatus connection state recovery apparatus, characterized in that the apparatus connection state recovery apparatus comprises:
the object creation model is used for creating a user interface automation operation object when the change of the connection state is detected;
the window information acquisition model is used for acquiring current page window information through the user interface automation operation object;
the sequence generation module is used for acquiring a preset recovery script and determining a corresponding interface operation sequence according to the preset recovery script;
and the execution model is used for calling an auxiliary function object to execute the interface operation sequence based on the current page form information so as to restore the connection state to a target connection state.
9. A device connection state recovery device characterized by comprising: memory, a processor and a device connection state recovery program stored on the memory and executable on the processor, the device connection state recovery program when executed by the processor implementing the steps of the device connection state recovery method according to any one of claims 1 to 7.
10. A storage medium having stored thereon a device connection state recovery program which, when executed by a processor, implements the steps of the device connection state recovery method according to any one of claims 1 to 7.
CN202010714232.9A 2020-07-22 2020-07-22 Method, device, equipment and storage medium for recovering equipment connection state Pending CN113971059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010714232.9A CN113971059A (en) 2020-07-22 2020-07-22 Method, device, equipment and storage medium for recovering equipment connection state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010714232.9A CN113971059A (en) 2020-07-22 2020-07-22 Method, device, equipment and storage medium for recovering equipment connection state

Publications (1)

Publication Number Publication Date
CN113971059A true CN113971059A (en) 2022-01-25

Family

ID=79585109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010714232.9A Pending CN113971059A (en) 2020-07-22 2020-07-22 Method, device, equipment and storage medium for recovering equipment connection state

Country Status (1)

Country Link
CN (1) CN113971059A (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6311105B1 (en) * 1998-05-29 2001-10-30 Powerweb, Inc. Multi-utility energy control system
US6745350B1 (en) * 1997-01-03 2004-06-01 Ncr Corporation Automated failure recovery service
CN103049370A (en) * 2011-10-17 2013-04-17 中兴通讯股份有限公司 Method and device for processing expected events intelligently in automated testing
CN105357030A (en) * 2015-09-30 2016-02-24 北京奇虎科技有限公司 Offline recovery method, device and system for terminal equipment on test platform
CN106055367A (en) * 2016-06-01 2016-10-26 腾讯科技(深圳)有限公司 Script file loading method and device
CN107241218A (en) * 2017-05-26 2017-10-10 南京南瑞继保电气有限公司 A kind of fault detection method and device
CN107291438A (en) * 2016-04-13 2017-10-24 阿里巴巴集团控股有限公司 Generation method, device and the electronic equipment of automatized script
CN107577591A (en) * 2016-07-05 2018-01-12 中兴通讯股份有限公司 A kind of method, apparatus and system of automatic test abnormal protection
CN108416011A (en) * 2018-03-02 2018-08-17 中国平安人寿保险股份有限公司 A kind of page processing method, device, terminal and computer readable storage medium
CN108429629A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Equipment fault restoration methods and device
CN108595329A (en) * 2018-04-23 2018-09-28 腾讯科技(深圳)有限公司 A kind of application testing method, device and computer storage media
CN109947650A (en) * 2019-03-20 2019-06-28 广州云测信息技术有限公司 Script step process methods, devices and systems
CN110868764A (en) * 2019-11-12 2020-03-06 上海联影医疗科技有限公司 Wireless connection self-recovery method, device, equipment and storage medium
CN110928767A (en) * 2019-10-12 2020-03-27 平安国际智慧城市科技股份有限公司 Webpage analysis method, device, equipment and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6745350B1 (en) * 1997-01-03 2004-06-01 Ncr Corporation Automated failure recovery service
US6311105B1 (en) * 1998-05-29 2001-10-30 Powerweb, Inc. Multi-utility energy control system
CN103049370A (en) * 2011-10-17 2013-04-17 中兴通讯股份有限公司 Method and device for processing expected events intelligently in automated testing
CN105357030A (en) * 2015-09-30 2016-02-24 北京奇虎科技有限公司 Offline recovery method, device and system for terminal equipment on test platform
CN107291438A (en) * 2016-04-13 2017-10-24 阿里巴巴集团控股有限公司 Generation method, device and the electronic equipment of automatized script
CN106055367A (en) * 2016-06-01 2016-10-26 腾讯科技(深圳)有限公司 Script file loading method and device
CN107577591A (en) * 2016-07-05 2018-01-12 中兴通讯股份有限公司 A kind of method, apparatus and system of automatic test abnormal protection
CN108429629A (en) * 2017-02-14 2018-08-21 腾讯科技(深圳)有限公司 Equipment fault restoration methods and device
CN107241218A (en) * 2017-05-26 2017-10-10 南京南瑞继保电气有限公司 A kind of fault detection method and device
CN108416011A (en) * 2018-03-02 2018-08-17 中国平安人寿保险股份有限公司 A kind of page processing method, device, terminal and computer readable storage medium
CN108595329A (en) * 2018-04-23 2018-09-28 腾讯科技(深圳)有限公司 A kind of application testing method, device and computer storage media
CN109947650A (en) * 2019-03-20 2019-06-28 广州云测信息技术有限公司 Script step process methods, devices and systems
CN110928767A (en) * 2019-10-12 2020-03-27 平安国际智慧城市科技股份有限公司 Webpage analysis method, device, equipment and storage medium
CN110868764A (en) * 2019-11-12 2020-03-06 上海联影医疗科技有限公司 Wireless connection self-recovery method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
秦天保: "利用Delphi流机制自动保存/恢复窗体及组件状态信息", 计算机系统应用, no. 03, 5 March 2003 (2003-03-05), pages 59 - 60 *
钱枫: ""TCP连接修复技术在无间断路由中的研究与实现"", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, 15 July 2018 (2018-07-15), pages 139 - 4 *

Similar Documents

Publication Publication Date Title
CN107979508B (en) Micro-service test method and device
CN110888615B (en) Multi-input equipment interaction method, device and medium for double-screen different display of Android system
CN108427616B (en) Background program monitoring method and monitoring device
CN109995805B (en) Intelligent robot management method, terminal device and medium
CN110875858B (en) Application test data grabbing method, system, equipment and storage medium
CN113626102A (en) Data processing method and device, electronic equipment and storage medium
CN110691120A (en) Timing task state detection method, server and detection system
CN104216775A (en) Information processing system, information processing method, and information processing terminal
CN112199301A (en) User interface automation test method, electronic device and storage medium
CN106952426B (en) Data processing method and device
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN113971059A (en) Method, device, equipment and storage medium for recovering equipment connection state
CN105229604A (en) Messaging device, information processing method and program
CN109522174B (en) Method, device, terminal and storage medium for controlling adb enabling
CN108984238B (en) Gesture processing method and device of application program and electronic equipment
CN110389886B (en) Additional function testing method and device of main application program and storage medium
CN107741885B (en) Transaction and service association method and system based on CS framework
CN110659082A (en) Application program interface display method and device, terminal and storage medium
CN115604132A (en) Remote control method and device for server, electronic equipment and readable storage medium
CN111797016B (en) Application program testing method, device, storage medium and device
CN113112217B (en) Business process configuration method, device, electronic equipment and computer readable medium
CN108762736B (en) Project branch management method, device and equipment and computer readable storage medium
CN114217879A (en) Method for breaking limitation of android ghost process during program starting and running
CN109660585B (en) Method, device, equipment and storage medium for calling AOP enhanced object service
KR20220049334A (en) Method and system for application test

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