System construction device
Through the system construction device that detects system changes in the execution environment and reflects them in the source code, it solves the problem of inconsistent system configuration when the user does not change the source code, realizes the correction and management of unified coding rules, and facilitates system construction and understanding.
Patent Information
- Application Number
- CN202380019637.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-05-13
- Filing Date
- 2023-04-18
- Publication Date
- 2024-09-10
AI Technical Summary
When users change the system structure without changing the source code, there is a problem that the source code of the object system is inconsistent with the structure, and the coding rules lack consistency, making it difficult to effectively manage and understand.
A system construction device is designed, which includes an input unit, a system source code production unit, a deployment unit, a setting change detection unit, and a setting change reflection unit. It detects system setting changes in the execution environment and compiles them according to coding rules. The differences are reflected in the source code, and the differences in system construction information are corrected with unified coding rules.
It realizes the unified coding rules to correct the differences between the system construction information and the changes after the system construction information without changing the system construction information, improves the consistency and management convenience of the source code, and reduces the man-hours of manual design and modification.
Smart Images

Figure CN118633076A
Abstract
Description
Technical Field
[0001] The present invention relates to a system construction device for constructing a system on a predetermined execution environment. Background Art
[0002] In recent years, with the development of cloud computing technology, the virtualization of IT (Information Technology) resources has been advancing. As a result of such technological development, the automatic construction technology of IaC (Infrastructure as Code) systems that effectively utilize virtualization technologies such as virtual servers and containers and deploy systems based on source code and setting files has attracted attention.
[0003] According to the technology of Patent Document 1, a technology is disclosed for automating the deployment of resources by converting a specification sheet describing system requirements into source code. Prior art literature Patent Literature
[0004] Patent Document 1: Japanese Patent Laid-Open No. 2021-157612 Patent Document 2: Japanese Patent Laid-Open No. 2021-140372 Summary of the invention Problem that the invention aims to solve
[0005] By using the technology described in Patent Document 1, even if the user has no coding knowledge, the system can be automatically constructed according to the system requirements. On the other hand, when the user changes the configuration of the deployed system without changing the source code, there is a problem that the source code of the target system is different from the configuration of the target system.
[0006] Regarding this problem, Patent Document 2 describes a technology for detecting whether or not there is a change in system settings and reflecting the detected change in settings in source code.
[0007] Patent Document 2 monitors the devices of the target system. For changes such as adding new devices to the system, there is a problem that the changes cannot be reflected in the source code. In addition, the writing method of the source code, that is, the coding rules, are mostly different for each user. Therefore, depending on the different methods of reflecting the source code, the coding rules of the revised source code may lack consistency. Therefore, in order to make the management of the source code and the understanding of the user easier, the source code must be revised in a consistent manner after reflection.
[0008] The present invention is made in view of the above problems, and its purpose is to correct the difference between the source code and the system configuration in a form consistent with the user's writing, including adding new resources to the system when the user changes the system configuration without changing the source code. Technical means of solving problems
[0009] The system construction device of the present invention is a system construction device that constructs a system including infrastructure resources and setting values of the infrastructure resources on a specified execution environment, and comprises: an input unit that inputs requirements for system construction that meet desired requirements; a system source code production unit that produces a first source code, wherein the first source code defines the system that meets the desired requirements; a deployment unit that deploys and constructs the system on the execution environment according to the requirements; a setting change detection unit that detects the difference between a second source code and a first source code that define the system after the change when a change occurs to the system constructed on the execution environment; and a setting change reflection unit that causes the difference detected by the setting change detection unit to be reflected in the first source code; the setting change reflection unit causes the difference to be reflected in the first source code according to a coding rule applied to the first source code. Effects of the Invention
[0010] According to the system construction device of the present invention, when a user changes the system configuration without changing the system construction information, the difference between the original system construction information and the changed system configuration can be corrected in a format with unified coding rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 This is a diagram showing the hardware configuration of the system construction device 100 according to the first embodiment. Figure 2 This is a functional block diagram of the system construction device 100 of the first embodiment. Figure 3 This is a flowchart of the process executed by the system construction device 100 of the first embodiment. Figure 4 For explanation Figure 3 FIG. 4 is a diagram of a specific example of step S101 in the flowchart of FIG. Figure 5A For explanation Figure 3 FIG. 1 is a diagram of a specific example of step S102 in the flowchart of FIG. Figure 5B For explanation Figure 3 FIG. 4 is a diagram of a specific example of step S103 in the flowchart of FIG. Figure 5C For explanation Figure 3 FIG. 4 is a diagram of a specific example of step S103 in the flowchart of FIG. Figure 6 To express Figure 3 FIG. 1 is a diagram showing an example of system source code involved in the deployment processing of step S104 and step S105. Figure 7 For explanation Figure 3 A flowchart of a specific example of steps S106 and S107 in the flowchart of FIG. Figure 8 For Figure 7 The figure illustrates a specific example of the determination method of the original setting value 282 referred to in step S202 in the flowchart. Fig. 9 For explanation Figure 7 A flowchart of a specific example of step S209 in the flowchart of FIG. Fig.10 This is a flowchart of the process executed by the system construction device 100 of the second embodiment. DETAILED DESCRIPTION
[0012] <Example 1> Figure 1 An example of the hardware configuration of the system construction device 100 of this embodiment is shown. Figure 1 As shown, the system construction device 100 includes hardware such as a computing device 110 , a storage device 120 , an input / output I / F (Interface) 130 , and a communication I / F (Interface) 140 .
[0013] The computing device 110 is, for example, a CPU (Central Processing Unit), and various functions described below are performed through processing performed by the CPU.
[0014] The storage device 120 includes, for example, a RAM (Random Access Memory) and a ROM (Read Only Memory), and stores data used by the computing device 110 .
[0015] The input / output I / F 130 is, for example, a display having a touch panel function, and displays the processing results given by the computing device 110 and a user interface of a portal screen 210 described later on the screen.
[0016] The communication I / F 140 is, for example, a communication chip or a NIC (Network Interface Card), and is used for communication with an execution environment 280 or a user 201 described later.
[0017] When each unit of the system construction device 100 receives data, the unit may receive the data via the input / output I / F 130 , or may receive the data via the communication I / F 140 .
[0018] Figure 2 This is a functional block diagram showing an example of the configuration of each functional unit of the system construction device 100. The system construction device 100 includes a portal screen 210, a repository 220, a system source code creation unit 230, a deployment unit 240, a configuration change detection unit 250, a configuration change reflection unit 260, and a coding rule storage unit 270.
[0019] In this embodiment, the source code of the template 221 and the module 222 for deployment is pre-registered in the designated repository 220. Examples of the repository 220 include GitHub (https: / / github.com / ) for cloud services and GitLab for OSS. Figure 6 This will be described later.
[0020] in addition, Figure 2 Although an example is shown in which a plurality of templates 221 and modules 222 are managed in one repository 220, the repository 220 may be divided for each source code corresponding to each of a plurality of projects.
[0021] Here, the so-called source code is a code that is effectively used to construct a specific system 281. For example, not only does one system 281 correspond to the configuration of one template 221, but a set of functions that constitute a part of the system 281, that is, a module 222, is also included in the source code. In this case, a plurality of modules 222 are combined to create a system source code for one system 281. In addition, the source code used to construct the system 281, that is, the template 221 or the module 222, and the entity or reference of the system source code are included in the various information managed and displayed in the present device 100.
[0022] The system construction device 100 displays a portal screen 210 on a display device (not shown) for the user 201 of the system construction device 100. Figure 4 5 will be described later. In addition, the portal screen 210 is equipped with a CPU (not shown), and presents system candidates according to the user's selection from the templates 221 and modules 222 in the repository 220 as described later.
[0023] The user 201 uses the portal screen 210 to select the system 281 that he wants to build this time. For example, the user 201 inputs the functional requirements and non-functional requirements of the cloud service, and a pre-prepared template 221 is presented. The template 221 is a service that combines public cloud services, private cloud services, etc. that meet each requirement based on past performance.
[0024] The non-functional requirements may include network-related requirements. Examples of network-related requirements include whether a public IP is used, whether a firewall is used, and whether an encryption function is used, but the non-functional requirements are not limited to these and may include various network-related requirements.
[0025] The functional requirements may include information indicating whether the execution environment 280 to be used is one of a plurality of clouds. In addition to the above requirements, the functional requirements may include various requirements related to the purpose of the system 281 and the infrastructure.
[0026] Thereafter, each infrastructure resource 283 of the presented template 221 is customized by changing it to another infrastructure resource 283 that can realize the same function or by adding or deleting infrastructure resources 283. After customization, setting values 282 required for deployment of each infrastructure resource 283 are input from a parameter table or the like, thereby selecting a system 281 to be constructed.
[0027] When the user 201 selects a system 281 to be constructed, the system source code creation unit 230 creates a system source code using the template 221 and the module 222 of the system 281 selected from the repository 220 .
[0028] After the system source code is produced, the deployment unit 240 performs deployment processing on the execution environment 280. The execution environment 280 is an environment for the system 281 to work. The execution environment 280 is, for example, a cluster of IT resources managed by a business process tool such as a public cloud service, a private cloud service, OpenStack, or Kubernetes. In addition, the execution environment 280 for the system 281 selected by the user 201 to work may also be in a form specified by the user 201. In this case, the execution environment 280 may be a different execution environment for each user 201, or may be in a form of a shared execution environment.
[0029] As a result of the deployment process performed by the deployment unit 240, a system 281 including infrastructure resources 283, setting values 282 of the infrastructure resources 283, etc. is constructed based on the system source code in the execution environment 280. Here, the infrastructure resource 283 may be one or more depending on the description of the system source code.
[0030] Then, the user 201 adds the changes required for the constructed system 281 to the execution environment 280 to perform development (changes to the system 281 ) in accordance with the purpose of the user 201 .
[0031] The configuration change detection unit 250 detects whether there is a configuration change of the construction target system 281. When there is a configuration change of the system 281, the configuration change detection unit 250 detects and extracts the configuration change content in the form of a difference between the configuration of the system 281 defined by the system source code created by the system source code creation unit 230 and the current system 281 in the execution environment.
[0032] The setting change reflecting unit 260 reflects the difference detected by the setting change detecting unit 250 in the system source code generated by the system source code generating unit 230 according to the coding rule stored in the coding rule storing unit 270. Here, the coding rule may be, for example, a variable name definition in the form of a standard variable name presented by each vendor or a variable such as an ID is not hard-coded.
[0033] In addition, in the following figures and descriptions, the execution environment 280 is illustrated by taking the IaaS (Infrastructure as a Service) public cloud of the public cloud service as an example, the deployment process is illustrated by taking Terraform as an example, and the template 221 and the module 222 are illustrated by taking the source code described in the HCL (HashiCorp Configuration Language) specified by Terraform as an example. However, the present embodiment is not limited to the above configuration. For example, the following combination may also be adopted, that is, the execution environment 280 is Kubernetes, the object constructed in the execution environment 280 is a container, and the deployment process is Helm.
[0034] Figure 3 FIG. 1 is a flowchart showing an example of processing performed by the system construction device 100 in the first embodiment of the present invention. Figure 3 In addition, the following is a description of the steps. Figure 3 The outline of each step shown is explained below, and the details are described later.
[0035] The user 101 inputs desired requirements (functional requirements and non-functional requirements) from the portal screen 210 (step S101 ).
[0036] Candidates of the system 281 that realizes the input functional requirements and non-functional requirements are presented on the portal screen 210 (step 102 ).
[0037] The user 201 inputs information required for deploying the system 281 presented on the portal screen 210 (step S103). The required information is, for example, the setting value 282 of each infrastructure resource 283 included in the system 281. The setting value 282 includes, for example, the name of each infrastructure resource 283, the object of charging the fee generated by the adoption / operation of the infrastructure resource 283, etc. Alternatively, the setting value 282 may be specified by the provider of each infrastructure resource 283. Furthermore, the user 201 may also change each infrastructure resource 283 to another infrastructure resource 283.
[0038] The system source code preparation unit 230 generates system source code by taking as input information of the infrastructure resources 283 included in the system 281 presented on the portal screen 210 and information required for deployment of the system 281 (step S104 ).
[0039] The deployment unit 240 constructs a system 281 on the execution environment 280 using the system source code generated by the system source code creation unit 230 .
[0040] The configuration change detection unit 250 monitors and detects whether the user 201 has directly changed the system 281. When a configuration change is detected, the configuration change detection unit 250 detects and extracts the changed content (step S106). The configuration change detection unit 250 may detect the changed content by any method. The configuration change detection unit 250 may also extract only the difference.
[0041] The configuration change reflection unit 260 refers to the coding rule used by the system source code creation unit 230 and stored in the coding rule storage unit 270, and reflects the difference extracted by the configuration change detection unit 250 in the system source code. The above steps complete the processing.
[0042] Figure 4 For explanation Figure 3 FIG. 2 is a diagram showing a specific example of a screen displayed on the portal screen 210 in step S101. Figure 4 As shown, a requirement input screen 300 is displayed on the portal screen 210. The user 201 selects the purpose to be achieved by the system 281, the availability and performance of the system 281 required, and the network conditions for operating the system on the requirement input screen 300 on the portal screen 210.
[0043] As the purpose to be achieved through system 281, Figure 4The example shown in FIG. 2 shows an example of displaying options such as development type, analysis type, and collaboration type in the service type 301 item. When the user 201 changes the purpose to be achieved through the system 281, the types of infrastructure resources 283 of the system 281 displayed on the portal screen 210 change according to the purpose. As a specific example, when the analysis type is selected, the system 281 is designed to collect data and analyze it. Through such automation, the user 201 can reduce the man-hours usually spent on the design of the system 281. The option is an example, and other options are also possible.
[0044] As availability, Figure 4 Shown in the figure is an example of displaying options such as formal operation and PoC (Proof of Concept) in the item of availability 302. In addition, PoC refers to verification or demonstration in the early stage of trial development for the purpose of verifying new concepts, theories, principles, and ideas. When the user 201 changes the availability, the configuration and setting values 282 of the infrastructure resources 283 of the system 281 displayed on the portal screen 210 change according to the selected availability. As a specific example, when the option of formal operation is selected, the system 281 is designed to be dispersed in multiple areas (such as Tokyo and Osaka), and the system 281 will continue to operate even if a disaster occurs in a certain area. That is, redundancy is guaranteed. The option is an example, and other options are also possible.
[0045] As performance, Figure 4 2 shows an example in which options such as level 1, level 2, and level 3 are displayed in the performance 303 item. When the user 201 changes the performance, the setting value 282 of the infrastructure resource 283 of the system 281 displayed on the portal screen 210 changes according to the performance. As a specific example, when level 3 is selected, the model of the infrastructure resource 283 of the system 281 is set to the most expensive model. The options are just examples, and other options are also possible.
[0046] As a condition of the network, Figure 4 2 shows an example of displaying the item of external connection 304 as having an external connection or not having an external connection. When the user 201 changes the network conditions, the network connection-related infrastructure resources 283 and setting values 282 of the system 281 displayed on the portal screen 210 change according to the network conditions. As a specific example, when the selection is to have an external connection, a firewall is deployed as a network connection infrastructure resource based on the premise of the external connection. The option is an example, and other options are also possible.
[0047] Figure 4 The requirements shown in are just an example, and other requirements may also be used. Figure 4In the system 281, the past system 281 can be displayed as an option instead of the purpose to be achieved by the system 281. In this case, the requirements when the past system 281 was deployed are input.
[0048] Figure 5A To illustrate Figure 3 The system construction device 100 presents the system 281 scheme that realizes the functional requirements and non-functional requirements input in step S101 on the portal screen 210. The user 201 inputs the information required to deploy the system 281 presented on the portal screen 210 (refer to Figure 5B ). Furthermore, the user 201 may also change each infrastructure resource 283 to another infrastructure resource 283.
[0049] Figure 5B For Figure 3 An example of a method of inputting information required for deploying the system 281 presented on the portal screen 210 in step S103. Figure 5A When you select "Parameter Input", the Figure 5B The screen 301 shown. In addition, the present embodiment shows that Figure 5A An example of inputting setting values 282 required for each infrastructure resource 283 by uploading an Excel spreadsheet of various parameters required for deployment of the selected infrastructure resource as a parameter table.
[0050] Figure 5C For Figure 3 An example of changing each service to another service in step S103 in Figure 5A When "Customize" is selected on screen 300 of Figure 5C The screen 320 is shown. This embodiment shows an example of changing the resource storing data. When the user selects another resource, it is changed to the resource selected by the user.
[0051] Figure 6 To express Figure 3 FIG. 1 is a diagram of an example of system source code involved in the deployment process of step S104 and step S105. In this embodiment, a case where Terraform is used as the deployment process is described. Terraform is an open source infrastructure automatic construction tool developed by HashiCorp.
[0052] The template 221 typically includes source code such as main.Tf(400) that defines what infrastructure resources 283 are deployed, a variable file in the form of variables.Tf(410) that defines the variables assigned to each infrastructure resource 283 and the default values of the variables, and a variable input file in the form of auto.input.tfvars(420) that defines the set values 282 of the variables assigned to each infrastructure resource 283.
[0053] For example, description 401 ("resource "aws_s3_bucket" "s3_bucket"") means deploying "aws_s3_bucket" as a resource. Also, description 401 ("bucket="${var.foo}"") means reading description 411 ("variable "foo" {}") defined in variables.Tf(410).
[0054] Furthermore, when deploying, if no value is specified for the variable with the variable key "foo", the default value "foo:1" is used. Also, when deploying, if a value "foo="dev-var" is specified for another value, such as the variable with the variable key "foo" in auto.input.tfvars(420), a description 411 is generated like "foo:"dev-var"".
[0055] Furthermore, the template file can also contain procedural elements such as if statements. Terraform defines procedural elements that can be used to control the number of resources to be built using the count variable. If the value "S3_count = 1" is specified in auto.input.tfvars (420), a "resource "aws_s3_bucket" "s3_bucket"" is generated. Therefore, by Figure 5B The count is controlled by the information entered in and the resource can be customized.
[0056] As described above, the deployment unit 240 deploys the infrastructure resources 283 on the execution environment 280 using the deployment tool according to the system source code generated in step S104 .
[0057] Figure 7 To express Figure 3 A flowchart of an example of a specific processing sequence in step S106 and step S107 in FIG. Figure 7 The following describes each step.
[0058] The setting change detection unit 250 detects that the user 201 has directly changed the system 281 in the execution environment 280 (step S201). Figure 3 When the system 281 is constructed in step S105, the function of exporting the system 281 prepared by the cloud provider in the form of the source code of each cloud provider can be used to obtain the source code that serves as the benchmark, and then the difference between the source code obtained by the export function and the source code that serves as the benchmark is obtained one by one.
[0059] As a method of obtaining the difference, it is ideal to derive it from the environment where each system 281 is built as described above. This is because each cloud provider prepares metadata indicating that the system 281 is the same as a standard, and thus, it is possible to detect the addition of a new device to the system 281. Figure 3 This is achieved by providing metadata indicating that the system 281 is the same when constructing the system 281 in step S105.
[0060] Then, the setting change detection unit 250 checks whether a setting change is detected (step S202). If a setting change is detected, the process proceeds to step S203, and if a setting change is not detected, the process ends.
[0061] When there is a setting change ("Yes" in step S202), the setting change detection unit 250 confirms the type of setting change (step S203). There are two types of setting changes: setting changes related to the infrastructure resource 283 and setting changes related to the setting value 282 of the infrastructure resource 283. The setting changes related to the infrastructure resource 283 include the case of newly adding or deleting an infrastructure resource 283, and the setting change related to the setting value 282 of the infrastructure resource 283 is the case of changing the setting value 282 of the infrastructure resource 283. When a setting change related to the infrastructure resource 283 is detected, the process proceeds to step S207, and when a setting change related to the setting value 282 of the infrastructure resource 283 is detected, the process proceeds to step S204. In addition, the setting value 282 referred to here is Figure 5B Parameters listed in the parameter table shown.
[0062] When the setting change is a change of the setting value 282, the setting change reflection unit 260 confirms whether it is a setting change related to the original setting value 282 (step S204). The so-called original setting value 282 refers to the setting value 282 that has been defined in the system source code. As an example, it is assumed that a VM (Virtual Machine) has been set as an infrastructure resource 283. In addition, the so-called VM refers to a virtual environment that is created on a physical hardware system (the location is a non-local computer room (オフプレミス) or a local computer room (オンプレミス)) and has a unique CPU, memory, network interface, storage unit, and functions as a virtual computer system.
[0063] Furthermore, in the part where VM is defined as the system source code, the size of VM is set to small. Thereafter, when the user 201 manually changes the size of VM to medium, the size of VM is the setting value 282 defined as the system source code, so it is determined to be the original setting value 282. Furthermore, when a setting value that is not defined as the system source code, such as a VM tag, is added, since it is the setting value 282 that is not defined as the system source code, it is determined not to be the original setting value 282. In the case of a setting change related to the original setting value 282, the process proceeds to step S205, and otherwise proceeds to step S206.
[0064] Figure 8 This is a diagram for explaining a specific example of the method for determining the original setting value 282 referred to in step S202. The system construction device 100 has information about which infrastructure resource 283 defines which variable as a system source code. For example, when the infrastructure resource 283 is a VM, it is known that a certain variable is defined in the 1st to 9th lines of the path ". / tempA," of the system source code, and is called in the 10th to 20th lines of the path ". / module" of the system source code. By using this information, the name of the infrastructure resource 283 and its variable name detected in the form of a difference are used as input to search and determine whether it exists in the form of the original setting value 282.
[0065] When a setting change of the existing setting value 282 is detected, the setting change reflecting unit 260 uses the information of which infrastructure resource 283 defines which variable as the system source code to change the current value of the corresponding setting value 282 to the difference setting value. In this way, the setting change can be corrected according to the original coding rule.
[0066] When the setting change of the original parameter cannot be detected, the setting change reflecting unit 260 uses the information of which infrastructure resource 283 defines which variable in the system source code to add the corresponding setting value 282 as a new setting value to the system source code (step S206). Thereafter, the process proceeds to step S205 and sets it as the current setting value 282. In this way, the setting change can be corrected according to the original coding rule.
[0067] In the case where the setting change is a change of the infrastructure resource 283, the setting change reflection unit 260 confirms whether it is a setting change related to the original infrastructure resource 283 (step S207). The so-called original infrastructure resource 283 refers to the infrastructure resource 283 that has been defined in the system source code. As an example, in the case where the infrastructure resource 283 of the VM is defined as the system source code, when the user 201 manually adds another VM, it is judged to be the original infrastructure resource 283. In addition, in the case where a new VM that is not defined as the infrastructure resource 283 is added, it is judged not to be the original infrastructure resource 283. Furthermore, even if the added VM is not included in the existing system source code, it is judged to be the original infrastructure resource 283 when the source code of the infrastructure resource 283 of the VM already exists in the repository 220. In the case of a setting change related to the original resource, proceed to step S208, otherwise proceed to step S209.
[0068] When a setting change of an existing resource is detected ("Yes" in step S207), the setting change reflection unit 260 adds the existing infrastructure resource 283 to the system source code (step S208). As a specific example, the name of the added infrastructure resource 283 obtained in the form of a difference is used to retrieve the source code program of each infrastructure resource 283 pre-registered in the repository 220. Thereafter, the source code program of the determined infrastructure resource 283 is added to the system source code. In addition, the description here is about the addition of the existing resource, but there is also a case where the setting change is the deletion of the resource. In this case, the part of the source code program that defines the corresponding resource can be deleted.
[0069] As described above, the source code program of the system source code includes a portion that defines the infrastructure resources 283 used and a portion that defines and sets the setting values 282 of the infrastructure resources 283. That is, when the system source code is changed, the portion that defines the infrastructure resources 283 used in the system source code is added to the portion that defines the infrastructure resources 283 of the registered source code program. In addition, the portion that defines the variables used in the registered source code program is added to the portion that defines the variables used in the infrastructure resources 283 in the system source code. Furthermore, the portion that sets the setting values 282 used in the infrastructure resources 283 in the system source code is added to the portion that sets the setting values 282 used in the registered source code program.
[0070] Here, regarding the part of setting the setting value 282 used, the variable name of the differential information must be associated with the variable name in the source code program. Several methods for association have been proposed in the past. For example, there is a method of manually associating the variable name output by the differential information with the variable name of the source code program in advance, a method of calculating the similarity between the variable name output by the differential information and the variable name of the source code program and associating them, etc. In this way, the setting change can be corrected according to the original coding rules.
[0071] When no setting change of the original resource is detected, that is, when the addition of the new infrastructure resource 283 is detected, the setting change reflection unit 260 obtains the source code program of the new infrastructure resource 283, modifies it according to the coding rules, and adds it (step S209). Fig. 9 This processing will be described in detail. Fig. 9 is a flowchart showing an example of a specific processing sequence in step S209. Fig. 9 The following describes each step.
[0072] The setting change reflection unit 260 retrieves the source code program of the corresponding infrastructure resource 283 from the name of the infrastructure resource 283 included in the differential information (step S301). As a specific example, Terraform publicly provides an API (Application Programming Interface) for retrieval, and the search parameters can be added to a specific URL to obtain the search results. As an example, the resource named "network" can be retrieved by performing a GET method on "https: / / registry.terraform.io / v1 / modules / search?q=network". In addition, a shared repository managed by the group to which the user 201 belongs can also be set. Furthermore, an example of a source code program can be obtained from a page describing the corresponding infrastructure resource recorded in the official page of the corresponding infrastructure resource 283 by web crawling.
[0073] The setting change reflection unit 260 performs a detailed check of the source code program of the acquired infrastructure resource 283 (step S302). As a specific example, when there are multiple candidates for the source code program of the resource acquired in step S301, there may be a source code program that does not contain the corresponding infrastructure resource among the candidates. Therefore, multiple candidate source code programs are analyzed to confirm whether they contain the characters of the corresponding infrastructure resource. Thereafter, the source code program that does not contain the character is deleted from the candidates. In addition, the metadata of the source code program can also be used to conduct a detailed check of the candidates. As a specific example, a source code program with a large number of asterisks indicating the popularity of the source code program can be selected. Thus, a source code program is selected from the multiple acquired source code programs.
[0074] Then, the setting change reflection unit 260 checks whether there is a candidate by the detailed check performed in step S302 (step S303). If the number of candidates is 1, the process proceeds to step S304, and if the number of candidates is 0, the process ends.
[0075] When the number of candidates is 1 ("Yes" in step S303), the setting change reflection unit 260 modifies a source code program selected by the detailed examination in step S302 (step S304). Here, the so-called modification of the source code program refers to rewriting the acquired source code program according to the coding rule specified by the user 201. As a specific example of the coding rule, there is a method of converting the variable name of the source code program according to the naming rule specified by the user 201. The reason is that although the setting project name is defined for the resource by the construction tool, the variable name of the setting project name is named by the developer, so the naming rule may not be unified.
[0076] Perform code analysis of the source code program for the corresponding variable names. Several methods of code analysis have been proposed in the past. For example, perform lexical analysis on the source code program according to the syntax of the programming language and convert it into a token string. Convert the token string obtained from the conversion into a tree structure. Confirm the variable name based on the tree structure of the conversion result and convert it according to the naming rules. As a specific example, add the resource name before setting the project name and connect it with an underscore or set it to all uppercase characters.
[0077] In addition, as another example of coding rules, there is a method of making the directory structure consistent with the original source code program. For example, as a source code program, there is a method of dividing each resource into different source code program files and calling each of them as a module. In this case, the method of calling the directory structure as a module is different from the directory structure in the method of implementing the directory structure with a source code program. In the case of the method of calling as a module, the acquired source code program is configured on the module directory, and the part of the acquired source code program to be called is added to the original source code program.
[0078] The above description has been made of the setting change reflection unit 260 to automatically add source code programs, but the method is not necessarily limited to automatic addition, and may also be in the form of notifying other users 201, urging the users 201 to create source code programs for new resources, and obtaining the created source code programs.
[0079] The system construction device 100 of this embodiment detects the setting change of the system 281, and reflects the setting change in the system source code according to the coding rule. By correcting the setting change according to the coding rule, the reflection of the setting change of the system 281 can be managed in the form of the source code program imagined by the user 201. Therefore, the system construction device 100 automatically reflects the setting change to the construction information when the user 201 manually makes the setting change, so no unnecessary man-hours are consumed. In addition, there is no need to correct the automatic setting change according to its own coding rule, so the man-hours of the setting change reflection operation can be reduced.
[0080] Furthermore, in the system construction device 100 of the present embodiment, the user 201 inputs the functional requirements and non-functional requirements of the system 281 on the portal screen 210, and the system 281 that meets the requirements is presented, and the user 201 customizes the system 281, and the system 281 is automatically constructed. Thus, even if the user 201 has no knowledge of the design of the system 281 and the automatic construction technology of the system 281, the system 281 that meets the requirements can be created.
[0081] <Example 2> Next, the system construction device of the second embodiment of the present invention is described. In the first embodiment, an example is described in which the user 201 inputs the functional requirements and non-functional requirements of the system 281 on the portal screen 210, and the system 281 that meets the requirements is presented and customized by the user 201. In the second embodiment, the system is constructed based on the system source code described by the user 201 without displaying the requirement input screen on the portal screen 210. Thus, even if the user 201 is proficient in the automatic construction technology of the system 281 and the user 201 creates the system source code by himself, the system 281 can be created and managed based on the system source code.
[0082] Fig.10 This is a flowchart for explaining the procedure of the system construction device 100 in the second embodiment to construct and manage the system. Fig.10 The following describes each step.
[0083] The system construction device 100 receives the system source code from the user 201 (step S401). As a specific example of the receiving method, the portal screen 210 may display the system source code. Figure 5B The same screen is used to upload the system source code. In addition, a text editor capable of describing the system source code may be displayed on the portal screen 210 so that the user 201 can directly describe the system source code.
[0084] The deployment unit 240 performs deployment processing based on the system source code received in step S401 (step S402). Figure 3 The same as step S104. In this embodiment, the deployment process can also be performed by the user. In this case, as an example of using Terrafrom, the system is constructed using the build command of Terrafrom in the user's environment.
[0085] Steps S403 and S404 are Figure 3 In this embodiment, when the user 201 performs deployment processing, the user inputs information related to the target system 281 for detecting setting changes and the build information based on the system source code to detect and reflect the setting changes.
[0086] As described above, in the second embodiment of the present invention, the system is constructed based on the system source code described by the user 201. Therefore, even if the user 201 is proficient in the automatic construction technology of the system and wants to make the system source code himself, the system can be made and managed based on the system source code.
[0087] According to the embodiments of the present invention described above, the following effects are achieved. (1) The system construction device of the present invention is a system construction device that constructs a system including infrastructure resources and setting values of the infrastructure resources on a specified execution environment, and comprises: an input unit that inputs requirements for system construction that meet desired requirements; a system source code production unit that produces a first source code that defines a system that meets the desired requirements; a deployment unit that deploys and constructs the system on the execution environment according to the requirements; a setting change detection unit that detects the difference between a second source code that defines the changed system and a first source code when a change occurs to the system constructed on the execution environment; and a setting change reflection unit that causes the difference detected by the setting change detection unit to be reflected in the first source code; the setting change reflection unit causes the difference to be reflected in the first source code according to a coding rule applied to the first source code.
[0088] With the above configuration, when the user changes the configuration of the system without changing the system configuration information, the difference between the original system configuration information and the changed system configuration information can be corrected in a format with unified coding rules.
[0089] (2) When the difference includes a change in a setting value, the setting change reflecting unit corrects the setting value of the second source code according to the coding rule and corrects the first source code. In addition, when the difference includes the addition of an infrastructure resource, the setting change reflecting unit obtains the source code of the added infrastructure resource, corrects the source code according to the coding rule, and corrects the first source code. In this way, regardless of the type of change added to the source code of the system, the correction can be appropriately reflected.
[0090] (3) The configuration change detection unit determines whether the added infrastructure resource is a new infrastructure resource based on the metadata that specifies the system. This allows the source code to be appropriately modified even when a new resource that is not envisioned in the prior art is added.
[0091] (4) The input unit includes a portal screen display unit, and the requirements include functional requirements and non-functional requirements. The portal screen display unit presents candidates of systems that meet the input functional requirements or non-functional requirements to the user. Thus, the user can select candidates by separating functional requirements from non-functional requirements, which improves the convenience for the user. Furthermore, by automatically selecting and presenting candidates of the system, the user can be aware of the addition and modification of the desired requirements.
[0092] (5) The deployment unit generates construction information for constructing the system selected by the user based on the user's selection of the presented system candidates, and constructs the system on the execution environment. This allows the information stored in the repository of the system construction device to be effectively utilized to realize rapid system construction.
[0093] The present invention includes various variations and is not limited to the above-described embodiments. For example, the above-described embodiments are detailed descriptions of the present invention in an easy-to-understand manner and are not necessarily limited to all the described configurations. In addition, a portion of the configuration of a certain embodiment may be replaced with a configuration of another embodiment, and a configuration of another embodiment may be added to a configuration of a certain embodiment. In addition, other configurations may be added, deleted, or replaced to a portion of the configuration of each embodiment. Explanation of symbols
[0094] 100…system construction device, 210…portal screen (input unit·portal screen display unit), 220…repository, 230…system source code production unit, 240…deployment unit, 250…setting change detection unit, 260…setting change reflection unit, 270…coding rule storage unit, 280…execution environment, 281…system, 282…setting value, 283…infrastructure resources.
Claims
1. A system construction device for constructing a system including infrastructure resources and setting values of the infrastructure resources on a predetermined execution environment, characterized in that: have: An input unit, whose input satisfies the requirements of the system construction of the desired elements; a system source code preparation unit that prepares a first source code that defines a system that satisfies the desired requirements; A deployment unit, which deploys and builds the system on the execution environment according to the requirements; a configuration change detection unit configured to detect a difference between a second source code defining the changed system and the first source code when a change occurs to the system constructed on the execution environment; as well as a setting change reflecting unit that reflects the difference detected by the setting change detecting unit in the first source code, The setting change reflecting unit reflects the difference in the first source code according to a coding rule applied to the first source code.
2. The system construction device according to claim 1, characterized in that: When the difference includes a change in the setting value, the setting change reflecting unit corrects the setting value of the second source code according to the coding rule, and corrects the first source code.
3. The system construction device according to claim 1, characterized in that: When the difference includes the addition of the infrastructure resource, the setting change reflecting unit acquires the source code of the added infrastructure resource, modifies the source code according to the coding rule, and modifies the first source code.
4. The system construction device according to claim 3, characterized in that: The configuration change detection unit determines whether the added infrastructure resource is a new infrastructure resource based on metadata identifying the system.
5. The system construction device according to claim 1, characterized in that: The input unit includes a portal screen display unit, the requirements include functional requirements and non-functional requirements, and the portal screen display unit presents candidates of systems satisfying the input functional requirements or non-functional requirements to the user.
6. The system construction device according to claim 5, characterized in that: The deployment unit creates construction information for constructing the system selected by the user according to the user's selection of the presented system candidates, and constructs the system on the execution environment.
