Summary of the invention
The present invention is waited for for a long time when testing for the prior art, causes experimental period too long or intelligent acess
The technical issues of data corruption of equipment, provides a kind of multitask switching method and device.
In order to solve the above technical problems, the technical solution that embodiment of the present invention uses is: providing a kind of multitask
Switching method, comprising:
It is receiving at least from the first processing task requests of the first client and second from the second client
When managing task requests, the second processing task requests of the first processing task requests and the second client of respectively the first client
Establish first task rabbet channel and the second task rabbet channel;
The first of first client processing task requests are 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 set to execute processing according to the first processing task requests in the first task rabbet channel;
It monitors the fiber plant and executes processing according to the first processing task requests in the first task rabbet channel
Processing status, and whether the processing status for judging that the first processing task requests execute processing the pending state such as is;
If the fiber plant executes processing according to the first processing task requests in the first task rabbet channel
Processing status such as is at the pending state, then stops the fiber plant at according to first in the first task rabbet channel
Reason task requests execute processing, make the fiber plant according to the second processing task requests in the second task rabbet channel
Execute processing.
Optionally, the method also includes:
If the fiber plant executes processing according to the first processing task requests in the first task rabbet channel
Processing status be non-camp execute state, then wait the fiber plant according to first in the first task rabbet channel at
Reason task requests execute completion, and receive the fiber plant and appointed according to the first processing in the first task rabbet channel
Business request executes the first task processing result for completing to return later;
The first task processing result is back to first client.
Optionally, the method also includes:
According to the first task processing result, the first task rabbet channel is destroyed.
Optionally, the method also includes:
The fiber plant is set to stop being executed according to the first processing task requests in the first task rabbet channel
When processing, records the fiber plant and the first processing task requests of the first task rabbet channel are carried out executing processing
Implementation progress;
Meet the fiber plant when receiving and continue to ask the first processing task in the first task rabbet channel
When seeking the processing data for executing and handling, monitors the fiber plant and appointed according to the second processing in the second task rabbet channel
Business request executes the processing status of processing, and whether the processing status for judging that second processing task requests execute processing is to wait holding
Row state executes completion;
If the fiber plant executes processing according to the second processing task requests in the second task rabbet channel
Processing status is etc. pending state or to execute completion, then the processing data is sent to the fiber plant, and make
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 execute processing.
Optionally, the method also includes:
It is connect respectively with described the first client and the second client by socket;
It is connect by socket with the fiber plant.
In order to solve the above technical problems, another technical solution that embodiment of the present invention uses is: providing more a kind of
Business switching device, comprising:
Module is received and establishes, for receiving the first processing task requests at least from the first client and coming from
When the second processing task requests of the second client, the first processing task requests of respectively the first client and the second client
Second processing task requests establish first task rabbet channel and the second task rabbet channel;
First sending module, for the first processing task requests of first client to be sent to first task notch
Channel, and the second processing task requests of second client are sent to the second task rabbet channel;
Processing module is executed, for asking that fiber plant according to the first processing task in the first task rabbet channel
Execution is asked to handle;
Monitoring and judgment module, for monitor the fiber plant according to first in the first task rabbet channel at
Manage task requests execute processing processing status, and judge it is described first processing task requests execute processing processing status whether
For etc. pending state;
Stop and execute processing module, if the fiber plant is according to the first processing in the first task rabbet channel
The processing status that task requests execute processing such as is at the pending state, and the stopping and execution processing module are for making the optical fiber
Equipment stops executing processing according to the first processing task requests in the first task rabbet channel, makes the fiber plant root
Processing is executed according to the second processing task requests in the second task rabbet channel.
Optionally, described device further include:
Waiting and receiving module, if the fiber plant is according to the first processing task in the first task rabbet channel
The processing status that request executes processing is that non-camp executes state, and the waiting and receiving module are for waiting the fiber plant
According in the first task rabbet channel first processing task requests execute completion, and receive the fiber plant according to
The first processing task requests in the first task rabbet channel execute the first task processing result for completing to return later;
Second sending module, for the first task processing result to be back to first client.
Optionally, described device further include:
Module is destroyed, for destroying the first task rabbet channel according to the first task processing result.
Optionally, described device further include:
Logging modle, for stopping the fiber plant according to the first processing in the first task rabbet channel
When task requests execute processing, record the fiber plant to the first of the first task rabbet channel the processing task requests into
Row executes the implementation progress of processing;
The monitoring and judgment module are also used to meet the fiber plant and continue to the first task slot when receiving
When the first processing task requests in mouth channel execute the processing data of processing, the fiber plant is monitored according to described second
The second processing task requests being engaged in rabbet channel execute the processing status of processing, and judge at second processing task requests execution
Whether the processing status of reason the pending state such as is or executes completion;
It sends and executes processing module, if the fiber plant is according to the second processing in the second task rabbet channel
The processing status that task requests execute processing is etc. pending state or executes completions, the transmission and executes processing module use
In the processing data are sent to the fiber plant, and make the fiber plant according to the implementation progress and processing number
Processing is executed according to the first processing task requests in the first task rabbet channel according to continuation.
Optionally, described device further include:
Link block, for being connect respectively with described the first client and the second client by socket;
The link block is also used to connect by socket with the fiber plant.
The beneficial effect of embodiment of the present invention is: being in contrast to the prior art, more of embodiment of the present invention
Business switching method establishes corresponding task notch when receiving two processing task requests of at least two clients for it
Channel, each processing task requests have corresponding task rabbet channel, by the first processing task requests and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, and fiber plant is allowed to handle one of task slot
Processing task requests in mouth channel monitor the fiber plant and are appointed according to the first processing in the first task rabbet channel
Business request executes the processing status of processing, and judges whether the processing status the pending state such as is, if so, setting optical fiber
Standby be switched to connect with another task rabbet channel.The multitask switching method of the embodiment of the present invention is at least two clients
Two processing task requests corresponding task rabbet channel is provided, after task rabbet channel and fiber plant access, processing
The processing status of the execution processing of task requests such as is at the pending state, though fiber plant be switched to it is logical with another task notch
Road connects and executes its processing task requests of processing, improves the treatment effeciencies to multiple processing task requests, fiber plant is no longer
Waiting processing state such as is at the processing task requests of pending state, and is to switch in other task rabbet channels and executes other
Task requests are handled, the free switching to multiple tasks rabbet channel is realized with this, multiple processing of multiple client can be met
Limited fiber plant resource is dispersed to utilize, improves the utilization rate of fiber plant, shorten whole experiment by task requests
Time meets teaching needs.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.
In addition, as long as technical characteristic involved in the various embodiments of the present invention described below is each other not
Constituting conflict can be combined with each other.
Optical transport: EPON (Ethernet Passive Optical Network, Ethernet passive optical network), is to be based on
Passive optical network (PON) technology of Ethernet.It is transmitted using point-to-multipoint structure, passive fiber, is provided on Ethernet
Multiple business.EPON technology is standardized by IEEE802.3EFM working group.In June, 2004, IEEE802.3EFM working group
Issuing EPON standard --- IEEE802.3ah (is incorporated to IEEE802.3-2005 standard in 2005).In the standard by ether
Net and PON technology combine, and use PON technology in physical layer, use Ethernet protocol in data link layer, utilize passive optical network
Topological structure realize Ethernet access.Therefore, it combines the advantages of PON technology and ethernet technology: low cost, high band
It is wide, scalability is strong, it is compatible with existing Ethernet, facilitate and manage etc..
Referring to Fig. 1, the embodiment of multitask switching method of the present invention includes:
Step 10 is being received at least from the first processing task requests of the first client and from the second client
When second processing task requests, the first processing task requests 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 established in business request.
The multitask switching method of the embodiment of the present invention can execute on the server.When the processing for receiving client is appointed
When business request, corresponding task rabbet channel is established for it, each processing task requests have corresponding task rabbet channel.It builds
Vertical task rabbet channel is to dock in order to subsequent with fiber plant.If a processing task requests of only one client,
Only its incoming fiber optic equipment just need to be needed the problem of switching between multitask there is no the present invention.When receiving
When one processing task requests and second processing task requests at least two handle task requests, just need to establish corresponding the respectively
One task rabbet channel and the second task rabbet channel.
Processing task requests are MML (man-machine language, Man-Machine Language, abbreviation MML) order.
First processing task requests of first client are sent to first task rabbet channel by step 20, 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, first is handled at task requests and second
Task requests are managed to send.Specifically, server is equipped with Client command alternation of bed and communicates with a task rabbet channel.
Step 30 handles fiber plant at task requests execution according to first in the first task rabbet channel
Reason.
Fiber plant is allowed to handle the processing task requests 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 processing task requests, according to excellent
First grade sequence allows fiber plant to handle corresponding processing task requests.For example, the first processing task requests of parsing and second processing
Task requests simultaneously generate priority for it, and the priority of such as the first processing task requests is the second priority, second processing task
Request is the first priority, then fiber plant is allowed to handle the second processing task requests in the second task rabbet channel.Server
Client processing layer is responsible for the processing task requests of processing parsing client.
Step 40, the monitoring fiber plant are held according to the first processing task requests in the first task rabbet channel
The processing status of row processing, and judge whether the processing status the pending state such as is.
Specifically, server is equipped with conduit monitoring center, and server opens conduit monitoring center, monitors each task notch
The processing task requests in channel execute the processing status of processing.And judge whether processing status the pending state such as is, if so, then
Enter step 50.
If step 50, the fiber plant are executed according to the first processing task requests in the first task rabbet channel
The processing status of processing such as is at the pending state, then stops the fiber plant according in the first task rabbet channel
First processing task requests execute processing, appoint the fiber plant according to the second processing in the second task rabbet channel
Business request executes processing.
Monitor the processing shape that fiber plant executes processing according to the first processing task requests in first task rabbet channel
After state, judge whether its processing status the pending state such as is, if so, being switched to fiber plant and another task slot
The connection of mouth channel.The pending state such as so-called refers to that the task execution of the first processing task requests depends on the further of client
It provides.For example, current processing task requests are uploading pictures, the requirement on webpage to upper transmitting file be provide 40-80KB with
JPG the or PNG file of interior size does not meet webpage requirement, needs client at this time again if uploading the BMP file of 100KB
Satisfactory picture is provided to upload, such as needs client editing picture again, then processing status be etc. pending state.Assuming that
Client provides the picture for meeting webpage requirement, can click uploading pictures and can upload successfully, processing status is held for non-camp
Row state.
The beneficial effect of embodiment of the present invention is: being in contrast to the prior art, more of embodiment of the present invention
Business switching method establishes corresponding task notch when receiving two processing task requests of at least two clients for it
Channel, each processing task requests have corresponding task rabbet channel, by the first processing task requests and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, and fiber plant is allowed to handle one of task slot
Processing task requests in mouth channel monitor the fiber plant and are appointed according to the first processing in the first task rabbet channel
Business request executes the processing status of processing, and judges whether the processing status the pending state such as is, if so, setting optical fiber
Standby be switched to connect with another task rabbet channel.The multitask switching method of the embodiment of the present invention, utilizes fiber plant
The characteristics of order segmentation executes, carries out conduit switching.For at least two clients two processing task requests provide it is corresponding
Task rabbet channel handles the processing status of the execution processing of task requests after task rabbet channel and fiber plant access
For etc. pending state, even if fiber plant be switched to connect and execute with another task rabbet channel handle its processing task ask
It asks, improves the treatment effeciencies to multiple processing task requests, it the pending state such as is that fiber plant, which is no longer waiting for processing status,
Task requests are handled, and is to switch in other task rabbet channels and executes other processing task requests, are realized with this to multiple
The free switching of task rabbet channel can meet multiple processing task requests of multiple client, limited fiber plant is provided
Source dispersion utilizes, and improves the utilization rate of fiber plant, shortens whole experimental period, meets teaching needs.
In another embodiment, referring to Fig. 2, the method also includes:
If step 60, the fiber plant are executed according to the first processing task requests in the first task rabbet channel
The processing status of processing is that non-camp executes state, then waits the fiber plant according in the first task rabbet channel
First processing task requests execute completion, and receive the fiber plant according to first in the first task rabbet channel
It handles task requests and executes the first task processing result for completing to return later.
If first handles the processing status of task requests as non-camp execution state, i.e., the first processing task requests are not necessarily to etc.
It is i.e. executable to other conditions, then it is executed according to the first processing task requests.The first processing task requests are waited to execute
At the first task processing result for later, receiving its return.Wherein first task processing result includes the first processing task requests
Handle the result completed.
The first task processing result is back to first client by step 70.
The result that first processing task requests processing is completed is back to the first client.
The beneficial effect of embodiment of the present invention is: if the processing status of the first processing task requests is that non-camp executes shape
State, i.e., the first processing task requests wait fiber plant to execute completion, receive without waiting for the i.e. executable processing of other conditions
After the first task processing result of return, the first client is fed back to, complete to execute the first processing task requests and simultaneously feed back, allow visitor
Family end can learn that it handles the state of task requests, promote the user experience of client user.
In another embodiment, as shown in Fig. 2, the method also includes:
Step 80, according to the first task processing result, destroy the first task rabbet channel.
The beneficial effect of embodiment of the present invention is that when receiving first task processing result, i.e., first handles task
It requests processed at can then destroy first task rabbet channel, destroy the validity of the assurable data of task rabbet channel
With consistency, the time of monitor task rabbet channel is saved, promotes monitoring efficiency.
In another embodiment, as shown in figure 3, the method also includes:
Step 90 makes the fiber plant stop being asked according to the first processing task in the first task rabbet channel
When execution being asked to handle, records the fiber plant and the first processing task requests of the first task rabbet channel are executed
The implementation progress of processing.
Record fiber plant carries out executing holding for processing to the first processing task requests of the first task rabbet channel
Traveling degree, it is known that know what progress is the first processing task requests go to, when back being facilitated to switch back into first task rabbet channel,
Continue to execute the first processing task requests.
Step 100 meets the fiber plant and continues at first in the first task rabbet channel when receiving
When managing task requests and executing the processing data of processing, the fiber plant is monitored according to the in the second task rabbet channel
Two processing task requests execute processing processing status, and judge second processing task requests execute processing processing status whether
For etc. pending state or execute completion.
Meet fiber plant and continues the processing that the first processing task requests in first task rabbet channel are executed with processing
Data, refer to have been provided can allow the first processing task requests processing status be no longer etc. pending state processing number
According to.Such as the processing task requests in upper example are uploading pictures, the picture uploaded at the beginning is not met on webpage to upper transmitting file
Requirement be that JPG the or PNG file of size within 40-80KB is provided, after client process, client provides 55KB's
JPG file then executes the processing data handled to processing task requests to meet for the picture for meeting webpage requirement.
Monitoring second processing task requests execute the processing status of processing and monitoring the first processing task requests execute processing
Processing status similarly.The settable conduit monitoring center of server supervises the processing task requests in each task rabbet channel
It listens.
Judge that second processing task requests execute whether the processing status of processing the pending state such as is or executes completion,
Regardless of second processing task requests execute processing processing status be etc. pending state, or execute completion status, be nothing
It need to continue the state accessed with fiber plant.
If step 110, the fiber plant are held according to the second processing task requests in the second task rabbet channel
The processing status of row processing is etc. pending state or to execute completion, then the processing data is sent to the optical fiber and set
It is standby, and continue the fiber plant according in the first task rabbet channel according to the implementation progress and processing data
First processing task requests execute processing.
If the fiber plant executes processing according to the second processing task requests in the second task rabbet channel
Processing status is etc. pending state or executes completions, as without continuing the state with fiber plant access, then will be handled
Data are sent to the fiber plant, make fiber plant on the basis of the implementation progress recorded before and the processing data received
On continue to execute processing first task processing request.Then upper example illustrates, as allows fiber plant access first task notch logical
Road, the JPG file for continuing the 55KB that will be provided upload to webpage backstage.It is asked without from the beginning executing processing first task processing again
It asks, such as without searching the network address for uploading webpage again, the entrance of uploading pictures can be found by no longer needing to log in the webpage.
The beneficial effect of embodiment of the present invention is: recording and saving the of the first task notch conduit that last time is switched
One task processing request execution state, when continuing into first task notch conduit, a step to the execution state after
It is continuous to execute.Without from the beginning executing processing first task processing request, treatment effeciency is improved.By the processing of practical control fiber plant
Task requests execute stage by stage, shorten experimental period.
In another embodiment, the method also includes: by socket respectively with first client and second visitor
The connection of family end;It is connect by socket with the fiber plant.Socket is also denoted as the communication technology of Socket.Use socket
Quickly connection can be achieved in connection.
The present invention provides multitask switching device embodiment again.Referring to Fig. 4, the device be applied to server, more
Business switching device 30 includes receiving and establishing module 31, the first sending module 32, execute processing module 33, monitoring and judgment module
34 and stop and execute processing module 35.
Module 31 is received and establishes, for receiving the first processing task requests at least from the first client and coming
When from the second processing task requests of the second client, the first processing task requests of respectively the first client and the second client
The second processing task requests at end establish first task rabbet channel and the second task rabbet channel;
First sending module 32, for the first processing task requests of first client to be sent to first task slot
Mouth channel, and the second processing task requests of second client are sent to the second task rabbet channel;
Processing module 33 is executed, for making fiber plant according to the first processing task in the first task rabbet channel
Request executes processing;
Monitoring and judgment module 34, for monitoring the fiber plant according to first in the first task rabbet channel
It handles task requests and executes the processing status of processing, and the processing status for judging that the first processing task requests execute processing is
It is no for etc. pending state;
Stop and execute processing module 35, if the fiber plant according to first in the first task rabbet channel at
Managing task requests and executing the processing status of processing the pending state such as is, the stopping and execution processing module are for making the light
Fine equipment stops executing processing according to the first processing task requests in the first task rabbet channel, makes the fiber plant
Processing is executed according to the second processing task requests in the second task rabbet channel.
It should be noted that multitask switching device and embodiment of the present invention method that the embodiment of the present invention proposes proposed
Multitask switching method is based on identical inventive concept, and embodiment of the method can be mutual with the relevant art content in Installation practice
It is applicable in, and will not be described here in detail.
The beneficial effect of embodiment of the present invention is: being in contrast to the prior art, more of embodiment of the present invention
Business switching method establishes corresponding task notch when receiving two processing task requests of at least two clients for it
Channel, each processing task requests have corresponding task rabbet channel, by the first processing task requests and second processing task
Request is separately sent to first task rabbet channel and the second task rabbet channel, and fiber plant is allowed to handle one of task slot
Processing task requests in mouth channel monitor the fiber plant and are appointed according to the first processing in the first task rabbet channel
Business request executes the processing status of processing, and judges whether the processing status the pending state such as is, if so, setting optical fiber
Standby be switched to connect with another task rabbet channel.The multitask switching method of the embodiment of the present invention is at least two clients
Two processing task requests corresponding task rabbet channel is provided, after task rabbet channel and fiber plant access, processing
The processing status of the execution processing of task requests such as is at the pending state, though fiber plant be switched to it is logical with another task notch
Road connects and executes its processing task requests of processing, improves the treatment effeciencies to multiple processing task requests, fiber plant is no longer
Waiting processing state such as is at the processing task requests of pending state, and is to switch in other task rabbet channels and executes other
Task requests are handled, the free switching to multiple tasks rabbet channel is realized with this, multiple processing of multiple client can be met
Limited fiber plant resource is dispersed to utilize, improves the utilization rate of fiber plant, shorten whole experiment by task requests
Time meets teaching needs.
In another embodiment, referring to Fig. 5, described device further includes waiting and receiving module 36 and the second sending module
37。
Waiting and receiving module 36, if the fiber plant is appointed according to the first processing in the first task rabbet channel
The processing status that business request executes processing is that non-camp executes state, and the waiting and receiving module 36 are for waiting the optical fiber
Equipment executes completion according to the first processing task requests in the first task rabbet channel, and receives the fiber plant
The first task returned after completing is executed according to the first processing task requests in the first task rabbet channel handles knot
Fruit;
Second sending module 37, for the first task processing result to be back to first client.
The beneficial effect of embodiment of the present invention is: if the processing status of the first processing task requests is that non-camp executes shape
State, i.e., the first processing task requests wait fiber plant to execute completion, receive without waiting for the i.e. executable processing of other conditions
After the first task processing result of return, the first client is fed back to, complete to execute the first processing task requests and simultaneously feed back, allow visitor
Family end can learn that it handles the state of task requests, promote the user experience of client user.
In another embodiment, as shown in figure 5, described device further include:
Module 38 is destroyed, for destroying the first task rabbet channel according to the first task processing result.
The beneficial effect of embodiment of the present invention is that when receiving first task processing result, i.e., first handles task
It requests processed at can then destroy first task rabbet channel, destroy the validity of the assurable data of task rabbet channel
With consistency, the time of monitor task rabbet channel is saved, promotes monitoring efficiency.
In another embodiment, as shown in fig. 6, described device further includes logging modle 39 and sends and execute processing module
41。
Logging modle 39, for stopping the fiber plant at according to first in the first task rabbet channel
When managing task requests execution processing, records the fiber plant and handle task requests to the first of the first task rabbet channel
Execute the implementation progress of processing;
The monitoring and judgment module 34 are also used to meet the fiber plant and continue to the first task when receiving
When the first processing task requests in rabbet channel execute the processing data of processing, the fiber plant is monitored according to described second
Second processing task requests in task rabbet channel execute the processing status of processing, and judge that second processing task requests execute
Whether the processing status of processing the pending state such as is or executes completion;
Send and execute processing module 41, if the fiber plant according to second in the second task rabbet channel at
The processing status that reason task requests execute processing is etc. pending state or executes completions, described to send and execute processing module
41 for being sent to the fiber plant for the processing data, and makes the fiber plant according to the implementation progress and place
Reason data continue to execute processing according to the first processing task requests in the first task rabbet channel.
The beneficial effect of embodiment of the present invention is: recording and saving the of the first task notch conduit that last time is switched
One task processing request execution state, when continuing into first task notch conduit, a step to the execution state after
It is continuous to execute.Without from the beginning executing processing first task processing request, treatment effeciency is improved.By the processing of practical control fiber plant
Task requests execute stage by stage, shorten experimental period.
In another embodiment, described device further include:
Link block, for being connect respectively with described the first client and the second client by socket;The connection
Module is also used to connect by socket with the fiber plant.It is connected using socket and quickly connection can be achieved.
Mode the above is only the implementation of the present invention is not intended to limit the scope of the invention, all to utilize this
Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is relevant to be applied directly or indirectly in other
Technical field is included within the scope of the present invention.