CN111726413B - Equipment connection method and device - Google Patents

Equipment connection method and device Download PDF

Info

Publication number
CN111726413B
CN111726413B CN202010598987.7A CN202010598987A CN111726413B CN 111726413 B CN111726413 B CN 111726413B CN 202010598987 A CN202010598987 A CN 202010598987A CN 111726413 B CN111726413 B CN 111726413B
Authority
CN
China
Prior art keywords
connection communication
long
communication
terminal
server
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
CN202010598987.7A
Other languages
Chinese (zh)
Other versions
CN111726413A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010598987.7A priority Critical patent/CN111726413B/en
Publication of CN111726413A publication Critical patent/CN111726413A/en
Application granted granted Critical
Publication of CN111726413B publication Critical patent/CN111726413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Abstract

The application discloses a device connection method and a device, and relates to the technical field of device monitoring and device maintenance. The method comprises the following steps: the terminal responds to the short connection communication with the server and receives the long connection communication request, and monitors the communication state of the long connection communication; and restarting the long-connection communication process to recover the long-connection communication in response to determining that the communication state of the long-connection communication is an abnormal state. The server side sends network detection information based on long connection communication with the terminal; and sending a long connection communication request based on short connection communication with the terminal in response to not receiving a response message to the network detection information from the terminal. The method can reduce the equipment connection maintenance cost and the communication cost.

Description

Equipment connection method and device
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to the technical field of equipment monitoring and equipment maintenance, and particularly relates to an equipment connection method and device.
Background
With the popularization of mobile devices, various applications at the mobile device end are produced, and since the application mobile device needs to be used for testing and monitoring applications to be published and published, and access and control of the mobile device need to be performed through a host in communication connection with the mobile device, when the connection between the mobile device and the host is interrupted, communication needs to be restored as soon as possible to guarantee the testing efficiency and the stability of a testing environment.
The existing method for recovering the communication connection between the mobile device and the host is mainly to send heartbeat information for maintaining the connection to the host through the USB debug switch or through the mobile device. However, the method for maintaining the communication connection through the USB debug switch needs to be manually completed, which causes a problem of long time consumption, and the method cannot be applied to complete the recovery of the communication connection when the mobile device does not have a USB interface; maintaining a communication connection by sending heartbeat information for maintaining the connection from the mobile device to the host increases communication costs.
Disclosure of Invention
The disclosure provides a device connection method, an apparatus, an electronic device and a computer-readable storage medium.
According to a first aspect of the present disclosure, there is provided a device connection method including: monitoring a communication state of long connection communication with a server in response to receiving a long connection communication request in the short connection communication with the server, wherein the long connection communication request is sent by the server when the long connection communication with the terminal is monitored to be abnormal; and restarting the long-connection communication process to recover the long-connection communication in response to determining that the communication state of the long-connection communication is an abnormal state.
According to a second aspect of the present disclosure, there is provided a device connection method including: transmitting network detection information based on long connection communication with a terminal; and in response to not receiving a response message to the network detection information from the terminal, sending a long connection communication request based on the short connection communication with the terminal, wherein the terminal monitors the communication state of the long connection communication in response to receiving the long connection communication request, and restarts the long connection communication process to restore the long connection communication in response to determining that the communication state of the long connection communication is an abnormal state.
According to a third aspect of the present disclosure, there is provided a device connecting apparatus including: a monitoring unit configured to monitor a communication state of long connection communication with a server in response to a long connection communication request received in short connection communication with the server, wherein the long connection communication request is issued by the server monitoring that the long connection communication with the terminal is abnormal; and the restarting unit is configured to restart the long-connection communication process to recover the long-connection communication in response to the fact that the communication state of the long-connection communication is determined to be an abnormal state.
According to a fourth aspect of the present disclosure, there is provided a device connecting apparatus including: a detection unit configured to transmit network detection information based on long connection communication with a terminal; a keep-alive unit configured to send a long-connection communication request based on short-connection communication with the terminal in response to not receiving a response message to the network detection information by the terminal, wherein the terminal monitors a communication status of the long-connection communication in response to receiving the long-connection communication request, and restarts a long-connection communication process to restore the long-connection communication in response to determining that the communication status of the long-connection communication is an abnormal status.
According to a fifth aspect of the present disclosure, an embodiment of the present disclosure provides an electronic device, including: one or more processors: a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the method of displaying an identification of a point of interest as provided in the first aspect.
According to a sixth aspect of the present disclosure, an embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method of displaying an identification of a point of interest provided by the first aspect.
The device connection method and the device provided by the disclosure monitor the communication state of the long connection communication between the server and the terminal through the server, and send the long connection communication request to the terminal through the short connection communication when monitoring that the communication state of the long connection communication is abnormal, so that the terminal restarts the long connection communication process to recover the long connection communication.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a device connection method according to the present application;
FIG. 3 is a flow diagram of another embodiment of a device connection method according to the present application;
FIG. 4 is a data interaction diagram of a device connection method according to the present application;
FIG. 5 is a schematic diagram of an embodiment of a device connection apparatus according to the present application;
FIG. 6 is a schematic structural diagram of another embodiment of a device connection apparatus according to the present application;
fig. 7 is a block diagram of an electronic device for implementing the device connection method according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the device connection method or device connection apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. Various client applications for receiving the push service, such as an operation and maintenance application, a debugging application, a map application, and the like, may be installed on the terminal devices 101, 102, and 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting receiving of push services, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion Picture Experts compression standard Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, motion Picture Experts compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal apparatuses 101, 102, and 103 are hardware, various electronic apparatuses may be used, and when the terminal apparatuses 101, 102, and 103 are software, the electronic apparatuses may be installed therein. It may be implemented as multiple pieces of software or software modules (e.g., multiple software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, for example, may be a server that provides operation and maintenance services. The server providing the operation and maintenance service may receive a response message sent by the terminal device 101, 102, 103, or send communication state detection information to the terminal device 101, 102, 103. For another example, the server 105 may be a server providing a data storage service, and the server providing the data storage service may transmit a resume communication instruction to the terminal devices 101, 102, and 103 according to the feedback states of the terminal devices 101, 102, and 103 to the communication state detection information, so as to maintain stability of data transmission and reception between the server and the terminal devices.
It should be noted that the device connection method provided by the embodiment of the present disclosure may be executed by the server 105 or the terminal devices 101, 102, and 103, and accordingly, the device connection apparatus may be disposed in the terminal device server 105 or the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a device connection method according to the present disclosure is shown. The equipment connection method can be applied to the terminal and comprises the following steps:
step 201, responding to the receiving of a long connection communication request by the short connection communication with the server, and monitoring the communication state of the long connection communication with the server, wherein the long connection communication request is sent by the server when the long connection communication with the terminal is monitored to be abnormal.
In the present embodiment, the execution subject of the device connection method (e.g., the terminal device shown in fig. 1) receives the long connection communication request sent by the server through short connection communication with the server, and then the terminal detects the communication state of its long connection communication with the server. The long connection communication means that the server establishes communication connection with the terminal and is not disconnected after the connection is established, that is, the long connection communication connection exists all the time, and the long connection communication may be communication based on a socket mode; the short connection communication refers to communication connection performed when a message is transmitted and received, and disconnection immediately after the message is transmitted and received, and may be communication based on an http Protocol (Hyper Text Transfer Protocol). The short connection communication needs to establish connection after three-way handshake between the terminal and the server for data transmission, and to be turned off/disconnected after four-way handshake between the terminal and the server after data transmission. In the case where communication requests are frequent, three-way handshake connection and four-way handshake disconnection increase communication costs. The long connection communication is to establish a connection after the terminal and the server perform three-way handshake and not disconnect the connection, and maintain communication between the terminal and the server until the server automatically disconnects upon timeout or the terminal actively disconnects, so that the long connection communication needs to be established in a case where communication requests are frequent (for example, a chat scene, a real-time game scene, online teaching or a terminal test scene). In order to ensure the stability of communication data transmission during frequent communication interaction, the long-connection communication needs to be restored immediately when the disconnection of the long-connection communication is monitored. Monitoring and triggering of long connection communications is typically performed by the server side, since monitoring and triggering of long connection communications requires additional power consumption and storage resources.
In this embodiment, the long connection communication request received by the terminal is a request sent by the server when the server monitors that the long connection communication between the server and the terminal is abnormal. The server may monitor a state of long connection communication with the terminal at regular time, and may send a long connection communication request to the terminal based on short connection communication when monitoring that the long connection communication is abnormal, for example, when the terminal is disconnected.
In response to determining that the communication status of the long-connection communication is an abnormal status, restarting the long-connection communication process to recover the long-connection communication, step 202.
In this embodiment, the terminal detects the long connection communication state of the terminal after receiving the long connection communication request, and restarts the long connection communication process to recover the long connection communication between the terminal and the server if it is detected that the long connection communication is interrupted or the like. Specifically, the terminal may detect the long connection communication state by detecting a working state of the long connection communication hardware module, and may detect the long connection communication state by detecting a running state of the long connection communication program. The terminal can restart the long-connection communication process by restarting the terminal equipment, restarting the long-connection communication hardware module, restarting the long-connection communication program and the like.
The device connection method provided by the embodiment monitors the communication state of the long connection communication between the server and the terminal through the server, and when the communication state of the long connection communication is monitored to be abnormal, sends the long connection communication request to the terminal through the short connection communication, so that the terminal restarts the long connection communication process to recover the long connection communication.
The technology solves the problems that the method for maintaining the communication connection through the USB debugging switch needs to be completed manually, which can lead to long time consumption and increase of communication cost caused by sending heartbeat information for maintaining the connection to maintain the communication connection.
In some embodiments, in response to determining that the communication status of the long-connection communication is an abnormal status, restarting the long-connection communication process to resume the long-connection communication includes: when the device receiving the long connection communication request is the android device, the long connection communication is recovered by restarting a debugging bridge daemon process of the android device in response to the fact that the communication state of the long connection communication is an abnormal state.
In this embodiment, if the terminal is an android device, when the terminal detects that long connection communication between the terminal and the server is abnormal, the long connection communication can be recovered by restarting an android debug bridge daemon (adbd) of the android device. The long connection communication is recovered by restarting the android debugging bridge daemon process, and the restarting of the long connection communication process can be realized by restarting fewer equipment processes, so that the efficiency of recovering the long connection communication is improved.
In some embodiments, the long connection communication request is received by a short connection service process initiated in the operation and maintenance program.
In this embodiment, the terminal may be equipped with an operation and maintenance program, and the operation and maintenance program starts a short connection service process (i.e., an http service process), so that the terminal may receive the long connection communication request through the short connection service process. The long connection communication request is received through the short connection service process started by the operation and maintenance program in the terminal equipment, so that the long connection communication request can be received in time, the connection efficiency of the long connection communication is improved, and the stability of the long connection communication between the terminal and the server is further ensured.
With further reference to fig. 3, a flow 300 of yet another embodiment of a device connection method, which may be applied to a server, is shown, comprising the steps of:
step 301, network detection information is sent based on long connection communication with the terminal.
In the present embodiment, the execution subject of the device connection method (e.g., the server shown in fig. 1) may transmit the long-connection communication network detection information to the terminal using the long-connection communication with the terminal. The network detection information is that a server sends a message with a fixed format to a terminal according to a preset protocol, the server communicates with the terminal according to the protocol, the terminal replies the message with the fixed format according to the protocol after receiving the message under the condition of normal long connection, and the server can judge the communication state between the server and the terminal according to the message replied by the terminal.
And 302, responding to that a response message of the terminal to the network detection information is not received, sending a long connection communication request based on short connection communication with the terminal, wherein the terminal monitors the communication state of the long connection communication in response to receiving the long connection communication request, and restarts a long connection communication process to recover the long connection communication in response to determining that the communication state of the long connection communication is an abnormal state.
In this embodiment, if the server does not receive a response message or a reply message of the terminal based on the network detection information sent by the terminal through the long connection communication, the server sends a long connection communication request through the short connection communication with the terminal, so that the terminal detects the long connection communication state between the terminal and the server, and restarts the long connection communication process to recover the long connection communication between the terminal and the server when detecting that the long connection communication state is abnormal. The short connection communication refers to communication connection performed when a message is received and transmitted, and disconnection is performed immediately after the message is received and transmitted, and may be communication based on an http Protocol (hypertext Transfer Protocol). Specifically, the server may send a message in a preset format to the terminal based on the http protocol, where the message in the preset format is a message that the server and the terminal have agreed in advance to trigger the terminal to start the long connection communication recovery operation, for example, if the preset message "101101" is a message that the trigger terminal recovers the long connection communication response, when the terminal receives the "101101" message, the trigger terminal starts the long connection communication recovery operation.
In some application scenarios, the terminal may be a test android device for testing a newly developed software/application program (App) function, and the server may be a test host. The testing host sends a command to the android device through long connection communication at regular time to monitor a long connection communication state between the testing host and the android device, when the long connection communication state is found to be abnormal (at the moment, the android device is in a device offline or disappearing state), namely, a connection keep-alive request is sent through short connection communication between the testing host and the android device, the android device receives the connection keep-alive request through the short connection communication and triggers a keep-alive strategy, namely, the fortune and maintenance App in the android device starts to detect the long connection communication state between the android device and the testing host, and after the interruption of the long connection communication is detected, the android debugging bridge daemon is called and restarted to recover the long connection communication between the android device and the testing host.
The device connection method provided by the embodiment monitors the communication state of the long connection communication between the server and the terminal through the server, and when the communication state of the long connection communication is monitored to be abnormal, sends the long connection communication request to the terminal through the short connection communication, so that the terminal restarts the long connection communication process to recover the long connection communication.
In some embodiments, sending the network detection information based on long connection communication with the terminal includes: and transmitting the network detection information at a preset frequency based on the long connection communication with the terminal.
In this embodiment, the server may transmit the long-connection communication network detection information using the long-connection communication with the terminal at a preset frequency or at a predetermined time. For example, the server may transmit the long connection communication network detection information to the terminal every 5 milliseconds, or transmit the long connection communication network detection information to the terminal when maintenance of the terminal device is required. By adopting the method of sending the network detection information at regular time or on demand, the server side and the terminal can be prevented from communicating with each other at any time, the waste of communication resources is reduced, and the communication cost is further reduced.
Fig. 4 shows a data interaction diagram of the above embodiment of the present application. As shown in fig. 4, the terminal may be a test android device 401 for testing newly developed software/application functions, and the server may be deployed with a test host 402. The testing host 402 sends a command to the android device 401 through long connection communication 403 at regular time to monitor the long connection communication state between the testing host and the android device 401, and sends a connection keep-alive request through short connection communication 404 between the testing host 402 and the android device 401 when the long connection communication state is found to be abnormal to recover the long connection communication 403 between the android device 401 and the testing host 402. Therefore, the long connection between the terminal and the server can be recovered, and the keep-alive of the terminal is realized.
With further reference to fig. 5, as an implementation of the above method, the present disclosure provides an embodiment of a device connection apparatus, which corresponds to the method embodiment shown in fig. 2, and which may be applied in various electronic devices.
As shown in fig. 5, the device connecting apparatus 500 of the present embodiment includes: a monitoring unit 501 and a restarting unit 502. The monitoring unit 501 is configured to monitor a communication state of long connection communication with the server in response to receiving a long connection communication request in response to short connection communication with the server, wherein the long connection communication request is sent by the server monitoring that the long connection communication with the terminal is abnormal; a restarting unit 502 configured to restart the long-connection communication process to resume the long-connection communication in response to determining that the communication state of the long-connection communication is an abnormal state.
In some embodiments, the reboot unit 502 includes: and the restarting module is configured to respond to that the communication state of the long connection communication is an abnormal state when the device receiving the long connection communication request is the android device, and recover the long connection communication through restarting a debugging bridge daemon of the android device.
In some embodiments, the long connection communication request is received by a short connection service process initiated in the operation and maintenance program.
The units in the apparatus 500 described above correspond to the steps in the method described with reference to fig. 2. Thus, the operations, features and technical effects described above for the device connection method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
With further reference to fig. 6, as an implementation of the above method, the present disclosure provides an embodiment of a device connection apparatus, which corresponds to the method embodiment shown in fig. 3, and which may be applied in various electronic devices.
As shown in fig. 6, the device connecting apparatus 600 of the present embodiment includes: detection unit 601, keep-alive unit 602. Wherein the detection unit 601 is configured to transmit the network detection information based on long connection communication with the terminal; a keep-alive unit 602 configured to send a long-connection communication request based on short-connection communication with the terminal in response to not receiving a response message to the network detection information by the terminal, wherein the terminal monitors a communication status of the long-connection communication in response to receiving the long-connection communication request, and restarts a long-connection communication process to resume the long-connection communication in response to determining that the communication status of the long-connection communication is an abnormal status.
In some embodiments, the detection unit 601 includes: a detection module configured to transmit network detection information at a preset frequency based on long connection communication with a terminal.
The units in the apparatus 600 described above correspond to the steps in the method described with reference to fig. 3. Thus, the operations, features and technical effects described above for the device connection method are also applicable to the apparatus 600 and the units included therein, and are not described herein again.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 7, it is a block diagram of an electronic device 700 according to the device connection method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 7, the electronic apparatus includes: one or more processors 701, a memory 702, and interfaces for connecting the various components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing some of the necessary operations (e.g., as an array of servers, a group of blade servers, or a multi-processor system). In fig. 7, one processor 701 is taken as an example.
The memory 702 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor, so that the at least one processor executes the device connection method provided by the application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the device connection method provided herein.
The memory 702 is a non-transitory computer-readable storage medium, and can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the device connection method in the embodiment of the present application (for example, the monitoring unit 501, the restarting unit 502 shown in fig. 5, or the detecting unit 601, the keep-alive unit 602 shown in fig. 6). The processor 701 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 702, that is, implements the device connection method in the above-described method embodiment.
The memory 702 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device-connected electronic device, and the like. Further, the memory 702 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 702 may optionally include memory located remotely from the processor 701, which may be connected to the device-connecting electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the device connection method may further include: an input device 703, an output device 704, and a bus 705. The processor 701, the memory 702, the input device 703, and the output device 704 may be connected by a bus 705 or in other ways, and are exemplified by the bus 705 in fig. 7.
The input device 703 may receive input numeric or character information and generate key signal inputs related to user settings and function controls of the device-attached electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input device. The output devices 704 may include a display device, auxiliary lighting devices (e.g., LEDs), and tactile feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A device connection method is applied to a terminal and comprises the following steps:
monitoring a communication state of long connection communication with a server in response to receiving a long connection communication request in response to short connection communication with the server, wherein the long connection communication request is sent by the server when monitoring that the long connection communication with a terminal is abnormal;
and restarting the long-connection communication process to recover the long-connection communication in response to determining that the communication state of the long-connection communication is an abnormal state.
2. The method of claim 1, wherein said restarting long-connection communication processes to resume the long-connection communication in response to determining that the communication state of the long-connection communication is an abnormal state comprises:
and when the device receiving the long connection communication request is the android device, responding to the abnormal state of the communication state of the long connection communication, and recovering the long connection communication by restarting a debugging bridge daemon process of the android device.
3. The method of claim 1, wherein the long connection communication request is received through a short connection service process initiated in an operation and maintenance program.
4. A device connection method is applied to a server and comprises the following steps:
transmitting network detection information based on long connection communication with a terminal;
and in response to not receiving a response message of the terminal to the network detection information, sending a long connection communication request based on short connection communication with the terminal, wherein the terminal monitors the communication state of the long connection communication in response to receiving the long connection communication request, and restarts a long connection communication process to recover the long connection communication in response to determining that the communication state of the long connection communication is an abnormal state.
5. The method of claim 4, wherein the sending network detection information based on long connection communication with the terminal comprises:
and transmitting the network detection information at a preset frequency based on the long connection communication with the terminal.
6. A device connecting apparatus applied to a terminal, comprising:
a monitoring unit configured to monitor a communication state of long connection communication with a server in response to a long connection communication request received by short connection communication with the server, wherein the long connection communication request is issued by the server monitoring that long connection communication with a terminal is abnormal;
a restarting unit configured to restart a long-connection communication process to resume the long-connection communication in response to determining that a communication state of the long-connection communication is an abnormal state.
7. The apparatus of claim 6, wherein the restart unit comprises:
and the restarting module is configured to respond to that the communication state of the long connection communication is an abnormal state when the device receiving the long connection communication request is the android device, and recover the long connection communication through restarting a debugging bridge daemon process of the android device.
8. The apparatus of claim 6, wherein the long connection communication request is received through a short connection service process initiated in an operation and maintenance program.
9. A device connecting device is applied to a server and comprises:
a detection unit configured to transmit network detection information based on long connection communication with a terminal;
a keep-alive unit configured to send a long-connection communication request based on short-connection communication with the terminal in response to not receiving a response message of the terminal to the network detection information, wherein the terminal monitors a communication status of the long-connection communication in response to receiving the long-connection communication request, and restarts a long-connection communication process to recover the long-connection communication in response to determining that the communication status of the long-connection communication is an abnormal status.
10. The apparatus of claim 9, wherein the detection unit comprises:
a detection module configured to transmit network detection information at a preset frequency based on long connection communication with a terminal.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
CN202010598987.7A 2020-06-28 2020-06-28 Equipment connection method and device Active CN111726413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010598987.7A CN111726413B (en) 2020-06-28 2020-06-28 Equipment connection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010598987.7A CN111726413B (en) 2020-06-28 2020-06-28 Equipment connection method and device

Publications (2)

Publication Number Publication Date
CN111726413A CN111726413A (en) 2020-09-29
CN111726413B true CN111726413B (en) 2022-05-17

Family

ID=72569139

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010598987.7A Active CN111726413B (en) 2020-06-28 2020-06-28 Equipment connection method and device

Country Status (1)

Country Link
CN (1) CN111726413B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422698B (en) * 2021-01-25 2021-06-22 游密科技(深圳)有限公司 Communication connection method, communication connection device, electronic equipment and storage medium
CN113114535A (en) * 2021-04-12 2021-07-13 北京字跳网络技术有限公司 Network fault detection method and device and electronic equipment
CN113778514A (en) * 2021-09-17 2021-12-10 平安科技(深圳)有限公司 Program maintenance method, device, equipment and storage medium
CN113923397B (en) * 2021-09-28 2023-12-19 北京字跳网络技术有限公司 Conference room equipment state detection method and device, electronic equipment and storage medium
CN116055227B (en) * 2023-03-31 2023-06-16 北京国信会视科技有限公司 Intelligent terminal management and control method, system and device based on android device online security

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610625A (en) * 2016-01-04 2016-05-25 杭州亚美利嘉科技有限公司 Robot terminal network abnormity self-recovery method and device
CN109413612A (en) * 2018-10-22 2019-03-01 深圳市元征科技股份有限公司 A kind of communication connection method for building up and equipment

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100728546B1 (en) * 2002-11-04 2007-06-15 리서치 인 모션 리미티드 Method and system for maintaining a wireless data connection
CN103428287B (en) * 2013-08-09 2017-04-12 华为技术有限公司 Method and device for establishing connection
US10091305B2 (en) * 2014-12-17 2018-10-02 International Business Machines Corporation Disconnect protection for command-line remote terminals
CN107800585B (en) * 2016-09-07 2021-01-12 腾讯科技(深圳)有限公司 Network communication method and device, and message pushing method and device
CN109660584A (en) * 2017-10-12 2019-04-19 阿里巴巴集团控股有限公司 A kind of method and communication means and communication system of client and the long connection of server foundation
CN108134713B (en) * 2017-12-19 2020-07-10 新华三技术有限公司 Communication method and device
CN108536479A (en) * 2018-04-17 2018-09-14 百度在线网络技术(北京)有限公司 Method and apparatus for restarting Android device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105610625A (en) * 2016-01-04 2016-05-25 杭州亚美利嘉科技有限公司 Robot terminal network abnormity self-recovery method and device
CN109413612A (en) * 2018-10-22 2019-03-01 深圳市元征科技股份有限公司 A kind of communication connection method for building up and equipment

Also Published As

Publication number Publication date
CN111726413A (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN111726413B (en) Equipment connection method and device
CN108430116B (en) Disconnected network reconnection method, medium, device and computing equipment
CN111586128B (en) Method, device, equipment and storage medium for acquiring applet data
CN106598633B (en) Configuration file updating method, client and server
CN114328098B (en) Slow node detection method and device, electronic equipment and storage medium
CN111913884A (en) Distributed test method, device, equipment, system and readable storage medium
CN111930222A (en) Control method and device and electronic equipment
CN111371629B (en) Network construction and out-of-band management method, device, equipment, medium and cloud platform
CN107104822B (en) Server disaster recovery processing method and device, storage medium and electronic equipment
CN110958250B (en) Port monitoring method and device and electronic equipment
CN113971277A (en) Multi-user login method and device
CN111625195A (en) Method and device for server capacity expansion
CN111884847B (en) Method and device for processing fault
CN113608970A (en) Core board, server, failure recovery method, device and storage medium
US20210067405A1 (en) Computer having an embedded switch
CN113825170A (en) Method and apparatus for determining network channel
CN111930565A (en) Process fault self-healing method, device and equipment for components in distributed management system
CN112770415B (en) Information processing method and device for wireless hotspots
CN110659184B (en) Health state checking method, device and system
CN112752323B (en) Method and device for changing hot spot access state
JP7299268B2 (en) PEER-TO-PEER CONNECTION METHOD, APPARATUS, ELECTRONIC DEVICE, STORAGE MEDIUM, AND PROGRAM
CN113655906A (en) Folding screen control method and device
KR20210091075A (en) Traffic adjustment method and apparatus
CN112489659A (en) Data processing method, system, server and terminal equipment based on input method
CN111510480A (en) Request sending method and device and first 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