A connection establishment method, apparatus, storage medium and device
By listening to communication messages and scanning for application activation messages, the target application was restarted, resolving the issue of interrupted connection between smart hardware devices and mobile applications, thus ensuring the normal functioning of the smart hardware and the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNITED AUTOMOTIVE ELECTRONICS SYST
- Filing Date
- 2022-12-22
- Publication Date
- 2026-06-02
AI Technical Summary
When the connection between smart hardware devices and mobile applications is interrupted, the smart hardware cannot provide services normally, affecting the user experience.
By monitoring communication messages between the target device and the terminal, and scanning for application activation messages to restart the target application, the connection is ensured to be restored.
It enables the keeping of smart hardware applications alive, maintains the normal function of the device, and improves the user experience.
Smart Images

Figure CN116156669B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a connection establishment method, apparatus, storage medium and device. Background Technology
[0002] With the development of smart hardware technology, more and more hardware devices and smartphones can connect and communicate via Bluetooth. The smartphone, paired with its respective application, scans and connects to the corresponding hardware device, providing users with relevant services. For example, pedometers provide exercise data via Bluetooth, working with a corresponding application to record exercise information; heart rate monitors provide heart rate data via Bluetooth, working with a corresponding application to record heart rate information. As the number of applications on a phone increases, the phone system will kill some applications running in the background to ensure the stable operation of other applications. If the application used in conjunction with smart hardware is killed, the smart hardware will be unable to provide relevant services to the user, affecting the user experience. Summary of the Invention
[0003] This application discloses a connection establishment method, apparatus, storage medium, and device that can maintain the connection between applications corresponding to smart hardware.
[0004] On one hand, embodiments of this application provide a connection establishment method, executed by a terminal, the method comprising:
[0005] Listen to communication messages sent from the target device to the terminal. These communication messages are used to communicate with a target application running on the terminal. The target application is used to control the target device and obtain data from the target device.
[0006] If no communication message is detected, scan for application activation messages, which are sent by the target device after detecting a connection interruption with the target application.
[0007] Upon receiving the application activation message, restart the target application corresponding to the application activation message;
[0008] Control the re-establishment of the connection between the target application and the target device.
[0009] In one possible implementation, scanning for the presence of an application activation message when the communication message is not detected includes:
[0010] Determine the running status of the target application if the communication message is not detected.
[0011] If the target application is not running, scan for the presence of the application activation message.
[0012] In one possible implementation, determining the running state of the target application without detecting the communication message includes:
[0013] If no communication message is detected within the target duration, determine whether the process of the target application is running.
[0014] In one possible implementation, scanning for the presence of the application activation message when the target application is in a non-running state includes:
[0015] If the target application is in a non-running state, determine whether the target application was actively closed by the user.
[0016] If the target application is not actively closed by the user, scan for the presence of the application activation message.
[0017] In one possible implementation, the method further includes:
[0018] If the target application is actively closed by the user, the system will not scan for the presence of the application activation message.
[0019] In one possible implementation, before scanning for the presence of an application activation message if the communication message is not detected, the method further includes:
[0020] A status confirmation message is sent to the target device, the status confirmation message being used to determine the connection status between the target device and the target application;
[0021] The step of scanning for the presence of application activation messages when no communication messages are detected includes:
[0022] If no communication message corresponding to the status confirmation message is detected, scan for the existence of the application activation message.
[0023] In one possible implementation, restarting the target application corresponding to the application activation message upon obtaining the application activation message includes:
[0024] If the application activation message is obtained, determine whether the format of the application activation message meets the target conditions;
[0025] If the format of the application activation message meets the target conditions, the target application corresponding to the application activation message is restarted.
[0026] In one possible implementation, the step of re-establishing the connection between the target application and the target device includes:
[0027] Send a connection message to the target device, the connection message being generated by the target application;
[0028] Upon receiving an acknowledgment message from the target device, the connection between the target application and the target device is re-established.
[0029] On one hand, embodiments of this application provide a connection establishment apparatus, the apparatus comprising:
[0030] The monitoring module is used to monitor communication messages sent from the target device to the terminal. These communication messages are used to communicate with a target application running on the terminal. The target application is used to control the target device and obtain data from the target device.
[0031] The scanning module is used to scan for the presence of application activation messages when no communication messages are detected. These application activation messages are sent by the target device after it detects an interruption in the connection with the target application.
[0032] The startup module is used to restart the target application corresponding to the application activation message when the application activation message is obtained;
[0033] The control module is used to control the re-establishment of the connection between the target application and the target device.
[0034] In one possible implementation, the scanning module is configured to determine the running status of the target application when no communication message is detected; and if the running status of the target application is not running, to scan for the existence of the application activation message.
[0035] In one possible implementation, the scanning module is used to determine whether the process of the target application is running if no communication message is detected within the target duration.
[0036] In one possible implementation, the scanning module is configured to determine whether the target application was actively closed by the user when the target application is in a non-running state; and to scan for the existence of the application activation message when the target application was not actively closed by the user.
[0037] In one possible implementation, the scanning module is further configured to not scan for the presence of the application activation message if the target application is actively closed by the user.
[0038] In one possible implementation, the device further includes:
[0039] A connection confirmation module is used to send a status confirmation message to the target device, the status confirmation message being used to determine the connection status between the target device and the target application.
[0040] The scanning module is used to scan for the existence of the application activation message when no communication message corresponding to the status confirmation message is detected.
[0041] In one possible implementation, the startup module is configured to, upon obtaining the application activation message, determine whether the format of the application activation message conforms to target conditions; and, if the format of the application activation message conforms to the target conditions, restart the target application corresponding to the application activation message.
[0042] In one possible implementation, the control module is configured to send a connection message to the target device, the connection message being generated by the target application; and upon receiving an acknowledgment message from the target device, to re-establish the connection between the target application and the target device.
[0043] On one hand, an electronic device is provided, the electronic device comprising:
[0044] At least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned connection establishment method.
[0045] On the one hand, a non-transitory computer-readable storage medium stores computer instructions for causing the computer to perform the aforementioned connection establishment method.
[0046] On the one hand, embodiments of this application also provide a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the aforementioned connection establishment method.
[0047] The technical solution provided in this application determines the connection status between the target device and the target application by monitoring communication messages between the target device and the terminal. If no communication messages are detected, it indicates that the connection between the target device and the target application may have been interrupted due to the closure of the target application, and the system scans for application activation messages. If an application activation message is detected, the target application corresponding to that message is restarted to re-establish the connection between the target application and the target device, thereby keeping the target application alive and maintaining the normal function of the target device. Attached Figure Description
[0048] To more clearly illustrate the technical solution of this application and to facilitate a further understanding of the technical effects, technical features and objectives of this application, the application will be described in detail below with reference to the accompanying drawings. The drawings constitute an essential part of the specification and are used together with the first embodiment of this application to illustrate the technical solution of this application, but do not constitute a limitation on this application.
[0049] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of this application;
[0050] Figure 2 A flowchart illustrating a connection establishment method provided in an embodiment of this application;
[0051] Figure 3 A flowchart illustrating a connection establishment method provided in an embodiment of this application;
[0052] Figure 4 This is a schematic diagram of the structure of a connection establishment device provided in an embodiment of this application;
[0053] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement an apparatus and / or a method of practice.
[0056] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0057] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the aspects described can be practiced without these specific details.
[0058] Figure 1 This is a schematic diagram illustrating the implementation environment of the connection establishment method provided in this application embodiment. See also: Figure 1 The implementation environment includes terminal 110 and target device 140.
[0059] Terminal 110 is connected to target device 140 via a wireless network. A target application runs on terminal 110 and can control target device 140. In some embodiments, terminal 110 and target device 140 are connected via Bluetooth Low Energy (BLE).
[0060] Target device 140 is smart hardware, such as smart bracelets, smartwatches, smart glasses, smart sports shoes, smart necklaces, etc.
[0061] Optionally, terminal 110 generally refers to one of a plurality of target devices, and this application embodiment only uses terminal 110 as an example for illustration.
[0062] Those skilled in the art will understand that the number of the aforementioned target devices can be more or less. For example, there may be only one target device, or there may be dozens or hundreds of target devices, or even more, in which case the aforementioned implementation environment may also include other target devices. This application does not limit the number or type of target devices in its embodiments.
[0063] After introducing the implementation environment of the embodiments of this application, the application scenarios of the embodiments of this application will be described below.
[0064] The connection establishment method provided in this application embodiment can be applied to the keep-alive scenario of applications associated with smart hardware.
[0065] For example, the connection establishment method provided in this application embodiment can be applied to the keep-alive scenario of an application associated with a smart bracelet, where the smart bracelet is the target device. A target application runs on the terminal, which is used to establish a communication connection with the smart bracelet, thereby controlling the smart bracelet and acquiring data from it. The terminal listens for communication messages sent by the smart bracelet, which are used to communicate with the target application. If no communication messages are detected, the target application may be closed, and the terminal scans for an application activation message. From the smart bracelet's perspective, in response to detecting a connection with the terminal, the smart bracelet broadcasts the application activation message. Upon receiving the application activation message, the terminal restarts the target application, thereby keeping it alive. The terminal controls the target application to reconnect with the smart bracelet, thus maintaining the normal function of the smart bracelet.
[0066] It should be noted that the above description is based on the example of a smart bracelet as the target device. In other possible implementations, the target device may be other smart devices, and this application does not limit this.
[0067] After introducing the implementation environment and application scenarios of the embodiments of this application, the connection establishment method provided by the embodiments of this application will be described below. See [link to documentation]. Figure 2 Taking an electronic device as the executing entity as an example, the method includes:
[0068] 201. The terminal listens to the communication messages sent by the target device to the terminal. These communication messages are used to communicate with the target application running on the terminal. The target application is used to control the target device and obtain data from the target device.
[0069] The target device is smart hardware, such as a smart bracelet, smartwatch, smart glasses, smart sneakers, smart necklace, etc., and this application embodiment does not limit this. Both the terminal and the target device include a communication unit, which is used for communication between the devices. In some embodiments, the communication unit is a Bluetooth module, such as a Bluetooth Low Energy (BLE) module. The target application is an application designed by the manufacturer of the target device, used to control the target device and obtain data from the target device. Taking a smart bracelet as an example, the terminal can set the time, alarm clock, and sedentary reminder functions of the smart bracelet through the target application, and can also obtain data such as steps, heart rate, and energy consumption through communication messages sent by the smart bracelet.
[0070] 202. If the communication message is not detected, the terminal scans for the presence of an application activation message, which is sent by the target device after detecting an interruption in the connection with the target application.
[0071] The application activation message is sent by the target device to activate the target application. When the target device detects a connection interruption with the target application, the target application may have been killed by the terminal, and the target device will be unable to interact with the target application.
[0072] 203. Upon obtaining the application activation message, the terminal restarts the target application corresponding to the application activation message.
[0073] In some embodiments, the application activation message is pre-registered in the terminal's operating system, that is, an event to launch the target application is pre-registered in the terminal. Upon receiving the application activation message, the terminal can execute the event, that is, restart the target application.
[0074] 204. The terminal controls the re-establishment of the connection between the target application and the target device.
[0075] The technical solution provided in this application determines the connection status between the target device and the target application by monitoring communication messages between the target device and the terminal. If no communication messages are detected, it indicates that the connection between the target device and the target application may have been interrupted due to the closure of the target application, and the system scans for application activation messages. If an application activation message is detected, the target application corresponding to that message is restarted to re-establish the connection between the target application and the target device, thereby keeping the target application alive and maintaining the normal function of the target device.
[0076] Steps 201-204 above are a simplified description of the connection establishment method provided in the embodiments of this application. The connection establishment method provided in the embodiments of this application will be described in detail below with reference to some examples. See [link to relevant documentation]. Figure 3 The methods include:
[0077] 301. The terminal listens to communication messages sent by the target device to the terminal. These communication messages are used to communicate with the target application running on the terminal. The target application is used to control the target device and obtain data from the target device.
[0078] The target device is smart hardware, such as a smart bracelet, smartwatch, smart glasses, smart sneakers, or smart necklace; this application does not limit the specific device to this type. Both the terminal and the target device include a communication unit for communication between the devices. In some embodiments, the communication unit is a Bluetooth module, such as a Bluetooth Low Energy (BLE) module, which significantly reduces power consumption. The target application is an application designed by the manufacturer of the target device, used to control the target device and acquire data from it. Taking a smart bracelet as an example, the terminal can set the time, alarm, and sedentary reminder functions of the smart bracelet through the target application, and can also acquire data such as steps, heart rate, and energy consumption through communication messages sent by the smart bracelet. In some embodiments, the communication message is a standard BLE broadcast, used to establish a connection with the target application and enable data interaction between the target device and the target application. In some embodiments, the BLE module uses a variable connection time interval, which can be set from a few milliseconds to a few seconds depending on the specific application. Furthermore, because BLE Bluetooth modules connect quickly, they can normally remain in a "non-connected" state (to save energy). In this state, the two ends of the link are only aware of each other, and the link is only activated when necessary. Whether the terminal's screen is on or off does not affect the operation of this communication unit.
[0079] In one possible implementation, the terminal launches the target application and simultaneously listens for communication messages sent from the target device to the terminal via a communication unit. The target device is bound to the target application, and the target device sends data to the target application through these communication messages. In some embodiments, even when the target device does not need to send data to the target application, it still sends the communication message to the terminal at preset intervals to maintain the connection between the target device and the target application. In this case, the communication message also serves to maintain the connection between the target device and the target application. Listening for communication messages sent from the target device to the terminal is equivalent to listening to the connection status between the target device and the target application. When the target device and the target application are successfully connected, the terminal can listen to the communication message; when the target device and the target application are disconnected, the terminal cannot listen to the communication message.
[0080] For example, if the target device is not bound to the target application, the terminal launches the target application and displays its device binding interface. In response to an operation on this interface, the terminal sends a binding request to the target device. The target device receives the binding request and, in response, sends a binding confirmation command. Upon receiving the confirmation command, the terminal establishes a binding relationship between the target application and the target device. The terminal scans the communication packets sent from the target device to itself via its communication unit, i.e., it monitors these communication packets through its communication unit.
[0081] 302. If the communication message is not detected, the terminal scans for the presence of an application activation message, which is sent by the target device after detecting an interruption in the connection with the target application.
[0082] The application activation message is sent by the target device to activate the target application. When the target device detects a connection interruption with the target application, the target application may have been killed by the terminal, and the target device cannot interact with the target application. In some embodiments, the application activation message is a Beacon broadcast, Eddystone broadcast, or Ibeacon broadcast, etc., and this application embodiment does not limit this. In some embodiments, the target device can detect whether the connection between the target device and the target application is interrupted through the BLE underlying interface. If a connection interruption is detected, the target device broadcasts the application activation message, such as a Beacon broadcast. The application activation message is used to trigger the restart of the target application.
[0083] In one possible implementation, if the communication message is not detected, the terminal scans the communication unit to see if an application activation message exists.
[0084] In this implementation, the terminal immediately scans for the presence of an application activation message if it does not detect the communication message. Since the application activation message is used to launch the target application, the target application can be restarted as quickly as possible, thus keeping the target application alive.
[0085] For example, if the communication message is not detected within the target duration, the terminal scans the communication unit to see if the application activation message exists.
[0086] In one possible implementation, if the communication message is not detected, the terminal determines the running status of the target application. If the target application is not running, the terminal scans for the presence of an application activation message.
[0087] In this implementation, since the communication message is sent when the target device communicates with the target application, the terminal determines the application status of the target application if the communication message is not detected. Only when the target application is not running will the terminal scan for the existence of the application activation message, thereby reducing the power consumption of the terminal.
[0088] For example, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the target application is in a running state; if the target application's process is not running, the target application is in a non-running state. The target duration is set by technicians according to actual conditions, and this application embodiment does not limit this. If the target application's process is running, the terminal scans for the presence of an application activation message.
[0089] For example, if the communication message is not heard within the target duration, the terminal determines whether the process of the target application is running. If the process of the target application is running, the terminal scans the surrounding broadcasts to determine whether the application activation message exists in the broadcasts. That is, the terminal queries the scanned broadcasts to see if there is an application activation message that has been registered in the operating system.
[0090] In one possible implementation, if the communication message is not detected, the terminal determines the running status of the target application. If the target application is not running, the terminal determines whether the target application was actively closed by the user. If the target application was not actively closed by the user, the terminal scans for the presence of an application activation message.
[0091] In this implementation, if the communication message is not detected, the terminal determines the running status of the target application. If it is determined that the target application is not running, it further determines whether the target application was actively closed by the user. If the application was not actively closed by the user, it is determined that the target application was killed by the terminal, and then a scan is performed to check for the existence of the application activation message.
[0092] For example, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal determines whether the target application was actively closed by the user. If the target application was not actively closed by the user, the terminal scans the communication unit to see if an application activation message exists.
[0093] For example, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal queries the application programming interface (API) file or log file. If there is no record of the target application being closed in the API file or log file, it is determined that the target application was not closed by the user. The terminal then scans the communication unit for the presence of an application activation message. Alternatively, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal compares the target application's shutdown time with the terminal screen's on / off time. If the target application's shutdown time differs from the terminal screen's on / off time, it is determined that the target application was not closed by the user. The terminal then scans the communication unit for the presence of an application activation message.
[0094] In one possible implementation, if the communication message is not detected, the terminal determines the running status of the target application. If the target application is not running, the terminal determines whether the target application was actively closed by the user. If the target application was actively closed by the user, no scan is performed to check for the existence of an application activation message.
[0095] In this implementation, the terminal determines the running status of the target application if the communication message is not detected. If it is determined that the target application is not running, it further determines whether the target application was actively closed by the user. If the application was actively closed by the user, it is determined that the target application was terminated by the user, and there is no need to scan for the existence of the application activation message.
[0096] For example, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal determines whether the target application was actively closed by the user. If the target application was actively closed by the user, the terminal does not scan for the existence of the application activation message.
[0097] For example, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal queries the application programming interface (API) file or log file. If a record of the target application being closed exists in the API file or log file, it is determined that the target application was closed actively by the user, and the terminal does not scan for the application activation message. Alternatively, if no communication message is detected within the target duration, the terminal determines whether the target application's process is running. If the target application's process is running, the terminal compares the target application's shutdown time with the terminal screen's on / off time. If the target application's shutdown time is the same as the terminal screen's on / off time, it is determined that the target application was closed actively by the user, and the terminal does not scan for the application activation message.
[0098] In one possible implementation, the terminal sends a status acknowledgment message to the target device to determine the connection status between the target device and the target application. If the terminal does not detect the communication message corresponding to the status acknowledgment message, it scans for the presence of an application activation message.
[0099] 303. Upon obtaining the application activation message, the terminal restarts the target application corresponding to the application activation message.
[0100] In some embodiments, the application activation message is pre-registered in the terminal's operating system, that is, an event to launch the target application is pre-registered in the terminal. Upon receiving the application activation message, the terminal can execute the event, that is, restart the target application.
[0101] In one possible implementation, upon receiving the application activation message, the terminal determines the event corresponding to the application activation message, which is used to launch the target application. The terminal executes the event corresponding to the application activation message, thereby launching the target application.
[0102] In one possible implementation, upon receiving the application activation message, the terminal determines whether the format of the application activation message conforms to the target conditions. If the format of the application activation message conforms to the target conditions, the terminal restarts the target application corresponding to the application activation message.
[0103] The format must meet the target criteria, meaning the format is Beacon, Eddystone, or Ibeacon.
[0104] In this implementation, the terminal can launch the target application only if the format of the application activation message meets the target conditions, thus avoiding the erroneous launch of the target application.
[0105] 304. The terminal controls the re-establishment of the connection between the target application and the target device.
[0106] In one possible implementation, the terminal sends a connection message to the target device, which is generated by the target application. Upon receiving an acknowledgment message from the target device, the terminal re-establishes the connection between the target application and the target device.
[0107] For example, the terminal sends a connection message to the target device, which is generated by the target application. Upon receiving an acknowledgment message from the target device, the terminal establishes a connection between the target application and the target device based on the acknowledgment message. Subsequently, it can detect communication messages sent by the target device to the target application, enabling data interaction between the target device and the target application, and keeping the target application alive.
[0108] In one possible implementation, the terminal scans for communication messages sent by the target device. Upon obtaining such communication messages, the terminal establishes a connection between the target device and the target application.
[0109] The technical solution provided in this application determines the connection status between the target device and the target application by monitoring communication messages between the target device and the terminal. If no communication messages are detected, it indicates that the connection between the target device and the target application may have been interrupted due to the closure of the target application, and the system scans for application activation messages. If an application activation message is detected, the target application corresponding to that message is restarted to re-establish the connection between the target application and the target device, thereby keeping the target application alive and maintaining the normal function of the target device.
[0110] For a corresponding method embodiment, see [link to relevant documentation]. Figure 4 This application also provides a connection establishment device 400, including: a listening module 401, a scanning module 402, a startup module 403, and a control module 404.
[0111] The monitoring module 401 is used to monitor the communication messages sent by the target device to the terminal. These communication messages are used to communicate with the target application running on the terminal. The target application is used to control the target device and obtain data from the target device.
[0112] The scanning module 402 is used to scan for the presence of an application activation message when the communication message is not detected. The application activation message is sent by the target device after it detects that the connection with the target application has been interrupted.
[0113] The startup module 403 is used to restart the target application corresponding to the application activation message when the application activation message is obtained.
[0114] Control module 404 is used to control the re-establishment of the connection between the target application and the target device.
[0115] In one possible implementation, the scanning module 402 is used to determine the running status of the target application if the communication message is not detected. If the running status of the target application is not running, the module scans for the presence of an application activation message.
[0116] In one possible implementation, the scanning module 402 is used to determine whether the process of the target application is running if the communication message is not detected within the target duration.
[0117] In one possible implementation, the scanning module 402 is configured to determine whether the target application was actively closed by the user if the target application is not actively closed by the user. If the target application was not actively closed by the user, the module scans for the presence of an application activation message.
[0118] In one possible implementation, the scanning module 402 is also configured to not scan for the presence of an application activation message if the target application is actively closed by the user.
[0119] In one possible implementation, the device further includes:
[0120] The connection confirmation module is used to send a status confirmation message to the target device, which is used to determine the connection status between the target device and the target application.
[0121] The scanning module 402 is used to scan for the existence of the application activation message when the communication message corresponding to the status confirmation message is not detected.
[0122] In one possible implementation, the startup module 403 is configured to, upon receiving the application activation message, determine whether the format of the application activation message conforms to target conditions. If the format of the application activation message conforms to the target conditions, the target application corresponding to the application activation message is restarted.
[0123] In one possible implementation, the control module 404 is configured to send a connection message to the target device, the connection message being generated by the target application. Upon receiving an acknowledgment message from the target device, the connection between the target application and the target device is re-established.
[0124] The technical solution provided in this application determines the connection status between the target device and the target application by monitoring communication messages between the target device and the terminal. If no communication messages are detected, it indicates that the connection between the target device and the target application may have been interrupted due to the closure of the target application, and the system scans for application activation messages. If an application activation message is detected, the target application corresponding to that message is restarted to re-establish the connection between the target application and the target device, thereby keeping the target application alive and maintaining the normal function of the target device.
[0125] See Figure 5 This application also provides an electronic device 500, which includes:
[0126] At least one processor; and,
[0127] The memory is communicatively connected to the at least one processor; wherein,
[0128] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the connection establishment method in the foregoing method embodiments.
[0129] This application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the connection establishment method described in the foregoing method embodiments.
[0130] This application also provides a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the connection establishment method described in the foregoing method embodiments.
[0131] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device 500 suitable for implementing embodiments of this application. The electronic device 500 in these embodiments may include, but is not limited to, mobile electronic devices such as laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), etc., and fixed electronic devices such as digital TVs, desktop computers, etc. Figure 5 The electronic device 500 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0132] like Figure 5 As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0133] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although an electronic device 500 with various devices is shown in the figure, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0134] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of the embodiments of this application.
[0135] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0136] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0137] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire at least two Internet Protocol (IP) addresses; send a node evaluation request including the at least two IP addresses to a node evaluation device, wherein the node evaluation device selects an IP address from the at least two IP addresses and returns it; and receive the IP address returned by the node evaluation device; wherein the acquired IP address indicates an edge node in a content delivery network.
[0138] Alternatively, the aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive a node evaluation request including at least two Internet Protocol (IP) addresses; select an IP address from the at least two IP addresses; and return the selected IP address; wherein the received IP address indicates an edge node in the content delivery network.
[0139] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0141] The units described in the embodiments of this application can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
Claims
1. A connection establishment method, characterized in that, Executed by the terminal, including: Listen to communication messages sent from the target device to the terminal. These communication messages are used to communicate with a target application running on the terminal. The target application is used to control the target device and obtain data from the target device. If no communication message is detected, scan for application activation messages, which are sent by the target device after detecting a connection interruption with the target application. Upon receiving the application activation message, restart the target application corresponding to the application activation message; Control the re-establishment of the connection between the target application and the target device; The process of controlling the target application to re-establish the connection with the target device includes: Send a connection message to the target device, the connection message being generated by the target application; Upon receiving an acknowledgment message from the target device, the connection between the target application and the target device is re-established.
2. The connection establishment method as described in claim 1, characterized in that, The step of scanning for the presence of application activation messages when no communication messages are detected includes: Determine the running status of the target application if the communication message is not detected. If the target application is not running, scan for the presence of the application activation message.
3. The connection establishment method as described in claim 2, characterized in that, Determining the running status of the target application when no communication message is detected includes: If no communication message is detected within the target duration, determine whether the process of the target application is running.
4. The connection establishment method as described in claim 2, characterized in that, The step of scanning for the presence of the application activation message when the target application is not running includes: If the target application is in a non-running state, determine whether the target application was actively closed by the user. If the target application is not actively closed by the user, scan for the presence of the application activation message.
5. The connection establishment method as described in claim 4, characterized in that, The method further includes: If the target application is actively closed by the user, the system will not scan for the presence of the application activation message.
6. The connection establishment method as described in claim 1, characterized in that, Before scanning for the presence of an application activation message if the communication message is not detected, the method further includes: A status confirmation message is sent to the target device, the status confirmation message being used to determine the connection status between the target device and the target application; The step of scanning for the presence of application activation messages when no communication messages are detected includes: If no communication message corresponding to the status confirmation message is detected, scan for the existence of the application activation message.
7. The connection establishment method as described in claim 1, characterized in that, The step of restarting the target application corresponding to the application activation message upon obtaining the application activation message includes: If the application activation message is obtained, determine whether the format of the application activation message meets the target conditions; If the format of the application activation message meets the target conditions, the target application corresponding to the application activation message is restarted.
8. A connection establishment device, comprising: The monitoring module is used to monitor communication messages sent from the target device to the terminal. These communication messages are used to communicate with a target application running on the terminal. The target application is used to control the target device and obtain data from the target device. The scanning module is used to scan for the presence of application activation messages when no communication messages are detected. These application activation messages are sent by the target device after it detects an interruption in the connection with the target application. The startup module is used to restart the target application corresponding to the application activation message when the application activation message is obtained; The control module is used to control the re-establishment of the connection between the target application and the target device.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the connection establishment method according to any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the connection establishment method according to any one of claims 1-7.