This patent application is based on and claims priority pursuant to 35 U.S.C. §119 to Japanese Patent Application No. 2012-002385, filed on Jan. 10, 2012 in the Japan Patent Office, the entire disclosure of which is hereby incorporated by reference herein.
1. Field of the Invention
The present invention relates to a network communications apparatus, method, and medium.
2. Description of the Background Art
Conventionally, computer systems embedded in home appliances and machines to implement specified functions (hereinafter referred to as “embedded systems”) can utilize only limited resources to achieve energy saving. It should be noted that “resources” here means memory capacity, processing speed of Central Processing Units (CPUs) etc., and hard disk capacity necessary to have any software and hardware work.
Recently, embedded systems have become multifunctional and are required to deal with a plurality of kinds of data on a network and satisfy stringent performance requirements in real time. A technology of reducing resources by separating a network communication unit from an application unit and sharing network communication units has been proposed (e.g., JP-2004-005503-A.)
The purpose of the technology described in JP-2004-005503-A is to provide a novel image forming/processing apparatus that makes it easier to develop and add applications that provide web services. More particularly, the image forming/processing apparatus is comprised of a plurality of method processing units that execute predefined processes according to a method and a web service executing unit that executes the web service by dividing processing requests among the method processing according to the method specified by the processing request in response to the processing request.
However, in the technology described in JP-2004-005503-A, transfer cannot be controlled by allocating appropriate resources for each different kind of data transmitted and received via a network only by sharing communication units. Therefore, handling multiple different kinds of data in the same manner results in using limited resources in vain, and satisfactory performance cannot be achieved for data that requires high transfer speed and real-time response.
The present invention provides a novel network communications apparatus, method, and medium that can improve network communication performance and real-time response in embedded systems.
More specifically, the present invention provides a network communications apparatus that includes a LAN interface that transmits and receives data via a network, a plurality of memory resources to transfer data to an application, an analyzing unit that divides data to be sent and received data into a control part and a content part and analyzes the control part, a storage unit that stores rules to determine a resource to be used and transfer control method in accordance with characteristic of the data to be sent and the received data, and a controller that transfers the content data to the application in accordance with a result of analyzing the control part of the data to be sent and the received data and applying the rule.
A more complete appreciation of the disclosure and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in conjunction with the accompanying drawings.
In describing preferred embodiments illustrated in the drawings, specific terminology is employed for the sake of clarity. However, the disclosure of this patent specification is not intended to be limited to the specific terminology so selected, and it is to be understood that each specific element includes all technical equivalents that have the same function, operate in a similar manner, and achieve a similar result.
An embodiment of the present invention will be described in detail below with reference to the drawings.
The projector 1 determines a resource to be used and transfer control method based on Table 1A and 1B by analyzing only control part of data received by the communication unit 2 and recognizing characteristic of content data.
Resources to be used as a key point of the network communications apparatus of this invention are described below.
SRAM_DATA is memory used in generic processing operations of the communication unit. SRAM— TOE and SRAM— LAN are memory used to transmit/receive data with a LAN interface. SRAM_WHIO is memory used to transfer data to the application unit 3. In this embodiment, this memory is logically divided into small size (2 KB) and large size (16 KB) spaces.
Table 1A and 1B illustrate characteristics of content data, resource to be used, and transfer control methods. Operation objectives, operation methods, MIME types, and names of sub-systems that include operation objectives are listed as characteristics of content data. Whether or not control information is included in transfer data, buffer to be used, and patterns of dataflow are listed as resources to be used and transfer control methods.
In Table 1A, “/service/projection”, “/state”, and “/property” in the operation objective column indicate Uniform Resource Locators (URLs).
Also, in Table 1A and 1B, “still image” indicates a JPEG image, and “PC screen” indicates a moving image.
In Table 1A and 1B, “Acquire status of projection job” indicates a command to acquire status of projection job of a projector. The projector has a function that acquires status of projection job remotely as one of its administrative functions. Specifically, information that indicates that projection job has started and can be interrupted can be acquired.
In Table 1A and 1B, “Acquire device status” indicates a command to acquire device status of the projector. The projector has a function that acquires device status remotely as one of its administrative functions. Specifically, information that indicates device specifications and settings can be acquired.
In Table 1A, “POST”, “PUT”, and “GET” in the operating method column indicate examples of data operating methods. HTTP methods are associated with data operating methods in this embodiment.
In Table 1B, the “large” and “small” that indicate the amount of space in the buffer to be used are purely examples, and they can be divided into smaller sizes. The point is to use appropriate buffer resources in accordance with the content of the data. For example, 16 KB can be used for dealing with projected data in No. 2 and 3. In commands such as No. 1, 4, 5, and 6, more processes can be executed concurrently by using 2 KB size of buffer. If 16 KB buffer is used for all cases, less processing can be executed concurrently due to memory limitation.
“Generate projection job”, “projected data (still images and PC screens)”, “update projection job”, “acquire status of projection job”, “delete projection job”, “acquire device status”, “change device status”, “acquire device information”, and “change device information” are listed as content of data. It should be noted that data flow patterns will be described later.
Among these modules, the USER communication module 204 depends on the device module 202, and the encryption/certificate module 206 and the device module 202 are mutually dependent. The communication module 203 and the device module 202 are mutually dependent, and the Socket I/F module 205, the USER communication module 204, and the encryption/certificate module 206 depend on the communication module 203. The communication driver 207 depends on the Socket I/F 205, and the encrypting engine 208 depends on the encryption/certificate module 206.
Next, responsibilities of each module are described below with reference to Table 2 and Table 3.
Next, rules on transfer of data between the communication unit and the application unit are described below with reference to TABLE 4A and TABLE 4B.
Table 4A and 4B are rule tables to determine “resource to be used and transfer control method” in data transfer between the communication unit and the application unit. Characteristic of content data in Table 4A can be obtained from header information (control information) of application protocol such as HTTP. For example, operation objective is included in URL in HTTP header, operation method is included in request line in HTTP header, and MIME type is included in attribute in HTTP header. Information registered in “name of sub-system where operation objective exists” is determined by the system configuration, and is used as information to determine which memory is used in data transfer for each transfer destination.
The starting up module 210 initializes hardware and software on start-up and boots each task.
The communication area module 203 includes functions (1) to (3) shown in Table 2 to provide network communication for the network system, and has a network communication function that the network sub-system executes autonomously instead of the network system in normal operation mode and energy saving mode. Also, the communication area module 203 includes SSL protocol/IEEE802.1x protocol function, function for managing buffer on SRAM_DATA and SRAM_SEC, and function for user authentication in protocol.
The supplicant module 204 includes function to execute connecting on layer 2 level (including security).
The device module 202 stores device-specific information received from the network system via [USER] to flash memory, and includes function to provide the device specific information on demand from the network system or [TRANS]. The device module 202 writes data for updating firmware received from the network system via [USER] in flash memory. The device module 202 controls status of the network sub-system.
The USER communication module 208 includes functions (1) and (2) shown in Table 2 to control communication with [network system] via USB, controls ToE for network communication, and controls MAC.
Managing progress of a whole part of transmitting/receiving packet in application layer, connecting and disconnecting are included in the procedures in application layer 301.
The packet in application layer 303 knows that packets in application layer consist of header and payload. Packets in application layer are created from data received from upper layer and is passed to lower layer where following process is executed. Also, packets in application layer are analyzed from data received from lower layer and is passed to upper layer where the following process is executed. Chunk is encoded and decoded.
The resource information table 302 used by the packet in application layer 303 is a table of rules for determining the resource to be used and the data transfer method.
Payload in application layer knows structure of payload in application layer.
Header in application layer knows structure of header in application layer.
Next, whether or not transfer destination to process data is a sub-system (application unit) is determined. If the transfer destination is the application unit, data transfer is executed after determining buffer size to be used in accordance with characteristic of the content data. For example, small size buffer is used if the data content is job generating command, etc., and large size buffer is used for image data to be projected. If content data size is so large that it cannot be processed by data transfer all at once, all data is processed by repeating data transfer to application by using the same type of buffer.
Next, the flowchart shown in
The network system 3 is a main body of operation. The network system 3 determines whether or not the protocol is TCP (S301). If the network system 3 determines that the protocol is TCP (YES in S301), header data is received in SRAM_DATA and the process proceeds to S303. If it is determined that protocol is not TCP (NO in S301), OMP3 passes SRAM_ToE buffer pointer to application and finishes after processing the data (S310).
In S303, the network system 3 follows through on the header part, picks up “characteristic of content data”, and determines “resource to be used and transfer controlling apparatus” (S304). The network system 3 determines whether or not transfer destination is the network system 3 (S305). If it is determined that transfer destination is the network system 3 (YES in S305), whether or not data size is larger than a predefined value is determined (S306).
If the network system 3 determines that transfer destination is not the network system 3 (NO in S305), the data is transferred to the application by using SRAM_DATA and the process ends (S308).
If the network system 3 determines that the data size is larger than the predefined value (YES in S306), the data is transferred to the application by using SRAM_WHIO (large size) and the process ends (S307).
If the network system 3 determines that the data size is not larger than the predefined value (NO in S306), the data is transferred to the application by using SRAM_WHIO (small size) and the process ends (S309).
If the network system 3 determines that an error occurred (S104), status is set to END, result of creating packet is set to E_PACKET_RESULT_COMPLETE, and error reason is set to E_PACKET_ERROR_REASON_TIMEOUT (S114).
If the network system 3 determines that no error occurred (S104), the network system 3 analyzes the header part (AAppLayerHeadcredecompos in S105 in
The network system 3 determines whether it is a server or a client (S107) if it has finished analyzing the header part (succeeded) (S106). The process proceeds to S115 if it is a client, and resource information is searched if it is a server (Resource Info Table:get Resource Info in S108).
The network system 3 determines whether or not the resource information exists (109). If it is determined that no resource information exists (S109), the process proceeds to S114. If it is determined that the resource information exists (S109), it is determined whether or not transfer destination is the network system 3 (S110).
If the network system 3 determines that transfer destination is the network sub-system, the process proceeds to S115. If the network system 3 determines that transfer destination is the network system (S110), the network system 3 checks whether or not it is OK to transfer to the network system (INFO CanExecute in S111 and determines whether or not it is OK to transfer (S112).
If the network system 3 determines that it is not OK to transfer (S112), status is set to END, result of creating packet is set to END, and error reason is set to E_PACKET_ERROR_REASON_NO_ERROR (S113). If the network system 3 determines that it is OK to transfer, it executes transferring.
In
After starting entry action in S201 in
If the network system 3 determines that the payload part exists (S202), the network system 3 determines whether or not transfer destination is the network system 3 (S204). If the network system 3 determines that transfer destination is the network system (S204), it executes exclusive access control of the content buffer (twai sxm (SEM_TRANS_CNTLT_EX) in S205).
In this case, if it is the server, it waits one second, for example, until exclusive access control is achieved. If exclusive access control is not achieved within one second, it is regarded that there is an error inside packet (404) and it is the end of the payload part.
If it is the client and location free, it waits unlimitedly until exclusive access control is achieved. If it is the client and @Remote, it waits one second, for example, until exclusive access control is achieved. If exclusive access control is not achieved within one second, received data is discarded. After that, it waits unlimitedly until exclusive access control is achieved, and it sends a response of EOL=1 and data size=0 at the time of achieving exclusive access control.
If the network system 3 determines that the transfer destination of the payload is the network sub-system (S204), the network system 3 reads SAM DATA (S215) and data from socket (S207).
After acquiring SRAM_WHIO buffer (S206), the network system 3 reads data from the socket described above in S207, and determines whether or not error occurs (S208).
In this case, if the content buffer is used, only the header part is sent to the network system 3 before reading data from the socket. Otherwise, if the payload size is 0, only the header part is sent to the network system 3 without reading data from the socket, and it finishes analyzing the payload part.
If the network system 3 determines that an error occurred (S208), a request for sharing network received data is sent to the network system 3 (S216), and the process proceeds to S217.
In this case, even if USER DhBulStar DhcomBulStart dhComBulStart has never been executed, it is sure to send a request for sharing network received data of EOF/I in order to release buffer space allocated in USER GelDhBul/USER GetComDhBuf.
If the network system 3 determines that no error occurred (S208), the network system 3 releases the payload part (AppLayerPayload::decompose in S209) and determines whether or not it has finished analyzing the payload part (S210). If the network system 3 determines that it has not finished analyzing (S210), it is determined whether or not transfer destination is the network system 3 (S223).
If the network system 3 determines that transfer destination is not the network system 3 but the network sub-system (S223), the process returns to S207. If the network system 3 determines that transfer destination is the network system 3 (S223), the network system 3 determines whether or not buffer of SRAM_WHIO is full (S220).
If the network system 3 determines that buffer of SRAM_WHIO is not full, the process returns to S207. If the network system 3 determines that buffer of SRAM_WHIO is full, a request for sharing network received data is sent to the network system 3 (USER DhBusStart/USER DhComBufStrat in S219), and the process returns to S206.
After determining that analyzing the payload part is finished in S210, the network system 3 determines whether or not transfer destination is the network system 3 (S211). If it is determined that transfer destination is the network system 3 (S211), the network system 3 sends request for sharing network received data (USER DhBufStart/USER DhComBufstart in S212) to the network system 3.
The network system 3 releases exclusive access control of the content buffer (sig sem(SEM_TRANS_CNTNT_EX) in S213). Subsequently, status is set to END, result of creating packet is set to E_PACKET_RESULT_COMPLETE, and error reason is set to E_PACKET_ERROR_REASON_NO_ERROR in S214.
If the network system 3 determines that transfer destination is the network sub-system 3 in S211, the process proceeds to S214.
If the network system 3 determines that no payload part exists in S202, the process proceeds to S214.
Data Flow Patterns
There are three patterns of copying memory in data transfer, described below.
(PA) TCP Data Transfer that Needs to Transfer to the Network System e.g., HTTP(S) Server and HTTP(S) Client
In case of plain communication,
In case of encrypted communication,
(PB) TCP Data Transfer that Closes in the Network System
In case of plain communication, as shown in
In case of encrypted communication,
As shown in
(PC) UDP Data Transfer that Closes in the Network Sub-System
The TRANS module reads data to be sent and writes received data from/to SRAM_ToE directly, and no memory copy is executed.
Numerous additional modifications and variations are possible in light of the above teachings. It is therefore to be understood that, within the scope of the appended claims, the disclosure of this patent specification may be practiced otherwise than as specifically described herein.
As can be appreciated by those skilled in the computer arts, this invention may be implemented as convenient using a conventional general-purpose digital computer programmed according to the teachings of the present specification. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software arts. The present invention may also be implemented by the preparation of application-specific integrated circuits or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the relevant art.
Number | Date | Country | Kind |
---|---|---|---|
2012-002385 | Jan 2012 | JP | national |