Current location - Education and Training Encyclopedia - Graduation thesis - Thesis topic of household packaging machinery
Thesis topic of household packaging machinery
Figure 2-5 Network Printing Process

From the above analysis, we can see that IPP is based on TCP/IP, HTTP and other protocols, and TCP/IP is one of them.

A protocol family consisting of hundreds of protocols. For IPP printer based on embedded system, it is not necessary and impossible to realize all the underlying protocols. However, in order to meet the basic requirements of IPP, the following protocol families should be implemented.

Communication protocol needed to realize IPP printer [6]

As shown in Table 2- 1:

Table 2-Communication Protocol of1IPP Printer

2.3.2 Network Printing Protocol

At present, the protocols used in network printing include SMB (Server Message Block) protocol, LPD (Progressive Printer Daemon Protocol) and IPP (Internet Printing Protocol) [7- 1 1].

1 SMEs /CIFS protocol

SMB protocol is an application protocol based on NETBIOS protocol and TCP.

138 and 139 ports. After NETBIOS appeared, Microsoft realized the network file/print service system with NETGBIOS. This system designs a file sharing protocol based on NETBIOS, which Microsoft calls SMB protocol. This protocol is used by Microsoft for their LAN manager.

Windows NT server system, and Windows system contains the client software of this protocol, so this protocol has a great influence in LAN system, and it realizes the sharing of printers and files between different computers. But not in a cross-network environment.

With the popularity of the Internet, Microsoft hopes to extend this agreement to the Internet and become

A standard for computers to share data on the Internet. Therefore, it reorganized the SMB protocol with few technical documents and renamed it CIFS(Common Internet File System), and intended to separate it from NetBIOS in an attempt to make it the standard protocol on the Internet. Different from other standard TCP/IP protocols, SMB protocol is a complex protocol, because with

With the development of Windows computer, more and more functions are added to the protocol. It is difficult to distinguish which concepts and functions should belong to the Windows operating system itself and which concepts should belong to the SMB protocol. Other network protocols have a clear and concise structure because they are pre-stored protocols and implement related software, while SMB protocol is developed with Microsoft operating system, so it contains a lot of concepts of Windows system. 2.3.2.2 lpd protocol

LPD protocol is based on the example developed by UNIX in the early 1970s, which is to support the printing of progressive printers.

Through this protocol, Windows system can use printing resources on Unix through Windows NT as an application gateway, because Windows NT supports TCP/IP network printing service, and because this service can support LPD protocol, Windows NT can also be used as a printer gateway to connect other printers.

Print requests from Windows clients are converted into lpd requests and sent to or from Unix computers.

Print to a Windows NT computer. However, when the LPD protocol is used for network printing, the printing status cannot be monitored.

For example, the number of prints in the server and the status information of the print server itself cannot be obtained. 2.3.2.3 IPP protocol

This chapter will discuss the specific content and working principle of IPP. If the computer you use is directly connected to the printer, IPP may not be needed, but it is an indispensable part of the network printing era. IPP protocol was put forward by IETF (Internet Engineering Task Force) at the end of 1998. IPP 1. 1 released in September 2000 is a protocol developed by almost all mainstream printers and software manufacturers. IPP protocol is an international standard for transmitting printing tasks on the Internet, which provides remote printing.

It is practical and efficient, and provides the ability to manage printers remotely. Its original intention is to make printing based on IP address easier through the network or larger Internet. Companies like HP have introduced some devices that support IPP standard, and with the further standardization of IPP standard, more companies will do so.

IPP will use HTTP as an attachment to HTTP instead of a completely different one located at HTTP.

On the agreement. In this way, we can make use of the characteristics of HTTP to make it easier to realize, because most manufacturers are already familiar with HTTP, so IPP protocol is based on the Internet application layer, and is oriented to end users and terminal printing devices. IPP is based on the commonly used Web browser, and uses HTTP and other existing Internet technologies to transfer the printing task from the end user to the Internet to support the printing output of IPP.

Out of the device, at the same time, the printer's attribute and status information are transmitted to the terminal device. Through IPP printing equipment, users can quickly, efficiently and practically print locally or remotely through the Internet, without complicated printer installation and driver installation.

IPP protocol adopts the POST method of hypertext transfer protocol HTTP on the client and print server.

Establish a dialogue. For the client, the user can send two types of messages through IPP, the message of inquiring the printer status and the message of submitting the print job, and the client can also receive the notification from the print server. The objects involved in IPP are described by object model, and there are three kinds of objects.

(1) printer object. This object encapsulates the printer device and all the actual printing tasks are completed by this object.

(2) working object. This object encapsulates a print job consisting of one or more files.

(3) the intended object. Encapsulates a notification mechanism that triggers a notification when the status of a job or printer object changes.

IPP printing is realized through a series of operations on related objects. Each operation consists of two parts: request and response.

Component, each part contains the operation properties related to the operation. When a client wants to communicate with an object, he sends an operation request for the object, which includes operation attributes, object attributes and the operation.

Required document data. After receiving the operation request, the object sends a response to the requester, indicating whether the operation is successful or not. This response contains operation properties, object properties, and related state information generated when executing this operation request.

Taking the printing workflow as an example, this paper introduces the working principle of IPP protocol. Addressing and positioning of (1)IPP printout device

IPP printout device can be a printer supporting IPP protocol, or a printer server supporting IPP negotiation plus one or more printers. Due to the need to support IPP protocol, IPP printout equipment is different from ordinary printout equipment. To realize it, we must have an independent internal processor and meet the requirements of memory capacity. In addition, it should have a network interface to access the Internet, support common communication protocols of the Internet, and also support SNMP (Simple Network Management Protocol).

After IPP-supported printing equipment is connected to the Internet, it will have an IP address and become an independent terminal equipment on the Internet. The terminal computer can address the printing device through a browser, and can perform the addressing process by inputting an IP address or a printer name. If this printing device is turned on and online at this time, it will return the printer's attribute information to the computer that addresses it, including the supported print media type, size and whether it supports color.

(2) Send print job, printer status information and cancel print job.

The job information package to be printed by the terminal computer (including the name of the print job and the media used)

Quality, print score, print content, etc. ) is encoded according to the IPP protocol and transmitted to the IPP printing device according to the protocol. IPP printing equipment decodes the received information according to the protocol and generates printed content according to its own attribute interpretation. The printer should send its own status information (such as the status of consumables and media) to the terminal computer before and during printing, so as to address it. At present, in IPP 1.0, the terminal computer can control the IPP printing equipment to cancel and terminate the started printing job.

The above is the introduction of IPP protocol. In the third chapter 3. 1.3 and 3.2. 1, the monitoring implementation based on IPP protocol will be introduced in detail.

2.4 Other related technologies involved in printer monitoring module

The specific implementation of the printer monitoring module in the intranet supervision system also uses the following other related technologies.

2.4. 1 background service program development

In this system, the monitoring end of printing is placed on the print server. Because it only completes the parsing of cache files and the control of print jobs, and sends the parsed file printing information and control result information to the database and the main control terminal, users do not need to feel the existence of application programs. So the best way is to make the monitoring program a background service program and turn off the pause and stop functions of the service program.

In NT-based operating systems such as 2000/XP, there is a service manager, and the background processes it manages are called services. A service is an application type that runs in the background, similar to a UNIX background application. Service applications can usually provide some functions to users locally and through the network, such as client/server applications, Web servers, database servers and other server-based applications. The background service program runs quietly in the background. By registering your own program as a service, you can make your own program not appear in the task manager, run it when the system starts, and stop it when the system closes.

Service Control Manager is an RPC server, which exposes a set of application programming interfaces. Programmers can easily write programs to configure services and control service programs in remote servers.

Service programs are usually written as console-type applications. Generally speaking, a program that meets the interface requirements of the service control manager includes the following three functions: (1) service program main function (main): calling the system function StartServiceCtrlDispatcher to connect the main thread of the program to the service control manager. (2) Service portal function: A service process that performs service initialization tasks and multiple services at the same time has multiple service portal functions. (3) Control service processing function: when the service program receives the control request, it is referenced by the control allocation thread. (Service_Ctrl here).

In addition, before the system runs this service, you need to install the registration service program: installService function. To delete a service program, you need to delete the service installation registration: the removeService function. Regarding the service types, there are the following categories, as shown in Table 2-2:

Table 2-2 Background Service Types

2.4.2 multithreading technology

According to the design of the print monitoring module, after analyzing the basic print information, it is necessary to upload the analyzed print information to the database in real time, which requires the transmission of information while processing the parsed file, so the multithreading technology is adopted here [12].

Windows series is a multitasking operating system, which can run multiple threads at the same time. Used for simultaneous transportation

For all threads, the operating system will arrange some CPU time for each independent thread. The operating system provides time slices (called time slices) to threads in a round-robin manner. Because the CPU runs fast enough, it gives people the illusion that these threads are running at the same time. In sharp contrast to this, DOS operating system can only run one program at a time, and each program has only one execution stream. Using multithreading technology can make full use of computer resources, including CPU time, peripherals and so on [13]. The basic concepts of multithreading technology are as follows:

Process: A process is usually defined as an instance of a program. In Win32, it occupies 4GB address space, and the code and data of the application are stored in this space, and the dynamic link library needed by the program will also be loaded into this space. But this process is lifeless. It only takes up space and does nothing. Thread: A thread is an independent execution path. When a process is started, the system will automatically generate a main thread, and then the main thread can generate other threads. Threads are divided into two categories, worker threads and user interface threads. User interface threads have their own windows, so they need to deal with message loops. Worker threads can't, so worker threads are easier to use.

Using multithreading in windows: Windows provides a set of API functions for starting, quitting, suspending and changing the priority of worker threads. The API functions about threads are shown in Table 2-3.

Table 2-3 Windows API Functions on Threads

2.5 Summary

This chapter introduces the working principle and mode of printing and the main network printing protocols related to it, and then introduces other related technologies involved in the printer monitoring module in the intranet monitoring system.