Device connection method, terminal device and distributed system
By including hidden mode requests in the handshake message between terminal devices, the problem of users needing to manually hide files is solved, and secure access and normal use between devices is achieved.
Patent Information
- Application Number
- CN202110282770.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-16
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-03-16
AI Technical Summary
In multiple terminal device networking scenarios, users need to manually operate hidden files or transfer files to prevent access from other devices, affecting the user experience and may affect the normal use of the application.
By sending a handshake message containing a hidden mode request when establishing a connection between devices, one party allows one party to access the other party's files without being accessed, a hidden mode network connection is realized.
It realizes that a terminal device can access files of other devices normally during the networking process, and at the same time restrict other devices from accessing their files, improving the user experience.
Smart Images

Figure CN115087137B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a device connection method, a terminal device, and a distributed system. Background Art
[0002] With the development of terminal technology, multiple terminal devices can now be networked to access files in each other's devices.
[0003] In a networking scenario with multiple terminal devices, some users do not want other devices to access files on their terminal devices due to confidentiality requirements, or temporarily do not want other devices to access files on their terminal devices. For example, after terminal device A and terminal device B are networked, the user wants terminal device A to be able to access files on terminal device B, but does not want terminal device A's files to be accessed by terminal device B.
[0004] In this case, the user needs to operate terminal device A in advance before terminal device A is networked, and perform some specific operations on files that do not want to be accessed by terminal device B, such as setting file attributes to hidden, moving to a specific hidden folder, or transferring files that need to be hidden before networking, etc. These operations bring great inconvenience to the user and affect the user's usage experience. After the file is hidden by the user, it may also affect the normal access of the application in the subsequent terminal device A and affect the normal use of the application. Summary of the Invention
[0005] The embodiments of the present application provide a device connection method, a terminal device, and a distributed system to realize that in a networking scenario of multiple terminal devices, a terminal device can not only normally access files in other devices, but also simultaneously restrict other devices from accessing files on the terminal device, thereby improving the user experience.
[0006] In a first aspect, an embodiment of the present application provides a device connection method, the method comprising: a first device sends a first request message to a second device, the first request message including a first field, the first field being used by the first device to request that a connection be established with the second device in a first mode, the first mode including restricting the second device from accessing files of the first device; upon receiving a first response message, the first device establishes a connection with the second device in the first mode, the first response message being sent when the second device agrees to establish a connection in the first mode.
[0007] In one implementation, restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of the files of the first device.
[0008] In one implementation, after the first device establishes a connection with the second device in the first mode, the method further includes: the first device receiving first metadata sent by the second device, where the first metadata is used for the first device to access files of the second device.
[0009] In one implementation, after the first device establishes a connection with the second device in the first mode, the method further includes: the first device sends second metadata to the second device, where the second metadata is used for the second device to access a specific type of file on the first device.
[0010] In one implementation, after the first device establishes a connection with the second device in the first mode, the method further includes: the first device updates the information of the second device to its own online device list.
[0011] In one implementation, the first request message is a handshake request message.
[0012] In one implementation, the first response message is a handshake agreement message.
[0013] In one implementation, the first response message includes a second field, and the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
[0014] In second aspect, an embodiment of the present application provides a device connection method, the method comprising: a second device receives a first request message sent by a first device, the first request message comprising a first field, the first field being used by the first device to request that a connection be established with the second device in a first mode, the first mode comprising restricting the second device from accessing files of the first device; if the second device agrees to establish a connection in the first mode, it sends a first response message to the first device to instruct the first device to establish a connection with the second device in the first mode.
[0015] In one implementation, restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of the files of the first device.
[0016] In one implementation, after the second device sends the first response message to the first device, the method further includes: the second device sends first metadata to the first device, where the first metadata is used for the first device to access files on the second device.
[0017] In one implementation, after the second device sends the first response message to the first device, the method further includes: the second device receives second metadata sent by the first device, where the second metadata is used for the second device to access a specific type of file on the first device.
[0018] In one implementation, after the second device sends the first response message to the first device, the second device further updates the information of the first device into its own online device list.
[0019] In one implementation, the first request message is a handshake request message.
[0020] In one implementation, the first response message is a handshake agreement message.
[0021] In one implementation, the first response message includes a second field, and the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
[0022] In one implementation, if the second device disagrees to establish a connection in the first mode, it sends a first rejection message to the first device.
[0023] In a third aspect, an embodiment of the present application provides a terminal device, which includes a processor and a memory, a transceiver, a memory and a processor; wherein the memory includes program instructions, and when the program instructions are executed by the processor, the terminal device is used to execute the first aspect and its various implementation methods and / or the second aspect and its various implementation methods.
[0024] In a fourth aspect, embodiments of the present application provide a distributed system comprising multiple terminal devices. Each terminal device can function as a first terminal device and / or a second terminal device; when the terminal device functions as a first terminal device, it is configured to execute the method of the first aspect and its respective implementations performed by the first terminal device; and when the terminal device functions as a second terminal device, it is configured to execute the method of the second aspect and its respective implementations performed by the second terminal device.
[0025] In a fifth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned aspects and methods of each implementation thereof.
[0026] In a sixth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the above-mentioned aspects and methods of their respective implementations.
[0027] In the seventh aspect, an embodiment of the present application also provides a chip system, which includes a processor for supporting the above-mentioned device or system to implement the functions involved in the above-mentioned aspects, for example, generating or processing the information involved in the above-mentioned method.
[0028] According to the technical solution provided by the embodiments of the present application, when a first device establishes a network connection with a second device, it sends a request message containing a specific field identifier to the second device. After receiving the field identifier, if the second device allows the first device to establish a network connection in hidden mode, it sends a response message to the first device to establish the connection. In this way, the first device can access files on the second device, but the second device is not allowed to access files on the first device, thus achieving the goal of hiding the files of the first device from the second device. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 This is a schematic diagram of the current multi-terminal device networking scenario;
[0030] Figure 2 This is a schematic diagram of the hardware structure of the terminal device provided in an embodiment of the present application;
[0031] Figure 3 This is a flow chart of a device connection method provided by an embodiment of the present application;
[0032] Figure 4 This is a schematic diagram of the software modules of the terminal device provided in the embodiment of the present application;
[0033] Figure 5 A schematic diagram showing the implementation of the device connection method provided in an embodiment of the present application at the software module level;
[0034] Figure 6 is a schematic diagram of the interaction of the connection module shown in an embodiment of the present application;
[0035] Figure 7 This is a schematic diagram of a connection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] With the development of terminal technology, multiple terminal devices can now be networked to access files in each other's devices. Figure 1 This is a schematic diagram of the current multi-terminal device networking scenario. Figure 1 As shown, multiple terminal devices 11 can be networked through direct connection or with the help of a wireless access point 12. The available networking here may include, for example, wireless fidelity (Wi-Fi), Wi-Fi Direct, Bluetooth Mesh, etc., which is not limited in this embodiment of the present application.
[0037] Combine Figure 1For example, after terminal device A and terminal device B are networked, terminal device A and terminal device B generally allow each other to access their respective files. That is, terminal device A can access files in terminal device B, and terminal device B can also access files in terminal device A. This greatly facilitates cross-device file operations.
[0038] However, in a networking scenario with multiple terminal devices, some users do not want other devices to access files on their terminal devices due to confidentiality needs, or temporarily do not want other devices to access files on their terminal devices. For example, after terminal device A and terminal device B are networked, the user wants terminal device A to be able to access files on terminal device B, but does not want the files on terminal device A to be accessed by terminal device B. In this case, the user needs to operate terminal device A in advance before terminal device A is networked, and perform some specific operations on the files that they do not want to be accessed by other terminal devices, such as setting file attributes to hidden, moving them to a specific hidden folder, or transferring files that need to be hidden before networking. These operations bring great inconvenience to users and affect their user experience. In addition, after the user performs operations such as hiding files, the normal access of applications in terminal device A may be affected, affecting the normal use of applications.
[0039] In order to realize a networking scenario in which multiple terminal devices are connected, a terminal device A can not only normally access files in other devices B, but also simultaneously restrict other devices B from accessing files in terminal device A, an embodiment of the present application provides a device connection method.
[0040] The device connection method provided in the embodiment of the present application can be applied to Figure 1 The multi-terminal device networking scenario shown can be applied to any terminal device in the networking scenario. The terminal devices provided in the embodiments of the present application include but are not limited to: mobile phones, laptops, tablets, large-screen display devices, virtual / mixed / augmented reality devices, local servers, etc., and the embodiments of the present application do not limit this.
[0041] Figure 2 This is a schematic diagram of the hardware structure of the terminal device provided in the embodiment of the present application. Figure 2 As shown, the terminal device 100 may include a processor 110, a memory 120, a universal serial bus (USB) interface 130, a radio frequency circuit 140, a mobile communication module 150, a wireless communication module 160, a camera 170, a display screen 180, a touch sensor 190, an air pressure sensor 210 and a button 220, etc.
[0042] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated into one or more processors, for example, integrated into a system on a chip (SoC). A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or recycled.
[0043] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0044] The memory 120 can be used to store computer executable program code, which includes instructions. The memory 120 may include a program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 100 (such as audio data, a phone book, etc.). In addition, the memory 120 may include one or more storage units, for example, volatile memory (volatile memory), such as dynamic random access memory (DRAM), static random access memory (SRAM), etc.; it may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, etc. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the memory 120 and / or instructions stored in a memory provided in the processor.
[0045] The wireless communication function of the terminal device 100 can be implemented through the radio frequency circuit 140, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0046] The RF circuit 140 may include at least one antenna 141 for transmitting and receiving electromagnetic wave signals. Each antenna in the terminal device 100 may be used to cover a single or multiple communication frequency bands. In some embodiments, the antenna may be used in conjunction with a tuning switch.
[0047] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 141, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 141. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0048] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (including but not limited to a speaker, a receiver, etc.) or displays an image or video through the display screen 180. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0049] The wireless communication module 160 may include a wireless fidelity (Wi-Fi) module, a Bluetooth (BT) module, a GNSS module, a near field communication (NFC) module, an infrared (IR) module, and the like. The wireless communication module 160 may be one or more devices integrating at least one of the above modules. The wireless communication module 160 receives electromagnetic waves via the antenna 141, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be transmitted from the processor 110, modulate the frequencies of the signals, amplify the signals, and convert them into electromagnetic waves for radiation via the antenna 141.
[0050] In the embodiment of the present application, the wireless communication function of the terminal device 100 may include, for example, global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), fifth generation mobile networks new radio (5G NR), BT, GNSS, WLAN, NFC, FM, and / or IR functions. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0051] The camera 170 is used to capture still images or videos. The camera 170 includes a lens and a photosensitive element. The object generates an optical image through the lens and is projected onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, RYYB or other format. In some embodiments, the terminal device 100 may include 1 or N cameras 170, where N is a positive integer greater than 1.
[0052] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in the terminal device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0053] The display screen 180 is used to display images, videos, etc. The display screen 180 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include one or N display screens 180, where N is a positive integer greater than one.
[0054] The touch sensor 190 is also called a "touch control device." The touch sensor 190 can be provided on the display screen 180. The touch sensor 190 and the display screen 180 form a touch screen, also called a "touch screen." The touch sensor 190 is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided through the display screen 180. In other embodiments, the touch sensor 190 can also be provided on the surface of the terminal device 100, at a location different from that of the display screen 180.
[0055] The air pressure sensor 210 is used to measure air pressure. In some embodiments, the terminal device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 210 to assist in positioning and navigation.
[0056] The buttons 220 include a power button, a volume button, etc. The buttons 220 may be mechanical buttons or touch buttons. The terminal device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 100.
[0057] It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0058] The device connection method provided in the embodiments of the present application provides a hidden mode networking method for device networking scenarios. A terminal device (hereinafter referred to as the first device for ease of description) can choose to use the hidden mode to network with another terminal device (hereinafter referred to as the second device for ease of description). If the first device uses the hidden mode to network with the second device, the first device can access files in the second device, but the second device is not allowed to access files in the first device, that is, the files of the first device are hidden from the second device.
[0059] To achieve this goal, the basic idea of the embodiment of the present application is: when a first device establishes a network connection with a second device, the first device requests the second device through a specific hidden mark field that it wishes to establish a network connection in a hidden mode. If the second device agrees to the first device's request for a network connection in a hidden mode, the first device can establish a network connection with the second device in a hidden mode.
[0060] Figure 3 This is a flow chart of a device connection method provided by an embodiment of the present application. Figure 3 As shown, the first device establishing a network connection with the second device in a hidden mode can be specifically implemented by the following steps:
[0061] Step S101: A first device sends a first request message to a second device, where the first request message includes a first field.
[0062] Among them, the first request message can be, for example, a handshake request message for the first device to establish a network connection with the second device. Depending on the connection protocol, the first request message can be, for example, a transmission control protocol (TCP) handshake request message, a hypertext transfer protocol (HTTP) handshake request message, a hypertext transfer protocol secure (HTTPS) handshake request message, etc. The embodiment of the present application does not limit this.
[0063] Furthermore, the first field may be a hidden flag field additionally configured in the handshake request, and the first field is used by the first device to indicate to the second device that it requests to establish a networking connection with the second device in a hidden mode.
[0064] In the embodiments of the present application, the format of the first field can be determined by pre-negotiation between the first device and the second device, and this embodiment of the present application does not limit this. For example, if the first device and the second device are from the same manufacturer, the agreement regarding the format of the first field can be configured by the manufacturer in the operating system of the device. If the devices are not from the same manufacturer, the networking connection between the first and second devices can also be achieved by installing a specific application, in which case the agreement regarding the format of the first field can be configured in the application.
[0065] For example, the first field may include: HiddenMode = 1. When the value of the first field is 1, it may indicate that the first device requests to establish a network connection with the second device in hidden mode; when the handshake request does not include the first field or the value of the first field is 0, it may indicate that the first device requests to establish a network connection with the second device in "normal mode (i.e., non-hidden mode)".
[0066] Step S102: In response to the first request message, the second device sends a first response message to the first device if the first device is allowed to establish a networking connection in a hidden mode.
[0067] Corresponding to the handshake request message, the first response message may be a handshake approval message. After receiving the first request message, the second device first parses the content of the first request message. If the first field is parsed (for example, HiddenMode = 1), the second device decides whether to allow the first device to connect in hidden mode. If the first device is allowed to connect in hidden mode, the second device sends a first response message to the first device. If the first device is not allowed to connect in hidden mode, the second device sends a first rejection message to the first device. The first rejection message may be a handshake rejection message.
[0068] In one implementation, the second device can decide whether to allow the first device to connect in hidden mode based on its own connection policy, which can be set by the user or by default. For example, the connection policy can include: allowing other devices to connect in hidden mode, and not allowing other devices to connect in hidden mode. In this way, when the second device parses the first field from the first request message, it can first read its own connection policy. If the connection policy allows other devices to connect in hidden mode, it can send a first response message to the first device. If the connection policy does not allow other devices to connect in hidden mode, it can send a first rejection message to the first device.
[0069] In one implementation, the second device itself can maintain a device list, which may include the device identification of one or more terminal devices, where the device identification can be, for example, the device MAC address, device name, device hardware ID, device type, etc., which is not limited in this embodiment of the present application.
[0070] In one implementation, the second device may also decide whether to allow the first device to connect in hidden mode based on its user's operation. For example, the first device generates a dialog box to ask its user whether to allow the first device to connect in hidden mode. If the user allows, the second device sends a first response message to the first device; if the user does not allow, the second device sends a first rejection message to the first device.
[0071] As an example, the device list can be a whitelist or a blacklist. When the device list is a whitelist, the whitelist may include the device identifiers of terminal devices that are allowed to connect in hidden mode. When the device list is a blacklist, the blacklist may include the device identifiers of terminal devices that are not allowed to connect in hidden mode. Then, if the device list is a whitelist, when the second device parses the first field from the first request message, it can match the device identifier of the first device with the device identifier in the whitelist. If the device identifier of the first device exists in the whitelist, a first response message is sent to the first device. If the device identifier of the first device does not exist in the whitelist, a first rejection message is sent to the first device. If the device list is a blacklist, when the second device parses the first field from the first request message, it can match the device identifier of the first device with the device identifier in the blacklist. If the device identifier of the first device does not exist in the blacklist, a first response message is sent to the first device. If the device identifier of the first device exists in the blacklist, a first rejection message is sent to the first device.
[0072] Step S103: The first device establishes a networking connection with the second device in a hidden mode in response to the first response message.
[0073] In a specific implementation, the first device and the second device can both update their respective online device lists after establishing a connection. Specifically, the first device can add the second device's information to the online device list it maintains, and the second device can add the first device's information to the online device list it maintains.
[0074] Furthermore, the second device can synchronize its own metadata to the second device, while the first device does not synchronize its own metadata to the first device. In this way, after receiving the metadata from the second device, the first device can normally access the files on the second device, while the second device cannot access the files on the first device due to the lack of the metadata from the first device, thus achieving the goal of hiding the files on the first device from the second device.
[0075] In one implementation, the first device may hide only a portion of files from the second device in hidden mode, such as only hiding specific folders or files of a specific type. In this case, the first device may also synchronize some metadata with the second device. For example, when the first device hides a specific type of file from the second device, the first device may synchronize metadata corresponding to the file types that are allowed to be accessed to the second device. In this way, after receiving the metadata, the second device can access files of the types that are allowed to be accessed on the first device.
[0076] According to the above technical solution, when a first device establishes a network connection with a second device, it sends a request message containing a specific field identifier to the second device. After receiving the field identifier, if the second device allows the first device to establish a network connection in hidden mode, it sends a response message to the first device to establish the connection. In this way, the first device can access files on the second device, but the second device is not allowed to access files on the first device, thus hiding the files of the first device from the second device.
[0077] In one embodiment, the first device and the second device may implement corresponding functions through one or more software modules.
[0078] Figure 4 Schematic diagram of the software module of the terminal device provided in the embodiment of the present application. Figure 4 As shown, the first device may include, for example, a device management module 13 , a device connection module 14 and a data management module 15 .
[0079] The device management module 13 can be used by the first or second device to implement device discovery and device list management functions. Device discovery can be achieved through periodic multicast messages sent between devices, or through other methods, which are not described in detail in the present embodiment. The device list management function primarily includes maintaining a list of online devices, specifically including a list of online devices corresponding to normal mode connections and a list of online devices corresponding to hidden mode connections. This allows users to establish a list of devices for networking between devices in hidden mode.
[0080] The device connection module 14 can be used for the first device or the second device to implement a handshake connection function between devices, including: interaction and analysis of handshake request messages, handshake approval messages, and handshake rejection messages.
[0081] The data management module 15 can be used by the first device or the second device to synchronize files and metadata between the devices. Specifically, this can include accessing files on the other device and detecting modifications made to files on the first device by other devices. In addition, in a hidden mode connection, the data management module of the first device is also used to restrict file access on the second device.
[0082] based on Figure 4 The software architecture of the first device and the second device is shown, Figure 5 Schematic diagram showing the implementation of the device connection method provided by the embodiment of the present application at the software module level. Figure 5 As shown, the device connection method may specifically include the following steps:
[0083] Step S201: The device management module of the first device and the device management module of the second device execute a device discovery process.
[0084] In a specific implementation, the device management module of the first device and the device management module of the second device may periodically send multicast messages to each other to confirm the existence of each other through the multicast messages, thereby realizing device discovery.
[0085] Step S202: The device management module of the first device instructs the device connection module of the first device to initiate a process of establishing a network connection with the second device in a hidden mode.
[0086] In a specific implementation, after discovering the second device, the device management module of the first device can display the information of the first device and the connection button icon on the display screen of the first device. The connection button icon can, for example, include two options: normal mode and hidden mode. When the user clicks on the hidden mode, the device management module of the first device triggers step S202.
[0087] Step S203: The device connection module of the first device sends a handshake request message to the device connection module of the second device. The first request message includes a hidden flag field.
[0088] Step S204 : The device connection module of the second device decides whether to allow the first device to establish a network connection in the hidden mode in response to the handshake request message.
[0089] In a specific implementation, the device connection module of the second device first parses the handshake request message. If the analysis finds that the handshake request message contains a hidden flag field, it decides whether to allow the first device to establish a network connection in hidden mode based on its own connection strategy.
[0090] Step S2051: If the device connection module of the second device allows the first device to establish a networking connection in the hidden mode, a handshake response message is sent to the connection module of the first device.
[0091] Step S2052: The device connection module of the second device notifies the device management module of the second device to update the online device list.
[0092] Step S2053: The device connection module of the second device notifies the data management module of the second device of a connection success message.
[0093] Step S206 : After receiving the handshake response message, the device connected module of the first device notifies the device management module of the first device of a connection success message.
[0094] Step S207: The device management module of the first device updates the online device list.
[0095] Step S208: The data management module of the second device synchronizes metadata with the data management module of the first device.
[0096] Step S209 : The device management module of the first device notifies the data management module of the first device that the online device list has been updated.
[0097] In this way, the data management module of the first device can access the files in the second device according to the metadata of the second device.
[0098] In step S210 , the data management module of the first device does not synchronize metadata with the data management module of the second device, or only synchronizes metadata of a specific type.
[0099] If the data management module of the first device does not synchronize metadata with the data management module of the second device, the data management module of the second device will not be able to access the files on the first device due to the lack of the metadata of the first device, thereby hiding the files on the first device from the second device. If the data management module of the first device only synchronizes metadata of specific types, the data management module of the second device will only be able to access files of certain types on the first device, thereby hiding some files on the first device from the second device.
[0100] Figure 6 This is a schematic diagram of the interaction of the connection module shown in the embodiment of the present application. Figure 6 As shown, during the process of establishing a network connection between the first device and the second device in a hidden mode, the device connection module of the first device and the device connection module of the second device may perform the following steps:
[0101] Step S301: The device connection module of the first device reads the connection mode.
[0102] The connection mode may include a hidden mode and a normal mode.
[0103] Step S302: If the hidden mode is read, the connection module of the first device encapsulates a handshake message including a hidden flag field.
[0104] Step S303: The connection module of the first device sends a handshake message to the connection module of the second device.
[0105] Step S304: The connection module of the first device parses the handshake message.
[0106] Step S305 : The connection module of the first device reads the hidden flag field and determines that the first device wishes to establish a network connection with the second device in a hidden mode.
[0107] Step S3061: If the first device does not allow hidden mode connection, the connection module of the first device sends a handshake rejection message to the connection module of the first device.
[0108] Step S3062: If the first device allows hidden mode connection, the connection module of the first device sends a handshake consent message to the connection module of the second device.
[0109] Step S307 : The connection module of the first device exchanges handshake confirmation messages with the connection module of the second device.
[0110] At this point, the first device and the second device are formally connected.
[0111] It should be noted here that, according to the technical solution of the embodiment of the present application, each first device can establish a connection with one second device in a hidden mode, or can establish a connection with multiple second devices in a hidden mode, and the embodiment of the present application does not limit this.
[0112] In one embodiment, the first device and the second device may also establish a connection with each other in hidden mode, that is, the two devices do not allow or restrict each other's file access. To achieve this, the second device may also configure a hidden flag field in the handshake agreement message sent to the first device. In this way, during the handshake process between the first and second devices, both devices obtain each other's hidden flag field. Therefore, after the connection is established, neither device may send metadata to the other, or may only send metadata corresponding to certain file types, thereby preventing or restricting each other's file access.
[0113] In the embodiments provided in the present application above, the various schemes of the device connection method provided in the present application are introduced from the perspective of the terminal device itself and from the perspective of interaction between devices. It is understandable that each device, such as the above-mentioned terminal device, includes a hardware structure and / or software module corresponding to the execution of each function in order to realize the above-mentioned functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0114] For example, the above-mentioned terminal device implements corresponding functions through hardware modules.
[0115] In one embodiment, Figure 7 As shown, the connection device for implementing the above-mentioned first device function includes: a processor 410 and a memory 420; wherein the memory 420 includes program instructions, and when the program instructions are executed by the processor 410, the first device is used to perform the following steps: sending a first request message to the second device, the first request message includes a first field, and the first field is used by the first device to request to establish a connection with the second device in a first mode, and the first mode includes restricting the second device from accessing files of the first device; upon receiving a first response message, establishing a connection with the second device in the first mode, and the first response message is sent when the second device agrees to establish a connection in the first mode.
[0116] In one implementation, restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of the files of the first device.
[0117] In one implementation, when the program instructions are executed by the processor 410 , the program instructions further cause the first device to perform the following steps: receiving first metadata sent by the second device, where the first metadata is used by the first device to access files on the second device.
[0118] In one implementation, when the program instructions are executed by the processor 410 , the program instructions further cause the first device to perform the following steps: sending second metadata to the second device, where the second metadata is used by the second device to access a specific type of file on the first device.
[0119] In one implementation, when the program instructions are executed by the processor 410 , the program instructions further enable the first device to perform the following steps: updating the information of the second device into its own online device list.
[0120] In one implementation, the first request message is a handshake request message.
[0121] In one implementation, the first response message is a handshake agreement message.
[0122] In one implementation, the first response message includes a second field, and the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
[0123] In one embodiment, Figure 7 The apparatus is also configured to implement the functions of the aforementioned second device. Specifically, when the program instructions in the memory 420 are executed by the processor 410, the second device is configured to perform the following steps: receiving a first request message sent by the first device, the first request message including a first field, the first field being used by the first device to request that a connection be established with the second device in a first mode, the first mode including restricting the second device from accessing files of the first device; and, if the connection is established in the first mode, sending a first response message to the first device to instruct the first device to establish a connection with the second device in the first mode.
[0124] In one implementation, restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of the files of the first device.
[0125] In one implementation, when the program instructions are executed by the processor 410 , the program instructions further cause the second device to perform the following steps: sending first metadata to the first device, where the first metadata is used for the first device to access files on the second device.
[0126] In one implementation, when the program instructions are executed by the processor 410 , the second device is further configured to perform the following steps: receiving second metadata sent by the first device, where the second metadata is used by the second device to access a specific type of file on the first device.
[0127] In one implementation, when the program instructions are executed by the processor 410 , the second device is further configured to perform the following steps: updating the information of the first device into its own online device list.
[0128] In one implementation, the first request message is a handshake request message.
[0129] In one implementation, the first response message is a handshake agreement message.
[0130] In one implementation, the first response message includes a second field, and the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
[0131] In one implementation, when the program instructions are executed by the processor 410 , the second device is further configured to perform the following steps: if the second device disagrees to establish a connection in the first mode, sending a first rejection message to the first device.
[0132] An embodiment of the present application further provides a computer storage medium, in which computer instructions are stored. When the computer storage medium is run on a computer, the computer is enabled to execute the above-mentioned methods.
[0133] The embodiment of the present application also provides a computer program product containing instructions, which, when executed on a computer, enables the computer to execute the above-mentioned methods.
[0134] The present application also provides a chip system. The chip system includes a processor for supporting the above-mentioned apparatus or device to implement the functions involved in the above aspects, such as generating or processing the information involved in the above-mentioned method. In one possible design, the chip system also includes a memory for storing the necessary program instructions and data for the above-mentioned apparatus or device. The chip system can be composed of a chip or can include a chip and other discrete devices.
[0135] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. A device connection method, characterized in that: include: A first device sends a first request message to a second device, where the first request message includes a first field, where the first field is used by the first device to request to establish a connection with the second device in a first mode, where the first mode includes restricting the second device from accessing files of the first device; The first device establishes a connection with the second device in the first mode when receiving the first response message, where the first response message is sent when the second device agrees to establish the connection in the first mode.
2. The device connection method according to claim 1, characterized in that: The restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of files of the first device.
3. The device connection method according to claim 1, wherein: After the first device establishes a connection with the second device in the first mode, the method further includes: The first device receives first metadata sent by the second device, where the first metadata is used by the first device to access a file on the second device.
4. The device connection method according to claim 2, wherein: After the first device establishes a connection with the second device in the first mode, the method further includes: The first device sends second metadata to the second device, where the second metadata is used for the second device to access a specific type of file of the first device.
5. The device connection method according to claim 1, characterized in that: After the first device establishes a connection with the second device in the first mode, the method further includes: The first device updates the information of the second device to its own online device list.
6. The device connection method according to any one of claims 1 to 5, characterized in that: The first request message is a handshake request message.
7. The device connection method according to any one of claims 1 to 5, characterized in that: The first response message is a handshake agreement message.
8. The device connection method according to any one of claims 1 to 5, characterized in that: Also includes: The first response message includes a second field, where the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
9. A device connection method, characterized in that: include: The second device receives a first request message sent by the first device, where the first request message includes a first field, where the first field is used by the first device to request to establish a connection with the second device in a first mode, where the first mode includes restricting the second device from accessing files of the first device; If the second device agrees to establish a connection in the first mode, it sends a first response message to the first device to instruct the first device to establish a connection with the second device in the first mode.
10. The device connection method according to claim 9, characterized in that: The restricting the second device from accessing files of the first device includes: not allowing the second device to access files of the first device, or allowing the second device to access part of files of the first device.
11. The device connection method according to claim 9, characterized in that: After the second device sends the first response message to the first device, the method further includes: The second device sends first metadata to the first device, where the first metadata is used for the first device to access files of the second device.
12. The device connection method according to claim 10, characterized in that: After the second device sends the first response message to the first device, the method further includes: The second device receives second metadata sent by the first device, where the second metadata is used for the second device to access a specific type of file on the first device.
13. The device connection method according to claim 9, characterized in that: After the second device sends the first response message to the first device, the method further includes: The second device updates the information of the first device to its own online device list.
14. The device connection method according to any one of claims 9 to 13, characterized in that: The first request message is a handshake request message.
15. The device connection method according to any one of claims 9 to 13, characterized in that: The first response message is a handshake agreement message.
16. The device connection method according to any one of claims 9 to 13, characterized in that: Also includes: The first response message includes a second field, where the second field is used for the second device to request to establish a connection with the first device in a second mode, where the second mode includes restricting the first device from accessing files of the second device.
17. The device connection method according to claim 9, characterized in that: Also includes: If the second device disagrees to establish the connection in the first mode, it sends a first rejection message to the first device.
18. A terminal device, characterized in that: It comprises a transceiver, a memory and a processor; wherein the memory includes program instructions, and when the program instructions are executed by the processor, the terminal device is used to execute the method according to any one of claims 1 to 17.
19. A distributed system, characterized in that: It includes multiple terminal devices; wherein each of the terminal devices serves as a first terminal device and / or a second terminal device; when the terminal device serves as the first terminal device, it is used to execute the method executed by the first terminal device according to any one of claims 1 to 8; when the terminal device serves as the second terminal device, it is used to execute the method executed by the second terminal device according to any one of claims 9 to 17.
Citation Information
Patent Citations
Method, apparatus and system for controlling access authority of pickaback plane
CN101330458A
Method and device for setting permission of device management application
CN108664799A