Background technology
Along with developing rapidly of network infrastructure and internet, the computing equipment that is distributed in the network becomes increasingly abundant.The network terminal of accesses network application service no longer is confined to personal computer, and comprises multiple thin client computing devices such as network computer, graphic terminal, handheld device.Use network terminal access various network to use and become the important way that people obtain information and service.Many network terminals are used the demonstration that not only relates to user interface, need to support the remote equipment visit simultaneously.
Terminal system is a kind ofly to run application on server, system by terminal equipment mouse beacon and keyboard, in this system, the operation of mouse and/or keyboard is delivered to server, and the running and the operation result of application program on the server shown on terminal.Early stage terminal is a character terminal, the videotex user interface, and present terminal is a graphic terminal, supports graphical user interface.Terminal is that the terminal system of graphic terminal also can be referred to as GTS.
In the implementation of the application program of GTS, application program realizes that on application server the target of application access is the equipment on the server, and the terminal use often wishes that application program can realize mutual with the equipment of terminal this locality.Must consider it is to adopt the device redirection technology to the solution of this problem.So-called device redirection promptly refers to application program the visit of server apparatus to be mapped as the visit to the terminal local device by network service, and this mechanism satisfies the transparency to application.
In terminal environments, applied logic occurs on the server, so the consumption of resource is also mainly on server.Therefore, the single server environment often can't be supported a large amount of terminal accesses, and server becomes access to netwoks and uses the bottleneck that calculates, and in order to eliminate this bottleneck, has proposed the multi-node intelligent network application service system.So-called multi-node intelligent network application service system, the node set of forming by a plurality of service nodes that can carry out cast communication each other.In the equipment control of multinode application service system, each service node is divided into host node and auxilliary node according to the difference of function.The node of creating end-user session is the host node of this user conversation; The node at the application program place of being called in the user conversation is auxilliary node.The distribution of nodal function is relevant with concrete end-user session, and for certain node, in an end-user session, this node is a host node, and in another end-user session, this node just may be auxilliary node.
In the multi-node intelligent network application service system, taking along with the distribution of application program of resource is distributed in the service system, just avoided the bottleneck problem of single server resource occupation on network topology.But the distribution of application makes original device redirection method can't satisfy the demand of multinode intelligent use service, therefore needs design to realize satisfying the device access mechanism of using in the multinode service environment the requirements for access of equipment meanwhile.
Summary of the invention
The purpose of this invention is to provide a kind of remote-apparatus access method in the multi-node intelligent network application service system, be implemented in the multinode network visit remote equipment.
To achieve these goals, the remote-apparatus access method in a kind of multi-node intelligent network application service system of the present invention comprises:
Step 1) user creates the user conversation process by the some nodes in the terminal login multi-node intelligent network application service system on node, this node is designated as host node;
Step 2) user sends application start message on host node, starts the application program on a certain node in the multi-node intelligent network application service system, and this node is designated as auxilliary node;
The operating system intercepting application program of the auxilliary node of step 3) is to the request of opening of local node equipment, and the equipment that calls among the auxilliary node driving agency is opened interface, and by the session inquiry, auxilliary node obtains the link information of host node;
The driving of the auxilliary node of step 4) is acted on behalf of transmitting apparatus connection request message to host node, to terminal equipment, terminal equipment is initiated according to equipment connection request message and is assisted being connected between the node driving agency with this equipment connection request forwards for session masters process in host node and user conversation process;
The step 5) application program is by being connected access terminal equipment between terminal equipment and the auxilliary node.
In the technique scheme, in described step 2) in, described user launches application is meant that host node sends application start message to auxilliary node, auxilliary node checks whether host node and auxilliary node are same nodes after receiving application start message, if host node and auxilliary node are same nodes, by the session process initiation application program on the host node, if host node and auxilliary node are not same nodes, then check on the auxilliary node whether the session proxy process is arranged, if there is not the session proxy process, then on auxilliary node, create the session proxy process, by the session proxy process according to the message initiated application program of application start.
Described application start message comprises session tokens, and the relevant information of the session that login user creates is arranged in the session tokens, and auxilliary node is created the session proxy process according to session tokens.
In the technique scheme, in described step 3), described session inquiry is meant and drives the session Query Information that the session masters process of agency in auxilliary node sends band application process sign, the session masters process obtains the link information of host node according to the session Query Information, drives the agency by inquiry feedback message notice.
Described inquiry feedback message comprises the listening port number of session identification, host node address and host node.
In the technique scheme, in described step 4), described equipment connection message comprises the listening port number of session identification, auxilliary node address and auxilliary node.
In the technique scheme, in described step 5), determine the concrete equipment of visit before the application access terminal equipment by device access message, device access message comprises device type, access type and the information relevant with access type.
The invention has the advantages that:
1) realized that in the multi-node intelligent network application service system visit of remote equipment is had very strong versatility.
2) among the present invention between application service system and the terminal network establishment of connection initiate by terminal, the support terminal network environment connects by gateway and wide-area applications service system, and application is expanded to wide area network by local area network (LAN).
3) system extension of the present invention is strong, can dynamically add service node on the basis of system framework of the present invention, can enlarge the terminal use's of interactive application scale.
Embodiment
In the multi-node intelligent network application service system, voice applications is a kind of important use.Be example with a mp3 player software player below, the concrete steps of the inventive method are illustrated.
In the example of a voice applications, the topological structure of multi-node intelligent network application service system as shown in Figure 1, have two nodes in the system, be designated as node 1 and node 2 respectively, if the IP address of node 1 is ipaddr1, the IP address of node 2 is ipaddr2, and application program player is installed on the node 2; Also be connected with terminal equipment in the system, this terminal equipment is labeled as terminal 3.In this system, as shown in Figure 3 to the specific implementation of remote equipment visit.
Step 100, user login the multi-node intelligent network application service system, the node that the first login of user is visited is exactly a host node, user conversation process of session masters process creation in the host node realizes the registration of user conversation, the corresponding specific user conversation of user conversation process.Communication pipe between process is arranged between session masters process and the session process.
In the embodiment of voice applications, to establish the user and create session a by terminal login node 1, node 1 is exactly a host node.In the process of creating session a, the session process of the session masters process creation user conversation a in the host node.
Step 200, the application program that starts.The user starts application program on host node, the node at institute application program started place is auxilliary node.The user is when starting application program, and host node includes the message of the session tokens and the application program started of wanting to auxilliary node transmission application start message in the application start message, and the relevant information of the session that login user creates is arranged in the session tokens.If auxilliary node and host node are same node (being that user institute application program started is just on host node), then directly start application program by the session process in the host node, if auxilliary node and host node are not same nodes, then check on the auxilliary node whether the session proxy process is arranged, if there is not the session proxy process, then utilize session tokens in the relevant information of assisting recording conversation on the session masters process of creating the session proxy process on the node and assisting node, thus the application program on the auxilliary node of application start message startup that session proxy process reception host node sends.Details about application program launching can be with reference to the separate case application that is entitled as " the application management subsystem in the multi-node intelligent network application service system ".
In the embodiment of voice applications, user conversation a starts application program player on host node, and this application program is installed on the node 2, so node 2 is auxilliary node.In the session process of the session a on the node 1 session masters process by node 2 application start message is sent on the agent process of session a of node 2, by this session proxy process initiation application program.
Step 300, session inquiry.Application program on the auxilliary node need be opened corresponding apparatus and operate when carrying out, at this moment, the operating system intercepting application program of auxilliary node is to the request of opening of local node relevant device, the equipment that calls among the driving agency of this node is opened interface, drive the session Query Information that the session masters process of agency in auxilliary node sends band application process sign, the session masters process is inquired about the session masters process communication port information that obtains host node according to session identification, and this information is back to the driving agency.
In the voice applications example, shown in the process 10 of Fig. 1, the audio frequency apparatus that application program player on the auxilliary node (node 2) need open a terminal when carrying out, the operating system intercepting application program player of auxilliary node is to the request of opening of the audio frequency apparatus of local node, then the equipment that calls among the driving agency who assists node is opened interface.Then, shown in the process among Fig. 1 20, the driving of auxilliary node agency sends the session query messages to the session masters process of this node, has the application process sign in this message; The session masters process receives the session query messages, according to application process sign inquiry session record wherein, session identification under obtaining to use, return the inquiry feedback message and give the driving agency, it is the host node at the session place of invokes application that notice drives which node of agency, should send out connection request to the session masters process of which node.Comprised in the session identification and driven the required link information that communicates with host node session masters process of agency, in the present embodiment, session identification can specifically be defined as (sessionId, ipaddr1, port1), wherein sessionId represents session identification number, the session identification number of each session has nothing in common with each other, ipaddr1 is the IP address of host node, the IP address of node 1 just, and port1 is used to monitor the listening port number that drives proxy message in the host node.
In the methods of the invention, the general structure of message definition is as shown in table 1:
Table 1
Type |
Length |
The message relevant information |
1 byte |
4 bytes |
Variable-length |
Wherein, type is used to indicate the kind of message, and " message relevant information " is relevant with type of message, and it has defined the particular content of message, and the defined details of dissimilar message has nothing in common with each other, and length only refers to the length of " message relevant information ".
In step 300, there are session query messages and inquiry feedback message, in the inquiry feedback message, comprised aforesaid session identification.The concrete definition of session query messages is as shown in table 2, the length of the numeral message field in (), and unit is a byte:
Table 2
Type |
Length |
Application process number (4) |
MSG_QUERY |
4 |
pid |
The concrete definition of inquiry feedback message is as shown in table 3:
Table 3
Type |
Length |
Session identification (4) |
Host node IP (16) |
Host node port (4) |
MSG_QUERY_R |
24 |
sessionId |
Ipaddr1 |
Port1 |
Step 400, equipment connect.Auxilliary node transmitting apparatus connection request message is to host node, by host node with this equipment connection request forwards to terminal equipment, terminal equipment is initiated and is assisted node and drive being connected between acting on behalf of.In the voice applications example, the detailed process that equipment connects is as follows.
Shown in the process among Fig. 1 30, in step 300, the driving of auxilliary node agency obtains the communication port message of host node session masters process according to session identification.By this information, the driving agency who sets up auxilliary node and host node session masters process be connected and to host node session masters process transmitting apparatus connection message, auxilliary then node is set up monitoring mechanism, monitoring comes the equipment connection request of self terminal.Comprising session identification number and monitoring information in the equipment connection message, the equipment connection message is defined as that (port3), wherein port3 is an auxilliary node listening port number for sessionId, ipaddr2.The definition of equipment connection message is as shown in table 4:
Table 4
Type |
Length |
Session identification (4) |
Auxilliary node IP (16) |
Auxilliary node port (4) |
MSG_DEV_CON |
24 |
sessionId |
Ipaddr2 |
Port3 |
Shown in the process among Fig. 1 40, in host node, the session masters process is received the equipment connection request message that the driving agency of auxilliary node is sent, session masters process in the host node will send to the session process of the session a that starts application program by the communication pipe between host node master control process and user conversation process from the equipment connection request message that auxilliary node obtains according to session identification under the application in the conversation recording.
Shown in the process among Fig. 1 50, in host node, the session process of session a finds corresponding terminal equipment according to equipment connection request message, and equipment connection request message is sent to terminal.In voice applications embodiment, terminal equipment can be audio frequency apparatus or other relevant terminal equipments.
Shown in the process among Fig. 1 60, terminal obtains equipment connection request message, parse the driving agency's who includes auxilliary node in this message monitoring information (ipaddr2, port3), comprise in the monitoring information to drive and act on behalf of the auxilliary IP addresses of nodes in place and listening port number, terminal utilizes this monitoring information to send connection request to the driving agency of auxilliary node, the driving agents listen of auxilliary node just connects at auxilliary node and terminal room behind connection request, and safeguard this connection, this connection and binding session, as long as session is in connection status, drives the agency keep always with just being connected of terminal room.
Step 500, device access.Drive being connected between the agency by terminal with auxilliary node, drive the transmitting apparatus access message access terminal equipment of acting on behalf of.The access logic of application program can comprise the operation of all device access, has defined device type and device access type in the device access message, satisfies application program in the same session to the concurrent visiting demand of distinct device.
Shown in the process among Fig. 1 70, when application program player plays mp3, need call the write interface of driving, therefore the device access type definition is DEV_WRITE, simultaneously open interface by MAJOR and MINOR macrodefinition at equipment, the primary and secondary device number of acquisition equipment can be distinguished device type by the device number of operating system definition.For example, the primary and secondary device number of audio frequency apparatus/dev/dsp is respectively 14 and 3, and device type definition is DEV_DSP; The primary and secondary device number of audio mixing equipment/dev/mixer is 14 and 0, and device type definition is/DEV/MIXER.Device type and device access type all are recorded in the device access message, utilize terminal and auxilliary node to drive then and are connected the transmitting apparatus access message between the agency, and the access logic of using is mapped to terminal, realize the visit to concrete equipment.Device access message generic definition is as shown in table 5:
Table 5
Type |
Length |
Device type |
Access type |
The visit order relevant information |
1 byte |
4 bytes |
2 bytes |
1 byte |
Indefinite |
In one embodiment, when audio frequency apparatus is done write operation, once write 4096 byte datas, it is as shown in table 6 that equipment is write the definition of message:
Table 6
Type |
Length |
Device type (2) |
Access type (1) |
Writing data quantity (4) |
Voice data (4096) |
MSG_DEV_OP |
4153 |
DEV_DSP |
DEV_WRITE |
4096 |
data |
The foregoing description has been described under single user conversation situation, to the access method of remote equipment, in actual use, also has the situation of multi-user conversation.Multi-user conversation exists following characteristics: the session difference that different terminals lands, but different sessions may be safeguarded by identical host node; The auxilliary node at each login user institute application program started place may identical also possibility difference.
Though multi-user conversation exists These characteristics, concrete workflow and single user conversation of visiting for remote equipment do not have essential distinction, at this it are done concise and to the point description.
In another embodiment, be illustrated in figure 2 as the situation of dual user session.In this embodiment, two users are arranged, created the session process of session c and the session process of session d respectively by node 4 login systems.For these two user conversations, node 4 all is a host node.The session process initiation of session c the application on node 5, node 5 is auxilliary nodes of session c, the session process initiation of session d the application on the node 4, so 4 couples of session d of node are host node, are again auxilliary nodes.In Fig. 2, solid line is represented the message flow of session c, and dotted line is represented the message flow of session d.Comparison diagram 1, session c does not have essential distinction to the browsing process and the session a of remote equipment, so be not described in detail.For session d, session d by the application on the session process transfer node 4 after, the application call relevant device of session d is operated, the call request of the operating system intercepting equipment of node 4, call the equipment that drives among the agency and open interface, drive the agency (at this moment to node 4, the auxilliary node of node 4 conducts) session masters process sends the session query messages, the session masters process identifies the affiliated session identification that is applied according to the application process in the session query messages, and session identification returns to and drives the agency under will using by the inquiry feedback message, and the connection message of host node session masters process is acted on behalf of in the notice driving.Because node 4 is a host node is again auxilliary node, therefore the driving of node 4 agency is connected with the session masters process of node 4 once more, and transmitting apparatus connection message, the session masters process of node 4 sends to the equipment connection message session process of session d by pipeline, session process by session d sends to the terminal 7 that will connect with this connection message, is initiated the connection between the driving agency of node 4 by terminal 7; Last application by session d realizes the visit to terminal 7.