Device connection method and apparatus, electronic device, and storage medium

CN122891631APending Publication Date: 2026-10-09NINGBO FOTILE KITCHEN WARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610017252.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0004]本公开提供一种设备连接方法、装置、电子设备及存储介质,以至少解决相关技术中无法保证物联网设备和服务器的持续互通,设备和服务器通信的连续性和可靠性较低,进而导致设备异常等问题

Benefits of technology

响应于针对目标服务器的通信连接指令,向域名解析服务器发送目标服务器对应的目标服务器域名,以使域名解析服务器对目标服务器域名进行解析,可以优先通过解析域名的方式获取地址,保障地址的实时性和有效性,在域名解析服务器解析目标服务器域名的失败次数达到预设次数的情况下,从预设缓存中获取预设解析地址和/或目标服务器地址,预设解析地址为域名解析服务器在历史时间段内解析出的目标服务器域名对应的服务器地址,目标服务器地址为终端设备发送的目标服务器域名对应的服务器地址;基于预设缓存地址,与目标服务器建立通信连接,可以在解析域名异常的情况下,通过使用缓存的地址与服务器进行通信连接,保证设备和服务器的持续互通,提升设备和服务器通信的连续性和可靠性,减少设备异常情况。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122891631A_ABST
    Figure CN122891631A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a device connection method and device, an electronic device and a storage medium. The method is applied to a target device including a target communication module, and includes: in response to a communication connection instruction for a target server, sending a target server domain name corresponding to the target server to a domain name resolution server, so that the domain name resolution server resolves the target server domain name; in a case where a number of failures in resolving the target server domain name reaches a preset number, obtaining a preset resolution address and / or a target server address from a preset cache; the preset resolution address is a server address corresponding to the target server domain name resolved by the domain name resolution server in a historical time period; the target server address is a server address corresponding to the target server domain name sent by a terminal device; and establishing a communication connection with the target server based on the preset cache address. The embodiments of the present disclosure can improve the continuity and reliability of device and server communication, and reduce device exceptions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of Internet of Things (IoT) technology, and more particularly to a device connection method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the development of IoT technology, a large number of IoT devices are connected to the network to form an interconnected system. Ensuring normal communication between IoT devices and servers has become the key to maintaining the stable operation of the IoT system.

[0003] In related technologies, IoT devices often resolve the server's domain name to obtain the server's corresponding IP address (Internet Protocol), and then establish a communication connection with the server through the server's IP address. However, in related technologies, there are many abnormal reasons that may cause resolution failure, which cannot guarantee the continuous communication between IoT devices and servers. The continuity and reliability of communication between devices and servers are low, which in turn leads to problems such as device malfunctions. Summary of the Invention

[0004] This disclosure provides a device connection method, apparatus, electronic device, and storage medium to at least solve the problems in related technologies, such as the inability to guarantee continuous interoperability between IoT devices and servers, low continuity and reliability of communication between devices and servers, and consequently, device malfunctions. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, a device connection method is provided, the method being applied to a target device, the target device including a target communication module, the method comprising: In response to a communication connection command for the target server, the domain name of the target server corresponding to the target server is sent to the domain name resolution server so that the domain name resolution server can resolve the domain name of the target server; If the number of times the domain name resolution server fails to resolve the target server domain name reaches a preset number, a preset cache address is obtained from a preset cache; the preset cache address includes a preset resolution address and / or the target server address; the preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period; the target server address is the server address corresponding to the target server domain name sent by the terminal device. A communication connection is established with the target server based on the preset cache address.

[0005] In an optional embodiment, the method further includes: When a network connection is established based on the network configuration parameters sent by the terminal device, the target server address sent by the terminal device is received. The target server address is stored in the preset cache based on the target communication module.

[0006] In an optional embodiment, the method further includes: If the target server address is updated, the terminal device sends the target updated address corresponding to the target server domain name. The target server address is updated to the target update address based on the target communication module.

[0007] In an optional embodiment, when the preset cache address includes the preset resolution address and the target server address, establishing a communication connection with the target server based on the preset cache address includes: A communication connection is established with the target server based on the preset resolution address; If establishing a communication connection with the target server based on the preset resolution address fails, a communication connection is established with the target server based on the target server address.

[0008] In an optional embodiment, when the preset cache address is the preset resolution address or the target server address, establishing a communication connection with the target server based on the preset cache address includes: A communication connection is established with the target server based on the preset resolution address; or, A communication connection is established with the target server based on the target server address.

[0009] In an optional embodiment, if the domain name resolution server successfully resolves the target server domain name, the method further includes: Get the current resolved address; Based on the current resolved address, establish a communication connection with the target server.

[0010] In an optional embodiment, the method further includes: If the domain name resolution server successfully resolves the target server domain name, the preset resolution address in the preset cache is updated based on the current resolution address.

[0011] According to a second aspect of the present disclosure, a device connection apparatus is provided, the apparatus being applied to a target device, the target device including a target communication module, the apparatus comprising: The target server domain name sending module is used to send the target server domain name corresponding to the target server to the domain name resolution server in response to a communication connection command for the target server, so that the domain name resolution server can resolve the target server domain name; A preset cache address acquisition module is used to acquire a preset cache address from a preset cache when the number of failures of the domain name resolution server in resolving the target server domain name reaches a preset number; the preset cache address includes a preset resolution address and / or a target server address; the preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period; the target server address is the server address corresponding to the target server domain name sent by the terminal device; The first communication connection establishment module is used to establish a communication connection with the target server based on the preset cache address.

[0012] In an optional embodiment, the apparatus further includes: The target server address receiving module is used to receive the target server address sent by the terminal device when establishing a network connection based on the network configuration parameters sent by the terminal device. The target server address storage module is used to store the target server address into the preset cache based on the target communication module.

[0013] In an optional embodiment, the apparatus further includes: The target update address receiving module is used to receive the target update address corresponding to the target server domain name sent by the terminal device when the target server address is updated. The target server address update module is used to update the target server address to the target update address based on the target communication module.

[0014] In an optional embodiment, when the preset cache address includes the preset resolution address and the target server address, the first communication connection establishment module includes: The first communication connection establishment unit is used to establish a communication connection with the target server based on the preset resolution address; The second communication connection establishment unit is used to establish a communication connection with the target server based on the target server address if the communication connection with the target server based on the preset resolution address fails.

[0015] In an optional embodiment, when the preset cache address is the preset resolution address or the target server address, the first communication connection establishment module includes: The third communication connection establishment unit is used to establish a communication connection with the target server based on the preset resolution address; or, The fourth communication connection establishment unit is used to establish a communication connection with the target server based on the target server address.

[0016] In an optional embodiment, if the domain name resolution server successfully resolves the target server domain name, the apparatus further includes: The current resolved address acquisition module is used to obtain the current resolved address. The second communication connection establishment module is used to establish a communication connection with the target server based on the current resolved address.

[0017] In an optional embodiment, the apparatus further includes: The preset resolution address update module is used to update the preset resolution address in the preset cache based on the current resolution address when the domain name resolution server successfully resolves the target server domain name.

[0018] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in any one of the first aspects above.

[0019] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided such that, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in any of the first aspects of the present disclosure.

[0020] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects: In response to a communication connection command for the target server, the system sends the target server's domain name to the DNS server so that the DNS server can resolve the target server's domain name. It prioritizes obtaining the address through domain name resolution to ensure the address's real-time performance and validity. If the DNS server fails to resolve the target server's domain name a preset number of times, it retrieves a preset resolution address and / or the target server address from a preset cache. The preset resolution address is the server address corresponding to the target server's domain name resolved by the DNS server within a historical time period, and the target server address is the server address corresponding to the target server's domain name sent by the terminal device. Based on the preset cached address, a communication connection is established with the target server. Even in the event of domain name resolution anomalies, the system can use the cached address to maintain communication with the server, ensuring continuous communication between the device and the server, improving the continuity and reliability of device-server communication, and reducing device malfunctions.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.

[0023] Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment; Figure 2 This is a flowchart illustrating a device connection method according to an exemplary embodiment; Figure 3 This is a block diagram illustrating a device connection apparatus according to an exemplary embodiment; Figure 4 This is a block diagram illustrating an electronic device for device connection according to an exemplary embodiment; Figure 5 This is a block diagram illustrating an electronic device for device connection according to an exemplary embodiment. Detailed Implementation

[0024] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0025] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar different contents and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0026] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0027] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment, such as... Figure 1 As shown, the application environment may include terminal 100, domain name resolution server 300, target server 400 and target device 200.

[0028] In an optional embodiment, terminal 100 can be used to send services to a target server address. Specifically, terminal 100 can be, but is not limited to, electronic devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices, or software running on the aforementioned electronic devices, such as applications. Optionally, the operating system running on the electronic device can be, but is not limited to, Android, iOS, Linux, Windows, etc.

[0029] In an optional embodiment, the target device 200 can be a device in the Internet of Things. Specifically, when the number of times the domain name resolution server fails to resolve the domain name of the target server reaches a preset number, the target device 200 can obtain the preset resolution address resolved by the domain name resolution server within a historical time period and / or the target server address sent by the terminal from the preset cache. Accordingly, it can combine the preset resolution address and / or the target server address to establish a communication connection with the target server.

[0030] In an optional embodiment, the domain name resolution server 300 can be used to resolve the target server's domain name, and the target server 400 can provide backend services to the target device 200. Specifically, the domain name resolution server 300 and the target server 200 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0031] In addition, it should be noted that, Figure 1 The example shown is merely one application environment provided by this disclosure; in practical applications, other application environments may also be included.

[0032] In the embodiments described in this specification, the terminal 100, target device 200, domain name resolution server 300, and target server 400 can be directly or indirectly connected through wired or wireless communication methods, and this disclosure does not impose any restrictions.

[0033] Figure 2 This is a flowchart illustrating a device connection method according to an exemplary embodiment. The device connection method is used in a target device, the target device including a target communication module, such as... Figure 2 As shown, it includes the following steps.

[0034] In step S201, in response to the communication connection instruction for the target server, the target server domain name corresponding to the target server is sent to the domain name resolution server so that the domain name resolution server can resolve the target server domain name.

[0035] In one specific embodiment, the communication connection instruction can be used to instruct the target device to establish a communication connection with the target server, and the target server can be used as a server to communicate with the target device.

[0036] In one specific embodiment, the domain name resolution server can be used to resolve the target server domain name. Optionally, the domain name resolution server can resolve the target server domain name through the mapping relationship between the server domain name and the server address. Optionally, the domain name resolution server can be the Domain Name System.

[0037] In step S203, if the number of times the domain name resolution server fails to resolve the target server domain name reaches a preset number, the preset cache address is obtained from the preset cache.

[0038] In one specific embodiment, the preset cache address may include a preset resolution address and / or a target server address. Specifically, the preset resolution address may be the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period, and the target server address may be the server address corresponding to the target server domain name sent by the terminal device.

[0039] In an optional embodiment, when the preset cache address includes a preset resolution address and a target server address, establishing a communication connection with the target server based on the preset cache address may include: Establish a communication connection with the target server based on the preset resolution address; If establishing a communication connection with the target server based on the preset resolution address fails, a communication connection will be established with the target server based on the target server address.

[0040] In a specific embodiment, taking the preset resolution address as IP1 and the target server address as IP2 as an example, a communication connection can be established with the target server through IP1 first. If the communication connection with the target server through IP1 fails, a communication connection can be established with the target server through IP2.

[0041] In the above embodiments, when the preset cache address includes a preset resolution address and a target server address, the preset resolution address resolved by the domain name resolution server within a historical time period is used first to establish a communication connection with the target server, which can ensure the validity and reliability of the server address. If the communication connection with the target server fails to be established using the preset resolution address, the target server address sent by the terminal device is then used, which can improve the connection probability between the target device and the target server.

[0042] In step S205, a communication connection is established with the target server based on the preset cache address.

[0043] In a specific embodiment, taking the preset cache address as IP1 and / or IP2 as an example, a communication connection can be established with the target server based on IP1 and / or IP2.

[0044] In an optional embodiment, when the preset cache address is a preset resolution address or a target server address, establishing a communication connection with the target server based on the preset cache address may include: Establish a communication connection with the target server based on the preset resolution address; or, Establish a communication connection with the target server based on the target server address.

[0045] In a specific embodiment, taking the preset resolution address as IP1 and the target server address as IP2 as an example, when the preset cache address is IP1, a communication connection can be established with the target server through IP1, and when the preset cache address is IP2, a communication connection can be established with the target server through IP2.

[0046] In the above embodiments, when the preset cache address is the preset resolution address or the target server address, a communication connection can be established with the target server through the preset resolution address or the target server address, ensuring normal communication between the target device and the target server, thereby reducing device malfunctions.

[0047] In an optional embodiment, if the domain name resolution server successfully resolves the target server's domain name, the method may further include: Get the current resolved address; Establish a communication connection with the target server based on the current resolved address.

[0048] In one specific embodiment, the current resolution address can be the server address corresponding to the target server domain name obtained by the domain name resolution server resolving the target server domain name.

[0049] In the above embodiments, if the domain name resolution server successfully resolves the target server's domain name, it can establish a communication connection with the target server by using the currently resolved address, automatically adapting to changes in the server address and ensuring the validity of the address.

[0050] In an optional embodiment, the above method may further include: If the DNS server successfully resolves the target server's domain name, the preset DNS address in the preset cache is updated based on the current DNS address.

[0051] In a specific embodiment, taking the preset resolution address as IP2 and the current resolution address as IP3 as an example, the IP2 in the preset cache can be updated to IP3 based on IP3.

[0052] In the above embodiments, when the domain name resolution server successfully resolves the target server domain name, the preset resolution address in the preset cache can be updated to the current resolution address in real time to adapt to changes in the server address and ensure communication continuity.

[0053] In an optional embodiment, the above method may further include: When establishing a network connection based on network configuration parameters sent by the terminal device, receive the target server address sent by the terminal device; The target server address is stored in a preset cache based on the target communication module.

[0054] In one specific embodiment, network configuration parameters can be used to configure the network. Specifically, network configuration parameters may include WiFi name, WiFi password, and encryption method, etc.

[0055] In the above embodiments, during the process of establishing a network connection through network parameters sent by the terminal device, the target server address sent by the terminal device is stored in a preset cache based on the target communication module. In the event of an anomaly in the domain name resolution server, the target server can be retrieved from the preset cache, ensuring the continuity of the communication connection and avoiding service interruption caused by resolution anomalies.

[0056] In an optional embodiment, the above method may further include: When the target server address is updated, the receiving terminal device sends the target updated address corresponding to the target server domain name. The target server address is updated to the target update address based on the target communication module.

[0057] In one specific embodiment, the target update address can be the updated server address corresponding to the target server domain name.

[0058] In a specific embodiment, taking the target server address as IP2 and the target update address as IP4 as an example, IP2 can be updated to IP4 based on the target communication module.

[0059] In the above embodiments, when the target server address is updated, the target server address can be updated to the target updated address based on the target communication module. This proactively addresses the server address change scenario and ensures that even if the domain name resolution server malfunctions, the target device can still obtain the updated server address corresponding to the target server domain name, thus avoiding connection failure due to the expiration of the cached server address.

[0060] As can be seen from the technical solutions provided in the embodiments of this specification above, in response to a communication connection command for a target server, this specification sends the target server domain name corresponding to the target server to the domain name resolution server, so that the domain name resolution server can resolve the target server domain name. It can prioritize obtaining the address by resolving the domain name, ensuring the real-time nature and validity of the address. If the number of times the domain name resolution server fails to resolve the target server domain name reaches a preset number, it obtains a preset resolution address and / or the target server address from a preset cache. The preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period, and the target server address is the server address corresponding to the target server domain name sent by the terminal device. Based on the preset cached address, a communication connection is established with the target server. Even in the event of domain name resolution anomalies, communication can be established with the server using the cached address, ensuring continuous communication between the device and the server, improving the continuity and reliability of communication between the device and the server, and reducing device anomalies.

[0061] Figure 3 This is a block diagram illustrating a device connection apparatus according to an exemplary embodiment. (Refer to...) Figure 3 The device is applied to a target device, which includes a target communication module. The device includes: The target server domain name sending module 310 is used to send the target server domain name corresponding to the target server to the domain name resolution server in response to the communication connection command for the target server, so that the domain name resolution server can resolve the target server domain name; The preset cache address acquisition module 330 is used to obtain a preset cache address from the preset cache when the number of times the domain name resolution server fails to resolve the target server domain name reaches a preset number; the preset cache address includes a preset resolution address and / or the target server address; the preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period; the target server address is the server address corresponding to the target server domain name sent by the terminal device. The first communication connection establishment module 350 is used to establish a communication connection with the target server based on a preset cache address.

[0062] In an optional embodiment, the above-described apparatus further includes: The target server address receiving module is used to receive the target server address sent by the terminal device when establishing a network connection based on the network configuration parameters sent by the terminal device. The target server address storage module is used to store the target server address into a preset cache based on the target communication module.

[0063] In an optional embodiment, the above-described apparatus further includes: The target update address receiving module is used to receive the target update address corresponding to the target server domain name sent by the terminal device when the target server address is updated. The target server address update module is used to update the target server address to the target update address based on the target communication module.

[0064] In an optional embodiment, when the preset cache address includes a preset resolution address and a target server address, the first communication connection establishment module 350 includes: The first communication connection establishment unit is used to establish a communication connection with the target server based on a preset resolution address; The second communication connection establishment unit is used to establish a communication connection with the target server based on the target server address if the communication connection with the target server based on the preset resolution address fails.

[0065] In an optional embodiment, when the preset cache address is a preset resolution address or a target server address, the first communication connection establishment module 350 includes: The third communication connection establishment unit is used to establish a communication connection with the target server based on the preset resolution address; or, The fourth communication connection establishment unit is used to establish a communication connection with the target server based on the target server address.

[0066] In an optional embodiment, if the domain name resolution server successfully resolves the target server's domain name, the above apparatus further includes: The current resolved address acquisition module is used to obtain the current resolved address. The second communication connection establishment module is used to establish a communication connection with the target server based on the current resolved address.

[0067] In an optional embodiment, the above-described apparatus further includes: The preset resolution address update module is used to update the preset resolution address in the preset cache based on the current resolution address when the domain name resolution server successfully resolves the target server's domain name.

[0068] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0069] Figure 4 This is a block diagram illustrating an electronic device for device connection according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a device connection method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0070] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the device connection method of the embodiments of this disclosure.

[0071] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0072] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A device connection method, characterized in that, The method is applied to a target device, the target device including a target communication module, the method comprising: In response to a communication connection command for the target server, the domain name of the target server corresponding to the target server is sent to the domain name resolution server so that the domain name resolution server can resolve the domain name of the target server; If the number of times the domain name resolution server fails to resolve the target server domain name reaches a preset number, a preset cache address is obtained from a preset cache; the preset cache address includes a preset resolution address and / or the target server address; the preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period; the target server address is the server address corresponding to the target server domain name sent by the terminal device. A communication connection is established with the target server based on the preset cache address.

2. The device connection method according to claim 1, characterized in that, The method further includes: When a network connection is established based on the network configuration parameters sent by the terminal device, the target server address sent by the terminal device is received. The target server address is stored in the preset cache based on the target communication module.

3. The device connection method according to claim 2, characterized in that, The method further includes: If the target server address is updated, the terminal device sends the target updated address corresponding to the target server domain name. The target server address is updated to the target update address based on the target communication module.

4. The device connection method according to claim 1, characterized in that, When the preset cache address includes the preset resolution address and the target server address, establishing a communication connection with the target server based on the preset cache address includes: A communication connection is established with the target server based on the preset resolution address; If establishing a communication connection with the target server based on the preset resolution address fails, a communication connection is established with the target server based on the target server address.

5. The device connection method according to claim 1, characterized in that, When the preset cache address is the preset resolution address or the target server address, establishing a communication connection with the target server based on the preset cache address includes: A communication connection is established with the target server based on the preset resolution address; or, A communication connection is established with the target server based on the target server address.

6. The device connection method according to claim 1, characterized in that, If the domain name resolution server successfully resolves the target server domain name, the method further includes: Get the current resolved address; Based on the current resolved address, establish a communication connection with the target server.

7. The device connection method according to claim 6, characterized in that, The method further includes: If the domain name resolution server successfully resolves the target server domain name, the preset resolution address in the preset cache is updated based on the current resolution address.

8. A device connection apparatus, characterized in that, The device is applied to a target device, the target device including a target communication module, and the device includes: The target server domain name sending module is used to send the target server domain name corresponding to the target server to the domain name resolution server in response to a communication connection command for the target server, so that the domain name resolution server can resolve the target server domain name; A preset cache address acquisition module is used to acquire a preset cache address from a preset cache when the number of failures of the domain name resolution server in resolving the target server domain name reaches a preset number; the preset cache address includes a preset resolution address and / or a target server address; the preset resolution address is the server address corresponding to the target server domain name resolved by the domain name resolution server within a historical time period; the target server address is the server address corresponding to the target server domain name sent by the terminal device; The first communication connection establishment module is used to establish a communication connection with the target server based on the preset cache address.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the device connection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the device connection method as described in any one of claims 1 to 7.