General packaging and calling method for constellation intelligent state monitoring algorithm
By encapsulating the algorithm into a modular service and integrating it into the algorithm library, the interface difference problem in algorithm integration and calling is solved, and the plug-and-play and rapid replacement of algorithm modules are realized, which improves the flexibility and scalability of the system, simplifies the maintenance process, and improves the user experience.
Patent Information
- Application Number
- CN202510534793.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, there are differences in interfaces and operations in algorithm integration and call, resulting in high code redundancy, poor system scalability, high maintenance complexity, and difficult to adapt to diversified scenario transformations and poor user experience.
Encapsulate the algorithm into a modular service and integrate it into the algorithm library. Through standardized interfaces and database management, dynamic switching and unified calls of algorithms are realized, and the scalability of modular services is utilized to reduce dependency conflicts. It provides a lightweight encapsulation interface and RESTful API, and supports rapid integration and replacement.
It realizes plug-and-play algorithm modules, reduces development workload and maintenance complexity, improves the flexibility and scalability of the system, provides an efficient and flexible algorithm call experience, simplifies code maintenance, and enhances the adaptability and user experience of the system.
Smart Images

Figure CN120469669A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a universal encapsulation and calling method, belonging to the field of computer technology. Background Art
[0002] With the continuous advancement of computer technology, numerous remarkable algorithms have been developed and applied in various fields. However, due to the differences in parameters and data structures required by each algorithm, there are significant differences in interfaces and operations when calling different algorithms, which increases the complexity of algorithm integration and application. In the existing technology, solutions to this problem usually involve designing independent service interfaces for different algorithms. Specifically, software systems write dedicated code for specific algorithms and provide standardized service interfaces in the JSON data format to facilitate algorithm calling and integration.
[0003] Based on the implementation methods of existing technologies, the following technical problems exist in the software development process: excessive code redundancy leads to reduced development efficiency; the system scalability is poor and it is difficult to adapt to the rapid integration of new algorithms; and the subsequent maintenance is complex, which increases the system's operation and maintenance costs and technical burden.
[0004] The existing technology lacks an efficient and universal algorithm call module capable of managing different algorithms to enable rapid switching and calling between multiple algorithms, making it difficult for the system to adapt to the needs of diverse scenario changes. Furthermore, the complex algorithm call process and lack of a unified management mechanism significantly impact the user experience, failing to meet user expectations for efficient, flexible, and user-friendly interaction. This invention significantly improves the system's scenario adaptability and user experience by designing an efficient algorithm call module that supports dynamic switching and unified management of multiple algorithms. Summary of the Invention
[0005] The present invention aims to solve the problem that when multiple algorithms are integrated into a software system, due to the differences in the input and output data formats of each algorithm, multiple combination codes need to be performed for different algorithms. If each algorithm is packaged and called independently, the development workload will be significantly increased and the coding maintenance complexity will be high. Therefore, a universal packaging and calling method for the constellation intelligent status monitoring algorithm is proposed.
[0006] The technical solution adopted by the present invention to solve the above problems is: the steps of the present invention include:
[0007] Step 1: Encapsulate multiple algorithms into modular services and integrate them into the algorithm library;
[0008] Step 2: Store the algorithm file in the local file system.
[0009] Step 3: Use the database to store algorithm information;
[0010] Step 4: By leveraging the scalability of modular services, encapsulate each algorithm model into an independent modular service;
[0011] Step 5: When the business logic changes, the front-end transmits the telemetry parameters that need to be analyzed to the back-end system via JSON strings. The back-end system matches the algorithm dimensions and the algorithm model keyword information in the database based on the parsed telemetry parameters.
[0012] Step 6: Based on the algorithms automatically screened by the system, the final algorithm and algorithm model are selected according to user needs, and the front end transmits the user-selected information to the system back end;
[0013] Step 7: The system adjusts and changes in real time according to changes in business logic. Users can independently choose to dynamically add, delete or replace algorithm models by calling the system backend interface.
[0014] Furthermore, in step 1, a lightweight, standardized modular service form is used to uniformly encapsulate the algorithm model and establish the same encapsulation interface: define a standardized algorithm input / output protocol, including parameter definition, data format and error code specification.
[0015] Furthermore, the storage method is standardized in step 2. All algorithms are stored in a folder named after the algorithm, and all models are stored in a folder named "model" under the algorithm folder, providing a basis for adding and modifying algorithm functions.
[0016] Furthermore, in step 3, corresponding database tables are established in the MySQL database for different types of information, and relevant indexes are established for tables with large data volumes and frequent queries to improve the query efficiency of the MySQL database. The data tables include: algorithm basic information table, algorithm parameter table, algorithm model table and algorithm keyword table.
[0017] Furthermore, in step 4, a unified RESTful API interface is designed for the modular services of each algorithm model. The drf-yasg library is used to automatically generate documents that comply with the OpenAPI specification. After configuration is complete, the visual API documentation based on the Swagger UI can be viewed by accessing the / docs endpoint. A componentized design approach is adopted, and the virtual environment venv is used to achieve environmental isolation.
[0018] Furthermore, in step 5, the algorithm and algorithm model suitable for analyzing the current telemetry parameters are automatically screened out through keyword matching and dimension matching; and the above information is encapsulated as a JSON string response to the front end; the front end parses the JSON string and displays the response algorithm information.
[0019] Furthermore, after the backend parses the data in step 6, the selected algorithm information, including algorithm parameter information, is again queried in the database.
[0020] Furthermore, in step 7, the system will simultaneously modify the corresponding algorithm information in the database and the algorithm model stored in the file system, thereby meeting the continuously changing needs of diverse scenarios in the application system. This method significantly improves the system's adaptability, scalability, and utilization of algorithm resources.
[0021] The beneficial effects of the present invention are:
[0022] 1. The present invention encapsulates the algorithm model into an independent module by utilizing the characteristics of modular services, thereby realizing plug-and-play and lightweight expansion of the algorithm module during the algorithm call process, effectively solving the integration problem caused by the difference in the underlying technology of the algorithm, and realizing standardized management of the algorithm module; each modular service can run in its own independent environment, avoiding dependency conflicts between different services, minimizing the dependency relationship between services, and enabling independent expansion and replacement; each algorithm model follows a unified standardized interface definition, thereby realizing cross-model functional integration, and providing an underlying foundation for mutual calls between algorithm models; when a new algorithm model needs to be integrated into the algorithm library or When replacing an existing algorithm model, only the logic of the front-end application layer needs to be adjusted without modifying the back-end underlying code. Based on the scalability of modular services, the present invention provides efficient support for the integration of algorithm models, significantly reducing the complexity of system expansion and maintenance, while enhancing the flexibility and maintainability of the system. In the front-end application layer, the calling logic of the algorithm module can be modified by adjusting the corresponding configuration information without modifying the back-end code, thereby quickly meeting the algorithm requirements of different business logics. This design enables the system to easily cope with complex and changing business scenarios, providing users with an efficient, flexible and simple algorithm calling experience, significantly improving the practicality and maintainability of the system.
[0023] 2. This invention encapsulates various algorithms into modular services and integrates them into the algorithm library, solving the problem of traditional encapsulation methods, which have great differences in the encapsulation process for algorithms of different types and different input and output formats, and completes the algorithm encapsulation with a universal method;
[0024] 3. This invention realizes the modularization and standardization of algorithm calls, which significantly reduces the complexity of algorithm integration and improves the flexibility and scalability of the system;
[0025] 4. When business logic changes, you only need to adjust the logical relationship of the algorithm call in the database to dynamically pull the corresponding modular service. This method reduces code redundancy, reduces development workload, and simplifies the complexity of coding maintenance;
[0026] 5. The modular service standard has strict requirements on all aspects of calling the interface, including the JSON format of the interface input parameters and the interface return value type. This allows the application system to directly call the algorithm interface without having to pay attention to the specific implementation details of the algorithm's underlying input and output, thus realizing universal algorithm calling. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the present invention;
[0028] Figure 2 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0029] Specific implementation method 1: Figure 1 As shown, first, each algorithm is encapsulated into different modular services and uniformly integrated into the algorithm library, so that different algorithms can be called according to the database in the future; each modular algorithm unit provides a standardized interface. For the standardized interface, a set of unified interface specifications is defined, including the interface name, the JSON format of the interface input parameters, the interface return value type, etc., so that different algorithm modules can be designed and implemented according to these specifications, thereby achieving seamless collaboration between algorithm modules. The integration between different services becomes simpler and more reliable. The application system only needs to focus on the business scenarios that need to be analyzed, and does not need to pay attention to the underlying calls between algorithm modules. In this way, the universal characteristics of algorithm encapsulation and algorithm calling functions are achieved;
[0030] In terms of high scalability, each algorithm model adopts a loosely coupled design method and is independently encapsulated as an atomic service process. At the same time, the algorithm services have little dependency and can be expanded and replaced independently of each other. In addition, when a new algorithm model needs to be integrated or an existing model needs to be replaced, it is only necessary to call the corresponding interface on the front end to make corresponding modifications to the algorithm library and database, which greatly reduces the complexity of expansion and maintenance. In short, the application can be adjusted and optimized at any time according to changes in business logic, and algorithm models can be dynamically added, deleted or replaced to meet the needs of ever-changing application scenarios. These modular algorithm units are integrated into an algorithm library to form a reusable algorithm capability pool. The lightweight and easy-to-transfer advantages of modular services make the startup and operation overhead of each algorithm model small, facilitating efficient calling and circulation.
[0031] Leveraging the characteristics of modular services, we define standardized interfaces and extensible capabilities for each algorithm in the algorithm library, facilitating the autonomous calling and switching of each algorithm model. We then define the business logic in the database. Finally, we utilize the algorithm scheduling module to execute different task scenarios, including algorithm management, algorithm model management, algorithm upload, algorithm download, and monitoring logs.
[0032] The structural analysis of the algorithm information database is as follows: algorithm basic information table, algorithm type table, and algorithm parameter table; the algorithm basic information table records the algorithms in the current algorithm management module and basic information such as the input data dimensions supported by the algorithm, the algorithm output data format type, etc.; the algorithm type table records the type of the algorithm in the current algorithm management module; the algorithm parameter table records the requirements of the specific algorithm for input parameters.
[0033] Specific implementation method 2: Figure 2 As shown in FIG, a general encapsulation and calling method of a constellation intelligent status monitoring algorithm includes the following specific steps:
[0034] Step 1: The front-end calls the algorithm query interface and transmits the telemetry data that needs to be analyzed in the current business scenario to the back-end. The back-end selects the algorithms that meet the conditions in the current system based on the telemetry data and the algorithm characteristics stored in the database, and returns the names of all qualified algorithms to the front-end.
[0035] Step 2: After the front-end selects the required algorithm, it accesses the back-end interface to query the input parameters and parameter meanings required by the selected algorithm; and displays different input methods to the user based on the parameter type; after the user completes the parameter input on the front-end page, the algorithm call function is used to call the selected algorithm.
[0036] Step 3: The backend calls the algorithm based on the frontend input data, combined with the basic algorithm information in the database and the software algorithm library, and returns the algorithm execution results to the frontend;
[0037] Step 4. The user reviews the algorithm results and decides whether to export the current analysis results from the software based on the results. If yes, the analysis results will be exported in the form of a Word document.
[0038] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the present profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical content disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement of the above embodiments made according to the technical essence of the present invention, within the spirit and principles of the present invention, without departing from the content of the technical solution of the present invention, shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A universal encapsulation and calling method for a constellation intelligent status monitoring algorithm, characterized in that: The specific steps include: Step 1: Encapsulate multiple algorithms into modular services and integrate them into the algorithm library; Step 2: Store the algorithm file in the local file system. Step 3: Use the database to store algorithm information; Step 4: By leveraging the scalability of modular services, encapsulate each algorithm model into an independent modular service; Step 5: When the business logic changes, the front-end transmits the telemetry parameters that need to be analyzed to the back-end system via JSON strings. The back-end system matches the algorithm dimensions and the algorithm model keyword information in the database based on the parsed telemetry parameters. Step 6: Based on the algorithms automatically screened by the system, the final algorithm and algorithm model are selected according to user needs, and the front end transmits the user-selected information to the system back end; Step 7: The system adjusts and changes in real time according to changes in business logic. Users can independently choose to dynamically add, delete or replace algorithm models by calling the system backend interface.
2. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 1, a lightweight, standardized modular service format is used to uniformly encapsulate the algorithm model and establish a unified encapsulation interface: define a standardized algorithm input / output protocol, including parameter definition, data format, and error code specifications.
3. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 2, the storage method is standardized. All algorithms are stored in a folder named after the algorithm, and all models are stored in a folder named "model" under the algorithm folder, providing a basis for adding and modifying algorithm functions.
4. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 3, corresponding database tables are established in the MySQL database for different types of information, and relevant indexes are established for tables with large data volumes and frequent queries to improve the query efficiency of the MySQL database. The data tables include: algorithm basic information table, algorithm parameter table, algorithm model table and algorithm keyword table.
5. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 4, a unified RESTful API interface is designed for the modular service of each algorithm model. The drf-yasg library is used to automatically generate documents that comply with the OpenAPI specification. After configuration is complete, the visual API documentation based on the Swagger UI can be viewed by accessing the / docs endpoint. A componentized design approach is adopted, and the virtual environment venv is used to achieve environmental isolation.
6. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 5, the algorithm and algorithm model suitable for analyzing the current telemetry parameters are automatically screened out through keyword matching and dimension matching; the above information is encapsulated as a JSON string and responded to the front end; the front end parses the JSON string and displays the response algorithm information.
7. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: After the backend parses the data in step 6, it queries the database again for the selected algorithm information, including algorithm parameter information.
8. The universal encapsulation and calling method of a constellation intelligent status monitoring algorithm according to claim 1 is characterized in that: In step 7, the system will simultaneously modify the corresponding algorithm information in the database and the algorithm model stored in the file system, thereby meeting the continuously changing needs of diverse scenarios in the application system. This method significantly improves the system's adaptability, scalability, and utilization of algorithm resources.