Summary of the invention
For the defect of above-mentioned prior art, the present invention proposes a kind of increase industry in cloud computing environment
The method of business object, solves the technical problem increasing business object under how cloud computing environment.
The invention provides a kind of tts resource object and the method for business object, the cloud computing related to is grasped
Make system according to actual scene, divided 21 kinds of upper-layer service objects altogether, including physical resource subregion,
Hypervisor, virtual machine, shared storage, IP, VLAN etc..Underlying resource is by different business pair
Generating as extracting common denominator according to certain method, a resource can be divided into three parts: substantially believes
Breath, configuration parameter information, incidence relation information.Essential information describes the predicable of business object,
Such as title, type etc.;Configuration parameter information describes the particular attribute of business object, incidence relation information
The incidence relation existed between business object and type thereof etc. are described.
System one business object base class of definition, the generic attribute in this base class is with resource essential information one by one
Correspondence, all business objects are both needed to inherit this base class;System is respectively each business object definition one
Individual business object class, the attribute of business object defined in class and interface, the attribute of business object except with
Outside the attribute that resource configuration parameter information is corresponding, it is also possible to define other and need attribute to be processed;Base class
It is provided which corresponding getter and setter method with the generic attribute corresponding with resource of business object class.
Underlying resource storage organization, data structure and the access interface that system definition is unified, essential information
Store respectively with configuration parameter information, the data structure of each own correspondence, in interface realizes also
It is respectively processed.
The present invention realizes, when storage, business object is converted into underlying resource, is provided by bottom when reading
Source is converted into the function of business object, when conversion, it is contemplated that different operating (increase, revise)
Data structure diversity, business object attribute data type and underlying resource data type diversity etc.,
Processed respectively.When business object occurs change, owing to the present invention is accomplished that the general end
Layer resource and the transducer of business object, it is only necessary to change business object self, without to bottom
Resource carries out any amendment, same when business object kind increases.
In cloud computing environment, business object is increased according to an aspect of the invention, it is provided a kind of
Method, it is characterised in that including: the total attribute in the described business object that will be increased is converted to
Total parameter in underlying resource;And the particular attribute conversion in the described business object that will be increased
For the peculiar parameter in described underlying resource.
Preferably, the total attribute in the described business object that will be increased is converted in underlying resource
Total parameter includes: at parameter object total defined in described underlying resource;By in described business object
Described total attribute be arranged in described total parameter object;And by described total parameter object
Content write described underlying resource data base in as described total parameter.
Preferably, the particular attribute in the described business object that will be increased is converted to described underlying resource
In peculiar parameter include: at parameter list peculiar defined in described underlying resource;By described business pair
Described particular attribute in as writes in described peculiar parameter list;And by described peculiar parameter list
In content write described underlying resource data base in as described peculiar parameter.
Preferably, the described particular attribute in described business object is write in described peculiar parameter list
Including: obtain the classification of described business object;The attribute of described business object is obtained according to described classification
Array and formwork structure;And if judging in described attribute array according to described formwork structure
One attribute is particular attribute, then write in described peculiar parameter list by the property value of described first attribute.
Preferably, the described particular attribute in described business object is write in described peculiar parameter list
Also include: if judging that the first attribute in described attribute array is not special according to described formwork structure
There is attribute, then judge whether the second attribute in described attribute array is particular attribute;And if root
Judge that the second attribute in described attribute array is particular attribute, then by described according to described formwork structure
The property value of the second attribute writes in described peculiar parameter list.
Preferably, judge that the first attribute in described attribute array is peculiar according to described formwork structure
Attribute includes: obtain the Property Name of described first attribute;And the attribute according to described first attribute
Title and described formwork structure judge that described first attribute is particular attribute.
Preferably, the property value of described first attribute is write described peculiar parameter list to include: root
The reading method of described first attribute is obtained according to described classification;Described the is obtained by calling described reading method
The property value of one attribute;Described property value is converted to String type;And by the institute through conversion
State property value to write in described peculiar parameter list.
Preferably, the described property value through conversion is write described peculiar parameter list to include:
Peculiar parameter object defined in described underlying resource;Described property value through conversion is arranged on described
In peculiar parameter object;And the content in described peculiar parameter object is write described peculiar parameter row
In table.
According to a further aspect in the invention, it is provided that a kind of revise business object under the cloud computing environment
Method, it is characterised in that including: arrange according to the total attribute in the described business object revised
Total parameter in underlying resource;And the particular attribute in the business object that will be revised is converted to the end
Peculiar parameter in layer resource.
Preferably, arrange in underlying resource according to the total attribute in the described business object revised
Total parameter includes: judge to deposit under described cloud computing environment according to unique mark of described business object
In described business object;According to the total attribute in the described business object revised, described bottom is set
Total parameter in resource.
Preferably, it is peculiar that the particular attribute in the business object will revised is converted in underlying resource
Parameter includes: obtain the first peculiar parameter list from described underlying resource;By described first peculiar ginseng
Ordered series of numbers table is converted to Map form;If the first attribute of the attribute array of the classification of described business object
The first property value be present in described first peculiar parameter list, then take out described first peculiar parameter
The peculiar parameter of correspondence in list, if described first property value is not present in described first peculiar parameter
In list, then define and arrange corresponding peculiar parameter;Peculiar for described correspondence parameter is arranged to second special
Have in parameter list;And the content in described second peculiar parameter list is write described underlying resource
Data base in.
Preferably, arrange corresponding peculiar parameter to include: arrange unique mark of corresponding peculiar parameter, mould
Plate, parameter value and modification time.
Preferably, it is peculiar that the particular attribute in the business object will revised is converted in underlying resource
Parameter also includes: obtain the described classification of described business object;And obtain the described genus of described classification
Property array.
Preferably, it is peculiar that the particular attribute in the business object will revised is converted in underlying resource
Parameter also includes: obtain the first attribute in described attribute array;If the attribute of described first attribute
Title corresponds to peculiar parameter, then obtain the reading method that described first attribute is corresponding;And call described
Reading method obtains the first property value of described first attribute.
Preferably, it is peculiar that the particular attribute in the business object will revised is converted in underlying resource
Parameter also includes: described first property value is converted to String form.
According to another aspect of the invention, it is provided that a kind of read underlying resource under the cloud computing environment
Method, it is characterised in that including: be business object by the total Parameters Transformation in described underlying resource
In total attribute;And be in described business object by the peculiar Parameters Transformation in described underlying resource
Particular attribute.
Preferably, it is the total attribute in business object by the total Parameters Transformation in described underlying resource
Including: obtain the general type example of described business object;And described common according in described underlying resource
There is parameter that the total attribute of described general type example of described business object is set.
Preferably, it is peculiar in described business object by the peculiar Parameters Transformation in described underlying resource
Parameter includes: obtain peculiar parameter list from described underlying resource;From described peculiar parameter list
Obtain peculiar parameter name and peculiar parameter value;Described peculiar parameter value is converted to described business object
The data type corresponding to particular attribute of classification;And by the particular attribute in described business object
It is arranged via the peculiar parameter value of conversion.
Preferably, described peculiar parameter value is converted to the particular attribute institute of the classification of described business object
Corresponding data type includes: obtain the data class of the classification of business object corresponding to described peculiar parameter
Type;And described peculiar parameter value is converted to the data type corresponding to classification of described business object.
Preferably, the particular attribute in described business object is arranged via the peculiar parameter value of conversion
Including: the classification of business object corresponding to described peculiar parameter is obtained according to described peculiar parameter name
Write method;And call described write method, the particular attribute in described business object is arranged via
The peculiar parameter value of conversion.
Preferably, the type of described peculiar parameter value includes String type.
Preferably, the data type corresponding to the classification of described business object include String type,
Integer type, Long type, Float type, Boolean type, List type, Enum class
Type or Date type.
Present invention achieves three conversion methods between underlying resource and business object, be respectively and increase
Time business object to underlying resource conversion method, amendment time business object to the conversion side of underlying resource
Method and underlying resource are to the conversion method of business object.Wherein, three conversion methods can individually be implemented,
Or three conversion methods can be combined two-by-two, or be that three Combination of Methods become a method come
Implement.
Provide one by technical scheme described in the invention to increase in cloud computing environment, revise
The method of business object and the method for reading underlying resource, solve multiple business in cloud computing environment
The multiple business object of system needs unified storage at underlying resource, and needs on upper strata to use towards right
The problem of the business object of elephant.Wherein, present invention achieves between underlying resource and upper-layer service object
Conversion, bottom storage and interface to upper-layer service system mask, upper-layer service have only to pay close attention to from
Body business object, and use unified storage and interface at bottom, shield the difference of different business object
The opposite sex.When business object occurs change, it is only necessary to amendment upper-layer service object self, without shadow
Ring to bottom storage and interface, it is ensured that system has good autgmentability.
Detailed description of the invention
Below in conjunction with accompanying drawing, the preferred embodiments of the present invention are illustrated, it will be appreciated that this place is retouched
The preferred embodiment stated is merely to illustrate and explains the present invention, is not intended to limit the present invention.
Present invention achieves three conversion methods between underlying resource and business object, be respectively and increase
Time business object to underlying resource conversion method, amendment time business object to the conversion side of underlying resource
Method and underlying resource are to the conversion method of business object.Wherein, three conversion methods can individually be implemented,
Or three conversion methods can be combined two-by-two, or be that three Combination of Methods become a method come
Implement.
In technical scheme described in the invention, cloud computing system includes upper-layer service object and lower floor
Underlying resource.Wherein, underlying resource can be divided into three parts: essential information (i.e. having parameter),
Configuration parameter information (the most peculiar parameter) and incidence relation information (i.e. incidence relation parameter).Substantially
Information describes the total attribute (such as title and type etc.) of business object;Configuration parameter information describes
The particular attribute of business object, incidence relation information describe between business object exist incidence relation and
Type etc..
When Fig. 1 to Fig. 3 describes increase, business object is to the conversion method of underlying resource.
Fig. 1 is the method increasing business object according to an embodiment of the invention in cloud computing environment
Overview flow chart.In FIG:
Step S100: add business object on upper strata according to user's instruction, such as increase by is virtual
Machine etc..Then, the total attribute in the business object that cloud computing system will be increased is converted to bottom
Total parameter in resource.Wherein, this step specifically may comprise steps of: in underlying resource
The total parameter object of definition;Total attribute in business object is arranged in total parameter object;With
And the content in total parameter object is write in the data base of underlying resource as total parameter.
Step S102: the particular attribute in the business object that will be increased is converted to the spy in underlying resource
There is parameter.Wherein, this step specifically may comprise steps of: in ginseng peculiar defined in underlying resource
Ordered series of numbers table;Particular attribute in business object is write in peculiar parameter list;And by peculiar parameter
As peculiar parameter in the data base of the content write underlying resource in list.
A kind of increase business in cloud computing environment is provided by the technical scheme described by the present embodiment
The method of object, the multiple business object solving multiple operation systems in cloud computing environment provides at bottom
Source needs unification to store, and the problem needing on upper strata to use OO business object.Wherein,
Present invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses system at bottom
The storage of one and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 2 is the method increasing business object according to an embodiment of the invention in cloud computing environment
Particular flow sheet.In fig. 2:
Wherein, the total attribute during step S200 to step S204 is the business object that will be increased turns
The concrete steps of the total parameter being changed in underlying resource;Step S206 to step S226 is to be increased
Particular attribute in the business object added is converted to the concrete steps of the peculiar parameter in underlying resource.
Step S200: at parameter object total defined in underlying resource.
Step S202: the total attribute in business object is arranged in total parameter object.
Step S204: the content in total parameter object is write in the data base of underlying resource as altogether
There is parameter.
Total attribute in above three step, the business object that will be newly increased has been arranged on the end
In layer resource.
Step S206: at parameter list peculiar defined in underlying resource.
Step S208: obtain the classification of the business object increased.
Step S210: obtain attribute array and the formwork structure of business object according to classification.Wherein, industry
The formwork structure of business object contains all particular attributes of the business object of the category.Thus, may be used
To utilize this formwork structure to judge whether an attribute is particular attribute.
Step S212: obtain the Property Name of the first attribute.
Step S214: whether Property Name and formwork structure according to the first attribute judge the first attribute
For particular attribute.
Wherein, if the first attribute judged in attribute array according to formwork structure is particular attribute,
Then follow the steps below.If the first attribute judged in attribute array according to formwork structure is not special
There is attribute, then judge whether the second attribute in attribute array is particular attribute.If tied according to template
Structure judges that the second attribute in attribute array is particular attribute, then write by the property value of the second attribute
In peculiar parameter list.
In other words, by judge the Property Name of each attribute of business object whether in formwork structure,
Can interpolate that out whether this attribute is particular attribute, be only particular attribute when this attribute, just should
The property value of attribute writes in peculiar parameter list.
Step S216: obtain the reading method of the first attribute according to classification.Due to different classes of attribute pair
The reading/writing method answered is different, accordingly, it would be desirable to by the reading method obtaining the first attribute obtain this first
First property value of attribute.
Step S218: obtain the first property value of the first attribute by calling reading method.
Step S220: this first property value is converted to String type.
Because the type string type of the configuration parameter value in resource, and the Attribute class of business object
Type is the most varied, including String, Integer, Long, Float, Boolean, List, self-defined
Various Enum types, Date etc., it is therefore desirable to the type carrying out configuration parameter value and property value turns
Change.The present embodiment realizes other data type value are converted to String type.
Step S222: at parameter object peculiar defined in underlying resource.
Step S224: will be arranged in peculiar parameter object through the property value of conversion.
Step S226: the content in peculiar parameter object is write in peculiar parameter list.
Step S228: the content in peculiar parameter list is write in the data base of underlying resource as special
There is parameter.
A kind of increase business in cloud computing environment is provided by the technical scheme described by the present embodiment
The method of object, the multiple business object solving multiple operation systems in cloud computing environment provides at bottom
Source needs unification to store, and the problem needing on upper strata to use OO business object.Wherein,
Present invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses system at bottom
The storage of one and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Hereinafter will specifically describe above-described embodiment by an example.
Fig. 3 is the method increasing business object according to an embodiment of the invention in cloud computing environment
The particular flow sheet of example.In other words, Fig. 3 describe a kind of when increasing business object to bottom money
Source converter.
Owing to the information of underlying resource is divided into essential information and configuration parameter information, the attribute of business object
The data structure of the most corresponding both information, therefore conversion is divided into two steps, respectively: tissue
In business object, the attribute of corresponding essential information is essential information structure;Endemic genus in organization business object
Property is configuration parameter message structure.
Corresponding interface:
1) transformation service object is to resource essential information
private Resource Vo convertAddBOToResourceVo(T bo)
2) transformation service object is resource configuration parameter
private List<ParamDataVo>convertAddBOToParamData(T bo)
Flow process describes:
1) definition resource essential information object ResourceVo resVo, arranges every attribute of resVo
Value is business object correspondence property value;
2) the Class object clazz of business object is obtained;
3) Field array fields of Class object is obtained;
4) configuration parameter template name and the Map structure of id of the resource type of business object are obtained
mapParamTempl;
5) definition configuration parameter data list List<ParamDataVo>lsParamData;
6) traversal fields, to each of which item Field field:
A) title fieldName of field is obtained;
B) judge whether fieldName is configuration parameter, if it is, perform below step,
Otherwise, next field is continued with;
C) reading method readMethod of field is obtained;
D) call readMethod and obtain value fieldValue of field;
E) calling data type converter, processing fieldValue is String type;
F) definition configuration parameter object ParamDataVo paramData;
G) property values such as the resource of paramData, configuration parameter template, value are organized;
H) paramData is added in lsParamData.
A kind of increase business pair in cloud computing environment is provided by the technical scheme described by this example
The method of elephant, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
When Fig. 4 to Fig. 6 describes amendment, business object is to the conversion method of underlying resource.
Fig. 4 is the method revising business object according to an embodiment of the invention in cloud computing environment
Overview flow chart.In the diagram:
Step S400: being total in underlying resource is set according to the total attribute in the business object revised
There is parameter.Wherein, this step can specifically include following steps: according to unique mark of business object
Judge to exist under cloud computing environment business object, and according to having in the business object revised
Attribute arranges the total parameter in underlying resource.
Step S402: the particular attribute in the business object that will be revised is converted to the spy in underlying resource
There is parameter.Wherein, this step can specifically include following steps: obtains first from underlying resource special
There is parameter list;First peculiar parameter list is converted to Map form;If the classification of business object
First property value of the first attribute of attribute array be present in the first peculiar parameter list, then take out
The peculiar parameter of correspondence in first peculiar parameter list, if to be not present in first peculiar for the first property value
In parameter list, then define and arrange corresponding peculiar parameter;Corresponding peculiar parameter is arranged to second special
Have in parameter list and the content in the second peculiar parameter list is write the data base of underlying resource
In.Wherein, arrange corresponding peculiar parameter include but not limited to arrange corresponding peculiar parameter unique mark,
Template, parameter value and modification time.
A kind of amendment business pair in cloud computing environment is provided by the technical scheme described by this example
The method of elephant, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 5 is the method revising business object according to an embodiment of the invention in cloud computing environment
Flow chart.In Figure 5:
Step S500: judge to there is business pair under cloud computing environment according to unique mark of business object
As.
Step S502: being total in underlying resource is set according to the total attribute in the business object revised
There is parameter.
Step S504: obtain the first peculiar parameter list from underlying resource.
Step S506: the first peculiar parameter list is converted to Map form.
Step S508: obtain the classification of business object.
Step S510: obtain the attribute array of classification.
Step S512: obtain the first attribute in attribute array.
Step S514: if the Property Name of the first attribute is corresponding to peculiar parameter, then obtain the first genus
The reading method that property is corresponding.
Step S516: call reading method and obtain the first property value of the first attribute.
Step S518: the first property value is converted to String form.Because the configuration parameter in resource
The type of value is String type, and the attribute type of business object is the most varied, including String,
Integer, Long, Float, Boolean, List, self-defining various Enum types, Date etc.,
It is thus desirable to carry out the type conversion of configuration parameter value and property value.The present embodiment realizes other data
Types value is converted to String type.
Step S520: if the first property value of the first attribute of the attribute array of the classification of business object
It is present in the first peculiar parameter list, then takes out the peculiar parameter of correspondence in the first peculiar parameter list,
If the first property value is not present in the first peculiar parameter list, then define and arrange corresponding peculiar ginseng
Number.Wherein, arrange corresponding peculiar parameter include but not limited to arrange corresponding peculiar parameter unique mark,
Template, parameter value and modification time.
Step S522: corresponding peculiar parameter is arranged in the second peculiar parameter list.
Step S524: the content in the second peculiar parameter list is write in the data base of underlying resource.
A kind of amendment business pair in cloud computing environment is provided by the technical scheme described by this example
The method of elephant, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 6 is the method revising business object according to an embodiment of the invention in cloud computing environment
The particular flow sheet of example.
It is that underlying resource step is similar with transformation service object when increasing operation, is also classified into two steps,
Idiographic flow is the most different.
Corresponding interface:
1) during amendment, transformation service object is resource essential information
private ResourceVo convertUpdateBOToResourceVo(T bo)
2) during amendment, transformation service object is resource configuration parameter information
private List<ParamDataVo>convertUpdateBOToParamData(T bo)
Flow process describes:
1) uniquely identify according to business object get correspondence resource information resVo;
2) if resource information resVo exists, then arrange its value be corresponding business object every substantially
Property value;
3) the existing configuration parameter data list List<ParamDataVo>lsParamData of resource is obtained;
4) lsParamData being converted into Map form mapParamData, the key of Map is for joining
Putting parameter name, value is corresponding configuration parameter ParamData;
5) the Class object clazz of business object is obtained;
6) Field array fields of clazz is obtained;
7) configuration parameter template name corresponding to resource category and the Map structure of id composition are obtained
mapParamTempl;
8) definition configuration parameter data list lsRetParamData;
9) to each Field field in field array fields:
A) field name fieldName of field is obtained;
If b) judging that field name fieldName is configuration parameter, then perform following step,
Otherwise, next Field is continued with;
C) reading method readMethod corresponding to field is obtained;
D) call readMethod and obtain field field value fieldValue;
E) call data type converter, fieldValue is converted into String form;
F) judge whether fieldValue deposits in existing configuration parameter data mapParamData
, if existed, then take out paramData;Otherwise, definition configuration parameter object ParamData
ParamData, arranges the information such as the resource of paramData, template;
G) information such as the value of paramData, time are set;
H) above-mentioned configuration parameter paramData is added to above-mentioned configuration parameter data list
In lsRetParamData.
A kind of amendment business pair in cloud computing environment is provided by the technical scheme described by this example
The method of elephant, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 7 to Fig. 9 describes the underlying resource conversion method to business object.
Fig. 7 is the method reading underlying resource according to an embodiment of the invention under cloud computing environment
Overview flow chart.In the figure 7:
Step S700: be the total attribute in business object by the total Parameters Transformation in underlying resource.
This step can specifically include following steps: obtains the general type example of business object;And according to bottom
Total parameter in resource arranges the total attribute of the general type example of business object.
Step S702: be the particular attribute in business object by the peculiar Parameters Transformation in underlying resource.
This step can specifically include following steps: obtains peculiar parameter list from underlying resource;From peculiar
Parameter list obtains peculiar parameter name and peculiar parameter value;Peculiar parameter value is converted to business pair
Data type corresponding to the particular attribute of the classification of elephant;And the particular attribute in business object is set
It is set to the peculiar parameter value through conversion.
Provide a kind of bottom that reads under cloud computing environment by the technical scheme described by this example to provide
The method in source, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 8 is the method reading underlying resource according to an embodiment of the invention under cloud computing environment
Particular flow sheet.In fig. 8:
Step S800: obtain the general type example of business object.Such as, the general type example of this business object
It can be virtual machine etc..
Step S802: this general type example of business object is set according to the total parameter in underlying resource
Total attribute.
Step S804: obtain peculiar parameter list from underlying resource.
Step S806: obtain peculiar parameter name and peculiar parameter value from peculiar parameter list.
Step S808: obtain the data type of the classification of business object corresponding to peculiar parameter.
Step S810: peculiar parameter value is converted to the data type corresponding to the classification of business object.
Because the type of the configuration parameter value in resource is mostly String type, and the genus of business object
Property type the most varied, including String, Integer, Long, Float, Boolean, List, from
The various Enum types of definition, Date etc., it is therefore desirable to carry out the class of configuration parameter value and property value
Type is changed.In a specific embodiment, it is achieved String type is converted to other data types.
Step S812: obtain the classification of business object corresponding to peculiar parameter according to peculiar parameter name
Write method.
Step S814: call write method, is arranged via conversion by the particular attribute in business object
Peculiar parameter value.
Wherein, the type of above-mentioned peculiar parameter value includes but not limited to String type.Business object
Data type corresponding to classification include but not limited to String type, Integer type, Long type,
Float type, Boolean type, List type, Enum type or Date type.
Provide a kind of bottom that reads under cloud computing environment by the technical scheme described by this example to provide
The method in source, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
Fig. 9 is the method reading underlying resource according to an embodiment of the invention under cloud computing environment
The particular flow sheet of example.
Corresponding interface:
1) tts resource essential information is business object essential information
Public T convertResourceVoToBO (ResourceVo resVo, Class<T>clazz)
2) tts resource configuration parameter information is business object information
Private T convertParamDataToBO (Long resId, T bo)
Flow process describes:
1) instantiation gives class, obtains business object example T resBase;
2) it is business object example resBase every basic information value that corresponding resource is set;
3) the configuration parameter data list List<ParamDataVo>lsParamData of resource is obtained;
4) each the ParamDataVo paramData to lsParamData:
A) configuration parameter title paramName and configuration parameter value paramValue are obtained;
B) according to paramName, writing of business object generic attribute corresponding to configuration parameter is obtained
Method writeMethod;
C) data type Class of business object generic attribute corresponding to configuration parameter is obtained
FieldType and typonym fieldTypeName;
D) call data type converter, the property value of String type is converted into business object
The data type of corresponding generic attribute;
E) call writeMethod, configuration parameter value is arranged the business object attribute of correspondence
Value.
Provide a kind of bottom that reads under cloud computing environment by the technical scheme described by this example to provide
The method in source, solves the multiple business object of multiple operation systems in cloud computing environment at underlying resource
Unification is needed to store, and the problem needing on upper strata to use OO business object.Wherein, originally
Invention achieves the conversion between underlying resource and upper-layer service object, to upper-layer service system mask
Bottom storage and interface, upper-layer service has only to pay close attention to own service object, and uses unified at bottom
Storage and interface, shield the diversity of different business object.When there is change in business object,
Have only to revise upper-layer service object self, without having influence on bottom storage and interface, it is ensured that be
System has good autgmentability.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for
For those skilled in the art, the present invention can have various modifications and variations.All essences in the present invention
Within god and principle, any modification, equivalent substitution and improvement etc. made, should be included in the present invention
Protection domain within.