1. Field of the Invention
The present invention relates to techniques on a structured document that can be used for performing communications between documents over a computer network. More particularly, the present invention relates to techniques for performing communications between documents in which displaying, editing and the like are performed in both sides of the documents without using a server-client scheme.
2. Description of the Related Art
In the past, the server-client scheme is generally used for performing communications on a computer network (refer to Japanese Laid-Open Patent Applications No. 2004-252877 (patent document 1) and 2004-235696 (patent document 2), for example). In addition, Japanese Laid-Open Patent Application No. 2003-15941 (patent document 3) that was filed by the applicant discloses a structured document (encapsulated document) to which a program is added.
Currently, communication techniques between computers such as the Internet are developed so that various information are transmitted as digital information to be used. In the techniques, IP (Internet Protocol) and TCP (Transmission Control Protocol) are particularly advanced so that communications between computers are generally performed by TCP/IP. In the TCP/IP, a communication partner on the computer network is specified by an IP address and a port number so that a communication route is virtually determined so as to perform communications.
Generally, when communications are performed between computers, there are a server that waits for a connection and a client that connects to the server. The WWW (World Wide Web) server on the Internet monitors a port 80 to wait for a connection. On the other hand, a general personal computer that is a client connects to a destination server by the port 80 with an application program called Web browser so as to obtain and display a Web page. Such scheme is called the server-client scheme.
Other than the server-client scheme, a P2P scheme is used in which personal computers are connected with each other in a peer-to-peer fashion. However, since a connection is established based on a combination of the IP address and the port number in these schemes and the connection is established based on a particular port, there is a fear that an illegal access may occur when the port number is known by a third party. In view of this technical background, the patent document 1 discloses a technique to prevent illegal access by changing the port number periodically.
In addition, the patent document 2 discloses a file transfer communication service for specifying a same port number in both ends of communication terminals so as to perform priority control and bandwidth assurance for communications using the port number.
By the way, an application of the present invention is network communications using documents. Generally, the document dealt with by a computer is a digital information file complying with a standard file format. As shown in
That is, generally, the document file can be used by using such application program, and the document file itself is merely digital data including contents of a document. The document file can be displayed, generated, and edited only by using such application program.
As disclosed in the patent document 3, the applicant has proposed an encapsulated document in which a program for displaying and operating the document is added to the document file. In general, the document file has a structure shown in
By the way, conventionally, communications on the network are performed using particular network communication application programs 3 and 4 as shown in
In view of the conventional communication techniques and the above-mentioned conventional encapsulated document technique, it is useful if communications can be performed between documents over a network by adding network communication functions to the encapsulated documents. An object of present invention is to realize enhanced document communications by providing an optimal method for realizing network communication functions of encapsulated documents (structured documents).
The object is achieved by a structured document used in a terminal apparatus including a network function including a socket waiting unit for waiting for socket connection at a predetermined port number and a socket connecting unit for connecting to a socket at the predetermined port number, the structured document including a program part and a contents part, the program part including:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information.
The object is also achieved by a terminal apparatus including a network function including a socket waiting unit for waiting socket connection at a predetermined port number and a socket connecting unit for connecting to a socket at the predetermined port number, and further including a structured document and a launching program, the structured document including:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information, and
the launching program including a unit for causing the terminal apparatus to execute program code in the structured document.
According to the present invention, enhanced document communications can be realized by providing an optimal method for realizing network communication functions of encapsulated documents (structured documents).
Other objects, features and advantages of the present invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings, in which:
In embodiments of the present invention, by adding network communication functions to the encapsulated document, network communications can be performed among documents 5, 6 and 7 as shown in
In a file structure of the encapsulated document including contents of a document and program code, there are transfer program code 15 and send/receive program code 16 as program codes as shown in
That is, as shown in
In addition, as shown in
The send/receive process can also send/receive information via the network without using the transfer process. In this case, more connections become necessary as shown in
Next, configuration and operation of the transfer process and the send/receive process are described. As shown in
As shown in
In this checking, the transfer process may ask the operating system in the computer about operating status of processes. Since a socket waiting thread is waiting for a socket connection at a particular port when another process is operating as described later, the transfer process may detect this. Generally, a computer cannot wait for plural socket connections with a single port, because if different programs connects to the single port, information to be sent/received are mixed.
When another transfer process is operating (Y in step 11), the transfer process is ended. When another transfer process is not operating (N in step 11), a socket waiting thread for waiting for a socket connection starts in step 12 so that the socket waiting thread operates in step 13, and an information distribution thread for distributing information received by a socket starts in step 14 and the information distribution thread operates in step 15 so that the launching operation for the transfer process ends.
Both of the terms “process” and “thread” are terms on multitask functions on general operating systems. The “process” operates independently and does not share a memory with another process. Plural threads can operate concurrently in the process and share a memory among threads as shown in
Next, the send/receive process is described. As shown in
Next, the socket waiting thread, the information distribution thread, the receive thread and the send thread are described. As shown in
Next, the socket waiting thread monitors a connection request at the obtained port number until the connection request occurs in steps 26 and 27. When the connection request occurs, the receive thread and the send thread are launched as shown in
As shown in
Next operation of the receive thread and the send thread of the send/receive process in
For example, in addition to the operation for socket connection and thread launching shown in
Accordingly, as shown in
In addition, the receive thread 37of the send/receive process sends the received information to the display panel 35, so that the display panel 35 displays the received coordinate information as a line segment. Then, the socket waiting unit of the transfer process establishes connections for connection requests from plural send/receive processes. In this example, since processes are connected as shown in
Accordingly, when a mouse is moved for writing on a display component, a line segment is displayed on plural components at the same time. That is, as shown in
Information transmission between the transfer process and the send/receive process is described so far. Next, communications between transfer processes are described. That is, so far, operation is described in which the transfer process is connected to the send/receive process by sockets based on a connection request by the socket connecting unit of the send/receive process, so that the send/receive process sends/receives information to other send/receive process via the transfer process.
On the other hand, in this case, as shown in
More particularly, as shown in
In this case, the send thread and receive thread that perform send/receive operation using sockets connected by the socket waiting unit are not substantially different from the send thread and receive thread that perform send/receive operation using sockets connected by the socket connecting unit. They are different only in a point whether socket connection is established passively by the socket waiting unit or socket connection is established actively by the socket connecting unit.
In addition, in a transfer process, there is no difference between send/receive threads used when transfer processes connect each other and send/receive threads used when the transfer process connects to the send/receive thread. That is, each thread performs in the same way in the transfer thread.
Next, an information transmission method including the before-mentioned connection request is described. Each of the transfer process and the send/receive process transmits information of a format shown in
By using the send source ID, a send source can be identified so that it can be used for discarding unnecessary information. The send destination ID can be used for sending information to a particular destination. The send No is a serial number of information to be sent. By using the send No, information that has not yet been sent can be detected. The send information size can be used for specifying a size of the send information.
By using such format of the information, a terminal which receives the information can ascertain what type of information is received by checking the items in the format even though the contents of the information are not known. This format is an example for explanation, and other formats can be used.
Next, the message number that indicates a type (kind) of the information is described. As shown in
Accordingly, the send/receive unit can connect to arbitrary transfer process, and can receive or block information. That is, the send/receive process sends information having a format shown in
That is, the transfer process waits for a connection at a specific (predetermined) port, and uses a socket connecting unit to establish a socket connection based on the message of number “2” send from the send/receive unit, so that the transfer process can connect to arbitrary transfer process. In addition, after they are connected, information can be properly distributed according to the format of the message.
Next, portions for determining operation according to the messages are described. For this purpose, the procedure shown in
More particularly, as shown in
Accordingly, send information is generated as a form of the message of the format shown in
Operation corresponding to the type of the message can be extended as described in the following. In this case, the transfer process includes a receive program locate unit 60 as shown in
More particularly, when the program code is based on a dynamic library of binary code, the program code is loaded onto a memory and is linked, and can be loaded when necessary. When the program code is intermediate code like JAVA, the intermediate code can be loaded onto the memory by a class loader.
In this example, it is assumed that the message number “10” indicates an extension program message. When the information distribution unit obtains a message of the number 10 from the send buffer (Y in step 78), the information distribution unit obtains the code from the message as shown in
That is, when the information distribution unit receives a message having a message number from 11 to 100 (Y in step 80), the information distribution unit passes process to the function of the extension program in step 81. Accordingly, the send/receive process can cause the transfer process to perform a special process as necessary.
In addition, as shown in
The extension program code may be configured to perform a process for encrypting a send message as necessary, or may be configured to change the send thread, the receive thread, the socket waiting thread and the socket connecting thread and the like of the transfer process to another schemes. Accordingly, the protocol used for network communications by the transfer process can be dynamically changed.
In addition, for example, by using the extension program code, the port number can be changed as necessary, sending order can be changed according to priority, and the communication scheme can be changed from a connection type send scheme such as TCP(Transmission Control Protocol) to non-connection type send scheme such as UDP (User Datagram Protocol) according to a type of information. In addition, the extension program may be used for purposes other than communications.
In addition, for example, as shown in
Accordingly, common components can be shared with more send/receive processes. In addition, by sharing the components, consumption of a memory can be reduced. In addition, by devolving IO access to the transfer process, access right of the send/receive process are tightened so that only the transfer process is allowed to perform IO access. Accordingly, it can be prevented that an illegal program is mixed into the send/receive process.
In the following, an embodiment of the present invention is described taking an encapsulated document including transfer program code and send/receive program code as an example. The encapsulated document is one like the encapsulated document shown in
From the viewpoint of versatility, it is desirable that each program code is described using an intermediate language such as JAVA. In addition, generally, it is desirable that the definition information is described using XML (extensible Mark-up Language) that is a meta-information description language. The contents information includes the contents of the document, and it is desirable that the document layout is described using XML, SGML (Standard Generalized Markup Language), HTML (HyperText Markup Language), SVG or the like, and that still images are stored as JPEG, TIFF or the like, and moving images are stored as MPEG or the like. In addition, it is desirable that each content is stored separately in a versatile format.
These pieces of information are integrated into a file with a proper encapsulation unit so that the encapsulated document is generated. It is desirable to use a versatile archive structure such as ZIP for the encapsulation unit. Accordingly, the encapsulated document can be processed and edited easily. As to a conventional digital document, a document editing application needs to be used for editing images in the document. On the other hand, as to the encapsulated document in this embodiment, since the versatile format is used, an application dedicated to image editing can be used so that advanced editing can be available.
For launching such encapsulated document, a launching program 80 is necessary as shown in
First, when a user clicks an encapsulated document that the user wants to view with a mouse and the like to instruct viewing, the SHELL system of the OS launches the launching program associated with the document file so that the launching program launches the start program of the encapsulated document as an independent process, and the launching program transfers operation and ends its operation in step 90 as shown in
Next, as shown in
Accordingly, the encapsulated document process launches the transfer process in step 97. In addition, the encapsulated document process sends/receives information to/from the transfer process via the send/receive program based on the definition information (steps 98, 99), and the transfer process sends received information to a transfer process in another computer and the transfer process executes received extension program code (steps 100-103). In addition, the extension program may be executed in the transfer process or may be executed in the encapsulated document process.
In addition, by adopting the structure in which the transfer process and the code of the send/receive program that accesses the transfer process are stored in the encapsulated document, information can be sent/received flexibly, and a program can be shared with a plurality of documents. In addition, the transfer process sends the extension program to another computer as necessary so that program sharing in the whole network can be performed easily.
By the way, in the above descriptions using flowcharts, ending of each process and thread, and error processing are not described since these are not relevant to the substance of the present invention. In addition, as to the types of the message, the types can be added as necessary.
For sending information received by a receive thread of the transfer process as send information, it is not necessary to send the information to a send thread that is paired with the receive thread that receives the information, and, when transferring information, it is necessary to transfer the information optimally. These can be properly processes using send source information of the message. According to these, although various examples can be considered according to applications, since these are not relevant to the substance of the present invention, these examples are not described.
Although an example of writing is described as a using method of the document, it is needless to say that the present invention is not limited to the writing example. Since the send/receive program can send/receive any user operation such as text editing, page switching, image scaling and the like to/from the transfer process, various information entered into a computer can be shared among encapsulated documents.
That is, in the past, digital documents are handled on a local computer and distributed via a network as necessary. On the other hand, according to the embodiment of the present invention, information can be dynamically exchanged between documents via the transfer process and via the network.
In the following, more concrete examples using the configuration for performing communications between documents are described. In the examples, documents like ones shown in
First, as shown in
After that, by sending a message like one shown in
More concretely, when a document is launched, an image of the document is displayed as shown in
When the user pushes the connection button 90, an input frame is displayed as shown in
After the connection partner is determined in this way, a connection request is sent to the communication partner in an after-mentioned way, so that a frame for entering connection permission is displayed in the document B side that is the connection destination as shown in
Such operation can be performed by sending and transferring messages shown in
When the send/receive process receives the connection request message, the send/receive process displays the permission request frame as shown in
That is, the send/receive process generates the message shown in
As to an example for the writing display operation by a mouse operation, when writing operation is performed, a message is generated. The send/receive process sends the message to the transfer process in step 126, the transfer process transfers the message to the transfer process of a communication partner in step 127. Then, the transfer process of the partner transfers the message to the send/receive process in step 128 so that the writing information can be transmitted. Thus, by displaying the information, writing information can be displayed on both of the documents. Similar communications can be also performed among more than two documents. As to leave from communications, when the leave button is pushed in the document B side, the leave message is sent from the send/receive process of the document B to the send/receive process of the document A via the transfer processes (steps 129-131).
In addition, a document generation program for generating the encapsulated document is described with reference to
In
Therefore, enhanced document communications can be realized by providing an optimal method for realizing network communication functions of encapsulated documents (structured documents).
According to the embodiment of the present invention, a structured document is obtained. The structured document is used in a terminal apparatus including a network function including a socket waiting unit for waiting for socket connection at a predetermined port number and a socket connecting unit for connecting to a socket at the predetermined port number, and the structured document includes a program part and a contents part, and the program part includes:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information.
In the structured document, the program part may include:
program code for causing the terminal apparatus to function as a receive program locating unit for executing an arbitrary program code included in information received from a connected socket;
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information.
In the above-mentioned structured documents, the program part may further includes program code for causing the terminal apparatus to function as a detection unit for detecting whether the program code corresponding to the information distribution unit is operating.
In the above-mentioned structured documents, the program part may further includes program code for causing the terminal apparatus to function as an execution unit for determining execution of the program code corresponding to the information distribution unit based on the result of detection by the detection unit.
Also, in the above-mentioned structured documents, the program part may further includes program code for causing the terminal apparatus to function as a port number setting unit for holding predetermined port number setting information so as to set the predetermined port number.
In the above-mentioned structured documents, the program part may further includes program code for causing the terminal apparatus to function as a port number obtaining unit for obtaining the predetermined port number in the terminal apparatus.
In the above-mentioned structured documents, the information sent and received by the information send and receive unit includes distribution method determination information used for determining a distribution method of the information distribution unit, and the program part may further include program code for causing the terminal apparatus to determine a distribution method based on the distribution method determination information.
In the above-mentioned structured documents, the program part may further includes program code for causing the terminal apparatus to determine a connection destination of the socket connecting unit for the information send and receive unit based on information received from the connected socket so as to establish a new connection.
According to an embodiment of the present invention, a terminal apparatus is also provided. The terminal apparatus includes a network function including a socket waiting unit for waiting socket connection at a predetermined port number and a socket connecting unit for connecting to a socket at the predetermined port number, and further including a structured document and a launching program, and the structured document includes:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information, and
the launching program including a unit for causing the terminal apparatus to execute program code in the structured document.
The structured document may include:
program code for causing the terminal apparatus to function as a receive program locating unit for executing an arbitrary program code included in information received from a connected socket;
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to the socket waiting unit for the information distribution unit so as to send and receive information, and
the launching program including a unit for causing the terminal apparatus to execute program code in the structured document.
According to an embodiment of the present invention, a program for causing a computer to generating a structured document that is used in a terminal apparatus is also provided, and the program includes code for forming a program part and a contents part in the structured document, and the program part includes:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to a socket waiting unit in the terminal apparatus for the information distribution unit so as to send and receive information.
As to the program, the program part may include:
program code for causing the terminal apparatus to function as a receive program locating unit for executing an arbitrary program code included in information received from a connected socket;
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to a socket waiting unit in the terminal apparatus for the information distribution unit so as to send and receive information.
According to an embodiment of the present invention, an apparatus for generating a structured document that is used in a terminal apparatus is also provided. The apparatus includes a unit for forming a program part and a contents part in the structured document, and the program part may include:
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to a socket waiting unit in the terminal apparatus for the information distribution unit so as to send and receive information.
As to the apparatus, the program part may include:
program code for causing the terminal apparatus to function as a receive program locating unit for executing an arbitrary program code included in information received from a connected socket;
program code for causing the terminal apparatus to function as an information distribution unit having a transfer unit for sending information received from a connected socket to another connected socket; and
program code for causing the terminal apparatus to function as an information send and receive unit for connecting to a socket waiting unit in the terminal apparatus for the information distribution unit so as to send and receive information.
The present invention is not limited to the specifically disclosed embodiments, and variations and modifications may be made without departing from the scope of the present invention.
The present application contains subject matter related to Japanese patent application No. 2005-303374, filed in the JPO on Oct. 18, 2005, the entire contents of which are incorporated herein by reference.
Number | Date | Country | Kind |
---|---|---|---|
2005-303374 | Oct 2005 | JP | national |