A controller hybrid programming development platform construction method and device
By adding NPU drivers and installing python resource containers in the Linux kernel, combining the advantages of C and python languages, the problem of difficulty in programming PHM algorithms on the C language platform is solved, achieving more efficient development and better portability.
Patent Information
- Application Number
- CN202411539457.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-31
AI Technical Summary
In the prior art, PHM algorithms are difficult to program on C language platforms, and lack the support of third-party libraries, resulting in limited stability and portability.
Add NPU drivers to the underlying driver of the Linux kernel, and install the python resource container in the Linux kernel to enable the python environment. The analysis object model is then created in a virtual python environment and the sensor signal is processed based on that model.
By building a python environment in the C language environment, directly calling the third-party library of the python language, shortening the development cycle, improving the development efficiency, and improving the portability of the software platform.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a method and device for constructing a controller hybrid programming development platform. Background Art
[0002] Traditional controller programming platforms are usually programmed in C language, which calls Linux underlying driver functions through C language to collect various analog and discrete signals on the hardware controller. After removing noise and interference signals from the collected signals through signal filtering and other means, the PHM (Prognostics and Health Management) algorithm is used to diagnose and monitor the data signals.
[0003] The PHM algorithm involves machine learning and deep learning algorithms, and its implementation requires the use of many ready-made third-party libraries. In the field of artificial intelligence, Python is used as the main development language, mainly because of its cross-platform nature, rich ecology, and support from third-party libraries.
[0004] Correspondingly, when developing the PHM algorithm using the C language platform, all algorithm details, including the call of third-party libraries, need to be implemented from scratch, and a lot of knowledge of the underlying mathematical theory needs to be mastered. Some algorithms are even encapsulated in the form of libraries on the Python platform, and the specific implementation details are not open source. Therefore, it is difficult to develop using the C language alone, and the workload and development cycle are also long. It cannot become a mainstream solution at this stage. At present, the industry is still mainly developing on the Python platform, but Python cannot directly operate the underlying registers and lacks related Linux driver support. It is not possible to develop using Python alone in the controller. Therefore, it is urgent to solve the problem that the PHM algorithm is difficult to program on the C language platform, lacks the reserve of third-party libraries, and has certain limitations on stability and portability. Summary of the invention
[0005] In view of this, the present application provides a method and device for constructing a controller hybrid programming development platform, which can reduce the difficulty of development and improve the portability of the software platform.
[0006] Specifically, the present application is implemented through the following technical solutions:
[0007] The first aspect of the present application provides a method for constructing a controller hybrid programming development platform, the method comprising:
[0008] Add NPU driver to the Linux kernel underlying driver, where the Linux kernel enables the C language environment;
[0009] Installing a python resource container in the Linux kernel and enabling a python environment in the Linux kernel;
[0010] Creating a virtual environment in the Linux kernel, installing a Python language resource library, and creating a virtual Python environment;
[0011] Creating an analysis object model based on Python language in the virtual Python environment;
[0012] The sensor signal is processed based on the analysis object model to analyze the analysis object.
[0013] A second aspect of the present application provides a controller hybrid programming development platform construction device, the device comprising an adding module, an installing module, a creating module and an analyzing module;
[0014] The adding module is used to add the NPU driver to the bottom layer driver of the Linux kernel, wherein the Linux kernel enables the C language environment;
[0015] The installation module is used to install a Python resource container in the Linux kernel and enable a Python environment in the Linux kernel;
[0016] The creation module is used to create a virtual environment in the Linux kernel, install a resource library of the Python language, and create a virtual Python environment;
[0017] The creation module is further used to create an analysis object model based on the Python language in the virtual Python environment;
[0018] The analysis module is used to process the sensor signal based on the analysis object model and analyze the analysis object.
[0019] The controller hybrid programming development platform construction method and device provided in the present application first add NPU driver to the Linux kernel bottom driver, wherein the Linux kernel enables the C language environment, then installs the python resource container in the Linux kernel, enables the python environment in the Linux kernel, then creates a virtual environment in the Linux kernel, installs the python language resource library, creates a virtual python environment, and then creates an analysis object model based on the python language in the virtual python environment, and finally processes the sensor signal based on the analysis object model to analyze the analysis object. In this way, for the controller on the embedded platform, the C language environment and the python environment are enabled in the Linux kernel at the same time, and by building the python environment in the C language environment, a large number of basic third-party libraries contained in the python language are directly called to complete the development using the underlying basic algorithms, that is, the C language and the python language can call each other's mature libraries that have been developed by the other party, shortening the development cycle and improving the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a first embodiment of a method for constructing a hybrid programming development platform for a controller provided in the present application;
[0021] Figure 2 This is a schematic diagram of the structure of a controller hybrid programming development platform shown as an exemplary embodiment of the present application;
[0022] Figure 3 This is a structural diagram of Example 1 of the controller hybrid programming development platform construction device provided in this application. DETAILED DESCRIPTION
[0023] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0024] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0025] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0026] Specific embodiments are given below to introduce the technical solution of the present application in detail.
[0027] Figure 1 This is a flowchart of the first embodiment of the method for constructing a controller hybrid programming development platform provided by this application. Please refer to Figure 1 , the method provided in this embodiment may include:
[0028] S101. Add an NPU driver to the underlying driver of the Linux kernel, wherein the Linux kernel enables a C language environment.
[0029] It should be noted that the Linux kernel underlying drivers are the bridge between the operating system and the hardware, which enable the operating system to communicate and control various hardware devices. NPU (Neural Processing Unit) is a hardware unit specifically designed to accelerate the reasoning and training of deep learning models.
[0030] Specifically, adding NPU driver to the Linux kernel underlying driver includes:
[0031] (1) Obtain the specifications and data sheet of the NPU hardware.
[0032] It should be noted that before developing NPU drivers, you first need to obtain detailed specifications and data sheets of the NPU hardware. This information is usually provided by the NPU supplier, including register mapping, control interface, interrupts, and power management.
[0033] (2) Download the Linux kernel source code and configure the compilation tool chain and development tools.
[0034] It should be noted that you can download the Linux kernel source code from the official website, and the version number of the downloaded Linux kernel source code can be adjusted according to actual needs. Among them, the compilation tool chain includes compilers, linkers and other tools, which are used to compile source code into executable binary files; development tools are used to improve development efficiency and code quality.
[0035] (3) Writing NPU driver code to form a driver module; the NPU driver code at least includes a driver framework, initialization and exit functions, and device file operation functions.
[0036] It should be noted that, regarding the driver framework, it is necessary to select a suitable driver framework, for example, it can be a character device driver, a platform device driver, etc., and then adapt it according to the characteristics of the NPU hardware. Regarding the initialization and exit functions, you can write an initialization function ('probe') and an exit function ('remove') to initialize and release the resources required by the NPU driver (where the driver framework, initialization and exit functions, and device file operation functions may or may not exist); it should also be noted that the device file operation function can implement operations such as reading, writing, and controlling, so that the user space program can communicate with the NPU driver.
[0037] (4) Compile and load the driver module, and automatically create a device node to provide an interface for accessing the device.
[0038] Specifically, you can use the cross-compilation tool chain to compile the written NPU driver code and generate a driver module ('.ko' file). In this way, when loading the driver module, you can automatically create a device node by calling the relevant device management function (such as 'device_create'), so that the user space can access the NPU driver. Among them, the user space is an area in the operating system memory used to run user-level applications, and the corresponding kernel space is used to run the operating system core code and driver programs.
[0039] (5) Edit the device tree source file, add the NPU node to it, and compile the device tree source file to generate the device tree file and then load it into the Linux kernel.
[0040] Edit the device tree source file and add node information describing the NPU. Specifically, define the properties of the NPU device in the device tree file, including register address, interrupt number, device type, etc., and then compile the device tree source file to generate a device tree file, and place it in the system boot directory for the Linux kernel to load.
[0041] (6) Enable the power supply of the NPU node so that the NPU driver can be normally recognized by the system.
[0042] It should be noted that to ensure that the power state of the NPU node described in the device tree is correctly configured so that the Linux kernel can correctly identify and initialize the NPU device, it is usually necessary to set the power control information in the device tree so that the NPU is automatically activated when the kernel starts.
[0043] First of all, the kernel provided by the present invention is a kernel configured with a C language environment. In order to further utilize the kernel to process the information of the object to be analyzed, an NPU driver is embedded in the kernel, so that there is no need to rely on software-level optimization, and hardware optimization acceleration can be directly used to achieve rapid analysis of the object to be analyzed, thereby avoiding the need to redevelop software and improving the efficiency of analysis and processing.
[0044] S102: Install a Python resource container in the Linux kernel, and enable a Python environment in the Linux kernel.
[0045] It should be noted that the python resource container includes the python interpreter and its supporting components, etc., and installing the python resource container in the Linux kernel includes: installing package management and environment management software; selecting a python programming language version adapted to linux, and modifying the default python interpreter version used in the Linux system according to the python programming language version; using the containerized platform to install the corresponding components and dependency packages. For example, in one embodiment, the package management and environment management software can be Miniconda software, and the python programming language version adapted to linux can be python3.7, wherein Miniconda is a lightweight Anaconda version, an open source package management and environment management system, focusing on the fields of data science and machine learning, and it is mainly used to simplify the installation and management of the python environment, especially the dependencies of scientific computing and data analysis tools.
[0046] According to the above operations, use the containerized platform to install the corresponding components and dependency packages, and build a Python environment for the hardware platform to make it cross-platform capable. Even if it is switched to other platforms with the same Linux kernel, it can be used normally.
[0047] S103: Create a virtual environment in the Linux kernel, install a Python language resource library, and create a virtual Python environment.
[0048] It should be noted that a virtual environment is created in the Linux kernel, and a resource library of the Python language is installed. Creating a virtual Python environment includes: using a virtual environment manager to create an independent Python virtual environment; installing a Python third-party library in the virtual environment; and installing the dependency packages corresponding to the Python third-party library. Among them, common Python third-party libraries include numpy, scipy, scikit-learn, setuptools, OpenCV and other commonly used libraries. Specifically, for detailed operations on creating a Python virtual environment, installing Python third-party libraries, and installing dependency packages corresponding to Python third-party libraries, please refer to the introduction of related technologies, which will not be repeated here.
[0049] S104: Create an analysis object model based on Python language in the virtual Python environment.
[0050] It should be noted that the analysis object model created by this application can be used on products such as turbines, hydraulic pumps, fuel pumps, etc., and the following is an introduction to the application to turbines. In order to use Python's mature third-party library, the present invention configures the Python environment in the Linux environment and uses its powerful data analysis and processing capabilities to create the analysis object model.
[0051] It should be noted that before creating an analysis object model based on Python language in the virtual Python environment, the following steps are required:
[0052] (1) Performing data preprocessing based on the signal data collected by the sensor, wherein the preprocessing at least includes low-pass filtering.
[0053] Taking the vibration signal of the turbine as an example, the corresponding signal data can be collected through the RK3568 hardware underlying driver module. The turbine vibration signal is usually a superposition of multiple frequency component signals. Therefore, the data can be pre-processed by low-pass filtering to filter out the corresponding noise signal.
[0054] (2) The empirical mode decomposition method is used to process the preprocessed signal data, and based on the processed results, the fast Fourier transform and autoregressive model are used to process the corresponding vectors.
[0055] Specifically, the empirical mode decomposition method can be used to decompose the vibration signal into multiple intrinsic mode function components to eliminate the mutual influence between the signal components. Then, for the decomposed signal, on the one hand, the corresponding frequency and amplitude vectors are obtained through fast Fourier transform, and on the other hand, the corresponding autoregressive model vector is obtained through the autoregressive model. Among them, empirical mode decomposition (EMD) is a data analysis method, which is particularly suitable for time domain analysis of nonlinear and non-stationary signals. Its basic principle is to decompose complex nonlinear and non-stationary signals into a group of basic components called "intrinsic mode functions" (IMF), where each IMF represents a local feature or vibration mode in the signal.
[0056] (3) Using wavelet packet decomposition to calculate energy function components of the signal data, the energy function components at least include energy entropy and mean.
[0057] Specifically, the vibration signal of the turbine is decomposed using wavelet packets, and the corresponding energy function (energy entropy, mean, etc.) components are calculated based on the decomposition results. Among them, wavelet packet decomposition is an extended form of wavelet analysis, which allows for more detailed and flexible decomposition of the signal and can capture more frequency components and local features in the signal.
[0058] (4) Normalize the energy function components, merge the output feature vectors, and use time domain methods to calculate the corresponding signal components.
[0059] It should be noted that the energy function components are normalized, the output feature vectors are merged, and then the corresponding signal components are calculated using operators such as the time domain analysis index order spectrum, kurtosis, and skewness. For specific and detailed calculation processes, please refer to the description of related technologies, which will not be repeated here.
[0060] (5) Taking the vector and the signal component as a parameter set as input, a neural network is used to train the characteristic vector of the turbine to obtain an optimal diagnostic effect.
[0061] It should be noted that the neural network used may be a BP neural network, a GRNN neural network, etc., which is not limited in this embodiment. Specifically, the neural network is used to train the characteristic vector of the turbine, and the optimal diagnostic effect of the vibration signal is obtained by combining different input characteristic vectors.
[0062] It should also be noted that creating an analysis object model based on Python language in a virtual Python environment includes:
[0063] (1) Install the deep learning model conversion and deployment tool in the virtual machine environment and initialize the SDK environment.
[0064] For example, in one embodiment, the deep learning model conversion and deployment tool may be rknn-toolkit2, wherein rknn-toolkit2 supports models trained by multiple deep learning frameworks, including TensorFlow, Caffe, ONNX, etc. When installing the deep learning model conversion and deployment tool, environment variables may be set to initialize the SDK environment, and these environment variables may include the SDK path, the Python interpreter path, etc.
[0065] (2) Create the corresponding RKNN object based on the program files generated during the analysis process.
[0066] Specifically, combined with the above example, you can use rknn-toolkit2 to convert the trained deep learning model into RKNN format. During the conversion process, corresponding program files (such as .rknn and .so files) will be generated, and then the corresponding RKNN objects will be created based on the program files.
[0067] (3) The RKNN object adjusts the method of preprocessing and quantization of the analysis object model data based on different sensor signal types.
[0068] It should be noted that different sensor signal types may include temperature signals, pressure signals, speed signals, etc. According to different sensor signal types, the corresponding adjustment settings are used for the data preprocessing method and quantization method of the analysis object model. For example, in one embodiment, when it is a temperature signal, the data preprocessing method may be low-pass filtering, and the quantization method may be normalization; for example, in another embodiment, when it is a pressure signal, the data preprocessing method may be filtering, and the quantization method may be segmented processing; for another example, in another embodiment, when it is a speed signal, the data preprocessing method may be frequency domain analysis, and the quantization method may be frequency counting. Specifically, it is not limited in this embodiment.
[0069] (4) Import the raw data and build the corresponding RKNN model based on the objects collected by the sensor.
[0070] It should be noted that the objects collected by the sensor may be turbines, hydraulic pumps, fuel pumps and other objects.
[0071] S105: Process the sensor signal based on the analysis object model to analyze the analysis object.
[0072] It should be noted that processing sensor signals based on the analysis object model and analyzing the analysis object include: building and installing a python interpreter, and initializing the python interpreter when the program starts running; checking whether the python interpreter is correctly initialized, and executing the python code after it is correctly initialized; and closing the python interpreter after the python code is executed in the program. Among them, the bottom layer of the python language is implemented by the C language, and the python interpreter needs to be built to implement the call of the C language program to the python program. Specifically, the Py_Initialize method can be used to initialize the python interpreter, and the Py_Finalize method can be used to close the python interpreter.
[0073] It should also be noted that processing sensor signals based on the analysis object model and analyzing the analysis object include: calling a python program to load the RKNN model for hardware accelerated calculation; establishing an interactive interface between the C program and the python program; and returning the hardware accelerated calculation results to the C program based on the interactive interface for subsequent development and analysis. Among them, calling the python program can be completed using the PyEval_CallObject method. The establishment of the interactive interface between the C program and the python program includes: determining the input variables and input variable formats of the C program; determining the associated variables and associated variable formats associated with the input variables; generating a variable tree based on the python program, the variable tree representing the temporal change association relationship between the variables in the python; matching the input variables and the associated variables in the python program; tracking the changes of the input variables and the associated variables in the python program according to the variable tree, and determining the final output variable related to the C program as the target variable; changing the target variable according to the variable format required by the C program, and inputting the target variable into the C program.
[0074] The method provided by the present invention uses the value and format of data to transfer information between a C program and a Python program, so that mature third-party libraries of the two programs can continue to be used, and two languages can be used for development on one platform at the same time, thereby improving the compatibility of the platforms; in addition, when the two programs interact with each other, in addition to the numerical values they need, they also transfer variables used by other functions that will change later to the other language, thereby improving the transfer efficiency and enabling the other language to understand the entire process of variable changes, thereby improving the accuracy of program calculations.
[0075] It should be noted that the controller hybrid programming development platform construction method provided in this embodiment is implemented based on the PHM algorithm. The PHM algorithm is a series of methods and techniques for fault prediction and health status management of equipment and systems. Its main goal is to detect potential faults in advance and evaluate the health status of equipment through data analysis and model building, so as to optimize maintenance strategies, extend equipment life, and improve system reliability and safety. Specifically, the PHM algorithm usually includes the following steps: data acquisition and preprocessing; feature extraction and selection; health assessment; fault prediction; decision support. Common PHM algorithms and methods include linear regression and multivariate regression analysis, Bayesian networks, support vector machines, random forests, long short-term memory networks, and convolutional neural networks.
[0076] Figure 2 This is a schematic diagram of the structure of a controller hybrid programming development platform shown in an exemplary embodiment of the present application. Figure 2 ,exist Figure 2 In the example shown, the bottom layer of the built controller hybrid programming development platform includes the NPU bottom-level driver module and the basic hardware bottom-level driver module. On this basis, a python environment is built and the corresponding third-party library is installed, and then the corresponding RKNN model is built. Finally, an interactive interface between C language and python language is established.
[0077] The controller hybrid programming development platform construction method provided in this embodiment first adds NPU driver to the Linux kernel bottom driver, wherein the Linux kernel enables the C language environment, then installs the python resource container in the Linux kernel, enables the python environment in the Linux kernel, then creates a virtual environment in the Linux kernel, installs the python language resource library, creates a virtual python environment, and then creates an analysis object model based on the python language in the virtual python environment, and finally processes the sensor signal based on the analysis object model to analyze the analysis object. In this way, for the controller on the embedded platform, the C language environment and the python environment are enabled in the Linux kernel at the same time, and the python environment is built in the C language environment, and a large number of basic third-party libraries contained in the python language are directly called to use the underlying basic algorithm to complete the development, that is, the C language and the python language can call each other's mature libraries that have been developed by the other party, shortening the development cycle and improving the efficiency of development. In addition, the kernel provided by the present invention is a kernel configured with a C language environment. In order to further utilize the kernel to process the information of the object to be analyzed, the NPU driver is embedded in the kernel, so that there is no need to use software-level optimization, and the hardware optimization acceleration method is directly used to achieve the rapid analysis of the object to be analyzed, avoiding the redevelopment of software and improving the efficiency of analysis and processing.
[0078] Corresponding to the aforementioned embodiment of a method for constructing a hybrid programming development platform for a controller, the present application also provides an embodiment of a device for constructing a hybrid programming development platform for a controller.
[0079] Figure 3 This is a schematic diagram of the structure of the first embodiment of the controller hybrid programming development platform construction device provided by this application. Figure 3 , the device provided in this embodiment includes an adding module 310, an installing module 320, a creating module 330 and an analyzing module 340;
[0080] The adding module 310 is used to add the NPU driver to the bottom layer driver of the Linux kernel, wherein the Linux kernel enables the C language environment;
[0081] The installation module 320 is used to install the Python resource container in the Linux kernel and enable the Python environment in the Linux kernel;
[0082] The creation module 330 is used to create a virtual environment in the Linux kernel, install a resource library of the Python language, and create a virtual Python environment;
[0083] The creation module 330 is further used to create an analysis object model based on the Python language in the virtual Python environment;
[0084] The analysis module 340 is used to process the sensor signal based on the analysis object model and analyze the analysis object.
[0085] The device of this embodiment can be used to perform Figure 1 The steps, specific implementation principles and implementation processes of the method embodiment shown are similar and will not be repeated here.
[0086] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0087] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0088] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A controller hybrid programming development platform construction method, characterized in that: The method comprises: Add NPU driver to the Linux kernel underlying driver, where the Linux kernel enables the C language environment; Installing a python resource container in the Linux kernel and enabling a python environment in the Linux kernel; Creating a virtual environment in the Linux kernel, installing a Python language resource library, and creating a virtual Python environment; Creating an analysis object model based on Python language in the virtual Python environment; Processing the sensor signal based on the analysis object model to analyze the analysis object; The processing of the sensor signal based on the analysis object model to analyze the analysis object includes: Call the python program to load the RKNN model for hardware accelerated calculation; Establish an interactive interface between C program and Python program; Based on the interactive interface, the hardware accelerated calculation results are returned to the C program for subsequent development and analysis.
2. The method according to claim 1, characterized in that The step of adding an NPU driver to the Linux kernel underlying driver includes: Get the specifications and datasheets for the NPU hardware; Download the Linux kernel source code and configure the compilation tool chain and development tools; Writing NPU driver code to form a driver module; the NPU driver code at least includes a driver framework, initialization and exit functions, and device file operation functions; Compile and load the driver module, and automatically create a device node to provide an interface for accessing the device; Edit the device tree source file to add the NPU node, compile the device tree source file to generate the device tree file and then load it into the Linux kernel; The power supply of the NPU node is enabled so that the NPU driver can be normally recognized by the system.
3. The method according to claim 1, characterized in that The installation of the Python resource container in the Linux kernel includes: Installation package management and environment management software; Select a Python programming language version that is compatible with Linux, and modify the default Python interpreter version used in the Linux system according to the Python programming language version; Use the containerized platform to install the corresponding components and dependency packages.
4. The method according to claim 1, characterized in that The step of creating a virtual environment in the Linux kernel and installing a resource library of the Python language includes: Use a virtual environment manager to create an independent Python virtual environment; Install Python third-party libraries in the virtual environment; Install the dependency package corresponding to the Python third-party library.
5. The method according to claim 1, characterized in that Before creating the analysis object model based on Python language in the virtual Python environment, the following steps are included: Performing data preprocessing based on the signal data collected by the sensor, wherein the preprocessing at least includes low-pass filtering; The empirical mode decomposition method is used to process the preprocessed signal data, and based on the processed results, the fast Fourier transform and autoregressive model are used to process the corresponding vectors; Calculate the energy function component of the signal data by using wavelet packet decomposition, wherein the energy function component at least includes energy entropy and mean value; Normalizing the energy function components, merging the output feature vectors, and using a time domain method to calculate the corresponding signal components; The parameter set formed by the vector and the signal component is used as input, and a neural network is used to train the characteristic vector of the turbine to obtain an optimal diagnostic effect.
6. The method according to claim 1, characterized in that The creating of the analysis object model based on the Python language in the virtual Python environment comprises: Install the deep learning model conversion and deployment tool in the virtual machine environment and initialize the SDK environment; Based on the program files generated during the analysis, create the corresponding RKNN objects; The RKNN object adjusts the method of preprocessing and quantization of the analysis object model data based on different sensor signal types; Import the raw data and build the corresponding RKNN model based on the objects collected by the sensor.
7. The method according to claim 1, characterized in that The processing of the sensor signal based on the analysis object model to analyze the analysis object includes: Build and install a Python interpreter, and initialize the Python interpreter when the program starts running; Check if the python interpreter is initialized correctly and execute python code if it is initialized correctly; After the execution of the Python code in the program is completed, the Python interpreter is closed.
8. The method according to claim 1, characterized in that: The establishment of the interactive interface between the C program and the Python program includes: Determining input variables and input variable formats of the C program; Determining associated variables and associated variable formats associated with the input variables; Generate a variable tree based on the Python program, wherein the variable tree represents the temporal change association relationship between the variables in the Python program; Matching the input variables and the associated variables in the Python program; Tracking the changes of the input variables and the associated variables in the Python program according to the variable tree, and determining the final output variable related to the C program as the target variable; The target variable is changed according to the variable format required by the C program, and the target variable is input into the C program.
9. A controller hybrid programming development platform construction device, characterized in that: The device includes an adding module, an installing module, a creating module and an analyzing module; wherein, The adding module is used to add the NPU driver to the bottom layer driver of the Linux kernel, wherein the Linux kernel enables the C language environment; The installation module is used to install a Python resource container in the Linux kernel and enable a Python environment in the Linux kernel; The creation module is used to create a virtual environment in the Linux kernel, install a resource library of the Python language, and create a virtual Python environment; The creation module is further used to create an analysis object model based on the Python language in the virtual Python environment; The analysis module is used to process the sensor signal based on the analysis object model and analyze the analysis object; The processing of the sensor signal based on the analysis object model to analyze the analysis object includes: Call the python program to load the RKNN model for hardware accelerated calculation; Establish an interactive interface between C program and Python program; Based on the interactive interface, the hardware accelerated calculation results are returned to the C program for subsequent development and analysis.
Citation Information
Patent Citations
Non-intrusive equipment health management algorithm library construction method
CN114416111A