Summary of the invention
The object of the invention is to provide the business structure under a kind of environment of internet of things, and the combinations of services method based on ant group algorithm under this framework, under this framework the Qos property value of business and each parameter in the ant group algorithm are made mapping, so that the business that is combined into can be met customer need to greatest extent and be had higher service quality.
The technical solution adopted for the present invention to solve the technical problems is: the present invention at first has been divided into five layers with whole Internet of Things, is respectively equipment access layer, data communication layer, equipment control layer, SML and service application layer.
The equipment access layer: the equipment access layer is the bottom in the whole Internet of Things framework, mainly is towards various equipment.
The data communication layer: whole data communication layer comprises and take the Internet as the communication network of representative, and so that physical equipment can with middleware or the gateway of these transmitted data on network.
The equipment control layer: the major function of this layer is to manage the equipment that accesses in the Internet of Things by the data communication layer, comprising the facility registration module, and device management module and monitoring of tools module.
SML: the major function of this layer is the business that management is developed based on equipment in the access Internet of Things, comprises the service log-on module, service management module, combinations of services module, business monitoring module.
Service application layer: this layer is mainly in the face of all types of users, this layer can be the processing platform of certain enterprise, perhaps use the individual pc of Internet of Things, can use the miscellaneous service that exists in the Internet of Things or be used in combination each former subservice by various platforms.
Comprehensive above five layers division, when having equipment or business to be added in the Internet of Things, at first, equipment is connected into the equipment access layer in the Internet of Things, this moment, the equipment to new adding in the equipment control layer carried out information registering, the monitoring of tools module is sent detection information by the data communication layer to this equipment, and the information of returning according to equipment generates the state of this equipment and confirms that registration effectively in device management module.The facility information that provide this moment in SML can be according to the equipment control layer carries out business development, after business development is finished, can register business newly developed at SML, whether while business monitoring module can detect this business available, if detect successfully, confirm that then service log-on is effective, this business will offer the user and use.When the user uses professional in the Internet of Things, monitoring of tools module and business monitoring module can detect the required business of calling of user successively, if detect unsuccessfully, then recommend other alternative business of user, guarantee reliability and the success rate of the business used with this.
Along with the continuous growth of internet of things service, cause waste to resource for fear of the overlapping development of business, combinations of services becomes research emphasis gradually.
According to the above framework of carrying, when the user when carrying out combinations of services, at first according to demand combination is divided into fixing step, the corresponding set of service of each step, the user selects an optimal service to participate in combination from this set when selecting in each step, utilize in the present invention based on the dynamic composition method of ant group algorithm and select specific service in each set of service, refer to dynamically that in the method each step combination all is the Qos information that obtains to participate in real time composite service, and according to Qos information the parameter in the ant group algorithm is made mapping, because the variation of network environment, the Qos property value also is that dynamic change, so select also along with environmental change is changing according to the combination that ant group algorithm is made, the good like this variation that adapts to professional environment for use, except considering Qos, in this algorithm, also considered user's expectation, the user can provide one to the desired value of each attribute of composite services Qos before composite services, in the present invention, the difference of the actual property value of utilizing Qos and expectation property value is as the important parameter in the ant group algorithm, like this can amplitude peak satisfy user's expectation, and.
Beneficial effect:
The invention provides a kind of internet of things service framework and based on the service dynamic combined method of ant group algorithm, at first by the user to determining according to demand combination step, the corresponding collection of services of each combination step, the business in these collection of services can obtain corresponding Qos information in the business structure that proposes.When dynamic combined, the relevant information of the Qos attribute of business and each parameter in the ant group algorithm are made reasonable mapping.The composite service that generates by the method can be good at meeting consumers' demand, so that composite service has higher service quality and higher reliability, therefore, has certain use value and economic worth.
Embodiment
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, at first the internet of things service architecture environment is divided into five layers, is respectively: equipment access layer, data communication layer, equipment control layer, SML, service application layer.
The equipment access layer: first step is exactly oneself to be deployed in the Access Layer of Internet of Things so that so that oneself can be by the perception of whole internet of things institute, after the Access Layer of equipment access Internet of Things by the data communication layer to more high-rise responsible;
Data communication layer: because most of physical equipment does not possess directly and the condition of internet communication, the data that they obtain often will just can be transferred to network by certain conversion, therefore the gateway and the middleware that have also comprised responsible data transaction in the data communication layer, the main task of this layer are to connect physical equipment and the Internet;
The equipment control layer: the major function of this layer is to manage the equipment that accesses in the Internet of Things by the data communication layer, comprising the facility registration module, device management module and monitoring of tools module, in the equipment control layer, record the information that is linked into each equipment in the Internet of Things, positional information (location) comprising equipment, equipment obtains time delay (time_delay) access times (count) equipment dependabilities (reliability) of data, when combinations of services, these log-on messages are reference values of Qos value, the equipment control layer also has the monitoring function to Internet of things access equipment in addition, when certain service needed is called certain equipment, the equipment control layer can check at first whether this equipment is in the networking state, whether functions of the equipments are normal, generate thus equipment state: the professional invoked procedure of normal (yes) undesired (no) unknown (unknown) only can use the equipment that is in normal condition.The equipment control layer can upgrade and the call flow relevant parameter after whole invoked procedure is finished, and such as equipment access times, successful call number etc., this layer provides the Qos property value of individual equipment to SML.
SML: the major function of this layer is the business that management is developed based on equipment in the access Internet of Things.Comprise the service log-on module, service management module, combinations of services module, business monitoring module.Wherein service log-on module major function is that the business that joins Internet of Things is registered, to make things convenient for the user to existing professional searching and make up; The information of service management module essential record business.Under the environment of Internet of Things, finish same specific function, have different business for user selection, finish same function with different business and must have different effects, the service management module can record after each operation flow executes, and the professional overall delay (time_delay) of carrying out of the professional cost (price) of carrying out, professionally carries out the shared information such as bandwidth (Bandwidth) in order to carrying out institute's reference next time.The combinations of services module is the important module of SML, this module mainly is responsible for the combination between the former subservice, this module is at first obtained each former subservice that may be used for combination according to user's request from professional Registering modules, then obtains best combinations of services for the user according to the business information in the service management module.The business monitoring module, mainly be before using each former subservice, this former subservice to be checked, this inspection comprises the related news such as the facility information that obtains in the equipment control layer and determines whether this business is in upstate, this layer provides professional Qos property value to service application layer when the Dynamic Selection of business, professional when carrying out, SML is according to the each parameter of carrying out of the implementation status record traffic of business, comprise professional Executing Cost, the professional time delay of carrying out, needed bandwidth and for this professional reliability evaluation during professional the execution, the execution result of nearest n time of this business of record record in SML, when the user carried out for the n+1 time, its Qos property value was just drawn by front n execution result.
Service application layer: this layer is mainly in the face of all types of users, this layer can be the processing platform of certain enterprise, perhaps use the PC of Internet of Things, can use the miscellaneous service that exists in the Internet of Things or be used in combination each former subservice by various platforms.
According to the characteristics of this framework, respectively recording equipment and professional Qos in equipment control layer and SML, wherein in the equipment control layer mainly for the Qos of individual equipment, in the SML mainly for the Qos of single business and composite service.
The combined method of utilizing ant group algorithm to provide a kind of Qos of service based in the above under the framework that proposes is come the combination of service guidance.In above-mentioned framework, can obtain professional relevant Qos information, according to the particularity of environment of internet of things the attribute of service quality is set as Q(q1, q2, q3, q4) q1 is the cost that the use business is paid, q2 is professional response delay (ms), and q3 is the shared bandwidth of service execution (Hz), and q4 is professional reliability.
Can directly obtain for response delay involved in the business and occupied bandwidth, the cost of paying carrying out this service, such as cost of use, bandwidth consumed etc., under this framework, this function is defined by service developer.
Therefore in the property value of service quality, professional reliability need to be by certain calculating, the below provides the computational methods of reliability, professional reliability is an important attribute, in this framework for the calculating of reliability mainly based on 2: 1. users estimate 2. with the evaluation to this business of other business of this service interaction.If reliability function is f(a, s), wherein a is user's evaluating (assessment_personal), s is the evaluating (assessment_service) of other services to this service; Because the Qos attribute of a service business of the every execution of service will be changed, and the user estimates and the evaluation of other services belongs to objective evaluation, evaluation between the front and back should have consistency, so the result when reliability is carried out by front n time when carrying out this business the n+1 time draws.If the reliability of front n execution is respectively:
So reliability attributes for final the n time execution time institute's reference:
For the consistency of retention value has:
So considering the weight that the value of the reliability after time of implementation in the actual conditions more leans on obtains should have greatlyr:
φ
i<φ
i+1; (4)
Provide the weighting function that meets above condition at this, have when total degree n is even number when carrying out:
Have when total degree n is odd number when carrying out:
When drawing the computational methods of reliability, the q4 reliability value of Qos attribute can be tried to achieve, and therefore, can call this for the j time when professional, the service quality that this that obtains is professional this moment
Q wherein
iFour different property values of corresponding Qos, α (i) is the weight of each attribute among the Qos, and has for α (i):
Execute after the business at every turn, professional property value is upgraded according to Self-variation, because there is the randomness in the certain limit in professional execution under certain environment, reliability in order to ensure the service quality of the business that draws, when calculating Qos, the Qos when once carrying out before this business also includes limit of consideration in:
If the Qos property value when this time carried out is Q
jQos when carrying out this business last time is Q
J-1, then this is carried out and assert that this business Qos is:
In Services Composition, final purpose is to make the service quality of user's satisfaction and composite services the highest, namely finds can meet consumers' demand and meet most one group that Qos requires and make up the completing user operation in numerous services set.In this framework, use the Qos optimal combination method based on ant group algorithm.Its basic thought is: at first according to user's demand, by user oneself whole combination is divided into the n step, each has a set of service S corresponding with it in the step, selects a service s ∈ S and come the completing user operation from S set, therefore from S set
mTo S set
nMulitpath is just arranged, so just can select best of breed based on ant group algorithm.
In the present invention, the user is serving as the role of ant, when the starting stage in combinations of services, selecting to participate in the business that makes up in each set is at random, after a combinations of services is carried out, the user can this combination of Dynamic Acquisition from the above layer architecture of carrying Qos information, and the Qos according to selected business stays certain pheromones on this combinatorial path, user afterwards can come according to the probability that pheromones determines the Selection and Constitute path, after the composite service operation, user-selected combination just can trend towards optimum combination, thereby reach the result who wants, can also adapt to real-time environmental change according to the Dynamic Selection mechanism of ant colony algorithm for optimization design, environment for use changes, so that Qos changes, the combinatorial path of selection also can change according to these information.
When beginning to select service, so that the pheromones (τ on all service paths
IjThe pheromones of expression on from i to the j path) be all mutually a fixed value τ
0, namely the incipient stage of combination supposes that each Qos property value of participating in composite service equates, selecting a probability of participating in composite service this moment is at random.
When after many users have carried out the composite services of some, the pheromones on every selecting paths will change according to the Qos property value, and this moment is at services set S
nAnd S
mIn by the service s
i∈ S
nTo s
j∈ S
mFinish from m and go on foot the n combination in step, select from s according to ant group algorithm
iTo s
jTransition probability be:
Wherein S represents the set of all services that can select in this step combination, α is that the pheromones of the heuristic factor representation accumulation of information is for the importance of ant selecting paths, it is larger namely to work as α, then the pheromones left over of path is larger on the impact of ant selecting paths, its value gets 1 or 2 generally speaking, β is the expectation heuristic factor, the importance of expression visibility, reacted ant heuristic information influence degree to selecting when selecting paths, its value is larger, then more close to the greed rule, its value also gets 1 or 2, τ generally speaking
Ij(t) be illustrated in t constantly, the pheromones of path i to the j.Heuristic information represents to select own path according to heuristic information when ant at selecting paths the time, in Path selection of the present invention, when making selecting paths, selects the highest combination of Qos value, and heuristic information is by inspiration letter η
Ij(t) expression, at this so that heuristic function with the business the Qos value identical namely:
From following formula as can be known, heuristic function is defined as next Qos value of serving, obviously the value of Qos is higher, and then heuristic function is larger, the larger then p of the value of heuristic function
Ij(t) larger, namely can select the higher service of Qos value with greater probability, when Dynamic Selection, carrying out each time professional Qos property value all might be different, the result that n time is carried out recorded the Qos value in the above SML of carrying framework before is (q1, q2, q3, q4) property value, when when carrying out this business the n+1 time, four professional property values are obtained by front n execution result, namely carry out the then Qos property value q1 of this time business for the n+1 time, q2, q3 execute the rear result who obtains the n time, q4 gets according to the comprehensive front n time result of above reliability formula, obtained thus the Qos value when this time carried out, after the n+1 time executes, (the q1 when business is carried out in this time, q2, q3, q4) be recorded to SML, calculate the Qos property value when calling this business during for the n+2 time, delete simultaneously a record the earliest, the quantity of holding the record is constant.
Adopt following update rule for the pheromones on every paths:
Wherein γ ∈ (0,1) represents the pheromones volatility coefficient.The reason that adds this volatility coefficient is to satisfy the dynamic change of whole environment, and the pheromones that before carries under the environment can only be left (1-γ) doubly, and adds the unlimited accumulation that volatility coefficient can prevent pheromones.
Represent that k ant stay pheromones increment on the path in this circulation.Adopt the Ant-Cycle model namely for the pheromones increment:
Wherein Q is pheromones intensity, L
kIt is the path that k ant walks in this circulation.The Qos property value of the path of in the present invention ant being walked from i to j when serve from i services selection j connects, and makes Q=1 at this, according to the Qos attribute that defines before, with L
kBe defined as:
F wherein
iFunction for i property value in the Qos attribute of the professional j of the selected next one passes through f
iCan draw i the property value of Qos of the professional j of current selection, p
iBe the desired value of user for i property value of this business, the user can provide the desired value of part or all of attribute, when the user does not provide the property value of expectation, and p
iThen be under above framework, each attribute to be set one acquiescence desired value.By the definition of above pheromones increment function as can be known, when the less amount of information that then stays of absolute value of the difference of actual value and desired value is larger, select so the possibility of the little service of difference just larger.
So far, the main function of ant group algorithm and parameter are all given, are divided into following steps according to ant group algorithm user selection best service combined method in sum:
Step 1: parameter initialization.So that original execution time t and cycle-index N are 0, a maximum cycle N is set
Max, m ant is put in the initial service, making the pheromones initial value on each bar execution route is τ
Ij(t)=and constant, Δ τ
Ij(0)=0.In this step, the ant number is for being number of users, and the user serves as the role of ant in ant group algorithm, for the correctness of the best of breed business that guarantees to select, has carried out N m user for this composite service
MaxJust draw the selecting paths of final the best after the inferior selection.
Step 2:N ← N+1.Namely whenever do once circulation, so that circulation time N adds 1, once circulation herein refers to that all m user has finished the selection from set of service C1 to set of service Cn, and N then is that the such circulation of record has how many times, N
MaxIt then is the upper limit of N;
Step 3:k ← k+1.The k here refers to have how many users to carry out the composite service that is in m user in the single cycle in step 2, carry out the entire flow of this composite service that is over whenever a user, namely choose final set of service Cn then so that k increases by 1 from initial set of service C1, finish this moment until once circulate during k=m and make the N in the step 2 increase by 1, otherwise the user who makes k=k+1 not finish composite services continues to carry out composite services.
Step 4: unique user is according to the state transition probability formula in the above formula (9)
Result of calculation select should participate in combination by which service in the next services set.
Step 5: upgrade taboo list, the taboo list that herein arranges is for user m, in single cycle at set of service C
iIn no longer select to participate in combination business: the service that 1. will select adds taboo list, 2. will carry out failed service adding taboo list in the set of service.
Step 6: if k<m, the number of users of namely finishing composite services then jumps to step 3 less than initial value m and continues to carry out, if traversal is finished k=m then execution in step 7.
Step 7: according to τ in above formula (11) and (12)
Ij(t+n) computational methods are upgraded the amount of information on every traverse path.
Step 8: maximum is set then execution in step 9 if cycle-index has reached, namely as cycle-index N=N
MaxThe time execution in step 9, jump to step 2 and continue down to carry out otherwise empty taboo list.
Step 9: according to the pheromones of finally staying on the selecting paths, the probability formula (9) when selecting next business in per step provides
(t) maximum all can be arranged, select next business of participating in combination all according to the probability of maximum in per step
Select, then drawn the optimal selection path, EP (end of program).