Summary of the invention
Shortcoming present in view of the above technology, the present invention provide a kind of raising system effectiveness, to ensure its offer
The TOC service model of better network communication services being lined up based on M/M/1 and its calculation method of service response time.
To achieve the above object, the present invention provide it is a kind of based on M/M/1 be lined up TOC service model, including client and
Server as the exclusive node for completing user's calculating demand;User submits operation request, clothes by user end to server
Result is fed back to client again after completing operation by business device;
The server includes operation request receiving module, data preprocessing module, task scheduling modules, processor distribution
Module, processor hardware reconstructed module, processor module, decoder module and operation result sending module;Operation request receives
After module receives the operation request of user's submission, data preprocessing module is sent it to;Data preprocessing module calculates
The priority of operation request is simultaneously inserted into chained list to be dispatched;Task scheduling modules complete the scheduling of task in chained list, by task
It is sent to processor distribution module;Processor distribution module is according to the different fortune that distribution according to need principle is in being scheduled for task
Optics processor resource is matched in point counting;Meanwhile processor hardware reconstructed module is completed at optics according to the different calculating demand of user
Reason thinks highly of structure, and is that user completes operation with the processor module reconstructed, and decoder module is decoded operation result,
And operation result is sent to operation result sending module, last operation result sending module feeds back to operation result accordingly
Client.
To achieve the above object, the present invention also provides when a kind of service response of TOC service model being lined up based on M/M/1
Between calculation method, different user concurrently can submit operation to request, will be by waiting system arrange when nonidentity operation request reaches
Team, therefore it is based on M/M/1 queuing system, TOC is public for the calculating for the average response time T that n operation request provides the service of calculating
Formula is:
T=TRA+TDPP+TRS+TRT (1)
Wherein TRAIndicate that operation request receiving module receives operation request required average time, TDPPOperation is asked in expression
It asks and carries out pre-processing required average time, TRSAverage time needed for indicating scheduler task, TRTExpression sends operation result
To the average time of user;
The TRAIt is calculated as
Wherein λ indicates the number of tasks reached in the unit time, that is, operation request arrival rate, and μ indicates each operation request
Average calculating operation amount, ω indicate to receive the network transfer speeds of operation request;
The TDPPIt is calculated as
Wherein τ indicates that data preprocessing module carries out pre-treating speed to the data in operation request;
The TRSIt is calculated as
Wherein θ indicates task scheduling modules, processor distribution module, processor hardware reconstructed module, place's device module reconciliation
The service speed of the waiting queue processed of code device module composition;
The TRTIt is calculated as
(2), (3), (4) and (5) formula substitution (1) formula are obtained into service average response time T:
Wherein, task scheduling modules send data to TOCAverage transmission rate be j, processor hardware reconstructed module
Completing the processor distribution time is constant C1, the time that processor hardware reconstructed module completes optical processor reconstruct is constant C2,
The processing speed of TOC is δ, then task scheduling modules, processor distribution module, processor hardware reconstructed module, processor module
It can be acquired by following formula (7) with the service speed θ of the waiting queue processed of decoder module composition;And the formula (4) is to pass through
Formula (7) obtains
Wherein, the TRSNot only include the task schedule time, further include processor distribution the time, processor reconstitution time,
Operation time and decoding time.
Wherein, the n operation request reaches the exponential distribution for obeying that parameter is λ, and transmitted data amount is μ/2, transmits number
It is the ω of μ/2 according to required average time, the service speed that operation request number is received in the unit time is 2 ω/μ.
The beneficial effects of the invention are as follows:Compared with prior art, the TOC service provided by the invention being lined up based on M/M/1
The calculation method of model and its service response time, user submit operation to request by user end to server, and server is completed
Result is fed back into client again after operation;Based on M/M/1 queuing system and tandem queue and first come first served basis, obtain
The calculation method of the overall service response time of TOC service is arrived, which obtains, discovery service response time is with appointing
Business arrival rate and operand increase and increase, reduced with the increase of network transmission rate.By the improvement of the system and method,
System effectiveness is improved, to ensure that it provides better network communication services.In addition, the calculating of the system service response time is public
Formula, therefore model emulation, which shows operand, and wide area network transmission speed is, which influences the bottleneck of system response time, will improve system
Efficiency is with regard to the appropriate task management system of necessary analysis and design, to facilitate user to use TOC as using electronic computer,
To reduce volume of transmitted data.
Specific embodiment
In order to more clearly state the present invention, the present invention is further described with reference to the accompanying drawing.
The TOC service model of the invention being lined up based on M/M/1 referring to FIG. 1-2, including client 1 and as completion
User calculates the server 2 of the exclusive node of demand;User submits operation request, server 2 to server 2 by client 1
Result is fed back into client 1 again after completing operation;
Server 2 includes operation request receiving module 21, data preprocessing module 22, task scheduling modules 23, processor
Distribution module 24, processor hardware reconstructed module 25, processor module 26, decoder module 27 and operation result sending module
28;After operation request receiving module 21 receives the operation request of user's submission, data preprocessing module 22 is sent it to;Number
Data preprocess module 22 calculates the priority of operation request and is inserted into chained list to be dispatched;Task scheduling modules 23 complete chained list
Task is sent processor distribution module 24 by the scheduling of middle task;Processor distribution module 24 according to distribution according to need principle be
Nonidentity operation in being scheduled for task distributes optical processor resource;Meanwhile processor hardware reconstructed module 25 according to
The different calculating demand in family completes optical processor reconstruct, and is that user completes operation with the processor module 26 reconstructed,
Decoder module 27 is decoded operation result, and operation result is sent to operation result sending module 28, last operation
As a result operation result is fed back to corresponding client 1 by sending module 28.
The present invention also provides a kind of calculation method of the service response time of TOC service model being lined up based on M/M/1, packets
It includes because different user concurrently can submit operation to request, it will be by waiting system to be lined up, therefore when nonidentity operation request reaches
Based on M/M/1 queuing system, TOC is for the calculation formula for the average response time T that n operation request provides the service of calculating:
T=TRA+TDPP+TRS+TRT (1)
Wherein TRAIndicate that operation request receiving module receives operation request required average time, TDPPOperation is asked in expression
It asks and carries out pre-processing required average time, TRSAverage time needed for indicating scheduler task, TRTExpression sends operation result
To the average time of user;
TRAIt is calculated as
Wherein λ indicates the number of tasks reached in the unit time, that is, operation request arrival rate, and μ indicates each operation request
Average calculating operation amount, ω indicate to receive the network transfer speeds of operation request;
TDPPIt is calculated as
Wherein τ indicates that data preprocessing module carries out pre-treating speed to the data in operation request;
TRSIt is calculated as
Wherein θ indicate task scheduling modules, processor distribution module, processor hardware reconstructed module, processor module and
The service speed for the waiting queue processed that decoder module is constituted;
TRTIt is calculated as
(2), (3), (4) and (5) formula substitution (1) formula are obtained into service average response time T:
In the present embodiment, by the data in an operation to be calculated request when task scheduling modules carry out task schedule
It is sent to TOC, and it is deleted from queue.And preprocessor distribution module be its carry out optical processor distribution, processing
Device hardware reconstruction module carries out optical processor reconstruct for it, and processor module carries out optical operation, and decoder module is to operation knot
Fruit is decoded.In other words, task scheduling modules, processor distribution module, processor hardware reconstructed module, processor module
It can be modeled with waiting M/M/1 queuing system together with 5 block combiners such as decoder module.Therefore, TRSNot only wrap
The task schedule time is included, further includes processor distribution time, processor reconstitution time, operation time and decoding time.Processor
The processor hardware reconstructed module that distribution module carries out processor distribution sum carries out all being one normal the time required to arithmetic unit reconstruct
Number.What is particularly worth mentioning is that processor reconstructed module is specific to TOC.Although the module makes TOC be provided with the spirit of calculating
Activity, but also increase overhead.Therefore, in order to analyze the two modules to system performance especially service response time
It influences, though constant, can not be ignored.
The average transmission rate that task scheduling modules send data to TOC is j, and processor hardware reconstructed module is completed
Processor distributes the time as constant C1, the time that processor hardware reconstructed module completes optical processor reconstruct is constant C2, TOC
Processing speed be δ, then task scheduling modules, processor distribution module, processor hardware reconstructed module, processor module reconciliation
The service speed θ of the waiting queue processed of code device module composition can be acquired by following formula (7);And formula (4) is obtained by formula (7)
's.
The calculation method of the TOC service model provided by the invention being lined up based on M/M/1 and its service response time, user
Operation request is submitted by user end to server, result is fed back to client again after completing operation by server;Based on M/M/1
Queuing system and tandem queue and first come first served basis have obtained the calculating of the overall service response time of TOC service
Method, the calculation method show that discovery service response time increases with the increase of task arrival rate and operand, with network
The increase of transmission rate and reduce.By the improvement of the system and method, system effectiveness is improved, to ensure that it provides better network
Communication service.In addition, the calculation formula of the system service response time, model emulation shows operand and wide area network transmission speed
It is the bottleneck for influencing system response time, therefore, to improve system effectiveness just must the appropriate task management system of analysis and design
System, to facilitate user to use TOC as using electronic computer, to reduce volume of transmitted data.
The present invention will establish TOC service model based on M/M/1 queuing system and First Come First Served strategy with Analysis Service
The global response time.Have a unique operation request receiving module in server, for receive user comprising several two
The operation of first three-valued logic operation is requested.To reduce transmitted data amount, the operand of each operation is to communicate Internal Code (each operation
Number accounts for 2 binary digits) mode is transmitted to operation request receiving module, i.e., and each byte stores 2 pairs of operands.Because difference is used
Family concurrently can submit operation to request, and will be lined up by waiting making when nonidentity operation request reaches, therefore operation request receives
Module can be expressed with a M/M/1 queuing system.Using a binary three-valued logic operation as the digit of operand,
Assuming that the exponential distribution that parameter is λ is obeyed in n operation request arrival, the average calculating operation amount of each operation request is μ, reception operation is asked
The network transfer speeds asked are ω, then transmitted data amount is μ/2, and average time needed for transmitting data is the ω of μ/2, in the unit time
Receiving operation request number, that is, operation request receiving module service speed is 2 ω/μ.That is, receiving operation requests luck
It is 2 ω/μ exponential distribution that parameter is obeyed in the service for calculating request receiving module.Operation request receiving module has received operation request
Afterwards, data preprocessing module just pre-processes it.Data preprocessing module is also unique in the server.Namely
It says, data preprocessing module can also be expressed with a M/M/1 queuing system.If data preprocessing module is in operation request
Data to carry out pretreated speed be τ, then similarly known to data preprocessing module obey the exponential distribution that parameter is τ/μ.
Obviously, in server existence anduniquess a task scheduling modules.Although having proposed the timer-triggered scheduler strategy of suitable TOC, the plan
Optical processor can slightly be made while handling multiple operation requests, but for simplicity, it is assumed that only handle an operation every time and ask
Ask, as soon as i.e. TOC is every handled a task after, task scheduling modules dispatch a task to TOC, which is referred to as operation
Scheduling strategy when completion, scheduling strategy when referred to as completing.Processor distribution module is according to the operand of operation each in task
Each operation carries out distribution according to need optical processor and has ensured that each operation is completed at the same time, and optical processor needed for searching each operation
Code is reconstructed, the processor reconstructed module of TOC is then sent it to.Because of nonidentity operation included in each operation request
No more than 15, the reconfiguration information amount variation for being sent to processor hardware reconstructed module is little.Thus, it is assumed that operation request receives
Module is completed the time required to processor distribution to be a constant.Processor hardware reconstructed module receive processor allocation result and.
Just the reconstruct of processor is carried out after the reconstruct code of optical processor needed for each operation, the reconstruct of each arithmetic unit is parallel
, therefore to given optical processor, reconstruct takes time to be also a constant.It completes after processor reconstructs at TOC optics
It manages device and operation is carried out to data, decoder is decoded operation result, and operation result is sent to result operation result hair
Send module.Obviously, the operation time of TOC is related with the arithmetic speed of operand μ and optical processor.Because network transfer speeds are remote
Less than the processing speed of optical processor, so operation result sending module can also be expressed with a M/M/1 queuing system.Cause
For for binary three-valued logic operation, two operands obtain an operation result, so the size of operation result is μ/4.
Obviously, the speed for sending operation result is also network transfer speeds ω.Therefore parameter is obeyed in the service of operation result sending module
For 4 ω/μ exponential distribution.As can be seen from the above analysis, above-mentioned each process constitutes a 4 stage tandem queue [system]s, such as
Shown in Fig. 3.
In order to study different parameters to the system performance especially influence of average response time T, model is emulated, phase
It is as follows to close parameter:
The arrival rate λ of operation request:The number of tasks reached in the unit time.The increasing function that the T known to (6) formula is;
Average calculating operation amount μ:Although TOC can carry out false add and vector-matrix multiplication, operand here is only
Indicate that the operand of included binary three-valued logic operation is requested in each operation.Because other operations can pass through binary three-valued logic
Operation is to realize, and the client of user can only also submit binary three-valued logic operation in current task management system,
Non- binary three-valued logic operation cannot be submitted;
Network transfer speeds ω:Although network transfer speeds differ greatly in local area network and wide area network, the not only face TOC
To LAN subscriber, there are also many wan users.Therefore, we are imitative to model is carried out with data transmission bauds in wide area network
Very;
Data prediction speed τ:The function of data preprocessing module mainly will communicate interior code table according to different operations
The data conversion shown is indicated at control Internal Code, it is clear that it is related to the electronic computer speed of service, it can reach G magnitude;
The average transmission rate that task scheduling modules send data to TOC is j:TOC passes through cable and server phase
Even to complete communication therebetween.Therefore, i.e. the data transmission bauds of local area network;
TOC processing speed δ:The arithmetic speed of TOC is mainly limited to liquid crystal because of the limitation of fund at present, but considers it
Concurrency, arithmetic speed still can reach G magnitude.
To get how λ influences average response time T clear, model emulation is carried out with the number of tasks reached per hour.Operand μ
Unit with network transfer speeds ω is respectively MB and MB/s, then the service speed of operation request receiving module is 7200 ω/μ,
7200 ω/μ operation request can be handled per hour.
It enablesThat is, ρ is by ω,
Reckling in τ, j and δ determines.In general, ω is its reckling.Work as ρ<When 1, system can reach equilibrium state.Work as parameter μ
=100, ω=2, τ=2, j=50 and δ=1, and when system reaches balance, to different λ average response time T with the variation of λ
As shown in Figure 4.
As seen from Figure 4, when there is an operation request to reach per hour, system response time is about 38s, though with more
A M/M/1 queuing system carries out series connection modeling, but when number of tasks increases, the response time is not multiplied by number of tasks.Its
Reason is that while that each task will undergo each stage of model, but each module when existing simultaneously multiple tasks in system
Concurrent working.The T known to (7) formula is the increasing function of μ.200 are increased to from 50 when λ increases to 60, μ from 1, and other parameters are constant
When, Mean Time of Systemic Response T is as shown in Figure 5 with the variation of μ.It can be seen that system response time is with task arrival rate and operation
The increase of amount and increase.
When operand μ=50 or ω=4 and when constant other parameters, Mean Time of Systemic Response T is with λ's compared with Fig. 4
Variation is significantly altered, and Mean Time of Systemic Response T is not but bright when only changing other certain parameters such as δ, τ, j, C1 and C2
Aobvious variation, as Figure 6-9.In other words, operand μ and network transfer speeds ω becomes the bottleneck of the system.Its reason master
It is that while that T is the subtraction function of δ, τ and ω, is the increasing function of μ, but their magnitude is different:δ and τ is G magnitude, and μ and ω
It is M magnitude.Therefore, when δ, τ and ω increase identical multiple, ω can be such that T is substantially reduced, even and if the former two increases bigger times
Number can only but make T reduce very little amplitude;T can also be made to be substantially reduced when μ reduces identical multiple, as Figure 6-9.Separately by Fig. 9
Even if can be seen that δ, C1And C2It improves a lot, system response time there will not be significant change.
By being analyzed above it is found that the network latency for reducing data can reduce system response time i.e. raising system effect
Rate.Obviously, reducing the network latencies of data, there are three approach:Increase the operation request for receiving operation request and receives mould
Number of blocks improves network transfer speeds, reduces data volume.Obviously receiving operation request with multiple operation request receiving modules can be with
System response time is improved, it can be modeled with M/M/c, it will be discussed in detail afterwards.Increase substantially network
Transmission speed needs new technology, therefore it is relatively difficult under existing network environment to increase substantially network transfer speeds.At present
The operation that system provides is substantially binary three-valued logic operation, and each of operand is all transmitted with communication Internal Code, though
So transmitted data on network amount can be reduced to a certain extent, but will be according to conventional mathematical operator and operand input
Transmitted data amount is largely reduced, to improve the response time.Therefore, the research of task management system should be accelerated, used
Family uses TOC as using electronic computer.
The transmission rate that wide area network is improved it can be seen from Fig. 4 and Fig. 9 can substantially reduce system service average response time
T.Further to analyze the influence to T, we draw out from 1 be changed to 15 when T variation tendency, as shown in Figure 10.It can be seen that,
At that time, Mean Time of Systemic Response T with increase decline than very fast, can further reduce T although being then further added by,
Fall off rate is substantially reduced.
In Given task arrival rate, Mean Time of Systemic Response T with operand and wide area network transmission speed change
Change situation, as shown in figure 11.As can be seen that system response time subtracts with network transfer speeds as imagining we
The increase of small and operand and increase.
By above-mentioned simulation result, it can be seen that the model that this case provides is not only able to express the service process of TOC well,
And can reveal that each parameter influences the rule of system response time in system, to provide solution party to improve system effectiveness
Case.
Disclosed above is only several specific embodiments of the invention, but the present invention is not limited to this, any ability
What the technical staff in domain can think variation should all fall into protection scope of the present invention.