Internet of things data anomaly detection method and system based on server-free architecture

文档序号:1875313 发布日期:2021-11-23 浏览:5次 中文

阅读说明:本技术 一种基于无服务器架构的物联网数据异常检测方法及系统 (Internet of things data anomaly detection method and system based on server-free architecture ) 是由 陈铭松 周亮 黄红兵 焦阳 马言悦 戴静安 于 2021-08-09 设计创作,主要内容包括:本发明公开了一种基于无服务器架构的物联网数据异常检测方法,所述方法包括:采用第三方物联网云平台作为物联网设备的接入端,所有物联网设备通过特定协议接入第三方物联网平台,并将采集的数据上报到第三方物联网平台;用户为接入系统的任一物联网设备选择合适的异常检测算法并配置相应的参数;采用无服务器架构实现数据异常检测端构建,根据算法和参数为设备自动生成和部署异常检测用的训练云函数和推理云函数。训练云函数训练异常检测模型并将其供推理云函数调用。部署完异常检测算法的设备上报的新数据点转发至推理云函数进行异常检测,并返回检测结果。本发明还提出了一种基于无服务器架构的物联网数据异常检测系统。(The invention discloses a server-free architecture-based data anomaly detection method for the Internet of things, which comprises the following steps: the method comprises the following steps that a third-party Internet of things cloud platform is used as an access end of Internet of things equipment, all the Internet of things equipment is accessed to the third-party Internet of things platform through a specific protocol, and collected data are reported to the third-party Internet of things platform; a user selects a proper anomaly detection algorithm for any Internet of things equipment accessed to the system and configures corresponding parameters; the data anomaly detection end is constructed by adopting a server-free framework, and a training cloud function and a reasoning cloud function for anomaly detection are automatically generated and deployed for equipment according to an algorithm and parameters. And training the cloud function to train the anomaly detection model and calling the anomaly detection model for the reasoning cloud function. And forwarding the new data points reported by the equipment with the deployed anomaly detection algorithm to a reasoning cloud function for anomaly detection, and returning a detection result. The invention further provides a system for detecting the data abnormality of the Internet of things based on the server-free architecture.)

1. A data anomaly detection method of the Internet of things based on a server-free architecture is characterized by comprising the following steps:

step 1: the method comprises the following steps that a third-party Internet of things cloud platform is used as an access end of Internet of things equipment, all the Internet of things equipment is accessed into the third-party Internet of things cloud platform through a specific protocol, and collected data are reported to the third-party Internet of things cloud platform;

step 2: a user selects a proper anomaly detection algorithm for any Internet of things equipment accessed to the system and configures corresponding parameters;

and step 3: constructing a data anomaly detection end by adopting a server-free architecture, and automatically generating and deploying a training cloud function and a reasoning cloud function for anomaly detection for equipment according to an algorithm and parameters; after deployment is finished, training the abnormal detection model according to the historical data of the equipment by the training cloud function, and storing the abnormal detection model in NAS file storage service for calling the reasoning cloud function;

and 4, step 4: and the new data points reported by the equipment with the deployed anomaly detection algorithm are forwarded to the reasoning cloud function for anomaly detection through the data push service of the third-party Internet of things cloud platform, the reasoning cloud function reads the trained anomaly detection model from the NAS file storage service for anomaly detection of the new data, and a detection result is returned.

2. The server-less architecture based data anomaly detection method for the internet of things as claimed in claim 1, wherein the third party internet of things cloud platform is china mobile OneNET, ariloc IoT, amazon IoT; the equipment access end is realized by adopting a third-party Internet of things cloud platform, and the data anomaly detection end is realized by adopting an Ali cloud function computing platform.

3. The method for detecting the data abnormality of the internet of things based on the serverless architecture as claimed in claim 1, wherein in the step 1, the specific protocol is a communication protocol, and includes MQTT, Modbus, HTTP; the acquired data are various numerical data acquired by the Internet of things equipment in different scenes.

4. The internet of things data anomaly detection method based on the server-free architecture as claimed in claim 1, wherein in the step 2, the anomaly detection algorithm comprises IForest, CBLOF, OCSVM, AutoEncoder, DBSCAN; the configured parameters comprise data pollution rate and training parameters required by various anomaly detection algorithms.

5. The method for detecting the data abnormality of the internet of things based on the server-free architecture as claimed in claim 1, wherein in the step 3, the training and reasoning of the detection model are realized through a cloud function in the server-free architecture, and the cloud function is charged according to the calling times.

6. The method for detecting the data anomaly of the internet of things based on the server-free architecture as claimed in claim 1, wherein the training cloud function and the reasoning cloud function are automatically generated according to a template and are deployed on a server-free computing platform; the template is preset in the system in a text file mode, and specific parameters in the template occupy the position in a template character string mode; the training cloud function and the reasoning cloud function are automatically generated according to the placeholder in the front-end transferred specific parameter replacement template during algorithm deployment, and automatic deployment is achieved through the SDK provided by the Ali cloud function computing platform.

7. A system for implementing the method according to any one of claims 1 to 6, wherein the system comprises a data dump module, an algorithm deployment module, a cloud function automatic generation and deployment module and a training and reasoning module.

8. The system of claim 7, wherein the data unloading module is responsible for receiving the internet of things device data pushed by a third-party internet of things cloud platform and storing the internet of things device data in a database for use in a subsequent deployment algorithm and a training model;

the algorithm deployment module provides a window for deploying the anomaly detection algorithm for a system user in a Web page form, and the system user modifies or inputs the anomaly detection algorithm and corresponding parameters required to be selected;

the cloud function automatic generation and deployment module is responsible for automatically generating codes for training a cloud function and a reasoning cloud function according to the template and the parameters transmitted by the front end, and automatically deploying the codes to the cloud end through the SDK provided by the function computing platform;

the training and reasoning module is deployed in the Alice cloud function computing platform in the form of a training cloud function and a reasoning cloud function and is respectively responsible for training an anomaly detection model and calling the model to perform anomaly detection.

9. A hardware system for implementing the method of any of claims 1-6, the hardware system comprising: a memory and a processor; the memory has stored thereon a computer program which, when executed by the processor, implements the method of any of claims 1-6.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.

Technical Field

The invention belongs to the technical field of computers, and relates to a method and a system for detecting data abnormality of an Internet of things based on a server-free architecture.

Background

With the continuous promotion of scientific technology and economic construction, the technology of the internet of things is developing vigorously. Some experts and scholars propose the concept of artificial intelligence internet of things, aiming to enable the traditional internet of things industry through artificial intelligence technology. The anomaly detection of the data of the Internet of things is one of the fields of the combination and application of the Internet of things and artificial intelligence. The Internet of things system is composed of terminal nodes with limited mass resources, and the nodes convert physical information into digital information in real time and send the digital information to the cloud or the edge end for storage so as to be used for artificial intelligent application analysis. However, in an actual scene, due to the influence of factors such as an external environment, network communication, a device failure, or malicious attack, data collected by the internet of things device often includes an exception, that is, a data value having a significant deviation from data in a normal mode. The anomaly detection in the scene of the Internet of things is very important, and the anomaly can prompt the occurrence of valuable events such as sudden change of the external environment, failure of a sensor node, intrusion or attack of equipment and the like, so that the method has important significance for improving the overall safety and stability of the system of the Internet of things and the accuracy of the analyzed data.

Although the traditional internet of things cloud platform is quite mature in functions of equipment access and management, data acquisition, instruction issuing and the like, the traditional internet of things cloud platform does not support deployment of a machine learning algorithm. Machine learning and deep learning technologies are one of the important modes of big data processing and analysis at present, but the traditional internet of things cloud platform represented by OneNET only supports the query and processing of equipment data in an SQL query mode, and the requirements of the current internet of things application are difficult to meet. Therefore, how to combine new technologies such as machine learning and deep learning with the traditional internet of things cloud platform for an anomaly detection task is a problem to be solved by the invention.

The traditional internet of things data anomaly detection system is usually deployed on an IaaS virtual machine or a PaaS application platform, and developers need to purchase a certain amount of cloud computing resources (computing resources, storage resources, network resources and the like) in advance for supporting the operation of the system according to the estimated request amount of the system and the estimated request before deploying an anomaly detection program. However, this approach has the following problems: firstly, the internet of things equipment usually reports data periodically at a fixed frequency, the anomaly detection program deployed in the manner needs 7 × 24 hours to run in a server background, and the problem of 'idle charging' is caused due to the great waste of computing resources in a time period without data reporting; secondly, the cloud computing resources purchased according to the estimated request amount may not meet the service requirements at the peak request time, and the resources are wasted at the valley request time. How to avoid the above problem is another problem to be solved by the present invention.

Disclosure of Invention

In order to overcome the defects in the prior art, the invention aims to provide a method and a system for detecting data abnormality of the internet of things based on a server-free architecture.

The method provided by the invention comprises the following steps:

step 1: the method comprises the following steps that a third-party Internet of things cloud platform is used as an access end of Internet of things equipment, all the Internet of things equipment is accessed into the third-party Internet of things cloud platform through a specific protocol, and collected data are reported to the third-party Internet of things cloud platform;

step 2: a user selects a proper anomaly detection algorithm for any Internet of things equipment accessed to the system and configures corresponding parameters;

and step 3: constructing a data anomaly detection end by adopting a server-free architecture, and automatically generating and deploying a training cloud function and a reasoning cloud function for anomaly detection for equipment according to an algorithm and parameters; after deployment is finished, training the abnormal detection model according to the historical data of the equipment by the training cloud function, and storing the abnormal detection model in NAS file storage service for calling the reasoning cloud function;

and 4, step 4: and the new data points reported by the equipment with the deployed anomaly detection algorithm are forwarded to the reasoning cloud function for anomaly detection through the data push service of the third-party Internet of things cloud platform, the reasoning cloud function reads the trained anomaly detection model from the NAS file storage service for anomaly detection of the new data, and a detection result is returned.

The Internet of things cloud platform refers to a third-party Internet of things cloud platform such as China Mobile OneNet, Ali cloud IoT, Amazon IoT and the like; the equipment access end is realized by adopting a third-party Internet of things cloud platform, and the data anomaly detection end is realized by adopting an Ali cloud function computing platform.

In the step 1, the specific protocol specifically refers to communication protocols such as MQTT, Modbus, HTTP and the like; the acquired data are various numerical data acquired by the Internet of things equipment in different scenes.

In step 2, the anomaly detection algorithm comprises IForest, CBLOF, OCSVM, AutoEncoder, DBSCAN and the like; the configured parameters comprise data pollution rate, training parameters required by various anomaly detection algorithms and the like.

In step 3, the training and reasoning of the detection model are realized through a cloud function in a serverless architecture, and the cloud function is charged according to the calling times.

The training cloud function and the reasoning cloud function are automatically generated according to the template and are deployed on the server-free computing platform; the template is preset in the system in a text file mode, and specific parameters in the template occupy the position in a template character string mode; the training cloud function and the reasoning cloud function are automatically generated according to the placeholder in the front-end transferred specific parameter replacement template during algorithm deployment, and automatic deployment is achieved through the SDK provided by the Ali cloud function computing platform.

a) An equipment access end implementation method based on a traditional Internet of things cloud platform comprises the following steps:

according to the invention, a China mobile OneNet Internet of things cloud platform is used as an access end of equipment, all Internet of things equipment is accessed to the OneNet cloud platform by adopting a specific protocol, data collected by all Internet of things equipment is reported to the OneNet cloud platform, the equipment is managed by the OneET cloud platform, and the data is pushed to an abnormality detection end by the data push function of the OneET cloud platform for abnormality detection. The OneNet is an Internet of things application development platform released by the middle-shift Internet of things, aims to provide safe and reliable equipment connection communication capability for Internet of things application programs, supports multiple equipment protocols such as MQTT, TCP, EDP, NB-IoT and Modbus, provides services such as equipment access and management, data acquisition and command issuing for various hardware terminals in the scene of the Internet of things, and provides rich API and SDK for application development.

b) An abnormal detection end implementation method based on a server-free architecture comprises the following steps:

in order to combine the technologies of machine learning, deep learning and the like with the traditional Internet of things cloud platform such as the OneNet cloud platform and further reduce the deployment and operation cost of the system, the abnormal detection end of the system is realized by adopting a server-free framework. The serverless does not mean that a backend server is not needed any more, but means that a developer can get rid of the setting and management work of the server needed for developing an application program, the operation is finished by a cloud service provider, and the developer concentrates on the development of specific services. The serverless architecture is an event-driven cloud computing mode, and supports applications by deploying a series of 'cloud functions' on the cloud and binding corresponding event sources, and organizing the cloud functions into micro-services. Each triggering execution of the cloud function is scheduled to a new temporary container, and the running environment is recycled by the cloud service provider within a period of time after the execution is finished, so that the cloud function is stateless. The stateless nature allows cloud functions to be instantiated in multiple containers quickly at peak demand, supporting large-scale concurrent requests. The cloud function cannot be scheduled to execute when there is no request, and the cloud service provider can create enough running instances to meet the demand when there are a large number of sudden requests. Because the scheduling execution of the cloud function is in the millisecond level, the automatic capacity expansion and contraction characteristic of the server-free architecture can be approximately perfectly fit with the load change. The cloud function is generally charged according to the calling times or calling time, no charge is generated when the cloud function is not called, the problem of idle charging of the traditional cloud service is solved, and the use cost is greatly saved. The anomaly detection system realized by the invention is deployed on an Aliskiren cloud function computing platform, and the Aliskiren cloud function computing platform is a server-architecture-free cloud service provided by Aliskiren cloud.

c) The method for automatically generating and deploying the training cloud function and the reasoning cloud function in the anomaly detection system comprises the following steps:

due to the adoption of the server-free architecture, the anomaly detection end of the anomaly detection system realized by the invention is deployed on the Ali cloud function computing platform in a cloud function mode (the structure of a cloud function is shown in figure 2), after an anomaly detection algorithm is deployed for the equipment of the Internet of things, a training cloud function and a reasoning cloud function are deployed for each piece of equipment on the Ali cloud function computing platform and are respectively used for training an anomaly detection model, and the trained anomaly detection model is called to carry out anomaly detection on new data. The method and the system realize automatic generation and deployment of the training cloud function and the reasoning cloud function, all algorithms supported in the anomaly detection system realized by the method and the system comprise two templates, namely a training cloud function template and a reasoning cloud function template, corresponding algorithm parameters are filled into the templates to generate corresponding training cloud function codes and reasoning cloud function codes when the algorithms are deployed, and then the training cloud function codes and the reasoning cloud function codes are automatically deployed through the SDK provided by the Ali cloud function computing platform, as shown in FIG. 5.

According to the invention, the OneNet Internet of things cloud platform is used as an access end of the Internet of things equipment, all the Internet of things equipment is connected with the OneNet cloud platform through a specific protocol and reports data to the OneNet platform, and the data is forwarded to the server-free abnormity detection end through the data push function of the OneET platform to carry out abnormity detection.

The anomaly detection end of the data is realized by adopting the cloud service without the server architecture provided by the Alice cloud function computing platform, and the training and calling of an anomaly detection model are mainly carried out by the training cloud function and the reasoning cloud function which correspond to the equipment one by one. The cloud function in the server-free architecture charges according to the calling times, and charging is not carried out when the cloud function is not called, so that the cost is greatly reduced.

The method supports the deployment of various anomaly detection algorithms, all anomaly detection algorithm programs realized based on Python can extract an algorithm main body from a training code and an inference code and store the algorithm main body as a template, a specific algorithm is selected when the model is deployed, and parameters of the specific algorithm are filled into the template to generate a training cloud function code and an inference cloud function code.

The method supports automatic deployment of the training cloud function and the reasoning cloud function, and the training cloud function code and the reasoning cloud function code generated by the template can be automatically deployed to the cloud end through the SDK provided by the Alice cloud function computing platform without manual deployment of users.

The time sequence of the internet of things data anomaly detection system based on the server-free architecture is shown in fig. 3 and comprises the following steps: 1. a system user creates virtual equipment and sets message pushing; 2. the third-party Internet of things platform feeds back the setting success; 3. the Internet of things equipment accesses the platform through a specific protocol; 4. uploading a certain amount of equipment data by the equipment of the Internet of things; 5. the third-party Internet of things cloud platform forwards data to the Ali cloud FaaS; 6. the Aliyun FaaS feedback is successfully received; 7. the Aliyun FaaS stores the data to Aliyun BaaS; 8. configuring and deploying an anomaly detection algorithm for equipment by a system user; 9. the Aliyun FaaS saves the algorithm configuration of the equipment; 10. history data of the Aliyun FaaS request equipment; 11. the Aliyun BaaS returns the historical data of the equipment; 12. training Aliyun FaaS and exporting a detection model; 13. the Internet of things equipment uploads new data to a third-party Internet of things cloud platform; 14. the third-party Internet of things cloud platform forwards data and triggers detection; 15. the Aliyun FaaS feedback is successfully received; 16. loading a detection model by Aliyun BaaS; 17. the Aliyun FaaS carries out abnormity warning; 18. the third-party Internet of things cloud platform issues a command to the Internet of things equipment; 19. and the third-party Internet of things cloud platform carries out abnormity warning on the system user.

The invention also provides a system for realizing the method, which comprises a data unloading module, an algorithm deployment module, a cloud function automatic generation and deployment module and a training and reasoning module.

The data unloading module is used for receiving the Internet of things equipment data pushed by the third-party Internet of things cloud platform and storing the Internet of things equipment data into the database for use of a subsequent deployment algorithm and a training model;

the algorithm deployment module provides a window for deploying the anomaly detection algorithm for a system user in a Web page form, and the system user can modify or input the anomaly detection algorithm and corresponding parameters required to be selected;

the cloud function automatic generation and deployment module is responsible for automatically generating codes for training a cloud function and a reasoning cloud function according to the template and the parameters transmitted by the front end, and automatically deploying the codes to the cloud end through the SDK provided by the function computing platform;

the training and reasoning module is deployed in the Alice cloud function computing platform in the form of a training cloud function and a reasoning cloud function and is respectively responsible for training an anomaly detection model and calling the model to perform anomaly detection.

The invention also provides a hardware system for realizing the method, which comprises the following steps: a memory and a processor; the memory has stored thereon a computer program which, when executed by the processor, carries out the above-mentioned method.

The invention also proposes a computer-readable storage medium on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method.

The beneficial effects of the invention include: the system and the method combine the traditional Internet of things cloud platform and a new server-free framework, reduce the cost of equipment access and management by adopting the traditional Internet of things cloud platform as an equipment access end, and greatly reduce the deployment and operation cost of the system by constructing the abnormal detection end through the server-free framework. The cloud function in the server-free architecture is executed as required, the problem of 'idle charging' is solved unlike the traditional cloud server, and the method is very suitable for the scene of the Internet of things which requires the low-frequency and periodic characteristics. Compared with the traditional cloud computing mode, the server-free architecture has the advantages in concurrency performance and response speed, and can detect abnormal data reported by the Internet of things equipment more quickly. In the prior art, a server-free architecture is not introduced to reduce the cost of the data anomaly detection system of the internet of things and improve the detection speed of the system.

Drawings

Fig. 1 is an architecture diagram of an internet of things data anomaly detection system based on a server-free architecture according to the present invention.

Fig. 2 is a structural diagram of a cloud function in the data anomaly detection system of the internet of things based on the server-free architecture.

Fig. 3 is a timing diagram of the data anomaly detection system of the internet of things based on the server-free architecture.

FIG. 4 is a schematic diagram of an operation interface of the algorithm deployment module of the device of the present invention.

FIG. 5 is a schematic diagram of the automatic generation deployment of the training and reasoning cloud function of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the following specific examples and the accompanying drawings. The procedures, conditions, experimental methods and the like for carrying out the present invention are general knowledge and common general knowledge in the art except for the contents specifically mentioned below, and the present invention is not particularly limited.

The OneNet platform is an Internet of things open platform created by a Middling Internet of things company Limited based on Internet of things technology and industrial characteristics, supports quick access and big data service of various sensors and intelligent hardware, provides rich APIs (application programming interfaces) and application templates to support development of various industrial applications and intelligent hardware, and can effectively reduce application development and deployment costs of the Internet of things. The device side can upload data to the cloud side through multiple transmission protocols.

Therefore, the China mobile OneNet Internet of things cloud platform is used as an access end of the equipment, all Internet of things equipment is accessed to the OneNet cloud platform through a specific protocol, data collected by all Internet of things equipment are reported to the OneNet cloud platform, the equipment is managed through the OneNet cloud platform, and the data are pushed to an abnormal detection end through the data pushing function of the OneET cloud platform for abnormal detection.

The invention discloses a method and a system for detecting data abnormity of the Internet of things based on a server-free architecture, which comprises the following steps:

1. adopt traditional thing networking cloud platform to realize equipment access end:

according to the invention, a China mobile OneNet Internet of things cloud platform is used as an access end of equipment, all Internet of things equipment is accessed to the OneNet cloud platform by adopting a specific protocol, data collected by all Internet of things equipment is reported to the OneNet cloud platform, the equipment is managed by the OneET cloud platform, and the data is pushed to an abnormality detection end by the data push function of the OneET cloud platform for abnormality detection. The OneNet is an Internet of things application development platform released by the middle-shift Internet of things, aims to provide safe and reliable equipment connection communication capability for Internet of things application programs, supports multiple equipment protocols such as MQTT, TCP, EDP, NB-IoT and Modbus, provides services such as equipment access and management, data acquisition and command issuing for various hardware terminals in the scene of the Internet of things, and provides rich API and SDK for application development.

2. The server-free architecture is adopted to realize an abnormal detection end:

in order to combine the technologies of machine learning, deep learning and the like with the traditional Internet of things cloud platform such as the OneNet cloud platform and further reduce the deployment and operation cost of the system, the abnormal detection end of the system is realized by adopting a server-free framework. The serverless does not mean that a backend server is not needed any more, but means that a developer can get rid of the setting and management work of the server needed for developing an application program, the operation is finished by a cloud service provider, and the developer concentrates on the development of specific services. The serverless architecture is an event-driven cloud computing mode, and supports applications by deploying a series of 'cloud functions' on the cloud and binding corresponding event sources, and organizing the cloud functions into micro-services. Each triggering execution of the cloud function is scheduled to a new temporary container, and the running environment is recycled by the cloud service provider within a period of time after the execution is finished, so that the cloud function is stateless. The stateless nature allows cloud functions to be instantiated in multiple containers quickly at peak demand, supporting large-scale concurrent requests. The cloud function cannot be scheduled to execute when there is no request, and the cloud service provider can create enough running instances to meet the demand when there are a large number of sudden requests. Because the scheduling execution of the cloud function is in the millisecond level, the automatic capacity expansion and contraction characteristic of the server-free architecture can be approximately perfectly fit with the load change. The cloud function is generally charged according to the calling times or calling time, no charge is generated when the cloud function is not called, the problem of idle charging of the traditional cloud service is solved, and the use cost is greatly saved. The anomaly detection system realized by the invention is deployed on an Aliskiren cloud function computing platform, and the Aliskiren cloud function computing platform is a server-architecture-free cloud service provided by Aliskiren cloud.

3. Supporting automatic generation and deployment of a training cloud function and an inference cloud function:

due to the adoption of the server-free architecture, the anomaly detection end of the anomaly detection system realized by the invention is deployed on the Ali cloud function computing platform in a cloud function mode, and after the anomaly detection algorithm is deployed for the Internet of things equipment, a training cloud function and an inference cloud function are deployed for each piece of equipment on the Ali cloud function computing platform and are respectively used for training an anomaly detection model and calling the trained anomaly detection model to perform anomaly detection on new data. The method and the system realize automatic generation and deployment of the training cloud function and the reasoning cloud function, all algorithms supported in the anomaly detection system realized by the method and the system comprise two templates of a training cloud function template and a reasoning cloud function template, corresponding algorithm parameters are filled into the templates to generate corresponding training cloud function codes and reasoning cloud function codes when the algorithms are deployed, and then the training cloud function codes and the reasoning cloud function codes are automatically deployed through the SDK provided by the Ali cloud function computing platform.

Examples

The invention provides a realization method of an Internet of things data anomaly detection system based on a server-free architecture, which comprises the following code realization parts (important interception):

as shown in fig. 4, a user can select a suitable anomaly detection algorithm for any internet of things device in the access system and configure corresponding algorithm parameters, and then the system can automatically generate codes for training cloud functions and reasoning cloud functions according to the algorithm and the parameters and automatically deploy the codes to an arii cloud function computing platform.

This section includes logic to automatically generate code to train and infer cloud functions from algorithm templates, as shown in code 1 below:

code 1

The generation _ http _ train _ py function is used for generating event-triggered training cloud function codes, and the generation _ http _ predict _ py function is used for generating event-triggered reasoning cloud function codes. The function parameters clf _ name, device _ id and params respectively represent the algorithm name, the device id of the internet of things device in the OneNET cloud platform and the algorithm parameters.

As shown in the following code 2, this section contains implementation logic for automatic deployment of cloud functions:

code 2

In code 2, it is described how the system implemented by the present invention deploys the generated training cloud function and prediction cloud function on the ari cloud function computing platform.

As shown in the following code 3, a template of the training cloud function code is given, and this part includes execution logic of the training cloud function. And training the anomaly detection model by the training cloud function according to the historical data of the equipment and the input algorithm parameters, and storing the trained anomaly detection model into the NAS file storage service for calling the reasoning cloud function.

Code 3

As shown in the following code 4, a template of the inference cloud function code is given, and this part contains execution logic of the inference cloud function. And the reasoning cloud function loads the trained anomaly detection model from the NAS file storage and carries out anomaly detection on newly reported data.

Code 4

The system and the method combine the traditional Internet of things cloud platform and a new server-free framework, reduce the cost of equipment access and management by adopting the traditional Internet of things cloud platform as an equipment access end, and greatly reduce the deployment and operation cost of the system by constructing the abnormal detection end through the server-free framework. The cloud function in the server-free architecture is executed as required, the problem of 'idle charging' is solved unlike the traditional cloud server, and the method is very suitable for the scene of the Internet of things which requires the low-frequency and periodic characteristics. Compared with the traditional cloud computing mode, the server-free architecture has the advantages in concurrency performance and response speed, and can detect abnormal data reported by the Internet of things equipment more quickly. In the prior art, a server-free architecture is not introduced to reduce the cost of the data anomaly detection system of the internet of things and improve the detection speed of the system.

The protection of the present invention is not limited to the above embodiments. Variations and advantages that may occur to those skilled in the art may be incorporated into the invention without departing from the spirit and scope of the inventive concept, which is set forth in the following claims.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:硬盘驱动命令队列的获取方法、装置及计算机设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!