CN106446355B - Instance construction method and device and software system - Google Patents

Instance construction method and device and software system Download PDF

Info

Publication number
CN106446355B
CN106446355B CN201610805697.9A CN201610805697A CN106446355B CN 106446355 B CN106446355 B CN 106446355B CN 201610805697 A CN201610805697 A CN 201610805697A CN 106446355 B CN106446355 B CN 106446355B
Authority
CN
China
Prior art keywords
instance
constructed
construction
network element
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610805697.9A
Other languages
Chinese (zh)
Other versions
CN106446355A (en
Inventor
庞虹宇
于芝涛
刘廷伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Electric Co Ltd filed Critical Hisense Electric Co Ltd
Priority to CN201610805697.9A priority Critical patent/CN106446355B/en
Publication of CN106446355A publication Critical patent/CN106446355A/en
Application granted granted Critical
Publication of CN106446355B publication Critical patent/CN106446355B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]

Abstract

The embodiment of the invention provides an example construction method, an example construction device and a software system, wherein the method comprises the following steps: an example construction device receives an example construction request sent by a network element, wherein the example construction request comprises an identifier of an example to be constructed; the instance construction device acquires a configuration data source corresponding to the network element and acquires configuration parameters corresponding to the identifier of the instance to be constructed from the configuration data source; and the example constructing device constructs the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed. For simplifying the development process of the network element.

Description

Instance construction method and device and software system
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to an instance construction method, an instance construction device and a software system.
Background
At present, in order to improve the performance and the operating efficiency of a software system, a layered design is generally adopted for the software system.
The software system designed in a layered manner includes a plurality of network elements and a plurality of services, the network elements can call the services in the software system, and before the network elements call one service in the software system, an instance corresponding to the service needs to be built in the network elements. In the prior art, when an instance needs to be constructed in a network element, the network element generally obtains configuration parameters corresponding to the instance that needs to be constructed, and constructs the instance that needs to be constructed according to the configuration parameters.
However, in the prior art, because each network element constructs an instance to be constructed, each network element needs to have a function of constructing an instance, and the development process of the network element is complicated.
Disclosure of Invention
The embodiment of the invention provides an instance construction method, an instance construction device and a software system, which are used for simplifying the development process of a network element.
In a first aspect, an embodiment of the present invention provides an instance construction method, which is applied to a software system, where the software system includes an instance construction apparatus and a network element, and the method includes:
the instance construction device receives an instance construction request sent by a network element, wherein the instance construction request comprises an identifier of an instance to be constructed;
the instance construction device acquires a configuration data source corresponding to the network element, and acquires configuration parameters corresponding to the identifier of the instance to be constructed from the configuration data source;
and the example constructing device constructs the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed.
In a possible implementation manner, the obtaining, by the instance building apparatus, the configuration parameter corresponding to the identifier of the instance to be built in the configuration data source includes:
the instance construction device acquires the parameter type of the parameter to be configured corresponding to the instance to be constructed;
the example construction device judges whether the configuration data source has the configuration parameters corresponding to the parameter types;
if so, the instance construction device determines the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the instance to be constructed;
if not, the instance construction device acquires default configuration parameters corresponding to the to-be-constructed instance, and determines the default configuration parameters as the configuration parameters corresponding to the identifier of the to-be-constructed instance.
In another possible embodiment, the construction rule is a preset program code; correspondingly, the instance constructing device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, including:
the example construction device acquires the preset program code;
the instance construction device determines the configuration parameters as parameter values of corresponding type parameters in the preset program codes;
the example construction device instantiates the preset program code through a preset instruction.
In another possible implementation manner, after the instance constructing device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, the instance constructing device further includes:
the example construction device judges whether the example to be constructed is constructed successfully;
if so, the instance construction device generates an instance handle corresponding to the instance to be constructed, and sends the instance handle to the network element, so that the network element calls the instance corresponding to the instance handle according to the instance handle;
if not, the instance construction device sends a first instance construction failure message to the network element, wherein the first instance construction failure message comprises the identifier of the instance to be constructed.
In another possible implementation manner, before the instance constructing device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, the instance constructing device further includes:
the instance construction device determines a parameter verification result of the configuration parameter according to the parameter format and the parameter value of the configuration parameter;
and the example construction device determines that the parameter checking result is in a normal state.
In another possible implementation manner, if the parameter verification result is an abnormal state, the method further includes:
and the instance construction device sends a second instance construction failure message to the network element, wherein the second instance construction failure message comprises the identifier of the instance to be constructed and the parameter verification result.
In a second aspect, an embodiment of the present invention provides an example building apparatus, including:
the receiving module is used for receiving an instance construction request sent by a network element, wherein the instance construction request comprises an identifier of an instance to be constructed;
an obtaining module, configured to obtain a configuration data source corresponding to the network element, and obtain a configuration parameter corresponding to the identifier of the instance to be constructed in the configuration data source;
and the construction module is used for constructing the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed.
In a possible implementation manner, the obtaining module is specifically configured to:
acquiring the parameter type of the parameter to be configured corresponding to the instance to be constructed;
judging whether the configuration data source has the configuration parameters corresponding to the parameter types;
if so, determining the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the example to be constructed;
if not, acquiring default configuration parameters corresponding to the to-be-constructed example, and determining the default configuration parameters as the configuration parameters corresponding to the identifier of the to-be-constructed example.
In another possible embodiment, the construction rule is a preset program code; correspondingly, the building module is specifically configured to:
acquiring the preset program code;
determining the configuration parameters as parameter values of corresponding type parameters in the preset program codes;
instantiating the preset program code through a preset instruction.
In another possible implementation manner, the apparatus further includes a judging module, a generating module and a sending module, wherein,
the judging module is used for judging whether the construction of the example to be constructed is successful or not after the construction module constructs the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed;
the generating module is configured to generate an instance handle corresponding to the to-be-constructed instance when the determining module determines that the to-be-constructed instance is successfully constructed, and the sending module is configured to send the instance handle to the network element, so that the network element calls an instance corresponding to the instance handle according to the instance handle;
the sending module is further configured to send a first instance construction failure message to the network element when the determining module determines that the to-be-constructed instance is not successfully constructed, where the first instance construction failure message includes an identifier of the to-be-constructed instance.
In another possible embodiment, the apparatus further comprises a determination module, wherein,
the determining module is configured to determine a parameter verification result of the configuration parameter according to a parameter format and a parameter value of the configuration parameter before the constructing module constructs the to-be-constructed instance according to the configuration parameter and the construction rule corresponding to the to-be-constructed instance, and determine that the parameter verification result is in a normal state.
In another possible implementation manner, if the determining module determines that the parameter verification result is in an abnormal state, correspondingly, the sending module is further configured to send a second instance construction failure message to the network element, where the second instance construction failure message includes the identifier of the instance to be constructed and the parameter verification result.
In a third aspect, an embodiment of the present invention provides a software system, where the software system includes a network element and the instance building apparatus described in any one of the second aspects.
According to the example construction method, the example construction device and the software system provided by the embodiment of the invention, after the example construction device receives the example construction request which is sent by the network element and comprises the identification of the example to be constructed, the example construction device obtains the configuration data source corresponding to the network element, determines the configuration parameters corresponding to the identification of the example to be constructed in the configuration data source, and constructs the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed. In the process, the instance construction device constructs the instance for the network element, and the network element does not need to carry out the instance construction, so that the network element does not need to have the function of constructing the instance, and the development process of the network element is further simplified. Furthermore, the instance building device and the network element are completely decoupled, and have no dependency relationship with each other, so that not only can the convenience of network element deployment be improved, but also the convenience of maintenance of the instance building device can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an application scenario of an example construction method provided by the present invention;
FIG. 2 is a first flowchart of an example construction method provided by the present invention;
FIG. 3 is a schematic flow chart illustrating a method for determining configuration parameters according to the present invention;
FIG. 4 is a second flowchart of an example construction method provided by the present invention;
FIG. 5 is a first schematic structural diagram of an example building apparatus according to the present invention;
FIG. 6 is a second schematic structural diagram of an example building apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic view of an application scenario of the example construction method provided by the present invention, please refer to fig. 1, where a software system includes a plurality of network elements (respectively denoted as 101-1 to 101-N), an example construction device 102, and a service library 103. Wherein, the service library 103 includes a plurality of services, and when a network element needs to use one service in the service library 103, the network element may request the instance construction apparatus 103 to construct an instance corresponding to the service for the network element, and use the constructed instance, where the constructed instance and the service have the same function. In the application, the instance construction device 102 can construct an instance for each network element, and each network element does not need to perform instance construction, so that the network element does not need to have the function of constructing the instance, and the development process of the network element is simplified; further, the instance building apparatus 102 and each network element are completely decoupled, and there is no dependency relationship therebetween, which not only can improve convenience of network element deployment, but also can improve convenience of maintenance of the instance building apparatus. The technical means shown in the present application will be described in detail below with reference to specific examples.
It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 2 is a first schematic flow chart of an example construction method provided by the present invention, please refer to fig. 2, which may include:
s201, an instance construction device receives an instance construction request sent by a network element, wherein the instance construction request comprises an identifier of an instance to be constructed;
s202, an example construction device obtains a configuration data source corresponding to a network element, and obtains configuration parameters corresponding to the identification of an example to be constructed from the configuration data source;
and S203, the example building device builds the example to be built according to the configuration parameters and the building rules corresponding to the example to be built.
In the embodiment of the present invention, when the software system is initialized, each network element in the software system needs to be initialized, and when each network element is initialized, the corresponding instance needs to be constructed for the network element. During the operation of the network element, it may also be necessary to construct a corresponding instance for the network element. Of course, the example constructing apparatus may also be used to construct the example for the network element in other application scenarios, and the application scenario in which the example constructing apparatus constructs the example for the network element is not specifically limited in the present invention.
It should be noted that the process of constructing the instance for each network element in the software system by the instance constructing apparatus is the same. The example construction method shown in the present application is described in detail below by taking an example of a process in which an example construction apparatus constructs an example for any network element in a software system.
In an actual application process, when a network element needs to perform instance construction, the network element sends an instance construction request to an instance construction device, wherein the instance construction request includes an identifier of an instance to be constructed, and the instance construction request is used for requesting the instance construction device to construct the instance to be constructed. Of course, the identity of the network element may also be included in the instance build request. Optionally, the network element may be an authentication network element, a relay network element, or the like, and when the network element is the authentication network element, the example to be constructed may include: obtaining an example of authentication Tonken, obtaining an example of specific network element information, an example of interaction with a cache layer, a database connection pool example and the like.
After the instance construction device receives the instance construction request, the instance construction device obtains a configuration data source corresponding to the network element. The configuration data source includes a plurality of configuration parameters corresponding to the Network element, and optionally, data in the configuration data source may be from a preset configuration file, a database, and a Network Management System (NMS for short), and of course, in an actual application process, in an operation process of the Network element, the configuration data source corresponding to the Network element may also be dynamically changed according to actual needs. Optionally, the configuration parameters may include an Internet Protocol (IP) address, a port number, a connection string, connection pool configuration information, and the like of the backend server. Optionally, the configuration data source corresponding to the network element may be stored in the configuration file corresponding to the network element, so that the instance building apparatus may obtain the configuration data source from the configuration file corresponding to the network element.
After the instance construction device obtains the configuration data source corresponding to the network element, the instance construction device determines the configuration parameters corresponding to the identifier of the instance to be constructed in the configuration data source. Optionally, the example constructing device may preset a corresponding relationship between the identifier of the example and the constructing rule, so that the example constructing device may obtain the constructing rule corresponding to the example to be constructed according to the corresponding relationship. The construction rule may be a method for constructing an instance to be constructed, and optionally, the construction method may be implemented by a function instruction, a factory method, a factory class instance, and the like. For example, when the programming language used by the software system is the C + + or Java language, the build rules may be classes implemented by program code.
And the example construction device constructs the example to be constructed according to the acquired configuration parameters and the construction rules corresponding to the example to be constructed. Optionally, when the construction rule is a preset program code, the example construction device may obtain the preset program code, determine the configuration parameter as a parameter value of a corresponding type parameter in the preset program code, and instantiate the preset program code through a preset instruction, so as to construct the example to be constructed.
After the instance construction device completes construction of an instance, the instance construction device may generate an instance handle corresponding to the instance to be constructed, and send the instance handle to the network element, so that the network element calls the instance corresponding to the instance handle according to the instance handle.
The method shown in the embodiment of fig. 2 is described in detail below by way of specific examples.
Illustratively, it is assumed that, when the network element 1 needs to construct the instance 1, the network element 1 sends an instance construction request to the instance construction apparatus, where the instance construction request includes an identifier of the instance 1.
After the instance construction device receives the instance construction request sent by the network element 1, the instance construction device obtains a configuration data source corresponding to the network element 1, and obtains configuration parameters corresponding to the instance 1 from the configuration data source corresponding to the network element 1, assuming that the configuration parameters are: maximum connection number 5, connection string: kla, port number: 145.
the example construction device also obtains a construction rule corresponding to example 1, and the construction rule corresponding to example 1 is assumed as follows:
class A
{
public:
A(int b,char c,long d);
~A();
}
the construction rule is a class realized through a C + + language, A (int b, char C, long d) is a construction function of the class, and the construction function is called by default when the class is instantiated; b, c and d in the constructor a are parameters which need to be transferred to the constructor, and the constructor can realize a certain preset function, and specific implementation of the constructor is not described here. The instance construction device can instantiate the class according to the preset instruction to obtain an object, and the object is an instance. Specifically, the instance construction apparatus takes the obtained configuration parameter (5, kla, 145) as a transfer parameter, and instantiates the class, specifically: a a (5, kla, 145), where instantiated a is an instance.
After the instantiation building device obtains the instantiated object a, a handle of the object a is generated, and the handle of the object a is sent to the network element 1, so that the network element 1 can call the object a according to the handle of the object a.
In the instance construction method provided by the embodiment of the present invention, after the instance construction device receives an instance construction request including an identifier of an instance to be constructed, which is sent by a network element, the instance construction device obtains a configuration data source corresponding to the network element, determines a configuration parameter corresponding to the identifier of the instance to be constructed in the configuration data source, and constructs the instance to be constructed according to the configuration parameter and a construction rule corresponding to the instance to be constructed. In the process, the instance construction device constructs the instance for the network element, and the network element does not need to carry out the instance construction, so that the network element does not need to have the function of constructing the instance, and the development process of the network element is further simplified. Furthermore, the instance building device and the network element are completely decoupled, and have no dependency relationship with each other, so that not only can the convenience of network element deployment be improved, but also the convenience of maintenance of the instance building device can be improved.
On the basis of the embodiment shown in fig. 2, optionally, the instance construction apparatus may determine, in the configuration data source, the configuration parameter corresponding to the identifier of the instance to be constructed through the following feasible implementation manner (S202 in the embodiment shown in fig. 2), specifically, please refer to the embodiment shown in fig. 3.
Fig. 3 is a schematic flow chart of a method for determining configuration parameters according to the present invention, please refer to fig. 3, where the method may include:
s301, the instance construction device obtains the parameter type of the parameter to be configured corresponding to the instance to be constructed;
s302, the example construction device judges whether a configuration parameter corresponding to the parameter type exists in the configuration data source;
if yes, executing S303;
if not, executing S304;
s303, the example construction device determines the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the example to be constructed;
s304, the example constructing device obtains the default configuration parameters corresponding to the examples to be constructed, and determines the default configuration parameters as the configuration parameters corresponding to the identifiers of the examples to be constructed.
In the embodiment shown in fig. 3, when the instance building apparatus needs to obtain the to-be-configured parameter corresponding to the to-be-built instance, the instance building apparatus first obtains a parameter type of the to-be-configured parameter corresponding to the to-be-built instance, and optionally, the parameter type of the to-be-configured parameter may include an IP address, a port number, and the like of the background service.
The example construction device judges whether the configuration data source corresponding to the network element has the configuration parameters corresponding to the parameter types of the parameters to be configured, if so, the example construction device determines the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the example to be constructed; if not, the example constructing device acquires the default configuration parameters corresponding to the example to be constructed, and determines the default configuration parameters as the configuration parameters corresponding to the identifier of the example to be constructed. Optionally, in the actual application process, the default parameters corresponding to the to-be-constructed instance may be set according to actual needs, so that it is avoided that the to-be-constructed instance is failed to be constructed due to the fact that the configuration parameters of the to-be-constructed instance are not obtained, and certainly, in order to ensure that the instance constructed according to the default parameters can normally operate, the default parameters may be set only for part of the parameter types of the to-be-constructed instance.
The method shown in the embodiment of fig. 3 is described in detail below by way of specific examples.
For example, assume that an example to be constructed is example 1, and assume that the parameter type corresponding to example 1 and the default value corresponding to each parameter type are shown in table 1:
TABLE 1
Type of parameter Default value
IP address /
Port number /
Maximum number of connections 10
Heartbeat parameter (tcp _ keepalive _ intvl) 75
Further, it is assumed that the parameter types in the configuration data source corresponding to the network element and the parameter values corresponding to each parameter type are shown in table 2:
TABLE 2
Figure GDA0002274796390000091
The example construction device acquires the parameter type corresponding to the example 1: the instance construction device judges that the configuration data source corresponding to the network element comprises the configuration parameters corresponding to the IP address, the port number and the maximum connection number, and then obtains the configuration parameters corresponding to the IP address, the port number and the maximum connection number from the configuration data source shown in the table 2; the example construction device determines that the configuration data source shown in table 2 does not include the heartbeat parameter (tcp _ heartbeat _ intvl), and then the example construction device determines the default heartbeat parameter in table 1 as the heartbeat parameter of example 1, specifically, the configuration parameter corresponding to the example determined by the example construction device is shown in table 3:
TABLE 3
Type of parameter Default value
IP address 123.139.1.1
Port number 135
Maximum number of connections 12
Heartbeat parameter (tcp _ keepalive _ intvl) 75
In the process, the default parameters are set for the to-be-constructed instance, so that the problem that the to-be-constructed instance is constructed unsuccessfully due to the fact that the instance construction device cannot acquire the configuration parameters of the to-be-constructed instance can be solved.
On the basis of any one of the above embodiments, optionally, in order to improve the efficiency of instance construction, before the instance construction device constructs the instance to be constructed according to the configuration parameters and the construction rules, the configuration parameters may be checked first, and when the configuration parameters are correct, the instance to be constructed is constructed. Specifically, please refer to the embodiment shown in fig. 4.
Fig. 4 is a second flowchart of an example construction method provided by the present invention, please refer to fig. 4, which may include:
s401, an instance construction device receives an instance construction request sent by a network element, wherein the instance construction request comprises an identifier of an instance to be constructed;
s402, the example construction device obtains a configuration data source corresponding to the network element, and obtains configuration parameters corresponding to the identification of the example to be constructed in the configuration data source;
s403, the instance construction device determines a parameter verification result of the configuration parameter according to the parameter format and the parameter value of the configuration parameter;
s404, the example construction device judges whether the parameter checking result is in a normal state;
if yes, executing S405-S407;
if not, executing S409;
s405, the instance construction device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed;
s406, the example construction device judges whether the construction of the example to be constructed is successful;
if yes, executing S407;
if not, executing S408;
s407, the instance construction device generates an instance handle corresponding to the to-be-constructed instance, and sends the instance handle to the network element, so that the network element calls the instance corresponding to the instance handle according to the instance handle;
s408, the example construction device sends a first example construction failure message to the network element, wherein the first example construction failure message comprises the identification of the example to be constructed;
s409, the example construction device sends a second example construction failure message to the network element, wherein the second example construction failure message comprises the identifier of the example to be constructed and the parameter verification result.
S401-S402 are the same as S201-S202 and are not described in detail here.
After the example construction device obtains the configuration parameters, the example construction device determines the parameter verification result of the configuration parameters according to the parameter format and the parameter value of the configuration parameters, and judges whether the parameter verification structure is in a normal state or not; optionally, if the parameter format of the configuration parameter is correct and the parameter value is within the preset range, it may be determined that the parameter verification result is in a normal state, otherwise, it is determined that the parameter verification structure is in an abnormal state.
And if the parameter verification result is judged to be in an abnormal state by the example construction device, sending a second example construction failure message to the network element, wherein the second example construction failure message comprises the identifier of the example to be constructed and the parameter verification result, so that the user can adjust the configuration parameters according to the second example construction failure message.
And if the example construction device judges that the parameter verification result is in an abnormal state, the example construction device constructs the example to be constructed according to the configuration parameters and the construction rules corresponding to the example to be constructed, and judges whether the example to be constructed is constructed successfully. Optionally, the example constructing apparatus may determine syntax and semantics of the constructed case to determine whether the construction of the example to be constructed is successful, and of course, the example constructing apparatus may also call other tools to determine whether the construction of the example to be constructed is successful.
If the instance construction device successfully constructs the instance to be constructed, the instance construction device generates an instance handle corresponding to the instance to be constructed, and sends the instance handle to the network element, so that the network element calls the instance corresponding to the instance handle according to the instance handle; if the instance construction device fails to construct the instance to be constructed, the instance construction device sends a first instance construction failure message to the network element, wherein the first instance construction failure message comprises the identifier of the instance to be constructed.
In the process, the instance construction device unifies all the network element construction instances in the software system, so that the instance construction device can be unified to carry out upgrading maintenance on the instance construction in the process of constructing all the instances; furthermore, because the instance building device and the network element are completely decoupled, and have no dependency relationship with each other, when the instance building process is changed, the network element does not need to be changed, and the convenience of maintaining the instance building is further improved.
Fig. 5 is a schematic structural diagram of an example building apparatus provided in the present invention, referring to fig. 5, the apparatus may include:
a receiving module 501, configured to receive an instance construction request sent by a network element, where the instance construction request includes an identifier of an instance to be constructed;
an obtaining module 502, configured to obtain a configuration data source corresponding to the network element, and obtain a configuration parameter corresponding to the identifier of the to-be-constructed instance from the configuration data source;
a constructing module 503, configured to construct the to-be-constructed instance according to the configuration parameters and the construction rules corresponding to the to-be-constructed instance.
The example construction apparatus shown in the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
In a possible implementation manner, the obtaining module 502 is specifically configured to:
acquiring the parameter type of the parameter to be configured corresponding to the instance to be constructed;
judging whether the configuration data source has the configuration parameters corresponding to the parameter types;
if so, determining the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the example to be constructed;
if not, acquiring default configuration parameters corresponding to the to-be-constructed example, and determining the default configuration parameters as the configuration parameters corresponding to the identifier of the to-be-constructed example.
In another possible embodiment, the construction rule is a preset program code; correspondingly, the building module 503 is specifically configured to:
acquiring the preset program code;
determining the configuration parameters as parameter values of corresponding type parameters in the preset program codes;
instantiating the preset program code through a preset instruction.
Fig. 6 is a schematic structural diagram of an example construction apparatus provided by the present invention, referring to fig. 6 on the basis of the embodiment shown in fig. 5, the apparatus further includes a determining module 504, a generating module 505, and a sending module 506, wherein,
the determining module 504 is configured to determine whether the to-be-constructed instance is successfully constructed after the constructing module 503 constructs the to-be-constructed instance according to the configuration parameters and the construction rules corresponding to the to-be-constructed instance;
the generating module 505 is configured to generate an instance handle corresponding to the to-be-constructed instance when the determining module 504 determines that the to-be-constructed instance is successfully constructed, and the sending module 506 is configured to send the instance handle to the network element, so that the network element calls an instance corresponding to the instance handle according to the instance handle;
the sending module 506 is further configured to send a first instance construction failure message to the network element when the determining module 504 determines that the to-be-constructed instance is not successfully constructed, where the first instance construction failure message includes an identifier of the to-be-constructed instance.
In another possible embodiment, the apparatus further comprises a determining module 507, wherein,
the determining module 507 is configured to determine a parameter verification result of the configuration parameter according to the parameter format and the parameter value of the configuration parameter before the constructing module 503 constructs the to-be-constructed instance according to the configuration parameter and the construction rule corresponding to the to-be-constructed instance, and determine that the parameter verification result is in a normal state.
In another possible implementation manner, if the determining module 507 determines that the parameter checking result is in an abnormal state, correspondingly, the sending module 506 is further configured to send a second instance construction failure message to the network element, where the second instance construction failure message includes the identifier of the instance to be constructed and the parameter checking result.
The example construction apparatus shown in the embodiment of the present invention may execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar and will not be described herein again.
An embodiment of the present invention further provides a software system, where the software system includes a network element and the example constructing apparatus described in any of the embodiments of fig. 5 to 6. It should be noted that the structure, implementation principle, and achievable benefits of the example construction apparatus included in the software system are similar to those of the example construction apparatus described in any of the embodiments of fig. 5 to 6, and are not described again here.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. An example construction method is applied to a software system, wherein the software system comprises an example construction device and a plurality of network elements, and the method comprises the following steps:
the example construction device receives an example construction request sent by a network element, wherein the example construction request comprises an identifier of an example to be constructed, the example to be constructed is an example corresponding to a service to be used by the network element, and the network element is any one of a plurality of network elements in the software system;
the instance construction device acquires a configuration data source corresponding to the network element, and acquires configuration parameters corresponding to the identifier of the instance to be constructed from the configuration data source;
the instance building device builds the instance to be built according to the configuration parameters and the building rules corresponding to the instance to be built;
the example constructing device obtains the configuration parameters corresponding to the identifier of the example to be constructed in the configuration data source, and the method comprises the following steps:
the instance construction device acquires the parameter type of the parameter to be configured corresponding to the instance to be constructed;
the example construction device judges whether the configuration data source has the configuration parameters corresponding to the parameter types;
if so, the instance construction device determines the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the instance to be constructed;
if not, the instance construction device acquires default configuration parameters corresponding to the to-be-constructed instance, and determines the default configuration parameters as the configuration parameters corresponding to the identifier of the to-be-constructed instance.
2. The method of claim 1, wherein the construction rule is a predetermined program code; correspondingly, the instance constructing device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, including:
the example construction device acquires the preset program code;
the instance construction device determines the configuration parameters as parameter values of corresponding type parameters in the preset program codes;
the example construction device instantiates the preset program code through a preset instruction.
3. The method according to any one of claims 1-2, wherein after the instance construction device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, the method further comprises:
the example construction device judges whether the example to be constructed is constructed successfully;
if so, the instance construction device generates an instance handle corresponding to the instance to be constructed, and sends the instance handle to the network element, so that the network element calls the instance corresponding to the instance handle according to the instance handle;
if not, the instance construction device sends a first instance construction failure message to the network element, wherein the first instance construction failure message comprises the identifier of the instance to be constructed.
4. The method according to any one of claims 1-2, wherein before the instance construction device constructs the instance to be constructed according to the configuration parameters and the construction rules corresponding to the instance to be constructed, the method further comprises:
the instance construction device determines a parameter verification result of the configuration parameter according to the parameter format and the parameter value of the configuration parameter;
and the example construction device determines that the parameter checking result is in a normal state.
5. The method of claim 4, wherein if the parameter check result is an abnormal state, the method further comprises:
and the instance construction device sends a second instance construction failure message to the network element, wherein the second instance construction failure message comprises the identifier of the instance to be constructed and the parameter verification result.
6. An example construction apparatus applied to a software system, the software system further including a plurality of network elements, the example construction apparatus comprising:
a receiving module, configured to receive an instance construction request sent by a network element, where the instance construction request includes an identifier of an instance to be constructed, the instance to be constructed is an instance corresponding to a service to be used by the network element, and the network element is any one of multiple network elements in the software system;
an obtaining module, configured to obtain a configuration data source corresponding to the network element, and obtain a configuration parameter corresponding to the identifier of the instance to be constructed in the configuration data source;
the building module is used for building the example to be built according to the configuration parameters and the building rules corresponding to the example to be built;
the acquisition module is specifically configured to:
acquiring the parameter type of the parameter to be configured corresponding to the instance to be constructed;
judging whether the configuration data source has the configuration parameters corresponding to the parameter types;
if so, determining the configuration parameters in the configuration data source as the configuration parameters corresponding to the identifier of the example to be constructed;
if not, acquiring default configuration parameters corresponding to the to-be-constructed example, and determining the default configuration parameters as the configuration parameters corresponding to the identifier of the to-be-constructed example.
7. The apparatus of claim 6, wherein the construction rule is a preset program code; correspondingly, the building module is specifically configured to:
acquiring the preset program code;
determining the configuration parameters as parameter values of corresponding type parameters in the preset program codes;
instantiating the preset program code through a preset instruction.
8. A software system, characterized in that it comprises a network element and the instance construction means of any of claims 6-7.
CN201610805697.9A 2016-09-07 2016-09-07 Instance construction method and device and software system Active CN106446355B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610805697.9A CN106446355B (en) 2016-09-07 2016-09-07 Instance construction method and device and software system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610805697.9A CN106446355B (en) 2016-09-07 2016-09-07 Instance construction method and device and software system

Publications (2)

Publication Number Publication Date
CN106446355A CN106446355A (en) 2017-02-22
CN106446355B true CN106446355B (en) 2020-03-20

Family

ID=58164036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610805697.9A Active CN106446355B (en) 2016-09-07 2016-09-07 Instance construction method and device and software system

Country Status (1)

Country Link
CN (1) CN106446355B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102007055729A1 (en) * 2006-12-08 2008-06-19 Toyota Jidosha Kabushiki Kaisha, Toyota Control device for a vehicle drive system
CN101217521A (en) * 2008-01-08 2008-07-09 北京邮电大学 A semantic telecommunication network capability service gateway component, network system and work method
CN101553033A (en) * 2009-04-14 2009-10-07 中国联合网络通信集团有限公司 A pool management method and system
CN101754055A (en) * 2008-12-05 2010-06-23 华为技术有限公司 Automatic network element ID setting method, ID management server and agent network element
CN104079436A (en) * 2014-07-14 2014-10-01 武汉大学 Cross-device and cross-protocol EPON element management system
CN104881733A (en) * 2015-05-08 2015-09-02 南车青岛四方机车车辆股份有限公司 Method and device for instantiating structure tree of high-speed train

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102007055729A1 (en) * 2006-12-08 2008-06-19 Toyota Jidosha Kabushiki Kaisha, Toyota Control device for a vehicle drive system
CN101217521A (en) * 2008-01-08 2008-07-09 北京邮电大学 A semantic telecommunication network capability service gateway component, network system and work method
CN101754055A (en) * 2008-12-05 2010-06-23 华为技术有限公司 Automatic network element ID setting method, ID management server and agent network element
CN101553033A (en) * 2009-04-14 2009-10-07 中国联合网络通信集团有限公司 A pool management method and system
CN104079436A (en) * 2014-07-14 2014-10-01 武汉大学 Cross-device and cross-protocol EPON element management system
CN104881733A (en) * 2015-05-08 2015-09-02 南车青岛四方机车车辆股份有限公司 Method and device for instantiating structure tree of high-speed train

Also Published As

Publication number Publication date
CN106446355A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN111258725B (en) Data processing method, device, equipment and medium based on block chain
WO2019184164A1 (en) Method for automatically deploying kubernetes worker node, device, terminal apparatus, and readable storage medium
US11693642B2 (en) Method and system for cross-platform deployment
CN108696381B (en) Protocol configuration method and device
CN111181991B (en) Method and device for constructing terminal access platform of Internet of things
CN110224860B (en) Load balancing application creation method and device, computer equipment and storage medium
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
US20170163478A1 (en) Method,electronic device and system for updating client configuration in key-value pair database
CN106911648B (en) Environment isolation method and equipment
US11831727B2 (en) Profile based content and services
CN110933095A (en) Message parsing method and device
CN108306844B (en) Method for API communication between server and client
CN111290742A (en) Parameter verification method and device, electronic equipment and readable storage medium
CN110677383A (en) Firewall opening method and device, storage medium and computer equipment
US11245709B2 (en) Multi-verifier approach for attestation of nodes in a network
Aslam et al. Service provisioning for the WSN cloud
US8719622B2 (en) Recording and preventing crash in an appliance
CN113330419A (en) Equipment application installation method and device
US9832198B2 (en) Service-based message access layer frame and implementation method thereof
CN111082953B (en) Configuration method, device and related equipment
CN113641388A (en) Cloud mobile phone updating method, related device and computer program product
CN106446355B (en) Instance construction method and device and software system
CN112217693B (en) Controller testing method and device, electronic equipment and storage medium
CN113641518A (en) Service calling method, device and storage medium
CN113821267A (en) Configuration file processing method, control terminal and management terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Patentee after: Hisense Video Technology Co., Ltd

Address before: 266555 Qingdao economic and Technological Development Zone, Shandong, Hong Kong Road, No. 218

Patentee before: HISENSE ELECTRIC Co.,Ltd.

CP01 Change in the name or title of a patent holder