Disclosure of Invention
Aiming at the defects in the prior art, the invention solves the technical problems that: how to call a preset general data model to configure any service under the condition of not writing codes.
In order to achieve the above object, the method for configuring universal data for service invocation provided by the present invention comprises the following steps: defining a uniform data model for each sub-service, and establishing an iterative relationship for each sub-service required by the service to be called, wherein the iterative relationship comprises an initial sub-service and other partner sub-services; after one partner sub-service is configured, determining an initial sub-service according to the iteration relation; and after the initial sub-service configuration is completed, if the configuration of the rest partner sub-services is determined to be completed according to the iteration relation, forming service configuration information of the service to be called.
On the basis of the technical scheme, the method specifically comprises the following steps: acquiring a data model of any sub-service required by a service to be called:
if the current sub-business is the initial sub-business and the data models of all partner sub-businesses are judged to be completely configured according to the iteration relation, business configuration information of the business to be called is formed according to all the data models;
and if the current sub-business is the partner sub-business and the data model configuration of the initial sub-business is judged to be completed according to the iterative relationship, acquiring the data model of the initial sub-business.
On the basis of the technical scheme, each data model comprises an incidence relation between the sub-service and other sub-services, and the process of creating the data model for each sub-service comprises the following steps: classifying all the sub-services according to functions, wherein the incidence relations of all the sub-services in one category are the same; the incidence relation between the class and other classes is recorded in each class; determining the category corresponding to the sub-service to be created, and associating the sub-service with other sub-services according to the association relationship between the category and other categories to form a data model of the sub-service.
On the basis of the technical scheme, the incidence relation between the sub-services comprises a dependency relation and a parent-child relation, the dependency relation is that the sub-service only depends on or is dependent on one other sub-service, and the parent-child relation is that the sub-service is dependent on a plurality of other sub-services or depends on one sub-service together with other sub-services.
On the basis of the technical scheme, both the initial sub-business and the partner sub-business can be unnecessary sub-businesses, and the data model of the unnecessary sub-businesses is issued after the business configuration information of the called business is configured.
The invention provides a general data configuration system for service calling, which comprises a data model establishing module and a data model calling module;
the data model creation module is to: creating a data model for each sub-service, wherein each data model comprises an incidence relation between the sub-service and other sub-services;
the data model calling module is used for: and when all the data models required by the service to be called are completely configured, forming service configuration information of the service to be called according to all the data models.
On the basis of the technical scheme, the data model calling module comprises a general iteration engine, an initial sub-business module and a partner sub-business module;
the generic iteration engine is to: acquiring all sub-service information required by a service to be called, wherein all the sub-service information comprises 1 initial sub-service and other partner sub-services; forming an iterative relationship of all the sub-services according to the incidence relationship among all the sub-services; acquiring a data model of any sub-service in all sub-services: if the data model of the initial sub-service is acquired, informing the initial sub-service module to start working; if the data model of the partner sub-business is acquired, informing the partner sub-business module to start working;
the start sub-service module is used for: when the data models of all partner sub-services are judged to be completely configured according to the iterative relationship, service configuration information of the service to be called is formed according to all the data models;
the partner sub-service module is used for: and when the data model configuration of the initial sub-service is judged to be completed according to the iteration relation, informing the initial sub-service module to start working.
On the basis of the technical scheme, the sub-service information also comprises non-necessary sub-services which can be flexibly configured, and the data model of the non-necessary sub-services is issued after the configuration of the service configuration information of the called service is completed.
On the basis of the technical scheme, the work flow of the data model creating module comprises the following steps: classifying all the sub-services according to functions, wherein the incidence relations of all the sub-services in one category are the same; the incidence relation between the class and other classes is recorded in each class; determining the category corresponding to the sub-service to be created, and associating the sub-service with other sub-services according to the association relationship between the category and other categories to form a data model of the sub-service.
On the basis of the technical scheme, the incidence relation between the sub-services in the data model created by the data model creating module comprises a dependency relation and a parent-child relation, wherein the dependency relation is that the sub-service only depends on or is dependent on one other sub-service, and the parent-child relation is that the sub-service is dependent on a plurality of other sub-services or depends on one sub-service together with other sub-services.
Compared with the prior art, the invention has the advantages that:
the invention can be called by different services through the pre-configured uniform data model with very high reusability, so that a configurator only needs to know the sub-services required by the service and does not need to write codes corresponding to the sub-services and the incidence relation; therefore, the service configuration process is remarkably simplified, and the error rate is greatly reduced; moreover, the requirement on configuration personnel is low, the application range is wide, and the platform data is well managed in a unified way.
On the basis, the invention realizes that the whole service to be called can be configured by the iterative relationship no matter any sub-service of the service to be called is obtained by dividing the initial sub-service, the partner sub-service and the iterative relationship thereof, thereby well realizing the unified management of platform data and being very suitable for popularization.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples.
The general data configuration method for service invocation in the embodiment of the invention comprises the following steps: defining a data model for each sub-service needing to be used (including about to be used, used later and possible to be used later), wherein each data model comprises a sub-service keyword, an incidence relation between the sub-service and other sub-services and service data of the sub-service; and when all the data models required by the service to be called are completely configured, forming service configuration information of the service to be called according to all the data models.
Preferably, the association relationship between the sub-services includes a dependency relationship and a parent-child relationship:
the dependency relationship is that the sub-service depends on or is dependent on one other sub-service, such as that the ARP table (the sub-service) depends on the egress interface table (other sub-service) through the index (foreign key) of the egress interface;
the parent-child relationship is that the child service is used as a "parent" and depended on by a plurality of other child services, or the child service and the other child services are both used as "children" and all depend on one "parent" child service, for example, a plurality of lag tables (other child services "children") depend on the same interface table (the child service "parent") through an interface index (external key).
The difference between the dependency relationship and the parent-child relationship is as follows: the dependency relationship is a one-to-one correspondence relationship, and the parent-child relationship is a one-to-many relationship.
Preferably, referring to fig. 1, the process of defining a data model for each sub-service that needs to be used includes:
classifying all the sub-services according to functions, namely that the incidence relation of all the sub-services in one class is the same, and the types of the sub-services in different classes are different; the node (CLASS _ TREE) of each CLASS records the association relationship between the CLASS and other classes, such as the DEPENDENCY relationship (DEPENDENCY _ INFO) and parent-child relationship (failure _ child _ INFO) in fig. 1. The dependency relationship comprises other class lists (dependency _ list and OBSERVER _ list) of dependent and depended class and specific information (DePENDER _ INFO and OBSERVER _ INFO); the parent-child relationship, in turn, includes a list of "parent" and "child" classes (myfather _ list and mychildrenjlist) and specific information (FATHER _ INFO and CHILDREN _ INFO); the list of other classes is associated with the specific information through a list node (list _ node).
Determining the class corresponding to the sub-service to be created, judging whether a data model of the sub-service exists in the class, if so, proving that the sub-service is created, and ending; otherwise, according to the association relationship between the class and other classes, the sub-service is associated with other sub-services to form a data model of the sub-service and store the data model in the class.
It can be derived that when there is no associated sub-service associated with the sub-service in the other class, an associated sub-service can be created in the manner described above.
Referring to fig. 2 and 3, the data model of the sub-service in the embodiment of the present invention includes:
route (routing table) including routing and next information, and depending on Route _ path (routing protection table) through foreign key path _ id; namely, the Route and the Route _ path are in a dependency relationship;
route _ path (Route protection table), including the number of Route members, is depended on by multiple Route _ path _ mem (Route member table) through the same path _ id, i.e. Route _ path (parent) and Route _ path _ mem (child) are in parent-child relationship;
route _ path _ mem, which, in addition to having a parent-child relationship with Route _ path, also includes next hop information, which depends on Nh (next hop table) by Nh _ id;
nh, including a next hop type and information of a next hop, depending on Arp (Address resolution protocol) through ifindex (index);
arp depends on if _ net (out-interface table) through the same ifindex;
if _ net, is depended on by Arp.
The invention enables the specific sub-service to be directly called when the service is configured in a mode of configuring the data model for each sub-service in advance; when the sub-service is called, other sub-services required to be used can be obtained according to the incidence relation in the sub-service data model. For example, as shown in fig. 2, the L3PATH (three-layer protection) service directly calls Route and Route _ PATH _ mem write drivers; the L3UNI (three-layer user) service directly calls the write drivers of Nh, arp and if _ net; the ARP service directly calls the ARP and if _ net write drivers.
Therefore, the method can be called by different services through the pre-configured general data model with very high reusability, so that a configurator only needs to know the sub-services required by the services without compiling codes corresponding to the sub-services and the incidence relation; therefore, the service configuration process is remarkably simplified, and the error rate is greatly reduced; and the requirement on configuration personnel is low, the application range is wide, and the unified management of platform data is well realized.
Preferably, after all the data models required by the service to be called are configured completely, the process of forming the service configuration information of the service to be called according to all the data models includes:
acquiring all sub-service information required by the service to be called, wherein the all sub-service information comprises 1 starting sub-service (namely, a sub-service for initiating mapping to the service to be called) and other partner sub-services (namely, other sub-services participating in mapping or notification).
Referring to fig. 4, the specifying mode and the iterative relationship of the starting sub-service and the partner sub-service may be specified by the service to be invoked itself, specifically:
each sub-service (class a) contains two pieces of information at registration:
(1) mapping _ starter _ list info block: the sub-service is used as some basic information of the initial sub-service, including a product callback function, a sub-service attribute bitmap to be called and selectively concerned by the service, and a dependent path _ list chain table; since one sub-service may serve as a starting sub-service for a plurality of services to be called, the path _ list needs to be traversed when the mapping is triggered.
(2) mapping _ parent _ list information block: when the sub-service is used as a partner sub-service of the current service to be called, the dependency chain information of the corresponding initial sub-service trigger mapping needs to be informed;
path _ list information in STARTER _ MAPPING _ INFO:
a set of dependency chains where partner sub-service information required for service assembly to be called is located; when the platform collects all the partner sub-business information, the dependency chain sets are traversed, attribute values concerned by the business to be called in all the partner sub-businesses are obtained, and finally, the issuing product is assembled at one time.
PARTER _ MAPPING _ INFO and its PATH _ NODE information:
the PARTER _ MAPPING _ INFO stores partner sub-service information, concerned attribute bitmap information, necessary and unnecessary attribute information, a product callback function and the like; and PATH _ NODE is essentially a PATH information recording the complete information from the partner sub-service to the originating sub-service.
In actual use, the process can be realized through the initial sub-business module and the partner sub-business module, wherein the initial sub-business module stores initial sub-business information and path information of all sub-businesses (namely the initial sub-business and all partner sub-businesses); the partner sub-service module stores complete path information for notifying the starting sub-service.
Referring next to fig. 5, it is necessary to obtain a data model of any sub-service in all sub-services:
when the data model of the initial sub-business is obtained, judging whether the data models of all the rest partner sub-businesses are configured or not according to the iteration relation (carrying out circulation according to the iteration relation, obtaining the data model information of one partner sub-business each time till traversing all the partner sub-businesses), if so, forming the business configuration information of the business to be called according to all the data models; otherwise, the data model is proved to be not completely configured and needs to be continuously waited;
when the partner sub-business is obtained, judging whether the data model of the initial sub-business is configured or not according to the iteration relation, if so, obtaining the data model of the initial sub-business (and then entering the process when the data model of the initial sub-business is obtained); otherwise, the data model of the initial sub-service is proved to be not configured and needs to continue waiting.
Therefore, the method can iterate all partner sub-businesses for mapping through the initial sub-business; or the partner sub-service iteration informs the corresponding initial sub-service, and the initial sub-service triggers mapping. Therefore, the invention completes the monitoring of all data models required by the service to be called in a mode of circulation and recursion of the initial sub-service and the partner sub-service; and further, the method can meet the requirements of the user-defined design and the service to be called with higher flexibility (because the method has corresponding logic for iteration no matter what sub-service is issued).
Preferably, since a more than one scenario is often encountered in the design process of the service to be invoked (i.e. there is a flexibly configurable "branch point" sub-service notified by the service to be invoked, that is, the service to be invoked notifies the attribute of the "branch point" sub-service as unnecessary, and may or may not be present), for example, the route NH (next hop) may be UNI (user side) or NNI (network side), the TUNNEL (TUNNEL selection table) may be FTN TUNNEL or TE TUNNEL, etc.; however, in an actual scene, only one type of service is issued, and if a common flow iterates, adaptive processing cannot be performed at the "bifurcation point".
Therefore, the invention introduces the sub-service with the non-necessary attribute (hereinafter referred to as non-necessary sub-service, namely the sub-service of a bifurcation point) which can be flexibly configured into all the sub-service information; the unnecessary sub-business does not belong to the necessary business configuration information (namely the unnecessary sub-business is not in parallel relation with the initial sub-business and the partner sub-business), and the data model of the unnecessary sub-business can be issued after the business configuration information of the business to be called is configured. For example, a service to be invoked needs to invoke 3 sub-services, but the attribute of one of the sub-services is unnecessary, and at this time, the unnecessary sub-service can be issued as long as the other 2 sub-services are already established.
The invention realizes the judgment of the rationality condition of the branch point sub-service through the design, effectively solves the problem of one-out-of-multiple scene, greatly increases the flexibility of service design, is simple and universal, quite accords with the platform idea, and well adapts to the requirements of various products.
The following illustrates the formation flow of the service configuration information.
Referring to fig. 6, each circle box of the left half area represents a sub-service, the left and right short arrows represent the dependency relationship between the sub-services, and the long arrow represents that a plurality of sub-services on the left side map a service to be called together. In this scenario, GROUP (routing working GROUP) is the initial sub-service, and these sub-services all exist in a multiple-out-of-one scenario, i.e. a complex scenario, UNI (user side next hop), nnil (TUNNEL selection table), FTN (FEC to NHLFE mapping table), and TE _ PROT (traffic engineering protection table), and thus are set as unnecessary sub-services to increase flexibility of product design. The rest sub-services are partner sub-services, and although the MEMBER (working group MEMBER table) and the ARP are sub-services which do not need mapping of the service to be invoked, the sub-services need to participate in mapping as path partners.
The general data configuration system for service invocation in the embodiment of the invention comprises a data model creation module and a data model invocation module.
The data model creation module is to: creating a data model for each sub-service, wherein each data model comprises an incidence relation between the sub-service and other sub-services; the association relationship comprises a dependency relationship and a parent-child relationship, the dependency relationship is that the child service depends on or is dependent on only one other child service, and the parent-child relationship is that the child service is dependent on a plurality of other child services or depends on one child service together with other child services.
The specific work flow of the data model creating module comprises the following steps: classifying all sub-services according to functions, wherein the incidence relations of all sub-services in one class are the same; the incidence relation between the class and other classes is recorded in each class; determining the category corresponding to the sub-service to be created, and associating the sub-service with other sub-services according to the association relationship between the category and other categories to form a data model of the sub-service.
The data model calling module is used for: and when all the data models required by the service to be called are completely configured, forming service configuration information of the service to be called according to all the data models.
The data model calling module specifically comprises a general iteration engine, an initial sub-business module and a partner sub-business module;
the generic iteration engine is to: acquiring all sub-service information required by a service to be called, wherein the sub-service information comprises 1 initial sub-service, a plurality of partner sub-services and a plurality of non-necessary sub-services which can be flexibly configured; forming an iterative relationship of all the sub-services according to the incidence relationship among all the sub-services; acquiring a data model of any sub-service in all sub-services: if the data model of the initial sub-service is acquired, informing the initial sub-service module to start working; if the data model of the partner sub-business is acquired, informing the partner sub-business module to start working; and if the acquired data model of the unnecessary sub-service is not the data model of the necessary sub-service, the service configuration information of the service to be called is issued after the configuration is completed.
The initiator sub-service module is used for: and when the data models of all the partner sub-services are judged to be completely configured according to the iterative relationship, forming service configuration information of the service to be called according to all the data models.
The partner sub-business module is used for: and when the data model configuration of the initial sub-service is judged to be completed according to the iteration relation, informing the initial sub-service module to start working.
It should be noted that: in the system provided in the embodiment of the present invention, when performing inter-module communication, only the division of each functional module is illustrated, and in practical applications, the above function distribution may be completed by different functional modules as needed, that is, the internal structure of the system is divided into different functional modules to complete all or part of the above described functions.
Further, the present invention is not limited to the above-mentioned embodiments, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements are also considered to be within the scope of the present invention. Those not described in detail in this specification are within the skill of the art.