A distributed construction task template design method based on Flink
The Flink-based distributed construction task template addresses limitations in Ansible playbooks by enabling variable value customization and flexible process control, enhancing template flexibility and customization.
Patent Information
- Application Number
- CN202210242568.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-11
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2042-03-11
AI Technical Summary
Ansible playbooks face limitations in variable values being constants and process control dependent on YAML writing order, restricting flexibility and customization in practical applications.
A distributed construction task template design method based on Flink, incorporating a control end to generate variable values and utilize middleware Kafka for flexible process control, enhancing template customization.
The method increases template flexibility and customization by allowing variable value customization and coordinated task flow control, improving the functionality of Ansible playbooks.
Smart Images

Figure CN114924711B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distributed construction task templates, and in particular to a distributed construction task template design method based on Flink. Background Art
[0002] Ansible playbooks are Ansible's configuration, deployment, and orchestration language. They can be described as a scenario in which you want a remote host to execute commands, or a set of commands that an IT program runs.
[0003] Playbooks are designed to be very simple to understand and develop based on a text language. There are multiple ways to organize playbooks and their attached files.
[0004] Playbooks are written in YAML and include functions such as variables, logic control, and process control.
[0005] Although Playbooks are widely used in CICD, they still have certain shortcomings in practical applications: (1) The variable values of Playbooks can only be constants. (2) The process control of Playbooks is heavily dependent on the writing order of YAML and can only be executed from top to bottom. Summary of the invention
[0006] The purpose of the present invention is to provide a distributed construction task template design method based on Flink to solve the problems raised in the above background technology.
[0007] To achieve the above objectives, the present invention provides the following technical solutions: a distributed construction task template design method based on flink, firstly, a control end is added downstream of the template, the control end is used to generate variable values required by the template and parse the template, refill the variable values into the template, and then send the newly generated template to the execution end of CICD, and complete the process control of the task through the template and the middleware kafka.
[0008] Preferably, the method comprises the following steps:
[0009] A. First, the backend management platform sends the project information and the task chain template used to the first_input topic of Kafka;
[0010] B. Then, the first task gets the msg from the first_input topic, executes it, and sends the msg to the topic: build_input and topic: unit_test_input through the kafka_out_topic information in the task chain template configuration;
[0011] C. Then, the build task and unit_test task simultaneously obtain msg from their respective source topics and execute.
[0012] Preferably, the method further comprises the following steps:
[0013] D. The verify task obtains msg through topic: verify_input, executes it, and sends msg to topic: end_input;
[0014] F. Finally, the end task obtains msg through topic: end_input and executes it to complete the entire task chain.
[0015] Preferably, in step C, since kafka_out_topic:verify_input is configured in the task chain template configuration, the build task will send msg to the topic verify_topic.
[0016] Compared with the prior art, the beneficial effects of the present invention are: the present invention specifically uses the control end to customize variable values, which greatly increases the flexibility of the template; and the task flow control of the template in conjunction with the middleware kafka greatly increases the customization of the template. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of the present invention;
[0018] Figure 2 It is a task chain flow chart of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] In the description of the present invention, it should be noted that the terms "upper", "lower", "inner", "outer", "front end", "rear end", "two ends", "one end", "the other end" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0021] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "provided with", "connected", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0022] See also Figure 1-2 The present invention provides the following technical solutions: a distributed construction task template design method based on flink, firstly, a control end is added downstream of the template, the control end is used to generate variable values required by the template and parse the template, refill the variable values into the template, and then send the newly generated template to the execution end of CICD, and complete the process control of the task through the template and the middleware kafka.
[0023] In the present invention, a distributed construction task template design method based on Flink includes the following steps:
[0024] A. First, the backend management platform sends the project information and the task chain template used to the first_input topic of Kafka;
[0025] B. Then, the first task gets the msg from the first_input topic, executes it, and sends the msg to the topic: build_input and topic: unit_test_input through the kafka_out_topic information in the task chain template configuration;
[0026] C. Then, the build task and unit_test task simultaneously obtain msg from their respective source topics and execute.
[0027] The following steps are also included:
[0028] D. The verify task obtains msg through topic: verify_input, executes it, and sends msg to topic: end_input;
[0029] F. Finally, the end task obtains msg through topic: end_input and executes it to complete the entire task chain.
[0030] In step C, since kafka_out_topic:verify_input is configured in the task chain template configuration, the build task will send msg to the topic verify_topic.
[0031] In summary, the present invention specifically uses the control end to customize variable values, which greatly increases the flexibility of the template; and the customization of the template is greatly increased by coordinating the task flow control of the template with the middleware kafka.
[0032] It should be noted that, in this article, terms such as "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0033] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A distributed construction task template design method based on Flink, characterized by: First, add a control end downstream of the template. The control end is used to generate the variable values required by the template and parse the template, refill the variable values into the template, and then send the newly generated template to the execution end of CICD. The process control of the task is completed through the template and the middleware Kafka. The following steps are involved: A. First, the backend management platform sends the project information and the task chain template used to the first_input topic of Kafka; B. Then, the first task gets the msg from the first_input topic, executes it, and sends the msg to the topic: build_input and topic: unit_test_input through the kafka_out_topic information in the task chain template configuration; C. Then, the build task and unit_test task simultaneously obtain msg from their respective source topics and execute; The following steps are also included: D. The verify task obtains msg through topic: verify_input, executes it, and sends msg to topic: end_input; F. Finally, the end task obtains msg through topic: end_input and executes it to complete the entire task chain; In step C, since kafka_out_topic:verify_input is configured in the task chain template configuration, the build task will send msg to the topic verify_topic.
