CN115858108A - Cloud edge coordination system constructed based on Kubeedge edge computing framework - Google Patents
Cloud edge coordination system constructed based on Kubeedge edge computing framework Download PDFInfo
- Publication number
- CN115858108A CN115858108A CN202211260705.8A CN202211260705A CN115858108A CN 115858108 A CN115858108 A CN 115858108A CN 202211260705 A CN202211260705 A CN 202211260705A CN 115858108 A CN115858108 A CN 115858108A
- Authority
- CN
- China
- Prior art keywords
- task
- data
- edge
- cloud
- information
- 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.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a cloud edge coordination system constructed based on a Kubeedge edge computing framework, which is constructed on the basis of the Kubeedge edge computing framework, realizes an automatic process that a runnable program becomes an edge task in a visual operation mode, greatly simplifies the complexity of executing the task at the edge, increases the functions of equipment discovery, cloud edge data transmission and the like on the basis of the Kubeedge, and improves the coordination capacity between cloud edges and the resource management capacity of edge nodes.
Description
Technical Field
The invention relates to the field of computer application, in particular to a cloud edge coordination system constructed based on a Kubeedge edge computing framework.
Background
In the process of modern internet development, cloud computing is widely advocated through abundant computing resources, good expansion capability and convenient management modes, but with the increase of various intelligent devices, the types and the quantity of data are sharply increased, and the problems of processing instantaneity and insufficient network bandwidth are difficult to solve by the traditional cloud computing technology. Therefore, an edge computing technology that places computing tasks close to a data source to execute starts, and edge computing has the characteristics of small processing time delay, strong data security and small network pressure, but each edge device has weak computing power and cannot independently process complex computing tasks. Cloud-edge collaborative computing becomes a key direction of future internet development, the cloud end is responsible for task scheduling and complex computing tasks, and simple computing tasks are distributed to the edge close to a data source to be executed, so that task response speed is improved, and network bandwidth pressure is reduced. Kubeedge is a cloud native edge computing open source framework developed for realizing cloud end, edge end and terminal cooperation, and provides strong cloud edge cooperation capability, so that the Kubeedge is widely applied to the field of industrial internets. However, kubeedge only provides an operation mode of a command line, which makes management and maintenance of edges very difficult, and a process of constructing a task from an executable program and then issuing the task to each edge is very complicated, so that the difficulty is high for ordinary operators, and a part of application scenarios are difficult to satisfy due to lack of intelligent task scheduling and data transmission capability between cloud edges. Therefore, a method capable of providing a convenient way to manage edges and schedule tasks and supporting transmission of data between different cloud edges is necessary.
Currently, cloud edge collaboration technologies are mainly divided into two categories, namely a cloud edge collaboration platform constructed by a cloud service provider and an edge computing framework providing cloud edge collaboration capability.
The cloud edge collaboration platform constructed by the cloud service provider is expanded on the basis of the existing cloud service, a cloud management suite and an edge operation program are provided in the cloud service, the cloud management suite is responsible for managing and monitoring each edge node, an edge application deployment function is provided, and functions such as edge data processing and AI inference built in the cloud service provider can be purchased. The edge running program is executed on the intelligent equipment close to the terminal, the intelligent equipment is used as one edge node in the cluster, and the program provided by a supplier can be run on the edge nodes through the cloud management suite. However, these cloud-edge collaboration platforms are often bound by cloud services provided by various providers, and can only be built on cloud servers provided by the providers, or corresponding services are directly purchased, which lacks versatility, and limits the types and number of the edge device architectures such as the cloud-edge collaboration platforms, and cannot be completely expanded as required.
The other type is an open source edge computing framework with certain cloud edge coordination capability, the edge computing framework divides the equipment into three layers of a cloud end, an edge and a terminal, the cloud end is responsible for issuing tasks and configuration, the edge is responsible for running the tasks and managing the accessed equipment, and the terminal refers to various equipment capable of acquiring data and executing operation. Most frames provide capabilities of cloud edge coordination, edge autonomy and equipment management, but only an operation mode of a command line is provided, so that management and maintenance of the edges are very difficult, a large amount of manpower is consumed only for building and expanding the edges, operation and inconvenience are caused by a complicated task execution flow, and partial application scenes are difficult to meet due to lack of intelligent task scheduling and data transmission capability between cloud edges.
The cloud edge collaboration platform constructed by using a cloud service provider has the problems of provider binding, limited service, low universality and the like, and the problems of difficult maintenance, complex operation and the like when an open source edge computing frame is directly used. The method comprises the following specific steps:
a) Lack of general utility. When the cloud edge collaboration platform is used, the cloud edge collaboration platform is often bound by cloud services provided by various suppliers, and can only be built on a cloud server provided by the cloud edge collaboration platform, or corresponding services are directly purchased, so that free building or service migration cannot be achieved;
b) The service is limited. When the cloud edge collaboration platform is used, the architecture type and the access number of edge devices are often limited, expansion as required cannot be achieved, and the type of a built-in terminal device cannot completely meet the user requirements;
c) Maintenance is difficult. When the cloud edge coordination capability provided by the open source edge computing framework is directly used, the operation mode of a command line is only provided, so that the management and maintenance of the edge are difficult, and the self service is difficult to build on the edge.
d) The operation is complicated. Most edge computing frameworks call many underlying services, and the flow of using the frameworks to build tasks from executable programs and then send the tasks to each edge for execution is very complicated, and the complicated steps are more prone to errors in the execution process.
Disclosure of Invention
The invention aims to overcome the technical problems in the background art, provides a cloud edge coordination system constructed based on a Kubean edge computing framework, realizes an automatic process of changing an executable program into an edge task in a visual operation mode, greatly simplifies the complexity of executing the task at the edge, increases the functions of equipment discovery, cloud edge data transmission and the like on the basis of Kubean, and improves the coordination capacity between cloud edges and the resource management capacity of edge nodes.
The specific technical scheme of the invention is as follows:
the invention provides a cloud edge coordination system constructed based on a Kubeedge edge computing framework, which comprises a cloud management module and an edge maintenance module;
the cloud management module comprises:
the first cloud side communication service unit is used as a data transmission channel between the cloud side server and the edge node, and provides a receiving interface of the edge data and an access interface of the cloud side data at the cloud side;
the edge data receiving interface is configured to be automatically started after the cloud management module is successfully deployed, receive task data running on an edge node, send the task data to the edge data receiving interface through an edge maintenance program, decrypt the task data after receiving the task data, and return the decrypted data to a program for calling cloud-side communication service;
the cloud data access interface is configured to create a cloud data download link according to data issued to the edge node, bind the link and the data stream through a data name and a data address, and then return the created link to a program calling cloud-side communication service;
the first storage service unit is used for data interaction between the cloud management module and the disk, the database and the Harbor mirror image warehouse;
the first storage service unit includes:
the database is used for increasing, deleting, modifying and checking the data, judging whether the given data is consistent with the data in the database or not, and returning an operation result to a functional program for calling the first storage service unit;
the magnetic disc is used for creating a directory, deleting the directory and storing files according to the command;
the Harbor mirror image warehouse is used for creating projects and deleting project and mirror images through a Harbor mirror image warehouse interface;
the task scheduling unit comprises a task migration subunit and an edge maintenance task automatic updating subunit:
the task migration subunit is configured to: the task executed by the unspecified edge is executed by the edge node with the richest hardware resources distributed by the system, when the edge running the task is disconnected from the cluster and the connection is not recovered for a long time, the system stops the task and distributes a new edge node with the richest hardware resources to the edge node to continue running the task, the task executed by the specified edge is distributed to the specified edge node to be executed, the execution of the task on the edge node is kept when the edge running the task is disconnected, the cloud end is used for synchronizing task information after the edge node recovers the connection, and if the hardware resources of the edge node are insufficient, the system automatically stops the last task running on the edge node;
the edge maintenance task automatic update subunit is configured to: accessing an edge maintenance program mirror image version in a Harbor mirror image warehouse every minute through a timing task and comparing the image version with the currently executed mirror image versions of all edge nodes, stopping the edge maintenance task on the node when the mirror image version executed by the edge node is lower than the latest version, and then re-issuing the latest edge maintenance task to the edge node for execution;
the system comprises an instruction base, a service processing unit and a service processing unit, wherein the instruction base comprises an edge node deleting instruction, a task issuing instruction, a task configuration modifying instruction, a task terminating instruction, a mirror image constructing instruction, a mirror image uploading instruction and a mirror image deleting instruction;
the edge node management unit is used for automatically adding edge nodes, inquiring node information, editing node information, enabling/disabling the nodes and deleting the nodes;
the task management unit is used for task addition, automatic updating of task state information, task configuration, task information inquiry, task restart, task stop and task deletion;
the data management unit is used for receiving data, issuing data and displaying data;
the edge maintenance module includes:
the second cloud-side communication service unit serves as a data transmission channel between the cloud server and the edge node, provides data uploading and downloading functions at the edge, and is specifically configured as:
the method comprises the steps that data to be returned to a cloud end by an edge node are received, the data are encrypted, then the data are sent to an edge data receiving interface in a first cloud side communication service unit based on an HTTP (hyper text transport protocol), when a data downloading link issued by the cloud end is received by the edge, whether the link is overdue or not is judged, and if the link is not overdue, a cloud end data access interface in the first cloud side communication service unit is accessed to download the data based on the HTTP;
the second storage service unit is used for providing uniform interaction capacity between the edge maintenance program and the disk and MQTT client, and comprises:
the disk is used for storing the server disk, creating a directory and deleting the directory through commands, and saving files through a method;
the MQTT client is used for subscribing the MQTT theme required by the edge maintenance program by the storage service when the edge maintenance program is issued to the edge node, subscribing the MQTT theme of the task by the storage service according to the task identifier when a new task is issued to the edge, pushing the message to the storage service when the MQTT client receives the message sent to the theme subscribed by the storage service, and then returning the message to the program corresponding to the theme by the storage service;
the hardware monitoring unit is used for acquiring and calculating the type, the architecture type, the core number, the calculation frequency and the utilization rate of the CPU of the edge node, the type, the total capacity and the utilization rate of a memory, the type, the total capacity and the utilization rate of a disk, acquiring the hardware interface information of the edge node which can be connected with the terminal equipment, and then returning the hardware information to a calling program;
the device discovery unit is used for discovering and identifying the edge nodes connected to the terminal devices, returning the terminal device information to the cloud for display, and is specifically configured to:
detecting programs including all terminal equipment types in the terminal equipment type management unit are executed on the edge node in a task mode; calling the hardware monitoring unit every minute through a timing task to acquire an interface used by an edge node, then sequentially running a device type detection program to send a request to all interfaces on the edge node, if a response is received when the detection program of one device type requests the interface, indicating that the interface is connected with a terminal device, determining the device type, and then calling the second storage service to store the found terminal device information in a disk. After a timing task is executed once, calling the second cloud-side communication service to encrypt all the found equipment information and returning the encrypted equipment information to the cloud management module;
the resource monitoring unit is used for monitoring the hardware use state and the task execution condition of the edge node, and returning hardware data and data such as whether the hardware data meets the latest task operation or not to the cloud, and is specifically configured as follows:
the timing task calls the hardware monitoring unit to obtain the use condition of the hardware equipment of the edge node, then calculates and counts various hardware data, and then calls the second storage service to store the hardware use information into a disk; when a new task is issued to the edge for execution, the state maintenance program can judge whether the idle hardware resources of the current edge node can meet the operation of the task, if the idle hardware resources can not meet the operation of the task, the task identifier is recorded, and finally the second cloud side communication service unit is called to encrypt the hardware use information and the data of whether the idle hardware resources meet the operation of the latest task and the like and then return the encrypted data to the cloud management module;
the data transmission unit is used for returning data generated by the tasks executed on the edge nodes to the cloud management module;
the task control unit is used for changing the execution state of the task on the edge node and releasing the resource consumption of the task according to the operation of the cloud management module on the task, and is specifically configured as follows:
when the cloud management module configures the tasks, the second storage service receives a change message of task configuration from an MQTT client on the edge node, and then returns a task identifier and the latest configuration information thereof to a task control program, and the task control program updates the execution state of the specified task by the acquired latest configuration information;
when the cloud management module deletes the task, the second storage service receives a task deletion message from the MQTT client on the edge node, and then returns a task identifier and a message to be deleted to the task control program, and the task control program stops the service related to the task according to the obtained task identifier and deletes the task data file of the specified task stored on the edge node.
Further, the edge node is automatically added, including:
accessing a Kubedge edge node information interface at fixed time;
acquiring current all edge node information, and comparing the current all edge node information with database information;
under the condition that a new edge node exists, a new node mirror image directory is created in a Harbor mirror image warehouse, and edge node information is updated in a database;
and under the condition that no new edge node exists, judging whether the existing edge node information is updated, and if so, updating the edge node information.
Further, the enabling/disabling node includes: disabling the automatically added edge nodes by default, controlling the enabling and disabling of the edge nodes by using a state button, and simultaneously modifying the use state information of the corresponding nodes in the database by calling the first storage service unit;
the deleting node comprises: calling a first storage service unit to a database to acquire relevant information of the edge node through the number of the selected edge node, judging whether a running task exists on the edge node, if so, stopping deleting, if not, calling an edge node deleting instruction in an instruction library, and then modifying the information of the edge node in the database into deleted;
and the terminal equipment type management unit is used for adding terminal equipment types, inquiring equipment type information and deleting equipment types.
Further, the node information query includes: when the edge node information is inquired, all the edge node information is acquired from the database by calling the first storage service unit, table display is carried out at the front end, and after the edge node is clicked, the CPU, the storage utilization rate and the connected terminal equipment of the node can be displayed through the chart.
Further, the terminal device class adding includes:
setting the category of terminal equipment;
adding a terminal equipment identification program;
if the terminal equipment identification program meets the requirements of format and integrity, judging whether the equipment data is repeated, updating the mirror image of the edge maintenance program under the condition of not repeating, and retransmitting the updated edge maintenance program;
the device category information query comprises: when the category information of the terminal equipment is inquired, the first storage service unit is called to obtain the category information of all the terminal equipment from the database, and table display is carried out at the front end; after the class of the terminal equipment is clicked, displaying the equipment pictures and the equipment data format corresponding to the class, and providing a download link of the equipment detection program.
Further, the device category deleting includes: calling a first storage service unit to a database through the number of the selected terminal equipment category to acquire the relevant information of the terminal equipment category, judging whether the edge node is connected with equipment of the category, if so, stopping deleting, if not, calling the first storage service unit to delete an equipment detection program in a disk and the equipment category data in the database, reconstructing an edge maintenance program mirror image, calling the first storage service unit to delete an original edge maintenance program mirror image through a Harbor mirror image warehouse, adding a new edge maintenance program mirror image, calling a task scheduling unit to stop an edge maintenance program executed by each edge node originally, and issuing the updated edge maintenance program to each edge node for execution again.
Further, the task adding comprises:
setting task basic information, wherein the task basic information comprises a task name and a task description;
selecting edge nodes to execute the task, automatically screening the edge nodes which are on-line and enabled in the terminal equipment type management unit as optional nodes, and supporting the simultaneous selection of a plurality of edge nodes; when the selection is confirmed, an interface in the terminal equipment type management unit is called to inquire the state of the edge node, and if the state of the node is changed, a prompt is given and the edge node is required to be reselected;
acquiring the name of the selected edge node, generating a unique identifier for a task to be executed on each node, and creating a directory stored by a task program;
adding a task program, and calling the first storage service unit to upload the task program to the created directory through an HTTP (hyper text transport protocol);
checking whether the task program meets the requirements or not, if not, stopping the flow, giving a prompt and calling the first storage service unit to delete the created directory;
generating a corresponding file by combining an edge node name and a task identifier based on the file templates of deployment, run, device and DockerFile, and calling the first storage service unit to store the file in the created directory;
generating default task configuration information, and calling the first storage service unit to store the task information into a database;
executing task issuing in an asynchronous mode;
the task state information is automatically updated, and the method comprises the following steps:
accessing an API (application program interface) provided by the timing task through a Kubeedge cloud server address every minute by the timing task, constructing a Kubeedge Java client, acquiring current state information of all tasks by a method provided by the client, comparing the current task state information with the state information in the database by calling the first storage service unit, and updating the state information in the database if the task state information is inconsistent;
the task configuration comprises the following steps:
the task in the running state can be configured, when configuration parameters are set, a first storage service unit is called to update the configuration information of the task in the database, then a device.yaml file generated by the task is modified based on the task configuration information, and a task configuration modification instruction in the instruction library is called;
the task information query comprises the following steps:
when the task information is inquired, all the task information is acquired from the database by calling the first storage service unit, and table display is carried out at the front end;
the task stopping includes:
the task with the state of running can be stopped, when the stopping operation is executed, the task can access the API interface provided by the Kubeedge cloud server through the Kubeedge cloud server address, a Kubeedge Java client is constructed, then the task state information is obtained through a method provided by the client, whether the actual state of the task is running or not is judged, if not, the flow is terminated, the first storage service unit is called to update the task state in the database to be the actual state, if yes, the task termination instruction in the instruction library is called, and then the first storage service unit is called to update the task state information in the database to be stopped;
the task starting comprises the following steps:
the task with the state of 'stop' can be started, when the starting operation is executed, the task can access the API interface provided by the Kubeedge cloud server through the Kubeedge cloud server address, the Kubeedge Java client is constructed, the task state information is obtained through a method provided by the client, whether the actual state of the task is 'stop' is judged, if not, the process is terminated, and the first storage service unit is called to update the actual state of the task in the database.
The task deletion comprises the following steps:
the task with the state of stop can be deleted, when the deletion operation is executed, the user can access the API interface provided by the task through the Kubeedge cloud server address, a Kubeedge Java client is constructed, then the task state information is obtained through a method provided by the client, whether the actual state of the task is stop is judged, if not, the process is terminated, the first storage service unit is called to update the actual state of the task in the database, if yes, the device.yaml file of the edge maintenance program task is modified based on the identification of the task to be deleted, a task configuration modification instruction in the instruction library is called, the task execution module is used for deleting the task data file stored on the edge node by the task, then the first storage service unit is called to delete the data file and the created directory obtained by the task in the disk, the task image uploaded in the Harbor image warehouse is deleted, and the task information and the task data file information in the database are deleted.
Further, the asynchronous mode performs task delivery, including:
calling a mirror image constructing instruction in the instruction library based on the generated DokcerFile and the uploaded task program, calling the first storage service unit to modify the task state into 'construction failure' if the mirror image constructing instruction fails, and terminating the flow;
calling a mirror image uploading instruction in the instruction library to upload the constructed task mirror image to a mirror image directory created by the terminal equipment type management unit of the edge node in the Harbor mirror image warehouse, calling the first storage service unit to modify the task state into 'construction failure' if the mirror image uploading fails, and terminating the flow;
calling a mirror image deleting instruction in the instruction library to delete the task mirror image constructed by the cloud;
and calling a task issuing instruction in the instruction library based on the generated files of deployment. If the task is successfully issued, the first storage service unit is called to modify the task state into 'being issued', if the task is failed to be issued, the first storage service unit is called to modify the task state into 'failure in operation', the process is terminated, and the task state information is automatically updated into 'in operation' after the task is completed and issued.
Further, the data receiving comprises:
calling the first cloud side communication service to start a cloud side data receiving interface, receiving task data uploaded by each edge through the interface, dividing the data into normal data and failure data, calling a first storage service unit to store the data into a database when the normal data are received, analyzing the return failure information contained in the failure data when the failure data are received, and calling the first storage service unit to store the information into the database;
the data issuing comprises the following steps:
uploading the data file to a cloud server through an HTTP request, calling the first cloud side communication service to create a cloud side data downloading link, then modifying a device.yaml file generated by the task based on the data downloading link and the task identifier, and calling a task configuration modification instruction in the instruction library.
The data presentation comprises:
and calling the first storage service to obtain the relevant data information of the task from the database through the serial number of the selected task, and performing table display at the front end. The detailed information and the data content of the normal data can be checked, and only the data information can be checked for the failed data. And the failed data supports manual retransmission, and a task configuration modification instruction in the instruction library is called by modifying a device.yaml file generated in the task adding unit based on retransmission data information and a task identifier through clicking retransmission.
Further, the returning data generated by the task executed on the edge node to the cloud management module includes:
calling the second cloud side communication service unit to upload data to the cloud management module, and adding the data into a failure queue if the data are uploaded unsuccessfully; sequentially executing uploading operation on the data in the failure queue every minute through the timing task, deleting the data from the failure queue if the data are uploaded successfully, and waiting for the next timing task to be executed if the data are uploaded unsuccessfully; if the retransmission time of the data exceeds one hour, defining the retransmission time as historical data, calling the second storage service to store the data into a disk file, wherein the file name is formed by adding a task identifier and a time stamp, and deleting the data from a failure queue; the historical data file names are put into a historical data uploading queue, uploading operation is sequentially performed on the file names in the historical data queue every minute through a timing task, if uploading is successful, the file names are deleted from the historical data queue, meanwhile, the second storage service is called to delete files corresponding to the file names, and if uploading is failed, the next timing task execution is waited;
and when receiving the historical data retransmission operation of the cloud, reading the data in the corresponding file and putting the data into a failure queue to wait for the next timing task execution.
According to the cloud-edge cooperative system, the problems that a cloud-edge cooperative platform constructed by a cloud service provider lacks universality and cannot be freely built and migrated are solved, the cloud-edge cooperative platform can be built on any equipment meeting basic configuration requirements, the migration of services can be completed only by simple copying when the services need to be migrated, and a user can completely control the services, so that the universality of the system is greatly enhanced, the use cost is reduced, the visual operation and the automatic maintenance of an edge body are realized on the basis of an open source edge computing framework Kubed, the difficulty of manual maintenance is reduced, and the usability of the system is improved by adding intelligent task scheduling and data transmission capability between cloud edges.
Drawings
In order to more clearly illustrate the detailed description of the invention or the technical solutions in the prior art, the drawings used in the detailed description or the prior art description will be briefly described below. Throughout the drawings, like elements or portions are generally identified by like reference numerals. In the drawings, elements or portions are not necessarily drawn to scale.
Fig. 1 is a design diagram of the cloud edge collaboration system architecture.
Fig. 2 is a layered architecture diagram of the cloud management module.
Fig. 3 is a flow chart of edge node automatic addition.
Fig. 4 is a flow chart of deleting edge nodes.
Fig. 5 is a flow chart of edge node automatic addition.
Fig. 6 is a flow chart of device class deletion.
Fig. 7 is a task addition flow chart.
Fig. 8 is a flow chart of asynchronous task delivery.
FIG. 9 is a diagram of an edge maintenance module layered architecture.
Fig. 10 is a data transmission flowchart.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
The invention will now be further described with reference to the accompanying drawings.
The embodiment of the invention provides a cloud edge coordination system constructed based on a Kubeedge edge computing framework, wherein the structural design of the cloud edge coordination system is shown in a figure 1: the cloud edge coordination system is divided into a cloud management module and an edge maintenance module.
S1, a cloud management module.
The cloud management module hierarchical architecture is as shown in fig. 2:
the cloud management module architecture is divided into a display layer, a service layer, a dependence layer and a hardware layer, wherein the display layer provides an application function for a user, the service layer provides a basic service for the application function of the display layer and calls dependence layer software, the dependence layer is software on which the cloud management module depends, and the hardware layer is hardware equipment used by the cloud management module.
In the following, the method for implementing functions in the presentation layer and the service layer will be described with emphasis, and only software in the dependent layer will be briefly described as follows:
kubeedge is an edge computing framework built on the basis of kubernets, nodes and devices extending the containerized application orchestration function to the edge, kubernets is a container orchestration program for managing containerized applications across multiple hosts, docker is an open-source container engine, harbor is a mirror repository, mySQL is a database.
The cloud management module service layer comprises a first cloud side communication service unit, a first storage service unit, a task scheduling unit and an instruction library.
S1-1, a first cloud side communication service unit.
The first cloud side communication service unit serves as a data transmission channel between the cloud side server and the edge node, a receiving interface of edge data and an access interface of the cloud side data are provided at the cloud side, and the specific contents are as follows:
edge data receiving interface: the interface is automatically opened after the cloud management module is successfully deployed, the edge node sends the task data running on the interface to the interface through the edge maintenance program, decrypts the data after receiving the data from the edge, and then returns the decrypted data to the program for calling the cloud-side communication service.
Cloud data access interface: and establishing a cloud data downloading link according to the data to be issued to the edge node, binding the link and the data stream through the data name and the data address, and then returning the established link to a program for calling the cloud-side communication service.
S1-2, a first storage service unit.
The first storage service unit provides uniform interaction capacity for the cloud management module, the disk, the database and the Harbor mirror image warehouse, and the specific contents are as follows:
a database: the storage service provides the operations of increasing, deleting, modifying and checking the database, judges whether the given data is consistent with the data in the database or not, and returns the operation result of the database to the functional program for calling the storage service.
A magnetic disk: the storage service provides for creating directories and deleting directories, saving files by method, on the server disk by command.
Harbor mirror warehouse: create an item through the Harbor mirror repository interface (https:// Harbor server address/api/projects), delete an item through the Harbor mirror repository interface (https:// Harbor server address/api/projects/item name), delete a mirror through the Harbor mirror repository interface (https:// Harbor server address/api/repositor _ repo _ name = mirror name).
S1-3, and a task scheduling unit.
The task scheduling unit comprises task migration and automatic updating of an edge maintenance task, and the specific contents are as follows:
task migration: tasks issued to the edge nodes are divided into designated edge execution and non-designated edge execution. The task executed by the unspecified edge is executed by the edge node which is allocated by the system and has the most abundant hardware resources, when the edge running the task is disconnected from the cluster and the connection is not recovered for a long time, the system stops the task and allocates a new edge node which has the most abundant hardware resources to the edge node to continue running the task. The task executed by the designated edge is distributed to the designated edge node to be executed, when the edge for running the task is disconnected, the task is kept executed on the edge node, the task information is synchronized after the edge node is connected again, and if the hardware resource of the edge node is insufficient, the system automatically stops the task which is finally executed on the edge node.
Automatic updating of edge maintenance tasks: and accessing the mirror image version of the edge maintenance program in the Harbor mirror image warehouse every minute through the timing task and comparing the mirror image version with the currently executed mirror image versions of all edge nodes, stopping the edge maintenance task on the edge node when the mirror image version executed by the edge node is lower than the latest version, and then re-issuing the latest edge maintenance task to the edge node for execution.
S1-4, an instruction library.
The instruction library comprises operation instructions of Kubeedge, kubernetes and Docker, and can execute corresponding instructions according to parameters transmitted by a calling program, wherein the specific instructions are as follows:
edge node delete instruction (kubecect node name)
Task issue instruction (kubecect application-f deployment. Yaml)
Task configuration modification instruction (kubecect apply-f device. Yaml)
Task termination instruction (kubecect delete-f deployment. Yaml)
Construct mirror image instruction (docker build-t mirror name.)
Mirror upload instruction (docker push mirror name (need to contain harbor server address))
Delete mirror image instruction (docker rmi mirror name)
The cloud management module display layer comprises edge node management, terminal equipment category management, task management and data management.
S1-5, and an edge node management unit.
The edge node management unit is mainly divided into automatic edge node adding, node information inquiring, node information editing, node enabling/disabling and node deleting.
S1-5-1, and automatically adding a unit to the edge node.
When a new edge node is added into the kubeige cluster, the cloud management module will automatically acquire the new edge node information and add the new edge node information into the database, and the implementation flow is as shown in fig. 3:
the method comprises the steps that a timed task accesses an API interface provided by the timed task through a Kubeedge cloud server address every minute, a Kubeedge Java client is constructed, then information of all current edge nodes is obtained through a method kubberenetes client () provided by the client, the current edge node information is compared with information difference in a database by calling S1-2 storage service, if an edge node is newly added, the S1-2 storage service is called to create a new node mirror image project through a Harbor mirror image warehouse interface, the edge node information is updated in the database, and otherwise, the existing edge node information is updated. After the addition of the edge node is completed, an edge maintenance program is operated on the edge node in a task execution mode, cloud side communication service is called from the cloud side to S1-1 to receive data returned by the edge node, and then hardware use data of the edge node and terminal equipment data are called to S1-2 storage service to be stored in a database.
S1-5-2, inquiring edge node information.
And when the edge node information is inquired, calling the S1-2 storage service to obtain all the edge node information from the database, and performing table display at the front end. After the edge node is clicked, detailed information of a CPU, storage utilization rate, connected terminal equipment and the like of the node can be displayed through a chart.
S1-5-3, enable/disable nodes.
The default of the automatically added edge nodes is forbidden, the enabling and the disabling of the edge nodes can be controlled by using a state button, when the using state of the nodes is changed, the functions of task management, data transmission and the like can be influenced, and meanwhile, the S1-2 storage service is called to modify the using state information of the corresponding nodes in the database.
S1-5-4, and deleting nodes.
The edge node that has exited from the Kubeedge cluster or is no longer used may be deleted, and the implementation flow is as shown in fig. 4:
and calling S1-2 storage service to obtain the relevant information of the edge node in the database through the number of the selected edge node, judging whether the running task exists on the edge node, if so, stopping deleting, otherwise, calling an edge node deleting instruction in an S1-4 instruction library, and then modifying the information of the edge node in the database into deleted.
S1-6, and a terminal equipment category management unit.
The terminal equipment category management unit is mainly used for adding terminal equipment categories, inquiring equipment category information and deleting equipment categories.
S1-6-1, adding terminal equipment types.
When a new terminal device type is added, basic information of the terminal type needs to be set, a terminal device detection program is added, and an edge maintenance program is updated, so that the implementation flow is as shown in fig. 5:
when a new terminal device type is added, a terminal device type name, a device interface protocol, a device data format and the like need to be input, and a device detection program is added. After input data integrity and format inspection is carried out, calling S1-2 storage service to a database to check whether equipment data are repeated or not, storing the equipment data to the database if the equipment data are not repeated, uploading an equipment detection program to a disk through an HTTP (hyper text transport protocol), then reconstructing an edge maintenance program mirror image according to a terminal equipment detection program, calling S1-2 storage service to delete a primary edge maintenance program mirror image through a Harbor mirror image warehouse interface, adding a new mirror image, calling S1-3 task scheduling to stop an edge maintenance program executed by each edge node originally, and re-issuing the updated program to each edge node for execution.
S1-6-2, inquiring equipment category information.
When the terminal equipment category information is inquired, all the terminal equipment category information is obtained in the database by calling the S1-2 storage service, and table display is carried out at the front end. After the terminal device category is clicked, detailed information such as device pictures and device data formats of the category can be displayed, and a download link of a device detection program is provided.
S1-6-3, deleting the equipment category.
When there is no device connected to the edge node in the terminal device class, the device class can be deleted, and the implementation flow is as shown in fig. 6:
calling S1-2 storage service to obtain the relevant information of the terminal equipment category from a database through the number of the selected terminal equipment category, judging whether the edge node is connected with equipment of the category, if yes, stopping deleting, otherwise, calling S1-2 storage service to delete the equipment detection program in the disk and the equipment category data in the database, then reconstructing an edge maintenance program mirror image, calling S1-2 storage service to delete the original edge maintenance program mirror image through a Harbor mirror image warehouse, adding a new mirror image, calling S1-3 task scheduling to stop the edge maintenance program executed by each edge node, and issuing the updated program to each edge node for execution again.
S1-7, and a task management unit.
The task management unit is mainly used for realizing task addition, automatic updating of task state information, task configuration, task information query, task restart, task stop and task deletion.
S1-7-1, adding tasks.
When a new task is created, basic information of the task needs to be set, an executed edge node is selected, a task program is uploaded, a task mirror image is constructed, and finally the task is issued to a specified edge to run, so that the implementation flow is as shown in fig. 7:
the execution flow of task addition will be described in detail below:
step 1, setting task basic information such as task names, task descriptions and the like.
And 2, selecting the edge node to execute the task, automatically screening the enabled edge node with the online state in the S1-5-2 by the system to serve as an optional node, and supporting the simultaneous selection of a plurality of edge nodes. When the selection is confirmed, the system calls the interface in the S1-5-2 again to inquire the state of the edge node, and if the state of the node is changed, a prompt is given and the edge node is required to be reselected.
And 3, acquiring the name of the selected edge node, generating a unique identifier for the task to be executed on each node, and creating a directory stored by the task program.
And 4, adding a task program, and calling S1-2 storage service to upload the task program to the directory created in the step 3 through an HTTP (hyper text transport protocol).
And 5, checking whether the task program meets the requirements and does not meet the flow to be terminated, giving a prompt and calling the S1-2 storage service to delete the directory created in the step 3.
And step 6, generating a corresponding file by combining the edge node name and the task identifier based on the file templates of the deployment. Yaml, the run.yaml, the device.yaml and the DockerFile, and calling the S1-2 storage service to store the file into the directory created in the step 3.
And 7, generating default task configuration information, and calling S1-2 storage service to store the task information into a database.
And 8, executing task issuing in an asynchronous mode.
When the asynchronous execution task is issued to the edge for execution, a task mirror image needs to be constructed, the mirror image is uploaded to a Harbor mirror image warehouse, then the task is issued to a designated edge node, and finally the task state is updated, so that the implementation flow is as shown in fig. 8:
the following will describe in detail the execution flow of asynchronous task issuing:
and 8-1, calling an S1-4 instruction library to construct a mirror image instruction based on the DokcerFile generated in the step 6 and the task program uploaded in the step 4. If the mirror image is failed to be constructed, the S1-2 storage service is called to modify the task state into 'construction failure', and the process is terminated.
And 8-2, calling a mirror image uploading instruction in the S1-4 instruction library to upload the task mirror image constructed in the step 8-1 to a mirror image catalog created by the S1-5-1 of the edge node in the Harbor mirror image warehouse. And if the mirror image uploading fails, calling the S1-2 storage service to modify the task state into 'construction failure', and terminating the flow.
And 8-3, calling a delete mirror image instruction in the S1-4 instruction library to delete the task mirror image constructed by the cloud in the step 8-1.
And 8-4, calling a task issuing instruction in the S1-4 instruction library based on the deployment. Yaml and run. Yaml files generated in the step 6. If the task is successfully issued, the S1-2 storage service is called to modify the task state into 'being issued', if the task is failed to be issued, the S1-2 storage service is called to modify the task state into 'failure operation', and the process is terminated. After the task is finished and issued, the task state information is automatically updated to be 'running'.
And S1-7-2, automatically updating the task state information.
The timed task accesses an API interface provided by the timed task through a Kubeedge cloud server address every minute to construct a Kubeedge Java client, acquires the current state information of all tasks by a method kubberenetes client (), compares the current state information of the tasks with the state information in the database by calling S1-2 storage service, and updates the state information in the database if the state information of the tasks is inconsistent.
S1-7-3, task configuration.
The task in the state of running can be configured, when the configuration parameters are set, the S1-2 storage service is called to update the configuration information of the task in the database, then the device.yaml file generated in the step 6 in the task S1-7-1 is modified based on the task configuration information, and a task configuration modification instruction in the S1-4 instruction library is called.
S1-7-4, task information query.
When the task information is inquired, all the task information is acquired in the database by calling the S1-2 storage service, and table display is carried out at the front end.
S1-7-5, stopping the task.
The task with the state of running can be stopped, when the stopping operation is executed, the task can access the API interface provided by the Kubeedge cloud server through the Kubeedge cloud server address to construct a Kubeedge Java client, then the method kubberness client () provided by the client is used for obtaining the task state information, whether the actual state of the task is running is judged, if not, the process is terminated, S1-2 storage service is called to update the actual state of the task in the database, if yes, a task termination instruction in the S1-4 instruction library is called, and then S1-2 storage service is called to update the task state information in the database to be stopped.
S1-7-6, starting a task.
The task with the state of 'stop' can be started, when the starting operation is executed, the task can access the API interface provided by the Kubeedge cloud server through the Kubeedge cloud server address, a Kubeedge Java client is constructed, the task state information is obtained through a method kubberenetes client () provided by the client, whether the actual state of the task is 'stop' or not is judged, if not, the process is terminated, S1-2 storage service is called to update the task state in the database to be the actual state, and if yes, the process in the step 8-4 in the step S1-7-1 is executed.
S1-7-7, task deletion.
The task with the state of stop can be deleted, when the deletion operation is executed, an API interface provided by the task can be accessed through a Kubeedge cloud server address, a Kubeedge Java client is constructed, the task state information is obtained through a method kubeenet client () provided by the client, whether the actual state of the task is stop or not is judged, if not, the process is terminated, S1-2 storage service is called to update the actual state of the task in the database, if yes, the device.yaml file of the edge maintenance program task is modified based on the task identifier to be deleted, a task configuration modification instruction in an S1-4 instruction library is called, a task execution module is used to delete the task data file stored on the edge node of the task, then S1-2 storage service is called to delete the data file obtained by the task in the disk, the directory created in the S1-7-1 step 3 is called, the task image uploaded in the S1-7-1 step 8-2 in the Harbor image warehouse is deleted, and the task information and the task data file information in the database are deleted.
S1-8, and a data management unit.
The data management unit is mainly divided into data receiving, data issuing and data displaying.
S1-8-1, receiving data.
Calling S1-1 cloud side communication service to start a cloud side data receiving interface, receiving task data uploaded by each edge through the interface, dividing the data into normal data (data normally returned by the task) and failure data (in order to save network overhead, returning the data which fails due to network fluctuation and repeated retransmission, and taking the data information of the returned part as failure data after network recovery), calling S1-2 storage service to store the data into a database when the normal data are received, and analyzing the return failure information contained in the failure data and calling S1-2 storage service to store the information into the database when the failure data are received.
S1-8-2, data issuing.
Uploading the data file to a cloud server through an HTTP request, calling S1-1 cloud side communication service to create a cloud side data downloading link, then modifying the device.yaml file generated in the step 6 in the task S1-7-1 based on the data downloading link and the task identifier, and calling a task configuration modification instruction in an S1-4 instruction library.
S1-8-3, and displaying data.
And calling S1-2 storage service to obtain the relevant data information of the task from the database through the number of the selected task, and performing table display at the front end. The detailed information and the data content of the normal data can be checked, and only the data information can be checked for the failed data. And the failed data supports manual retransmission, and the device.yaml file generated in the step 6 in the task S1-7-1 is modified by clicking retransmission data information and a task identifier, and a task configuration modification instruction in an S1-4 instruction library is called.
And S2, an edge maintenance module.
The edge maintenance module is used for automatically constructing a basic program which needs to run on an edge as an edge maintenance mirror image after the cloud management module is deployed, the basic program can be issued to each edge node in a mode of a basic Kube task when the edge node is added into a cluster, the edge maintenance mirror image is executed, a new version mirror image can be automatically constructed when the edge maintenance program is changed, and the edge maintenance program on each edge node can be automatically updated after the fact that the mirror image versions are inconsistent is detected.
The edge maintenance module hierarchical architecture is as shown in fig. 9:
the edge maintenance module architecture is divided into an application layer, a service layer, a dependence layer and a hardware layer, wherein the application layer provides functions for an edge maintenance program, the service layer provides basic services for the application functions of the display layer and calls dependence layer software, the dependence layer is software on which the edge maintenance program depends, and the hardware layer is hardware equipment used by the edge maintenance program.
In the following, the method for implementing functions in the presentation layer and the service layer will be described with emphasis, and the following briefly describes software in the dependency layer:
kubeedge is an edge computing framework constructed based on Kubernetes, and is a node and equipment which extend the containerization application editing function to the edge, a container engine which is an open source, and MQTT which is a client of a message queue telemetry transmission protocol, and is a 'lightweight' communication protocol based on a publish/subscribe mode.
S2-1, a second cloud side communication service unit.
The cloud side communication service is used as a data transmission channel between the cloud side server and the edge node, and provides data uploading and downloading functions at the edge, and the specific contents are as follows:
the cloud side communication service receives data to be returned to the cloud side by the edge node, encrypts the data, and then sends the data to an edge data receiving interface in the S1-1 based on the HTTP. When the data downloading link issued by the cloud is received by the edge, whether the link is overdue or not is judged, and if the link is not overdue, the data is downloaded by accessing a cloud data access interface in the S1-1 based on the HTTP.
S2-2 and a second storage service unit.
The second storage service unit provides a uniform interaction capability for the edge maintenance program, the disk and the MQTT client, and the specific contents are as follows:
a magnetic disk: the storage service provides for creating directories and deleting directories, saving files by method, on the server disk by command.
MQTT client: when the edge maintenance program is issued to the edge node to run, the storage service subscribes the MQTT theme required by the edge maintenance program, when a new task is issued to the edge, the storage service subscribes the MQTT theme of the task according to the task identifier, when the MQTT client receives a message sent to the theme subscribed by the storage service, the message is pushed to the storage service, and then the storage service returns the message to the program corresponding to the theme.
S2-3, and a hardware monitoring unit.
The hardware monitoring unit is used for monitoring hardware resources on the edge node and a terminal device connection interface, mainly collecting and calculating the type, the architecture type, the core number, the calculation frequency and the utilization rate of a CPU (Central processing Unit) of the edge node, the type, the total capacity and the utilization rate of a memory, the type, the total capacity and the utilization rate of a disk, and simultaneously acquiring hardware interface information of the edge node capable of connecting the terminal device, and then returning the hardware information to a calling program.
S2-4, a device discovery unit.
The device discovery unit is configured to discover and identify a terminal device connected to the edge node, and return information of the terminal device to the cloud for display, which is specifically described as follows:
the edge maintenance program comprises detection programs of all terminal equipment types in S1-6 and is executed on the edge node in a task mode. Calling S2-3 hardware to monitor and obtain an interface used by an edge node every minute through a timing task, then sequentially running a device type detection program to send requests to all interfaces on the edge node, if a response is received when the detection program of one device type requests the interface, indicating that the interface is connected with a terminal device, determining the device type, and then calling S2-2 storage service to store the found terminal device information in a disk. After a timing task is executed once, the S2-1 cloud side communication service is called to encrypt all the found device information and then return the encrypted device information to the cloud management module.
S2-5, and a resource monitoring unit.
The resource monitoring unit is used for monitoring the hardware use state and the task execution condition of the edge node, and returning hardware data and data such as whether the hardware data meets the latest task operation or not to the cloud, and the specific description is as follows:
and calling S2-3 hardware monitoring by the timing task to acquire the service condition of the hardware equipment of the edge node, then calculating and counting various hardware data, and then calling S2-2 storage service to store the hardware service information into a disk. And when a new task is issued to the edge for execution, the state maintenance program can judge whether the idle hardware resources of the current edge node can meet the operation of the task, and if the idle hardware resources of the current edge node can not meet the operation of the task, the state maintenance program records the task identifier. And finally, calling the S2-1 cloud side communication service to encrypt the hardware use information and data such as whether the latest task operation is met, and returning the encrypted data to the cloud management module.
S2-6, and a data transmission unit.
The data transmission is used for returning data generated by a task executed on the edge node to the cloud, and the implementation flow is as shown in fig. 10:
and calling the S2-1 cloud side communication service to upload data to the cloud side, and if the data are uploaded unsuccessfully, adding the data into a failure queue. And sequentially executing the uploading operation on the data in the failure queue by the timing task every minute, deleting the data from the failure queue if the data are uploaded successfully, and waiting for the next timing task to be executed if the data are uploaded unsuccessfully. If the retransmission time of the data exceeds one hour, the data is defined as historical data, the data calls S2-2 storage service to be stored in a disk file, the file name is formed by adding a time stamp to a task identifier, and the data is deleted from a failure queue. And (3) putting the historical data file names into a historical data uploading queue, sequentially uploading the file names in the historical data queue by a timing task every minute, deleting the file names from the historical data queue if the uploading is successful, simultaneously calling S2-2 storage service to delete the files corresponding to the file names, and waiting for the next timing task to execute if the uploading is failed.
And when the historical data retransmission operation of the cloud is received, reading the data in the corresponding file and putting the data in a failure queue to wait for the next timing task execution.
S2-7, and a task control unit.
The task control unit is configured to change an execution state of a task on an edge node and release resource consumption of the task according to an operation of the cloud end on the task, and the like, and the specific description is as follows:
when the cloud configures the tasks, the S2-2 storage service receives a change message of task configuration from an MQTT client on the edge node, then returns the task identification and the latest configuration information thereof to the task control program, and the task control program updates the execution state of the specified task by the acquired latest configuration information.
When the cloud side deletes the task, the S2-2 storage service receives a task deletion message from the MQTT client side on the edge node, then returns a task identifier and a message to be deleted to the task control program, and the task control program stops the service related to the task according to the acquired task identifier and deletes the task data file of the specified task stored on the edge node.
In summary, the present invention has at least the following advantages:
1) Simplifying the edge management and maintenance method
When the kubeige is used for managing and maintaining the edge nodes added into the kubeige, the kubeige can be only carried out in a command line mode, and automation operation and real-time monitoring are not supported.
2) Intelligent task management in S1-7
When an edge computing framework Kubeedge is used for executing tasks on each edge node, the operation is extremely complex, an executable program needs to be constructed into a mirror image through a docker, then the mirror image is uploaded to a mirror image warehouse, then a task issuing instruction is called, the task is issued to a specified edge to be executed, and errors in an execution flow are difficult to check. The invention provides intelligent task management capability, can finish task issuing operation only by adding an executable program, can automatically process and prompt errors in the execution process, and can intelligently schedule tasks on the edge resources when the edge resources are insufficient.
3) And S1-8, managing data.
The invention increases the capacity of data transmission and management on the basis of a Kubeedge framework, supports the data transmission to a specified edge at the cloud end and the data transmission to each edge, and provides the capacity of local persistence, retransmission, continuous transmission and the like of edge node data because the edge network has the problem of instability, thereby ensuring that important data is not lost.
4) And supporting the user to define the terminal equipment.
When the cloud edge collaboration platform constructed by a cloud service provider is used, only the types of terminal equipment supported by the cloud edge collaboration platform can be selected, and the number of equipment protocols supported by a Kubean edge computing framework is small, so that the method and the device for automatically discovering the terminal equipment of the corresponding type accessed on the edge node can be automatically found only by adding an equipment detection program at the cloud end and additionally supporting user-defined terminal equipment.
5) S2 edge maintenance procedure
The edge maintenance program realized by the invention is issued to the edge node in a basic task mode to be executed when the edge node is added into the Kubeedge cluster, and provides the capabilities of terminal equipment discovery, edge hardware resource monitoring, cloud edge data transmission and edge task intelligent control for the edge.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.
Claims (10)
1. A cloud edge coordination system constructed based on a Kubeedge edge computing framework is characterized by comprising a cloud management module and an edge maintenance module;
the cloud management module comprises:
the first cloud side communication service unit is used as a data transmission channel between the cloud side server and the edge node, and provides a receiving interface of the edge data and an access interface of the cloud side data at the cloud side;
the edge data receiving interface is configured to be automatically started after the cloud management module is successfully deployed, receive task data running on an edge node, send the task data to the edge data receiving interface through an edge maintenance program, decrypt the task data after receiving the task data, and return the decrypted data to a program for calling cloud-side communication service;
the cloud data access interface is configured to create a cloud data download link according to data issued to the edge node, bind the link and the data stream through a data name and a data address, and then return the created link to a program calling cloud-side communication service;
the first storage service unit is used for data interaction between the cloud management module and the disk, the database and the Harbor mirror image warehouse;
the first storage service unit includes:
the database is used for increasing, deleting, modifying and checking the data, judging whether the given data is consistent with the data in the database or not, and returning an operation result to a functional program for calling the first storage service unit;
the disk is used for creating a directory according to the command, deleting the directory and storing files;
the Harbor mirror image warehouse is used for creating projects and deleting project and mirror images through a Harbor mirror image warehouse interface;
the task scheduling unit comprises a task migration subunit and an edge maintenance task automatic updating subunit:
the task migration subunit is configured to: the task executed by the unspecified edge is executed by the edge node with the richest hardware resources distributed by the system, when the edge running the task is disconnected from the cluster and the connection is not recovered for a long time, the system stops the task and distributes a new edge node with the richest hardware resources to the edge node to continue running the task, the task executed by the specified edge is distributed to the specified edge node to be executed, the execution of the task on the edge node is kept when the edge running the task is disconnected, the cloud end is used for synchronizing task information after the edge node recovers the connection, and if the hardware resources of the edge node are insufficient, the system automatically stops the last task running on the edge node;
the edge maintenance task automatic update subunit is configured to: accessing an edge maintenance program mirror image version in a Harbor mirror image warehouse every minute through a timing task and comparing the image version with the currently executed mirror image versions of all edge nodes, stopping the edge maintenance task on the node when the mirror image version executed by the edge node is lower than the latest version, and then re-issuing the latest edge maintenance task to the edge node for execution;
the system comprises an instruction base, a data base and a data processing module, wherein the instruction base comprises an edge node deleting instruction, a task issuing instruction, a task configuration modifying instruction, a task terminating instruction, a mirror image constructing instruction, a mirror image uploading instruction and a mirror image deleting instruction;
the edge node management unit is used for automatically adding edge nodes, inquiring node information, editing node information, enabling/disabling the nodes and deleting the nodes;
the task management unit is used for task addition, automatic updating of task state information, task configuration, task information inquiry, task restart, task stop and task deletion;
the data management unit is used for receiving data, issuing data and displaying data;
the edge maintenance module includes:
the second cloud-side communication service unit serves as a data transmission channel between the cloud server and the edge node, provides data uploading and downloading functions at the edge, and is specifically configured as:
the method comprises the steps that data to be returned to a cloud end by an edge node are received, the data are encrypted, then the data are sent to an edge data receiving interface in S1-1 based on an HTTP (hyper text transport protocol), when a data downloading link issued by the cloud end is received by an edge, whether the link is overdue or not is judged, and if the link is not overdue, a cloud end data access interface in a first cloud side communication service unit is accessed to download the data based on the HTTP;
the second storage service unit is used for providing uniform interaction capacity between the edge maintenance program and the disk and MQTT client, and comprises:
the disk is used for storing the server disk, creating a directory and deleting the directory through commands, and saving files through a method;
the MQTT client is used for subscribing the MQTT theme required by the edge maintenance program by the storage service when the edge maintenance program is issued to the edge node, subscribing the MQTT theme of the task by the storage service according to the task identifier when a new task is issued to the edge, pushing the message to the storage service when the MQTT client receives the message sent to the theme subscribed by the storage service, and then returning the message to the program corresponding to the theme by the storage service;
the hardware monitoring unit is used for collecting and calculating the type, the architecture type, the core number, the calculation frequency and the utilization rate of the CPU of the edge node, the type, the total capacity and the utilization rate of a memory and the type, the total capacity and the utilization rate of a magnetic disk, acquiring the hardware interface information of the edge node capable of being connected with the terminal equipment, and then returning the hardware information to a calling program;
the device discovery unit is used for discovering and identifying the edge nodes connected to the terminal devices, returning the terminal device information to the cloud for display, and is specifically configured to:
detecting programs including all terminal equipment types in the terminal equipment type management unit are executed on the edge nodes in a task mode; calling the hardware monitoring unit every minute through a timing task to acquire an interface used by an edge node, then sequentially running a device type detection program to send a request to all interfaces on the edge node, if a response is received when the detection program of one device type requests the interface, indicating that the interface is connected with a terminal device, determining the device type, and then calling the second storage service to store the found terminal device information in a disk. After a timing task is executed once, calling the second cloud-side communication service to encrypt all the found equipment information and returning the encrypted equipment information to the cloud management module;
the resource monitoring unit is used for monitoring the hardware use state and the task execution condition of the edge node, and returning hardware data and data such as whether the hardware data meets the latest task operation or not to the cloud, and is specifically configured as follows:
the timing task calls the hardware monitoring unit to obtain the use condition of the hardware equipment of the edge node, then calculates and counts various hardware data, and then calls the second storage service to store the hardware use information into a disk; when a new task is issued to the edge for execution, the state maintenance program can judge whether the idle hardware resources of the current edge node can meet the operation of the task, if the idle hardware resources can not meet the operation of the task, the task identifier is recorded, and finally the second cloud side communication service unit is called to encrypt the hardware use information and the data of whether the idle hardware resources meet the operation of the latest task and the like and then return the encrypted data to the cloud management module;
the data transmission unit is used for returning data generated by the tasks executed on the edge nodes to the cloud management module;
the task control unit is used for changing the execution state of the task on the edge node and releasing the resource consumption of the task according to the operation of the cloud management module on the task, and is specifically configured as follows:
when the cloud management module configures the tasks, the second storage service receives a change message of task configuration from an MQTT client on the edge node, and then returns a task identifier and the latest configuration information thereof to a task control program, and the task control program updates the execution state of the specified task by the acquired latest configuration information;
when the cloud management module deletes the task, the second storage service receives a task deletion message from the MQTT client on the edge node, and then returns a task identifier and a message to be deleted to the task control program, and the task control program stops the service related to the task according to the obtained task identifier and deletes the task data file of the specified task stored on the edge node.
2. The cloud edge collaboration system of claim 1, wherein the edge nodes are added automatically, comprising:
accessing a Kubedge edge node information interface at fixed time;
acquiring information of all current edge nodes, and comparing the information with database information;
under the condition that a new edge node exists, a new node mirror image directory is created in a Harbor mirror image warehouse, and edge node information is updated in a database;
and under the condition that no new edge node exists, judging whether the existing edge node information is updated or not, and if so, updating the edge node information.
3. The cloud-edge collaboration system as claimed in claim 2, wherein the enabling/disabling node comprises: disabling the automatically added edge nodes by default, controlling the enabling and disabling of the edge nodes by using a state button, and simultaneously modifying the use state information of the corresponding nodes in the database by calling the first storage service unit;
the deleting node comprises: calling a first storage service unit to a database through the number of the selected edge node to obtain the relevant information of the edge node, judging whether the edge node has a running task, if so, stopping deleting, otherwise, calling an edge node deleting instruction in an instruction library, and then modifying the information of the edge node in the database into deleted information;
and the terminal equipment category management unit is used for adding terminal equipment categories, inquiring equipment category information and deleting equipment categories.
4. The cloud edge collaboration system as claimed in claim 3, wherein the node information query comprises: when the edge node information is inquired, all the edge node information is acquired from the database by calling the first storage service unit, and table display is performed at the front end, and after the edge node is clicked, a CPU (central processing unit), the storage utilization rate and connected terminal equipment of the node can be displayed through a chart.
5. The cloud-edge collaboration system as claimed in claim 4, wherein the adding of the terminal device class comprises:
setting the category of terminal equipment;
adding a terminal equipment identification program;
if the terminal equipment identification program meets the requirements of format and integrity, judging whether the equipment data is repeated, updating the mirror image of the edge maintenance program under the condition of not repeating, and retransmitting the updated edge maintenance program;
the device category information query comprises: when the category information of the terminal equipment is inquired, the first storage service unit is called to obtain the category information of all the terminal equipment from the database, and table display is carried out at the front end; after the class of the terminal equipment is clicked, displaying the equipment pictures and the equipment data format corresponding to the class, and providing a download link of the equipment detection program.
6. The cloud-edge collaboration system as recited in claim 5, wherein the device class deletion comprises: calling a first storage service unit to a database through the number of the selected terminal equipment category to acquire the relevant information of the terminal equipment category, judging whether the edge node is connected with equipment of the category, if so, stopping deleting, if not, calling the first storage service unit to delete an equipment detection program in a disk and the equipment category data in the database, reconstructing an edge maintenance program mirror image, calling the first storage service unit to delete an original edge maintenance program mirror image through a Harbor mirror image warehouse, adding a new edge maintenance program mirror image, calling a task scheduling unit to stop an edge maintenance program executed by each edge node originally, and issuing the updated edge maintenance program to each edge node for execution again.
7. The cloud-edge collaboration system as claimed in claim 1, wherein the task adding comprises:
setting task basic information, wherein the task basic information comprises a task name and a task description;
selecting an edge node to execute the task, automatically screening the edge node which is in an online state and is started in the terminal equipment type management unit as an optional node, and supporting the simultaneous selection of a plurality of edge nodes; when the selection is confirmed, an interface in the terminal equipment type management unit is called to inquire the state of the edge node, and if the state of the node is changed, a prompt is given and the edge node is required to be reselected;
acquiring the name of the selected edge node, generating a unique identifier for a task to be executed on each node, and creating a directory stored by a task program;
adding a task program, and calling the first storage service unit to upload the task program to the created directory through an HTTP (hyper text transport protocol);
checking whether the task program meets the requirements or not, if not, stopping the flow, giving a prompt and calling the first storage service unit to delete the created directory;
generating a corresponding file by combining an edge node name and a task identifier based on a file template of a default file, a run file, a device file and a DockerFile file, and calling the first storage service unit to store the file in a created directory;
generating default task configuration information, and calling the first storage service unit to store the task information into a database;
executing task issuing in an asynchronous mode;
the task state information is automatically updated, and the method comprises the following steps:
accessing an API (application programming interface) provided by the timing task through a Kubeedge cloud server address every minute, constructing a Kubeedge Java client, acquiring current all task state information by a method provided by the client, comparing the current task state information with state information in a database by calling the first storage service unit, and updating the state information in the database if the task state information is inconsistent;
the task configuration comprises the following steps:
the task in the running state can be configured, when configuration parameters are set, a first storage service unit is called to update the configuration information of the task in the database, then a device.yaml file generated by the task is modified based on the task configuration information, and a task configuration modification instruction in the instruction library is called;
the task information query comprises the following steps:
when the task information is inquired, all the task information is acquired from the database by calling the first storage service unit, and table display is carried out at the front end;
the task stops, including:
the task with the state of running can be stopped, when the stopping operation is executed, the task can access the API interface provided by the Kubeedge cloud server through the Kubeedge cloud server address, a Kubeedge Java client is constructed, then the task state information is obtained through a method provided by the client, whether the actual state of the task is running or not is judged, if not, the flow is terminated, the first storage service unit is called to update the task state in the database to be the actual state, if yes, the task termination instruction in the instruction library is called, and then the first storage service unit is called to update the task state information in the database to be stopped;
the task starting comprises the following steps:
and the task in the state of stop can be started, when the starting operation is executed, the Kubean cloud server address is used for accessing the API interface provided by the Kubean cloud server address, a Kubean Java client is constructed, the task state information is obtained by a method provided by the client, whether the actual state of the task is stop or not is judged, if not, the process is terminated, and the first storage service unit is called to update the actual state of the task in the database.
The task deletion comprises the following steps:
the task with the state of stop can be deleted, when the deletion operation is executed, an API interface provided by the task can be accessed through a Kubeedge cloud server address, a Kubeedge Java client is constructed, the task state information is obtained through a method provided by the client, whether the actual state of the task is stopped or not is judged, if not, the process is terminated, the first storage service unit is called to update the actual state of the task in the database, if yes, the device.yaml file of the edge maintenance program task is modified based on the identification of the task to be deleted, the task configuration modification instruction in the instruction library is called, the task execution module is used for deleting the task data file stored on the edge node by the task, the first storage service unit is called to delete the data file and the created directory obtained by the task in the disk, the task image uploaded in the Harbor image library is deleted, and the task information and the task data file information in the database are deleted.
8. The cloud-edge collaboration system of claim 1, wherein the asynchronous manner of performing task delivery comprises:
calling a mirror image constructing instruction in the instruction library based on the generated DokcerFile and the uploaded task program, calling the first storage service unit to modify the task state into 'construction failure' if the mirror image constructing instruction fails, and terminating the flow;
calling a mirror image uploading instruction in the instruction library to upload the constructed task mirror image to a mirror image directory created by the terminal equipment type management unit of the edge node in the Harbor mirror image warehouse, calling the first storage service unit to modify the task state into 'construction failure' if the mirror image uploading fails, and terminating the flow;
calling a mirror image deleting instruction in the instruction library to delete the task mirror image constructed by the cloud;
and calling a task issuing instruction in the instruction library based on the generated files of deployment. If the task is successfully issued, the first storage service unit is called to modify the task state into 'under-delivery', if the task is failed to be issued, the first storage service unit is called to modify the task state into 'operation failure', the process is terminated, and the task state information is automatically updated into 'operation' after the task is completed and issued.
9. The cloud-edge collaboration system as recited in claim 1, wherein the data receiving comprises:
the first cloud side communication service is called to start a cloud side data receiving interface, task data uploaded by each edge are received through the interface, the data are divided into normal data and failure data, when the normal data are received, a first storage service unit is called to store the data into a database, when the failure data are received, the returned failure information contained in the data are analyzed, and the first storage service unit is called to store the information into the database;
the data issuing comprises the following steps:
uploading the data file to a cloud server through an HTTP request, calling the first cloud side communication service to create a cloud side data downloading link, then modifying a device.yaml file generated by the task based on the data downloading link and the task identifier, and calling a task configuration modification instruction in the instruction library.
The data presentation comprises:
and calling the first storage service to obtain the relevant data information of the task from the database through the serial number of the selected task, and performing table display at the front end. The detailed information and the data content of the normal data can be checked, and only the data information can be checked for the failed data. And the failed data supports manual retransmission, a device.yaml file generated by the task in the task adding unit is modified based on retransmission data information and the task identifier by clicking retransmission, and a task configuration modification instruction in an instruction library is called.
10. The cloud edge collaboration system of claim 1, wherein returning data generated by tasks executing on the edge nodes to the cloud management module comprises:
calling the second cloud side communication service unit to upload data to the cloud management module, and if uploading fails, adding the data into a failure queue; sequentially executing uploading operation on the data in the failure queue every minute through the timing task, deleting the data from the failure queue if the data are uploaded successfully, and waiting for the next timing task to be executed if the data are uploaded unsuccessfully; if the retransmission time of the data exceeds one hour, defining the retransmission time as historical data, calling the second storage service to store the data into a disk file, forming a file name by adding a time stamp to a task identifier, and deleting the data from a failure queue; the historical data file names are put into a historical data uploading queue, uploading operation is sequentially performed on the file names in the historical data queue every minute through a timing task, if uploading is successful, the file names are deleted from the historical data queue, meanwhile, the second storage service is called to delete files corresponding to the file names, and if uploading is failed, the next timing task execution is waited;
and when receiving the historical data retransmission operation of the cloud, reading the data in the corresponding file and putting the data into a failure queue to wait for the next timing task execution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211260705.8A CN115858108A (en) | 2022-10-14 | 2022-10-14 | Cloud edge coordination system constructed based on Kubeedge edge computing framework |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211260705.8A CN115858108A (en) | 2022-10-14 | 2022-10-14 | Cloud edge coordination system constructed based on Kubeedge edge computing framework |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115858108A true CN115858108A (en) | 2023-03-28 |
Family
ID=85661534
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211260705.8A Pending CN115858108A (en) | 2022-10-14 | 2022-10-14 | Cloud edge coordination system constructed based on Kubeedge edge computing framework |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115858108A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116389491A (en) * | 2023-04-03 | 2023-07-04 | 中国电子技术标准化研究院 | Cloud edge computing power resource self-adaptive computing system |
CN116886691A (en) * | 2023-09-08 | 2023-10-13 | 蓝思系统集成有限公司 | File management control method, device, system and storage medium |
-
2022
- 2022-10-14 CN CN202211260705.8A patent/CN115858108A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116389491A (en) * | 2023-04-03 | 2023-07-04 | 中国电子技术标准化研究院 | Cloud edge computing power resource self-adaptive computing system |
CN116389491B (en) * | 2023-04-03 | 2023-11-07 | 中国电子技术标准化研究院 | Cloud edge computing power resource self-adaptive computing system |
CN116886691A (en) * | 2023-09-08 | 2023-10-13 | 蓝思系统集成有限公司 | File management control method, device, system and storage medium |
CN116886691B (en) * | 2023-09-08 | 2024-02-09 | 蓝思系统集成有限公司 | File management control method, device, system and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11741412B2 (en) | Event-based composition model for workflow systems | |
KR101891506B1 (en) | Methods and systems for portably deploying applications on one or more cloud systems | |
CN115858108A (en) | Cloud edge coordination system constructed based on Kubeedge edge computing framework | |
US9015651B2 (en) | Gateway data distribution engine | |
CN112051993B (en) | Method, device, medium and equipment for generating state machine template and processing task | |
CN101472140B (en) | System for distributing and requiring multimedia program and implementing method thereof | |
CN103019757A (en) | Method, device and system for synchronizing software among multiple clients | |
JP2010518490A (en) | Synchronization framework for irregularly connected applications | |
JP2004227359A (en) | Operation management method for storage system based on policy | |
WO2021244644A1 (en) | Method for dynamically integrating application, and software system and machine therefor | |
CN106790403B (en) | Method for realizing mobile cloud computing intermediate platform and method for realizing distribution | |
WO2019027597A1 (en) | Workflows management framework | |
CN111651418B (en) | Document content downloading method and device, computer equipment and storage medium | |
CN114374813A (en) | Multimedia resource management method, recorder and server | |
CN109614271A (en) | Control method, device, equipment and the storage medium of multiple company-data consistency | |
CN110633250B (en) | Resource management system and method | |
JP5886901B2 (en) | Storage medium for providing system, method and program for managing distribution of contents to apparatus | |
CN115309500A (en) | Method and system for deploying application and managing operation and maintenance of micro service architecture on cloud | |
WO2000063801A1 (en) | Managed remote virtual mass storage for client data terminal | |
CN114896078A (en) | Data synchronization method, system, device and equipment | |
CN115878138B (en) | Application pre-download method, device, computer and storage medium | |
CN115344273A (en) | Method and system for running application software based on shelf system | |
CN115237547A (en) | Unified container cluster hosting system and method for non-intrusive HPC computing cluster | |
CN111061723A (en) | Workflow implementation method and device | |
US20180063242A1 (en) | Method and apparatus for operating infrastructure layer in cloud computing architecture |
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 |