Disclosure of Invention
Embodiments of the present application provide a method, a corresponding apparatus, and a system for accessing a home NAS device, so that a remote terminal can reliably and safely access the home NAS device in a local area network of a home gateway having a WAN interface with an IP address being a public network address or a private network address.
In a first aspect, an embodiment of the present invention provides a method for accessing a home NAS device, where a communication system applied in the method includes the home NAS device, a home gateway, a remote management server, a file proxy server, and a remote terminal. The home NAS device may be a unit built in the home gateway, or may be an independent device located on the LAN side of the home gateway; the home gateway establishes a first connection with the remote management server, wherein the first connection can be a connection based on a TCP/IP protocol, which is established by logging in an account of the remote management server by the home gateway; the remote terminal establishes a second connection with the remote management server, wherein the second connection can be a connection based on a TCP/IP protocol, which is established by logging in an account of the remote management server by the remote terminal; the home gateway establishes a third connection with the file proxy server, and the remote terminal establishes a fourth connection with the file proxy server, where the third connection and the fourth connection may be TCP/IP protocol-based connections. The method for accessing the home NAS device comprises the following steps: the remote terminal sends a directory browsing command to the remote management server through the second connection; the remote management server forwards the directory browsing command to the home gateway through the first connection; the home gateway sends the file directory of the home NAS device to the file proxy server through the third connection according to the directory browsing command; the remote terminal obtains the file directory of the home NAS device from the file proxy server through the fourth connection; and the remote terminal displays the file directory of the home NAS device.
In the technical scheme, the home gateway establishes a first connection with the remote management server, and the remote terminal establishes a second connection with the remote management server, so that the remote terminal can send the directory browsing command to the home gateway through the remote management server. And the home gateway establishes a third connection with the file proxy server, and the remote terminal establishes a fourth connection with the file proxy server, so that the home gateway can respond to the received directory browsing command and send the file directory of the home NAS device to the remote terminal through the file proxy server. The technical scheme is suitable for the situation that the IP address of the WAN of the home gateway is a public network address and the situation that the IP address of the WAN of the home gateway is a private network address, and the application range is wide. Moreover, in the technical scheme, the remote terminal sends the directory browsing command to the home gateway through the existing remote management server for managing the home gateway, so that the implementation mode is simple, the cost is low, and the wide application of the technology that the remote terminal accesses the home NAS device is facilitated. Moreover, the home gateway only sends the directory of the home NAS device to the file proxy server when the remote terminal sends a directory browsing command, and the file of the home NAS device is still only stored in the home NAS device, so that the security is high.
In some possible implementation manners, the remote management server allocates a file proxy server for the home gateway, and then the remote management server sends the address of the file proxy server to the home gateway through a first connection with the home gateway so as to enable the home gateway to establish a third connection with the file proxy server; and the remote management server sends the address of the file proxy server to the remote terminal through a second connection with the remote terminal, so that the remote terminal establishes a fourth connection with the file proxy server.
In some possible implementations, after sending the file directory of the home NAS device to the file proxy server, the home gateway sends a directory sending completion notification to the remote management server through the first connection; and after receiving a directory transmission completion notification sent by the home gateway, the remote management server sends the directory transmission completion notification to the remote terminal through the second connection. In the implementation mode, the remote terminal can timely and accurately know whether the file directory of the home NAS device is successfully uploaded to the file proxy server, so that the remote terminal can timely obtain the file directory from the file proxy server.
In some possible implementation manners, the remote terminal generates a file access command according to a first input operation of a user, where the file access command is used to access a first file in a file directory of the home NAS device; the remote terminal sends the file access command to the remote management server through the second connection; the remote management server sends the file access command to the home gateway through the first connection; the home gateway acquires the first file from the home NAS device according to the file access command, and sends the first file to the file proxy server through the third connection; the remote terminal obtains the first file from the file proxy server over the fourth connection. In the implementation mode, the remote terminal can send the directory browsing command to the home gateway through the remote management server, and the home gateway can respond to the received file access command and send the first file of the home NAS device to the remote terminal through the file proxy server. Because the home gateway only sends the first file which the remote terminal requests to access to the file proxy server, the files of the home gateway except the first file are stored in the home NAS device, the file proxy server cannot cause the leakage of the files which are only stored in the home NAS device due to the fault, and the security is high.
In some possible implementations, the home gateway sends a file sending completion notification to the remote management server through the first connection after sending the first file to the file proxy server; and the remote management server sends the file sending completion notice to the remote terminal through the second connection. In the implementation mode, the remote terminal can timely and accurately know whether the first file of the home NAS device is successfully uploaded to the file proxy server, so that the remote terminal can timely obtain the first file from the file proxy server.
In some possible implementation manners, after the remote terminal obtains the first file from the file proxy server through the fourth connection, the file proxy server deletes the first file stored locally, so that leakage of the first file is avoided, and the security of the file is enhanced.
In some possible implementations, the remote terminal sends a second file to the file proxy server over the fourth connection; after the remote terminal finishes sending the second file to the file proxy server, sending a file uploading notification to the remote management server through the second connection; the remote management server forwards the file uploading notification to the home gateway through the first connection; and the home gateway acquires the second file from the file proxy server through the third connection according to the file uploading notification, and stores the second file in the home NAS device. In the implementation mode, the remote terminal can store the second file in the home NAS device by combining the remote management server and the file proxy server, so that a user can conveniently store the file remotely.
In some possible implementations, the remote terminal can generate a file management command according to a second input operation of the user, where the file management command may be a delete file command, a move file command, and a rename file command; the remote terminal sends the file management command to the remote management server through the second connection; the remote management server forwards the file management command to the home gateway through the first connection; and the home gateway performs management operation corresponding to the file management command on the file in the home NAS device according to the file management command. In the implementation mode, the remote terminal can forward a management command for managing the files in the home NAS device to the home gateway through the remote management server, the home gateway can respond to the management command to manage the files in the home NAS device, remote management of the remote terminal on the home NAS device is achieved, and a user can conveniently manage the files in the home NAS device.
In a second aspect, an embodiment of the present invention provides a method for managing a home NAS device, where a communication system applied in the method includes the home NAS device, a home gateway, a remote management server, and a remote terminal. The home NAS device may be a unit built in the home gateway, or may be an independent device located on the LAN side of the home gateway; the home gateway establishes a first connection with the remote management server, wherein the first connection can be a connection based on a TCP/IP protocol, which is established by logging in an account of the remote management server by the home gateway; the remote terminal establishes a second connection with the remote management server, wherein the second connection can be a connection based on a TCP/IP protocol, which is established by logging in an account of the remote management server by the remote terminal; the method for managing the home NAS device comprises the following steps: the remote terminal generates file management commands according to second input operation of a user, wherein the file management commands can be file deleting commands, file moving commands and file renaming commands; the remote terminal sends the file management command to the remote management server through the second connection; the remote management server forwards the file management command to the home gateway through the first connection; and the home gateway performs management operation corresponding to the file management command on the file in the home NAS device according to the file management command. In the implementation mode, the remote terminal can forward a management command for managing the files in the home NAS device to the home gateway through the remote management server, the home gateway can respond to the management command to manage the files in the home NAS device, remote management of the remote terminal on the home NAS device is achieved, and a user can conveniently manage the files in the home NAS device.
In a third aspect, an embodiment of the present invention provides a method for accessing a home NAS device, where a communication system applied in the method includes the home NAS device, a home gateway, a file proxy server, and a remote terminal. The home NAS device may be a unit built in the home gateway, or may be an independent device located on the LAN side of the home gateway; the home gateway establishes a third connection with the file proxy server, and the remote terminal establishes a fourth connection with the file proxy server, where the third connection and the fourth connection may be TCP/IP protocol-based connections. The method for accessing the home NAS device comprises the following steps: the home gateway sends the file directory of the home NAS device to the file proxy server through the third connection; the remote terminal obtains the file directory of the home NAS device from the file proxy server through the fourth connection; and the remote terminal displays the file directory of the home NAS device. In the technical scheme, the home gateway actively sends the file directory to the file proxy server, and the remote terminal which requires the file directory of the home NAS device can directly and quickly acquire the file directory from the file proxy server without adopting the manner of sending the directory browsing command. Because the directory browsing command does not need to be forwarded through the remote management server, the time can be saved, the time consumption of the remote terminal for obtaining the file directory is reduced, and the transmission resource of the communication system can also be saved. Further, when the number of files in the home NAS device is large, the data amount of the file directory is also large, and it takes a long time for the home gateway to transmit the home NAS device to the file proxy server. In the embodiment, the home gateway actively sends the file directory to the file proxy server, when the remote terminal needs to obtain the file directory, the file directory is already stored in the file proxy server, and the remote terminal can directly obtain the file directory from the file proxy server, so that the situation that the remote terminal needs to wait for the home gateway to send the file directory to the file proxy server is avoided, and the time consumed by the remote terminal to obtain the file directory is further reduced.
In some possible implementations, the communication system further includes a remote management server, the home gateway establishes a first connection with the remote management server, and the remote terminal establishes a second connection with the remote management server. The remote management server distributes a file proxy server for the home gateway, and then the remote management server sends the address of the file proxy server to the home gateway through a first connection with the home gateway so as to enable the home gateway to establish a third connection with the file proxy server; and the remote management server sends the address of the file proxy server to the remote terminal through a second connection with the remote terminal, so that the remote terminal establishes a fourth connection with the file proxy server.
In a fourth aspect, an embodiment of the present invention provides a system for accessing a home NAS device, where the system includes: the home NAS device, a home gateway connected with the home NAS device, a remote management server establishing a first connection with the home gateway, a remote terminal establishing a second connection with the remote management server, and a file proxy server establishing a third connection with the home gateway, wherein the remote terminal establishes a fourth connection with the file proxy server; wherein the remote terminal is configured to: sending a directory browsing command to the remote management server through the second connection; the remote management server is configured to: forwarding the directory browsing command to the home gateway through the first connection; the home gateway is configured to: according to the directory browsing command, sending the file directory of the home NAS device to the file proxy server through the third connection; the remote terminal is further configured to: obtaining a file directory of the home NAS device from the file proxy server over the fourth connection; and displaying the file directory of the home NAS device.
In some possible implementations, the remote management server is further configured to: distributing the file proxy server for the home gateway, sending the address of the file proxy server to the home gateway through the first connection, and sending the address of the file proxy server to the remote terminal through the second connection; the home gateway is further configured to: establishing the third connection with the file proxy server according to the address of the file proxy server sent by the remote management server; the remote terminal is further configured to: and establishing the fourth connection with the file proxy server according to the address of the file proxy server sent by the remote management server.
In some possible implementations, the home gateway is further configured to: after the file directory of the home NAS device is sent to the file proxy server, sending a directory sending completion notification to the remote management server through the first connection; the remote management server is further configured to: and sending the directory sending completion notification to the remote terminal through the second connection, wherein the directory sending completion notification is used for enabling the remote terminal to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the remote terminal is further configured to: generating a file access command according to a first input operation of a user, wherein the file access command is used for accessing a first file in a file directory of the home NAS device; and sending the file access command to the remote management server through the second connection; the remote management server is further configured to: sending the file access command to the home gateway through the first connection; the home gateway is further configured to: acquiring the first file from the home NAS device according to the file access command, and sending the first file to the file proxy server through the third connection; the remote terminal is further configured to: obtaining the first file from the file proxy server over the fourth connection.
In some possible implementations, the home gateway is further configured to: after sending the first file to the file proxy server, sending a file sending completion notification to the remote management server through the first connection; the remote management server is further configured to: and sending the file sending completion notification to the remote terminal through the second connection, wherein the file sending completion notification is used for enabling the remote terminal to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the file proxy is configured to: deleting the first file stored locally after the remote terminal obtains the first file from the file proxy server through the fourth connection.
In some possible implementations, the remote terminal is further configured to: sending a second file to the file proxy server over the fourth connection; after the second file is sent to the file proxy server, a file uploading notice is sent to the remote management server through the second connection; the remote management server is further configured to: forwarding the file upload notification to the home gateway through the first connection; the home gateway is further configured to: and acquiring the second file from the file proxy server through the third connection according to the file uploading notification, and storing the second file in the home NAS device.
In some possible implementations, the remote terminal is further configured to: generating a file management command according to a second input operation of a user, wherein the file management command comprises at least one of a file deleting command, a file moving command and a file renaming command; and sending the file management command to the remote management server through the second connection; the remote management server is further configured to: forwarding the file management command to the home gateway through the first connection; the home gateway is further configured to: and according to the file management command, performing management operation corresponding to the file management command on the file in the home NAS device.
In a fifth aspect, an embodiment of the present invention provides a system for accessing a home NAS device, where the system includes: the home NAS device, a home gateway connected with the home NAS device, a remote management server establishing a first connection with the home gateway, and a remote terminal establishing a second connection with the remote management server; wherein the remote terminal is further configured to: generating a file management command according to a second input operation of a user, wherein the file management command comprises at least one of a file deleting command, a file moving command and a file renaming command; and sending the file management command to the remote management server through the second connection; the remote management server is further configured to: forwarding the file management command to the home gateway through the first connection; the home gateway is further configured to: and according to the file management command, performing management operation corresponding to the file management command on the file in the home NAS device.
In a sixth aspect, an embodiment of the present invention provides a system for accessing a home NAS device, where the system includes: the home NAS device, a home gateway connected with the home NAS device, a file proxy server establishing third connection with the home gateway, and a remote terminal establishing fourth connection with the file proxy server; wherein the home gateway is configured to: sending the file directory of the home NAS device to the file proxy server through the third connection; the remote terminal is configured to: obtaining a file directory of the home NAS device from the file proxy server over the fourth connection; and displaying the file directory of the home NAS device.
In some possible implementations, the system further includes: the remote management server establishes a first connection with the home gateway, and the remote terminal establishes a second connection with the remote management server; the remote management server is configured to: distributing the file proxy server for the home gateway, sending the address of the file proxy server to the home gateway through the first connection, and sending the address of the file proxy server to the remote terminal through the second connection; the home gateway is further configured to: establishing the third connection with the file proxy server according to the address of the file proxy server sent by the remote management server; the remote terminal is further configured to: and establishing the fourth connection with the file proxy server according to the address of the file proxy server sent by the remote management server.
In a seventh aspect, an embodiment of the present invention provides a remote management server, including: the system comprises a network interface, a home gateway and a remote terminal, wherein the network interface is used for establishing a first connection with the home gateway and a second connection with the remote terminal and receiving a directory browsing command sent by the remote terminal through the first connection; a memory for storing instructions and storing messages received by the network interface from the home gateway and the remote terminal; a processor, coupled to the network interface and the memory, respectively, for executing the instructions in the memory to perform the following steps when executing the instructions: configuring a port of the network interface connected with the home gateway to establish the first connection; configuring a port of the network interface connected with the remote terminal to establish the second connection; generating a directory browsing command forwarded to the home gateway according to the directory browsing command sent by the remote terminal and received by the network interface; the network interface is further configured to: and sending the directory browsing command which is generated by the processor and forwarded to the home gateway through the first connection, wherein the directory browsing command is used for enabling the home gateway to send the file directory of the home NAS device to a file proxy server.
In some possible implementations, the processor is further configured to: distributing the file proxy server for the home gateway; the network interface is further configured to: sending the address of the file proxy server to the home gateway through the first connection, so that the home gateway establishes the third connection with the file proxy server according to the address of the file proxy server; and sending the address of the file proxy server to the remote terminal through the second connection, so that the remote terminal establishes the fourth connection with the file proxy server according to the address of the file proxy server.
In some possible implementations, the network interface is further to: receiving a directory transmission completion notification sent by the home gateway through the first connection; the processor is further configured to: generating a directory transmission completion notification forwarded to the remote terminal according to the directory transmission completion notification sent by the home gateway and received by the network interface; the network interface is further configured to: and sending a directory sending completion notification generated by the processor and forwarded to the remote terminal through the second connection, wherein the directory sending completion notification is used for enabling the remote terminal to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a target file access command sent by the remote terminal through the second connection; the processor is further configured to: generating a file access command forwarded to the home gateway according to the file access command sent by the remote terminal and received by the network interface; the network interface is further configured to: and sending the file access command which is generated by the processor and forwarded to the home gateway through the first connection, wherein the file access command is used for enabling the home gateway to send the first file requested by the file access command to the file proxy server through the third connection.
In some possible implementations, the network interface is further to: receiving a file sending completion notification sent by the home gateway through the first connection; the processor is further configured to: generating a file sending completion notification forwarded to the remote terminal according to the file sending completion notification sent by the home gateway and received by the network interface; the network interface is further configured to: and sending a file sending completion notification generated by the processor and forwarded to the remote terminal through the second connection, wherein the file sending completion notification is used for enabling the remote terminal to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a file uploading notification sent by the remote terminal through the second connection; the processor is further configured to: generating a file uploading notification forwarded to the home gateway according to the file uploading notification sent by the remote terminal and received by the network interface; the network interface is further configured to: and sending a file uploading notification generated by the processor and forwarded to the home gateway through the first connection, wherein the file uploading notification is used for enabling the home gateway to acquire the second file from the file proxy server through the third connection.
In some possible implementations, the network interface is further to: receiving a file management command sent by the remote terminal through the second connection; the processor is further configured to: generating a file management command forwarded to the home gateway according to the file management command sent by the remote terminal and received by the network interface; the network interface is further configured to: and sending the file management command which is generated by the processor and forwarded to the home gateway through the first connection, wherein the file management command is used for enabling the home gateway to perform management operation corresponding to the file management command on the file in the home NAS device.
In an eighth aspect, an embodiment of the present invention provides a home gateway, including: the network interface is used for connecting with the home NAS equipment, establishing a first connection with a remote management server, establishing a third connection with a file proxy server and receiving a directory browsing command sent by the remote management server through the first connection; a memory for storing instructions, and storing messages received from the remote management server, and storing files or file directories received from the home NAS device and the file proxy server; a processor, coupled to the network interface and the memory, respectively, for executing the instructions in the memory to, when executed, perform the following: configuring ports of the network interface, the home NAS device, the remote management server and the file proxy server; responding to a directory browsing command sent by the remote management server, and obtaining a file directory from the home NAS device through the network interface; the network interface is further configured to: and sending the file directory to a file proxy server through the third connection so that the remote terminal can obtain the file directory from the file proxy server.
In some possible implementations, the processor is further configured to: after the network interface sends the file directory of the home NAS device to the file proxy server, a directory sending completion notification is generated; the network interface is further configured to: and sending the directory sending completion notification to the remote management server through the first connection, so that the remote management server sends the directory sending completion notification to the remote terminal, wherein the directory sending completion notification is used for enabling the remote terminal to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a file access command sent by the remote management server through the first connection; the processor is further configured to: responding to a file access command sent by the remote management server, and obtaining a first file requested by the file access command from the home NAS device through the network interface; the network interface is further configured to: sending the first file to a file proxy server through the third connection so that the remote terminal can obtain the file directory from the file proxy server.
In some possible implementations, the processor is further configured to: after the network interface sends the first file to the file proxy server, generating a file sending completion notification; the network interface is further configured to: and sending the file sending completion notification to the remote management server through the first connection so that the remote management server sends the file sending completion notification to the remote terminal, wherein the file sending completion notification is used for enabling the remote terminal to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a file uploading notification sent by the remote management server through the first connection; the processor is further configured to: and responding to a file uploading notification sent by the remote management server, instructing the network interface to obtain a second file from the file proxy server, and instructing the network interface to store the second file in the home NAS device.
In some possible implementations, the network interface is further to: receiving a file management command sent by the remote management server through the first connection; the processor is further configured to: and responding to a file management command sent by the remote management server, and performing management operation corresponding to the file management command on the file in the home NAS device through the network interface.
In a ninth aspect, an embodiment of the present invention provides a home gateway, including: the network interface is used for connecting with the home NAS device and establishing a third connection with the file proxy server; sending the file directory of the home NAS device to the file proxy server through the third connection so that the remote terminal can obtain the file directory from the file proxy server; a memory for storing instructions and files or file directories received from the home NAS device; a processor, coupled to the network interface and the memory, respectively, for executing the instructions in the memory to, when executed, perform the following: and configuring a port of the network interface connected with the home NAS device, and configuring a port of the network interface connected with the file proxy server, so that the network interface and the file proxy server establish a third connection.
In a tenth aspect, an embodiment of the present invention provides a remote terminal, including: the network interface is used for establishing a second connection with the remote management server and establishing a fourth connection with the file proxy server; a memory for storing instructions and storing files or file directories received from the file proxy; a processor, respectively coupled to the network interface, the display unit, and the memory, for executing the instructions in the memory to, when executed, perform the following: configuring a port of the network interface connected with the remote management server so that the network interface establishes the second connection with the remote management server; configuring a port of the network interface connected with the file proxy server so that the network interface and the file proxy server establish the fourth connection; generating a directory browsing command sent to the remote management server; the network interface is further configured to: sending a directory browsing command to the remote management server over the second connection, and obtaining a file directory of the home NAS device from the file proxy server over the fourth connection; the remote terminal further comprises: and the display unit is used for displaying the file directory.
In some possible implementations, the network interface is further to: receiving a directory transmission completion notification transmitted by the remote management server through the second connection; the processor is further configured to: and according to the directory sending completion notification, indicating the network interface to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the remote terminal further includes: an input unit for receiving a first input operation by a user; the processor is further configured to: generating a file access command according to the first input operation, wherein the file access command is used for accessing a first file in a file directory of the home NAS device; the network interface is further configured to: sending the file access command to the remote management server over the second connection; and obtaining the first file from the file proxy server over the fourth connection.
In some possible implementations, the network interface is further to: receiving a file transmission completion notification transmitted by the remote management server through the second connection; the processor is further configured to: and according to the file sending completion notice, indicating the network interface to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: sending a second file to the file proxy server over the fourth connection; the processor is further configured to: after the network interface sends the second file to the file proxy server, generating a file uploading notification; the network interface is further configured to: and sending a file uploading notification to the remote management server through the second connection so that the remote management server forwards the file uploading notification to the home gateway, wherein the file uploading notification is used for enabling the home gateway to acquire the second file from the file proxy server and store the second file in the home NAS device.
In some possible implementations, the input unit is further configured to: receiving a second input operation of the user; the processor is further configured to: generating a file management command according to the second input operation, wherein the file management command comprises at least one of a file deleting command, a file moving command and a file renaming command; the network interface is further configured to: and sending the file management command to the remote management server through the second connection so that the remote management server forwards the file management command to the home gateway, where the file management command is used for enabling the home gateway to perform management operation corresponding to the file management command on the file in the home NAS device.
In an eleventh aspect, an embodiment of the present invention provides a file proxy server, including: the network interface is used for establishing a third connection with a home gateway, establishing a fourth connection with a remote terminal, receiving a file directory or a file of the home NAS device sent by the home gateway through the third connection, and sending the file directory or the file to the remote terminal through the fourth connection; a memory for storing instructions and storing files or file directories received from the home gateway and the remote terminal; a processor, respectively coupled to the network interface, the display unit, and the memory, for executing the instructions in the memory to, when executed, perform the following: configuring the network interface and the port of the home gateway so that the network interface and the home gateway establish the third connection; and configuring a port for connecting the network interface and the remote terminal so that the network interface and the remote terminal establish the fourth connection.
In some possible implementations, the network interface is further to: and receiving a first file sent by the remote terminal through the fourth connection, and sending the first file to the home gateway through the third connection, so that the home gateway stores the first file in the home NAS device.
Detailed Description
The technical solutions of the present invention are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features in the embodiments and examples of the present invention are not intended to limit the technical solutions of the present invention, but may be combined with each other without conflict.
The following first presents a description of the related concepts in an embodiment of the present invention.
The remote terminal refers to a terminal device in a network outside the home lan, for example, a computer, a tablet computer, a smart phone, etc. in the network outside the home lan. The remote terminal includes an input unit operable to receive an input operation by a user and generate a control command, text content, or voice content, etc. corresponding to the input operation according to user setting or system setting. For example, the input unit is a touch screen, and the input unit generates a file access command for accessing a first file according to an operation of a user touching the first file in a file directory displayed on the touch screen. For another example, the input unit generates a delete file command to delete the first file according to an operation in which the user presses the first file in the file directory for a long time and selects the "delete" option in the pop-up option list. For another example, the input unit generates a rename file command for renaming the first file according to the operation that the user presses the first file in the file directory for a long time and selects a rename option in the popped option list. In practical applications, the input unit of the remote terminal may also be a voice input unit, and the voice input unit is configured to receive a voice input by a user and generate a corresponding control command, text content, or voice content according to the voice, which is not described in detail herein.
The home gateway is a network interconnection device between a home local area network and an external wide area network, and is used for realizing mutual access between devices in the home local area network and devices outside the home local area network.
Network attached storage NAS devices, including storage devices (e.g., disk arrays, tape drives, or removable storage media) and embedded system software, may provide cross-platform file sharing functionality. The home NAS device is located on a LAN side of the home gateway and accesses an external wide area network through the home gateway.
In one possible implementation, the home gateway has a built-in NAS unit, providing NAS services, in which case the remote terminal accesses the home gateway, i.e. can access the files in the built-in NAS unit of the home gateway.
In another possible implementation manner, the home NAS device is an independent device located on the LAN side of the home gateway, in which case, by configuring a connection port between the home NAS device and the home gateway, the remote terminal can access the file in the home NAS device via the home gateway. For example, the IP Port of the home NAS device is mapped to the home gateway by using a Port Forwarding (english: Port Forwarding) technology, and the remote terminal can communicate with the home gateway by using a remote domain name mode and access the home NAS device through the home gateway.
In the embodiments of the present invention, the home NAS devices in the following description may be NAS units built in the home gateway, or may be independent devices located on the LAN side of the home gateway.
The IP address is a uniform address format provided by an IP protocol, and a logical address is allocated to each device on the Internet, and the devices in the Internet communicate based on the respective IP addresses.
The public network address is an unreserved address in the IP address, and has uniqueness in the entire Internet, and a device having the public network address can directly access the Internet.
The private network address (english: private network address) is a reserved address in the IP address. The private network address is unique and effective in a local area network, and different terminals can use the same private network address in different local area networks. Thus, a device using a private network address can directly access other devices within the local area network, but not the Internet.
The Network Address Translation (NAT) is used to realize mutual translation between a private network address and a public network address, translate a large number of private network addresses into one or a small number of public network addresses, and reduce occupation of the public network addresses. For example, in a local area network, only one device is connected to the Internet, and the NAT can be used to share the Internet connection, so that other devices in the local area network can also access the Internet.
Dynamic IP (english: Dynamic IP) refers to a method of allocating an IP address when needed, and an IP address allocated in this way is called a Dynamic IP address. In contrast, a static IP address refers to a fixed assignment of an IP address to a device, which is used for each communication of the device. In practical situations, most users access the internet using dynamic IP addresses because IP address resources are precious.
The Dynamic Domain Name Service (DDNS) is used for mapping the dynamic IP address of the user equipment to a fixed domain name, and other equipment in the Internet can communicate with the user equipment through the fixed domain name.
Peer-to-peer network P2P, refers to a network in which devices are in peer-to-peer relationship, each device being capable of serving as a requester of network services and responding to requests from other devices to provide resources and services, e.g., sharing and exchange of information, sharing of computing resources, sharing of storage resources, etc. When the IP address of one device in P2P is a private network address, it is necessary to implement communication between devices in P2P by using NAT traversal technology.
Fig. 1 is a schematic diagram of a communication system in an embodiment of the present invention, where a home gateway 10 and a home NAS device 20 are located in a home lan, and a network where a remote terminal 30 is located may be the Internet or another lan accessing the Internet. For example, the network in which the remote terminal 30 is located may be: a Global System for mobile communications (GSM) network, a General Packet Radio Service (GPRS) network, a CDMA network, a Wideband CDMA network, a Long Term Evolution (LTE) network, and a fifth generation mobile communication System (5G) network.
In the embodiment of the present invention, the IP address on the WAN side of the home gateway 10 may be a public network address or a private network address, and when the IP address on the WAN side of the home gateway 10 is a private network address, the network device on the upper layer of the home gateway 10 converts the private network address of the home gateway 10 into a public network address according to the NAT technology, so that the home gateway 10 can access the Internet; similarly, the IP address of the remote terminal 30 may be a public network address or a private network address, and when the IP address of the remote terminal 30 is a private network address, the private network address of the remote terminal 30 is also subjected to NAT processing. Particularly, in the case where the WAN address of the home gateway 10 is a private network address, according to the technical solution provided by the embodiment of the present invention, the remote terminal 30 can access the home NAS device 20 located on the LAN side of the home gateway 10.
In the embodiment of the present invention, the communication system further includes a remote management server 40, configured to provide a function of remotely managing the home gateway 10, including: instructing the home gateway 10 to upload a file directory or a file of the home NAS device 20, or instructing the home gateway 10 to store the file in the home NAS device 20, or instructing the home NAS device 20 to perform operations such as moving, deleting, renaming, and the like on the file/folder in the home NAS device 20.
The remote management server 40 establishes a first connection with the home gateway 10, and the remote management server 40 specifically sends a control command to the home gateway 10 through the first connection, so as to implement the above-described function of remotely managing the home gateway 10. The home gateway 10 may log in to the remote management server 40 through an account of the remote management server 40 to establish a first connection with the remote management server 40.
For example, when the user purchases the home gateway 10, the service provider has already assigned the remote management server 40 to the home gateway 10 and notifies the user of the account number and password of the remote management server 40. Or, the user registers the account of the remote management server 40 by himself, and after the registration is successful, the service provider allocates the remote management server 40 associated with the account registered by the user to the user. The user logs in the account and the password on the home gateway 10, and the home gateway 10 can log in the remote management server 40 to establish a first connection with the remote management server 40.
The first connection may be a connection established based on a Transmission control Protocol/Internet Protocol (TCP/IP) Protocol, for example, the first connection may be a connection established according to an extensible messaging and presentation Protocol (XMPP). Optionally, the first connection is a long connection established based on a TCP/IP protocol, where the long connection means that after the connection is established, the connection is always valid and is not interrupted regardless of whether the connection is used for data or instruction transmission.
In this embodiment of the present invention, a second connection is established between the remote terminal 30 and the remote management server 40, so that the remote terminal 30 can send a control command to the remote management server 40 through the second connection, and the remote management server 40 will forward the control command sent by the remote terminal 30 to the home gateway 10, so that the remote terminal 30 can instruct the home gateway 10 to upload a file directory or a file of the home NAS device 20, instruct the home gateway 10 to store the file in the home NAS device 20, or instruct the home NAS device 20 to perform operations such as moving, deleting, renaming, and the like on the file/folder in the home NAS device 20.
The remote terminal 30 may also log into the remote management server 40 by way of an account of the remote management server 40 to establish a second connection with the remote management server 40. For example, the remote terminal 30 is installed with an application (App) for remotely managing the home gateway 10, and the user can log in the remote management server 40 by opening the App and inputting an account and a password of the remote management server 40, and establish a second connection with the remote management server 40. For example, the user may log in the remote management server 40 by opening a browser, opening a Web application (english: Web App) developed based on a technique such as hypertext markup language (HTLM) and used for remote management of the home gateway 10 through the browser, inputting an account and a password of the remote management server 40 into the Web application, and establishing a second connection with the remote management server 40.
The second connection may likewise be a connection established on the basis of the TCP/IP protocol and may likewise be a long connection on the basis of the TCP/IP protocol. In practice, the first connection and the second connection may be of the same type.
In the embodiment of the present invention, the communication system further includes a file proxy server 50, configured to relay transmission of a file or a file directory between the home gateway 10 and the remote terminal 30. The home gateway 10 establishes a third connection with the file proxy server 50, and the establishment process of the third connection includes the following implementation manners:
firstly, the home gateway manufacturer allocates a fixed file proxy server 50 to the home gateway 10, and writes the address of the file proxy server 50 into the storage unit of the home gateway 10, and the home gateway 10 can establish a third connection with the file proxy server 50 according to the address of the file proxy server 50 in its own storage unit.
Secondly, the home gateway manufacturer, the communication carrier, or the remote management server 40 assigns a fixed file proxy server 50 to the home gateway 10, and stores the address of the file proxy server 50 in the remote management server 40. After the home gateway 10 establishes the first connection with the remote management server 40, the remote management server 40 may transmit the address of the file proxy server 50 to the home gateway 10 through the first connection, and the home gateway 10 establishes the third connection according to the address. Alternatively, the remote management server 40 receives a control command, such as a directory browsing command, sent by the remote terminal 30, and when the remote management server 40 forwards the control command to the home gateway 10 through the first connection, the remote management server 40 sends the address of the file proxy server 50 to the home gateway 10, and the home gateway 10 establishes a third connection with the file proxy server 50 according to the address.
Thirdly, different from the second embodiment, the remote manager dynamically allocates a file proxy server to the home gateway 10 according to a file or directory uploading requirement of the home gateway 10, and sends an address of the file proxy server 50 to the home gateway 10 through the first connection, and the home gateway 10 establishes a third connection with the file proxy server 50 according to the address.
For example, the home gateway 10 receives a directory browsing command transmitted from the remote terminal 30 via the remote management server 40, and transmits a file proxy 50 request to the remote management server 40, the remote management server 40 assigns the file proxy 1 to the home gateway 10 and transmits the address of the file proxy 1 to the home gateway 10, and the home gateway 10 establishes a third connection with the file proxy 1 based on the address and transmits the file directory of the home NAS device 20 to the file proxy 1. On the other hand, when the home gateway 10 receives the file browsing command transferred from the remote terminal 30 via the remote management server 40, the home gateway 10 again transmits a file proxy server 50 request to the remote management server 40, and the remote management server 40 allocates the file proxy server 2 to the home gateway 10. In other words, the remote management server 40 may assign a file proxy server to the home gateway 10 according to its current file or directory upload requirements, while the file proxy servers 50 assigned for different file or directory upload requirements may be different.
Fourthly, the file proxy server 50 has an account number, and the home gateway 10 establishes a first connection with the file proxy server 50 by logging in the account number of the file proxy server 50. The account number of the file proxy server 50 may be assigned to the home gateway 10 by the communication service provider or the home gateway manufacturer. Or, the user registers the account of the file proxy server 50 by himself, and after the registration is successful, the service provider allocates the file proxy server 50 associated with the account registered by the user to the user.
In practical cases, one file proxy server 50 may serve as a file or directory relay for a plurality of home gateways 10, and the file proxy server 50 may allocate a corresponding storage space for each home gateway 10.
The third connection may be a connection established based on a TCP/IP Protocol, such as a connection according to a HyperText Transfer Protocol (HTTP). The third connection may be a long connection or a short connection. When the third connection is a short connection, once the task is finished (the file or directory is transmitted), the third connection is interrupted, and when the next communication is needed, the home gateway 10 re-establishes the third connection with the file proxy server 50, where the third connection has a characteristic of high security when the third connection is a short connection.
In the embodiment of the present invention, the remote management server 40 establishes a fourth connection with the file proxy server 50, and obtains the file or directory uploaded by the home gateway 10 from the file proxy server 50 through the fourth connection, or the remote terminal 30 sends the file to the file proxy server 50 through the fourth connection, and instructs the home gateway 10 to obtain the file from the file proxy server 50 through the remote management server 40 and store the file in the home NAS device 20.
In combination with one to three of the aforementioned third connection establishment methods, the remote terminal 30 may obtain the address of the file proxy server 50 from the remote management server 40, and establish a fourth connection with the file proxy server 50 according to the address. For example, in combination with one of the aforementioned third connection establishment methods, after the remote terminal 30 establishes the fourth connection with the remote management server 40, the remote terminal 30 may send a file proxy server 50 request to the remote management server 40, the remote management server 40 forwards the request to the home gateway 10, the home gateway 10 receives the request and sends the address of the file proxy server 50 to the remote management server 40, and the remote management server 40 sends the address of the file proxy server 50 to the remote terminal 30. For another example, in combination with the second or third connection establishment method, after the remote terminal 30 establishes the fourth connection with the remote management server 40, the remote management server 40 transmits the address of the file proxy server 50 assigned to the home gateway 10 to the remote terminal 30. Alternatively, after the remote terminal 30 transmits a directory/file browsing command to the remote management server 40, the remote management server 40 forwards the command to the home gateway 10 on the one hand, and transmits the address of the file proxy server 50 allocated to the home gateway 10 to the remote terminal 30 on the other hand. Alternatively, the case where the remote terminal 30 transmits a file proxy server 50 request to the remote management server 40, and the remote management server 40 transmits the address of the file proxy server 50 allocated to the home gateway 10 to the remote terminal 30 according to the request may be applied to the case where the remote terminal 30 uploads a file to the home NAS device 20.
In combination with the fourth method of establishing the third connection, the remote terminal 30 may also log in to the remote management server 40 through the file proxy server 50 to establish a fourth connection with the remote management server 40. A specific implementation thereof may refer to a process of establishing the fourth connection between the remote terminal 30 and the remote management server 40, which is not repeated here.
The fourth connection may be a connection based on the HTTP protocol, and may be a long connection or a short connection. In practice, the third connection and the fourth connection may be of the same type.
In the embodiment of the present invention, the remote management server 40 and the file proxy server 50 may be deployed in the same physical device, or may be deployed in two physical devices respectively. The remote management server 40 and the file proxy server 50 are each implemented by a cluster formed by a plurality of servers.
After the home gateway 10 establishes the first connection with the remote management server 40, the remote terminal 30 establishes the second connection with the remote management server 40, the home gateway 10 establishes the third connection with the file proxy server 50, and the remote terminal 30 establishes the fourth connection with the file proxy server 50, the remote terminal 30 can access the directory of the home NAS device 20. Referring to fig. 2, the remote terminal 30 being able to access the directory of the home NAS device 20 includes the steps of:
step 101: and the remote terminal sends a directory browsing command to the remote management server through the second connection.
Specifically, when the remote terminal 30 is in operation, the user inputs the account and the password of the remote management server 40 into the application program for remotely managing the home gateway 10 on the remote terminal 30 in the manner described above, and establishes the second connection with the remote management server 40.
Then, the user can generate a directory browsing command according to an input operation by the user, which may be an operation of touching an icon of the home NAS device 20 displayed on the touch screen of the remote terminal 30, or a voice input operation by the user through the microphone of the remote terminal 30, for example, the user speaks "the directory of the home NAS device 1" into the microphone of the remote terminal 30.
The remote terminal 30 generates a directory browsing command including the identification of the target home NAS device 20 according to the input operation by the user. For example, the directory browse command may be represented as "GET NAS 1/DIR", where NAS1 is the identity of the target NAS and DIR indicates a request to browse the file directory (English: directory, DIR) of NAS 1.
Then, the remote terminal 30 transmits the directory browsing command to the remote management server 40 through the second connection with the remote management server 40.
Step 102: the remote management server forwards the directory browse command to the home gateway through the first connection.
Specifically, the home gateway 10 establishes the first connection with the remote management server 40 by logging in the account of the remote management server 40 in the manner described above, which is not repeated here.
In practice, each remote management server 40 may be a dedicated server allocated to a fixed home gateway 10, in which case, after receiving the directory browsing command sent by the remote terminal 30, the remote management server 40 sends the directory browsing command to the home gateway 10 through the first connection between the remote management server 40 and the home gateway 10, since it is unique to the home gateway 10 managed by itself.
When each remote management server 40 is responsible for managing a plurality of home gateways 10, after receiving a directory browsing command transmitted from the remote terminal 30, the remote management server 40 needs to determine to which home gateway 10 the command should be forwarded. One implementation is as follows: the directory browsing command includes the identifier of the home gateway 10, and the remote management server 40 transmits the command to the corresponding home gateway 10 according to the identifier of the home gateway 10 in the directory browsing command. In another implementation manner, the remote management server 40 stores a mapping relationship between the home gateway 10 and the remote terminal 30 that are logged in through the same account, the directory browsing command sent by the remote terminal 30 includes an identifier of the remote terminal 30 that is a command source, and the remote management server 40 determines, according to the mapping relationship stored locally, the home gateway 10 corresponding to the remote terminal 30 that sends the command, and sends the directory browsing command to the home gateway 10.
Step 103: and the home gateway sends the file directory of the home NAS device to the file proxy server through the third connection according to the directory browsing command.
Specifically, the home gateway 10 establishes the third connection with the file proxy server 50 through any one of the first to third methods described above, which is not repeated here.
In a case where the home NAS device 20 that the remote terminal 30 requests to browse the directory is a network storage unit built in the home gateway 10, the home gateway 10 has a control authority over the home NAS device 20, and the file directory of the home NAS device 20 can be transmitted to the file proxy server 50 through the third connection.
When the home NAS device 20 is an independent device located on the LAN side of the home gateway 10, the home gateway 10 obtains the directory of the home NAS device 20 by two implementation manners:
in the method 1, when the home gateway 10 has the right to read a file or a directory from the home NAS device 20, the home gateway 10 directly reads the file directory from the home NAS device 20 and transmits the file directory to the file proxy server 50.
In the mode 2, the home gateway 10 forwards the received directory browsing command to the home NAS device 20, and the home NAS device 20 sends the file directory to the home gateway 10 in response to the directory browsing command. The home gateway 10 receives the file directory transmitted by the home NAS device 20, and transmits the file directory to the file proxy server 50 through the third connection.
Step 104: the remote terminal obtains the file directory of the home NAS device from the file proxy server through the fourth connection.
In particular, the remote terminal 30 establishes the fourth connection with the file proxy server 50 in the manner described above, which is not repeated here. In practice, step 104 has a variety of implementations, including:
the first implementation mode comprises the following steps: the home gateway 10 transmits a directory transmission completion notification to the remote management server 40 through the first connection after transmitting the file directory of the home NAS device 20 to the file proxy server 50; the remote management server 40 transmits the directory transmission completion notification to the remote terminal 30 through the second connection. The remote terminal 30 receives the directory transmission completion notification, transmits a directory browsing request to the file proxy server 50 through the fourth connection, and the file proxy server 50 transmits the file directory received from the home gateway 10 to the remote terminal 30 in response to the directory browsing request.
In this implementation, the remote terminal 30 can timely and accurately know whether the file directory of the home NAS device 20 is successfully uploaded to the file proxy server 50, so that the remote terminal 30 can timely obtain the file directory from the file proxy server 50.
It should be noted that, when the remote management server 40 sends the directory transmission completion notification to the remote terminal 30, the address of the file proxy server 50 may be sent to the remote terminal 30, and the file proxy server 50 may establish a fourth connection with the file proxy server 50 according to the address and send a file directory request to the file proxy server 50 through the fourth connection.
The second implementation mode comprises the following steps: the remote terminal 30 periodically transmits a file directory request to the file proxy server 50 after transmitting the directory browse command to the remote management server 40. Once the file proxy server 50 receives the file directory transmitted by the home gateway 10, the file proxy server 50 transmits the file directory to the remote terminal 30 after receiving the file directory request transmitted by the remote terminal 30.
The third implementation mode comprises the following steps: the fourth connection established between the remote terminal 30 and the file proxy server 50 is a long connection, and the remote terminal 30 sends the file directory request to the file proxy server 50 after sending the directory browsing command to the remote management server 40, which is different from the second implementation manner in that the remote terminal 30 may send the file directory request only once, and the file proxy server 50 may respond to the file directory request after receiving the file directory sent by the home gateway 10 and actively send the file directory to the remote terminal 30 through the fourth connection.
The fourth implementation mode comprises the following steps: the fourth connection established by the remote terminal 30 and the file proxy server 50 is a long connection and a connection is established between the remote management server 40 and the file proxy server 50. The remote management server 40, after receiving the directory browsing command sent by the remote terminal 30, forwards the directory browsing command to the home gateway 10 on the one hand and sends the directory browsing command to the file proxy server 50 on the other hand, the directory browsing command including the identification of the remote terminal 30 and the identification of the home gateway 10. The file proxy server 50, after receiving the file directory transmitted from the home gateway 10, determines that the file directory should be transmitted to the remote terminal 30 according to the directory browsing command, and then transmits the file directory to the remote terminal 30 through a fourth connection with the remote terminal 30.
Step 105: the remote terminal displays a file directory of the home NAS device.
Specifically, after obtaining the file of the home NAS device 20 from the file proxy server 50, the remote terminal 30 displays the file directory through the display unit of the remote terminal 30, so that the user can view the file directory of the home NAS device 20.
In the above technical solution, the home gateway 10 establishes a first connection with the remote management server 40, and the remote terminal 30 establishes a second connection with the remote management server 40, so that the remote terminal 30 can send a directory browsing command to the home gateway 10 through the remote management server 40. And the home gateway 10 establishes a third connection with the file proxy server 50 and the remote terminal 30 establishes a fourth connection with the file proxy server 50, so that the home gateway 10 can transmit the file directory of the home NAS device 20 to the remote terminal 30 through the file proxy server 50 in response to the received directory browsing command. The technical scheme is suitable for the situation that the IP address of the WAN of the home gateway 10 is a public network address and the situation that the IP address of the WAN of the home gateway 10 is a private network address, and is wide in application range. Moreover, in the above technical solution, the remote terminal 30 sends the directory browsing command to the home gateway 10 through the existing remote management server 40 that manages the home gateway 10, which is not only simple in implementation manner, but also low in cost, and is beneficial to wide application of the technology that the remote terminal 30 accesses the home NAS device 20. Further, the home gateway 10 transmits the directory of the home NAS device 20 to the file proxy server 50 only when the remote terminal 30 issues a directory browse command, but the file of the home NAS device 20 is still stored only in the home NAS device 20, which is highly secure.
In one possible implementation, after accessing the file directory of the home NAS device 20 in the above manner, the remote terminal 30 may further access the file of the home NAS device 20. Referring to fig. 3, the process of the remote terminal 30 accessing the file of the home NAS device 20 includes the steps of:
step 106: the remote terminal generates a file access command according to a first input operation of a user, wherein the file access command is used for accessing a first file in a file directory of the home NAS device.
Specifically, after the remote terminal 30 displays the file directory of the home NAS device 20, the user can view the file directory of the home NAS device 20, the user can select a first file in the directory, and the remote terminal 30 generates a file access command for accessing the first file according to the selected operation of the user.
For example, when the display unit of the remote terminal 30 is a touch screen, the user touches a first file displayed on the display unit, and the remote terminal 30 generates a file access command for accessing the first file according to the touch operation. For another example, the user moves a cursor displayed on the mobile remote terminal 30 to a first file, and presses a decision key to select the first file, and the remote terminal 30 generates a file access command for accessing the first file according to the first file. For another example, the user speaks "a first file" into the microphone of the remote terminal 30, and the remote terminal 30 generates a file access command to access the first file after analyzing the voice input by the user.
In practical cases, the FILE access command may be represented as "GET NAS1/FILE 1", where NAS1 is the identifier of the target NAS and FILE1 is the identifier of the first FILE.
Step 107: the remote terminal sends a file access command to the remote management server through the second connection.
Step 108: the remote management server sends the file access command to the home gateway through the first connection.
Specifically, the remote management server 40, upon receiving the file access command transmitted from the remote terminal 30, transmits the file access command to the home gateway 10 through the first connection established with the home gateway 10. The implementation manner of step 108 is similar to the implementation manner of forwarding the directory browsing request to the home gateway 10 by the remote management server 40 in step 102, and is not described in detail herein.
Step 109: and the home gateway acquires the first file from the home NAS device according to the file access command and sends the first file to the file proxy server through the third connection.
Specifically, after receiving the file access command, the home gateway 10 obtains the first file from the home NAS device 20 according to the identifier of the first file included in the command.
In a similar manner to the manner in which the home gateway 10 obtains the file directory in step 103, when the home gateway 10 has the right to read a file from the home NAS device 20, the home gateway 10 directly reads the first file from the home NAS device 20. When the home gateway 10 does not have the right to read the file in the active home NAS device 20, the home gateway 10 may send the received file access command to the home NAS device 20, and the home NAS device 20, in response to the command, locates the first file according to the identifier of the first file in the command, and sends the first file to the home gateway 10.
Step 110: the remote terminal obtains the first file from the file proxy server over the fourth connection.
Specifically, the manner in which the remote terminal 30 obtains the first file from the file proxy server 50 is similar to the manner in which the remote terminal 30 obtains the file directory from the file proxy server 50 in step 104, that is, the remote terminal 30 may obtain the first file through any one of the aforementioned first to fourth implementations.
Taking the foregoing first implementation as an example, the home gateway 10 sends a file transmission completion notification to the remote management server 40 through the first connection after sending the first file to the file proxy server 50; and the remote management server 40 transmits a file transmission completion notification to the remote terminal 30 through the second connection. After receiving the file transmission completion notification, the remote terminal 30 transmits a request for obtaining the first file to the file proxy server 50 through the fourth connection, and the file proxy server 50 transmits the first file uploaded by the home gateway 10 to the remote terminal 30 through the fourth connection in response to the request.
The remote terminal 30 may also obtain the first file from the file proxy server 50 through the second to fourth implementation manners, which are not described in detail in the embodiments of the present invention.
In the above-described technical solution, the remote terminal 30 can transmit the directory browsing command to the home gateway 10 through the remote management server 40, and the home gateway 10 can transmit the first file of the home NAS device 20 to the remote terminal 30 through the file proxy server 50 in response to the received file access command. Since the home gateway 10 only transmits the first file requested to be accessed by the remote terminal 30 to the file proxy server 50, files other than the first file of the home gateway 10 are stored in the home NAS device 20, and a failure of the file proxy server 50 does not cause leakage of the files stored only in the home NAS device 20, which is high in security.
In another possible implementation manner, after the file proxy server 50 sends the first file to the remote terminal 30, the file proxy server 50 deletes the first file stored locally, so as to avoid leakage of the first file and enhance the security of the file.
In another possible implementation, the remote terminal 30 may store the second file in the home NAS device 20 through the remote management server 40 and the file proxy server 50 described above. Referring to fig. 4, the remote terminal 30 stores the second file in the home NAS device 20, including the steps of:
step 111: the remote terminal sends the second file to the file proxy server through the fourth connection.
Specifically, when the user needs to save the second file on the remote terminal 30 in the home NAS device 20, an input operation, such as a touch operation, an operation of inputting voice, and the like, is performed through the input unit of the remote terminal 30, and the input operation is similar to the foregoing implementation manner of the first input operation, and is not described in detail herein. The remote terminal 30 analyzes the received input operation, generates a command for uploading the second file, executes the command, and transmits the second file to the file proxy server 50. The remote terminal 30 establishes the fourth connection with the file proxy server 50, and the remote terminal 30 specifically sends the second file to the file proxy server 50 through the fourth connection.
Step 112: and after the remote terminal finishes sending the second file to the file proxy server, sending a file uploading notification to the remote management server through the second connection.
Specifically, the remote terminal 30 needs to notify the home gateway 10 to acquire the second file from the file proxy server 50 after transmitting the second file to the file proxy server 50. In the embodiment of the present invention, the remote terminal 30 establishes the aforementioned second connection with the remote management server 40, and the remote terminal 30 specifically sends a file upload success notification to the remote management server 40 through the second connection. Optionally, the file upload success notification sent by the remote terminal 30 further includes path information, which is used to instruct the home gateway 10 to store the second file in a corresponding location in the home NAS device 20 according to the path information.
Step 113: the remote management server forwards the file upload notification to the home gateway through the first connection.
Specifically, the remote management server 40 establishes the aforementioned first connection with the home gateway 10, and the remote management server 40 forwards the file upload notification to the home gateway 10 through the first connection. The specific implementation manner of step 113 is similar to the previous implementation manner of step 102 in which the remote management server 40 forwards the directory browsing command to the home gateway 10, and is not repeated here.
Step 114: and the home gateway acquires the second file from the file proxy server through the third connection according to the file uploading notification, and stores the second file in the home NAS device.
Specifically, the home gateway 10 establishes a third connection with the file proxy server 50, and after receiving the file upload notification, the home gateway 10 specifically acquires the second file from the file proxy server 50 through the third connection. The home gateway 10 obtains the second connection from the pouch server, and includes the following implementation manners:
in the method a, the file upload notification sent by the remote terminal 30 includes the identifier of the second file, and the home gateway 10 requests the file proxy server 50 for the second file according to the identifier of the second file in the file upload notification.
In the method B, the file proxy server 50 deletes the locally stored file or file directory after completing the file transfer between the home gateway 10 and the remote terminal 30, so that only the second file is stored in the storage area of the file proxy server 50 for the file transfer between the home gateway 10 and the remote terminal 30 after the remote terminal 30 transmits the second file to the file proxy server 50. After receiving the file upload notification, the home gateway 10 requests the file proxy server 50 for the file in the storage area of the file proxy server 50 allocated to the home gateway 10, and since only the second file is stored in the storage area, the file proxy server 50 transmits the second file to the home gateway 10.
The home gateway 10, after obtaining the second file from the file proxy server 50, stores the second file in the home NAS device 20. Wherein, if the file upload notification sent by the remote terminal 30 includes the aforementioned path information for specifying the storage location of the second file, the home gateway 10 stores the second file in the corresponding location according to the path information. If the path information is not included in the file upload notification transmitted by the remote terminal 30, the home gateway 10 may store the second file in a preset folder.
In the above technical solution, in combination with the remote management server 40 and the file proxy server 50, the remote terminal 30 can store the second file in the home NAS device 20, so that it is convenient for the user to store the file remotely.
In another possible implementation, the remote terminal 30 establishes the aforementioned second connection with the remote management server 40, and the home gateway 10 establishes the first connection with the remote management server 40. The remote terminal 30 may transmit a command for managing files/folders in the home NAS device 20 to the home gateway 10 through the remote management server 40, instructing the home gateway 10 to manage the home NAS device 20 according to the command. Referring to fig. 5, the remote terminal 30 remotely manages the home NAS device 20, and includes the steps of:
step 115: and the remote terminal generates a file management command according to the second input operation of the user.
Specifically, the implementation manner of the second input operation is similar to the previous implementation manner of the first input operation, and is not described in detail here. After obtaining the second input operation, the remote terminal 30 generates a corresponding file management command according to the second input operation.
For example, FILE management commands include a delete FILE command, which may be denoted as "DEL NAS1/FILE 3", where DEL is an abbreviation for delete indicating that the command is a delete FILE or folder command; the NAS1 is an identification of the NAS device that the remote terminal 30 requests to manage, and the FILE3 is an identification of the FILE that needs to be deleted, which is requested by the remote terminal 30.
As another example, the FILE management commands include a move FILE command, which may be denoted as "MOV NAS1/FILE3to xx", where MOV is an abbreviation for move, indicating that the present command is a move FILE/folder command: NAS1 is the identifier of the NAS device that the remote terminal 30 requests to manage, FILE3 is the identifier of the FILE that needs to be moved requested by the remote terminal 30, and xx is the target location of the folder movement, that is, FILE3 is moved to xx.
As another example, the FILE management commands include a rename FILE command, which may be denoted as "MOD NAS1/FILE3to yy", where MOD is an abbreviation for modify, indicating that the present command is a command to rename a FILE/folder: NAS1 is the identifier of the NAS device requested to be managed by remote terminal 30, FILE3 is the identifier of the FILE that needs to be renamed and yy is the name of the folder after renaming, i.e. FILE3 is renamed to yy.
After generating the file management command, the remote terminal 30 proceeds to step 116.
Step 116: the remote terminal sends a file management command to the remote management server through the second connection.
Step 117: the remote management server forwards a file management command to the home gateway through the first connection;
in particular, the implementation of step 116 is similar to the previous implementation of step 102 in which the remote management server 40 forwards the directory browsing command to the home gateway 10, and is not repeated here.
Step 118: and the home gateway performs management operation corresponding to the file management command on the file in the home NAS device according to the file management command.
Specifically, if the home gateway 10 has the authority to manage the files/folders of the home NAS device 20, the home gateway 10 performs a corresponding management operation on the files/folders in response to the received file management command.
If the home gateway 10 has the authority to manage the files/folders of the home NAS device 20, the home gateway 10 transmits the received file management command to the home NAS device 20, and the home NAS device 20 performs a corresponding management operation on the files/folders in response to the file management command.
In the above technical solution, the remote terminal 30 can forward a management command for performing a management operation on a file in the home NAS device 20 to the home gateway 10 through the remote management server 40, and the home gateway 10 can respond to the management command to perform a management operation on a file in the home NAS device 20, so that the remote terminal 30 can remotely manage the home NAS device 20, and a user can conveniently manage the file in the home NAS device 20.
The embodiment of the invention also provides a method for accessing the home NAS device 20, wherein the home NAS device 20 is connected with the home gateway 10, the home gateway 10 establishes a third connection with the file proxy server 50, and the remote terminal 30 establishes a fourth connection with the file proxy server 50. The third connection between the home gateway 10 and the file proxy server 50 can be established in one to four ways described above, and the fourth connection between the remote terminal 30 and the file proxy server 50 can also be established in various ways described above.
When the third connection between the home gateway 10 and the file proxy server 50 is established in the fourth manner, the home gateway 10 establishes the third connection with the file proxy server 50 by logging in the account of the file proxy server 50, and the remote terminal 30 may establish the fourth connection with the file proxy server 50 by logging in the account of the file proxy server 50. In this case, in view of the technical solution that the home gateway 10 actively uploads the file directory of the home NAS device 20 to the file proxy server 50 to be described below, the home gateway 10 may not establish the first connection with the remote management server 40, and the remote terminal 30 may not establish the second connection with the remote management server 40.
Referring to fig. 6, based on the third connection established between the home gateway and the file proxy server and the fourth connection established between the remote terminal and the file proxy server, the method for accessing the home NAS device provided by this embodiment includes the following steps:
step 201: and the home gateway sends the file directory of the home NAS device to the file proxy server through the third connection.
Specifically, after establishing the third connection with the file proxy server, the home gateway may still actively send the directory of the home NAS device to the file proxy server through the third connection even if the directory browsing command described above is not received.
Step 202: the remote terminal obtains the file directory of the home NAS device from the file proxy server through the fourth connection.
Specifically, after the file proxy server establishes the fourth connection, when the user needs to obtain the directory of the home NAS device, the remote terminal may obtain the directory of the home NAS device from the file proxy server through the fourth connection. For example, when the user clicks the identifier of the home NAS device 1 displayed on the remote terminal, the remote terminal obtains the file directory of the home NAS device 1 from the file proxy server through the fourth connection.
Step 203: the remote terminal displays a file directory of the home NAS device.
Specifically, after obtaining the file of the home NAS device from the file proxy server, the remote terminal displays the file directory through the display unit of the remote terminal, so that the user can view the file directory of the home NAS device.
In the technical scheme, the home gateway actively sends the file directory to the file proxy server, and the remote terminal which requires the file directory of the home NAS device can directly and quickly acquire the file directory from the file proxy server without adopting the manner of sending the directory browsing command. Because the directory browsing command does not need to be forwarded through the remote management server, the time can be saved, the time consumption of the remote terminal for obtaining the file directory is reduced, and the transmission resource of the communication system can also be saved. Further, when the number of files in the home NAS device is large, the data amount of the file directory is also large, and it takes a long time for the home gateway to transmit the home NAS device to the file proxy server. In the embodiment, the home gateway actively sends the file directory to the file proxy server, when the remote terminal needs to obtain the file directory, the file directory is already stored in the file proxy server, and the remote terminal can directly obtain the file directory from the file proxy server, so that the situation that the remote terminal needs to wait for the home gateway to send the file directory to the file proxy server is avoided, and the time consumed by the remote terminal to obtain the file directory is further reduced.
In one possible implementation, after the file directory in the home NAS device is changed, the home gateway sends the changed file directory to the file proxy server, so that the remote terminal can obtain the file directory in the latest state. The implementation mode can be as follows: firstly, after a file directory is changed, the home NAS device actively reports to the home gateway, and the home gateway learns the change of the file directory according to the report and sends the changed directory to the file proxy server. And secondly, the home gateway periodically checks the consistency of the file directory in the home NAS device, and after checking that the file directory is changed, the home gateway sends the changed directory to the file proxy server.
The implementation mode can enable the file directory stored in the file proxy server to be always in the latest state, and the remote terminal can be ensured to obtain the file directory of the home NAS device in the latest state from the file proxy server.
An embodiment of the present invention further provides a system for accessing a home NAS device 20, where the system includes: the home NAS device 20, the home gateway 10 connected with the home NAS device 20, the remote management server 40 establishing a first connection with the home gateway 10, the remote terminal 30 establishing a second connection with the remote management server 40, and the file proxy server 50 establishing a third connection with the home gateway 10, wherein the remote terminal 30 establishes a fourth connection with the file proxy server 50;
wherein the remote terminal 30 is configured to: sending a directory browsing command to the remote management server 40 through the second connection;
the remote management server 40 is configured to: forwarding the directory navigation command to the home gateway 10 over the first connection;
the home gateway 10 is configured to: transmitting the file directory of the home NAS device 20 to the file proxy server 50 through the third connection according to the directory browsing command;
the remote terminal 30 is also configured to: obtaining a file directory of the home NAS device 20 from the file proxy server 50 through the fourth connection; and displays a file directory of the home NAS device 20.
In some possible implementations, the remote management server 40 is further configured to: allocating a file proxy server 50 to the home gateway 10 and transmitting an address of the file proxy server 50 to the home gateway 10 through a first connection and transmitting an address of the file proxy server 50 to the remote terminal 30 through a second connection;
the home gateway 10 is also configured to: establishing a third connection with the file proxy server 50 according to the address of the file proxy server 50 sent by the remote management server 40;
the remote terminal 30 is also configured to: a fourth connection is established with the file proxy server 50 based on the address of the file proxy server 50 sent by the remote management server 40.
In some possible implementations, the home gateway 10 is further configured to: after transmitting the file directory of the home NAS device 20 to the file proxy server 50, transmitting a directory transmission completion notification to the remote management server 40 through the first connection;
the remote management server 40 is also configured to: a directory transmission completion notification for causing the remote terminal 30 to obtain the file directory of the home NAS device 20 from the file proxy server 50 through the fourth connection is transmitted to the remote terminal 30 through the second connection.
In some possible implementations, the remote terminal 30 is further configured to: generating a file access command according to a first input operation of a user, wherein the file access command is used for accessing a first file in a file directory of the home NAS device 20; and transmits a file access command to the remote management server 40 through the second connection;
the remote management server 40 is also configured to: transmitting a file access command to the home gateway 10 through the first connection;
the home gateway 10 is also configured to: acquiring a first file from the home NAS device 20 according to the file access command, and transmitting the first file to the file proxy server 50 through the third connection;
the remote terminal 30 is also configured to: the first file is obtained from the file proxy server 50 via a fourth connection.
In some possible implementations, the home gateway 10 is further configured to: after transmitting the first file to the file proxy server 50, transmitting a file transmission completion notification to the remote management server 40 through the first connection;
the remote management server 40 is also configured to: a file transmission completion notification for causing the remote terminal 30 to obtain the first file from the file proxy server 50 through the fourth connection is transmitted to the remote terminal 30 through the second connection.
In some possible implementations, the file proxy server 50 is configured to: after the remote terminal 30 obtains the first file from the file proxy server 50 through the fourth connection, the locally saved first file is deleted.
In some possible implementations, the remote terminal 30 is further configured to: sending the second file to the file proxy 50 over the fourth connection; and after the transmission of the second file to the file proxy server 50 is completed, transmits a file upload notification to the remote management server 40 through the second connection;
the remote management server 40 is also configured to: forwarding the file upload notification to the home gateway 10 over the first connection;
the home gateway 10 is also configured to: the second file is acquired from the file proxy server 50 through the third connection according to the file upload notification, and is stored in the home NAS device 20.
In some possible implementations, the remote terminal 30 is further configured to: generating a file management command according to a second input operation of the user, wherein the file management command comprises at least one of a file deleting command, a file moving command and a file renaming command; and transmits a file management command to the remote management server 40 through the second connection;
the remote management server 40 is also configured to: forwarding the file management command to the home gateway 10 through the first connection;
the home gateway 10 is also configured to: according to the file management command, a management operation corresponding to the file management command is performed on the file in the home NAS device 20.
An embodiment of the present invention further provides a system for accessing a home NAS device, where the system includes: the home NAS device, the home gateway connected with the home NAS device, the file proxy server establishing third connection with the home gateway 10, and the remote terminal establishing fourth connection with the file proxy server;
wherein the home gateway is configured to: sending the file directory of the home NAS device to a file proxy server through a third connection;
the remote terminal is used for: obtaining a file directory of the home NAS device from the file proxy server through a fourth connection; and displays the file directory of the home NAS device.
In some possible implementations, the system further includes: a remote management server establishing a first connection with the home gateway, the remote terminal establishing a second connection with the remote management server 40;
the remote management server is used for: distributing a file proxy server for the home gateway, sending the address of the file proxy server to the home gateway through a first connection, and sending the address of the file proxy server to the remote terminal through a second connection;
the home gateway is further configured to: establishing a third connection with the file proxy server according to the address of the file proxy server sent by the remote management server;
the remote terminal is further configured to: and establishing a fourth connection with the file proxy server according to the address of the file proxy server sent by the remote management server.
An embodiment of the present invention further provides a remote management server, referring to fig. 7, where the remote management server includes:
a network interface 301, configured to establish a first connection with a home gateway and a second connection with a remote terminal, and receive a directory browsing command sent by the remote terminal through the first connection;
a memory 302 for storing instructions and storing messages received by the network interface 301 from the home gateway and the remote terminal;
a processor 303, coupled to the network interface 301 and the memory 302, respectively, for executing the instructions in the memory 302, so as to perform the following steps when executing the instructions: configuring a port of the network interface 301 connected with the home gateway to establish a first connection; configuring a port of the network interface 301 connected with the remote terminal to establish a second connection; generating a directory browsing command forwarded to the home gateway according to a directory browsing command sent by the remote terminal and received by the network interface 301;
the network interface 301 is also used to: and sending the directory browsing command which is generated by the processor 303 and forwarded to the home gateway through the first connection, wherein the directory browsing command is used for enabling the home gateway to send the file directory of the home NAS device to the file proxy server.
In some possible implementations, the processor 303 is further configured to: distributing a file proxy server for the home gateway;
the network interface 301 is also used to: the address of the file proxy server is sent to the home gateway through the first connection, so that the home gateway establishes a third connection with the file proxy server according to the address of the file proxy server; and sending the address of the file proxy server to the remote terminal through the second connection, so that the remote terminal establishes a fourth connection with the file proxy server according to the address of the file proxy server.
In some possible implementations, the network interface 301 is further configured to: receiving a directory transmission completion notification sent by a home gateway through a first connection;
the processor 303 is further configured to: generating a directory transmission completion notification forwarded to the remote terminal according to the directory transmission completion notification transmitted by the home gateway received by the network interface 301;
the network interface 301 is also used to: the directory transmission completion notification generated by the processor 303 and forwarded to the remote terminal is transmitted to the remote terminal through the second connection, and the directory transmission completion notification is used for enabling the remote terminal to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the network interface 301 is further configured to: receiving a target file access command sent by the remote terminal through the second connection;
the processor 303 is further configured to: generating a file access command forwarded to the home gateway according to a file access command sent by the remote terminal and received by the network interface 301;
the network interface 301 is also used to: the file access command forwarded to the home gateway and generated by the processor 303 is sent to the home gateway through the first connection, and the file access command is used for enabling the home gateway to send the first file requested by the file access command to the file proxy server through the third connection.
In some possible implementations, the network interface 301 is further configured to: receiving a file sending completion notification sent by a home gateway through a first connection;
the processor 303 is further configured to: generating a file sending completion notification forwarded to the remote terminal according to the file sending completion notification sent by the home gateway received by the network interface 301;
the network interface 301 is also used to: the file transmission completion notification generated by the processor 303 and forwarded to the remote terminal is transmitted to the remote terminal through the second connection, and the file transmission completion notification is used for enabling the remote terminal to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface 301 is further configured to: receiving a file uploading notification sent by the remote terminal through the second connection;
the processor 303 is further configured to: generating a file uploading notification forwarded to the home gateway according to the file uploading notification sent by the remote terminal and received by the network interface 301;
the network interface 301 is also used to: the file upload notification forwarded to the home gateway, generated by the processor 303, is sent to the home gateway through the first connection, and the file upload notification is used to enable the home gateway to obtain the second file from the file proxy server through the third connection.
In some possible implementations, the network interface 301 is further configured to: receiving a file management command sent by the remote terminal through the second connection;
the processor 303 is further configured to: generating a file management command forwarded to the home gateway according to a file management command sent by the remote terminal and received by the network interface 301;
the network interface 301 is also used to: the file management command forwarded to the home gateway and generated by the processor 303 is sent to the home gateway through the first connection, and the file management command is used for enabling the home gateway to perform management operation corresponding to the file management command on the file in the home NAS device.
The specific implementation manner of the operations executed by the processor and the network interface included in the remote management server may refer to the corresponding steps executed by the remote management server in the embodiments of fig. 2 to 5, and the embodiments of the present invention are not described in detail again.
An embodiment of the present invention further provides a home gateway, including:
the network interface is used for connecting with the home NAS device, establishing a first connection with the remote management server, establishing a third connection with the file proxy server and receiving a directory browsing command sent by the remote management server through the first connection;
a memory for storing instructions, and storing messages received from the remote management server, and storing files or file directories received from the home NAS device and the file proxy server;
a processor, coupled to the network interface and the memory, respectively, for executing the instructions in the memory to perform the following operations when executing the instructions: configuring ports of a network interface connected with the home NAS device, the remote management server and the file proxy server; responding to a directory browsing command sent by a remote management server, and obtaining a file directory from home NAS equipment through a network interface;
the network interface is further configured to: the file directory is sent to the file proxy server over the third connection to enable the remote terminal to obtain the file directory from the file proxy server.
In some possible implementations, the processor is further configured to: after the network interface sends the file directory of the home NAS device to the file proxy server, a directory sending completion notification is generated;
the network interface is further configured to: and sending a directory transmission completion notification to the remote management server through the first connection so that the remote management server sends the directory transmission completion notification to the remote terminal, wherein the directory transmission completion notification is used for enabling the remote terminal to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a file access command sent by a remote management server through a first connection;
the processor is further configured to: responding to a file access command sent by a remote management server, and obtaining a first file requested by the file access command from the home NAS device through a network interface;
the network interface is further configured to: the first file is sent to the file proxy server over the third connection to enable the remote terminal to obtain the file directory from the file proxy server.
In some possible implementations, the processor is further configured to: after the network interface sends the first file to the file proxy server, generating a file sending completion notification;
the network interface is further configured to: and sending a file sending completion notification to the remote management server through the first connection so that the remote management server sends the file sending completion notification to the remote terminal, wherein the file sending completion notification is used for enabling the remote terminal to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: receiving a file uploading notification sent by a remote management server through a first connection;
the processor is further configured to: and responding to a file uploading notice sent by the remote management server, instructing the network interface to obtain the second file from the file proxy server, and instructing the network interface to store the second file in the home NAS device.
In some possible implementations, the network interface is further to: receiving a file management command sent by a remote management server through a first connection;
the processor is further configured to: and responding to the file management command sent by the remote management server, and performing management operation corresponding to the file management command on the file in the home NAS device through the network interface.
The specific implementation manner of the operation executed by the processor and the network interface included in the upper home gateway may refer to the corresponding steps executed by the home gateway in the embodiments of fig. 2 to 5, and details of the embodiments of the present invention are not described again.
An embodiment of the present invention further provides a home gateway, including:
the network interface is used for connecting with the home NAS device and establishing a third connection with the file proxy server; sending the file directory of the home NAS device to the file proxy server through the third connection so that the remote terminal can obtain the file directory from the file proxy server;
a memory for storing instructions and files or file directories received from the home NAS device;
a processor, coupled to the network interface and the memory, respectively, for executing the instructions in the memory to, when executed, perform the following: and configuring a port of the network interface connected with the home NAS device, and configuring a port of the network interface connected with the file proxy server, so that the network interface and the file proxy server establish a third connection.
The specific implementation manner of the operation executed by the processor and the network interface included in the upper home gateway may refer to the corresponding steps executed by the home gateway in the embodiment of fig. 6, and details of the embodiment of the present invention are not described again.
An embodiment of the present invention further provides a remote terminal, including:
the network interface is used for establishing a second connection with the remote management server and establishing a fourth connection with the file proxy server;
a memory for storing instructions and storing files or file directories received from the file proxy;
a processor, respectively coupled to the network interface, the display unit, and the memory, for executing the instructions in the memory to perform the following operations when executing the instructions: configuring a port for connecting the network interface and the remote management server so that the network interface and the remote management server establish a second connection; configuring a port for connecting the network interface and the file proxy server so as to establish a fourth connection between the network interface and the file proxy server; generating a directory browsing command sent to the remote management server;
the network interface is further configured to: sending a directory browsing command to the remote management server through the second connection, and obtaining a file directory of the home NAS device from the file proxy server through the fourth connection;
the remote terminal further includes: and the display unit is used for displaying the file directory.
In some possible implementations, the network interface is further to: receiving a directory transmission completion notification sent by the remote management server through the second connection;
the processor is further configured to: and according to the directory sending completion notice, indicating the network interface to obtain the file directory of the home NAS device from the file proxy server through the fourth connection.
In some possible implementations, the remote terminal further includes:
an input unit for receiving a first input operation by a user;
the processor is further configured to: generating a file access command according to the first input operation, wherein the file access command is used for accessing a first file in a file directory of the home NAS device;
the network interface is further configured to: sending a file access command to the remote management server through the second connection; and obtaining the first file from the file proxy server over the fourth connection.
In some possible implementations, the network interface is further to: receiving a file sending completion notification sent by the remote management server through the second connection;
the processor is further configured to: and according to the file sending completion notice, indicating the network interface to obtain the first file from the file proxy server through the fourth connection.
In some possible implementations, the network interface is further to: sending a second file to the file proxy server through a fourth connection;
the processor is further configured to: after the network interface sends the second file to the file proxy server, generating a file uploading notification;
the network interface is further configured to: and sending a file uploading notification to the remote management server through the second connection so that the remote management server forwards the file uploading notification to the home gateway, wherein the file uploading notification is used for enabling the home gateway to acquire a second file from the file proxy server and store the second file in the home NAS device.
In some possible implementations, the input unit is further to: receiving a second input operation of the user;
the processor is further configured to: generating a file management command according to the second input operation, wherein the file management command comprises at least one of a file deleting command, a file moving command and a file renaming command;
the network interface is further configured to: and sending a file management command to the remote management server through the second connection so that the remote management server forwards the file management command to the home gateway, wherein the file management command is used for enabling the home gateway to perform management operation corresponding to the file management command on the file in the home NAS device.
The specific implementation of the operations executed by the processor and the network interface included in the remote terminal may refer to the corresponding steps executed by the remote terminal in the embodiments of fig. 2 to 6, and the embodiments of the present invention are not described in detail again.
An embodiment of the present invention further provides a file proxy server, where the file proxy server includes:
the network interface is used for establishing a third connection with the home gateway, establishing a fourth connection with the remote terminal, receiving a file directory or a file of the home NAS device sent by the home gateway through the third connection, and sending the file directory or the file to the remote terminal through the fourth connection;
a memory for storing instructions and storing files or file directories received from the home gateway and the remote terminal;
a processor, respectively coupled to the network interface, the display unit, and the memory, for executing the instructions in the memory to perform the following operations when executing the instructions: configuring ports of the network interface and the home gateway so as to establish third connection between the network interface and the home gateway; and configuring a port of the network interface connected with the remote terminal so that the network interface establishes a fourth connection with the remote terminal.
In some possible implementations, the network interface is further to: and receiving the first file sent by the remote terminal through the fourth connection, and sending the first file to the home gateway through the third connection, so that the home gateway stores the first file in the home NAS device.
The specific implementation manner of the operations executed by the processor and the network interface included in the file proxy server may refer to the corresponding steps executed by the file proxy server in the embodiments of fig. 2 to 4, and the embodiments of the present invention are not described in detail again.
The above configurations of the home gateway, the remote terminal, and the file proxy server can be referred to in the same manner as fig. 7.
The processor may be a single processing element or may be a combination of multiple processing elements. For example, the processor may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention, such as: one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs).
The memory may be a single memory element or a combination of multiple memory elements, and is used for storing executable program codes or parameters, data, etc. required by the operation of the terminal, the server, the home gateway, etc. And the memory may include a random-access memory (RAM) or a non-volatile memory (NVM), such as a magnetic disk memory, a Flash memory (Flash), and the like.
One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
the home gateway establishes a first connection with the remote management server, and the remote terminal establishes a second connection with the remote management server, so that the remote terminal can send a directory browsing command to the home gateway through the remote management server. And the home gateway establishes a third connection with the file proxy server, and the remote terminal establishes a fourth connection with the file proxy server, so that the home gateway can respond to the received directory browsing command and send the file directory of the home NAS device to the remote terminal through the file proxy server. The technical scheme is suitable for the situation that the IP address of the WAN of the home gateway is a public network address and the situation that the IP address of the WAN of the home gateway is a private network address, and the application range is wide. Moreover, in the technical scheme, the remote terminal sends the directory browsing command to the home gateway through the existing remote management server for managing the home gateway, so that the implementation mode is simple, the cost is low, and the wide application of the technology that the remote terminal accesses the home NAS device is facilitated. Moreover, the home gateway only sends the directory of the home NAS device to the file proxy server when the remote terminal sends a directory browsing command, and the file of the home NAS device is still only stored in the home NAS device, so that the security is high.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
These computer program codes may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.