CN112988168B - Environment building method and device - Google Patents
Environment building method and device Download PDFInfo
- Publication number
- CN112988168B CN112988168B CN201911202172.6A CN201911202172A CN112988168B CN 112988168 B CN112988168 B CN 112988168B CN 201911202172 A CN201911202172 A CN 201911202172A CN 112988168 B CN112988168 B CN 112988168B
- Authority
- CN
- China
- Prior art keywords
- module
- machine
- topology
- modules
- environment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000010276 construction Methods 0.000 claims abstract description 21
- 230000001419 dependent effect Effects 0.000 claims abstract description 16
- 230000006978 adaptation Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 9
- 230000007613 environmental effect Effects 0.000 claims description 5
- 239000000758 substrate Substances 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 5
- 238000012423 maintenance Methods 0.000 abstract description 5
- 230000007547 defect Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 16
- 238000004891 communication Methods 0.000 description 9
- 238000011144 upstream manufacturing Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000013515 script Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3664—Environments for testing or debugging software
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses a method and a device for setting up an environment, and relates to the technical field of computers. One embodiment of the method comprises the following steps: establishing topology by using modules in the module set; assigning a machine to a module in the topology; according to the topology, the labels in the configuration files corresponding to the modules are replaced by the dependent addresses of the downstream machines, so that the configuration files are updated; and calling an environment deployment tool to build the environment of the module according to the updated configuration file. The implementation mode avoids the technical defects of high maintenance cost and low resource utilization rate required by the manual environment construction in the prior art, and further can realize the technical effects of automatically configuring the upstream-downstream relation, not needing to maintain a fixed environment, and adaptively modifying the upstream-downstream port file so that all modules in the system can normally communicate.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for setting up an environment.
Background
Under the condition of limited tester resources, the establishment of a testing environment is important, and particularly, a system with relatively complex topology is realized. The realization of automatic connection between upstream and downstream services is a relatively complex part of environment construction. In the prior art, a plurality of sets of environments are maintained by each module, the machines and port numbers corresponding to the modules are fixed, and when the environments are built each time, the downstream addresses, the port numbers and the like in the downstream port files are written in the built scripts.
In the process of realizing the invention, the inventor finds that at least the technical problems of high maintenance cost and low resource utilization rate exist in the prior art.
Disclosure of Invention
In view of this, the embodiment of the invention provides a method and a device for setting up an environment, which can further realize automatic configuration of upstream and downstream relationships, does not need to maintain a fixed environment, and can adaptively modify upstream and downstream port files no matter which machine is selected for setting up, so that all modules in a system can normally communicate.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for setting up an environment, including:
establishing topology by using modules in the module set;
Assigning a machine to a module in the topology;
According to the topology, the labels in the configuration files corresponding to the modules are replaced by the dependent addresses of the downstream machines, so that the configuration files are updated;
and calling an environment deployment tool to build the environment of the module according to the updated configuration file.
Optionally, before establishing the topology by using the modules in the module set, the method includes:
Defining modules in a module set;
wherein, the attribute information table of the module at least comprises: module name, module tag; the module labels comprise labels of modules downstream of the module;
the attribute information table further includes at least one of: CPU size, memory size, module deployment related code download address.
Optionally, the establishing a topology includes: existing topologies are selected for establishment or temporary topologies are created custom.
Optionally, after assigning the machine to the topologically corresponding module, the method includes:
Judging whether the topology still has an idle module and no machine is allocated to the idle module;
if yes, judging whether an idle adaptation machine matched with the idle module exists or not; if the idle adaptation machine exists, matching the machine with the lowest configuration in the idle adaptation machine with the idle model; and if the idle adaptation machine does not exist, waiting for the idle adaptation machine.
Optionally, according to the topology, replacing the label in the module corresponding configuration file with the address of the dependent downstream machine, and before updating the configuration file, including:
recording a configuration file of the dispensing machine in a database table;
wherein, the configuration file includes: the address of the downstream machine on which the module depends, and the attribute information of the downstream machine port.
According to a further aspect of an embodiment of the present invention, there is provided an apparatus for environmental construction, comprising:
the topology establishment module is used for establishing topology by utilizing the modules in the module set;
A machine allocation module for allocating machines to modules in the topology;
The updating module is used for replacing the label in the configuration file corresponding to the module with the address of the dependent downstream machine according to the topology to update the configuration file;
and the environment setting up module is used for calling an environment deployment tool to set up the environment of the module according to the updated configuration file.
Optionally, before establishing the topology by using the modules in the module set, the method includes:
Defining modules in a module set;
wherein, the attribute information table of the module at least comprises: module name, module tag; the module labels comprise labels of modules downstream of the module;
the attribute information table further includes at least one of: CPU size, memory size, module deployment related code download address.
Optionally, the establishing a topology includes: existing topologies are selected for establishment or temporary topologies are created custom.
Optionally, after assigning the machine to the topologically corresponding module, the method includes:
Judging whether the topology still has an idle module and no machine is allocated to the idle module;
if yes, judging whether an idle adaptation machine matched with the idle module exists or not; if the idle adaptation machine exists, matching the machine with the lowest configuration in the idle adaptation machine with the idle model; and if the idle adaptation machine does not exist, waiting for the idle adaptation machine.
Optionally, according to the topology, replacing the label in the module corresponding configuration file with the address of the dependent downstream machine, and before updating the configuration file, including:
recording a configuration file of the dispensing machine in a database table;
wherein, the configuration file includes: the address of the downstream machine on which the module depends, and the attribute information of the downstream machine port.
According to another aspect of an embodiment of the present invention, there is provided an electronic device for environmental construction, including:
One or more processors;
Storage means for storing one or more programs,
When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method for setting up an environment provided by the present invention.
According to a further aspect of an embodiment of the present invention, there is provided a computer readable medium having stored thereon a computer program which when executed by a processor implements the method of environment construction provided by the present invention.
One embodiment of the above invention has the following advantages or benefits:
According to the application, the configuration file of the module is updated, so that the automatic construction of the environment is realized, the technical defects of high maintenance cost and low resource utilization rate required by the manual construction of the environment in the prior art are avoided, the automatic configuration of the upstream and downstream relation can be realized, the fixed environment is not required to be maintained, the upstream and downstream port file can be adaptively modified no matter which machine is selected for construction, and the technical effect of normal communication can be realized for all modules in the system.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a method of environment building according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a module attribute information table in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a topology in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a specific flow of a method of environment building according to an embodiment of the present invention;
FIG. 5 is a schematic illustration of the main modules of an environment set up device according to an embodiment of the invention;
FIG. 6 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
Fig. 7 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a method for environment setup according to an embodiment of the present invention, as shown in fig. 1, including:
Step S101, building topology by using modules in a module set; establishing topology by using modules in the module set;
Wherein the establishing topology comprises: existing topologies are selected for establishment or temporary topologies are created custom. In practical applications, a system may be composed of a plurality of modules, and in particular, the upstream-downstream relationship between the plurality of modules is represented by a topology. Fig. 3 is a schematic diagram of a topology in accordance with an embodiment of the present invention. As shown in fig. 3, the system has four modules (module 1, module 2, module 3, module 4, module 5, respectively). When establishing topology, the dependency relationship of the system can be preset to be that a module 2, a module 3, a module 4 and a module 5 depend on a module 1; there is no interdependence between modules 2,3, and 4. The topology in fig. 3 can then be determined by the above-described relationship. After the topology is selected, a unique standard id of the deployment tool and each machine can be determined, and then step S102 is performed.
Step S102, distributing machines to the modules in the topology;
step S103, according to the topology, replacing the label in the configuration file corresponding to the module with the address of the dependent downstream machine to update the configuration file; and each machine and the dependent machine address can be determined through updating the configuration file, so that the subsequent environment construction is facilitated.
And step S104, calling an environment deployment tool to build the environment of the module according to the updated configuration file.
According to the application, the configuration file of the module is updated, so that the automatic construction of the environment is realized, the technical defects of high maintenance cost and low resource utilization rate required by the manual construction of the environment in the prior art are avoided, the automatic configuration of the upstream and downstream relation can be realized, the fixed environment is not required to be maintained, the upstream and downstream port file can be adaptively modified no matter which machine is selected for construction, and all modules in the system can normally communicate.
Optionally, before establishing the topology by using the modules in the module set, the method includes:
Defining modules in a module set;
wherein, the attribute information table of the module at least comprises: module name, module tag; the module labels comprise labels of modules downstream of the module;
the attribute information table further includes at least one of: CPU size, memory size, module deployment related code download address.
The module is also a service; by defining each module and determining the technical means of the attribute information table of each module, the machine corresponding to the module can be determined rapidly when the machine is distributed in the following method steps, and the parameters are extracted more conveniently when the environment is built.
FIG. 2 is a schematic diagram of a module attribute information table in accordance with an embodiment of the present invention; as shown in fig. 2, the attribute information table further includes, but is not limited to, at least one of: CPU size, memory size, download address (e.g., git address and git branches), platform, core directory, minimum disk size, module tag (tag) and its port (port), constraints on the adapted machine; wherein the module tag comprises a tag of a module downstream of the module.
Optionally, according to the topology, replacing the label in the module corresponding configuration file with the address of the dependent downstream machine, and before updating the configuration file, including: recording a configuration file of the dispensing machine in a database table; wherein the configuration file includes, but is not limited to: the address of the downstream machine on which the module depends, and the attribute information of the downstream machine port. The data table is shown in the following table 1, and the table 1 is a database table corresponding to the above-mentioned fig. 3:
table 1 topology corresponding database tables
As shown in table 1 above, the task represents a unique identifier of the task corresponding to the topology, in this embodiment "123", and nodeid represents a unique identifier corresponding to each machine; module_id represents a Module unique identifier corresponding to the machine unique identifier, and attr represents an attribute information table corresponding to the Module. The dependency_nodes_ids represent unique identities of other machines on which the unique identities of the machines correspond, and the dependency_nodes_tags represent TAG: PORT attributes of the unique identities of the other machines on which they depend.
Optionally, assigning a machine to a module in the set of modules comprises:
downloading codes corresponding to the modules according to the downloading addresses (which can be git addresses) in the module attribute information table;
and acquiring the machine type adapted to each module, and further realizing the machine distribution to the modules in the module set.
Optionally, after assigning a machine to a module in the topology, the method includes:
judging whether an idle module is still in the set and is not allocated to a machine;
If yes, judging whether an idle adaptation machine matched with the idle module exists or not; if the idle adaptation machine exists, matching the machine with the lowest configuration in the idle adaptation machine with the idle model; if the idle adaptation machine does not exist, waiting for the idle adaptation machine
Specifically, according to the topology, replacing the label in the machine corresponding configuration file with the address of the dependent downstream machine to update the configuration file includes:
After the information is recorded in the database, the tag (tag) of the configuration file is replaced, so that different machines at the upstream and downstream are communicated, and the technical effect of communicating different modules is achieved. In an alternative embodiment of the present application, the tag in all configuration files corresponding to the unique identifier nodeid corresponding to the current machine is replaced with the address (ip address) of the dependent machine, and if a port (port) exists in the address of the dependent machine, the port information is added to the ip address.
Specifically, as shown in fig. 3 and table 1 above:
The topology shown in fig. 3 has 5 modules (module 1, module 2, module 3, module 4 and module 5, respectively) that, after each module has been assigned a corresponding machine, replace the tag in the machine profile. As can be seen in table 1, the dependencies between these 5 modules are module 2, module 3, module 4, module 5 dependent on module 1; and the modules 2, 3, 4 and 5 are independent of each other. When the tag label is replaced, in the configuration file corresponding to the module 1, if the tag label (tag 2) corresponding to the module 2 is present, the address of the machine corresponding to the module 2 is replaced, and if the tag labels (tag 3, tag4 and tag 5) are present, the addresses of the machines allocated to the module 3, the module 4 and the module 5 are replaced respectively. If the PORT corresponding to the tag is not empty, the PORT (PORT number information) is added to the back of the ip, thereby realizing the automatic connection of the upstream and the downstream.
The following describes the flow of the present solution in detail with a specific embodiment:
FIG. 4 is a schematic diagram of a specific flow of a method of environment building according to an embodiment of the present invention; as shown in fig. 4, includes:
step S401, creating a task, wherein a plurality of modules are arranged in the task;
step S402, establishing a topology for the modules in the task;
Step S403, judging whether a module in the topology has a designated git address; if yes, executing S404; if not, then S4031 is executed, identifying a module definition error.
Step S404, downloading codes of the modules; if the code fails, S4041 is executed to download the code again; if successful, then S405 is executed;
step S405, distributing the modules by a distributing machine;
step S406, judging whether all modules in the topology are allocated with machines; if yes, then execute S407; if not, then S4061 is executed;
S4061, judging whether a machine conforming to the current idle module exists or not; if yes, executing S4062; if not, executing S4063;
Step S4062, assigning the machine with the lowest configuration to the current idle module;
step S4063, waiting for the released machine;
Step S407, judging whether tags in all configuration files are replaced; if yes, then execute S408; if not, executing step S4071, and replacing the tag according to the record in the data table;
And step S408, calling an environment deployment tool to build an environment.
Fig. 5 is a schematic diagram of the main modules of an apparatus 500 for environmental construction according to an embodiment of the invention, as shown in fig. 5, comprising:
A module 501, a topology establishment module, configured to establish a topology by using modules in a module set;
a module 502, a machine allocation module, for allocating machines to modules in the topology;
A module 503, an updating module, configured to replace, according to the topology, a tag in a configuration file corresponding to the module with an address of a downstream machine on which the tag depends, so as to update the configuration file;
And the module 504 and the environment setting up module are used for calling an environment deployment tool to set up the environment of the module according to the updated configuration file.
Fig. 6 shows an exemplary system architecture 600 in which the environment construction method or environment construction device of an embodiment of the invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 is used as a medium to provide communication links between the terminal devices 601, 602, 603 and the server 605. The network 604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 605 via the network 604 using the terminal devices 601, 602, 603 to receive or send messages, etc. Various communication client applications such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 601, 602, 603.
The terminal devices 601, 602, 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 605 may be a server providing various services, such as a background management server (by way of example only) providing support for shopping-type websites browsed by users using terminal devices 601, 602, 603. The background management server may analyze and process the received data such as the product information query request, and feedback the processing result (e.g., the target push information, the product information—only an example) to the terminal device.
It should be noted that, the method for setting up an environment provided in the embodiment of the present invention is generally executed by the server 605, and accordingly, the device for setting up an environment is generally set up in the server 605.
It should be understood that the number of terminal devices, networks and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 7, there is illustrated a schematic diagram of a computer system 700 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 701.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes a transmitting unit, an acquiring unit, a determining unit, and a first processing unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the transmitting unit may also be described as "a unit that transmits a picture acquisition request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include:
Establishing topology by using modules in the module set; establishing topology by using modules in the module set;
Assigning a machine to a module in the topology;
According to the topology, the labels in the configuration files corresponding to the modules are replaced by the dependent addresses of the downstream machines, so that the configuration files are updated;
and calling an environment deployment tool to build the environment of the module according to the updated configuration file.
According to the technical scheme provided by the embodiment of the invention, the following beneficial effects can be achieved:
according to the application, through updating the configuration file corresponding to the module in the topology, the automatic construction of the environment is realized, the technical defects of high maintenance cost and low resource utilization rate required by the manual construction of the environment in the prior art are avoided, the automatic configuration of the upstream-downstream relationship can be realized, the fixed environment is not required to be maintained, the upstream-downstream port file can be adaptively modified no matter which machine is selected for construction, and all modules in the system can achieve the technical effect of normal communication.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method of environmental construction, comprising:
defining modules in a module set; wherein, the attribute information table of the module at least comprises: module name, module tag; the module labels comprise labels of modules downstream of the module; the module serves;
establishing topology by using modules in the module set;
Assigning a machine to a module in the topology;
According to the topology, the label of the downstream module in the configuration file corresponding to the module is replaced by the address of the dependent downstream machine, so that the configuration file is updated;
and calling an environment deployment tool to build the environment of the module according to the updated configuration file.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The attribute information table further includes at least one of: CPU size, memory size, module deployment related code download address.
3. The method of claim 1, wherein the establishing a topology comprises: existing topologies are selected for establishment or temporary topologies are created custom.
4. A method according to claim 3, characterized in that after assigning a machine to the topologically corresponding module, it comprises:
Judging whether the topology still has an idle module and no machine is allocated to the idle module;
If yes, judging whether an idle adaptation machine matched with the idle module exists or not; if the idle adaptation machine exists, matching the machine with the lowest configuration in the idle adaptation machine with the idle module; and if the idle adaptation machine does not exist, waiting for the idle adaptation machine.
5. The method of claim 4, wherein replacing the tag in the module corresponding profile with the address of the dependent downstream machine based on the topology, prior to effecting the updating of the profile, comprises:
recording a configuration file of the dispensing machine in a database table; the machine corresponds to the module;
wherein, the configuration file includes: the address of the downstream machine on which the module depends, and the attribute information of the downstream machine port.
6. An environment building apparatus, comprising:
the topology establishment module is used for establishing topology by utilizing the modules in the module set; the method is also used for defining the modules in the module set; wherein, the attribute information table of the module at least comprises: module name, module tag; the module labels comprise labels of modules downstream of the module; the module serves;
A machine allocation module for allocating machines to modules in the topology;
the updating module is used for replacing the label of the downstream module in the configuration file corresponding to the module with the address of the dependent downstream machine according to the topology, so as to update the configuration file;
and the environment setting up module is used for calling an environment deployment tool to set up the environment of the module according to the updated configuration file.
7. The apparatus of claim 6, wherein the device comprises a plurality of sensors,
The attribute information table further includes at least one of: CPU size, memory size, module deployment related code download address.
8. The apparatus of claim 6, wherein the establishing a topology comprises: existing topologies are selected for establishment or temporary topologies are created custom.
9. An environmental construction electronic device, comprising:
One or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911202172.6A CN112988168B (en) | 2019-11-29 | 2019-11-29 | Environment building method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911202172.6A CN112988168B (en) | 2019-11-29 | 2019-11-29 | Environment building method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112988168A CN112988168A (en) | 2021-06-18 |
CN112988168B true CN112988168B (en) | 2024-10-18 |
Family
ID=76330900
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911202172.6A Active CN112988168B (en) | 2019-11-29 | 2019-11-29 | Environment building method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112988168B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102437938A (en) * | 2012-01-09 | 2012-05-02 | 北京邮电大学 | Large-scale network monitoring-oriented virtualization deployment system and method |
CN103309746A (en) * | 2013-05-13 | 2013-09-18 | 百度在线网络技术(北京)有限公司 | Method and device for building investigation environment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7512942B2 (en) * | 2005-08-24 | 2009-03-31 | International Business Machines Corporation | Model-driven software deployment in an application server |
US8595693B2 (en) * | 2008-07-29 | 2013-11-26 | International Business Machines Corporation | Model driven deployment of composite applications |
US9104803B2 (en) * | 2011-01-03 | 2015-08-11 | Paypal, Inc. | On-demand software test environment generation |
CN104572372A (en) * | 2014-12-26 | 2015-04-29 | 浪潮电子信息产业股份有限公司 | System and method for building server performance testing environment |
CN108595222A (en) * | 2018-04-26 | 2018-09-28 | 努比亚技术有限公司 | Background service environmental structure method, server and computer readable storage medium |
-
2019
- 2019-11-29 CN CN201911202172.6A patent/CN112988168B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102437938A (en) * | 2012-01-09 | 2012-05-02 | 北京邮电大学 | Large-scale network monitoring-oriented virtualization deployment system and method |
CN103309746A (en) * | 2013-05-13 | 2013-09-18 | 百度在线网络技术(北京)有限公司 | Method and device for building investigation environment |
Also Published As
Publication number | Publication date |
---|---|
CN112988168A (en) | 2021-06-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108737270B (en) | Resource management method and device for server cluster | |
CN111460129B (en) | Method, device, electronic equipment and storage medium for generating identification | |
WO2021023149A1 (en) | Method and apparatus for dynamically returning message | |
CN110795147A (en) | Interface protocol file management method and device | |
CN110019158A (en) | A kind of method and apparatus of monitoring data quality | |
CN113535220B (en) | Code packet management method and device | |
CN111062682B (en) | Work order processing method and device | |
CN112817562B (en) | Service processing method and device | |
CN112988168B (en) | Environment building method and device | |
CN112306984A (en) | Data source routing method and device | |
CN111382953A (en) | Dynamic process generation method and device | |
CN116737662A (en) | Method, device, electronic equipment and storage medium for processing business data | |
CN114070889B (en) | Configuration method, traffic forwarding device, storage medium, and program product | |
CN108696557B (en) | Information processing system, method and device | |
CN113765983B (en) | Site service deployment method and device | |
CN112559001B (en) | Method and device for updating application | |
CN115442129A (en) | Method, device and system for managing cluster access authority | |
CN113312900A (en) | Data verification method and device | |
CN114500485B (en) | Data processing method and device | |
CN112099841A (en) | Method and system for generating configuration file | |
CN115150281B (en) | Network construction method and device for data center | |
CN113448602A (en) | Version updating method and device | |
CN113556370A (en) | Service calling method and device | |
CN113495747B (en) | Gray scale release method and device | |
CN110727739B (en) | Data storage method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |