A sensor online training system and method based on machine learning
Through the online sensor training system based on machine learning, the convolutional neural network model is trained and the sensor software is updated in real time, the problem of unstable and reliable traditional sensor software in complex application scenarios is solved, and the monitoring effect of efficient adaptation to different working conditions is achieved.
Patent Information
- Application Number
- CN202011328753.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-11-24
AI Technical Summary
Traditional sensor software design relies on experience and is difficult to adapt to environmental changes in complex application scenarios, resulting in unstable and reliable monitoring work.
The online sensor training system based on machine learning is adopted to train the convolutional neural network model through massive data, generate algorithms that adapt to complex application scenarios, and update the sensor software in real time, so that it can continuously improve throughout the entire life cycle.
It realizes the stability and reliability of sensor algorithms in complex application scenarios, maximizes the adaptation to different working conditions, and achieves global optimization results.
Smart Images

Figure CN112541569B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things, and in particular to a sensor online training system and method based on machine learning. Background Art
[0002] Machine learning technology has achieved great success in image recognition, natural language recognition and other fields by leveraging big data and convolutional neural network algorithms. The industry is also constantly trying to apply machine learning algorithms to online sensor devices to cope with complex application environments, such as wastewater monitoring.
[0003] The traditional monitoring field still has the following shortcomings: Engineers design sensor software based on industry knowledge and their own experience, but the software algorithms developed based on experience alone can only adapt to certain application scenarios. When monitoring a complex object, the on-site environment and the monitored object are prone to change. Moreover, due to project time and cost constraints, engineers are often only able to collect raw data from some on-site working conditions to train the algorithm. Therefore, software designed by traditional methods is doomed to be unable to complete monitoring work stably and reliably.
[0004] Based on the above problems, it is urgent to propose a sensor online training system and method based on machine learning. Machine learning is used to collect a large amount of raw data from sensors in complex application scenarios and actual measurement values under corresponding working conditions. The convolutional neural network model is trained through massive data to obtain a set of algorithms that match the current complex application scenarios. The algorithm is then embedded in the sensor software so that the sensor algorithm can be continuously improved throughout its life cycle, so that the sensor can adapt to different working conditions on site to the greatest extent possible, stably and reliably complete monitoring work in complex application scenarios, and achieve a global optimization effect. Summary of the Invention
[0005] The purpose of the present invention is to provide a sensor online training system and method based on machine learning to solve the problems raised in the above background technology.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] A sensor online training system based on machine learning includes hardware and software. The hardware includes a sensor, a data acquisition module and a human-computer interaction device. The software includes a smartphone application, data acquisition module software and cloud server software. The sensor is connected to the data acquisition module. The smartphone application allows a user to input the measurement value of the measured target. The data acquisition module software includes an acquisition unit, an upload unit and a deployment unit. The acquisition unit is responsible for obtaining raw data from the sensor, the upload unit is responsible for uploading the data to the cloud server, and the deployment unit is responsible for updating the algorithm parameters received from the cloud server to the sensor. The cloud server software includes a data receiving unit, a model training unit and a data sending unit. The data receiving unit receives and saves the raw data to a corresponding database via the network. The model training unit uses the continuously updated sensor raw data to train the model parameters. The data sending unit downloads the trained algorithm parameters to the data acquisition module via the network.
[0008] Furthermore, the connection methods between the sensor and the data acquisition module include Ethernet and RS-485 bus, and the data acquisition module is equipped with 4G / 5G network communication function and Wi-Fi function, ensuring the real-time data acquisition.
[0009] Furthermore, the data acquisition module obtains raw data from the sensor and uploads it to the cloud server through the network, and finally updates the new model parameters to the online sensor in the following steps:
[0010] a: Data acquisition module obtains raw data from online sensors;
[0011] b: The data acquisition module adds timestamp information to the collected raw data;
[0012] c: Determine whether the network is normal at this time. If it is normal, go to step d; otherwise, directly save the data to the local database and go back to step a;
[0013] d: Upload the original data with timestamp information added in step b to the cloud server via the network;
[0014] e: Determine whether new model parameters are received from the cloud server. If new model parameters are received, go to step f, otherwise go back to step a;
[0015] f: The data acquisition module updates the new model parameters to the online sensors and continues to obtain raw data from the sensors, so that the sensor algorithm continues to improve throughout its life cycle.
[0016] Furthermore, the acquisition of the online sensor raw data in step a and the updating of the new model parameters to the online sensor in step f are both carried out through the Modbus RTU communication protocol. Modbus is an industrial automation bus communication protocol that supports data communication of thousands of industrial intelligent instruments and meters, and also supports multiple communication interfaces.
[0017] Furthermore, the steps of the cloud server receiving raw data, extracting device serial number and timestamp information, training the algorithm to obtain new model parameters, and sending the new model parameters are as follows:
[0018] (1) Create a TCP Socket application programming interface service to wait for the on-site upload of sensor raw data;
[0019] (2) The cloud server determines whether the sensor raw data has been received. If the sensor raw data has been received, the device serial number and timestamp information are extracted and the raw data is inserted into database A. The process goes to step (3). Otherwise, the cloud server continues to wait for the on-site upload of the sensor raw data.
[0020] (3) Determine whether the marking data sent by the smartphone application has been received. If the marking data has been received, extract the device serial number and timestamp information, insert the marking data into database B, and go to step (4). Otherwise, continue to wait for the on-site upload of the sensor raw data.
[0021] (4) Extract all labeled data from database B and query database A to find the corresponding original data set through the timestamp information. Then retrain the algorithm with the original data and labeled data obtained from the query to obtain new model parameters.
[0022] (5) Check whether the device with the corresponding serial number has established a network connection. If so, the cloud server sends the new model parameters and downloads them to the data acquisition module. Otherwise, the new model parameters will be saved in the cloud server and sent again after the device is connected next time.
[0023] Furthermore, the marking in step (3) is a process in which the user inputs the measurement value of the current measured target through the smartphone application and uploads it to the cloud server.
[0024] Furthermore, a sensor online training method based on machine learning includes the following steps:
[0025] S1: Gets raw data from sensors via Ethernet or RS-485 bus, and also gets measurement values from human-computer interaction devices;
[0026] S2: Input the measurement value of the current target through the smartphone application and upload it to the cloud server;
[0027] S3: uploads raw data to the cloud server via the network;
[0028] S4: Insert the original data and measurement values into the training database. Use the timestamp as the index for each data in the training database. The data with the same timestamp will contain one original data sampling value and one target measurement value.
[0029] S5: The cloud server extracts all data from the training database belonging to the same sensor and retrains the model;
[0030] S6: Download the trained algorithm, i.e., a new set of model parameters, to the data acquisition module;
[0031] S7: Update the new model parameters to the sensor via Ethernet or RS-485 bus, thereby greatly improving the adaptability of the sensor under different working conditions.
[0032] Furthermore, the step S2 further includes the following steps:
[0033] S21: The user inputs the accurate value measured by third-party equipment or laboratory through the smartphone application;
[0034] S22: The user enters the serial number of the online sensor through the smartphone application;
[0035] S23: The smartphone application packages the measurement value, serial number, and current time information and sends them to the cloud server.
[0036] Compared with the existing technology, the beneficial effects achieved by the present invention are: the present invention uses machine learning to collect a large amount of raw data of sensors in complex application scenarios and actual measurement values under corresponding working conditions, and trains the convolutional neural network model through massive data to obtain a set of algorithms that match the current complex application scenarios. The algorithm is then embedded in the sensor software, so that the sensor algorithm can be continuously improved throughout its life cycle, so that the sensor can adapt to different working conditions on site to the greatest extent, stably and reliably complete the monitoring work in complex application scenarios, and achieve a global optimization effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0038] Figure 1 1 is a schematic diagram of a framework of a sensor online training system based on machine learning according to the present invention;
[0039] Figure 2This is a schematic diagram of the steps of a sensor online training method based on machine learning of the present invention;
[0040] Figure 3 This is a schematic diagram of the working steps of a data acquisition module of a sensor online training system based on machine learning of the present invention;
[0041] Figure 4 This is a schematic diagram of the working steps of a cloud server of a sensor online training system based on machine learning of the present invention;
[0042] Figure 5 This is a schematic diagram of the working steps of a smartphone application of a sensor online training system based on machine learning of the present invention. DETAILED DESCRIPTION
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0044] See also Figure 1-5 , the present invention provides a technical solution:
[0045] A sensor online training system based on machine learning includes hardware and software. The hardware includes sensors, data acquisition modules and human-computer interaction devices. The software includes smartphone applications, data acquisition module software and cloud server software. The sensors and data acquisition modules communicate via Ethernet or RS-485 buses. The data acquisition module has 4G / 5G network communication functions and Wi-Fi functions. The smartphone application allows users to input measurement values of the measured targets. The data acquisition module software includes an acquisition unit, an upload unit and a deployment unit. The acquisition unit is responsible for obtaining raw data from the sensor, the upload unit is responsible for uploading the data to the cloud server, and the deployment unit is responsible for updating the algorithm parameters received from the cloud server to the sensor. The cloud server software includes a data receiving unit, a model training unit and a data sending unit. The data receiving unit receives and saves the raw data to the corresponding database via the network. The model training unit uses the continuously updated sensor raw data to train the model parameters. The data sending unit downloads the trained algorithm parameters to the data acquisition module via the network.
[0046] The data acquisition module obtains raw data from the sensor and uploads it to the cloud server through the network. Finally, the new model parameters are updated to the online sensor in the following steps:
[0047] a: Data acquisition module obtains raw data from online sensors;
[0048] b: The data acquisition module adds timestamp information to the collected raw data;
[0049] c: Determine whether the network is normal at this time. If it is normal, go to step d; otherwise, directly save the data to the local database and go back to step a;
[0050] d: Upload the original data with timestamp information added in step b to the cloud server via the network;
[0051] e: Determine whether new model parameters are received from the cloud server. If new model parameters are received, go to step f, otherwise go back to step a;
[0052] f: The data acquisition module updates the new model parameters to the online sensor and continues to obtain raw data from the sensor.
[0053] The acquisition of the online sensor raw data in step a and the updating of the new model parameters to the online sensor in step f are both carried out through the Modbus RTU communication protocol.
[0054] The operation process of the cloud server is as follows:
[0055] (1) Create a TCP Socket application programming interface service to wait for the on-site upload of sensor raw data;
[0056] (2) The cloud server determines whether the sensor raw data has been received. If the sensor raw data has been received, the device serial number and timestamp information are extracted and the raw data is inserted into database A. The process goes to step (3). Otherwise, the cloud server continues to wait for the on-site upload of the sensor raw data.
[0057] (3) Determine whether the marking data sent by the smartphone application has been received. If the marking data has been received, extract the device serial number and timestamp information, insert the marking data into database B, and go to step (4). Otherwise, continue to wait for the on-site upload of the sensor raw data.
[0058] (4) Extract all labeled data from database B and query database A to find the corresponding original data set through the timestamp information. Then retrain the algorithm with the original data and labeled data obtained from the query to obtain new model parameters.
[0059] (5) Check whether the device with the corresponding serial number has established a network connection. If so, the cloud server sends the new model parameters and downloads them to the data acquisition module. Otherwise, the new model parameters will be saved in the cloud server and sent again after the device is connected next time.
[0060] A sensor online training method based on machine learning includes the following steps:
[0061] S1: Gets raw data from sensors via Ethernet or RS-485 bus, and also gets measurement values from human-computer interaction devices;
[0062] S2: Input the measurement value of the current target through the smartphone application and upload it to the cloud server;
[0063] S3: uploads raw data to the cloud server via the network;
[0064] S4: Insert the original data and measurement values into the training database. Use the timestamp as the index for each data in the training database. The data with the same timestamp will contain one original data sampling value and one target measurement value.
[0065] S5: The cloud server extracts all data from the training database belonging to the same sensor and retrains the model;
[0066] S6: Download the trained algorithm, i.e., a new set of model parameters, to the data acquisition module;
[0067] S7: Update the new model parameters to the sensor via Ethernet or RS-485 bus.
[0068] The above step S2 further includes the following steps:
[0069] S21: The user inputs the accurate value measured by third-party equipment or laboratory through the smartphone application;
[0070] S22: The user enters the serial number of the online sensor through the smartphone application;
[0071] S23: The smartphone application packages the measurement value, serial number, and current time information and sends them to the cloud server.
[0072] Taking "spectral probe data collection and nitrate concentration prediction" as an example, the steps to implement this method are as follows:
[0073] Step 1: The online sensor collects raw data corresponding to 256 discrete spectra, which is a 256-dimensional input vector in mathematics. n sampling points form an input matrix X with n rows and 256 columns;
[0074] Step 2: The user obtains the accurate nitrate concentration at the time based on measurements from a third-party device or laboratory, and enters this value into the smartphone app to set the input vector. The target y, let the i-th sampling point, the user set value is y i , n sampling points, set value is the target value vector The serial number of the online sensor is entered through the smartphone application, and the measurement value, serial number and current time information are packaged and sent to the cloud server;
[0075] Step 3: Through the data acquisition module, the input matrix X and the target value vector Upload to the cloud server;
[0076] Step 4: Use machine learning algorithms such as partial least squares regression (PLS) or neural networks on the cloud server to approximate the true spectral input vector and the target value function
[0077] pls=PLSRegression(n_components=9)
[0078] pls.fit(x,y)
[0079] Step 5: Package the multidimensional parameters θ trained on the cloud server and download them to the on-site data acquisition module via the network. According to the PLS algorithm principle, the mean vector x_mean_ of the X matrix, the standard deviation vector x_std, the coefficient vector coef_, and the mean value y_mean_ of the target value, a total of four sets of parameters, need to be downloaded to the slave computer. The method to obtain the parameters is:
[0080] Pls.x_mean_
[0081] Pls.x_std_.
[0082] Pls.coef_.
[0083] Pls.y_mean_[0]
[0084] Step 6: The data acquisition module updates the average value vector, standard deviation vector, coefficient vector and target value average value to the online sensor through the Modbus RTU protocol. The sensor saves these four sets of vectors as parameters in the Flash memory.
[0085] Step 7: In the next measurement cycle, the online sensor will use the new model parameters to calculate the measurement value, such as the calculation formula:
[0086]
[0087] Among them, x is the absorbance input vector measured by the lower computer, x mean is the downloaded trained mean vector x_mean_,x stdis the standard deviation vector x_std after training, C is the coefficient vector coef_ after training, y mean The mean value y_mean_ of the downloaded trained target values.
[0088] like Figure 1 As shown in the figure, the data acquisition module collects a large amount of raw data from sensors in complex application scenarios and actual measurement values under corresponding working conditions. The cloud server uses massive data to train the convolutional neural network model to obtain a set of algorithms that match the current complex application scenario. The algorithm is then embedded into the sensor software, allowing the sensor algorithm to be continuously improved throughout its life cycle, so that the sensor can adapt to different working conditions on site to the greatest extent possible, stably and reliably complete monitoring work in complex application scenarios, and achieve a global optimization effect.
[0089] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0090] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A sensor online training system based on machine learning, including hardware and software, wherein the hardware includes sensors, data acquisition modules and human-computer interaction devices, and the software includes smartphone applications, data acquisition module software and cloud server software, characterized in that: The sensor is connected to a data acquisition module, the smartphone application allows a user to input a measurement value of a measured target, the data acquisition module software includes an acquisition unit, an upload unit and a deployment unit, the acquisition unit is responsible for acquiring raw data from the sensor, the upload unit is responsible for uploading the data to a cloud server, the deployment unit is responsible for updating the algorithm parameters received from the cloud server to the sensor, the cloud server software includes a data receiving unit, a model training unit and a data sending unit, the data receiving unit receives and saves the raw data to a corresponding database via a network, the model training unit uses the continuously updated raw data of the sensor to train the model parameters, and the data sending unit downloads the trained algorithm parameters to the data acquisition module via a network; The specific steps of the cloud server receiving raw data, extracting device serial number and timestamp information, training the algorithm to obtain new model parameters, and sending the new model parameters are as follows: (1) Create a TCP Socket application programming interface service to wait for the on-site upload of sensor raw data; (2) The cloud server determines whether the sensor raw data has been received. If the sensor raw data has been received, the device serial number and timestamp information are extracted, and the raw data is inserted into database A, and the process goes to step (3). Otherwise, the cloud server continues to wait for the on-site upload of the sensor raw data. (3) Determine whether the marking data sent by the smartphone application has been received. If the marking data has been received, extract the device serial number and timestamp information, insert the marking data into database B, and go to step (4). Otherwise, continue to wait for the on-site upload of the sensor raw data. (4) Extract all the labeled data from database B, query database A, find the corresponding original data set through the timestamp information, and retrain the algorithm with the original data and labeled data obtained from the query to obtain new model parameters; (5) Check whether the device with the corresponding serial number has established a network connection. If the network connection has been established, the cloud server sends the new model parameters and downloads them to the data acquisition module. Otherwise, the new model parameters will be saved in the cloud server and sent again after the device is connected next time; The sensor online training method of the sensor online training system based on machine learning comprises the following steps: S1: Get raw data from sensors via Ethernet or RS-485 bus, and get measurement values from human-computer interaction devices; S2: Input the measurement value of the current target through the smartphone application and upload it to the cloud server; S3: upload the original data to the cloud server through the network; S4: insert the original data and the measured value into the training database, and use the timestamp as the index for each data in the training database. The data with the same timestamp will contain one original data sampling value and one target measurement value. S5: The cloud server extracts all the data in the training database belonging to the same sensor and retrains the model; S6: Download the trained algorithm, i.e., a set of new model parameters, to the data acquisition module; S7: Update the new model parameters to the sensor via Ethernet or RS-485 bus.
2. The sensor online training system based on machine learning according to claim 1, characterized in that: The connection modes of the sensor and the data acquisition module include Ethernet and RS-485 bus, and the data acquisition module is provided with 4G / 5G network communication function and Wi-Fi function.
3. The sensor online training system based on machine learning according to claim 1, characterized in that: The data acquisition module obtains raw data from the sensor and uploads it to the cloud server through the network. Finally, the specific steps of updating the new model parameters to the online sensor are as follows: a: The data acquisition module obtains the raw data of online sensors; b: The data acquisition module adds timestamp information to the collected raw data; c: Determine whether the network is normal at this time. If it is normal, go to step d; otherwise, directly save the data to the local database and go back to step a; d: Upload the original data with timestamp information added in step b to the cloud server through the network; e: Determine whether new model parameters are received from the cloud server. If new model parameters are received, go to step f, otherwise go back to step a; f: The data acquisition module updates the new model parameters to the online sensor and continues to obtain raw data from the sensor.
4. The sensor online training system based on machine learning according to claim 3, characterized in that: The acquisition of the raw data of the online sensor in step a and the updating of the new model parameters to the online sensor in step f are both carried out through the Modbus RTU communication protocol.
5. The sensor online training system based on machine learning according to claim 4, characterized in that: The marking in step (3) is a process in which the user inputs the measurement value of the current measured target through a smartphone application and uploads it to the cloud server.
6. The sensor online training system based on machine learning according to claim 1, characterized in that: The step S2 further comprises the following steps: S21: Users input accurate values measured from third-party equipment or laboratories through a smartphone application; S22: The user inputs the serial number of the online sensor through the smartphone application; S23: The smartphone application packages the measurement value, serial number, and current time information and sends them to the cloud server.
Citation Information
Patent Citations
Safety monitoring system based on multiple sensors
CN107707657A
Method and system for crowd-sourced algorithm development
CN108293174A
Multi-sensor vehicle driving detecting system and method based on machine learning
CN110329271A