Summary of the invention
Technical matters: the purpose of this invention is to provide a kind of mobile middleware of usage policy driving and the entire method flow process that development strategy drives mobile middleware, be used to solve problems such as current mobile middleware range of application is narrow, exploitation difficulty.The present invention can improve the application power of mobile middleware significantly, and reduces the cost of development that mobile middleware is used.
Technical scheme: the present invention is a kind of tactic method, can be applied to various existing mobile middleware platforms, also can develop brand-new mobile middleware platform according to the present invention.The present invention is by being incorporated into strategy in the exploitation of mobile middleware, its target is to come the mobile middleware of constructing function complexity by the simple tactful combination of function, the dynamic ability that changes mobile middleware reduces the development difficulty of mobile middleware and the security risk of existence.
Realize a kind of mobile middleware that strategy drives that relies on, it should have following feature: the whole life of mobile middleware is all driven by strategy, can realize on existing mobile middleware platform; Strategy its form in the whole life of mobile middleware constantly changes; Mobile middleware can be written into or the strategy of cutting various uses dynamically, changes size and the function of self.
Policy definition among the present invention is: constitute mobile middleware, and guide the method and the rule of mobile middleware whole life.Fig. 1 has provided the whole process of usage policy driving mobile middleware.In this process, the external display form of strategy changes, but its inherent essence is constant.The form of strategy mainly contains the variation of high level, middle layer, 3 levels of low layer, with the forming process tight association of mobile middleware.
Strategy can be decomposed into semantically and describe the policy condition of carrying out background and describe the strategy action of carrying out action, for example tactful " just moving to next main frame " if finished task, can be decomposed into that policy condition " has been finished task " and strategy action " moving to next main frame ", when satisfying policy condition with regard to the implementation strategy action.Like this, a simple strategy can be decomposed into one or more policy conditions and strategy action, interrelatedly form a strategy by them, many simple strategy can be combined into a sophisticated strategies.We all are called tactful particle with least unit policy condition and the strategy action that strategy decomposes, and it comprises conditional policies particle (policy condition) and the tactful particle of action (strategy action).
Usage policy drives mobile middleware, it promptly is the action method that instructs mobile middleware with strategy, the strategy that uses not only comprises and is used to instruct mobile middleware to finish the strategy of mobile middleware basic function, also comprises the strategy that instructs mobile middleware to finish particular task.We at first are divided into strategy following several:
Function policy: refer to be used to realize the strategy of specific tasks, as finish Network Management Function strategy, finish the strategy of electronic transaction etc., these strategies have determined the major function and the ability of mobile middleware.
Migration strategy: refer to the strategy relevant, comprise the basic migration strategy appointment purpose of the mobile middleware (migration), senior migration strategy (as routing strategy) etc. with the migratory behaviour of mobile middleware.
Security strategy: refer to the strategy relevant, be used for protecting mobile middleware to resist the security threat that may exist, comprise access control policy, authentication policy, encryption policy, trusted node selection strategy or the like with mobile middleware safety.
Method flow:
The step that the mobile middleware development approach of policy-driven is comprised:
Step 1). carry out demand analysis, the result is expressed as the high-rise strategy of " if satisfy ... condition, carrying out ... action " form;
Step 2). the high-rise strategy that obtains in the step 1 is decomposed and conclude, generate the tactful particle of high-rise expression, comprise policy condition and strategy action;
Step 3). depend on step 2) resulting result, the tactful particle of high level is translated into the more tiny middle layer strategy particle of granularity, the expression of middle layer strategy meets certain criteria;
Step 4). the middle layer strategy particle that step 3) is produced stores in the tactful warehouse, and tactful particle is made up, when forming complete strategy with the association store between the tactful particle in tactful warehouse;
Step 5). if have certain mobile middleware platform corresponding mobile middleware skeleton code and mobile middleware life cycle steering logic, directly change step 7) over to, otherwise continue execution in step 6);
Step 6). select one or more mobile middleware platforms, develop mobile middleware skeleton code and mobile middleware life cycle steering logic under this platform, this step can begin simultaneously with step 1), and is independent of other step;
Step 7). according to the mobile middleware platform that the mobile middleware skeleton code uses, the middle layer strategy particle of step 4) generation is translated into the tactful code of low layer;
Step 8). integrated mobile middleware skeleton code and low layer strategy code, test, if pass through, description of step 7) finish correct continuation step 9), translate again otherwise change step 7);
If step 9). disposed mobile middleware life cycle steering logic, tactful warehouse and mobile middleware platform in the network, then changeed step 11), otherwise continued execution in step 10);
Step 10). in network, dispose mobile middleware life cycle steering logic, tactful warehouse and mobile middleware platform;
Step 11). assign high-rise strategy to mobile middleware;
Step 12). start mobile middleware by mobile middleware life cycle steering logic;
Step 13). corresponding middle layer strategy or low layer strategy, tactful index are obtained in mobile middleware initialization, the high-rise strategy of assigning according to step 11), are saved in the policy information base of data field;
Step 14). mobile middleware is carried out migration strategy, moves in network, arrives the next network node of having disposed the mobile middleware platform;
Step 15). mobile middleware is carried out the basic strategies code;
Step 16) if. the executable code of finding required strategy is not present in the policy information base of self, then obtains corresponding strategy by the tactful warehouse of external policy accessor from network;
Step 17). continue the implementation strategy code, order is to carry out security strategy earlier, through safety certification afterwards carries out function policy again to finish the task that high level is given;
Step 18) if. carry out in the process of function policy or security strategy, find that external environment condition satisfies the policy condition of migration strategy definition, then change step 14) and carry out;
Step 19). after every function policy is finished, check whether this function policy does not re-use, do not abandon this strategy to reduce self size if do not re-use;
Step 20) if. mobile middleware is carried out certain function policy and is destroyed self, and then the mobile middleware whole life finishes;
Step 21). mobile middleware changes step 14) and carries out after current main frame executes all predetermined function strategies, perhaps returns source address.
The performance history of policy-driven mobile middleware is specific as follows:
Step 1: the high-rise strategy of formulating descriptive language.The demand of at first will finishing the work as required, the task description that mobile middleware need be finished comes out, and uses the understandable custom language of people to explain, select to be similar to " when .../afterwards, and just ... " such grammatical form.Demand for example: " when the CPU usage of access node surpasses 80%, just carrying out self migration ", " after acquisition strategy information, just the information of acquisition being encrypted ".Then high-rise strategy is segmented and concludes, the identical or similar policy condition of implication/strategy action is reduced a condition strategy particle/tactful particle of taking action, so just obtains granularity tactful particle bigger, that high-rise form is represented.The groundwork substantial equivalence in this step is in demand analysis and overall design, but its result is expressed as common icon or literal, but is expressed as the form of understandable high-rise strategy.
Step 2: high-rise strategy is translated into the middle layer strategy.Demand analysis personnel's custom is depended in the expression of high-rise strategy, and the details of programming language is depended in the expression of low layer strategy, and they in fact all are being difficult to produce unified standard.And the middle layer strategy is the expression that is independent of high-rise description and the realization of low layer coding, use strategy Development concrete mobile middleware in middle layer to meet the development requires of middleware, can shield the different mobile middleware Platform Implementation details of low layer downwards, and upwards shield different high-rise development approaches.The middle layer strategy uses certain criteria to represent, at present industry can with standard have: IETF (Internet Engineering Task Force, internet engineering duty group) the tactful core information model and the expansion thereof of Zhi Dinging, DMTF (DistributedManagement Task Force, distributed management task ANSI) CIM (Common InformationModel, common information model) tactful information model in, the PONDER language of London university of kingdom etc.The feature of middle layer strategy is to be the tactful particle that function is concrete more, the more tiny middle layer of granularity is represented with the tactful particle breakdown of high level, by the interrelated strategy that forms a specific meanings of a plurality of tactful particles.The strategy particle can be many strategies total (reusable), also can be certain bar strategy distinctive (not reusable).
We come the storage policy particle in the usage policy warehouse, and the correlating method between the tactful particle is also stored in the tactful warehouse, thus with policy store in tactful warehouse.The strategy warehouse can use relational database or catalogue etc., the former is stored in strategy (tactful particle and related information) in the relation table, the latter is stored in tactful particle in the leaf node clauses and subclauses, in higher level's clauses and subclauses of tactful particle, related information is stored in clauses and subclauses or is converted into the superior and the subordinate's relation of inclusion.The strategy warehouse also can be used to store the out of Memory relevant with mobile middleware simultaneously.
Step 3: the middle layer strategy is translated as the low layer strategy.The low layer strategy is that mobile middleware generally can directly be carried out the low layer strategy on main frame towards particular device, based on the strategy of language-specific.The middle layer strategy is taked the mode of type translation one to one to the translation of low layer strategy, the corresponding code that is stored in the tactful warehouse of every type tactful particle, composition in when translation according to the tactful particle of middle layer strategy, directly from the warehouse, take out low layer strategy code snippet, be combined into a complete low layer strategy.The code that takes the form of high level language of low layer strategy, it is corresponding one by one with the tactful particle on upper strata.Code depends on the realization details of mobile middleware platform usually, can map out the multiple low layer strategy that depends on different mobile middleware platforms by the middle layer strategy.
Step 4: strategy is dissolved into the complete mobile middleware of formation in the mobile middleware framework.At first be incorporating of function policy, according to the present situation of present industry, function policy is fused to two kinds of methods in the mobile middleware framework.One joins low layer strategy code in the mobile middleware skeleton code, and soon both are integrated and form the specific mobile middleware of function, and this method is applicable on existing mobile middleware platform and develops.They are two years old, all low layer strategies are not directly joined in the mobile middleware skeleton code, in order to guarantee the execution efficient of mobile middleware, only low layer strategy code commonly used is joined in the skeleton code, and other strategy is set up the function policy index, indicate these tactful positions and access method etc.; Mobile middleware carries function policy index and function policy code, perhaps only carries the function policy index, but the executable tactful code of remote access when needed.Second method realizes that function policy can increase and decrease dynamically flexibly, and the function of mobile middleware just can strengthen or reduce dynamically.But existing mobile middleware Platform Implementation more complicated, best selection are to develop the novel mobile middleware platform of supporting this method.
Migration strategy and security strategy are used the method for setting up common tactful index, and mobile middleware will and be written into required strategy according to the selection of current state and common tactful indexes dynamic in execution environment.
Step 5: in network, dispose the infrastructure of using based on the mobile middleware of policy-driven.As shown in Figure 2, typical such is used and is needed following several parts usually:
(1) mobile middleware life cycle steering logic: be responsible for initiating and controlling the life cycle of the mobile middleware in the whole application, selection strategy generates/drives mobile middleware.The mobile middleware of policy-driven is to use main function carrier, moves between each network node, finishes specific task after arriving destination node under the support of mobile middleware platform.
(2) tactful warehouse: store policy information and mobile middleware relevant information provide functions such as strategy retrieval to using primary control program and mobile middleware.
(3) mobile middleware platform: but be deployed on the various network nodes with executive capability, provide basic service facility to mobile middleware, comprise the execution environment, migration support, safeguard protection support of mobile middleware etc.
Just can bring into use the mobile middleware executive software of policy-driven to use after having disposed infrastructure.Architecture:
Fig. 3 has provided the architecture of the mobile middleware of typical usage policy driving method exploitation, has the characteristic feature of the mobile middleware of policy-driven.Compare with traditional mobile middleware architecture, this architecture has: policy mappings logic, strategy execution logic, policy information base and four modules of external policy accessor, these four modules are controlled by the unification of mobile middleware main control module.
Provide specifying of these several modules below:
Policy mappings logic: according to tactful index that is stored in mobile middleware private data district and tactful acquisition strategy, or come acquisition strategy from self policy information base or external policy accessor, and, the policy mappings that obtains is become executable low layer strategy according to the needs of strategy execution logic.
Strategy execution logic:, under the support of mobile middleware platform, carry out to the strategy that tactful mapping logic passes over.The ability of strategy execution logic depends on the service facility that the mobile middleware platform provides, and this module has the function to other module shielding mobile middleware platform of mobile middleware.
Policy information base: certain structure of policy information base (for example tree structure) tissue and storage policy particle, it small, main storage policy information commonly used.Policy mappings logic and external policy accessor be the access strategy information bank directly, and the content in the update strategy information bank dynamically.
The external policy accessor: mobile middleware is by the tactful warehouse of external policy accessor on can the retrieval network node, and these tactful warehouses provide directory service or database access service usually.The external policy accessor provides strategy function such as to retrieve, download, upload.The external policy accessor is called by the policy mappings logic usually.
Beneficial effect: the inventive method has proposed the development of novel method of policy-driven mobile middleware, and the novel strategy of using this method to develop drives the architecture of mobile middleware.The present invention uses simple tactful particle to be combined to form complicated mobile middleware, has the following remarkable advantage, all is that present other mobile middleware and development approach thereof are not available:
(1) segmentation of realization function and reduction development difficulty: usage policy method of driving, with the mobile middleware Function Decomposition of complexity is simple tactful particle, the segmentation of function has increased the rationality that task is carried out and assigned, reduce the integrated development difficulty of traditional mobile middleware task, improved the efficient of exploitation.Simultaneously, the tactful particle that develops can be multiplexed to the mobile middleware of various functions very easily, has promoted the reusability of code greatly.
(2) abstractness of raising application and development: strategy has the high abstract ability, and can keep the consistance on the function from high-rise strategy to the low layer strategy.On the one hand, when generating actual mobile middleware application, can directly come customized application by management, the high-rise strategy of appointment, shield complicated low layer identification code and realized, need not programmer's interference at high level; On the other hand, can become the corresponding low layer strategy of different platform code, reduce the workload of multi-platform mobile middleware application and development by middle layer policy mappings with standard.
(3) dynamically form and the function that changes mobile middleware: can generate the mobile middleware of different abilities by the various combination of function policy dynamically, go to finish various tasks.Mobile middleware can also increase or delete the function of self dynamically by update strategy, strengthens the adaptive faculty of mobile middleware to network environment and mission requirements greatly.
(4) improve the security of mobile middleware: by the security strategy and the migration strategy of dynamic renewal mobile middleware, can be in time and effectively protect mobile middleware to resist various security threats in the network environment.Mobile middleware can not need obviously to increase self size, only obtains security strategy from the external policy warehouse as required and deals with different situations.
(5) provide mobile middleware interaction capabilities each other: lack information interaction language simple, standard between the present various mobile middlewares, can be with the middle layer strategy of standard language as information interaction between the mobile middleware.For the mobile middleware of certain platform, only the middle layer strategy that obtains need be translated into own corresponding low layer strategy, just can exchange with the mobile middleware of other platform.
Embodiment
For convenience of description, we have following application example at supposition: develop the network management-application based on mobile middleware, the primary demand of using is to create mobile middleware in Network Management Station, and send in the network each by management node it, and by the local network management task of carrying out of management node main frame.
Specific embodiments is:
(1) developer creates the preliminary high-rise strategy (overall design) of realizing Network Management Function according to demand;
(2) developer concludes high-rise strategy and decomposes concrete, the tiny tactful particle of systematic function, represents (detailed design) with the tactful form of high level;
(3) developer generates tactful particle translation of high level and decomposition the tactful particle of the middle layer form that granularity is more tiny, function is more concrete, it meets the CIM related specifications of IETF, and strategy particle in middle layer stored among the tactful warehouse catalogue D (code name), store the related information that each tactful particle is combined to form strategy simultaneously;
(4) developer selects mobile middleware platform such as Grasshopper platform, exploitation can be dynamically embedded into the mobile middleware skeleton code and the mobile middleware life cycle steering logic independently of strategy, and this step can be carried out simultaneously with embodiment (1) (2) (3);
(5) network management personnel as required, at network node main frame deploy Network Management Station, tactful warehouse and mobile middleware platform;
(6) network management personnel is assigned to mobile middleware A (code name, this moment, A was not truly created) some concrete network management strategys (function policy, migration strategy and security strategy) according to corresponding network management requirement from high level;
(7) Network Management Station application call mobile middleware life cycle steering logic is created mobile middleware A, and this moment, A began whole life;
(8) mobile middleware A initialization according to Policy List visit catalogue D, obtains necessary policy store in the policy information base of self, mainly comprises function policy and security strategy, migration strategy commonly used;
(9) A begins to carry out the intended function strategy, begins migration under the support of mobile middleware platform;
(10) A arrives destination management host I (code name), and begins to carry out network management task under the support of local mobile middleware platform;
(11) A carries out basic security strategy, finds that main frame I is the trusted node, and promptly main frame I is through safety certification:
(12) A carries out function policy, use the SNMP agency on SNMP (Simple Network Management Protocol, Simple Network Management Protocol) the protocol access main frame I, obtain the flow information of the main frame I place network segment, carry out the sample statistics computing, the result is saved in the private data district;
(13) A discovery feature strategy " after main frame I is by authentication, is collected the sample statistics information of main frame I place network segment flow " no longer needs, and unloads this policy-related (noun) code dynamically to reduce self size;
(14) A finds that by the environmental monitoring interface of self CPU usage of main frame I has arrived 85%, carry out migration strategy and " when the CPU usage of main frame surpasses 80%, move to other node immediately ", determine next destination node according to routing policy, begin migration;
(15) A arrives intermediate node main frame II (code name), begins to carry out under the support of local mobile middleware platform;
(16) A carries out basic security strategy, finds that main frame II trusted rank is lower, after by all basic security strategy authentications, also needs the authentication by certain advanced security strategy;
(17) A asks this high-level policy by the external policy accessor of oneself to catalogue D, and LDAP safe in utilization (Lightweight Directory Access Protocol, Light Directory Access Protocol) agreement obtains this high-level policy;
(18) A carries out this high-level policy success, and main frame II through safety certification;
(19) main frame II visits Network Management Station information and the access node information that A carries by access interface to mobile middleware A request, and A traversal policy information base can not find corresponding processing policy;
(20) A uses ldap protocol visit catalogue D by the external policy accessor of oneself, and retrieval is sent the processing of request strategy to main frame II;
(21) A obtains the function corresponding strategy from catalogue D, increases function policy dynamically and changes the ability of self;
(22) A replys the request of main frame II, allows main frame II to obtain the information of Network Management Station, refuses main frame II simultaneously and obtains access node information;
(23) A execution migration strategy carries out routing, to next destination node migration, continues to carry out network management task;
(24) A executes all predetermined network management task, the function policy that dynamic tailor does not re-use, and increase the data that security strategy is executed the task and obtained with protection;
(25) Network Management Station is got back in the final migration of A, and the mobile middleware life cycle control program data that A is entrained are given network management-application and handled, and destroys self if mobile middleware is carried out certain function policy, finishes the whole life of A.