Summary of the invention
Present invention aim at providing calculating based on ant colony under the business structure under a kind of environment of internet of things, and this framework
The combinations of services method of method, makes mapping by the Qos property value of business with each parameter in ant group algorithm under this framework so that group
The business closed out can be met customer need to greatest extent and have higher service quality.
The technical solution adopted for the present invention to solve the technical problems is: first whole Internet of Things be divide into five by the present invention
Layer, is equipment Access Layer, data communication layer, equipment control layer, SML and service application layer respectively.
Equipment Access Layer: equipment Access Layer is the bottom in whole Internet of Things framework, mainly towards various
Equipment.
Data communication layer: whole data communication layer includes the communication network with the Internet as representative, and physics is set
Standby can be with the middleware of these transmitted data on network or gateway.
Equipment control layer: the major function of this layer is to manage, by data communication layer, the equipment accessed in Internet of Things, its
Include facility registration module, device management module and monitoring of tools module.
SML: the major function of this layer is to manage based on accessing the business that in Internet of Things, equipment is developed, including
Service log-on module, operational control module, combinations of services module, business monitoring module.
Service application layer: this layer main, and this layer can be the processing platform of certain enterprise in the face of all types of users, or
Use the individual pc of Internet of Things, miscellaneous service or combination present in Internet of Things can be used to make by various platforms
By each atom business.
Comprehensive above five layers division, when having equipment or business is added in Internet of Things, first, equipment is connected into Internet of Things
Equipment Access Layer in net, now carries out information registering in equipment control layer to the equipment being newly added, and monitoring of tools module is led to
Cross data communication layer and send detection information to this equipment, in device management module, generate this equipment according to the information that equipment returns
State and confirm registration effectively.Now can carry out according to the facility information provided in equipment control layer at SML
Business development, after business development completes, can register business newly developed at SML, business monitoring mould simultaneously
Block can detect whether this business can be used, if detecting successfully, then confirms that service log-on is effective, and this business will provide for making to user
With.When business during user uses Internet of Things, monitoring of tools module and business monitoring module can detect required for user successively
The business called, if detecting unsuccessfully, then recommends other alternative business of user, with this guarantee use business can
By property and success rate.
Along with the continuous growth of internet of things service, in order to avoid the overlapping development of business causes the waste to resource, business
Combination is increasingly becoming research emphasis.
According to framework mentioned above, when user is when carrying out combinations of services, the most according to demand combination is divided into fixing
Step, the corresponding set of service of each step, user selects optimal clothes from this set when each step selects
Business participates in combination, utilizes dynamic composition method based on ant group algorithm to select the tool in each set of service in the present invention
Body services, and the most dynamically refers to that the combination of each step is all the Qos information obtaining in real time and participating in composite service, and according to
Parameter in ant group algorithm is made mapping by Qos information, and due to the change of network environment, Qos property value is also dynamically to vary
, so the combination selection made according to ant group algorithm is also as environmental change and varies, so well adapt to
Business uses the change of environment, in addition to considering Qos, also contemplates user's expectation in the algorithm, and user is before composite services
The expected value of an attribute each to composite services Qos can be given, in the present invention, utilize actual property value and the expectation of Qos
The difference of property value, as the important parameter in ant group algorithm, so can be expected with the user that meets of amplitude peak, and.
Beneficial effect:
The invention provides a kind of internet of things service framework and service dynamic combined method based on ant group algorithm, first by
User to determining combination step according to demand, the corresponding collection of services of each combination step, the business in these collection of services
Corresponding Qos information can be obtained in the business structure proposed.When dynamic combined, by the phase of the Qos attribute of business
Pass information and each parameter in ant group algorithm make rationally mapping.The composite service generated by the method can be good at meeting
User's request so that composite service has higher service quality and higher reliability, therefore, has certain use value
And economic worth.
Detailed description of the invention
Below in conjunction with Figure of description, the invention is described in further detail.
The present invention proposes a kind of internet of things service framework and combinations of services method, first by internet of things service architecture environment
It is divided into five layers, is respectively as follows: equipment Access Layer, data communication layer, equipment control layer, SML, service application layer.
Equipment Access Layer: first step is exactly that oneself is deployed in the Access Layer of Internet of Things, in order to make oneself permissible
By the perception of whole internet of things institute, it is responsible for higher by data communication layer after the Access Layer of equipment access Internet of Things;
Data communication layer: owing to major part physical equipment does not possess directly and the condition of internet communication, they are obtained
Data often just can be transferred to network by certain conversion, in data communication layer, therefore also include responsible data turn
The gateway changed and middleware, the main task of this layer is to connect physical equipment and the Internet;
Equipment control layer: the major function of this layer is to manage, by data communication layer, the equipment accessed in Internet of Things, its
Include facility registration module, device management module and monitoring of tools module, record in equipment control layer and have already accessed to
The information of each equipment in Internet of Things, including the positional information (location) of equipment, equipment obtains the time delay of data
(time_delay) access times (count) equipment dependability (reliability), when combinations of services, these log-on messages
Being the reference value of Qos value, additionally equipment control layer also has the control function to Internet of things access equipment, when certain service needed
The when of calling certain equipment, equipment control layer can first check for whether this equipment is in networking state, and whether functions of the equipments
Normally, equipment state is thus generated: the invoked procedure of normal (yes) abnormal (no) unknown (unknown) business only can use
It is in the equipment of normal condition.After whole invoked procedure completes, equipment control layer can update and call flow relevant parameter,
Such as equipment access times, success call number etc., this layer provides the Qos property value of individual equipment to SML.
SML: the major function of this layer is to manage based on accessing the business that in Internet of Things, equipment is developed.Including
Service log-on module, operational control module, combinations of services module, business monitoring module.Wherein service log-on module major function
It is that the business joining Internet of Things is registered, to facilitate user to the lookup of existing business and combination;Operational control module
The information of essential record business.In the environment of Internet of Things, complete same specific function, have different business for user
Selecting, use different business to complete same function and necessarily have different effects, operational control module can record each industry
After business flow performing is complete, overall delay (time_delay), business that cost (price) business that business performs performs perform institute
The information such as the bandwidth (Bandwidth) taken are in case performing next time referenced.Combinations of services module is the important of SML
Module, this module is mainly responsible for the combination between atom business, and first this module obtains from business Registering modules according to user's request
Take each atom business being possibly used for combination, then obtain optimal combinations of services according to the business information in operational control module
For user.Business monitoring module, mainly checks this atom business, this inspection before using each atom business
The related news such as including the facility information obtained in equipment control layer and determine whether this business is in upstate, this layer is in industry
The Qos property value providing business when dynamically selecting to service application layer of business, upon execution, SML is according to business for business
The parameter that every time performs of implementation status record traffic, including business Executing Cost, business performs time delay, and business is required when performing
The bandwidth wanted and the reliability evaluation for this business, record nearest n time of this business in SML performs knot
Really, when user performs for (n+1)th time, its Qos property value is just performed result by first n time and draws.
Service application layer: this layer main, and this layer can be the processing platform of certain enterprise in the face of all types of users, or
Use the PC of Internet of Things, miscellaneous service or combination present in Internet of Things can be used by various platforms
Use each atom business.
According to the feature of this framework, recording equipment and the Qos of business in equipment control layer and SML respectively, its
Mainly for the Qos of individual equipment in middle equipment control layer, mainly for single business and composite service in SML
Qos。
The combined method utilizing ant group algorithm to give a kind of Qos based on business under framework suggested above refers to
Lead the combination of business.Can obtain the relevant Qos information of business in above-mentioned framework, the particularity according to environment of internet of things will clothes
The attribute setup of business quality is the cost that Q (q1, q2, q3, q4) q1 is paid by use business, and q2 is the response delay of business
(ms), q3 is the bandwidth (Hz) shared by service execution, and q4 is the reliability of business.
Can directly obtain for response delay involved in business and occupied bandwidth, be paid performing this service
Cost, such as cost of use, consume bandwidth etc., under this framework, this function is defined by service developer.
Therefore, in the property value of service quality, the reliability of business needs to be calculated by certain, is given below
The computational methods of reliability, the reliability of business is an important attribute, in the architecture for the calculating of reliability
Be based primarily upon 2: 1. users evaluate 2. with the evaluation to this business of other business of this service interaction.If reliability function is f
(a, s), wherein a be user's evaluating (assessment_personal), s be other evaluatings to this service of service
(assessment_service);Due to service often perform a service business Qos attribute will change, and user evaluate and
Other service evaluations belong to objective evaluation, front and back between evaluation should have concordance, so (n+1)th time performs this business
Time reliability by front n time perform time result draw.If the reliability that first n time performs is respectively as follows:
(f1(a,s),f2(a,s),f3(a,s).............fn(a,s)) (1)
So reliability attributes referenced when final n-th is performed:
In order to the concordance of retention value has:
Consider that the weight that in practical situation, the value of execution time reliability the most rearward is obtained should be the biggest so having:
φi< φi+1; (4)
The weighting function meeting conditions above is given, when performing have when total degree n is even number at this:
When performing have when total degree n is odd number:
When drawing the computational methods of reliability, the q4 reliability value of Qos attribute can be tried to achieve, therefore, and now can be
Jth time call this business time, the service quality of this business obtained
Wherein qiCorresponding tetra-different property values of Qos, α (i) is the weight of each attribute in Qos, and has for α (i):After having performed a business, the property value of business is updated according to Self-variation, due to business every time
Perform under certain environment, there is a range of randomness, in order to ensure the reliability of the service quality of the business drawn,
When calculating Qos, Qos when once performing before this business is also accounted for scope:
If Qos property value when this time performs is QjQos when performing this business last time is Qj-1, then this performs identification
This business Qos is:
λQj+(1-λ)Qj-1; (8)
In Services Composition, final purpose is to make the service quality of the satisfaction of user and composite services the highest, i.e. crowd
Many services are focused to find out meeting user's request and best suit one group that Qos requires and combined user operation.At this
Framework uses Qos optimal combination method based on ant group algorithm.Its basic thought is: first according to the demand of user, by
Whole combination is divided into n to walk by user oneself, has set of service S the most corresponding in each step, selects one from set S
Service s ∈ S completes user operation, therefore from set SmTo set SnJust there is mulitpath, then just can be based on ant group algorithm
Select best of breed.
In the present invention, user act as the role of Formica fusca, when the starting stage in combinations of services, selects in each set
It is random for selecting and participating in the business combined, and after a combinations of services performs, user can be from layer architecture mentioned above
Dynamically obtain the Qos information of this combination, and leave certain information according to the Qos of selected business on this combinatorial path
Element, user afterwards can be according to the probability that pheromone is determined to select combinatorial path, after composite service runs, selected by user
Select combination will trend towards optimum combination, thus reach the result wanted, dynamically select machine according to ant colony algorithm for optimization design
System can also adapt to real-time environmental change, uses environment to change so that Qos changes, and the combinatorial path of selection is also
Can change according to these information.
When starting to select service so that the pheromone (τ on all service pathsijRepresent the information from i to j path
Element) it is all fixed value τ mutually0, it is equal that incipient stage of i.e. combining assumes that each participates in the Qos property value of composite service, this
Time select one participate in composite service probability be random.
After performing a number of composite services many users, every pheromone selected on path will depend on
Change according to Qos property value, now in services set SnAnd SmIn by service si∈SnTo sj∈SmComplete to walk n-th from m
The combination of step, selects from s according to ant group algorithmiTo sjTransition probability be:
Wherein S represents the set of all services that can select in this step combines, and α is that information heuristic greedy method represents long-pending
Tired pheromone selects the importance in path for Formica fusca, and i.e. the biggest as α, then the pheromone that path is left over selects path to Formica fusca
Impact the biggest, its value generally takes 1 or 2, β for expectation heuristic factor, represent visibility importance, reacted Formica fusca
The heuristic information influence degree to selecting when selecting path, its value is the biggest, then be closer to greed rule, its value ordinary circumstance
Under also take 1 or 2, τijT () represents the pheromone in t, path i to j.Heuristic information represents when Formica fusca is selecting path
Time select oneself path according to heuristic information, in the Path selection of the present invention, during in order to make selection path, select Qos
Being worth the highest combination, heuristic information is by heuristic function ηijT () represents, make heuristic function identical i.e. with the Qos value of business at this:
ηij(t)=λ Qj+(1-λ)Qj-1 (10)
Knowable to above formula, heuristic function is defined as the Qos value of next service, it is clear that the value of Qos is the highest, then inspire letter
Number is the biggest, the biggest then p of value of heuristic functionijT () is the biggest, i.e. can select, with greater probability, the service that Qos value is higher, dynamically
During selection, the Qos property value performing business each time is likely to difference, record in the SML of framework mentioned above
The result that before Qos value, n time performs is the property value of (q1, q2, q3, q4), when when performing this business (n+1)th time, business
Four property values are performed result by first n time and obtain, and the Qos property value q1 that i.e. (n+1)th time performs then this business, q2, q3 are i.e.
N-th performed after the result that obtained, q4 be then according to above reliability formula comprehensively before the result of n time get, thus obtain
Obtain Qos value when this time performs, after (n+1)th time has performed, this time is performed (q1, q2, q3, q4) record during business
To SML, calculate Qos property value when calling this business during for the n-th+2 times, delete a record the earliest simultaneously, keep
The quantity of record is constant.
For the more new regulation that the pheromone employing on every paths is following:
τij(t+n)=(1-γ). τij(t)+Δτij(t) (11)
Wherein γ ∈ (0,1) represents pheromone volatility coefficient.The reason adding this volatility coefficient is intended to meet whole environment
Dynamic change, the pheromone before carried under environment can the most remaining (1-γ) times, and add volatility coefficient can in case
The only unlimited accumulation of pheromone.Represent that kth Formica fusca stays the pheromone increment on path in this circulates.For letter
Breath element increment uses Ant-Cycle model i.e.:
Wherein Q is pheromone intensity, LkThe path walked in this circulates for kth Formica fusca.In the present invention will
The path that Formica fusca is walked from i to j connects with the Qos property value when i services selection j services, makes Q=1 at this, according to it
The Qos attribute of front definition, by LkIt is defined as:
Then:
Wherein fiFor the function of the ith attribute value in the Qos attribute of selected next business j, pass through fiCan draw
The ith attribute value of the Qos of current business j selected, piFor user for the expected value of this business ith attribute value, user
The expected value of part or all of attribute can be given, when user does not provides desired property value, piIt is then under above framework
Acquiescence expected value to each attribute setup one.From the definition of information above element increment function, when actual value and expectation
The absolute value of the difference of value is the least, and the quantity of information stayed is the biggest, then the probability selecting the service that difference is little is the biggest.
So far, primary function and the parameter of ant group algorithm have given, and select according to ant group algorithm user in sum
Best service combined method is divided into following steps:
Step 1: parameter initialization.Making original execution time t and cycle-index N is 0, arranges a largest loop time
Number Nmax, m Formica fusca is put in initial service, making the pheromone initial value on each execution route is τij(t)=constant,
Δτij(0)=0.In this step, Formica fusca number is for being number of users, and user serves as the role of Formica fusca in ant group algorithm,
In order to ensure the correctness of the best of breed business selected, carry out N m user for this composite servicemaxAfter secondary selection
Just draw final optimal selection path.
Step 2:N ← N+1.The most often do and once circulate so that circulation time N adds 1, and once circulation herein refers to, all of m
Individual user completes the selection from set of service C1 to set of service Cn, and N is then to record such circulation to have how many times, Nmax
It it is then the upper limit of N;
Step 3:k ← k+1.Here k refers to have how many user to perform in single cycle in step 2 in m user
Be over composite service, whenever user performs to be over the entire flow of this composite service, i.e. from initial set of service C1 choosing
K is then made to increase by 1 to final set of service Cn, until loop ends now makes the N increase by 1 in step 2 during k=m, no
The user then making k=k+1 be not fully complete composite services continues executing with composite services.
Step 4: unique user is according to the state transition probability formula in above formula (9)Result of calculation select
Should be participated in by which service in next services set is combined.
Step 5: updating taboo list, the taboo list herein arranged is for user m, in set of service C1 in single cycle
In set of service Cn, reselection does not participates in the business of combination: the service that 1. will have been chosen by adds taboo list, 2. by services set
The service performing failure in conjunction adds taboo list.
Step 6: if k < m, i.e. complete the number of users of composite services and then jump to step 3 less than initial value m and continue to hold
OK, if having traveled through k=m, step 7 is performed.
Step 7: according to τ in above formula (11) and (12)ij(t+n) computational methods update the information in every traverse path
Amount.
Step 8: if cycle-index has reached to arrange maximum, perform step 9, i.e. when cycle-index N=NmaxTime hold
Row step 9, otherwise empties taboo list and jumps to step 2 and continue down to perform.
Step 9: according to ultimately residing in the pheromone selected on path, public often walking probability when selecting next business
Formula (9) is givenWill there is a maximum, select the next one to participate in the business of combination all according to maximum general often walking
RateSelect, then drawn optimum selection path, EP (end of program).