The content of the invention
The present invention is waited for when testing for prior art for a long time, causes experimental period long or intelligent acess
The technical problem of the data corruption of equipment, there is provided a kind of multitask changing method and device.
To solve above-mentioned technical problem, the technical scheme that embodiment of the present invention is adopted is:A kind of multitask is provided
Changing method, including:
Receiving at least from the first process task request of the first client and at the second of the second client
During reason task requests, the first process task of respectively the first client asks the second processing task requests with the second client
Set up first task rabbet channel and the second task rabbet channel;
The request of first process task of first client is sent to first task rabbet channel, and by described the
The second processing task requests of two clients are sent to the second task rabbet channel;
Fiber plant is made to perform process according to the first process task request in the first task rabbet channel;
Monitor the fiber plant and process is performed according to the first process task request in the first task rabbet channel
Process state, whether and to judge that first process task request performs the process state that processes the pending state such as be;
If the fiber plant performs what is processed according to the first process task request in the first task rabbet channel
Process state for etc. pending state, then the fiber plant is stopped at according to first in the first task rabbet channel
Reason task requests perform process, make the fiber plant according to the second processing task requests in the second task rabbet channel
Perform process.
Alternatively, methods described also includes:
If the fiber plant performs what is processed according to the first process task request in the first task rabbet channel
Process state be non-camp perform state, then wait the fiber plant according to first in the first task rabbet channel at
Reason task requests are performed and are completed, and receive the fiber plant according to the first process times in the first task rabbet channel
Business request performs the first task result for completing to return afterwards;
The first task result is back to into first client.
Alternatively, methods described also includes:
According to the first task result, the first task rabbet channel is destroyed.
Alternatively, methods described also includes:
Stop being performed according to the first process task request in the first task rabbet channel the fiber plant is made
During process, recording first process task request of the fiber plant to the first task rabbet channel carries out performing process
Implementation progress;
When receive meet that the fiber plant continues please to the first process task in the first task rabbet channel
During the processing data for asking execution to process, monitor the fiber plant and appointed according to the second processing in the second task rabbet channel
Business request performs the process state for processing, and judges that second processing task requests perform whether the process state for processing is that wait is held
Row state or execution are completed;
If the fiber plant performs what is processed according to the second processing task requests in the second task rabbet channel
Process state for etc. pending state or execution complete, then the processing data is sent to the fiber plant, and is made
The fiber plant continues at according to first in the first task rabbet channel according to the implementation progress and processing data
Reason task requests perform process.
Alternatively, methods described also includes:
It is connected with first client and the second client by socket respectively;
It is connected with the fiber plant by socket.
To solve above-mentioned technical problem, another technical scheme that embodiment of the present invention is adopted is:There is provided a kind of many
Business switching device, including:
Receive and set up module, for receive at least from the first client the request of the first process task and from
During the second processing task requests of the second client, the request of the first process task and second client of respectively the first client
Second processing task requests set up first task rabbet channel and the second task rabbet channel;
First sending module, sends to first task notch for the first process task request by first client
Passage, and the second processing task requests of second client are sent to the second task rabbet channel;
Processing module is performed, for making fiber plant ask according to the first process task in the first task rabbet channel
Execution is asked to process;
Monitoring and judge module, for monitor the fiber plant according to first in the first task rabbet channel at
Reason task requests perform the process state for processing, and judge whether first process task request performs the process state that processes
For etc. pending state;
Stop and perform processing module, if the fiber plant is processed according to first in the first task rabbet channel
Task requests perform process process state for etc. pending state, the stopping and perform processing module be used for make the optical fiber
Equipment stops performing process according to the first process task request in the first task rabbet channel, makes the fiber plant root
Process is performed according to the second processing task requests in the second task rabbet channel.
Alternatively, described device also includes:
Wait and receiver module, if the fiber plant is according to the first process task in the first task rabbet channel
It is that non-camp performs state that request performs the process state for processing, and the wait and receiver module are used to wait the fiber plant
According in the first task rabbet channel the first process task request execution complete, and receive the fiber plant according to
The first process task request in the first task rabbet channel performs the first task result for completing to return afterwards;
Second sending module, for the first task result is back to first client.
Alternatively, described device also includes:
Module is destroyed, for according to the first task result, destroying the first task rabbet channel.
Alternatively, described device also includes:
Logging modle, for making the fiber plant stop being processed according to first in the first task rabbet channel
Task requests perform process when, record the fiber plant the first process task of the first task rabbet channel is asked into
Row performs the implementation progress for processing;
The monitoring and judge module are additionally operable to work as receive and meet the fiber plant continuation to the first task groove
When the first process task request in mouth passage performs the processing data for processing, the fiber plant is monitored according to described second
Second processing task requests in business rabbet channel perform the process state for processing, and judge at second processing task requests execution
Whether the process state of reason is etc. that pending state or execution are completed;
Send and perform processing module, if the fiber plant is according to the second processing in the second task rabbet channel
Task requests perform process process state for etc. pending state or execution complete, it is described transmission and perform processing module use
In the processing data is sent to the fiber plant, and the fiber plant is made according to the implementation progress and process number
Process is performed according to the first process task request in the first task rabbet channel according to continuation.
Alternatively, described device also includes:
Link block, for being connected with first client and the second client by socket respectively;
The link block is additionally operable to be connected with the fiber plant by socket.
The beneficial effect of embodiment of the present invention is:It is different from the situation of prior art, many of embodiment of the present invention
Business changing method, when two process tasks for receiving at least two clients are asked, is which sets up corresponding task notch
Passage, each process task request have corresponding task rabbet channel, by the request of the first process task and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, allows fiber plant to process one of task groove
Process task request in mouth passage, monitors the fiber plant and is appointed according to the first process in the first task rabbet channel
Business request performs the process state for processing, and judges that whether the process state the pending state such as is, in this way, will optical fiber set
Standby being switched to is connected with another task rabbet channel.The multitask changing method of the embodiment of the present invention is at least two clients
The request of two process tasks corresponding task rabbet channel is provided, after task rabbet channel is accessed with fiber plant, process
The process state that the execution of task requests is processed for etc. pending state, even if fiber plant be switched to it is logical with another task notch
Road connects and performs process its process task asks, and improves the treatment effeciency to the request of multiple process tasks, and fiber plant is no longer
Waiting processing state such as is at the process task request of pending state, and performs other in being to switch to other task rabbet channels
Process task is asked, and is realized the free switching to multiple tasks rabbet channel with this, can be met multiple process of multiple client
Task requests, limited fiber plant resource dispersion are utilized, the utilization rate of fiber plant are improve, is shortened overall experiment
Time, meet teaching needs.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, it is below in conjunction with drawings and Examples, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, not
For limiting the present invention.
As long as additionally, technical characteristic involved in invention described below each embodiment is each other not
Constitute conflict can just be mutually combined.
Optical transport:EPON (Ethernet Passive Optical Network, Ethernet passive optical network), is to be based on
EPON (PON) technology of Ethernet.It is transmitted using point-to-multipoint structure, passive fiber, is provided on Ethernet
Multiple business.EPON technologies are standardized by IEEE802.3EFM working groups.In June, 2004, IEEE802.3EFM working groups
Issuing EPON standards --- IEEE802.3ah (is incorporated to IEEE802.3-2005 standards in 2005).In the standard by ether
Net and PON technologies are combined, and are adopted PON technologies in physical layer, are used Ethernet protocol in data link layer, using EPON
Topological structure realize Ethernet access.Therefore, it combines the advantage of PON technologies and ethernet technology:Low cost, high band
Wide, autgmentability is strong, compatible with existing Ethernet, conveniently management etc..
Fig. 1 is referred to, the embodiment of multitask changing method of the present invention includes:
Step 10, receiving at least from the first client the first process task request and from the second client
During second processing task requests, the first process task request of respectively the first client and the second processing of the second client are appointed
First task rabbet channel and the second task rabbet channel are set up in business request.
The multitask changing method of the embodiment of the present invention can be performed on the server.When the process for receiving client is appointed
During business request, it is which sets up corresponding task rabbet channel, each process task request has corresponding task rabbet channel.Build
Vertical task rabbet channel is to subsequently dock with fiber plant.If a process task request of only one of which client,
Only need to be by its incoming fiber optic equipment, with regard to not there is a problem of that the present invention is needed to switch between multitask.When receiving
When one process task is asked and at least two process task of second processing task requests is asked, just need to set up respectively corresponding the
One task rabbet channel and the second task rabbet channel.
Process task request is ordered for MML (man-machine language, Man-Machine Language, abbreviation MML).
Step 20, the request of the first process task of first client is sent to first task rabbet channel, and
The second processing task requests of second client are sent to the second task rabbet channel.
After establishing first task rabbet channel and the second task rabbet channel, at the request of the first process task and second
Reason task requests send.Specifically, server is provided with Client command alternation of bed and is communicated with individual task rabbet channel.
Step 30, make fiber plant according in the first task rabbet channel the first process task request execution at
Reason.
Fiber plant is allowed to process the process task request in one of task rabbet channel.Wherein, fiber plant is light
Fine access device.It is possible to further first dissection process task requests, and priority is generated for process task request, according to excellent
First level sequence allows fiber plant to process corresponding process task request.For example, the request of the first process task and second processing are parsed
Task requests are simultaneously its generation priority, and the priority of such as the first process task request is the second priority, second processing task
Ask as the first priority, then allow fiber plant to process the second processing task requests in the second task rabbet channel.Server
Client processing layer is responsible for the process task request for processing parsing client.
Step 40, the monitoring fiber plant are held according to the first process task request in the first task rabbet channel
The process state that row is processed, and judge that whether the process state the pending state such as is.
Specifically, server is provided with conduit Surveillance center, and server opens conduit Surveillance center, monitors each task notch
The process task request of passage performs the process state for processing.And judge that whether process state the pending state such as is, in this way, then
Into step 50.
If step 50, the fiber plant are performed according to the first process task request in the first task rabbet channel
The process state of process for etc. pending state, then the fiber plant is stopped according in the first task rabbet channel
The request of first process task performs process, the fiber plant is appointed according to the second processing in the second task rabbet channel
Business request performs process.
Monitoring fiber plant performs the process shape for processing according to the first process task request in first task rabbet channel
After state, judge that whether its process state the pending state such as is, in this way, will fiber plant be switched to and another task groove
Mouth passage connection.The pending state such as so-called refers to that the tasks carrying of the first process task request depends on the further of client
There is provided.For example, current process task request is uploading pictures, the requirement on webpage to upper transmitting file for 40-80KB is provided with
JPG the or PNG files of interior size, if uploading the BMP files of 100KB, do not meet webpage requirement, now need client again
There is provided satisfactory picture to upload, if desired for client editing picture again, then process state for etc. pending state.Assume
Client provides the picture for meeting webpage requirement, can click on uploading pictures and can upload successfully, and process state is held for non-camp
Row state.
The beneficial effect of embodiment of the present invention is:It is different from the situation of prior art, many of embodiment of the present invention
Business changing method, when two process tasks for receiving at least two clients are asked, is which sets up corresponding task notch
Passage, each process task request have corresponding task rabbet channel, by the request of the first process task and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, allows fiber plant to process one of task groove
Process task request in mouth passage, monitors the fiber plant and is appointed according to the first process in the first task rabbet channel
Business request performs the process state for processing, and judges that whether the process state the pending state such as is, in this way, will optical fiber set
Standby being switched to is connected with another task rabbet channel.The multitask changing method of the embodiment of the present invention, using fiber plant
The characteristics of order segmentation is performed, carries out conduit switching.Two process task requests at least two clients provide corresponding
Task rabbet channel, after task rabbet channel is accessed with fiber plant, the process state of the execution process of process task request
For etc. pending state, even if fiber plant be switched to be connected with another task rabbet channel and perform process its process task please
Ask, improve the treatment effeciency to the request of multiple process tasks, it the pending state such as is that fiber plant is no longer waiting for process state
Process task is asked, and other process tasks is performed in being to switch to other task rabbet channels and is asked, and is realized to multiple with this
The free switching of task rabbet channel, can meet multiple process task requests of multiple client, limited fiber plant is provided
Source dispersion is utilized, and is improve the utilization rate of fiber plant, is shortened overall experimental period, meets teaching needs.
In another embodiment, Fig. 2 is referred to, methods described also includes:
If step 60, the fiber plant are performed according to the first process task request in the first task rabbet channel
The process state of process is that non-camp performs state, then wait the fiber plant according in the first task rabbet channel
The request execution of first process task is completed, and receives the fiber plant according to first in the first task rabbet channel
Process task request performs the first task result for completing to return afterwards.
If the process state of the first process task request is non-camp performing state, i.e. the first process task request is without the need for waiting
Treat that other conditions can perform, then performed according to the request of the first process task.The request of the first process task is waited to perform
Into the first task result for afterwards, receiving its return.Wherein first task result is asked comprising the first process task
The result that process is completed.
Step 70, the first task result is back to into first client.
First process task request is processed the result for completing and is back to the first client.
The beneficial effect of embodiment of the present invention is:If the process state of the first process task request is non-camp performs shape
The request of state, i.e. the first process task can perform without waiting for other conditions and process, and wait fiber plant execution to complete, and receive
After the first task result of return, the first client is fed back to, complete to perform the first process task and ask and feed back, allow visitor
The state of its process task request can be learnt in family end, lift the Consumer's Experience of client user.
In another embodiment, as shown in Fig. 2 methods described also includes:
Step 80, according to the first task result, destroy the first task rabbet channel.
The beneficial effect of embodiment of the present invention is, when receiving first task result, i.e. the first process task
Request is processed into can then destroy first task rabbet channel, destroy the validity of the assurable data of task rabbet channel
With uniformity, the time of monitor task rabbet channel is saved, lift monitoring efficiency.
In another embodiment, as shown in figure 3, methods described also includes:
Step 90, stop the fiber plant please according to the first process task in the first task rabbet channel
When asking execution to process, record first process task request of the fiber plant to the first task rabbet channel and perform
The implementation progress of process.
First process task request of the record fiber plant to the first task rabbet channel carries out performing holding for process
Traveling degree, it is known that know the request of the first process task and go to what progress, when switching back into first task rabbet channel behind convenience,
Continue executing with the request of the first process task.
Step 100, meet the fiber plant and continue to first in the first task rabbet channel when receiving
When reason task requests perform the processing data for processing, the fiber plant is monitored according to the in the second task rabbet channel
The request of two process tasks performs the process state for processing, and judges whether second processing task requests perform the process state for processing
For etc. pending state or execution complete.
Meet fiber plant to continue to perform the process for processing to the first process task request in first task rabbet channel
Data, refer to the process number for having been provided for allowing the process state of the first process task request to be no longer to wait for execution state
According to.Process task request in example is gone up for example for uploading pictures, the picture for uploading at the beginning is not met on webpage to upper transmitting file
Requirement be JPG the or PNG files that size within 40-80KB is provided, after client process, client is there is provided 55KB
JPG files, to meet the picture of webpage requirement, then ask to perform the processing data for processing to process task to meet.
Monitoring second processing task requests perform the process state for processing and perform process with monitoring the first process task request
Process state in the same manner.Server can arrange conduit Surveillance center and the process task request in each task rabbet channel is supervised
Listen.
Whether judge that second processing task requests perform the process state for processing is etc. that pending state or execution are completed,
No matter second processing task requests perform process process state for etc. pending state, be also carried out completion status, be nothing
The state accessed with fiber plant need to be continued.
If step 110, the fiber plant are held according to the second processing task requests in the second task rabbet channel
Row process process state for etc. pending state or execution complete, then the processing data is sent to the optical fiber and is set
It is standby, and the fiber plant is continued according in the first task rabbet channel according to the implementation progress and processing data
The first process task request perform process.
If the fiber plant performs what is processed according to the second processing task requests in the second task rabbet channel
Process state for etc. pending state or execution complete, as without the need for continue with fiber plant access state, then will process
Data is activation makes fiber plant on the implementation progress for recording before and the basis of the processing data for receiving to the fiber plant
On continue executing with process first task process request.Then example elaboration is gone up, is as allowed fiber plant to access first task notch and is led to
Road, the JPG files passes of the 55KB that continuation will be provided are to webpage backstage.And please without the need for from the beginning performing process first task process again
Ask, such as without the need for searching again the network address for uploading webpage, without the need for logging in the entrance that the webpage can just find uploading pictures again.
The beneficial effect of embodiment of the present invention is:Record and preserve the of the first task notch conduit that last time is switched
One task process request execution state, when first task notch conduit is continued into, a step to the execution state after
It is continuous to perform.First task process request is processed without the need for from the beginning performing, treatment effeciency is improved.By the process of actual control fiber plant
Task requests are performed stage by stage, shorten experimental period.
In another embodiment, methods described also includes:It is objective with first client and second respectively by socket
Family end connects;It is connected with the fiber plant by socket.Socket is also denoted as the communication technology of Socket.Using socket
Connection is capable of achieving quick connection.
The present invention provides multitask switching device embodiment again.Fig. 4 is referred to, the device is applied to server, many
Business switching device 30 includes receiving and setting up module 31, the first sending module 32, performs processing module 33, monitoring and judge module
34 and stop and perform processing module 35.
Receive and set up module 31, for receive at least from the first client the request of the first process task and come
From the second processing task requests of the second client when, respectively the first client the first process task request and the second client
The second processing task requests at end set up first task rabbet channel and the second task rabbet channel;
First sending module 32, sends to first task groove for the first process task request by first client
Mouth passage, and the second processing task requests of second client are sent to the second task rabbet channel;
Processing module 33 is performed, for fiber plant being made according to the first process task in the first task rabbet channel
Request performs process;
Monitoring and judge module 34, for monitoring the fiber plant according to first in the first task rabbet channel
Process task request performs the process state for processing, and judges that the first process task request performs the process state for processing and is
It is no for etc. pending state;
Stop and perform processing module 35, if the fiber plant according to first in the first task rabbet channel at
Reason task requests perform process process state for etc. pending state, the stopping and perform processing module be used for make the light
Fine equipment stops performing process according to the first process task request in the first task rabbet channel, makes the fiber plant
Process is performed according to the second processing task requests in the second task rabbet channel.
It should be noted that the multitask switching device of embodiment of the present invention proposition and the proposition of the inventive method embodiment
Multitask changing method is based on identical inventive concept, and embodiment of the method can be mutual with the relevant art content in device embodiment
It is suitable for, no longer describes in detail herein.
The beneficial effect of embodiment of the present invention is:It is different from the situation of prior art, many of embodiment of the present invention
Business changing method, when two process tasks for receiving at least two clients are asked, is which sets up corresponding task notch
Passage, each process task request have corresponding task rabbet channel, by the request of the first process task and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, allows fiber plant to process one of task groove
Process task request in mouth passage, monitors the fiber plant and is appointed according to the first process in the first task rabbet channel
Business request performs the process state for processing, and judges that whether the process state the pending state such as is, in this way, will optical fiber set
Standby being switched to is connected with another task rabbet channel.The multitask changing method of the embodiment of the present invention is at least two clients
The request of two process tasks corresponding task rabbet channel is provided, after task rabbet channel is accessed with fiber plant, process
The process state that the execution of task requests is processed for etc. pending state, even if fiber plant be switched to it is logical with another task notch
Road connects and performs process its process task asks, and improves the treatment effeciency to the request of multiple process tasks, and fiber plant is no longer
Waiting processing state such as is at the process task request of pending state, and performs other in being to switch to other task rabbet channels
Process task is asked, and is realized the free switching to multiple tasks rabbet channel with this, can be met multiple process of multiple client
Task requests, limited fiber plant resource dispersion are utilized, the utilization rate of fiber plant are improve, is shortened overall experiment
Time, meet teaching needs.
In another embodiment, Fig. 5 is referred to, described device also includes waiting and receiver module 36 and the second sending module
37。
Wait and receiver module 36, if the fiber plant is appointed according to the first process in the first task rabbet channel
It is that non-camp performs state that business request performs the process state for processing, and the wait and receiver module 36 are used to wait the optical fiber
Equipment is completed according to the first process task request execution in the first task rabbet channel, and receives the fiber plant
The first task for completing to return afterwards is performed according to the first process task request in the first task rabbet channel and processes knot
Really;
Second sending module 37, for the first task result is back to first client.
The beneficial effect of embodiment of the present invention is:If the process state of the first process task request is non-camp performs shape
The request of state, i.e. the first process task can perform without waiting for other conditions and process, and wait fiber plant execution to complete, and receive
After the first task result of return, the first client is fed back to, complete to perform the first process task and ask and feed back, allow visitor
The state of its process task request can be learnt in family end, lift the Consumer's Experience of client user.
In another embodiment, as shown in figure 5, described device also includes:
Module 38 is destroyed, for according to the first task result, destroying the first task rabbet channel.
The beneficial effect of embodiment of the present invention is, when receiving first task result, i.e. the first process task
Request is processed into can then destroy first task rabbet channel, destroy the validity of the assurable data of task rabbet channel
With uniformity, the time of monitor task rabbet channel is saved, lift monitoring efficiency.
In another embodiment, as shown in fig. 6, described device also includes logging modle 39 and sends and perform processing module
41。
Logging modle 39, for making the fiber plant stop at according to first in the first task rabbet channel
Reason task requests are performed when processing, and record the fiber plant and the first process task of the first task rabbet channel is asked
Carry out performing the implementation progress of process;
The monitoring and judge module 34 are additionally operable to work as receive and meet the fiber plant continuation to the first task
When the first process task request in rabbet channel performs the processing data for processing, the fiber plant is monitored according to described second
Second processing task requests in task rabbet channel perform the process state for processing, and judge that second processing task requests are performed
Whether the process state of process is etc. that pending state or execution are completed;
Send and perform processing module 41, if the fiber plant according to second in the second task rabbet channel at
Reason task requests perform process process state for etc. pending state or execution complete, it is described transmission and perform processing module
41 for the processing data is sent to the fiber plant, and makes the fiber plant according to the implementation progress and place
Reason data continue to perform process according to the first process task request in the first task rabbet channel.
The beneficial effect of embodiment of the present invention is:Record and preserve the of the first task notch conduit that last time is switched
One task process request execution state, when first task notch conduit is continued into, a step to the execution state after
It is continuous to perform.First task process request is processed without the need for from the beginning performing, treatment effeciency is improved.By the process of actual control fiber plant
Task requests are performed stage by stage, shorten experimental period.
In another embodiment, described device also includes:
Link block, for being connected with first client and the second client by socket respectively;The connection
Module is additionally operable to be connected with the fiber plant by socket.Quick connection is capable of achieving using socket connection.
Embodiments of the present invention are the foregoing is only, the scope of the claims of the present invention is not thereby limited, it is every using this
Equivalent structure or equivalent flow conversion that description of the invention and accompanying drawing content are made, or directly or indirectly it is used in other correlations
Technical field, is included within the scope of the present invention.