A non-intrusive equipment health management algorithm library construction method
Through the combination of Python WEB architecture and docker container platform, the algorithm library is built and the template engine and the operation engine are used, which solves the problem of difficulty in fusion of multiple algorithm models, and realizes the scalability and maintainability of the equipment health management platform, which is suitable for Multilingual scenarios and cloud platforms.
Patent Information
- Application Number
- CN202111635049.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-12-29
AI Technical Summary
When the existing equipment health management algorithm model is implemented, the differences in the interfaces of multiple algorithm models lead to difficulty in fusion, and it needs to be written at the code level, hindering the scalability and maintainability of the platform and affecting the engineering transformation of research results.
Using the Python WEB architecture microservice platform and docker container platform, an algorithm library is built, and the algorithm model is instantiated and run independently through the template engine and the running engine, realizing full-cycle management without changing the underlying code, and supporting the integration of multilingual algorithm models.
It realizes non-invasive fusion of different algorithm models, improves the platform's development and use efficiency, ensures the scalability and maintainability of the algorithm model, is suitable for multilingual scenarios, and is suitable for cloud platform deployment.
Smart Images

Figure CN114416111B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of equipment health management, and more specifically, relates to a method for constructing a non-invasive equipment health management algorithm library. Background Art
[0002] Equipment health management algorithm models are the core technology for realizing PHM (fault prediction and health management) of complex equipment. These models are mainly used to realize comprehensive needs such as abnormality detection, fault diagnosis, fault prediction, and maintenance decision-making for different systems, subsystems, and components. At present, there are many cases of building health management algorithm models for equipment in the industry. Most of them are of scientific research nature and focus more on the implementation of algorithms, but many problems will be encountered in actual use when the project is implemented. The most critical problem of implementation is that there are many kinds of algorithm models, and the interface types have certain differences. It is difficult to integrate different algorithms into the same platform and form specific health management scenarios through combination. In many cases, in order to realize the functions, they need to be hard-coded at the code level, which seriously hinders the scalability and maintainability of the platform. The lack of growth of the platform will seriously affect the engineering transformation of research results.
[0003] In view of this, a non-invasive equipment health management algorithm library construction method is expected to solve the problem of how to integrate different algorithm models into the production platform. Summary of the invention
[0004] The purpose of the present invention is to provide a method for constructing an equipment health management algorithm library based on a non-invasive approach to solve the problems existing in the prior art. By constructing a microservice platform and a container platform based on a Python WEB architecture, an algorithm library is built, all algorithm models are stored in the algorithm library, a template engine is established to instantiate the algorithm model, and a running engine is established to independently run the algorithm model in the running environment and call it at any time when needed. This ensures that no underlying code needs to be changed during the entire cycle of adding, deleting, modifying, checking, using, and optimizing the algorithm model, so as to achieve truly non-invasive algorithm library construction, solve the problem of integrating different algorithm models into the equipment health management service platform, and realize the integration of multi-language algorithm models.
[0005] In order to achieve the above object, the technical solution of the present invention is as follows:
[0006] The present invention provides a method for constructing a non-invasive equipment health management algorithm library, comprising:
[0007] Step S1, building a microservice platform based on Python WEB architecture;
[0008] Step S2, building a container platform, deploying multiple independent Docker containers in the container platform, and deploying the operating environment of the algorithm model in the Docker containers;
[0009] Step S3, building an algorithm library, wherein the algorithm library is used to store the algorithm model;
[0010] Step S4, establishing a template engine, wherein the template engine instantiates and verifies the validity of the algorithm model and saves it to the algorithm library;
[0011] Step S5, establishing a running engine, wherein the running engine independently runs the algorithm model in the running environment and calls the algorithm model at any time.
[0012] Preferably, the step S2 specifically includes:
[0013] Step S21, installing the docker container tool on the server to complete the construction of the container platform;
[0014] Step S22, pulling a Linux image as the system environment of the container platform;
[0015] Step S23, instantiate and build multiple Docker containers based on the system environment, and configure the corresponding environment variables of the operating environment in each Docker container.
[0016] Preferably, the algorithm model includes a model file, a function code block, an input format, and an output format.
[0017] Preferably, the algorithm library includes MySQL database, MongoDB database and Redis database;
[0018] The mysql database is used to store the function code block, the input interface and the output interface, the MongoDB database is used to store the model file, and the redis database is used to store the intermediate running results of the algorithm model during the running process.
[0019] Preferably, the step S4 specifically includes:
[0020] S41, establishing a code template as a benchmark for instantiating the algorithm model;
[0021] S42, establishing the template engine according to the code template;
[0022] S43, instantiating the algorithm model using the module of the template engine according to the input module, output module and library of the code template;
[0023] S44, performing syntax verification and function verification on the algorithm model;
[0024] S45, publishing the verified algorithm model through a database identifier and a function interface and saving it to the algorithm library.
[0025] Preferably, the step S5 specifically includes:
[0026] S51, establishing a running engine of the algorithm model;
[0027] S52, the execution engine reads the model file and function code block included in the algorithm model currently to be executed and introduces them into the execution engine;
[0028] S53, the execution engine executes the algorithm model and saves the execution result to the redis database, and calls the algorithm model at any time through the database identifier and function interface.
[0029] Preferably, the step S43 specifically includes:
[0030] Step S431, determining the input of the algorithm model and instantiating the input module of the code template;
[0031] Step S432, determining the runtime library of the algorithm model, and instantiating the library usage module of the code template;
[0032] Step S433, confirming the output of the algorithm model and instantiating the output module of the code template.
[0033] Preferably, the step S4 also includes modifying the runtime library of the algorithm model and editing the core code of the algorithm model to further instantiate the algorithm model.
[0034] Preferably, it also includes constructing the microservice platform in the equipment health management service platform, and the equipment health management service platform is a B / S architecture.
[0035] Preferably, the equipment health management service platform calls the microservice that runs the algorithm model through http access.
[0036] The beneficial effects of the technical solution of the present invention are:
[0037] The present invention adopts the technical form of combining the microservice platform of Python WEB architecture with the docker container, and uses database management to save the algorithm model in the algorithm library, and integrates the algorithm model into the operating environment in a dynamic, online and scalable manner through the template engine and the running engine, ensuring that there is no need to change any underlying code during the whole cycle of adding, deleting, modifying, using and optimizing the algorithm model, so as to achieve truly non-invasive algorithm library construction and solve the problem of integrating different algorithm models into the equipment health management service platform.
[0038] The present invention installs the container platform required for various operating environments based on the algorithm model, so that the algorithm model can run in each independent sandbox operating environment. The various operating environments interact with each other in the form of function interfaces, without the need for additional middleware operations, thereby improving the development and use efficiency of the platform algorithm model.
[0039] The equipment health management service platform of the present invention adopts a B / S architecture, can be efficiently integrated into the cloud platform, is suitable for mainstream private cloud and public cloud technologies, and can meet the needs of various multi-language algorithm model fusion scenarios based on the Internet, cloud networks, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present invention.
[0041] Figure 1 A schematic diagram of a process of constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0042] Figure 2 A flow chart of step S2 of a method for constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0043] Figure 3 A flow chart of step S4 of a method for constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0044] Figure 4 A flow chart of step S5 of a method for constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0045] Figure 5 A flow chart of step S43 of a method for constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0046] Figure 6a to Figure 6cA code instruction diagram for installing a docker platform in step S2 of a method for constructing a non-invasive equipment health management algorithm library according to the present invention is shown;
[0047] Figure 7a to Figure 7f A function page for implementing step S4 based on a non-invasive equipment health management algorithm library construction method of the present invention is shown. DETAILED DESCRIPTION
[0048] The preferred embodiments of the present invention will be described in more detail below. Although the preferred embodiments of the present invention are described below, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
[0049] Reference Figure 1 As shown, the present invention provides a method for constructing a non-invasive equipment health management algorithm library, comprising:
[0050] Step S1, building a microservice platform based on Python WEB architecture;
[0051] Step S2, building a container platform, deploying multiple independent Docker containers in the container platform, and deploying the operating environment of the algorithm model in the Docker containers;
[0052] Step S3, building an algorithm library, which is used to store algorithm models;
[0053] Step S4, establishing a template engine, which instantiates and verifies the validity of the algorithm model and saves it to the algorithm library;
[0054] Step S5, establishing a running engine, which runs the algorithm model independently in the running environment and calls the algorithm model at any time.
[0055] Specifically, by installing the fastAPI library and running the fastAPI http service, a microservice platform with a python WEB architecture is built using fastAPI. A docker container platform is built, and the operating environment of the algorithm model is deployed in the docker container. The operating environment has a python runtime environment, and various python libraries required for operation are installed. An algorithm library is built, and all algorithm models are managed in the form of database management. A template engine is built based on python, and the algorithm model is added, deleted, modified, and checked, and the algorithm model is instantiated according to the input format and output format. After the validity of the algorithm model is verified, it is published to the algorithm library, and it is extracted in real time when it needs to be run. A running engine is built based on python, and the algorithm model is independently run in the running environment to facilitate the calling of the algorithm model. A technical form combining a microservice platform with a Python WEB architecture and a docker container is adopted, wherein the Docker container is an advanced virtualization technology, which can lightweight build a Linux system with core functions, based on which any required running environment can be installed, and various running environments can be isolated, supporting the sandbox running of the algorithm model. The microservice platform with a Python WEB architecture can publish different algorithm models as independent microservices. By adopting Python's unique feature of real-time operation without compilation, the algorithm model is integrated into the operating environment in a dynamic, online and scalable manner through the template engine and the runtime engine, ensuring that there is no need to change any underlying code during the entire cycle of adding, deleting, modifying, using and optimizing the algorithm model, thus achieving truly non-invasive algorithm library construction and solving the problem that different algorithm models are difficult to integrate into the equipment health management service platform.
[0056] A preferred example, referring to Figure 2 As shown, step S2 specifically includes:
[0057] Step S21, installing the docker container tool on the server to complete the construction of the container platform;
[0058] Step S22, pulling the Linux image as the system environment of the container platform;
[0059] Step S23, instantiate and build multiple Docker containers based on the system environment, and configure the environment variables of the corresponding operating environment in each Docker container.
[0060] Specifically, install the docker tool on the server side of the microservice platform. Taking Ubuntu system as an example, you can use the online installation method and execute the following steps: Figure 6a The instructions shown complete the installation of the Docker container.
[0061] Execute as Figure 6b The instructions shown pull the Linux image of the Docker container as the most basic system environment.
[0062] Based on the Linux image, execute Figure 6c The instructions shown are used to instantiate and build multiple Docker containers, such as the Matlab runtime environment container, the Python runtime environment container, and the C runtime environment container, pass the corresponding runtime environment into the container, and configure the relevant environment variables to complete the construction of the container platform.
[0063] In a preferred example, the algorithm model includes a model file, a function code block, an input format, and an output format.
[0064] In a preferred example, the algorithm library includes a MySQL database, a MongoDB database, and a Redis database;
[0065] The mysql database is used to save function code blocks, input interfaces, and output interfaces, the MongoDB database is used to save model files, and the redis database is used to save the intermediate running results of the algorithm model during operation.
[0066] Specifically, the algorithm library includes MySQL database, MongoDB database and redis database. The MySQL database is built to save the function code blocks that can run the algorithm model, as well as the input format and output format of the algorithm model; the MongoDB database is built to save the model files; and the redis database is built to save the intermediate running results of the algorithm model during operation. By building the algorithm library, the algorithm model (including model files, function code blocks, input format, output format, etc.) is managed and saved in the algorithm library to facilitate real-time extraction when it needs to be run.
[0067] A preferred example, referring to Figure 3 As shown, step S4 specifically includes:
[0068] S41, establishing a code template as a benchmark for instantiating the algorithm model;
[0069] S42, establishing a template engine according to the code template;
[0070] S43, instantiating the algorithm model using the module of the template engine according to the input module, output module and library of the code template;
[0071] S45, performing syntax verification and functional verification on the algorithm model;
[0072] S46, publish the verified algorithm model through the database identifier and function interface and save it to the algorithm library.
[0073] In a preferred example, step S4 also includes modifying the runtime library of the algorithm model and editing the core code of the algorithm model to further instantiate the algorithm model.
[0074] A preferred example, referring to Figure 5 As shown, step S43 specifically includes:
[0075] Step S431, determining the input of the algorithm model and instantiating the input module of the code template;
[0076] Step S432, determining the runtime library of the algorithm model and instantiating the library usage module of the code template;
[0077] Step S433, confirm the output of the algorithm model and instantiate the output module of the code template.
[0078] Specifically, a code template is established as a benchmark for instantiating the algorithm model. The code template includes basic information and interface information. The basic information includes the function name, Chinese name and description. The interface information includes input modules and output modules. Figure 7a As shown. This code template is used as the benchmark for instantiating the algorithm model, and the input and output of the algorithm model and the dependent runtime library are determined to generate the function code block for the initial instantiation of the algorithm model, as shown Figure 7b As shown. Add, delete, modify and edit the core code of the algorithm model, and further instantiate the algorithm model code block, such as Figure 7c Perform syntax and function checks on the function code blocks of the current algorithm model to ensure that the algorithm model can run normally and without error, as shown in the following example: Figure 7d-7e The verified algorithm model is published and saved to the algorithm library through the database identifier and function interface. The function interface includes the input format and output format of the algorithm model, as shown in Figure 7f The template engine can automatically construct the function code block of the algorithm model according to the input module and output module of the code template to complete the instantiation of the algorithm model.
[0079] A preferred example, referring to Figure 4 As shown, step S5 specifically includes:
[0080] S51, establishing a running engine for the algorithm model;
[0081] S52, the running engine reads the model file and function code block included in the algorithm model currently to be run and introduces them into the running engine;
[0082] S53, the running engine executes the algorithm model and saves the running results to the redis database, and calls the algorithm model at any time through the database identifier and function interface.
[0083] Specifically, an algorithm model running engine is established, which can dynamically run the function code blocks of the algorithm model, query the function code blocks and model files of the current algorithm model in the MySQL database and MongoDB database, introduce them into the running engine, and read the algorithm model function code blocks into memory through the exec function of Python according to the database identifier and function interface, so as to ensure that the current microservice can call the algorithm model at any time. The running engine enables the algorithm model to run in its own independent sandbox running environment, and each running environment interacts in the form of a function interface, without the need for additional middleware operations, which improves the development and use efficiency of the platform algorithm model.
[0084] Furthermore, by adopting the json format required by the algorithm model, inputting the database identifier of the algorithm model, and calling the function interface of the algorithm model, it can be directly used by the server-side code and is easy to maintain.
[0085] A preferred example also includes building a microservice platform in the equipment health management service platform, and the equipment health management service platform is a B / S architecture.
[0086] In a preferred example, the equipment health management service platform calls the microservice that runs the algorithm model through http access.
[0087] Specifically, this method is applicable to the equipment health management service platform with B / S architecture, which calls microservices running various algorithm models through http access. The equipment health management service platform with B / S architecture is applicable to mainstream private cloud and public cloud technologies, and can meet the needs of various multi-language algorithm model fusion scenarios based on the Internet, cloud network, etc.
[0088] Example
[0089] Reference Figure 1-Figure 5 As shown, this embodiment provides a method for constructing a non-intrusive equipment health management algorithm library, including:
[0090] Step S1, building a microservice platform based on Python WEB architecture;
[0091] Step S2, building a container platform, deploying multiple independent Docker containers in the container platform, and deploying the operating environment of the algorithm model in the Docker containers;
[0092] Step S3, building an algorithm library, which is used to store algorithm models;
[0093] Step S4, establishing a template engine, which instantiates and verifies the validity of the algorithm model and saves it to the algorithm library;
[0094] Step S5, establishing a running engine, which runs the algorithm model independently in the running environment and calls the algorithm model at any time.
[0095] A preferred example, referring to Figure 2 As shown, step S2 specifically includes:
[0096] Step S21, installing the docker container tool on the server to complete the construction of the container platform;
[0097] Step S22, pulling the Linux image as the system environment of the container platform;
[0098] Step S23, instantiate and build multiple Docker containers based on the system environment, and configure the environment variables of the corresponding operating environment in each Docker container.
[0099] In a preferred example, the algorithm model includes a model file, a function code block, an input format, and an output format.
[0100] In a preferred example, the algorithm library includes a MySQL database, a MongoDB database, and a Redis database;
[0101] The mysql database is used to save function code blocks, input interfaces, and output interfaces, the MongoDB database is used to save model files, and the redis database is used to save the intermediate running results of the algorithm model during operation.
[0102] A preferred example, referring to Figure 3 As shown, step S4 specifically includes:
[0103] S41, establishing a code template as a benchmark for instantiating the algorithm model;
[0104] S42, establishing a template engine according to the code template;
[0105] S43, instantiating the algorithm model using the module of the template engine according to the input module, output module and library of the code template;
[0106] S45, performing syntax verification and functional verification on the algorithm model;
[0107] S46, publish the verified algorithm model through the database identifier and function interface and save it to the algorithm library.
[0108] In a preferred example, step S4 also includes modifying the runtime library of the algorithm model and editing the core code of the algorithm model to further instantiate the algorithm model.
[0109] A preferred example, referring to Figure 5 As shown, step S43 specifically includes:
[0110] Step S431, determining the input of the algorithm model and instantiating the input module of the code template;
[0111] Step S432, determining the runtime library of the algorithm model and instantiating the library usage module of the code template;
[0112] Step S433, confirm the output of the algorithm model and instantiate the output module of the code template.
[0113] A preferred example, referring to Figure 4 As shown, step S5 specifically includes:
[0114] S51, establishing a running engine for the algorithm model;
[0115] S52, the running engine reads the model file and function code block included in the algorithm model currently to be run and introduces them into the running engine;
[0116] S53, the running engine executes the algorithm model and saves the running results to the redis database, and calls the algorithm model at any time through the database identifier and function interface.
[0117] A preferred example also includes building a microservice platform in the equipment health management service platform, and the equipment health management service platform is a B / S architecture.
[0118] In a preferred example, the equipment health management service platform calls the microservice that runs the algorithm model through http access.
[0119] In summary, the present invention adopts the technical form of combining the microservice platform of Python WEB architecture and the docker container, wherein the Docker container is an advanced virtualization technology, which can build a linux system with core functions in a lightweight manner, based on which any required operating environment can be installed, and various operating environments can be isolated, supporting the sandbox operation of the algorithm model. The microservice platform of Python WEB architecture can publish different algorithm models as independent microservices. Using the unique compilation-free real-time operation feature of Python, the algorithm model is dynamically, online, and scalably integrated into the operating environment through the template engine and the operating engine, ensuring that in the whole cycle of adding, deleting, modifying, checking, using, and optimizing the algorithm model, no underlying code needs to be changed, so as to achieve a truly non-invasive algorithm library construction, and solve the problem that different algorithm models are difficult to integrate into the equipment health management service platform.
[0120] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for constructing a non-invasive equipment health management algorithm library, characterized in that: include: Step S1, building a microservice platform based on Python WEB architecture; Step S2, building a container platform, deploying multiple independent Docker containers in the container platform, and deploying the operating environment of the algorithm model in the Docker containers; Step S3, building an algorithm library, wherein the algorithm library is used to store the algorithm model; Step S4, establishing a template engine, wherein the template engine instantiates and verifies the validity of the algorithm model and saves it to the algorithm library; Step S5, establishing a running engine, wherein the running engine independently runs the algorithm model in the running environment and calls the algorithm model at any time; Wherein, the algorithm model includes a model file, a function code block, an input format, and an output format; Wherein, the algorithm library includes MySQL database, MongoDB database and redis database; The mysql database is used to store the function code block, the input format and the output format, the MongoDB database is used to store the model file, and the redis database is used to store the intermediate running results of the algorithm model during the running process; Wherein, the step S4 specifically includes: S41, establishing a code template as a benchmark for instantiating the algorithm model; S42, establishing the template engine according to the code template; S43, instantiating the algorithm model using the module of the template engine according to the input module, output module and library of the code template; S44, performing syntax verification and function verification on the algorithm model; S45, publishing the verified algorithm model through a database identifier and a function interface and saving it to the algorithm library; Wherein, the step S43 specifically includes: Step S431, determining the input of the algorithm model and instantiating the input module of the code template; Step S432, determining the runtime library of the algorithm model, and instantiating the library usage module of the code template; Step S433, confirming the output of the algorithm model and instantiating the output module of the code template.
2. The method for constructing an equipment health management algorithm library according to claim 1, characterized in that: The step S2 specifically includes: Step S21, installing the docker container tool on the server to complete the construction of the container platform; Step S22, pulling a Linux image as the system environment of the container platform; Step S23, instantiate and build multiple Docker containers based on the system environment, and configure the corresponding environment variables of the operating environment in each Docker container.
3. The method for constructing an equipment health management algorithm library according to claim 1, characterized in that: The step S5 specifically includes: S51, establishing a running engine of the algorithm model; S52, the execution engine reads the model file and function code block included in the algorithm model currently to be executed and introduces them into the execution engine; S53, the execution engine executes the algorithm model and saves the execution result to the redis database, and calls the algorithm model at any time through the database identifier and function interface.
4. The method for constructing an equipment health management algorithm library according to claim 1, characterized in that: The step S4 also includes modifying the runtime library of the algorithm model and editing the core code of the algorithm model to further instantiate the algorithm model.
5. The method for constructing an equipment health management algorithm library according to claim 1, characterized in that: It also includes constructing the microservice platform in the equipment health management service platform, and the equipment health management service platform is a B / S architecture.
6. The method for constructing an equipment health management algorithm library according to claim 5, characterized in that: The equipment health management service platform calls the microservice that runs the algorithm model through http access.
