A wave data edge intelligent computing method and system for marine Internet of Things

By adopting edge intelligent computing and deep learning neural network models in parallel computing in marine IoT systems, the problems of high bandwidth occupation, high cost and real-time transmission difficulties in marine wave data transmission are solved, real-time, continuous and high-frequency transmission of marine wave data is realized, and the needs of marine environmental monitoring and sea condition prediction are met.

CN119204227BActive Publication Date: 2025-04-15OCEAN UNIV OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411667679.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-04-15
Estimated Expiration
2044-11-21

Smart Images

  • Figure CN119204227B_ABST
    Figure CN119204227B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of edge computing technology of marine Internet of Things, and discloses a wave data edge intelligent computing method and system for marine Internet of Things. The acquired acceleration sensor data at a certain time interval is stored in the memory in the form of a data structure of a bidirectional linked list; multiple processes are created to be executed in parallel during the entire running time of the first process; for a single process, the acceleration sensor data at the time interval stored in the bidirectional linked list is read, and the corresponding effective wave height, average wave period and wave direction are obtained through reasoning and calculation by a trained deep learning neural network model, and then data transmission is performed: the generated wave height, wave period and wave direction are sent to the edge side device at a transmission frequency of 4Hz for wireless communication through multi-process concurrent execution calculation and control signal transmission mechanism. The present invention controls multi-threaded concurrent calculation through a semaphore transmission mechanism to achieve data transmission at a frequency of 4Hz.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of edge computing technology for marine Internet of Things, and in particular relates to a wave data edge intelligent computing method and system for marine Internet of Things. Background Art

[0002] The measurement of ocean wave data is of great significance to the fields of navigation safety, marine resource development and environmental monitoring. However, in the current marine IoT applications, many marine detection devices directly transmit raw data to shore-based cloud computing platforms for further processing, which will occupy a large amount of marine network bandwidth. Since marine signal transmission is mainly based on satellite network transmission, the transmission traffic cost is relatively high.

[0003] At the same time, due to the large amount of data to be transmitted, the data transmission time interval is large and real-time transmission cannot be achieved. This will inevitably cause discontinuity and omission of transmitted data. Data loss is also prone to occur during the transmission process, which will bring a lot of inconvenience to further data calculation and conversion. If the original acceleration sensor data is intercepted, it will also pose a huge threat to data security.

[0004] Traditional wave sensors measure waves by obtaining statistical values ​​of non-overlapping time periods, but more and more application scenarios, including marine environment monitoring, sea condition forecasting, and military applications, require continuous real-time wave data. Summary of the invention

[0005] In order to overcome the problems existing in the related art, the embodiments disclosed in the present invention provide a wave data edge intelligent computing method and system for marine Internet of Things, specifically relating to a wave data edge deep learning neural network model parallel computing method for marine Internet of Things.

[0006] The technical solution is as follows: a wave data edge intelligent computing method for marine Internet of Things, the method comprising:

[0007] S1, the time interval to be acquired The acceleration sensor data is stored in the memory in the form of a doubly linked list data structure;

[0008] S2, create multiple processes currently needed, recycle the first process that ends, then create the second process, and so on; during the entire runtime of creating the first process, execute multiple processes simultaneously; when creating multiple processes, for a single process, read the time interval stored in the bidirectional linked list The acceleration sensor time series range data is used to obtain the effective wave height, average wave period and wave direction through inference calculation of the trained deep learning neural network model;

[0009] S3, data transmission, through the control signal transmission mechanism, the generated effective wave height, average wave period and wave direction are sent to the edge side communication module device at a transmission frequency of 4Hz for wireless communication.

[0010] In step S1, the time interval is obtained The acceleration sensor data is stored in the memory in the form of a doubly linked list data structure, including: The frequency of 20ms and 50Hz is used to send binary instructions from the main development board program to the MEMS accelerometer. After receiving the instructions, the MEMS accelerometer sends real-time sensor data to the main development board. The main development board program sets cache variables to receive the accelerometer data, and then stores the accelerometer data in the cache variables in the memory in the form of a two-way linked list data structure. Among them, a separate peripheral clock is used to time data acquisition and trigger a clock interrupt program. The interrupt program is executed every 20ms. The interrupt program sends data to obtain binary instructions, and uses three variables to receive three-axis acceleration data, which are then placed in a two-way linked list data structure object instance.

[0011] In step S2, the first terminated process is recycled, and then a second process is created, including:

[0012] (1) Use the task creation API - xTaskCreate of the development board system to create a new task, and use the system task deletion API - vTaskDelete to delete the task. After the task is created, use the system scheduler - vTaskStartScheduler to schedule the task;

[0013] (2) Ensure that the acceleration sensor receives the specified time interval length at a certain moment. After the data is received, the system scheduler interface is called by the program to start the first process and send a start signal to the second process. The semaphore that complies with the POSIX standard is used to allow synchronization across multiple processes. The semaphore is initialized using sem_init, sem_wait is used to wait for the semaphore, and sempost is used to send the semaphore. The first process will The acceleration data is read from the head end of the bidirectional linked list and stored as a temporary copy for calculation. After the calculation is completed, after waiting for a redundant time of 0.1s, data transmission is executed, and the timing is 0.25s. After 0.25s, the transmission signal is sent to the second process.

[0014] In the second process, after receiving the start signal sent by the first signal, it waits for 0.25s, sends the start signal to the next process, and loads data from the head of the bidirectional linked list in memory again. The data time interval is ; The wave data is calculated through the deep learning neural network model. After the calculation is completed, it waits for the transmission signal sent by the previous process. When the transmission signal is received, data is transmitted immediately and the timing is 0.25s. After the timing is over, the transmission signal is sent to the next process.

[0015] In step S2, the effective wave height, average wave period and wave direction are obtained through inference calculation of the trained deep learning neural network model, including:

[0016] The deep learning neural network model uses a self-attention mechanism combined with a multi-channel fully connected layer model architecture. At each moment, the acceleration has Data from three directions form three routes. Route 1 receives direction The time interval data is used as input. First, the three data are preprocessed separately, including discrete Fourier transform DFT, filtering, and inverse discrete Fourier transform IDFT. Discrete Fourier transform DFT converts the input time series acceleration data from time domain representation to frequency domain representation. The mathematical expression of discrete Fourier transform DFT is expressed as:

[0017] ;

[0018] In the formula, is the frequency domain value, is the time domain value, is the length of the input data, is the frequency index, is an imaginary unit; is a discrete time index, from 0 to ; is the Euler number;

[0019] The filtering is achieved by:

[0020] ;

[0021] In the formula, is the discrete value after filtering, is a Gaussian high-pass filter;

[0022] Performing an inverse Fourier transform will Convert to time domain value again;

[0023] The formula for the inverse discrete Fourier transform is:

[0024] ;

[0025] In the formula, is the time domain value after filtering, is the frequency domain value after filtering;

[0026] After completing the inverse discrete Fourier transform, normalization is performed, and the minimum-maximum normalization method is used to scale the data to Range, statistics are taken from the historical data of the wave sensor to obtain the maximum and minimum values ​​of the acceleration sensor values. and , for the input data , use the normalization formula to scale it to a fixed range, the expression is:

[0027] ;

[0028] In the formula, is the normalized acceleration vector, is the original acceleration vector;

[0029] After normalization, the data is processed using a simplified self-attention mechanism. The self-attention mechanism is processed as follows:

[0030] ;

[0031] ;

[0032] ;

[0033] ;

[0034] In the formula, is the output of the self-attention module, For input, symbol is the scalar product, symbol is the vector inner product, The activation function is used for probability conversion;

[0035] The output of the attention mechanism module passes through several layers of fully connected layers and outputs the intermediate value , It represents a vector of three values, corresponding to the effective wave height, average wave period and wave direction to be output. and Direction data is processed to obtain the middle layer and , After a self-attention mechanism, a fully connected layer is finally connected to obtain the final effective wave height , average wave period and wave direction , The value range is 0~1, corresponding to 0~360°, and the formula is as follows:

[0036] ;

[0037] ;

[0038] ;

[0039] ;

[0040] In the formula, represents the fully connected layer, l represents the number of layers, represents a simplified self-attention module, The input of the self-attention layer is After the output, The input of the self-attention layer is After the output, is the number of input time series values, that is, the time index of the discrete signal in the time domain. For the Layer fully connected layer;

[0041] The output effective wave height, average wave period and wave direction data are inversely normalized to obtain the final effective wave height and average wave period data. The maximum and minimum values ​​used in the normalization process are used for inverse normalization. Inverse normalization is not performed on the edge side, so that the data is encrypted. When the shore-based platform equipment receives the data, inverse normalization is performed using the following formula:

[0042] ;

[0043] In the formula, the wave direction data range is 0~1. After receiving the shore-based data, it is mapped to the actual wave angle by multiplying it with 360°.

[0044] In step S2, the deep learning neural network model is used for forward reasoning of data after training. The training data uses historical observation data, including historical acceleration sensor data and corresponding effective wave heights, average wave periods and wave directions. The historical acceleration sensor data is used as training input data, and the historical effective wave heights and wave periods are used as labels. The improved Adam optimizer is used for parameter optimization and back propagation. The improved Adam optimization uniformly sets the learning rate learning rate=0.001~0.0015 at the beginning of training, and gradually increases the learning rate as the number of training times increases. When the parameters need to be adjusted in reverse, the learning rate is reduced again, so that the learning rate is reduced when the optimal value is first crossed, and gradually approaches the optimal value.

[0045] In step S3, when data is transmitted, the data is first formatted into a character array, and then the communication interface UART is initialized, the baud rate, start bit, check bit, and stop bit are set, and then the data is sent to the wireless communication module on the edge device through the data sending interface of the communication interface, and the response signal sent back by the wireless communication module is waited for to confirm that the data has been successfully sent.

[0046] In step S3, the control signal transmission mechanism includes: when a process ends, the generated data is transmitted through the antenna while ensuring that the number of computing cores is sufficient, and the next process transmits the data generated by the process again at 0.25s, and so on, that is, data is transmitted once every 0.25s, and a total of 4 data transmissions within 1s, to achieve real-time data transmission at a frequency of 4Hz; the time interval of the time data processed by any process is , then delete the time interval from the head of the bidirectional linked list The acceleration sensor data can be transferred to the external storage medium.

[0047] Furthermore, the number of computing cores is calculated based on the time required for a single process to calculate the wave data, and the expression is:

[0048] ;

[0049] In the formula, To calculate the number of cores, is the computational running time of a single process, is the safety delay time of a single process, For the time period.

[0050] Another object of the present invention is to provide a wave data edge intelligent computing system for marine Internet of Things, which is implemented by the wave data edge intelligent computing method for marine Internet of Things, and the system includes:

[0051] Acceleration sensor data acquisition module, used to obtain the time interval The acceleration sensor data is stored in the memory in the form of a doubly linked list data structure;

[0052] Multiple process creation modules are used to create multiple processes currently needed, recycle the first terminated process, and then create the second process, and so on; during the entire runtime of creating the first process, multiple processes are executed simultaneously; when creating multiple processes, for a single process, the time interval stored in a bidirectional linked list is read The acceleration sensor time series range data is used to obtain the effective wave height, average wave period and wave direction through inference calculation of the trained deep learning neural network model;

[0053] The data transmission module is used for data transmission. By controlling the signal transmission mechanism, the generated effective wave height, average wave period and wave direction are sent to the edge-side communication module device at a transmission frequency of 4Hz for wireless communication.

[0054] Furthermore, the system is mounted on an ocean navigation device of a submersible or an unmanned ship at sea to obtain ocean wave data in real time. The obtained ocean wave data is used for marine meteorological science to predict and prevent extreme ocean weather.

[0055] In combination with all the above technical solutions, the beneficial effects of the present invention are as follows: the present invention provides a method for using artificial intelligence deep learning on the edge side to infer and calculate the input acceleration sensor data to obtain various wave parameters and realize 4Hz high-frequency transmission. The method obtains the effective wave height, average wave period and wave direction of the wave after inference by inputting the original sensor data into the deep learning neural network model; and controls multi-threaded concurrent computing through a semaphore transmission mechanism to realize 4Hz frequency data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure;

[0057] Figure 1 It is a flow chart of a wave data edge intelligent computing method for marine Internet of Things provided by an embodiment of the present invention;

[0058] Figure 2 It is a simplified schematic diagram of the self-attention mechanism provided by an embodiment of the present invention;

[0059] Figure 3 It is a schematic diagram of the recovery and creation of parallel processes provided by an embodiment of the present invention;

[0060] Figure 4 is a diagram of the wave parameter calculation model architecture provided by an embodiment of the present invention;

[0061] Figure 5 It is a schematic diagram of a multi-process parallel execution calculation and control signal transmission mechanism provided by an embodiment of the present invention;

[0062] Figure 6 is a schematic diagram of the transmission data processing coverage provided by an embodiment of the present invention;

[0063] Figure 7 It is a comparison chart of the output results of the deep learning neural network model reasoning method and the traditional numerical calculation method provided by an embodiment of the present invention;

[0064] Figure 8 is a circuit diagram of a MEMS acceleration sensor chip provided by an embodiment of the present invention;

[0065] Fig. 9 This is a diagram of the overall development board architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific implementation disclosed below.

[0067] The innovation of the present invention is that the present invention can input accelerometer data to calculate the effective height of waves, the average wave period and the wave direction; the calculation of wave parameters can be executed concurrently by multiple threads and output at a transmission frequency of 4Hz. The data used in the reasoning process of the present invention is the sensor data sampled by window shifting, covering all data, so that the data results are more accurate. Moreover, since the input data is selected by continuous window movement, the output data is continuous and real-time. In the transmission process, the processed data is transmitted. Compared with the direct transmission of the original sensor data, the amount of transmitted data is greatly reduced, and the security of the original data is effectively protected. At the same time, the present invention adopts a deep learning model for numerical reasoning calculation, which has stronger generalization ability and improved fault tolerance. Finally, the present invention uses normalized data for reasoning calculation, which is transmitted first, and then inverse normalized after the shore-based equipment receives it, so the transmitted data is encrypted to a certain extent, ensuring the security of the transmitted data.

[0068] Embodiment 1, as Figure 1 As shown, the wave data edge intelligent computing method for the marine Internet of Things provided by the embodiment of the present invention includes:

[0069] S1, the time interval to be acquired The acceleration sensor data is stored in the memory in the form of a doubly linked list data structure;

[0070] The accelerometer acquires data at a frequency of 50 Hz and stores it in memory, that is, it acquires data every 20 ms. In addition, the accelerometer uses an independent timer, which will not conflict with other subsequent timing requirements, such as the timing of signal transmission.

[0071] Exemplarily, the acceleration sensor acquires acceleration data at a time interval of 20 ms and stores it in the memory, and the data structure of the bidirectional linked list is stored in the memory, including:

[0072] Corresponding binary instructions are sent from the main development board program to the MEMS accelerometer at a frequency of 50 Hz. After receiving the instructions, the MEMS accelerometer immediately sends real-time sensor data to the main development board. The main development board program sets a cache variable for receiving the accelerometer data, and then stores the accelerometer data in the cache variable in the memory in the form of a two-way linked list data structure. A separate peripheral clock is used to time data acquisition and trigger a clock interrupt program. The interrupt program is executed every 20 ms. The interrupt program sends data to obtain binary instructions, and uses three variables to receive three-axis acceleration data, which are then placed in a two-way linked list data structure object instance.

[0073] S2, create multiple processes currently needed, recycle the first process that ends, then create the second process, and so on; during the entire runtime of creating the first process, execute multiple processes simultaneously; when creating multiple processes, for a single process, read the time interval stored in the bidirectional linked list The acceleration sensor time series range data is used to obtain the effective wave height, average wave period and wave direction through inference calculation of the trained deep learning neural network model;

[0074] The above processes are all performed on edge devices;

[0075] S3, data transmission, through the control signal transmission mechanism, the generated effective wave height, average wave period and wave direction are sent to the edge side communication module device at a transmission frequency of 4Hz for wireless communication;

[0076] The data sent by wave height and wave period are the data before inverse normalization. As a confidentiality mechanism, shore-based or other equipment receives the data and performs inverse normalization to obtain the correct data. The transmitted data is only the inverse normalization data of the calculated wave height and wave period. Compared with the original data of the transmission and speed sensor, the amount of transmitted data is greatly reduced.

[0077] Example 2, as another implementation of the present invention, the edge intelligent computing method for wave data for marine Internet of Things provided by the embodiment of the present invention obtains the corresponding wave effective height, average wave period and wave direction after inference calculation of accelerometer data at a certain time interval through a trained deep learning neural network model. The calculation process is performed on the edge side device; the calculation of wave parameters can be executed concurrently by multiple threads and output at a transmission frequency of 4 Hz.

[0078] Specifically, the wave sensor uses a MEMS acceleration sensor chip (such as Figure 8 ), by integrating it with the ADC analog-to-digital conversion chip, the acceleration analog quantity obtained by the acceleration sensor can be converted into a digital quantity, and then the RS232 digital interface is integrated into the main development board for data transmission between the ADC analog-to-digital conversion chip and the main development board. This design makes the sensor and the connection circuit all printed circuits, reducing the size of the entire system and reducing energy consumption. The overall development board architecture is as follows Fig. 9 shown.

[0079] This method needs to obtain 50 data from the MEMS accelerometer every 1 second as input for subsequent calculations. The MEMS accelerometer chip itself has embedded binary instructions for value acquisition. Therefore, by sending the corresponding binary instructions from the main development board program to the MEMS accelerometer, the MEMS accelerometer will immediately send instant sensor data to the main development board after receiving the instructions. The main development board program sets a cache variable to receive the sensor data, and then stores the accelerometer data in the cache variable in the form of a two-way linked list data structure in the memory. In order not to interfere with the subsequent 4Hz output timing clock, a separate peripheral clock is used to time data acquisition and trigger the clock interrupt program, that is, the interrupt program is executed every 20ms. The interrupt program sends the "data acquisition" binary instruction and uses three variables to receive the three-axis acceleration data, and then puts it into a two-way linked list. The subsequent calculation program can directly read the data from the two-way linked list.

[0080] When the program starts executing, all currently needed processes are created in advance, that is, all processes that will run simultaneously during the entire running time of the first process. Then, after the first process ends, the ended process is recycled, and then a new terminal process is created. The process creation and recycling process is as follows Figure 3 As shown, specifically, the task creation uses the development board system's task creation API - xTaskCreate to create a new task, and the recycling uses the system's task deletion API - vTaskDelete to delete the task. After the task is created, the system scheduler - vTaskStartScheduler is used to schedule the task, including starting and stopping the process.

[0081] After that, after ensuring that a certain moment is set to time 0, the sensor receives data of the specified time interval length t1, and then calls the system scheduler interface through the program to start the first process, and sends a "start signal" to the second process. The transmission of semaphores is a synchronization mechanism. The present invention adopts semaphores that follow the POSIX standard, which allows synchronization across multiple processes. It can use sem_init to initialize the semaphore, use sem_wait to wait for the semaphore, and use sempost to send the semaphore. After that, process one reads the acceleration data of duration t1 from the head end of the bidirectional linked list and saves it as a temporary copy for calculation. After the calculation is completed, after waiting for a redundant time of 0.1s, data transmission is executed, and the timing is 0.25s. After reaching 0.25s, the "transmission signal" is sent to the next process.

[0082] In the second process, after receiving the start signal sent by the first signal, it waits for 0.25s, sends the start signal to the next process immediately, and loads data from the head of the bidirectional linked list in the memory again. The data time interval is 0.25s~t1+0.25s, and then the wave data is calculated through the deep learning neural network model. After the calculation is completed, it waits for the "transmission signal" sent by the previous process. When the "transmission signal" is received, data transmission is performed immediately, and the timing is 0.25s. After the timing is over, the "transmission signal" is sent to the next process. The wave parameter calculation model architecture is as follows Figure 4 shown.

[0083] During data transmission, the data is first formatted, that is, formatted into a character array, and then the communication interface UART is initialized, the baud rate, start bit, check bit, and stop bit are set, and then the data is sent to the wireless communication module on the edge device through the data sending interface of the communication interface, and then wait for the response signal sent back by the wireless communication module to confirm that the data has been successfully sent.

[0084] Each subsequent process is the same as the second process. The signal transmission process of the entire process is as follows: Figure 5 As shown in the multi-process concurrent execution calculation and control signal transmission mechanism, under the condition of ensuring sufficient number of computing cores, the following effects can be achieved: when a process ends, the generated data is transmitted through the antenna, and the next process will transmit the data generated by the process again at 0.25s, and so on, that is, data is transmitted every 0.25s, and a total of 4 data transmissions within 1s, that is, real-time data transmission at a frequency of 4Hz is achieved. Suppose the time interval of the time data processed by any process is , then delete the time interval from the head of the bidirectional linked list The acceleration sensor data can be transferred to the external storage medium to save memory space. Figure 6 shown.

[0085] The number of computing cores can be calculated based on the time required for a single process to calculate wave data, as shown in the following formula:

[0086] ;

[0087] This formula is a core quantity calculation formula specifically proposed for the solution of the present invention, where: To calculate the number of cores, is the computational running time of a single process, is the safety delay time of a single process, is the time period. The delay time takes into account that the running time of each process is not completely equal, so a tail waiting time is required to make up the duration of all processes to the same. The 0.25 is to achieve a processing frequency of 4 Hz, that is, it is required to be equivalent to a time period of 0.25. This formula is based on Figure 5 The pipeline job processing method is designed by ourselves, which is mainly used to calculate the minimum number of computing cores that should be guaranteed to be owned by the running hardware system. If the number of cores is lower than this number, when the new data processing moment starts to be sent, all computing cores will be busy and no idle computing cores can be allocated.

[0088] In a single process, complete an interval The deep learning neural network model is used to calculate the wave parameters. The input is The acceleration data within the time interval is output as the effective wave height of the time interval , average wave period , wave direction . The value range is 0~1, corresponding to 0~360°

[0089] The neural network model structure is as follows Figure 4 As shown in Figure 1, it uses a self-attention mechanism combined with a multi-channel fully connected layer model architecture, which greatly reduces the number of parameters and speeds up the reasoning calculation. Specifically, at each moment, the acceleration has The model has three routes for data in three directions. direction The time interval data is used as input, and the three data are first preprocessed, including discrete Fourier transform (DFT), filtering, and inverse discrete Fourier transform (IDFT). Discrete Fourier transform (DFT) performs DFT on the input time series acceleration data, converting it from time domain representation to frequency domain representation. The frequency in the frequency domain is for the period, so the time span of the input data should exceed one wave period, and according to experience, it should be at least 30s. The mathematical expression of discrete Fourier transform DFT can be expressed as:

[0090] ;

[0091] In the formula, is the frequency domain value, is the time domain value, is the length of the input data, is the frequency index, is an imaginary unit; is a discrete time index, from 0 to ; is the Euler number;

[0092] Filtering can be done through digital filters, specifically high-pass filters (BPF), because lower frequencies may be clutter from some waves, and waves are periodic in a short period of time. The filter design process uses a Gaussian high-pass filter, and its parameters need to set standard deviations. By testing different standard deviations and comparing the filtered frequency domain graphs, the appropriate standard deviation can be finally determined. After obtaining the filter H, filtering can be achieved through the following formula:

[0093] ;

[0094] In the formula, is a Gaussian high-pass filter, is a discrete value after filtering. At this time, an additional inverse Fourier transform can convert Y into a time domain value again, that is, the acceleration data within a time interval, but it has been filtered. The formula for the inverse discrete Fourier transform is:

[0095] ;

[0096] In the formula, is the time domain value after filtering, is the frequency domain value after filtering;

[0097] After completing the inverse discrete Fourier transform, normalization is required. Data normalization can normalize all eigenvalues ​​to the same scale. The gradient descent algorithm can update the weights more effectively, speed up the convergence speed in the neural network training process, and alleviate the problems of gradient vanishing and gradient exploding. It also makes different eigenvalues ​​comparable, and can make different eigenvalues ​​have the same scale of influence on the loss function. The present invention adopts the "minimum-maximum normalization" method to scale the data to Specifically, the maximum and minimum values ​​of the acceleration sensor values ​​are obtained from the historical data of the wave sensor. and , for the input data a, the normalization formula can be used to scale it to a fixed range:

[0098] ;

[0099] In the formula, is the normalized acceleration vector, is the original acceleration vector;

[0100] After normalization, the simplified self-attention mechanism is used to process the data. Since the calculation does not need to consider the temporal nature of the range time sensor data, the temporal position does not need to be encoded, and the normalized sensor data can be directly input into the self-attention module. The specific processing method is as follows: Figure 2 , this simplified version of the self-attention mechanism can calculate the relationship between each input value, thereby assigning different calculation weights to each data. In the self-attention mechanism, the normalized data is first input, and then each data is multiplied with other data to obtain the attention score of the data to each data, and then the softmax function is used to standardize the attention score. The standardized attention score is used to perform weighted summation on the embedding vector, that is, the contextual representation of each element is obtained, and then it is input into the next network layer. The self-attention mechanism is processed as follows:

[0101] ;

[0102] ;

[0103] ;

[0104] ;

[0105] In the formula, is the output of the self-attention module, For input, symbol is the scalar product, symbol is the vector inner product, The activation function is used for probability conversion;

[0106] The output of the attention mechanism module passes through several layers (the specific number of layers is determined by the hyperparameter tuning of the training process) of the fully connected layer, and the intermediate value is output. , It represents a vector of three values, corresponding to the effective wave height, average wave period and wave direction to be output. and The data of the direction are processed similarly to obtain the middle layer and , After that, it goes through a self-attention mechanism and finally connects to a fully connected layer to obtain the final effective wave height. , average wave period , wave direction This part of the process is formulated as follows:

[0107] ;

[0108] ;

[0109] ;

[0110] ;

[0111] In the formula, represents the fully connected layer, l represents the number of layers, represents a simplified self-attention module, The input of the self-attention layer is After the output, The input of the self-attention layer is After the output, is the number of input time series values, that is, the time index of the discrete signal in the time domain. For the Layer fully connected layer;

[0112] Because in the inference process, the original acceleration sensor data is normalized before inference, so the output wave height and wave period data need to be inverse normalized to obtain the final effective wave height and wave period data, and inverse normalization must use the maximum and minimum values ​​used in the normalization process. The present invention does not perform inverse normalization on the edge side, and encrypts the data in this way. The security of the data can be guaranteed to a certain extent during the transmission process. When the shore-based or other platform equipment receives the data, it is inverse normalized by the following formula:

[0113] ;

[0114] In the formula, the wave direction data range is 0~1. After receiving the shore-based data, it is mapped to the actual wave angle by multiplying it with 360°.

[0115] In an embodiment of the present invention, the deep learning neural network model needs to be trained before it can be used for forward reasoning of data. The training data uses historical observation data, including historical acceleration sensor data and its corresponding effective wave height and wave period, wherein the historical acceleration sensor data is used as training input data, and the historical effective wave height and wave period are used as labels. The Adam optimizer is used for parameter optimization and back propagation. The Adam (Adaptive MomentEstimation) optimizer combines the advantages of two optimization methods, momentum (Momentum) and RMSprop (Root Mean Square Propagation), and can adaptively adjust the learning rate of each parameter during the training process. The present invention improves the use of the Adam optimizer. At the beginning of training, a smaller learning rate learning rate=0.001~0.0015 is uniformly set, and the learning rate is gradually increased as the number of training times increases. When the parameters need to be adjusted in reverse, the learning rate is reduced again to prevent the adjustment of the parameter weights from always jumping over the optimal value, so that the model can reduce the learning rate when it first crosses the optimal value and gradually approach the optimal value, which helps the model to converge more stably in the early stage of training.

[0116] During the training process, it is necessary to calculate the difference between the calculated result and the actual value, that is, the loss function. The present invention uses MSE (mean square error loss) as the loss function. During the training process, the training data is processed in batches, and a batch of data is input for each training. Then the model is forward-inferred to obtain the result, and the MSE between the result and the label is calculated. Then the loss is back-propagated, and all parameters in the model are updated, that is, a training cycle is completed. All batches are trained as an epoch. For this type of reasoning problem, 100 rounds of training can make the model converge.

[0117] During the training process, about 20% of the data will be randomly sampled from the training data as the validation set. The validation set can be used to adjust hyperparameters (learning rate, number of model layers) during the training process. A grid search method is used to traverse all hyperparameters. In order to reduce the training time, an early termination strategy is adopted, that is, if the performance does not improve during several rounds of verification, the training process under the hyperparameter configuration is terminated.

[0118] After training, the model weight parameters and optimal hyperparameters are saved and pre-loaded into the model during forward reasoning to start data reasoning, that is, input acceleration sensor data of a certain period and output effective wave height Hs, average wave period Tm, and wave direction Wd. The pseudo code for training and parameter tuning is shown in Table 1.

[0119] Table 1 Pseudo code for training and parameter tuning

[0120]

[0121] Data transmission does not transmit the original acceleration value, but the calculated wave effective wave height, average wave period and wave direction value. The sampling frequency of the acceleration sensor is 50Hz, so if the data in the time period t1 (t1>30s) is calculated, the sampling volume is 50t1 (>1500samples). Through edge computing, there is no need to send 50t1 of data, and it can be calculated as the required features before transmission.

[0122] Through the above algorithm, the raw data of the accelerometer can be converted into wave effective wave height, average wave period and wave direction data for transmission. This algorithm saves bandwidth and is conducive to protecting the security of the original sensor data. At the same time, through multi-core parallel computing, the wave data transmission frequency can reach 4Hz (previously the transmission period was 20s), ensuring the real-time transmission of wave data and ensuring that the data application end can obtain continuous wave data rather than segmented statistical data. In the data calculation process, the artificial intelligence deep learning neural network model is adopted instead of the traditional numerical method. The model is data-driven and can automatically learn the linear and nonlinear relationship between the acceleration value and the wave effective wave height, average wave period and wave direction. Compared with the traditional numerical method, it has stronger generalization and stronger assimilation ability for abnormal data. It can act as a filter itself, and takes into account the performance requirements of ocean monitoring, optimizes the structure of the traditional fully connected layer, and greatly reduces the number of model parameters in a three-way separation manner, which correspondingly reduces the amount of calculation in the reasoning process, thereby increasing the reasoning speed and improving the computing energy efficiency.

[0123] It can be seen from the above embodiments that the present invention is expected to bring significant economic benefits in the field of ocean monitoring through its unique technical solution. Specifically, the present invention can transmit the parameters of the measured waves in real time and safely at a frequency of 4Hz, which has a huge performance improvement compared to the 20s transmission period of traditional products, and can obtain more abundant ocean wave data to better serve marine scientific research. Not only can this solution be adopted on new wave observation equipment, but traditional deployed equipment can also use this patented invention through upgrading and transformation. In addition, the present invention is also expected to promote the innovation and development of related technologies, drive the upgrading of the entire marine detection equipment industry chain, and bring positive impetus to society and the economy.

[0124] At present, there is no technical solution identical or similar to the present invention in the domestic and foreign markets. The present invention fills the technical gap in this field and provides a new technical path for solving how to continuously and real-timely transmit ocean wave parameters at high frequency. The use of this method will increase the calculation speed of edge measurement, and the data obtained is no longer the interval data obtained by traditional wave sensors, but real-time, continuous wave data obtained by inference from the original data covering the entire time length.

[0125] For a long time, the field of ocean wave monitoring has always had the problem of low data transmission frequency. Generally, it takes 20 seconds to transmit wave data once, which makes the wave data too sparse in the time dimension and cannot meet the needs of certain refined ocean research. It limits the development of the field of ocean wave scientific research, and domestic related research institutions have not found suitable alternative monitoring equipment. The technical solution of the present invention has conducted in-depth research on these problems and successfully proposed an effective solution. The pipeline data parallel processing program is controlled by a signal transmission mechanism to achieve continuous real-time transmission of 4Hz wave data. The present invention not only solves these long-standing problems, but also lays a solid foundation for future high-frequency calculations of ocean waves.

[0126] In the traditional edge computing end, research is often limited to a single computing core, which severely limits the computing speed of the edge side. However, if the computing cores are appropriately increased, they can be coordinated to work in parallel through the signal transmission mechanism, achieving a significant increase in computing speed. Traditional edge computing uses numerical methods for calculation and filtering, but this often has low adaptability. If an unexpected error data appears in the sensor, the calculation result will produce a huge deviation. The present invention uses a small-scale deep learning neural network, uses discrete Fourier transform to embed the network for filtering, and then infers and calculates the result, which is more robust. The present invention directly transmits un-inverse normalized data as a means of encryption, which is completely different from the previous method of adding additional signal encryption processing procedures, and uses semi-finished data to ensure data security. The technical solution of the present invention overcomes these technical biases through its innovative design and implementation, proving the limitations of traditional technical concepts. The successful implementation of the present invention not only brings new perspectives to the field of technology, but also provides impetus for continuous innovation in the industry.

[0127] Embodiment 2, the embodiment of the present invention provides a wave data edge intelligent computing system for marine Internet of Things, the system comprising:

[0128] The acceleration sensor data acquisition module is used to store the acceleration sensor data acquired at a certain time interval t1 in the memory in the form of a bidirectional linked list data structure;

[0129] Multiple process creation modules are used to recycle the first terminated process, and then create the second process, and so on, to create multiple processes that are executed in parallel during the entire running time of the first process; in creating multiple processes, for a single process, read the acceleration sensor data of the time interval t1 stored in a bidirectional linked list, and obtain the corresponding effective wave height, average wave period, and wave direction through inference calculation by the trained deep learning neural network model. This calculation process is all performed on the edge side device;

[0130] The data transmission module is used to send the generated wave height and wave period to the edge device for wireless communication at a transmission frequency of 4Hz through multi-process concurrent execution of calculations and control signal transmission mechanism.

[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0132] To further illustrate the relevant effects of the embodiments of the present invention, during the verification process, the experimenters will drop a buoy carrying the algorithm development board into the Bohai Sea. The buoy will rise and fall with the waves and drift. At this time, the acceleration sensor carried by the buoy will regularly output the acceleration value to the development board storage system. The algorithm program in the memory will regularly extract data from the storage system and output the effective wave height and average wave period after calculation according to the above-mentioned calculation method. The output data will be directly transmitted to the ground receiving station through the marine satellite communication system. The receiving station personnel can obtain the wave data of the specified sea area in real time and further process the data for other scientific research purposes.

[0133] The traditional numerical calculation method takes a long time to calculate and cannot be executed in parallel. The GPU resources on modern development boards cannot be fully utilized. The frequency of calculating and transmitting wave parameters by the traditional numerical method is once every 20 seconds. However, this method can transmit wave data 4 times within 1 second by combining deep learning neural network and parallel computing. In terms of numerical reasoning calculation accuracy, it can achieve the accuracy of traditional numerical methods, with faster calculation speed and more stable numerical output. The output results of the two methods on the same data input are compared in Figure 7 The performance comparison between the two is shown in Table 2 below.

[0134] Table 2 Comparison of wave data calculation and transmission performance

[0135]

[0136] The algorithm can be used in the development board of drifting buoys, so that drifting buoys can calculate and transmit wave data of designated sea areas in real time. The algorithm is also applicable to submersibles and marine navigation devices of unmanned ships at sea to obtain ocean wave data in real time. The acquired ocean data can be used for marine meteorological scientific research, prediction and prevention of extreme marine weather such as typhoons and tsunamis, and can also be used for marine ship navigation scheduling and other military-related purposes.

[0137] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A wave data edge intelligent computing method for marine Internet of Things, characterized in that: The method includes: S1, storing the acquired acceleration sensor data of time interval t1 in the memory in the form of a bidirectional linked list data structure; S2, create multiple processes currently needed, recycle the first terminated process, then create the second process, and so on; during the entire running time of creating the first process, execute multiple processes simultaneously; when creating multiple processes, for a single process, read the acceleration sensor time series range data of the time interval t1 stored in a bidirectional linked list, and obtain the effective wave height, average wave period and wave direction through inference calculation of the trained deep learning neural network model; S3, data transmission, through the control signal transmission mechanism, the generated effective wave height, average wave period and wave direction are sent to the edge side communication module device at a transmission frequency of 4Hz for wireless communication; In step S2, the first terminated process is recycled, and then a second process is created, including: (1) Use the task creation API-xTaskCreate of the development board system to create a new task, and use the system task deletion API-vTaskDelete to delete the task. After the task is created, use the system scheduler-vTaskStartScheduler to schedule the task; (2) After ensuring that it is set to 0 at a certain moment and the acceleration sensor receives data with a specified time interval length t1, the system scheduler interface is called through the program to start the first process and send a start signal to the second process. The semaphore that complies with the POSIX standard is used to allow synchronization across multiple processes. The semaphore is initialized using sem_init, sem_wait is used to wait for the semaphore, and sempost is used to send the semaphore. The first process reads the acceleration data of duration t1 from the head of the bidirectional linked list and stores it as a temporary copy for calculation. After the calculation is completed, after waiting for a redundant time of 0.1s, data transmission is executed, and a time of 0.25s is counted. After 0.25s is reached, a transmission signal is sent to the second process. In the second process, after receiving the start signal sent by the first signal, it waits for 0.25s, sends the start signal to the next process, and loads data from the head end of the bidirectional linked list in the memory again. The data time interval is 0.25s~t1+0.25s; the wave data is calculated through the deep learning neural network model. After the calculation, it waits for the transmission signal sent by the previous process. When the transmission signal is received, data is transmitted immediately, and the timing is 0.25s. After the timing is over, the transmission signal is sent to the next process; In step S3, the control signal transmission mechanism includes: under the condition that the number of computing cores is sufficient, when a process ends, the generated data is transmitted through the antenna, and at the same time, the next process transmits the data generated by the process again at 0.25s later, and so on, that is, data is transmitted once every 0.25s, and a total of 4 data transmissions are performed within 1s, so as to realize real-time data transmission at a frequency of 4Hz; if the time interval of the time data processed by any process is (t_start, t_end), the acceleration sensor data of the time interval (t_start, t_start+0.25) is deleted from the head end of the bidirectional linked list, or the data within the time interval is transferred to the external storage medium.

2. The wave data edge intelligent computing method for marine Internet of Things according to claim 1 is characterized in that: In step S1, the acquired acceleration sensor data of the time interval t1 is stored in the memory in the form of a two-way linked list data structure, including: sending a binary instruction from the main development board program to the MEMS acceleration sensor at a time interval t1 of 20ms and a frequency of 50Hz, after receiving the instruction, the MEMS acceleration sensor sends the real-time sensor data to the main development board, the main development board program sets a cache variable for receiving the acceleration sensor data, and then stores the acceleration sensor data in the cache variable in the memory in the form of a two-way linked list data structure; wherein, a separate peripheral clock is used to time data acquisition and trigger a clock interrupt program, the interrupt program is executed every 20ms, the interrupt program sends a data acquisition binary instruction, and uses three variables to receive three-axis acceleration data, and then places it in a two-way linked list data structure object instance.

3. The wave data edge intelligent computing method for marine Internet of Things according to claim 1 is characterized in that: In step S2, the effective wave height, average wave period and wave direction are obtained through inference calculation of the trained deep learning neural network model, including: The deep learning neural network model adopts a model architecture that combines a self-attention mechanism with a multi-channel fully connected layer. At each moment, the acceleration has data in the three directions of x, y, and z to form three routes. Route 1 receives data in the x direction at the time interval of t1 as input. First, the three-way data is preprocessed separately, including discrete Fourier transform DFT, filtering, and inverse discrete Fourier transform IDFT; discrete Fourier transform DFT converts the input time series acceleration data from time domain representation to frequency domain representation. The mathematical expression of discrete Fourier transform DFT is expressed as: Where X[k] is the frequency domain value, x[n] is the time domain value, N is the length of the input data, k is the frequency index, j is the imaginary unit; n is the discrete time index, from 0 to N-1; e is the Euler number; The filtering is achieved by: Y=X[k]*H In the formula, Y is the discrete value after filtering, and H is the Gaussian high-pass filter; Perform inverse Fourier transform to convert Y into time domain value again; The formula for the inverse discrete Fourier transform is: In the formula, y[n] is the time domain value after filtering, and Y[k] is the frequency domain value after filtering; After completing the inverse discrete Fourier transform, normalization is performed. The minimum-maximum normalization method is used to scale the data to the range of [0, 1]. Statistics are performed from the historical data of the wave sensor to obtain the maximum and minimum values ​​of the acceleration sensor values, which are max(a) and min(a), respectively. For the input data a, the normalization formula is used to scale it to a fixed range. The expression is: In the formula, a′ is the normalized acceleration vector, and a is the original acceleration vector; After normalization, the data is processed using a simplified self-attention mechanism. The self-attention mechanism is processed as follows: x1_a=softmax(x1*x1,x1*x2…x1*xn)·(x1,x2…xn) x2_a=softmax(x2*x1,x2*x2…x2*xn)·(x1,x2…xn) … xn_a=softmax(xn*x1,xn*x2…xn*xn)·(x1,x2…xn) Where x1_a, x2_a, xn_a are the outputs of the self-attention module, x1, x2, xn are the inputs, the symbol * is the scalar product, the symbol · is the vector inner product, and softmax() is the activation function for probability conversion; The output of the attention mechanism module passes through several layers of fully connected layers and outputs the intermediate value X m , X m It represents a vector of three values, corresponding to the effective wave height, average wave period and wave direction to be output. At the same time, the data in the y and z directions are processed to obtain the intermediate layer Y m and Z m , X m , T m , Z m After a self-attention mechanism, a fully connected layer is finally connected to obtain the final effective wave height H s , average wave period T m and wave direction W d , W d The value range is 0 to 1, corresponding to 0 to 360 degrees. The formula is as follows: X m =FC l (x1_a,x2_a…xn_a) Y m =FC l (y1_a,y2_a…in_a) From m =FC l (z1_a,z2_a…zn_a) (H s ,T m ,W d )=FC(ATTN(X m ,Y m ,Z m )) Where FC represents the fully connected layer, l represents the number of layers, ATTN() represents the simplified self-attention module, x1_a, y1_a, z1_a are the outputs of the self-attention layer after inputting x1, y1, z1 respectively, xn_a, yn_a, zn_a are the outputs of the self-attention layer after inputting xn, yn, zn respectively, n is the number of input time series values, and FC l is the lth fully connected layer; The output effective wave height, average wave period and wave direction data are inversely normalized to obtain the final effective wave height and average wave period data. The maximum and minimum values ​​used in the normalization process are used for inverse normalization. Inverse normalization is not performed on the edge side, so that the data is encrypted. When the shore-based platform equipment receives the data, inverse normalization is performed using the following formula: a=a′*(max(a)-min(a))+min(a) In the formula, the wave direction data range is 0 to 1. After receiving the shore-based data, it is mapped to the actual wave angle by multiplying it with 360°.

4. The wave data edge intelligent computing method for marine Internet of Things according to claim 1 is characterized in that: In step S2, the deep learning neural network model is used for forward reasoning of data after training. The training data uses historical observation data, including historical acceleration sensor data and corresponding effective wave heights, average wave periods and wave directions. The historical acceleration sensor data is used as training input data, and the historical effective wave heights and wave periods are used as labels. The improved Adam optimizer is used for parameter optimization and back propagation. The improved Adam optimization uniformly sets the learning rate learning rate=0.001~0.0015 at the beginning of training, and gradually increases the learning rate as the number of training times increases. When the parameters need to be adjusted in reverse, the learning rate is reduced again, so that the learning rate is reduced when the optimal value is first crossed, and gradually approaches the optimal value.

5. The wave data edge intelligent computing method for marine Internet of Things according to claim 1 is characterized in that: In step S3, when data is transmitted, the data is first formatted into a character array, and then the communication interface UART is initialized, the baud rate, start bit, check bit, and stop bit are set, and then the data is sent to the wireless communication module on the edge device through the data sending interface of the communication interface, and the response signal sent back by the wireless communication module is waited for to confirm that the data has been successfully sent.

6. The wave data edge intelligent computing method for marine Internet of Things according to claim 1 is characterized in that: The number of computing cores is calculated based on the time required for a single process to calculate wave data, and the expression is: Where N c is the number of computing cores, t p is the computational running time of a single process, t s is the safety delay time of a single process, and 0.25 is the time period.

7. A wave data edge intelligent computing system for marine Internet of Things, characterized in that: The system is implemented by the wave data edge intelligent computing method for marine Internet of Things according to any one of claims 1 to 6, and the system includes: The acceleration sensor data acquisition module is used to store the acquired acceleration sensor data of the time interval t1 in the memory in the form of a bidirectional linked list data structure; Multiple process creation modules are used to create multiple processes currently needed, recycle the first terminated process, and then create the second process, and so on; during the entire running time of creating the first process, multiple processes are executed simultaneously; when creating multiple processes, for a single process, the acceleration sensor time series range data of the time interval t1 stored in a bidirectional linked list is read, and the effective wave height, average wave period and wave direction are obtained through inference calculation of the trained deep learning neural network model; The data transmission module is used for data transmission. By controlling the signal transmission mechanism, the generated effective wave height, average wave period and wave direction are sent to the edge-side communication module device at a transmission frequency of 4Hz for wireless communication.

8. The wave data edge intelligent computing system for marine Internet of Things according to claim 7 is characterized in that: The system is carried on the ocean navigation device of a submersible or an unmanned ship at sea to obtain ocean wave data in real time. The acquired ocean wave data is used in marine meteorological science to predict and prevent extreme ocean weather.

Citation Information

Patent Citations

  • Wind characteristic monitoring system and method based on Beidou satellite

    CN106680533A

  • Offshore wind condition active acquisition system based on 4G & DTU remote wireless transmission

    CN111708103A