Method and device for automatically scaling up and down transmission worker services in industrial Internet of Things data centers
By building Docker images and Worker scheduling center services in industrial IoT data centers, the automatic expansion and scaling of Worker service containers is solved, and the problem of inefficient adjustment of the number of Worker services is improved, resource utilization and operation and maintenance costs are reduced.
Patent Information
- Application Number
- CN202011516466.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-12-21
AI Technical Summary
In industrial IoT data transmission, the number of operational worker services needs to be dynamically adjusted according to changes in factory equipment and data, but the existing technology relies on manual monitoring and adjustment by operation and maintenance personnel, resulting in inefficiency and waste of resources.
By developing the Worker service environment, configure shell scripts, Worker service running shell scripts and Dockerfile files, build the Worker service container in the Docker image, and add an interactive interface with the monitoring platform to the Worker scheduling center service to realize the automatic startup and shutdown of the Worker service container.
The automatic expansion and scaling of Worker services is realized, which reduces the intervention of operation and maintenance personnel, improves the flexibility of the system and resource utilization rate, and saves the time and server resource costs of operation and maintenance personnel.
Smart Images

Figure CN112579260B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of industrial Internet of Things data transmission, and relates to a method and device for automatically expanding and contracting a Worker service of an industrial Internet of Things data center transmission. Background Art
[0002] When the industrial IoT data transmission Worker service is running, when factory equipment and the data generated by the equipment change, the operation and maintenance personnel manually modify the number of running Worker services by judging the monitoring indicators of the Worker service. Due to the increase in the number of factories and the large number of configuration files, the operation and maintenance personnel cannot respond in time, resulting in excessive pressure on the Worker service and shutdown, or too many Worker services started, resulting in resource waste. Summary of the invention
[0003] In order to solve the technical problems in the related technologies, this application provides a method and device for automatically scaling up and down the Worker service of an industrial Internet of Things data center transmission. The technical solution is as follows:
[0004] In a first aspect, the present application provides a method for automatically scaling up and down a Worker service in an industrial Internet of Things data center, the method comprising:
[0005] Develop the Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image;
[0006] Develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call;
[0007] Develop the Dockerfile file to build the Worker service container in the Docker image;
[0008] Develop a Worker scheduling center service, add an interactive interface between the Worker scheduling center service and the monitoring platform, and add a Worker container startup method and a Worker container shutdown method to start or shut down the Worker service container respectively.
[0009] Optionally, the developing a Worker service environment configuration Shell script configures the operating environment of the internal system of the Worker service container in the Docker image, including:
[0010] Develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package;
[0011] Copy the dependency package to the Repo directory;
[0012] Generate CLASSPATH based on the dependency packages in the current system Repo directory and add it to the system PATH environment.
[0013] Optionally, the developing Worker service runs a Shell script to enable the Worker service container in the Docker image to start a Worker service call, including:
[0014] Receives HelixZookeeperServer and HelixClusterName parameters as written configuration files;
[0015] Receive the MemoryLimit parameter to limit the startup resource size of the Worker service;
[0016] Start the Worker service through the configuration file.
[0017] Optionally, the development of the Dockerfile file to build a Worker service container in the Docker image includes:
[0018] Set the Maven image JDK8 version as the container runtime system;
[0019] Set the MAVEN_OPTS parameter to compile the Worker service and create the Worker service working directory;
[0020] Compile the Worker service code, execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
[0021] Optionally, the method further comprises:
[0022] When the monitoring platform detects an increase in the amount of data, the Worker scheduling center service is called through an interactive interface with the monitoring platform to start the Worker service container;
[0023] When the monitoring platform detects that the amount of data is reduced, the Worker scheduling center service is called through the interactive interface between the monitoring platform and the Worker service container.
[0024] In a second aspect, the present application provides an automatic expansion and contraction device for a Worker service in an industrial Internet of Things data center, the device comprising:
[0025] The first development module is used to develop a Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image;
[0026] The second development module is used to develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call;
[0027] The third development module is used to develop the Dockerfile file and build the Worker service container in the Docker image;
[0028] The fourth development module is used to develop a Worker scheduling center service, in which an interactive interface between the Worker scheduling center service and the monitoring platform is added, and a Worker container startup method and a Worker container shutdown method are added to start or shut down the Worker service container respectively.
[0029] Optionally, the first development module is further used for:
[0030] Develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package;
[0031] Copy the dependency package to the Repo directory;
[0032] Generate CLASSPATH based on the dependency packages in the current system Repo directory and add it to the system PATH environment.
[0033] Optionally, the second development module is further used for:
[0034] Receives HelixZookeeperServer and HelixClusterName parameters as written configuration files;
[0035] Receive the MemoryLimit parameter to limit the startup resource size of the Worker service;
[0036] Start the Worker service through the configuration file.
[0037] Optionally, the third development module is further used for:
[0038] Set the Maven image JDK8 version as the container runtime system;
[0039] Set the MAVEN_OPTS parameter to compile the Worker service and create the Worker service working directory;
[0040] Compile the Worker service code, execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
[0041] Optionally, the device further comprises:
[0042] A startup module, configured to, when the monitoring platform monitors an increase in the amount of data, call the Worker scheduling center service through an interactive interface with the monitoring platform to start the Worker service container;
[0043] The closing module is used to call the Worker scheduling center service through the interactive interface between the monitoring platform and the monitoring platform to close the Worker service container when the monitoring platform monitors a decrease in the amount of data.
[0044] Through the above technical solution, the present application can at least achieve the following beneficial effects:
[0045] By building a Worker service container in the Docker image, when the number of factories or equipment increases or decreases, resulting in changes in the amount of data, automatic scaling can be achieved without the involvement of operation and maintenance personnel. In addition, after the Worker service achieves automatic scaling, it saves the time cost of operation and maintenance personnel and the cost of server resources.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0048] Figure 1 It is a flowchart of a method for automatically scaling up and down a Worker service in an industrial Internet of Things data center provided in one embodiment of the present application;
[0049] Figure 2 It is a schematic diagram of an automatic expansion and contraction system for Worker services in an industrial Internet of Things data center provided in one embodiment of the present application;
[0050] Figure 3 It is a schematic diagram of an automatic expansion and contraction device for an industrial Internet of Things data center transmission Worker service provided in one embodiment of the present application. DETAILED DESCRIPTION
[0051] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.
[0052] Figure 1 : is a flowchart of an industrial Internet of Things data center transmission Worker service automatic expansion and contraction method provided in one embodiment of the present application. The industrial Internet of Things data center transmission Worker service automatic expansion and contraction method may include the following steps:
[0053] Step 101, develop a Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image;
[0054] In a possible implementation of step 101, first develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package; then copy the dependency package to the Repo directory; finally, generate CLASSPATH based on the dependency package in the current system Repo directory and add it to the system PATH environment.
[0055] Step 102, develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call;
[0056] In a possible implementation of step 102, firstly, the HelixZookeeperServer and HelixClusterName parameters are received as a write configuration file; then the MemoryLimit parameter is received to limit the startup resource size of the Worker service; and finally, the Worker service is started through the configuration file.
[0057] Step 103, developing a Dockerfile file to build a Worker service container in the Docker image;
[0058] In a possible implementation of step 103, first set the Maven image JDK8 version as the container operating system; then set the MAVEN_OPTS parameter to compile the Worker service and create a Worker service working directory; finally compile the Worker service code, and execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
[0059] like Figure 2 As shown in the figure, the Worker service container contains the Worker service environment configuration Shell script, the Worker service running Shell script, the Worker service Dockerfile file, and the Worker service code.
[0060] Step 104, develop a Worker scheduling center service, add an interactive interface between the Worker scheduling center service and the monitoring platform, and add a Worker container startup method and a Worker container shutdown method to start or shut down the Worker service container respectively.
[0061] For example, when the monitoring platform detects an increase in the amount of data, the Worker scheduling center service is called through the interactive interface between the monitoring platform and the Worker service container;
[0062] For another example, when the monitoring platform detects that the amount of data is decreasing, the Worker scheduling center service is called through the interactive interface between the monitoring platform and the Worker service container to close.
[0063] In summary, the automatic scaling method of the Worker service for industrial IoT data center transmission provided by this application, by building a Worker service container in a Docker image, can achieve automatic scaling without the participation of operation and maintenance personnel when the number of factories and equipment increases or decreases, resulting in changes in the amount of data. In addition, after the Worker service achieves automatic scaling, it saves the time cost of operation and maintenance personnel and the cost of server resources.
[0064] Figure 3 It is a schematic diagram of an automatic expansion and contraction device for an industrial Internet of Things data center transmission Worker service provided in an embodiment of the present application. The automatic expansion and contraction device for an industrial Internet of Things data center transmission Worker service provided in the present application may include: a first development module 310, a second development module 320, a third development module 330 and a fourth development module 340.
[0065] The first development module 310 can be used to develop a Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image.
[0066] The second development module 320 can be used to develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call.
[0067] The third development module 330 can be used to develop a Dockerfile file and build a Worker service container in the Docker image.
[0068] The fourth development module 340 can be used to develop a Worker scheduling center service, in which an interactive interface with a monitoring platform is added, and a Worker container startup method and a Worker container shutdown method are added to start or shut down the Worker service container, respectively.
[0069] Optionally, the first development module 310 is further configured to perform the following operations:
[0070] Develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package;
[0071] Copy the dependency package to the Repo directory;
[0072] Generate CLASSPATH based on the dependency packages in the current system Repo directory and add it to the system PATH environment.
[0073] Optionally, the second development module 320 is further configured to perform the following operations:
[0074] Receives HelixZookeeperServer and HelixClusterName parameters as written configuration files;
[0075] Receive the MemoryLimit parameter to limit the startup resource size of the Worker service;
[0076] Start the Worker service through the configuration file.
[0077] Optionally, the third development module 330 is further configured to perform the following operations:
[0078] Set the Maven image JDK8 version as the container runtime system;
[0079] Set the MAVEN_OPTS parameter to compile the Worker service and create the Worker service working directory;
[0080] Compile the Worker service code, execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
[0081] In a possible implementation, the automatic expansion and contraction device for the industrial Internet of Things data center transmission Worker service provided in the present application may also include: a startup module and a shutdown module.
[0082] When the monitoring platform monitors an increase in the amount of data, the start-up module may call the Worker scheduling center service through an interactive interface with the monitoring platform to start the Worker service container.
[0083] When the monitoring platform detects a decrease in the amount of data, the shutdown module can be called by the Worker scheduling center service through the interactive interface between the monitoring platform and the monitoring platform to close the Worker service container.
[0084] In summary, the automatic expansion and contraction device for the Worker service of the industrial Internet of Things data center transmission provided by this application, by building a Worker service container in the Docker image, can achieve automatic expansion and contraction without the participation of operation and maintenance personnel when the number of factories and equipment increases or decreases, resulting in changes in the amount of data. In addition, after the Worker service achieves automatic expansion and contraction, it saves the time cost of operation and maintenance personnel and the cost of server resources.
[0085] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention invented herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not invented by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0086] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for automatically scaling up and down the Worker service of an industrial Internet of Things data center, characterized in that: The method comprises: Develop the Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image; Develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call; Develop the Dockerfile file to build the Worker service container in the Docker image; Develop a Worker scheduling center service, add an interactive interface between the Worker scheduling center service and the monitoring platform, and add a Worker container startup method and a Worker container shutdown method to start or shut down the Worker service container respectively; When the monitoring platform detects an increase in the amount of data, the Worker scheduling center service is called through an interactive interface with the monitoring platform to start the Worker service container; When the monitoring platform detects that the amount of data is reduced, the Worker scheduling center service is called through the interactive interface between the monitoring platform and the Worker service container; Among them, building the Worker service container in the Docker image includes: Set the Maven image JDK8 version as the container runtime system; Set the MAVEN_OPTS parameter to compile the Worker service and create the Worker service working directory; Compile the Worker service code, execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
2. The method according to claim 1, characterized in that The development of the Worker service environment configuration Shell script configures the operating environment of the internal system of the Worker service container in the Docker image, including: Develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package; Copy the dependency package to the Repo directory; Generate CLASSPATH based on the dependency packages in the current system Repo directory and add it to the system PATH environment.
3. The method according to claim 1, characterized in that The developed Worker service runs a Shell script to enable the Worker service container in the Docker image to start the Worker service call, including: Receives HelixZookeeperServer and HelixClusterName parameters as written configuration files; Receive the MemoryLimit parameter to limit the startup resource size of the Worker service; Start the Worker service through the configuration file.
4. An automatic expansion and contraction device for transmission Worker service in an industrial Internet of Things data center, characterized in that: The device comprises: The first development module is used to develop a Worker service environment configuration Shell script to configure the operating environment of the internal system of the Worker service container in the Docker image; The second development module is used to develop a Worker service to run a Shell script, so that the Worker service container in the Docker image starts a Worker service call; The third development module is used to develop the Dockerfile file and build the Worker service container in the Docker image; The fourth development module is used to develop a Worker scheduling center service, in which an interactive interface between the Worker scheduling center service and the monitoring platform is added, and a Worker container startup method and a Worker container shutdown method are added to start or shut down the Worker service container respectively; A startup module, configured to, when the monitoring platform monitors an increase in the amount of data, call the Worker scheduling center service through an interactive interface with the monitoring platform to start the Worker service container; A closing module, configured to, when the monitoring platform detects a decrease in the amount of data, call the Worker scheduling center service through an interactive interface with the monitoring platform to close the Worker service container; The third development module is also used for: Set the Maven image JDK8 version as the container runtime system; Set the MAVEN_OPTS parameter to compile the Worker service and create the Worker service working directory; Compile the Worker service code, execute the Worker service environment configuration Shell script and the Worker service running Shell script in sequence to complete the Worker service Docker image packaging and realize containerization.
5. The device according to claim 4, characterized in that The first development module is also used for: Develop the Worker service environment configuration Shell script, configure the Java runtime environment, and generate a dependency package for the Worker service operation based on the Worker service code package; Copy the dependency package to the Repo directory; Generate CLASSPATH based on the dependency packages in the current system Repo directory and add it to the system PATH environment.
6. The device according to claim 4, characterized in that The second development module is also used for: Receives HelixZookeeperServer and HelixClusterName parameters as written configuration files; Receive the MemoryLimit parameter to limit the startup resource size of the Worker service; Start the Worker service through the configuration file.
Citation Information
Patent Citations
Internet of Things platform construction method based on micro-service architecture
CN110149396A