1 Introduction

With the continuous development of advanced manufacturing technology and the evolution of production mode, manufacturing technology and information technology are mutually infiltrated, and the complementary integration between different fields is becoming more and more obvious. The economic global integration has made great progress. As a pillar industry and core strength of national economic development, manufacturing industry will face more severe challenges in the increasingly fierce market competition environment [1], in order to adapt to the complex and volatile market environment, China, the United States, Germany, Japan and other countries have. The development and implementation of a national industrial development strategy centred on advanced manufacturing is to develop smart manufacturing driven by new technologies. In recent years, with the rapid development of technologies such as sensors, ICTs, mobile computing, sensor networks and radio frequency identification (RFID), the Internet of Things (IOT) [2] has been developed to target the Internet through the Internet of Things. The sensor and radio frequency identification technology collects and monitors the information of the item in real time; realizes the intelligent identification of the item, real-time location tracking and control; and has the important features of common object equipment, autonomous terminal interconnection and universal service intelligence [3]. With the rapid development and wide application of IOT technology, the role of IOT technology in intelligent manufacturing strategy has become increasingly prominent. At present, China, the United States, Germany, Japan and other countries have included IOT technology in the national intelligent manufacturing development and implementation strategy. In response to the development and application of IOT, Germany proposed the “Industry 4.0” strategy in April 2013. The strategy aims to make the manufacturing industry intelligent by making full use of information and communication technologies (ICTs) and network physical systems (CPS). Transformation, the core idea of “Industry 4.0” is to introduce IOT technology into the manufacturing industry and form a manufacturing network physical system. The goal is to establish a new production mode with dual characteristics of individualization and digitization [4].

China is a big manufacturing country, and manufacturing is a pillar industry of the national economy. Therefore, China has also formulated the “Twelfth Five-Year Development Plan for the Internet of Things” strategy. The strategy points out that IOT technology has become the new round of economic and technological development strategies in the world. One of the commanding heights has the characteristics of high integration of information technology, strong driving force and good application effect. The development and application of IOT has important practical significance for promoting economic development and social progress [5]. At present, under the support of the national intelligent manufacturing development and implementation strategy, key technologies of IOT such as RFID, machine vision and sensors have been widely used in the mechanical manufacturing industry, and the mechanical product manufacturing system has been gradually promoted. Multi-dimensional, transparent, intelligent “direction development” [6], this intelligent manufacturing production model characterized by the fusion of IOT technology has emerged [7]. For the intelligent manufacturing production mode under the IOT environment, researchers at home and abroad are different. Technologies (such as RFID, machine vision, IOT middleware) have applied and studied different functions of mechanical product manufacturing systems (such as material management, work-in-process tracking, quality inspection). However, with IOT technology in manufacturing the extensive coverage of the workshop, modular research can no longer meet the needs of the manufacturing system for the overall application level and development of IOT (Fig. 1).

Fig. 1
figure 1

GDP of China’s manufacturing industry in 2010–2018

CNC machine tool is one of the high-end equipment in the intelligent manufacturing industry. It is a new type of machine tool with high processing precision and high production efficiency. The excellent production performance leads to the large-scale use of CNC machine tools in the industrial field. Due to the high processing strength, the machine parts of the machine tool are fast. Fatigue, and the fatigue of mechanical parts, leads to the frequent occurrence of machine faults. Once the failure may lead to the scrapping of the processed products and the stagnation of production, how to diagnose and warn the machine faults in real time is a serious problem faced by the CNC machine tool industry. At present, some foreign large-scale CNC machine tool manufacturers have designed remote acquisition and analysis systems for machine tool failures. For example, Toshiba, Mitsubishi, Siemens and other manufacturers have developed machine tool fault diagnosis systems. However, there are few studies in China. At present, the following problems exist in the field of fault diagnosis of domestic high-end CNC machine tools:

(1) The main method of fault diagnosis is manual observation and diagnosis. The manual diagnosis is mainly based on production experience. The source of the data is the visual representation of the sound and vibration of the mechanical operation. This method has problems such as unsuccessful discovery and inaccurate judgment. (2) Fault diagnosis is mainly carried out on site, lacking real-time data acquisition capability, and cannot provide early warning of faults. (3) Another problem is the lack of ability to acquire and analyse multiple operating parameters and lack of ability to summarize and analyse the trend of failure. In order to solve the above problems and improve the intelligent degree of fault diagnosis of domestic high-end CNC machine tools, this paper proposes to design a set of intelligent fault diagnosis and early warning system based on the Internet of Things to realize intelligent diagnosis and early warning of machine faults.

2 Internet of Things and intelligent manufacturing relations

2.1 Intelligent manufacturing

IM was born in the 1980s with the research of Computer Integrated Manufacturing System (CIMS). Its core is to realize the self-measurement, self-diagnosis, self-maintenance, self-learning and self-adaptation of the manufacturing process by means of artificial intelligence, and finally realize flexibility.

Unmanned manufacturing

At the beginning of the twenty-first century, with the rapid development of advanced technologies such as ICT and new sensing (such as RFID and machine vision), the IM category has been greatly expanded. The current IM is based on advanced sensing, communication and intelligent processing technologies. Through the extensive use of real-time data perception, seamless data links, intelligent decision-making and manufacturing execution technologies to achieve intelligent design, development, production and other aspects of the product, IM is highly integrated with a variety of advanced manufacturing technologies. And integrated application is the information manufacturing under the ubiquitous sensing condition.

IM’s product-oriented life cycle mainly includes intelligent manufacturing technology, intelligent manufacturing equipment, intelligent manufacturing system (IMS) and intelligent manufacturing services, where IMS is an integrated application environment of intelligent manufacturing technology and intelligent manufacturing equipment, and comprehensive application of artificial intelligence.

Technology, ICT, automation technology, manufacturing technology and systems engineering theory and methods

IMS is a concentrated expression of enterprise benefits. Studying IMS is of great significance for realizing intelligent manufacturing strategies.

2.2 Internet of Things technology

In 1991, Professor Kevin Ashton of the Massachusetts Institute of Technology first proposed the concept of the Internet of Things, but since 1991, with the rapid development of advanced manufacturing technology, people’s understanding of the “Internet of Things” has also changed; the literature [8] IOT is considered to be a novel model. It has been widely used by researchers and users to describe the relationship between real-world objects and virtual world information. “Internet” emphasizes the network of IOT and “Things” emphasizes the integration object of the Internet of Things (IoT), which, on the basis of object integration, requires the understanding of the interconnection “Things” through semantic technology, which is the three characteristics of the Internet of Things: intelligent goods, interconnection perception and semantic understanding. Literature [9] pointed out that in the IOT environment, the interaction and cooperation between IoT nodes with sensing and execution capabilities can achieve the goal together; with the rapid development of technologies such as sensors, ICT, mobile computing, sensor networks and RFID development and wide application, the connotation of IOT is also undergoing fundamental changes. At present, the unified understanding of IOT at home and abroad is, “IOT refers to the Internet through the Internet of Things Technologies such as sensors and radio frequency identification which collect and monitor item information in real time; realize intelligent identification of items, real-time location tracking, monitoring and management; and have important features such as common object equipment, autonomous terminal interconnection and universal service intelligence” (Fig. 2).

Fig. 2
figure 2

Internet of Things technology

The development and implementation strategies of the United States, Europe, Japan, South Korea, China and other countries include Internet of Things technologies, such as Germany’s “Industry 4.0” strategy and China’s “Internet of Things 12th Five-Year Development Plan” strategy. Under the support of the country’s “Internet of Things” development strategy, research organizations and manufacturing companies have conducted different levels of research and application on the Internet of Things, mainly through advanced perceptions (such as RFID, sensors, machine vision, semantic middleware technology) and communication. Advanced manufacturing technologies such as technology (such as sensor network, Ethernet, bus) realize the ubiquitous interconnection and perception of objects in production systems, and, on this basis, use technologies such as decision-making, optimization and execution to realize intelligence in the Internet of Things environment produce. With the continuous penetration of the concept of Internet of Things (IOT) in the manufacturing field, the R&D and manufacturing process of manufacturing companies has evolved from the traditional “black box” model to the “multi-dimensional, transparent and ubiquitous perception” model. Technology is the driving force of the manufacturing system, which strongly promotes the development of manufacturing systems in the direction of globalization, information, intelligence and green. Therefore, the development and application of IOT has important practical significance for promoting the development of manufacturing.[10]

2.3 Intelligent manufacturing and IoT relationship

The goal of IoT technology is to collect any objects or processes that need to be monitored, connected and interacted in real time through sensors, RFID, image recognition and other technologies to achieve ubiquitous links between objects and objects, objects and people, and to achieve intelligence on items and processes. It has the important characteristics of common object equipment, autonomous terminal interconnection and universal service intelligence. Based on the analysis of the mechanical product assembly system, combined with the characteristics of the manufacturing association described in the literature, this paper defines the object interconnection for the mechanical product assembly process, and the perceived manufacturing characteristics:

  1. 1.

    Multi-source heterogeneity: the workshop production system in the manufacturing IoT environment is mainly composed of resource identification module, information sensing module, action or logic triggering and execution module, control module and other auxiliary modules, physical connections and logical relationships, and a wide variety of resource organization structure and interaction agreements;

  2. 2.

    Object interconnection: on the basis of forming a multi-source heterogeneous self-organizing network, the multi-level heterogeneous self-organizing network realizes the interconnection and integration of the traditional physical world and the information world through the Internet of Things gateway and the Internet of Things middleware. Make all common physical objects that can be independently addressed interconnected [29], and establish an “object interconnection, perception network” environment;

  3. 3.

    Real-time perceptuality: manufacturing resources with interconnected sensing capabilities are important features of production systems in the manufacturing IoT environment. The manufacturing resources in the manufacturing object mode are referred to as manufacturing object resources (IOMTS). The Manufacturing IoT Resource (IOMTS) has the ability of active or passive sensing to sense and reflect resource status and operating environment data in the production process in real time;

  4. 4.

    Dynamic: the real-time perception and rapid flow of manufacturing resources, dynamic changes of production environment and other characteristics make the production system dynamic, mainly manifested by the dynamic nature of resource ontology, the dynamics of topology and the dynamics of other production activities;

  5. 5.

    Sharing and collaboration: Manufacturing IoT Resources (IOMTS) can be shared by other autonomous units in the IoT environment. Through resource modelling and optimization configuration, resource utilization can be improved, and production logistics bottlenecks can be optimized, to achieve collaborative production in IOMT mode;

  6. 6.

    Other characteristics: the production system in the manufacturing IoT environment also has the characteristics of intelligent manufacturing and chaining of the universal manufacturing service, self-organization and self-maintenance of the manufacturing system, flexibility, strong fault tolerance and high reliability.

3 Overall structure design of intelligent diagnosis and early warning system

In order to realize the real-time judgment and analysis of machine tool failure, the system uses the Internet of Things technology to deploy temperature and vibration sensors in the key mechanical parts of the machine tool, and data aggregation through wireless communication. The aggregation node performs preliminary processing on the data to complete the data.

Smoothing, denoising and filtering

The aggregation node sends the processed data to the control centre via Ethernet, and the diagnostic and early warning software of the control centre performs time-frequency domain analysis (extracting feature data) on the data, and sends the feature data to the neural network. Learning, generating fault diagnosis and warning information is stored in the database, and operators and managers implement real-time supervision of fault information and operational information through web pages and mobile apps.

According to the functional requirements and operational requirements of the system, the fault diagnosis and analysis system is designed with a three-layer structure. The first layer is the acquisition communication layer. The layer consists of a vibration acquisition device, a temperature acquisition device and a convergence node. The acquisition device is responsible for completing the relevant signals.

The collection and transmission

The aggregation node completes the filtering, denoising, smoothing, etc. of the data to realize the pre-processing of the data. The second layer is the data processing layer, which runs on the fault diagnosis and early warning server. The layer completes the feature extraction and time-frequency domain analysis of the data, and inputs the analysed data into the neural network to form fault diagnosis results and early warning information. The third layer is the web service layer, which provides users with the function of monitoring machine fault data and diagnosing early warning information. The overall operating structure of the machine tool intelligent diagnosis and early warning system is shown in Fig. 3.

Fig. 3
figure 3

Overall operation structure of intelligent diagnosis and early warning system

The three-layer structure of the diagnostic and early warning system is distributed in the operational structure to support the operational structure. The following is a detailed design and implementation of each layer of functionality.

4 Design and implementation of acquisition communication layer

The acquisition communication layer completes the data collection, communication and pre-processing work, and designs two parts from the hardware structure. The data collection work consists of the acquisition device equipped with the wireless communication chip and related sensors. The data aggregation and pre-processing work is completed by the aggregation node.

4.1 Acquisition device

In this system, the acquisition device will be deployed on the mechanical equipment of the machine tool, so the acquisition device needs to have the characteristics of small size and high durability. In order to realize real-time accurate collection of vibration data and temperature data, contact stickers are used on the collection device. Piece temperature sensor and acceleration sensor, these collection devices are deployed in the spindle, screw and other positions to achieve temperature and vibration data acquisition. After the data acquisition is completed, the collection node is sent to the aggregation node through the cc2430 wireless communication chip. In the design of the system, data of multiple machine tools in one processing workshop is sent to the same aggregation node, and the aggregation node completes the data through the Ethernet.

Transfer

This aggregation method fully utilizes the processing power and communication capability of the aggregation node, and disperses the overall processing burden of the system.

4.2 Convergence node

The aggregation node is the device that completes the data pre-processing and communication work in the system. In order to achieve efficient and accurate data processing, the arm cortex m4 processor and the RT-Thread operating system are used in the aggregation node, and the floating-point computing capability and operating system communication are used. The introduction of the protocol stack improves the processing power and communication capabilities of the aggregation node. Two threads are designed in the aggregation node: the first is the data receiving thread and the thread stores the received data in the message queue; the second is the processing and sending thread and the thread reads the data in the message queue, after processing Send to the control centre. This mode of work is asynchronous work mode; the focus is on the design of the message queue length and access method according to the system’s traffic and processing power. In this system, two queues, Message Queuing and Idle Queue, are used. The total queue length is 30 bytes. At the same time, the variable length control method is designed. The variable length parameter setting can change the length of the queue. This approach improves the utilization of queue resources, reduces the amount of memory used by embedded systems and provides more space for operations and storage.

4.3 Signal pre-processing

Due to the unavoidable mixing of some other signals in the machine signal generation process or due to strong mechanical vibrations, some very special data may appear in the signal. The existence of these data forms a certain interference to the fault diagnosis, in order to achieve the data is denoised, smoothed and filtered. The signal zero-melanisation algorithm, standard deviation filtering algorithm and wavelet filtering algorithm are designed on the aggregation node. The zero-melanisation of the signal uses the averaging of the data sequence, and the signal value is subtracted to obtain a new value, so that the special data can be effectively processed, and then the data generated after the processing is filtered. The filtering method adopts the standard deviation.

Analytical algorithm

In the mechanical failure, the data standard deviation anomaly range should be within three times; by setting the standard deviation three times the threshold, the data out of the standard deviation three times the data is eliminated, and then, the processed data is wavelet filtered. In the algorithm, the second-generation wavelet filtering method is adopted in this algorithm. Firstly, the signal is split, predicted and updated, and then the process of recovery update, recovery prediction and synthesis are carried out. The key point needs to solve the threshold selection in this algorithm. The soft and hard threshold methods are adopted. The threshold value is selected by the method of Tn=CQn in the algorithm, where Qn is the standard deviation of the nth layer signal, C is the noise intensity and C needs to be artificially set according to statistical analysis. In the present algorithm, the difference between the soft and hard thresholds is that when the wavelet coefficient is greater than the threshold, the wavelet coefficients are greater than the hard threshold, and the wavelet coefficients need to be adjusted when the wavelet threshold is greater than the soft threshold. The signal processed in this way should have the same smoothness as the original signal, the error of the mean square value of the original data is small, the signal-to-noise ratio is relatively high, and the data reliability is high.

4.3.1 Signal zero melanisation algorithm

For an artificially generated signal, the signal zero-averaged transformation method is used for power spectrum analysis. The algorithm is as follows:

Known signal:

$$ \mathrm{x}\left(\mathrm{n}\right)=100.0\ast \mathrm{COS}\left(2\ast 3.14\ast \mathrm{SF}\ast \mathrm{n}/\mathrm{FS}\right)+50.0\ast \mathrm{COS}\left(4\ast 3.14\ast \mathrm{SF}\ast \mathrm{n}/\mathrm{FS}\right),\mathrm{n}=0,1,2\dots \mathrm{N}\hbox{-} 1 $$
(1)

where N represents the number of sampling points and must be 2x. SF represents the signal frequency, SF=10Hz. FS represents the sampling frequency. The signal zero-melanisation transformation result X(k) can be obtained by the subroutine provided below. The formula for calculating the power spectrum is:

$$ \mathrm{G}\left(\mathrm{k}\right)=2\left(\mathrm{XR}\left(\mathrm{k}\right)2+\mathrm{XI}\left(\mathrm{k}\right)\right)2/\mathrm{N},\mathrm{k}=0,1,2,\dots, \mathrm{N}/2\hbox{-} 1 $$
(2)

where XR(k) represents the real part of X(k) and XI(k) represents the imaginary part of X(k).

4.3.2 Standard deviation filtering algorithm

The standard deviation can be used as a measure of uncertainty. For example, in the physical sciences, when making repetitive measurements, the standard deviation of the set of measured values represents the accuracy of these measurements. When it is decided whether the measured value meets the predicted value, the standard deviation of the measured value plays a decisive important role: if the measured average value is too far from the predicted value (and compared with the standard deviation value), the measured value and the predicted value are considered to contradict each other. This is easy to understand, because the values fall outside a certain range of values, and it can be reasonably inferred whether the predicted values are correct.

Suppose there is a set of values x1, …, xN (all real numbers) whose mean expression is:

$$ \overline{\mathrm{x}}=\frac{1}{\mathrm{N}}\sum \limits_{\mathrm{i}=1}^N{x}_{\mathrm{i}} $$
(3)

The standard deviation of this set of values is:

$$ \sigma =\sqrt{\frac{1}{\mathrm{N}}\sum \limits_{\mathrm{i}=1}^N{\left({x}_{\mathrm{i}}-\overline{\mathrm{x}}\right)}^2} $$
(4)

A faster way to solve is:

$$ \sigma =\sqrt{\frac{\sum \limits_{\mathrm{i}=1}^N{x}_i^2}{N{\left(\sum \limits_{\mathrm{i}=1}^N{x}_i/N\right)}^2}}=\sqrt{\frac{N\sum \limits_{\mathrm{i}=1}^N{x}_i^2-{\left(\sum \limits_{\mathrm{i}=1}^N{x}_i\right)}^2}{N^2}} $$
(5)

It should be noted that not all random variables have a standard deviation because some random variables do not have an expected value. If the random variable X is x1, …, xN with the same probability, the standard deviation can be calculated using the above formula. Take the same value combination x1, …, xN from a large set of values, often defining its sample standard deviation:

$$ \mathrm{s}=\sqrt{\frac{1}{n-1}\sum \limits_{i=1}^n{\left({x}_i-\overline{x}\right)}^2} $$
(6)

4.3.3 Wavelet filtering algorithm

The appearance of wavelet analysis can be traced back to Haar’s proposed Haar norm orthogonal basis in 1910, and the L-P theory established by Littlewood-Paley in Fourier series in 1938. In order to overcome the shortcomings of traditional Fourier analysis, in the early 1980s, scientists used the concept of “wavelet” for data processing. The famous one was the introduction of the concept of wavelet by French geophysicist Morley in 1984. The seismic signals are stored and represented. The explorations in mathematics are mainly the “atoms” and “molecules” doctrines created by R. Coifman and G. Weiss. These “atoms” and “molecules” form part of the basis of different functional spaces. L. Carleron used a function like “wavelet” to construct the unconditional basis of the space of Stein and Weiss. Until 1986, the French mathematician Meyer successfully constructed a smoothing function with a certain attenuation, and its binary expansion and translation {ψj, k(t)=2j/2ψ(2jtk):j,kZ} constitute the normative orthogonal basis of L2(R). Previously, it was generally believed that this was impossible. For example, Daubechies, Grossman and Meyer retired to study the conditions under which the function \( {\left|{a}_0\right|}^{-j/2}\psi \left({a}_0^{-j}t-{kb}_0\right) \) constituted the framework of L2(R). The continuous wavelet transform (also sometimes called integral wavelet transform) of ∀f(t)∈L2(R) and f(t) is defined as:

$$ {WT}_f\left(a,b\right)={\left|a\right|}^{-1/2}{\int}_{-\infty}^{\infty }f(t)\overline{\psi \left(\frac{t-b}{a}\right)} dt,\kern0.5em a\ne 0 $$
(7)

Or use the inner product form:

$$ {WT}_f\left(a,b\right)=\left\langle f,{\psi}_{a,b}\right\rangle $$
(8)

In the middle, \( {\psi}_{a,b}(t)={\left|a\right|}^{-1/2}\psi \left(\frac{t-b}{a}\right) \). To make the inverse transform exist, ψ(t) must satisfy the permission condition:

$$ {C}_{\psi }={\int}_{-\infty}^{\infty}\frac{{\left|\psi, \hat, \left(\omega \right)\right|}^2}{\left|\omega \right|} d\omega <\infty $$
(9)

where \( \hat{\psi}\left(\omega \right) \) is the Fourier transform of ψ(t). At this time, the inverse transformation is

$$ f(t)={C}_{\psi}^{-1}{\int}_{-\infty}^{\infty }{\int}_{-\infty}^{\infty }{\psi}_{a,b}(t){WT}_f\left(a,b\right) db\frac{da}{{\left|a\right|}^2} $$
(10)

Cψ constant limits the class of function C that belongs to L2(R) as a “base wavelet (or mother wavelet)”. In particular, if ψ is also required to be a window function, then ψ must also belong to L1(R), i.e.

$$ {\int}_{-\infty}^{\infty}\left|\psi (t)\right| dt<\infty $$
(11)

Therefore \( \hat{\psi}\left(\omega \right) \) is a continuous function in R. From equation (9), \( \hat{\psi} \) must be zero at the origin, i.e.

$$ \hat{\psi}(0)={\int}_{-\infty}^{\infty}\psi (t) dt=0 $$
(12)

From Eq. (12), it can be found that the wavelet function must have oscillation.

In this function, the C language is used for programming. In the RT-Thread operating system, two threads are first created to complete the data receiving and data processing communication functions. The two threads are set to have the same priority, and then, the RT-Thread operation is performed. The system schedules work for threads and completes collection processing and communication work. After smoothing, denoising, and filtering by the aggregation node, the data is sent to the control centre through the Ethernet, and is received and processed by the fault diagnosis and early warning system server software.

5 Data processing layer design and implementation

The data processing layer completes the extraction of data feature points and uses the neural network to perform fault diagnosis information and early warning information output functions. The data processing layer runs on the fault diagnosis and early warning server, and performs time domain and frequency domain analysis on the received data to complete the extraction of the fault feature data.

In the mechanical failure of the machine tool, the fault can be judged by statistical methods. The standard normal data is obtained through statistics, and then, the current data is compared with the standard normal data to judge and warn the fault characteristics. The key problem is to correct the thresholds and weights used in the operation. In this system, the neural network correction method is adopted. First, the threshold and weight are present according to statistics and experience, and then, the standard samples are input through the neural network. Calculate the standard error after the operation, observe whether the error accuracy meets the usage requirement, and if the error is not satisfied, correct the threshold and weight, and calculate the standard error after running again, until the error precision produced meets the usage requirement; then, the threshold and weight will be Used by the system as a standard parameter.

In order to accurately obtain the characteristic values of mechanical faults, the time domain and frequency domain analysis methods are adopted in the system, and the signal peak, mean square value and mean square error value sensitive to mechanical faults are selected in the time-frequency domain characteristics. Features such as peak factor, kurtosis and frequency variance are analysed and processed. These data are used as input data to enter a neural network with thresholds and weights for analysis, and output data is generated based on the analysis as fault diagnosis and warning data.

In this function, c# is used to complete the program design. The server is divided into two parts. The part is the Winform program. The communication and data processing control work are the content of this function. Some of them are designed as web sites and services. The web service implementation is web. The function of the service layer, in this function, uses c# and thread technology to complete the development of the Winform program. Two types of threads are designed in the Winform program. One type of thread completes the receiving and storing of data, which is called communication thread, and one type of thread completes the feature. The extraction of values and the processing of neural networks are called data processing threads. The communication thread uses the tcp/ip protocol to complete communication with the aggregation node, and uses socket programming technology to complete data transmission. To ensure the reliability of data communication, the tcp model is adopted in socket communication, at each aggregation node and server. A tcp connection is established between the communication threads to complete the data transmission. The communication thread performs verification processing on the received data and stores it in the database. The data processing thread completes the extraction of the data feature points and the processing of the neural network, and the processing will be processed. The results are stored in the database (Fig. 4).

Fig. 4
figure 4

Design of fault diagnosis and early warning data processing layer

In order to ensure the speed and efficiency of data storage and access, the system uses oracle11g database software to complete the storage and management of data. In this system, a large amount of data needs to be analysed to improve the prediction of machine faults and running trends. The grammatical structure of these analysis work is highly repetitive, so a large number of stored procedures are designed in the system to speed up the operation of the database.

6 Web service layer design and implementation

The web service layer is a service program that provides users with data display and data analysis. In this function, the B/S access mode is designed. Users can use the system through web pages and develop mobile app applications for mobile phone users. Program, through the app program users can complete the use of machine fault diagnosis and early warning system on the phone.

The web service layer adopts the mvc three-layer model structure. In order to realize the real-time refresh of data, ajax technology is adopted. In the three-layer model, the model layer mainly completes the access operation of the database, including the operation of querying and modifying the database, in the view layer. The real-time diagnosis and early warning function, data query function and trend analysis function are designed. The real-time diagnosis and early warning function complete the real-time display of the result data of the system analysis, and the data processing layer completes the analysis and processing of the data, forming the conclusion of the fault analysis.

Data, including fault data and fault warning data

The model layer reads and processes the data, and displays and outputs through the view layer. The real-time diagnosis and early warning interface of the machine fault is shown in Fig. 5.

Fig. 5
figure 5

Real-time diagnosis and warning web interface

In the web service layer, in order to realize the access support for the mobile APP, web service is designed. The difference between web service and web site is that there is no need to display the interface, only need to generate corresponding output. In this application, it is mainly necessary to provide database data for the app application, so the work of web service takes the form of an output xml file. In this system, c# is used to complete the development of the web service used in the system, and the operation and access functions of the database are provided in the web service. In order to realize the support of the android system mobile phone in this system, the machine fault diagnosis and early warning system app software was developed by using Java technology. The app software has the requirement of small memory and high reliability, so the fault real-time monitoring is designed in the software. The function and warning notification function obtains fault diagnosis information and warning information in the server by periodically calling the web service in the app and displaying it in the app.

7 Experimental test

In order to achieve the purpose of accurate testing of the function and performance of the system, the system was deployed and implemented in the CNC machine tool group, and diagnosed and tested the mechanical failure of the CNC machine tools in several workshops of the group. The implementation conditions are as follows. (1) Each machine tool spindle is deployed with a temperature acquisition device and a vibration acquisition device, and a vibration acquisition device is deployed on the work table. (2) One machine node is deployed in each machine shop, and each machine shop has 20 machine tools. (3) The workshop is connected to the control centre through the Ethernet network. The management personnel use the system through the pc in the office. The workshop staff and the off-site test personnel use the system through the mobile phone app. (4) Perform a 12-hour work test on the machine tool for 30 days.

Experimental results

In the 30-day continuous work, through the extraction of the vibration characteristics and temperature characteristics of the machine tool, the neural network analysis realized the accurate prediction of the mechanical component degradation in the machine tool, and realized the faults in the machine tool.

Diagnosis and early warning

By testing the system, real-time monitoring of the working state of the machine tool can be realized, and real-time intelligent diagnosis and early warning of the machine tool fault can be performed. The web mode can complete the comprehensive analysis of the data and the trend graphic display, and the mobile app can complete the diagnosis and warning content.

Real-time display

System work has good real-time, accuracy and reliability.

8 Conclusion

The system applies the Internet of Things technology to the diagnosis and early warning of machine tool failures. By designing the acquisition communication layer, data processing layer, web service layer and mobile phone app, it can realize intelligent diagnosis and early warning of machine tool failure, and improve machine tool fault diagnosis and the real-time and accuracy of the warning. Through the test and application of the machine tool group, the system has the ability to diagnose and warn the machine tool faults. The function is real-time, scientific and accurate. Therefore, the system has theoretical research value and application value.