Invention content
The first object of the present invention is to provide a kind of printer IP fixing means for being convenient for IP address being fixed setting.
The second object of the present invention is to provide a kind of printer IP fixing devices for being convenient for IP address being fixed setting.
The third object of the present invention is to provide a kind of computer installation for being convenient for IP address being fixed setting.
The fourth object of the present invention is to provide a kind of storage medium for being convenient for IP address being fixed setting.
In order to realize that above-mentioned main purpose, printer IP fixing means provided by the invention include:Booting printing self test page
Afterwards, IP obtaining modes are determined;If IP obtaining modes are dynamic access IP patterns, open DHCP service and obtain new IP address;
Judge whether the new IP address got has different network address from the old IP address of storage, if so, utilizing IP address
The host address of network address and old IP address generates final IP address;It locks and stores final IP address.
It is new by what is got by said program as it can be seen that printer IP fixing means of the present invention is under dynamic access IP patterns
IP address is compared with the old IP address of storage, if the network address of new IP address and the network address of old IP address exist not
Together, then it utilizes the host address of network address and the old IP address of IP address to generate final IP address, can save and renumber
Trouble, provides facility to the user.
In further embodiment, after obtaining new IP address, printer IP fixing means further includes:Whether judge old IP address
For original factory IP address, if so, locking and storing using new IP address as final IP address.
It can be seen that printer is when first used, storage be factory default address, therefore, it is necessary to reacquire
New IP address is fixed and uses.
In further embodiment, after final IP address is locked and stored, printer IP fixing means further includes:It closes
DHCP service simultaneously prints self test page.
It can be seen that in order to avoid repeating automatic acquisition IP address printer is switched on next time when, with obtaining final IP
Behind location, DHCP service is closed, meanwhile, self test page is printed, the IP address service condition of current printer is known convenient for user.
In further embodiment, new IP address is obtained, including:If being got in preset time different from old IP address
IP address then gets new IP address.
It can be seen that when obtaining IP address, if not getting the address different from old IP address in preset time,
The new IP address that then possible network breaks down or gets retains as the old IP address of storage and stores old IP address.
In order to realize that above-mentioned second purpose, printer IP fixing devices provided by the invention include:IP obtaining modes determine
Module determines IP obtaining modes after the printing self test page that is switched on;IP address module is obtained, if being for IP obtaining modes
State obtains IP patterns, then opens DHCP service and obtain new IP address;IP address module is generated, for judging the new IP got
Whether address has different network address from the old IP address of storage, if so, using the network address of IP address and old IP
The host address of location generates final IP address;Locking module is stored, for locking and storing final IP address.
It is new by what is got by said program as it can be seen that printer IP fixing devices of the present invention are under dynamic access IP patterns
IP address is compared with the old IP address of storage, if the network address of new IP address and the network address of old IP address exist not
Together, then the host address of the network address for utilizing IP address and old IP address generates final IP address, can save to printer weight
The trouble newly numbered, provides facility to the user.
In order to realize that above-mentioned third purpose, computer installation provided by the invention include processor, which is used for
Each step of above-mentioned printer IP fixing means is realized when executing the computer program stored in memory.
In order to realize that above-mentioned 4th purpose, storage medium provided by the invention are stored thereon with computer program, and calculate
Machine program realizes each step of above-mentioned printer IP fixing means when being executed by processor.
Specific implementation mode
On the printer IP fixing means application printers of the present invention, to need to fix in router or network segment replacement etc.
Automatic fixed ip address is realized in the case of IP address.The printer IP fixing devices of the present invention are run on a printer, and
For realizing above-mentioned printer IP fixing means.Also, the present invention also provides a kind of computer installation, the computer installation packets
Processor is included, processor can be with the instruction of executing application, to realize each step of above-mentioned printer IP fixing means
Suddenly.It is stored with computer program on the computer readable storage medium of the offer of the present invention, and computer program is held by processor
Each step of above-mentioned printer IP fixing means is realized when row.
Printer IP fixing means embodiments:
As shown in Figure 1, step S1 is first carried out when carrying out IP address fixation in the printer IP fixing means of the present invention,
After booting printing self test page, IP obtaining modes are determined.Printer prints self test page after getting starting-up signal, after printing self test page
Triggering determines the step of IP obtaining modes.In the present embodiment, IP obtaining modes include static acquisition IP patterns and dynamic access IP
Pattern, wherein it refers to that fixed ip address has been stored in printer that static state, which obtains IP patterns, is fixed by this after printer booting
IP address carries out network communication;Dynamic access IP patterns refer to printer booting after can obtain automatically an idle IP address into
Row network communication.The determination of printer IP obtaining modes can be configured by the function button of printer, can also by with
The IP address setting page that the computer of printing interconnection plane enters printer is configured.For example, in the function using printer
When button progress IP obtaining modes determine, the selection page of IP obtaining modes, printer are entered by the setting button of printer
Display screen display need the IP obtaining mode options of selection, IP obtaining modes to be used are needed simultaneously by selection key selection
Confirmed.
After determining IP obtaining modes, step S2 is executed, if IP obtaining modes are dynamic access IP patterns, opens DHCP
(Dynamic Host Configuration Protocol, dynamic host configuration protocol)It services and obtains new IP address.In IP
Obtaining mode be dynamic access IP patterns after, first turn on DHCP service, make printer that can obtain IP address automatically.Obtaining IP
When address, printer superior routing server sends automatic acquisition IP signals, and routing server is that printer distributes a sky
Not busy IP address, and printer is fed back to, to which printer gets IP address.
Wherein, the step of acquisition new IP address includes:If with getting the IP different from old IP address in preset time
Location then gets new IP address.Preset time can be the time threshold that printer system developer is configured, for example,
The time threshold of setting is 30 seconds, i.e., the IP address different from old IP address is got in 30 seconds, then it is assumed that gets new IP
Address.After printer obtains IP address, if judging, the IP address obtained is different from the old IP address that printer stores, and recognizes
To get new IP address, if the IP address obtained is identical as old IP address or does not get IP address, then it is assumed that do not have
Get new IP address.
After getting new IP address, step S3 is executed, judges whether old IP address is original factory IP address.Printer goes out
The original factory IP address of acquiescence is provided with when factory, the old IP address and original factory IP address stored by comparing printer,
It can determine whether printer is first use or factory reset.
When judging the old IP address of storage for original factory IP address, step S4 is executed, it will be using new IP address as most
Whole IP address, that is, need fixed final IP address using the IP address got automatically as printer.
When it is not original factory IP address to judge the old IP address of storage, step S5 is executed, judges the new IP got
Whether address has different network address from the old IP address of storage.IP address is divided into two portions of network address and host address
Point, for example, IP address " 192.168.2.28 ", first three byte " 192.168.2 " is network address, and the 4th byte " 28 " is
Host address.When whether the new IP address for judging to get has different network address from the old IP address of storage, only need
Judge whether first three byte identical, when first three byte of two IP address is identical if think network having the same
Address, when first three byte of two IP address is not exactly the same if think do not have identical network address.If for example, new
IP address is " 192.168.2.38 ", and old IP address is " 192.168.2.58 ", then new IP address has identical with old IP address
Network address;If new IP address be " 192.168.2.38 ", old IP address be " 192.168.1.58 ", then new IP address with it is old
IP address has different network address.
When executing step S5, when being judged as NO, that is, the old IP address of the new IP address and storage that get is having the same
When network address, S6 is thened follow the steps, using old IP address as final IP address.
When executing step S5, judge that the new IP address got has different network address from the old IP address of storage
When, step S7 is executed, final IP address is generated using the network address of IP address and the host address of old IP address.In printer
During use, be generally set with fixed IP address, needed when the network segment changes in order to prevent again to printer into
Row number makes printer that can retain original number, is obtained convenient for user therefore, it is necessary to retain the host address in old IP address
Know the corresponding IP address of printer.For example, the new IP address got is " 156.52.52.54 ", the old IP address of storage
For " 192.168.1.58 ", then the final IP address that the host address of the network address for utilizing IP address and old IP address generates is
“156.52.52.58”。
After obtaining final IP address, step S8 is executed, locks and stores final IP address.After obtaining final IP address,
Fixed IP address is needed to be stored in printer using final IP address as printer, while level-1 router is sent most upwards
Whole IP address is confirmed and is stored, to make network-in-dialing.
After locking and storing final IP address, step S9 is executed, close DHCP service and prints self test page.It locks and stores
It after final IP address, then need not carry out obtaining IP address automatically again, IP obtaining modes can be switched to static acquisition IP patterns, because
This, DHCP service is closed.In order to which user can be allowed to will be seen that the IP address service condition of current printer, is locking and depositing
After storing up final IP address, self test page is printed, so that user checks.Wherein, to include printer current printer in self test page make
IP address information.
It should be noted that locking and can not also close DHCP service after storing final IP address, beaten restarting every time
When print machine, IP address can be voluntarily obtained, but since host address uses the host address of old IP address, Bu Huiyin
This causes the confusion in IP address management.
Printer IP fixing device embodiments:
As shown in Fig. 2, the printer IP fixing devices of the present invention include IP obtaining modes determining module 1, obtain IP address
Module 2, for the first time setting module 3 generate IP address module 4, storage locking module 5 and close service module 6.
After IP obtaining modes determining module 1 is for the printing self test page that is switched on, IP obtaining modes are determined.Printer is got out
Self test page is printed after machine signal, IP obtaining modes determining module 1 is determined IP obtaining modes after booting prints self test page
Step.In the present embodiment, IP obtaining modes include static acquisition IP patterns and dynamic access IP patterns, wherein static state obtains IP
Pattern refers to that fixed ip address has been stored in printer, and network communication is carried out by the fixed ip address after printer booting;
Dynamic access IP patterns refer to that can obtain an idle IP address after printer is switched on automatically to carry out network communication.Printer IP
The determination of obtaining mode can be configured by the function button of printer, can also pass through the computer with printing interconnection plane
The IP address setting page into printer is configured.
If it is dynamic access IP patterns to obtain IP address module 2 for IP obtaining modes, opens DHCP service and obtain
New IP address.If IP obtaining modes are dynamic access IP patterns, open DHCP service and obtain new IP address.Mould is obtained in IP
Formula be dynamic access IP patterns after, first turn on DHCP service, make printer that can obtain IP address automatically.Obtaining IP address
When, printer superior routing server sends automatic acquisition IP signals, and routing server is that printer distribution one is idle
IP address, and printer is fed back to, to which printer gets IP address.
Obtaining 2 acquisition new IP address of IP address module includes:If being got in preset time different from old IP address
IP address then gets new IP address.Preset time can be the time threshold that printer system developer is configured.It obtains
After taking IP address module 2 to obtain IP address, if judging, the IP address obtained is different from the old IP address that printer stores,
Think to get new IP address, if the IP address obtained is identical as old IP address or does not get IP address, then it is assumed that do not have
Get new IP address.
Setting module 3 is for judging whether the old IP address is original factory IP address for the first time, if so, by the new IP
Address locks and stores as the final IP address.Printer is provided with the original factory IP address of acquiescence when dispatching from the factory, for the first time
Setting module 3 can determine whether printer is first by comparing the old IP address and original factory IP address of printer storage
Using or factory reset.When judging the old IP address of storage for original factory IP address, new IP address will be made
For final IP address, that is, need fixed final IP address using the IP address got automatically as printer.
IP address module 4 is generated for judging it is different whether the old IP address of the new IP address and storage got has
Network address, if so, generating final IP address using the network address of IP address and the host address of old IP address.IP address point
For two parts of network address and host address, for example, IP address " 192.168.2.28 ", first three byte " 192.168.2 "
For network address, the 4th byte " 28 " is host address.It is in the old IP address of new IP address and storage that judgement is got
It is no have different network address when, only need to judge whether first three byte identical, if first three byte of two IP address is complete
Network address having the same is then thought when exactly the same, when first three byte of two IP address is not exactly the same if think not
Network address having the same.
When the old IP address network having the same for generating new IP address and storage that the judgement of IP address module 4 is got
When location, using old IP address as final IP address.
Judge the new IP address that gets and the old IP address of storage with different networks when generating IP address module 4
When location, final IP address is generated using the network address of IP address and the host address of old IP address.In the mistake that printer uses
Cheng Zhong is generally set with fixed IP address, needs that printer is numbered again when the network segment changes in order to prevent, because
This, needs to retain the host address in old IP address, makes printer that can retain original number, convenient for user know printer with
Its corresponding IP address.
Storage locking module 5 is for locking and storing final IP address.By final IP address after obtaining final IP address
Fixed IP address is needed to be stored in printer as printer, while level-1 router sends final IP address progress upwards
Confirm and store, to make network-in-dialing.
Service module 6 is closed for closing the DHCP service and printing self test page.It locks and stores final IP address
Afterwards, then it need not carry out obtaining IP address automatically again, IP obtaining modes can be switched to static acquisition IP patterns and therefore close clothes
Business module 6 closes DHCP service.In order to which user can be allowed to will be seen that the IP address service condition of current printer, locking
After determining and storing final IP address, closes service module 6 and print self test page, so that user checks.Wherein, self test page includes
There is the IP address information that printer current printer uses.
Certainly, it locks and can not also close DHCP service after storing final IP address, it, can when restarting printer every time
IP address is voluntarily obtained, but since host address uses the host address of old IP address, it will not with therefore causing IP
The managerial confusion in location.
Computer installation embodiment:
The computer installation of the present invention can be include the devices such as processor and memory, such as include central processing
The microcontroller etc. of device.Also, the processor of computer installation can execute the computer program stored in memory, work as processing
When device executes computer program, each step in above-mentioned printer IP fixing means may be implemented, including IP obtaining modes are true
Fixed step obtains the step of IP address, generates the step of the step of IP address module, storage locking IP address, DHCP service
The step of open and close and for the first time set respective operations the step of etc..
Storage medium embodiment:
The computer readable storage medium of the present invention can be by the read any form of the processor of computer installation
Storage medium, including but not limited to nonvolatile memory, volatile memory, ferroelectric memory etc. are computer-readable to deposit
Computer program is stored on storage media, when the processor of computer installation is read and executes the computer stored in memory
When program, each step in above-mentioned printer IP fixing means, including the step of IP obtaining modes determination, acquisition may be implemented
The step of IP address, generates the step of the step of IP address module, storage locking IP address, the step that DHCP service opens and closes
It is rapid and for the first time set respective operations the step of etc..
It can be seen from the above, printer IP fixing means of the present invention is under dynamic access IP patterns, by the new IP got
Location is compared with the old IP address of storage, if the network address of new IP address and the network address of old IP address there are different,
The host address of the network address for then utilizing IP address and old IP address generates final IP address, can save the fiber crops renumberd
It is tired, provide facility to the user.
It should be noted that these are only the preferred embodiment of the present invention, but the design concept invented is not limited thereto,
All insubstantial modifications made to the present invention using this design, are also each fallen within protection scope of the present invention.