Summary of the invention
The technical problem to be solved in the present invention provides a kind of portable terminal, server and data access method.Make the directly data in the access server of portable terminal, no longer be subjected to the restriction of the memory capacity of portable terminal.
For solving the problems of the technologies described above, embodiments of the invention provide technical scheme as follows:
On the one hand, provide a kind of portable terminal, comprising:
The remote procedure call unit is used for and remote server is consulted, and determines that local mobile terminal is connected with described remote server and enjoys NFS and serve the port that is adopted;
The directory creating unit is used to scan the shared file catalogue of described remote server, determines that described local mobile terminal estimates the shared file catalogue of carry, and set up the mount point catalogue of estimating carry on described local mobile terminal;
Catalogue carry unit is used for by described port described local mobile terminal being estimated that the shared file catalogue of carry directly is mounted to described mount point catalogue.
On the other hand, provide a kind of server, comprising:
The remote procedure call service unit is used to portable terminal to specify described portable terminal to be connected the port that is adopted with described server;
The share directory setup unit, be used to set the shared file catalogue that described portable terminal is estimated carry, described shared file catalogue directly is mounted in the mount point catalogue of the expectation carry of setting up on described portable terminal by described port by described portable terminal, makes it possible to just can directly have access to data file under the described shared file catalogue opening described mount point catalogue on the described portable terminal;
The data manipulation unit is used for receiving by described port the access request to the data under the described shared file catalogue of described portable terminal, and according to described access request the data under the described shared file catalogue is operated accordingly.
On the one hand, provide a kind of data access method again, comprising:
Determine to be connected with remote server and to enjoy NFS and serve the port that is adopted;
Scan the shared file catalogue of described remote server, determine the shared file catalogue of described local mobile terminal expectation carry, and set up the mount point catalogue of estimating carry;
By described port described local mobile terminal is estimated that the shared file catalogue of carry directly is mounted in the described mount point catalogue;
By the data under the shared file catalogue of the described remote server of described mount point directory access.
Embodiments of the invention have following beneficial effect:
Such scheme is mounted on the local mobile terminal by the shared file catalogue with server, with portable terminal (is handheld device, as mobile phone) in some file leave on the server, the data of storing on the direct access server of handheld device, so just do not need the process of data sync, and, can not have copy in this locality because data are placed in the server, like this when mobile phone is lost, the also risk that can not exist sensitive information to be leaked.
Embodiment
For technical problem, technical scheme and advantage that embodiments of the invention will be solved is clearer, be described in detail below in conjunction with the accompanying drawings and the specific embodiments.
Embodiments of the invention are at occupying the restriction that is subjected to the memory capacity of local handheld device in local handheld device when the bigger data of Capacity Ratio are stored in the prior art, be stored in data on the local handheld device simultaneously and also can be subjected to the problem of the threat of safety factor, provide a kind of portable terminal, server and data access method.
The embodiments of the invention portable terminal is by realize the Client (client) of a NFS (Network FileSystem) in local side, and set up the server (server) of a NFS at server side, on server, set up a catalogue as required, the file that needs on the portable terminal to visit all is put in this catalogue, and set corresponding authority, when portable terminal starts automatically or the catalogue mount (carry) that shares on manually with server to local, so just can visit the file that is placed in the far-end server as visiting local file.
As shown in Figure 1, structural representation for the embodiments of the invention portable terminal, this portable terminal 10 comprises: remote procedure call unit 11, be used for and remote server is consulted, determine that local mobile terminal is connected with described remote server and enjoys NFS (NFS) and serve the port that is adopted; Because the function ratio that NFS supports is more, and different functions all can use different programs to start, function of every startup will be enabled some ports and be transmitted data, therefore, the pairing port of the function of NFS is unfixed, take some ports that are not used at random and transmit data less than 1024, when server can be taken several ports at random when starting NFS, and initiatively register to the RPC of server side (remote procedure call), therefore RPC can know the NFS function of each port correspondence, RPC is again that the fixing port that uses is monitored the demand of client and repaid the correct port of client then, client just can directly be connected with server after understanding correct port; This portable terminal can be connected by the TCP/UDP agreement of IP network with remote server;
Directory creating unit 12 is used for setting up the mount point catalogue of estimating carry on described local mobile terminal; Correct transmit port is being determined to have set up in this directory creating unit 12, and which the shared file catalogue of scan N FS server has, understand local mobile terminal and whether can use these shared file catalogues, promptly utilize order: showmount realizes this process, on local mobile terminal 10, set up the mount point catalogue of estimating to want carry afterwards, as on local mobile terminal, setting up catalogue :/home/nfs/public;
Catalogue carry unit 13 is used for by described port the shared file catalogue of described remote server directly being mounted to described mount point catalogue; As can with remote server /home/public be mounted to local mobile terminal /the home/nfs/public catalogue under, that is to say, on local mobile terminal, open catalogue :/home/nfs/public, just can directly have access to remote server / data file under the home/public catalogue, on local mobile terminal, just can store the data of large-capacity data or secret like this, these data can be placed on the server fully, directly go to read in the server when needing to get final product.
This embodiment (is a handheld device with portable terminal, as mobile phone, PDA (Personal DigitalAssistant)) in some file leave on the server, the data of storing on the direct access server of handheld device so just do not need the process of data sync.And because data are placed in the server, can there be copy in this locality, like this when mobile phone is lost, the also risk that can not exist sensitive information to be leaked.
As shown in Figure 2, be a concrete structure schematic diagram of above-mentioned portable terminal 10 shown in Figure 1, this portable terminal 10 also comprises:
Login authentication unit 14 is used for sending the login authentication solicited message to described remote server, after obtaining the login authentication confirmation of described remote server, controls described remote procedure call unit and begins to consult with described remote server; When the client on the portable terminal 10 is initiated when server initiates to connect, can at first send the message of a login authentication to server, this message includes the username and password of login, if username and password is legal, server will return the affirmation information of an authentication success, after this, this portable terminal just can be held consultation with server, determine that local mobile terminal is connected with remote server and enjoys the port that NFS (NFS) service is adopted, client and server end be possible must possess identical number of the account can some catalogue of access or archives;
Authority acquiring unit 15 is used to obtain the access rights of the data under the described shared file catalogue;
Data access unit 16 is used for the access rights according to the data under the described shared file catalogue, and the data under the shared file catalogue of described remote server are directly visited; One station server can provide service for a plurality of portable terminals usually, therefore, corresponding authority is set in the visit of each portable terminal, when authority acquiring unit 15 sends when obtaining the request of authority to server, server can go to read corresponding catalogue, notify portable terminal with the access right that this portable terminal can be enjoyed, as, the user logins with the dmtsai user name in the client of portable terminal, when wanting the shared file data under the shared file catalogue of access server end, server end can attempt reading the shared file data of server end with identity such as the user UID of client and GID, if on the server identical number of the account and group are just arranged, then this moment the user can be directly with dmtsai (as, its corresponding UID is 501) identity carry out the access of the shared file that server provided; When if 501 these UID numbers of the account of server correspond to vbird, this user's of vbird that the dmtsai of client can the access server end shared file data then are only because both have identical UID; If server is not when having 501 these UID, then the identity of dmtsai can be compressed into the anonym under this catalogue, and the anonym of General N FS can be 65534 to be its user with UID, and the access to shared-file system just might be under an embargo like this.
Unloading unit 17 is used for unloading described shared file catalogue when detecting described catalogue carry unit and surpass a Preset Time threshold value and the shared file catalogue of described remote server directly is not mounted to described mount point catalogue; Can reduce the service time of a lot of unnecessary movement terminals like this, to save the power consumption of power supply.
As shown in Figure 3, the concrete structure schematic diagram for above-mentioned catalogue carry unit 13 comprises:
Automatic directory carry module 131 is used to dispose automatic carry parameter, according to described automatic carry parameter, directly is mounted in the described mount point catalogue by the shared file catalogue of described port with described remote server; As when the mobile terminal-opening,, just the shared file catalogue of server can be mounted to this locality automatically according to the configuration of automatic carry parameter;
Manually catalogue carry module 132 is used to dispose manual carry parameter, according to described manual carry parameter, directly is mounted in the described mount point catalogue by the shared file catalogue of described port with described remote server; Carry during except above-mentioned start, carry just during data that can certainly be on needing access server, promptly by the relevant manual carry parameter of configuration, make manual catalogue carry module 132 that the shared file catalogue on the server is mounted to this locality, in the needs visit, just remove carry like this, also can save the service time of portable terminal, the amount of saving energy.
The above embodiment of the present invention is by setting up NFS Client on portable terminal, set up NFS Server at server end, and set the authority of corresponding share directory, and when having NFS Client to initiate to connect, the user is authenticated, have only legal users could visit this catalogue; The user just can both can solve the not enough problem of memory capacity in the handheld device as the file on the local file access server on the visit handheld device, can increase the fail safe of data file simultaneously.
As shown in Figure 4, embodiments of the invention also provide a kind of server 20, and this server 20 is a nfs server, comprising:
Remote procedure call service unit 21 is used to portable terminal to specify described portable terminal to be connected with server and enjoys the port that NFS (NFS) service is adopted; This port is generally the port less than 1024, when server can be taken several ports at random when starting NFS, and the registration of the RPC to server side (remote procedure call) initiatively, therefore RPC can know the NFS function of each port correspondence, server is being determined with after portable terminal is connected the port that is adopted, with this port numbers notice portable terminal, so that can be connected and enjoy the NFS service with portable terminal;
Share directory setup unit 22 is used to set the shared file catalogue that described portable terminal is estimated carry; Data file under this shared file catalogue is used to be moved terminal and carries out access;
Data manipulation unit 23 is used for receiving by described port the access request to the data under the described shared file catalogue of described portable terminal, and according to described access request the data under the described shared file catalogue is operated accordingly.
As shown in Figure 5, this server 20 also comprises:
Login authentication service unit 24 is used for when receiving the login authentication information of described portable terminal transmission this portable terminal being carried out the legitimacy authentication, if authentication is passed through, then sends authenticate-acknowledge information to described portable terminal.
Rights management unit 25, be used for the data under the described shared file catalogue are carried out right assignment and management, when the mobile terminal side user logins with a certain user name, corresponding UID or GID will be searched according to this user name in this rights management unit 25, after finding UID or GID, this UID or the pairing user's of GID rights of using are distributed this login user.
Shared file lock cell 26 is used for the data under the described shared file catalogue are locked; Since because the NFS file of sharing can allow client use, when a plurality of clients attempt writing certain archives simultaneously, just might damage so, therefore can protect data with this unit to data.
The read-only unit 27 of shared file is used for being set at the data attribute under the described shared file catalogue read-only; Allow some client to read the shared file data, can certainly allow the client to visit shared file, promptly need be provided with again as lower unit at server end in erasable mode with read-only mode:
The erasable unit 28 of shared file is used for being set at the data attribute under the described shared file catalogue erasable;
Shared file recovery unit 29, when being used for data under described shared file catalogue and being destroyed, data under the described shared file catalogue are recovered, if when generation uses same shared file to cause file to damage to some extent because of client simultaneously, utilize this unit that file data is restored.
This server permission portable terminal is directly visited the shared file data on it, make the user terminal needn't be to portable terminal from the big data of server download capability, also not be used in and preserve private data on the portable terminal, these private data files can be kept on this server, make these private datas avoid the risk of being leaked.
As shown in Figure 6, embodiments of the invention also provide a kind of data access method, comprising:
Step S61 determines to be connected the port that is adopted with remote server;
Step S62 sets up the mount point catalogue of estimating carry;
Step S63 directly is mounted in the described mount point catalogue by the shared file catalogue of described port with described remote server;
Step S64 is by the data under the shared file catalogue of the described remote server of described mount point directory access.
This method directly is mounted in the mount point catalogue of local mobile terminal by the shared file catalogue with remote server, when making local mobile terminal open local directory, just can directly visit the file data under the shared file catalogue on the remote server, make portable terminal need not its file data that needs is downloaded to this locality, also need not at this locality preservation private data, these data are kept on the server, both guaranteed that portable terminal is not subjected to the restriction of local memory capacity to the visit of some data, had guaranteed also that private data is not revealed.
Carry out concrete detailed description again at said method below:
Step S71 sends the login authentication solicited message to described remote server;
Step S72 obtains the login authentication confirmation of described remote server;
Step S73, beginning is consulted with described remote server, determines that local mobile terminal and remote server enjoy NFS and serve the port that is adopted;
Step S74 sets up the mount point catalogue of estimating carry on described local mobile terminal;
Step S75 directly is mounted in the described mount point catalogue by the shared file catalogue of described port with described remote server;
Step S76 obtains the access rights of the data under the described shared file catalogue;
Step S76 according to the access rights of the data under the described shared file catalogue, directly visits the data under the shared file catalogue of described remote server; In access process, can adopt relevant instruction that certain data file is read, instruct as NFS_MSG_READ; Also can adopt relevant instruction that certain data file is carried out write operation, instruct as NFS_MSG_WRITE; Also can adopt relevant instruction to carry out reading of associative directory, as NFS_MSG_READDIR, concrete operating process can change according to different contents, does not repeat them here;
Step S77 detecting when surpassing a Preset Time threshold value and directly not being mounted to the shared file catalogue of described remote server in the described mount point catalogue, unloads described shared file catalogue, to save the service time of portable terminal.
One of ordinary skill in the art will appreciate that all or part of step that realizes in the foregoing description method is to instruct relevant hardware to finish by program, described program can be stored in the read/write memory medium of a portable terminal, this program is when carrying out, comprise step, described storage medium etc. as above-mentioned method embodiment.
The above is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from principle of the present invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.