A device connection method, apparatus, device, and storage medium

CN116980685BActive Publication Date: 2026-10-20GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210430422.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2026-10-20
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

[0003]本发明实施例提供了一种设备连接方法、装置、设备及存储介质,能够在兼容局域网和广域网的情况下,提高设备连接的成功率,解决了现有技术中连接码兼容性差且设备连接成功率低的技术问题

Benefits of technology

[0028]上述,本发明实施例中第二设备只需要显示一个连接码,即可使得第一设备通过局域网或广域网与第二设备相连接,能够同时兼容局域网和广域网的网络环境,并且用户在使用过程中只需要获取一个连接码即可,不需要获取不同的连接码进行重复连接操作,无论显示第一连接码或第二连接码,用户在第一设备上执行的连接操作相同,用户也不需要针对不同的连接码学习不同的操作,减轻了用户的学习成本以及操作成本。本发明实施例能够解决现有技术中连接码兼容性差且设备连接成功率低的技术问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116980685B_ABST
    Figure CN116980685B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a device connection method and device, apparatus and storage medium, and relate to the field of communication. The method comprises generating a first connection code according to device information, sending a request for applying a second connection code and the first connection code to a server, so that the server saves the first connection code and the second connection code in association, the first connection code is used as at least one of a verification code and an address code of a local area network, and the second connection code is used as a verification code of a wide area network; displaying the first connection code or the second connection code to receive a connection request sent by a first device through the local area network or the wide area network, the connection request is generated by the first device according to the first connection code or the second connection code; and connecting with the first device through the local area network or the wide area network in response to the connection request. The embodiments of the present application can improve the success rate of device connection under the condition of compatibility of the local area network and the wide area network, and solve the technical problems of poor connection code compatibility and low device connection success rate in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communications, and more particularly to a device connection method, apparatus, device, and storage medium. Background Technology

[0002] Currently, with the continuous development of network technology, wireless screen sharing technology is being used more and more in office and education settings. Before wireless screen sharing, a connection code needs to be entered on the sending end to connect the sending and receiving ends. Currently, the connection code can only be used when both the sending and receiving ends are located on the same local area network (LAN). The connection code serves as either a random verification code or an address code. However, when the sending end is only connected to a wide area network (WAN), or when the sending end cannot directly connect to the receiving end's address, the sending end cannot connect to the receiving end using the connection code. Furthermore, in environments with high information security requirements, the connection code may not be compatible with the environment, or may even become unusable. Summary of the Invention

[0003] This invention provides a device connection method, apparatus, device, and storage medium that can improve the success rate of device connection while being compatible with local area networks and wide area networks, and solves the technical problems of poor connection code compatibility and low device connection success rate in the prior art.

[0004] In a first aspect, embodiments of the present invention provide a device connection method, including:

[0005] A first connection code is generated based on the device information, and a request for a second connection code is sent to the server along with the first connection code, so that the server can associate and store the first connection code and the second connection code. The first connection code is used as at least one of a local area network verification code and an address code, and the second connection code is used as a wide area network verification code.

[0006] Display the first connection code or the second connection code to receive a connection request sent by the first device through a local area network or a wide area network, wherein the connection request is generated by the first device based on the first connection code or the second connection code;

[0007] In response to the connection request, the device connects to the first device via the local area network or the wide area network.

[0008] Secondly, embodiments of the present invention provide a device connection method, including:

[0009] Receive a first connection code or a second connection code, wherein the first connection code is used as at least one of a verification code and an address code for a local area network, and the second connection code is used as a verification code for a wide area network.

[0010] When the second connection code is received, request the server to receive the first connection code associated with the second connection code;

[0011] Based on the first connection code, a first connection request is sent to the second device via the local area network;

[0012] When the first connection code is received and the connection establishment corresponding to the first connection request fails, the server is requested to receive the second connection code associated with the first connection code.

[0013] After confirming that the connection establishment corresponding to the first connection request has failed, a second connection request is sent to the second device through the wide area network according to the second connection code.

[0014] Thirdly, embodiments of the present invention provide a device connection apparatus, including: a connection code generation module, a connection code display module, and a connection response module;

[0015] The connection code generation module is used to generate a first connection code based on device information, and send a request for a second connection code and the first connection code to the server, so that the server can associate and store the first connection code and the second connection code. The first connection code is used as at least one of the verification code and address code of the local area network, and the second connection code is used as the verification code of the wide area network.

[0016] The connection code display module is used to display the first connection code or the second connection code to receive a connection request sent by the first device through a local area network or a wide area network. The connection request is generated by the first device based on the first connection code or the second connection code.

[0017] The connection response module is used to respond to the connection request and connect to the first device via the local area network or the wide area network.

[0018] Fourthly, embodiments of the present invention provide a device connection apparatus, including a connection code receiving module, a first connection code request module, a first connection request module, a second connection code request module, and a second connection request module;

[0019] The connection code receiving module is used to receive a first connection code or a second connection code, wherein the first connection code is used as at least one of a local area network (LAN) verification code and an address code, and the second connection code is used as a wide area network (WAN) verification code.

[0020] The first connection code request module is used to request the server to receive the first connection code associated with the second connection code when the received connection code is the second connection code;

[0021] The first connection request module is used to send a first connection request to the second device through the local area network based on the first connection code;

[0022] The second connection code request module is used to request the server to receive a second connection code associated with the first connection code when the first connection code is received and the connection corresponding to the first connection request fails to be established.

[0023] The second connection request module is used to send a second connection request to the second device through the wide area network according to the second connection code after confirming that the connection establishment corresponding to the first connection request has failed.

[0024] Fifthly, embodiments of the present invention provide a device connection device, the device connection device including a processor and a memory;

[0025] The memory is used to store computer programs and to transfer the computer programs to the processor;

[0026] The processor is configured to execute a device connection method as described in the first or second aspect, according to instructions in the computer program.

[0027] In a sixth aspect, embodiments of the present invention provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform a device connection method as described in the first or second aspect.

[0028] As described above, in this embodiment of the invention, the second device only needs to display one connection code to enable the first device to connect to the second device via a local area network (LAN) or a wide area network (WAN). This allows for compatibility with both LAN and WAN network environments. Furthermore, the user only needs to obtain one connection code during use, eliminating the need to obtain different codes for repeated connection operations. Regardless of whether a first or second connection code is displayed, the connection operation performed by the user on the first device remains the same. Users also do not need to learn different operations for different connection codes, reducing learning and operational costs. This embodiment of the invention solves the technical problems of poor connection code compatibility and low device connection success rate in the prior art. Attached Figure Description

[0029] Figure 1 This is a schematic diagram illustrating a scenario where devices are interconnected, as provided in an embodiment of the present invention.

[0030] Figure 2 This is a schematic diagram illustrating a scenario where devices within a local area network are interconnected, as provided in an embodiment of the present invention.

[0031] Figure 3 This is a flowchart of a device connection method provided in an embodiment of the present invention.

[0032] Figure 4 This is a schematic diagram of a scenario for an application device connection method provided in an embodiment of the present invention.

[0033] Figure 5 A flowchart of another device connection method provided in an embodiment of the present invention.

[0034] Figure 6 A flowchart of another device connection method provided in an embodiment of the present invention.

[0035] Figure 7 This is a schematic diagram illustrating the process of a first device parsing a connection code, provided as an embodiment of the present invention.

[0036] Figure 8 This is a schematic diagram illustrating another device connection method provided in an embodiment of the present invention.

[0037] Figure 9 This is a schematic diagram illustrating another device connection method provided in an embodiment of the present invention.

[0038] Figure 10 This is a schematic diagram illustrating another device connection method provided in an embodiment of the present invention.

[0039] Figure 11 This is a schematic diagram of another device connection device provided in an embodiment of the present invention.

[0040] Figure 12 This is a schematic diagram of another device connection device provided in an embodiment of the present invention.

[0041] Figure 13 This is a schematic diagram of a device connection device provided in an embodiment of the present invention.

[0042] Figure Labels

[0043] First device 10, second device 20, server 30. Detailed Implementation

[0044] The following description and accompanying drawings fully illustrate specific embodiments of this application to enable those skilled in the art to practice them. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The scope of embodiments of this application includes the entire scope of the claims and all available equivalents of the claims. In this document, each embodiment may be referred to individually or collectively by the term "invention," which is merely for convenience and is not intended to automatically limit the scope of the application to any single invention or inventive concept if more than one invention is disclosed. Relational terms such as "first" and "second" are used herein merely to distinguish one entity or operation from another, without requiring or implying any actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, or apparatus comprising a list of elements includes not only those elements but also other elements not expressly listed. The various embodiments in this document are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the structures, products, etc., disclosed in the embodiments, since they correspond to the disclosed parts, the descriptions are relatively simple; relevant details can be found in the method section.

[0045] like Figure 1 As shown, Figure 1This diagram illustrates a first scenario of interconnected devices according to an embodiment of the present invention. A first device 10 and a second device 20 can interact. The first device 10 can be a mobile phone, tablet, desktop computer, Windows, Mac, or Chrome laptop, or other portable device. The second device 20 can be an interactive smart tablet, interactive tablet, projector, screen, and / or television, etc. The first device 10 and the second device 20 can be interconnected, for example, via a wireless communication network. This wireless communication network can be understood as any network that does not require a wired connection between the first device 10 and the second device 20, such as RF (Radio Frequency), optical, or infrared communication, for example, an infrared interface (IrDA), diffuse infrared, wireless local area network (WLAN), WiMax, wireless local area network (WiFi), WiFi Direct, Bluetooth, or any other wireless communication network familiar to those skilled in the art, such as an optical network (LiFi). Of course, in other embodiments, the first device 10 and the second device 20 can also be connected via a wired communication network.

[0046] After the first device 10 and the second device 20 are connected, they can exchange information. For example, the first device 10 can send the currently displayed screen data to the second device 20. The currently displayed screen data may include one or more of audio and video data. After receiving the screen data sent by the first device 10, the second device 20 can process the received screen data and display it on its own page to achieve screen projection. For example, the first device 10 can encode the current screen data and send the encoded screen data to the second device 20. The second device 20 receives the encoded screen data and decodes it to obtain the decoded screen data, which can then be displayed. The following explanation uses the connection between the first device 10 and the second device 20 via a wireless local area network as an example.

[0047] For example, such as Figure 2 As shown, Figure 2This is a schematic diagram of a second scenario of device interconnection provided in an embodiment of the present invention. The first device 10 and the second device 20 are located within the same local area network (LAN). A LAN refers to a private network formed within a local area. The first device 10 and the second device 20 are connected through the LAN. When the first device 10 needs to project its screen onto the second device 20, the second device 20 generates a LAN connection code according to certain rules and displays it. After the first device 10 inputs the LAN connection code, it can locate the second device 20 within the LAN and perform information interaction with the second device 20 through the LAN, such as the screen projection process described above. However, when the first device 10 and the second device 20 are not in the same LAN, they cannot interact through the aforementioned LAN connection code. For example, if the second device 20 is a mobile phone, and the user uses the mobile phone through a mobile communication network, it cannot connect to the first device 10 through the aforementioned LAN connection code.

[0048] Based on this, embodiments of the present invention provide a device connection method, such as... Figure 3 As shown, Figure 3 This is a schematic diagram of a first process for a device connection method provided in an embodiment of the present invention. The method can be applied to a second device 20 and includes the following steps:

[0049] Step 101: Generate a first connection code based on the device information, and send a request for a second connection code and the first connection code to the server so that the server can associate and save the first connection code and the second connection code. The first connection code is used as at least one of the verification code and address code of the local area network, and the second connection code is used as the verification code of the wide area network.

[0050] In this embodiment, the second device 20 first generates a first connection code based on its own device information. This device information includes, for example, a local area network (LAN) IP address, a service port number, a hotspot IP address, a hotspot SSID (Service Set Identifier), a hotspot password, and / or a physical address. The LAN IP address is the network address of the local area network; the service port number is the port number of server 30, where different services on server 30 use different ports to provide different services; the server 30 port number is the number within each port. A hotspot is a device that converts GPRS, 3G, or 4G signals into wireless LAN signals and broadcasts them for other devices to use; the hotspot IP address is the address of the wireless LAN. The hotspot SSID divides a hotspot's wireless LAN into several sub-networks requiring different authentication methods. Each sub-network requires independent authentication; only authenticated users can access the corresponding sub-network, preventing unauthorized users from entering the wireless LAN. The hotspot password is the password required to connect to the hotspot's wireless LAN; only with the correct password can one connect to the hotspot. A physical address is the address of a device that broadcasts a hotspot. Physical addresses are set by the manufacturer at the factory and are used to identify each device in the network.

[0051] The first connection code refers to the connection code used to connect different devices within the same local area network (LAN). In this embodiment, the first connection code serves as at least one of the verification code and address code in the LAN; that is, the first connection code can serve only as the LAN verification code, only as the LAN address code, or both. The verification code is the connection code used to match a specific device, and it includes the device's verification information. For example, the first device 10 discovers the list of second devices 20 through a LAN protocol (such as Simple Service Discovery Protocol or Multicast DNS Protocol), and then matches a specific receiving end from the list of second devices 20 using the connection code, indirectly discovering and connecting to the second device 20. The address code is the connection code containing IP address information, including the device's IP address information. For example, IP address information can be mapped to a connection code through a certain mapping relationship. After the screen-casting device inputs the connection code, it can directly discover and connect to the screen-casting receiving device.

[0052] In one embodiment, the first connection code is a default six-character connection code. A character refers to a glyph or symbol, including letters, numbers, operators, punctuation marks, and other symbols, as well as some functional symbols. In this embodiment, the characters of the first connection code can consist of any one or more numbers or letters. For example, the first connection code could be CDF96Q or WS7U89, etc. The specific content of the first connection code is not limited in this embodiment. It is understood that the first connection code can be expanded to include seven or more characters, thereby adding more IP address information, variable bits, ports, or other network information. Specifically, in this embodiment, the process by which the second device 20 generates the first connection code based on its own device information is as follows: According to the RFC 1918 standard, the private IPv4 addresses in the local area network are divided into four segments, as shown in Table 1.

[0053] Table 1

[0054] 1. Class A private segment 00 10.0.0.0~10.255.255.255 16777216 2. Class B private segment 01 172.16.0.0~172.31.255.255 1048576 3. Class C private segment 10 192.168.0.0~192.168.255.255 65536 4. Retain extended sections 11 Undefined Undefined

[0055] Since the first linker code is a six-digit or letter linker code, consisting of six digits and letters, namely 0-9 and A-Z (case-insensitive), totaling 36 characters, after removing the digits "0" and "1" and the letters "I" and "O," which are easily misidentified by users, 32 characters remain. Therefore, the encoding space of the linker code is 32. 6 =2 30 That is, there is a 30-bit encoding space to store content.

[0056] After dividing the IPv4 private address, the first device 10 fills the IP address, port, random bit, checksum, and type bit into the 30 binary bits of the connection code. Specifically, when the IP address of the second device 20 is a Class A private address, the binary bits of the connection code, from high to low, represent the type, checksum, port, and IP address information, as shown in Table 2:

[0057] Table 2

[0058] meaning Type bit Check bit port IP address information

[0059] When the IP address of the second device 20 is a Class B private segment address, the binary bits of the connection code, from high to low, represent the type, checksum, port, and IP address information, as shown in Table 2:

[0060] Table 3

[0061] meaning Type bit Check bit Change bit port IP address information

[0062] When the IP address of the second device 20 is a Class C private segment address, the binary bits of the connection code, from high to low, represent the type, checksum, port, and IP address information, as shown in Table 4:

[0063] Table 4

[0064] meaning Type bit Check bit Change bit port IP address information

[0065] The type bit indicates the type of the IP address: 00 for Class A private segment addresses, 01 for Class B private segment addresses, 10 for Class C private segment addresses, and 11 for reserved extension segments. The check bit is a number formed by the remaining bits in the connection code, modulo 4. For the user-input connection code, the check bit is calculated and compared with the stored check bit in the connection code to confirm whether the user has entered the correct information. The change bit is randomly generated within the range of 0 to 15. To ensure the change bit affects other parts, it is swapped with any four other bits to avoid a situation where only one character changes across the six connection codes. The port number stores the index of the port array and can be obtained from the service port number in the device information. The IP address information indicates the IP address of the second device 20 in the local area network and can be obtained from the LAN IP address in the device information.

[0066] After generating the first connection code, the second device 20 uploads it to the server 30. The server 30 is a device that provides computing or application services to other devices on the network. Simultaneously, the second device 20 sends a request to the server 30 for a second connection code. Upon receiving the request, the server 30 generates the second connection code and associates and saves it with the first connection code. It should be noted that in this embodiment, the second connection code is a connection code used in a wide area network (WAN), enabling different devices within the WAN to connect. A WAN is a remote network connecting computers in different local area networks (LANs) or metropolitan area networks (MANs). Because different devices can access each other in a WAN, each WAN connection code must be unique; otherwise, incorrect connections to other devices may occur, leading to serious problems such as information leakage. Therefore, the second connection code is used as a verification code in the WAN to match specific devices. In one embodiment, the server 30 can use the connection code corresponding to the reserved extension segment of the IP address in the first connection code as the WAN connection code.

[0067] Step 102: Display the first connection code or the second connection code to receive a connection request sent by the first device through a local area network or a wide area network. The connection request is generated by the first device based on the first connection code or the second connection code.

[0068] After sending a request for a second connection code to the server 30, the second device 20 can display either the first or second connection code. For example, the second device 20 can display the connection code at a random location on the screen, or it can display the connection code in a specific area on the screen. If the second device 20 needs to display the first connection code, it needs to receive the first connection code returned by the server 30. Subsequently, the user inputs the first or second connection code displayed on the second device 20 into the first device 10. After receiving the first or second connection code, the first device 10 generates a connection request based on the first or second connection code. This connection request is used to request a connection with the second device 20, and it is generated based on the first or second connection code received from the first device 10. For example, as shown... Figure 4 As shown, Figure 4This diagram illustrates a usage scenario of a device connection method provided by an embodiment of the present invention. The method includes a first device 10, a second device 20, and a server 30. The first device 10 is connected to a wide area network (WAN), and the second device 20 is connected to both the WAN and a local area network (LAN). The second device 20 displays either a first connection code or a second connection code, and a user inputs the connection code displayed on the second device 20 into the first device 10. Upon receiving the input connection code, the first device 10 first determines whether it is the first or second connection code. If it is the first connection code, the first device 10 parses the first connection code to obtain the IP address information and verification information of the second device 20. Then, based on the IP address information and verification information, it sends a connection request to the second device 20 via the LAN. For example, bits 29-28 of the first connection code are parsed as the type. Based on the parsed type, bits 27-0 of the first connection code can be parsed. When the type is 00, it indicates that the IP address type in the connection code is a Class A private segment address. In this case, bits 27-26 of the first connection code are parsed as the checksum; bits 25-24 of the first connection code are parsed as the port; bits 23-0 of the connection code are parsed as the IP address information, and so on for connection codes of other IP address types. Thus, when the user enters the first connection code on the first device 10, the first device 10 can connect to the second device 20 via the local area network. In another embodiment, after receiving the first connection code, the first device 10 can also obtain the second connection code associated with the first connection code from the server 30, parse the verification information from the second connection code, and send a connection request to the second device 20 via the wide area network based on the verification information. Alternatively, in another embodiment, after the first device 10 fails to connect to the second device 20 via the local area network, the first device 10 obtains a second connection code associated with the first connection code from the server 30, parses verification information from the second connection code, and sends a connection request to the second device 20 via the wide area network based on the verification information. Thus, even if the user enters the first connection code on the first device 10, the first device 10 can still connect to the second device 20 via the wide area network.

[0069] When the second device 20 displays the second connection code, the user inputs the second connection code into the first device 10. In one embodiment, after receiving the second connection code, the first device 10 can directly send a connection request to the second device via a wide area network (WAN) based on the second connection code, thereby connecting the first and second devices via the WAN. In another embodiment, after receiving the second connection code, the first device 10 retrieves a first connection code associated with the second connection code from the server 30, and sends a connection request to the second device 20 via a local area network (LAN) based on the first connection code. If the first device 10 fails to connect to the second device 20 via the LAN, the first device 10 further sends a connection request to the second device 20 via the WAN based on the second connection code, so that even when the user inputs the second connection code, the first device 10 can still connect to the second device 20 via the LAN.

[0070] Step 103: In response to the connection request, connect to the first device via a local area network or a wide area network.

[0071] After receiving a connection request from the first device 10, the second device 20 establishes a connection with the first device 10 through the local area network if the connection request is sent through the local area network; otherwise, the second device 20 establishes a connection with the first device 10 through the wide area network.

[0072] As described above, when the second device uploads the generated first connection code to the server, it simultaneously requests a second connection code from the server. If the second device does not receive the second connection code, it displays the first connection code; if the second device receives the second connection code, it displays the second connection code. When a user subsequently inputs either the first or second connection code into the first device, the first device can send a connection request to the second device via a local area network (LAN) or a wide area network (WAN), enabling the second device to connect with the first device. In this embodiment, the second device only needs to display one connection code to allow the first device to connect to the second device via a LAN or WAN, thus ensuring compatibility with both LAN and WAN network environments. Furthermore, the user only needs to obtain one connection code during use, eliminating the need to obtain different connection codes for repeated connection operations. Since the connection operation performed by the user on the first device is the same regardless of whether the first or second connection code is displayed, the user does not need to learn different operations for different connection codes, reducing the user's learning and operational costs.

[0073] like Figure 5 As shown, Figure 5 A flowchart illustrating another device connection method applied to a second device 20 according to an embodiment of the present invention includes the following steps:

[0074] Step 201: Generate a first connection code based on the device information, and send a request for a second connection code and the first connection code to the server so that the server can associate and save the first connection code and the second connection code. The first connection code is used as at least one of the verification code and address code of the local area network, and the second connection code is used as the verification code of the wide area network.

[0075] Step 202: Receive the second connection code returned by the server.

[0076] In this embodiment, after the server 30 receives the request for a second connection code sent by the second device 20, the server 30 generates a second connection code, associates and saves the second connection code with the first connection code, and then sends the second connection code to the second device 20, so that the second device 20 receives the second connection code returned by the server 30.

[0077] Step 203: Display the second connection code to receive a connection request sent by the first device via a local area network or a wide area network. The connection request is generated by the first device based on the first connection code or the second connection code.

[0078] After receiving the second connection code, the second device 20 displays the second connection code, allowing the user to input it into the first device 10. Upon receiving the input second connection code, the first device 10 sends a connection request via a local area network (LAN) or a wide area network (WAN). The connection request is generated by the first device 10 based on either the first or second connection code. Specifically, in one embodiment, after the second device 20 displays the second connection code, the user inputs the displayed second connection code into the first device 10. The first device 10 parses the input connection code. After determining that the second connection code is a WAN connection code, it retrieves the first connection code associated with the second connection code from the server 30. Then, it generates a first connection request based on the first connection code and sends it to the second device 20 via the LAN. If the first device 10 fails to connect to the second device 20 via the LAN, it further generates a second connection request based on the second connection code and sends it to the second device 20 via the WAN to establish a connection with the second device 20 via the WAN.

[0079] Step 204: In response to the connection request, connect to the first device via a local area network or a wide area network.

[0080] As described above, after generating the first connection code, the second device uploads the first connection code to the server and sends a request to the server for a second connection code. After receiving the second connection code returned by the server, the second device displays the second connection code, so that when a user enters the second connection code on the first device, the first device can obtain the first connection code associated with the second connection code from the server, thereby connecting to the second device via a local area network (LAN) or a wide area network (WAN). The second connection code is compatible with both LAN and WAN network environments. During use, the user only needs to enter the second connection code into the first device. In different network environments, the connection operation performed by the user on the first device is the same, and the user does not need to learn different operations according to the network environment, reducing the user's learning and operation costs.

[0081] It should be further noted that, in this embodiment, the second connection code is a connection code that includes at least six characters.

[0082] In this embodiment, the second connection code is the same as the first connection code, both defaulting to a six-character connection code, thus having a 30-bit binary encoding space. However, the second connection code can be extended to seven or more characters depending on the actual situation. For example, if the IPv4 address of the first device 10 is special and does not belong to a Class A, Class B, or Class C private segment address (i.e., the IP address is not in 10.0.0.0~10.255.255.255, 172.16.0.0~172.31.255.255, or 192.168.0.0~192.168.255.255), but is a public IP address (commonly found among overseas users, such as 202.102.34.128), then the aforementioned six-digit and letter combination of the second connection code cannot be used. In this case, the second connection code can be extended to an eight-digit and letter combination, at which point the encoding space of the second connection code is 32. 8 =2 40 That is, the second linker has a 40-bit binary encoding space, which is an expansion of the encoding space compared to the second linker consisting of six characters, and can encode IPv4 addresses worldwide.

[0083] Based on the above embodiments, the second connection code includes a type bit, a check bit, and a random bit. The type bit is used to store the type of the local area network IP segment. The type of the local area network IP segment is related to the bit length of the check bit. The check bit is used to store the data verification result, and the data verification result is not equal to the verification result of at least one data in the random bit. The random bit is used to store a random number.

[0084] In the first connection code, regardless of whether the LAN IP segment is a Class A, Class B, or Class C private segment address, the data in the check bit must equal the check result of a specific data point, which is either part or all of the remaining data in the first connection code. If the check bit does not equal the check result of the specific data point, then the 30-bit binary encoding space has not been used. Therefore, the 30-bit binary encoding space where the check bit does not equal the check result of the specific data point can be used as the second connection code. Specifically, the second connection code includes a type bit, a check bit, and a random bit. The type bit stores the type of the LAN IP segment, and the type of the LAN IP segment is related to the length of the check bit. That is, when the LAN IP segment is a Class A private segment address, the check bit is bits 27-26; when the LAN IP segment is a Class B private segment address, the check bit is bits 27-25; and when the LAN IP segment is a Class C private segment address or a reserved extension segment, the check bit is bits 27-22. The random bits in the second connection code are used to store random numbers, which are randomly generated by the server. Specifically, when the second connection code is a Class A private segment address, the random bits are bits 25-0, meaning the port and IP address information are filled with random numbers; when the second connection code is a Class B private segment address, the random bits are bits 24-0, meaning the change bits, port, and IP address information are filled with random numbers; when the second connection code is a Class C private segment address, the random bits are bits 21-0, meaning the change bits, port, and IP address information are filled with random numbers; when the second connection code is a reserved extension segment, the 30-bit binary encoding space of the second connection code is shown in Table 5, with the random bits being bits 21-0, meaning the reserved bits are filled with random numbers.

[0085] Table 5

[0086] meaning Type bit Check bit Reserved bits

[0087] As described above, the 30-bit binary encoding space of the second connection code has four possibilities. However, regardless of the possibility, the data verification result in the check bit of the second connection code is not equal to the verification result of at least one data in the random bits, thus distinguishing the first connection code from the second connection code. When the first device subsequently receives the connection code, it can determine whether the received connection code is the first connection code or the second connection code based on the data verification result of the check bit in the first connection code. Furthermore, the above encoding method for the second connection code also allows for a wide range of variations. Specifically, for different types of local area network IP segments, the following situations apply:

[0088] Class A private segment address: Random bits vary within the binary range [0-25], then multiplied by three possible check failure scenarios, resulting in: 2 26 ×(22-1 =201326492, approximately 200 million.

[0089] Class B private segment address: The random bits vary within the binary range [0-24], then multiplied by 7 possible check failures, resulting in: 2 25 ×(2 3-1 =234,881,024, approximately 230 million.

[0090] Class C private segment address: Random bits vary within the binary range [0-21], then multiplied by 63 possible check failures, resulting in: 2 22 ×(2 6-1 =264,241,152, approximately 260 million.

[0091] Reserved extension segment: The random bits are calculated by multiplying the range of binary bits [0-21] by 63 possible check failures, resulting in 2. 22 ×(2 6-1 =264,241,152, approximately 260 million.

[0092] That is, the second connection code has a total of 965 million possible variations. Even if one million devices are online, it will only occupy one-thousandth of the total, which can meet the actual use needs.

[0093] As described above, this embodiment of the invention expands the encoding space of the first connection code where the check bit is not equal to the check result of the specific data into a second connection code. This allows the second connection code to have a larger range of variation during the server's generation process, ensuring its uniqueness and thus avoiding security issues caused by unintentional or malicious brute-force attacks. Secondly, the second connection code and the first connection code are presented in a unified format, both using characters, and both require a minimum of six bits, simplifying user input, facilitating user operation, and improving the user experience.

[0094] like Figure 6 As shown, Figure 6 A device connection method for a first device 10 provided in an embodiment of the present invention includes the following steps:

[0095] Step 301: Receive a first connection code or a second connection code. The first connection code is used as at least one of a local area network (LAN) verification code and an address code, and the second connection code is used as a WAN verification code.

[0096] When the second device 20 displays either the first or second connection code, the user inputs the first or second connection code from the second device 20 into the first device. For example, the first device 10 has a software application installed for device connection. After the user opens the software application, the software interface prompts the user to enter a connection code; for instance, the first device 10 displays an input box on its screen for the user to enter the connection code. When the second device 20 displays the second connection code, the user enters the second connection code in the software interface of the first device 10; when the second device 20 displays the first connection code, the user enters the first connection code in the software interface of the first device 10.

[0097] Step 302: When the second connection code is received, request the server to receive the first connection code associated with the second connection code.

[0098] After receiving the connection code, the first device 10 first determines whether it is a first connection code or a second connection code. Specifically, after receiving the connection code, the first device 10 first obtains the type bit of the connection code to determine the type of the local area network IP segment corresponding to the connection code. Then, based on the correlation between the type of the local area network IP segment and the length of the check bit, it confirms the length of the check bit, thereby obtaining the check result from the check bit. Then, it further determines whether the check result is equal to the check result of at least one of the remaining bits. If so, the connection code is a first connection code; otherwise, the connection code is a second connection code. For example, in one embodiment, the first device 10 first obtains bits 29-28 of the connection code, i.e., the type bits of the connection code, to determine the type of the local area network IP segment corresponding to the connection code. When bits 29-28 of the connection code are 00, the type of the local area network IP segment corresponding to the connection code is a Class A private segment address. Then, it obtains bits 27-26 of the connection code, i.e., the check bits, and determines whether the data check result of the check bits is equal to the check result of at least one of the remaining bits. If yes, the connection code is a first connection code; otherwise, the connection code is a second connection code. Other cases are similar, and the specific process is as follows: Figure 7 As shown, further details will not be elaborated upon in this embodiment.

[0099] In this embodiment, when the first device 10 confirms that the received connection code is the second connection code, it accesses the server 30 and sends a request to the server 30 to receive the first connection code associated with the second connection code. After receiving the request, the server 30 queries the associated first connection code based on the second connection code and sends the first connection code to the first device 10. For example, in one embodiment, after receiving the second connection code, the first device 10 sends a request to the server 30 to query information about the second device based on the second connection code. After receiving the request, the server 30 queries the information about the second device based on the second connection code, thereby obtaining the first connection code associated with the second connection code, and sends the first connection code to the first device 10.

[0100] Step 303: Based on the first connection code, send the first connection request to the second device via the local area network.

[0101] After receiving the first connection code, the first device 10 parses the authentication information and IP address information of the second device 20 from the first connection code, generates a first connection request based on the authentication information and IP address information, and sends the first connection request to the second device 20 through the local area network to establish a connection with the second device 20 through the local area network.

[0102] Step 304: When the first connection code is received and the connection establishment corresponding to the first connection request fails, request the server to receive the second connection code associated with the first connection code.

[0103] If the user enters a connection code in the first device 10, and the first device 10 determines that the connection code is the first connection code, it generates a first connection request based on the first connection code and sends the first connection request to the second device 20 via the local area network (LAN) to establish a connection with the second device 20. If the connection between the first device 10 and the second device 20 fails via the LAN, the first device 10 further sends a second connection code associated with the first connection code to the server 30. The process of the first device 10 requesting the second connection code is similar to the process of requesting the first connection code; the specific process can be referred to step 303, and will not be described in detail in this embodiment.

[0104] Step 305: After confirming that the connection establishment corresponding to the first connection request has failed, send a second connection request to the second device through the wide area network according to the second connection code.

[0105] In step 304 or step 305, after the first device 10 sends a first connection request to the second device 20 via the local area network, if the connection between the first device 10 and the second device 20 fails to be established via the local area network, the first device 10 confirms that the connection establishment corresponding to the first connection request has failed, further parses the verification information from the second connection code, generates a second connection request based on the verification information, and sends the second connection request to the second device 20 via the wide area network to establish a connection with the second device 20 via the wide area network.

[0106] For example, in such Figure 4 In the scenario shown, the second device 20 displays a "Create Screen Casting" button on the screen. The user clicks the "Create Screen Casting" button to send a command to the second device 20 to create a screen casting, or the user selects the "Create Screen Casting" button using a remote control or other device to send a command to the second device 20 to create a screen casting. When the second device 20 detects that the "Create Screen Casting" button has been clicked or selected, the second device 20 begins to acquire its own device information and generates a first connection code C58JBS based on the device information. At the same time, the second device 20 sends a request to the server 30 to request a second connection code. After receiving the request, the server 30 generates a second connection code DXD5AG and associates and saves the first connection code C58JBS and the second connection code DXD5AG.

[0107] In one embodiment, such as Figure 8 As shown, if server 30 returns the second connection code DXD5AG to second device 20, second device 20 displays the second connection code DXD5AG on its screen. Then, the user opens the software application on first device 10 used for device connection and enters the connection code DXD5AG in the connection code input box of the software application. Afterwards, the software application of second device 20 analyzes the connection code DXD5AG to determine its type. After determining that DXD5AG is the second connection code, second device 20 accesses server 30 and requests server 30 to receive the first connection code C58JBS associated with the second connection code DXD5AG. Then, server 30 sends the first connection code C58JBS to first device 10. The software application of first device 10 then generates a first connection request based on the first connection code C58JBS and sends the first connection request to second device 20 through the local area network. If the connection between the first device 10 and the second device 20 fails via the local area network, the first device 10 generates a second connection request based on the second connection code DXD5AG and sends the second connection request to the second device 20 via the wide area network, thereby establishing a connection between the first device 10 and the second device 20 via the wide area network.

[0108] In another embodiment, such as Figure 9As shown, if server 30 does not return the second connection code DXD5AG to second device 20, then second device 20 displays the first connection code C58JBS. Afterwards, the user opens the software application on first device 10 and enters the connection code C58JBS in the connection code input box of the software application. Then, the software application of second device 20 analyzes the connection code C58JBS to determine its type. After determining that C58JBS is the first connection code, the software application of first device 10 generates a first connection request based on the first connection code C58JBS and sends the first connection request to second device 20 through the local area network. If the connection between the first device 10 and the second device 20 fails via the local area network, the second device 20 accesses the server 30 and requests the server 30 to receive the second connection code DXD5AG associated with the first connection code C58JBS. Then, the server 30 sends the second connection code DXD5AG to the first device 10. The first device 10 generates a second connection request based on the second connection code DXD5AG and sends the second connection request to the second device 20 via the wide area network, thereby establishing a connection between the second device 20 and the wide area network.

[0109] After the first device 10 and the second device 20 are connected via a wide area network or a local area network, screen mirroring can be performed between the first device 10 and the second device 20. For example, the first device 10 sends video data including the picture currently displayed on the screen and audio data including the sound being played to the second device 20 via a local area network or a wide area network. After receiving the video data and audio data, the second device 20 decodes the video data and audio data and displays the corresponding picture and plays the corresponding sound on the screen.

[0110] In the above-described embodiment of the invention, after receiving the connection code input by the user, the first device first determines the type of the connection code. If the connection code input by the user is a first connection code, it connects to the second device via a local area network (LAN). If the connection fails, it further obtains a second connection code associated with the first connection code from the server and connects to the second device via a wide area network (WAN). Conversely, if the connection code input by the user is a second connection code, it obtains a first connection code associated with the second connection code from the server and first connects to the second device via a LAN. If the connection fails, it further connects to the second device via a WAN. In this embodiment of the invention, after receiving either the first or second connection code, the first device can connect to the server via either a LAN or a WAN, thus ensuring compatibility with both LAN and WAN network environments. Furthermore, when the first device cannot connect to the second device via a LAN, it can automatically switch to connecting via a WAN, avoiding connection failures due to the first device's inability to connect to the LAN, thus significantly improving the connection success rate. In addition, considering that LAN has high bandwidth, low latency, and does not require internet traffic fees, the first device will prioritize connecting to the second device via LAN when it receives either the first or second connection code. Only when the LAN connection fails will it switch to WAN connection, thereby improving the security of information exchange and avoiding unnecessary traffic costs.

[0111] In another embodiment, when the first device 10 and the second device 20 are only connected to a local area network (LAN) and not to a wide area network (WAN), the connection process of the first device 10 and the second device 20 is as follows: Figure 10 As shown. After generating the first LAN connection code C58JBS, the second device 20 checks whether it is connected to the WAN. If not, the second device 20 displays the first connection code C58JBS on the screen. Then, the user opens the software application on the first device 10 used for device connection and enters the connection code C58JBS in the connection code input box. The software application on the second device 20 then analyzes the connection code C58JBS to determine its type. After confirming that C58JBS is the first connection code, the software application on the first device 10 generates a first connection request based on the first connection code C58JBS and sends the first connection request to the second device 20 via the LAN. After the first device 10 and the second device 20 successfully connect via the LAN, subsequent screen mirroring operations can be performed.

[0112] In one embodiment, the second connection code is associated with business information.

[0113] Business information refers to information that includes business functions and business data. In this embodiment, since the WAN connection code is only used as a verification code and does not have business attributes, therefore, in one embodiment,

[0114] The second device 20 can also upload business information to the server 30, thereby enabling the server 30 to associate the business information with the second connection code. This allows the first device 10 to execute the corresponding business function upon receiving the second connection code and successfully connecting with the second device 20. In one embodiment, the second connection code can be associated with multiple pieces of business information, allowing the first device 10 to implement different business functions after inputting the second connection code, thus unifying all scalable business functions through a single second connection code.

[0115] Correspondingly, it also includes:

[0116] After confirming that the second connection code has been received and the connection corresponding to the first or second connection request has been successfully established, execute the business action corresponding to the business information.

[0117] In one embodiment, after the first device 10 receives the second connection code and successfully connects to the second device 20 via a local area network (LAN) or wide area network (WAN), the first device 10 further performs a business action corresponding to the business information associated with the second connection code. A business action refers to the operation and means used to perform a business function. For example, in one embodiment, the second device 20 requests the second connection code DXD5AG from the server 30, and simultaneously runs video conferencing software on the second device 20. Video conferencing software refers to software used to establish connections between devices and to transmit images captured by the camera and audio recorded by the microphone on the device. When the room number of the video conference is 1234567890, this room number can be uploaded to server 30 as business data as the business information of the second connection code DXD5AG. Server 30 associates the second connection code DXD5AG with the room number 1234567890. Then, when the user enters the second connection code DXD5AG in the video conferencing sub-function interface of the video conferencing software on the first device 10, the second device 20 connects to the first device 10 through the wide area network. At the same time, the first device 10 accesses server 30 and obtains the room number associated with the second connection code DXD5AG from server 30. The video conferencing software on the first device 10 can then directly join the video conference in that room. In one embodiment, in addition to video conferencing, business information such as screen interaction or remote assistance can also be associated with the second connection code. This allows the user to enter the second connection code DXD5AG on other sub-function interfaces of the video conferencing software on the first device 10, thereby enabling the corresponding screen interaction or remote assistance functions. Screen interaction refers to the function of controlling the screen displayed on the other device between two interconnected devices; remote assistance refers to the function of controlling the other device between two interconnected devices.

[0118] As described above, the embodiments of the present invention associate the second connection code with service information, so that after the first device receives the second connection code and successfully connects with the first device, it can perform service actions associated with the service information. During this process, the user does not need to perform any additional operations, which expands the function of the connection code and improves the user experience.

[0119] like Figure 11 As shown, Figure 11 A device connection apparatus provided in an embodiment of the present invention includes: a connection code generation module 401, a connection code display module 402, and a connection response module 403;

[0120] The connection code generation module 401 is used to generate a first connection code based on device information, send a request for a second connection code and the first connection code to the server, so that the server can associate and save the first connection code and the second connection code. The first connection code is used as at least one of the verification code and address code of the local area network, and the second connection code is used as the verification code of the wide area network.

[0121] The connection code display module 402 is used to display a first connection code or a second connection code to receive a connection request sent by the first device through a local area network or a wide area network. The connection request is generated by the first device based on the first connection code or the second connection code.

[0122] The connection response module 403 is used to respond to a connection request and connect to the first device via a local area network or a wide area network.

[0123] Based on the above embodiments, a connection code receiving module is also included. The connection code receiving module is used to receive the second connection code returned by the server after generating a first connection code according to the device information, sending a request for a second connection code and the first connection code to the server.

[0124] Accordingly, the connection code display module 402 is used to display the first connection code or the second connection code, specifically:

[0125] Used to display the second connection code.

[0126] Based on the above embodiments, the second connection code is a connection code that includes at least six characters.

[0127] Based on the above embodiments, the second connection code includes a type bit, a check bit, and a random bit. The type bit is used to store the type of the local area network IP segment. The type of the local area network IP segment is related to the bit length of the check bit. The check bit is used to store the data verification result, and the data verification result is not equal to the verification result of at least one data in the random bit. The random bit is used to store a random number.

[0128] like Figure 12 As shown, Figure 12 A device connection apparatus provided in an embodiment of the present invention includes a connection code receiving module 404, a first connection code request module 405, a first connection request module 406, a second connection code request module 407, and a second connection request module 408.

[0129] The connection code receiving module 404 is used to receive a first connection code or a second connection code. The first connection code is used as at least one of a local area network (LAN) verification code and an address code, and the second connection code is used as a WAN verification code.

[0130] The first connection code request module 405 is used to request the server to receive the first connection code associated with the second connection code when the received connection code is the second connection code.

[0131] The first connection request module 406 is used to send a first connection request to the second device via the local area network according to the first connection code;

[0132] The second connection code request module 407 is used to request the server to receive the second connection code associated with the first connection code when the first connection code is received and the connection establishment corresponding to the first connection request fails.

[0133] The second connection request module 408 is used to send a second connection request to the second device via the wide area network after confirming that the connection establishment corresponding to the first connection request has failed, based on the second connection code.

[0134] The device connection apparatus provided above can be used to execute the device connection method provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0135] It is worth noting that in the embodiments of the above-mentioned device connection device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.

[0136] Figure 13 This is a schematic diagram of the structure of a device connection device provided in one embodiment of this application, such as... Figure 13 As shown, the device connection device includes a processor 500, a memory 501, an input device 502, and an output device 503; the number of processors 500 in the device connection device can be one or more. Figure 13 Taking a processor 500 as an example; the processor 500, memory 501, input device 502, and output device 503 in the device connection can be connected via a bus or other means. Figure 13 Taking the example of a connection between China and Israel via a bus.

[0137] The memory 501, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the device connection method in this embodiment (e.g., the connection code generation module 401, connection code display module 402, and connection response module 403 in the device connection device). The processor 500 executes various functional applications and data processing of the device connection device by running the software programs, instructions, and modules stored in the memory 501, thereby implementing the device connection method described above.

[0138] Memory 501 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on the use of the connected device. Furthermore, memory 501 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, memory 501 may further include memory remotely located relative to processor 500, which can be connected to the connected device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0139] Input device 502 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the connected device. Output device 503 may include a display device such as a screen. In addition, the connected device may also include a communication device to enable communication with external devices (such as cameras).

[0140] The aforementioned device connection equipment includes corresponding device connection apparatus, which can be used to execute any device connection method and has corresponding functions and beneficial effects.

[0141] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and equipment can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0142] Furthermore, embodiments of this application also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform relevant operations in the device connection method provided in any embodiment of this application, and have corresponding functions and beneficial effects.

[0143] Those skilled in the art will understand that embodiments of this application may be provided as methods, systems, or computer program products.

[0144] Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce implementations of the flowchart... Figure 1 One or more processes and / or boxes Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0145] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0146] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0147] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0148] Note that the above are merely preferred embodiments and the technical principles applied in this invention. Those skilled in the art will understand that the embodiments of this invention are not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the protection scope of this invention. Therefore, although the embodiments of this invention have been described in detail above, the embodiments of this invention are not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of the embodiments of this invention, and the scope of the embodiments of this invention is determined by the scope of the appended claims.

Claims

1. A device connection method for a second device, characterized in that, include: A first connection code is generated based on the device information, and a request for a second connection code is sent to the server along with the first connection code, so that the server can associate and store the first connection code and the second connection code. The first connection code is used as at least one of a local area network verification code and an address code, and the second connection code is used as a wide area network verification code. Display the first connection code or the second connection code to receive a connection request sent by the first device through a local area network or a wide area network, wherein the connection request is generated by the first device based on the first connection code or the second connection code; The first device obtains a first connection code associated with the second connection code from the server based on the second connection code, and sends a first connection request to the second device through the local area network based on the obtained first connection code. If the first device fails to connect to the second device through the local area network, the first device generates a second connection request based on the second connection code and sends the second connection request to the second device through the wide area network to establish a connection with the second device through the wide area network. In response to the connection request, connect to the first device via the local area network or the wide area network; The process of generating a first connection code based on device information, sending a request for a second connection code and the first connection code to the server, further includes: Receive the second connection code returned by the server; The display of the first connection code or the second connection code specifically refers to: Display the second connection code.

2. The device connection method according to claim 1, characterized in that, The second connection code is a connection code that includes at least six characters.

3. The device connection method according to claim 2, characterized in that, The second connection code includes a type bit, a check bit, and a random bit. The type bit is used to store the type of the local area network IP segment. The type of the local area network IP segment is related to the bit length of the check bit. The check bit is used to store the data verification result, and the data verification result is not equal to the verification result of at least one data in the random bit. The random bit is used to store a random number.

4. A device connection method, applied to a first device, characterized in that, include: Receive a first connection code or a second connection code, wherein the first connection code is used as at least one of a verification code and an address code for a local area network, and the second connection code is used as a verification code for a wide area network. When the second connection code is received, request the server to receive the first connection code associated with the second connection code; Based on the first connection code, a first connection request is sent to the second device via the local area network; When the first connection code is received and the connection establishment corresponding to the first connection request fails, the server is requested to receive the second connection code associated with the first connection code. After confirming that the connection establishment corresponding to the first connection request has failed, a second connection request is sent to the second device through the wide area network according to the second connection code.

5. The device connection method according to claim 4, characterized in that, The second connection code is associated with business information; Correspondingly, it also includes: After confirming that the second connection code has been received and the connection corresponding to the first connection request or the second connection request has been successfully established, the business action corresponding to the business information is executed.

6. A device connection apparatus, applied to a second device, characterized in that, include: The module includes a connection code generation module, a connection code display module, a connection response module, and a connection code receiving module. The connection code generation module is used to generate a first connection code based on device information, and send a request for a second connection code and the first connection code to the server, so that the server can associate and store the first connection code and the second connection code. The first connection code is used as at least one of the verification code and address code of the local area network, and the second connection code is used as the verification code of the wide area network. The connection code display module is used to display the first connection code or the second connection code to receive a connection request sent by the first device through a local area network or a wide area network. The connection request is generated by the first device based on the first connection code or the second connection code. The first device obtains a first connection code associated with the second connection code from the server based on the second connection code, and sends a first connection request to the second device through the local area network based on the obtained first connection code. If the first device fails to connect to the second device through the local area network, the first device generates a second connection request based on the second connection code and sends the second connection request to the second device through the wide area network to establish a connection with the second device through the wide area network. The connection response module is used to respond to the connection request and connect to the first device through the local area network or the wide area network; The connection code receiving module is used to receive the second connection code returned by the server; Correspondingly, the connection code display module is used to display the second connection code.

7. A device connection apparatus, applied to a first device, characterized in that, It includes a connection code receiving module, a first connection code request module, a first connection request module, a second connection code request module, and a second connection request module; The connection code receiving module is used to receive a first connection code or a second connection code, wherein the first connection code is used as at least one of a local area network (LAN) verification code and an address code, and the second connection code is used as a wide area network (WAN) verification code. The first connection code request module is used to request the server to receive the first connection code associated with the second connection code when the received connection code is the second connection code; The first connection request module is used to send a first connection request to the second device through the local area network based on the first connection code; The second connection code request module is used to request the server to receive a second connection code associated with the first connection code when the received connection code is the first connection code and the connection establishment corresponding to the first connection request fails. The second connection request module is used to send a second connection request to the second device through the wide area network according to the second connection code after confirming that the connection establishment corresponding to the first connection request has failed.

8. A device connection device, characterized in that, The device connection includes a processor and a memory; The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to execute a device connection method as described in any one of claims 1-5 according to instructions in the computer program.

9. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform a device connection method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Service finding method, device and system, storage medium and computer equipment

    CN107332912A

  • Projection screen connection method, device and system and electronic equipment

    CN111669424A