Method and device for dynamically expanding discovery capability of Java automatic discovery proxy in combination with Jython

By combining Jython's Java automatic discovery agent, dynamically expanding the discovery capabilities, the problems of poor maintenance, poor readability and complex implementation in the existing technology are solved, and the capability expansion development is efficiently and conveniently without recompiling Java code, reducing the operation and maintenance deployment cost.

CN120066475APending Publication Date: 2025-05-30BEIJING BAOLANDE SOFTWARE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510132682.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The existing Java automatic discovery agent has problems such as poor maintenance, poor readability, and complex implementation in dynamic expansion discovery capabilities, and it is difficult to achieve expansion discovery capabilities without recompiling Java code.

Method used

Combining Jython's Java automatic discovery agent's method of dynamically expanding discovery capabilities, we can create and edit tools, configure tool basic information, edit and bind Python scripts with tools, and use Jython to run Python scripts in Java automatic discovery agent to achieve dynamically expanding discovery capabilities.

Benefits of technology

It realizes dynamic expansion of automatic discovery capabilities without issuing a new version of Java automatic discovery agent, which reduces operation and maintenance deployment costs, improves system flexibility and scalability, and simplifies data parsing and processing processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066475A_ABST
    Figure CN120066475A_ABST
Patent Text Reader

Abstract

The invention relates to the field of automatic discovery of dynamic extension discovery capability of an agent, and particularly discloses a Java automatic discovery method and device for dynamic extension discovery capability of an agent in combination with Jython, and the method comprises the following steps: S1, creating a tool or editing the tool, configuring basic information of the tool, editing a python script and binding the python script with the tool, and storing the tool in a database; s2, obtaining and reading a tool in the database, downloading the tool and setting parameters, running a python script in a tool process by using Jython, obtaining data collected by the script, and uploading the collected data to the database. According to the method, the automatic discovery agent program developed based on Java can have the capability of dynamically expanding automatic discovery under the condition that a new version is not issued, capability expansion development can be efficiently and conveniently carried out, and the operation and maintenance deployment cost is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatically discovering the dynamic extension of the discovery ability of an agent, and more particularly to a method and device for dynamically extending the discovery ability of a Java automatic discovery agent combined with Jython. Background Art

[0002] With the continuous innovation and development of IT technology, new application systems, middleware, databases and other types of software have emerged and been applied continuously. At the same time, various existing software will also release new versions over time. The newly created software often has differences in architecture design, storage, communication, and logical concepts from other similar software, so that it is impossible to use a general collection method to collect information about it. Even for the same software, the differences in the physical and logical levels between major versions may be relatively large, resulting in the inability to use the old collection method to collect information about the new version of the software, thus bringing huge challenges to the resource management system for collecting and managing these new software and versions.

[0003] For an automatic discovery agent program commonly developed using Java, its corresponding capabilities are solidified after code compilation. If you want to extend the automatic discovery information collection ability, you need to modify or add code and then recompile to achieve it. And usually, the automatic discovery agent program is deployed in a large number of servers and virtual machines. The repackaged automatic discovery agent program needs to be redeployed to the corresponding server to achieve the upgrade of the discovery ability. It can be seen that there are obvious complexities in both the development and operation and maintenance levels.

[0004] As a compiled and interpreted language, the functions of an automatic discovery agent program developed using Java are basically solidified after compilation and packaging. Although the reflection mechanism can be used to dynamically load remote Class files for execution to dynamically extend the capabilities, there are problems such as poor maintainability, poor readability, and complex implementation.

[0005] In addition, the automatic discovery agent in Java can download and execute Python scripts to dynamically extend the capabilities. However, in most actual application scenarios, for system security, the dynamically downloaded Python scripts generally do not have executable permissions, resulting in the inability to execute, and it is impossible to ensure that the required Python version and related dependencies are installed on the running server. There are many limiting conditions in the implementation process.

[0006] Conventional scripts themselves also have many limitations, such as the reuse of common logic between scripts, how to make scripts more flexible through parameters and environment variables, the dependency management between scripts, and the state management of scripts. All of these require a set of mechanisms to standardize and constrain.

[0007] In summary, the current automatic discovery agents have problems such as poor maintainability, poor readability, and complex implementation in dynamically expanding discovery capabilities. Summary of the Invention

[0008] To solve the above technical problems, the present invention provides a method and device for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython. This method enables the automatic discovery agent program developed based on Java to dynamically expand its automatic discovery capabilities without releasing new versions, allowing for efficient and convenient development of capability expansion, and greatly reducing the operation and maintenance deployment costs.

[0009] In a first aspect, the method for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython provided by the present invention adopts the following technical solutions:

[0010] The method for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython includes the following steps:

[0011] S1. Create a tool or edit a tool, configure the basic information of the tool, edit a Python script and bind it to the tool, and save the tool to the database;

[0012] S2. Obtain and read the tools in the database, then download the tools and set parameters, and then use Jython to run the Python script inside the tool process, obtain the data collected by the script, and upload the collected data to the database.

[0013] Preferably, the basic information of the tool includes name, entry script, dependent script, corresponding model, parameters, and environment variables.

[0014] Preferably, step S2 further includes the following steps:

[0015] After a sleep time T, return and re-execute step S2.

[0016] Preferably, the time T is 30 minutes.

[0017] Preferably, it further includes the following steps:

[0018] Create a thread pool through ExecutorService, and dynamically set the size of the linear pool according to the number of tools and the system resource status;

[0019] Encapsulate the Python script of each tool into a Callable object and submit it to the thread pool for execution;

[0020] Execute the linear pool and, after the execution is completed, use a Future object to collect all the execution results.

[0021] In a second aspect, the present invention provides a device for dynamically expanding the discovery ability of a Java automatic discovery agent in combination with Jython, which adopts the following technical solutions:

[0022] The device for dynamically expanding the discovery ability of a Java automatic discovery agent in combination with Jython includes an agent unit and a service unit;

[0023] The agent unit includes the following modules:

[0024] A creation module, which is used to create a tool and set the basic information of the tool;

[0025] An editing module, which is used to edit the tool and edit the basic information of the tool;

[0026] An upload module, which is used to upload or edit a Python script;

[0027] A binding module, which is used to bind the Python script to the tool;

[0028] A saving module, which is used to save the tool to a database;

[0029] The service unit includes the following modules:

[0030] A obtaining module, which is used to obtain and read the tools in the database;

[0031] A downloading module, which is used to download the tool;

[0032] A setting module, which is used to set the parameters of the tool;

[0033] A script running module, which is used to run the Python script inside the tool process using Jython;

[0034] A collection obtaining module, which is used to obtain the data collected by the script;

[0035] A collection uploading module, which is used to upload the data collected by the script to the database.

[0036] Preferably, it further includes a sleep module, and the sleep module is used to return and restart the function of executing the obtaining module after a sleep time T.

[0037] Preferably, it further includes a linear pool unit, and the linear pool unit includes the following modules:

[0038] A linear pool creation unit, which is used to create a thread pool through an ExecutorService and dynamically set the size of the linear pool according to the number of tools and the system resource status;

[0039] A linear pool encapsulation submission unit, which is used to encapsulate the Python script of each tool into a Callable object and submit it to the thread pool for execution;

[0040] A linear pool execution collection unit is used to execute a linear pool and, after the execution is completed, collect all execution results using a Future object.

[0041] In a third aspect, the present application provides an electronic device, adopting the following technical solution:

[0042] An electronic device, the electronic device includes:

[0043] One or more processors;

[0044] A memory;

[0045] One or more applications, where one or more applications are stored in the memory and are configured to be executed by one or more processors. One or more programs are configured to: execute a method for dynamically expanding discovery capabilities of a Java automatic discovery agent combined with Jython as shown in any possible implementation manner of the first aspect.

[0046] In a fourth aspect, the present application provides a computer-readable storage medium, adopting the following technical solution:

[0047] A computer-readable storage medium, including: a computer program stored with the ability to be loaded and executed by a processor to implement a method for dynamically expanding discovery capabilities of a Java automatic discovery agent combined with Jython as shown in any possible implementation manner of the first aspect.

[0048] In summary, the present invention includes the following beneficial technical effects:

[0049] 1. The automatic discovery agent program developed based on Java in the present invention can dynamically expand the automatic discovery capabilities without releasing a new version, enabling efficient and convenient development of capability expansion, and greatly reducing the operation and maintenance deployment costs.

[0050] 2. The present invention integrates Jython into the Java automatic discovery agent program, allowing Java to dynamically load and execute Python scripts, thereby realizing the expansion of discovery capabilities without recompiling Java code, effectively improving the flexibility and scalability of the system.

[0051] 3. The present invention has the functions of standardized output and data unification, standardizes the acquisition output of Python scripts, ensures that the data collected by different scripts follows a unified format structure, facilitates the rapid parsing and processing by Java programs, reduces the complexity of data parsing, improves the maintainability and scalability of the system, and greatly simplifies the parsing and processing process of Java programs, reducing the maintenance cost.

[0052] 4. The present invention has a flexible file dependency management function. Through the DependFiles attribute, it supports any type of file as a dependency of the script, so as to flexibly supplement the capabilities of Python scripts. This mechanism significantly improves the depth and breadth of information collection and allows specific functions to be implemented using Java in complex scenarios.

[0053] 5. The present invention introduces a thread pool concurrent execution strategy to effectively manage the concurrent execution of multiple Python scripts, dynamically adjust the thread pool size to adapt to different workloads, so as to efficiently handle the concurrent tasks of a large number of tools and improve the overall performance and response speed of the system.

[0054] 6. The present invention can dynamically adjust the collection strategy according to different business requirements, adapt to the changing IT environment, and provide strong support for resource management. Brief Description of the Drawings

[0055] Figure 1 It is a schematic diagram of the dependency relationship between scripts of the method in the embodiment of the present invention.

[0056] Figure 2 It is a flowchart of the method in the embodiment of the present invention. Detailed Embodiment

[0057] The present invention will be further described in detail below with reference to the accompanying drawings.

[0058] The embodiment of the present invention discloses a method for dynamically expanding the discovery ability of a Java automatic discovery agent in combination with Jython.

[0059] The embodiment of the present application proposes the concept of "tool" to solve the encapsulation and management problems of scripts, parameters, configuration information and dependency relationships. Tools not only include Python scripts, but also related system parameters, environment variables and dependencies. The proxy program dynamically downloads tools by obtaining the tool list on the server side and automatically sets the running environment according to the configuration. This mechanism allows tools to be added or modified in real time without republishing the proxy program, improving the scalability and flexibility of the system. The core attributes of the tool are defined as follows:

[0060] Attribute Description Name Tool Name State Status EntryScript Tool Execution Entry DependScripts Define all scripts on which the operation depends DependFiles Files on which the script execution depends Model Define the model to which the data discovered by the current tool belongs Description Script description, used to distinguish the role of the script at the management level Args Parameter values passed to the entry script Envs Environment variables passed to the entry script

[0061] The interpretations of the name attributes in the above table are as follows:

[0062] I. Name;

[0063] The tool name is mainly used to identify the purpose of the tool, such as "Mysql Automatic Discovery".

[0064] II. State;

[0065] The online and offline status of the tool is used to dynamically control whether the tool is executed in the agent program.

[0066] III. EntryScript;

[0067] The entry script for tool execution. A tool can contain multiple scripts and files. Specify a Python file as the entry file, which is configured as a reference to the script file here.

[0068] IV. DependScripts;

[0069] An array structure that defines all other script files on which the entry file depends. After configuration, the automatic discovery agent program downloads all dependent scripts to the specified directory. The dependency relationship between scripts is as Figure 1 shown. Except for the entry script, scripts can depend on each other, which is convenient for extracting and encapsulating common capabilities to improve reusability, and script management can also be hierarchically managed in an engineering way.

[0070] V. DependFiles;

[0071] An array structure that defines the "files" on which all scripts in the tool depend. The files can be of any type. Generally, the "files" are used to supplement the script capabilities in a specific way when certain capabilities cannot be achieved by Python scripts, thus providing more flexible extension capabilities for the agent program.

[0072] For example, when wanting to collect the version number information of BES used by a certain Java application, an ordinary Python script cannot complete this task. At this time, a Java file can be written to collect information on the imported BES-related jar packages. We only need to compile the written Java file into a class file and then upload it to the management platform as a "file" and associate it with the "tool". In our Python script, use the Java command to execute this class file and pass in the BES-related jars through the classpath method to execute the logic we wrote in advance to obtain the target data.

[0073] As in the above example, this solution does not limit the type of files. It can be any file that assists the script in information collection during the script execution process. It can be seen that this implementation method greatly improves the depth of information that the agent program can collect.

[0074] VI. Model;

[0075] Defines the model to which the data discovered by the current tool belongs. The data discovered by the agent program and the script is defined as model instance data, and the definition of the model is maintained in the configuration management system.

[0076] VII. Description;

[0077] The script description is mainly used for the automatic discovery management platform to describe the tool's ability boundary range, input and output parameters, related dependencies, etc., so as to facilitate the long-term maintenance of the tool.

[0078] VIII. Args;

[0079] In the form of an array, it is the parameter list of the entry script. After configuration, it is passed in by the automatic discovery agent when executing the corresponding entry script using Jython.

[0080] By setting parameters, the script can be made more extensible to achieve different collection tasks by passing in different parameters. For example, a set of general logic is implemented in the Mysql entry script, which supports using the version number as a parameter to complete the collection of Mysql information for different versions. The management platform can create multiple tools and use the same Mysql entry script with different versions set as input parameters to achieve tool isolation.

[0081] IX. Envs;

[0082] In the form of an array, it is the environment variables for the execution of the entry script, configured in the form of key-value pairs. After configuration, before executing the entry script, the agent uses the PythonInterpreter class in Jyhton to execute os.exec(“os.environ[${key}=${value}]”) to set the configured environment variables in sequence.

[0083] The introduction of environment variables allows the script to be executed on diverse operating systems without modifying its source code.

[0084] Specifically, referring to Figure 2 , the method for dynamically extending the discovery ability of the Java automatic discovery agent in combination with Jython includes the following steps:

[0085] S1. Create a tool or edit a tool, configure the basic information of the tool, edit the python script and bind it to the tool, and save the tool to the database;

[0086] Specifically, first enter the tool management page of the automatic discovery platform, and then create or edit a tool. If creating a tool, set the basic information of the tool. If editing a tool, edit the basic information of the tool, then upload or edit or modify the python script and bind it to the tool, and then save the tool to the database.

[0087] Among them, the basic information of the tool includes name, entry script, dependent script, corresponding model, parameters, and environment variables.

[0088] S2. Obtain and read the tools in the database, then download the tools and set the parameters. Next, in the basic solution of the tool, the information collected by the Python script is uniformly collected, parsed, and reported through Java logic. To ensure the generality and efficiency of data processing, the present invention standardizes the collection output of the Python script. Through this standardized design, the data collected by different Python scripts will follow a unified format structure, and the Java program can quickly and accurately parse and process it. The unification of this data format greatly simplifies the differences between the outputs of different scripts, significantly reduces the complexity of Java program parsing, and thus improves the maintainability and scalability of the system.

[0089] The data specification format is defined as follows:

[0090]

[0091]

[0092] findTime represents the timestamp of resource discovery, which is convenient for sorting and analyzing data by time.

[0093] fields is a list of resource attributes, organized in the form of an array of key-value pairs, supporting personalized attributes of different resource models. The above process ensures that the attribute differences between models can be handled through flexible extension definitions without changing the core Java logic.

[0094] The above example defines that all models have fixed common attributes, such as "resource name", "IP", "port", etc., ensuring that these common attributes can be directly mapped and processed. At the same time, personalized attributes can be flexibly extended according to model requirements through the fields field, and specific Python scripts are responsible for collecting and outputting. This mechanism gives great flexibility to the Python script, meeting the information collection requirements under different resource types and different business scenarios.

[0095] In this embodiment, due to the expansion of the follow-up discovery ability, a large number of tools need to be processed. To ensure that the program can still maintain high performance in the face of a large number of concurrent tasks, therefore, the method of dynamically expanding the discovery ability of the Java automatic discovery agent combined with Jython further includes the following steps:

[0096] S3. Concurrent execution of the linear pool;

[0097] The concurrent execution of the linear pool can not only effectively manage the concurrent execution of multiple Python scripts, but also dynamically adjust the size of the thread pool according to specific situations to adapt to different workloads. It specifically includes the following steps:

[0098] Initialization of the thread pool: Create a thread pool of an appropriate size through ExecutorService. Dynamically set the size of the thread pool according to the number of tools and the system resource status to ensure efficient utilization of resources.

[0099] Task submission and scheduling: Encapsulate the Python script of each tool into a Callable object and submit it to the thread pool for execution. The above process allows the system to handle the execution of multiple Python scripts simultaneously, reducing the latency caused by task queuing. Especially when the number of tools is large, it can significantly improve the efficiency of concurrent execution.

[0100] Result collection and processing: Execute the thread pool and use the Future object to collect all execution results after completion. The above process ensures that all results can be effectively integrated and reported in a timely manner even in a highly concurrent environment.

[0101] Based on the Jython-based architecture design, the core of this method lies in integrating Jython into the Java automatic discovery agent program, enabling the Java program to dynamically load and execute Python scripts, thereby achieving extended discovery capabilities without recompiling the Java code.

[0102] As an implementation of the Python language on the Java virtual machine, Jython can seamlessly combine Java classes and resources, allowing the simultaneous use of Java and Python in the same environment.

[0103] In the architecture design, the Java part is responsible for the lifecycle management of the entire agent program and is used to collect fixed information, such as the basic information of the server, including CPU, memory, disk, IP, hostname, etc.

[0104] For the information collection tasks of complex components such as third-party middleware, services, and databases that need to be flexibly processed when deployed on servers or virtual machines, they are implemented through Python scripts to ensure that the collection capabilities can be dynamically extended and updated according to business requirements.

[0105] The embodiment of the present invention also discloses a device for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython. This device is used to execute the method for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython disclosed in the above embodiment. Specifically, the device for dynamically expanding the discovery capabilities of a Java automatic discovery agent combined with Jython includes an agent unit and a service unit.

[0106] Specifically, the agent unit includes the following modules:

[0107] Creation module, used to create tools and set basic tool information;

[0108] Editing module, used to edit tools and edit basic tool information;

[0109] Upload module, used to upload or edit Python scripts;

[0110] Binding module, used to bind Python scripts to tools;

[0111] Saving module, used to save tools to the database;

[0112] The service unit includes the following modules:

[0113] Retrieving module, used to retrieve and read tools in the database;

[0114] Download module, used to download tools;

[0115] Setting module, used to set parameters of tools;

[0116] Script running module, used to run Python scripts inside the tool process using Jython;

[0117] Collection and retrieval module, used to retrieve data collected by scripts;

[0118] Collection and upload module, used to upload data collected by scripts to the database.

[0119] Furthermore, the device that combines the dynamic extension discovery ability of the Java automatic discovery proxy of Jython also includes a sleep module and a linear pool unit.

[0120] The sleep module is used to return and restart the function of the retrieving module after a sleep time T.

[0121] The linear pool unit includes the following modules:

[0122] Linear pool creation unit, used to create a thread pool through ExecutorService and dynamically set the size of the linear pool according to the number of tools and the system resource status;

[0123] Linear pool encapsulation and submission unit, used to encapsulate the Python script of each tool into a Callable object and submit it to the thread pool for execution;

[0124] Linear pool execution and collection unit, used to execute the linear pool and use a Future object to collect all execution results after the execution is completed.

[0125] An embodiment of the present invention also discloses an electronic device, which includes: a processor and a memory. Among them, the processor and the memory are connected, such as through a bus. Optionally, the electronic device may further include a transceiver. It should be noted that in practical applications, the transceiver is not limited to one, and the structure of the electronic device does not constitute a limitation to the embodiment of the present invention.

[0126] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in connection with the disclosure of the present invention. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0127] The bus may include a path for transmitting information between the above components. The bus may be a PCI (Peripheral Component Interconnect) standard bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc.

[0128] The memory may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0129] The memory is used to store the application program code for implementing the solution of the present invention, and is controlled by the processor to execute. The processor is used to execute the application program code stored in the memory to implement the content shown in a method for dynamically expanding the discovery ability of a Java automatic discovery agent combined with Jython as disclosed in the above embodiment.

[0130] Among them, the electronic device includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle terminals (such as vehicle navigation terminals), etc. and fixed terminals such as digital TVs, desktop computers, etc. It may also be a server, etc.

[0131] An embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When it runs on a computer, it enables the computer to execute the corresponding content in a method for dynamically expanding the discovery ability of a Java automatic discovery agent combined with Jython disclosed in the above embodiment.

[0132] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited accordingly. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention shall be covered within the protection scope of the present invention.

Claims

1. A method for dynamically extending discovery capabilities of a Java automatic discovery agent in combination with Jython, characterized in that: The following steps are involved: S1. Create or edit a tool, configure basic information of the tool, edit the Python script and bind it to the tool, and save the tool to the database; S2. Obtain and read the tool in the database, then download the tool and set the parameters, then use Jython to run the python script inside the tool process, obtain the data collected by the script, and upload the collected data to the database.

2. The method for dynamically extending the discovery capability of a Java automatic discovery agent combined with Jython according to claim 1, characterized in that: The basic information of the tool includes name, entry script, dependent scripts, corresponding model, parameters, and environment variables.

3. The method for dynamically extending the discovery capability of a Java automatic discovery agent combined with Jython according to claim 1, characterized in that: The S2 further comprises the following steps: After the sleep time T, the process returns to and re-executes S2.

4. The method for dynamically extending the discovery capability of a Java automatic discovery agent combined with Jython according to claim 3, characterized in that: The time T is 30 minutes.

5. The method for dynamically extending the discovery capability of a Java automatic discovery agent combined with Jython according to claim 1, characterized in that: The following steps are also included: Create a thread pool through ExecutorService and dynamically set the size of the linear pool according to the number of tools and system resource conditions; Encapsulate the Python script of each tool as a Callable object and submit it to the thread pool for execution; Executes a linear pool and after the execution is completed, uses a Future object to collect all the execution results.

6. A device for dynamically extending discovery capabilities of a Java automatic discovery agent in combination with Jython, characterized in that: It includes agent unit and service unit; The agent unit includes the following modules: Create a module to create a tool and set basic information of the tool; Editing module, used to edit tools and basic information of tools; Upload module, used to upload or edit Python scripts; Binding module, used to bind Python scripts with tools; A saving module, used to save the tool to the database; The service unit includes the following modules: The acquisition module is used to acquire and read the tools in the database; Download module, used to download tools; The setting module is used to set the parameters of the tool; The script running module is used to run Python scripts inside the tool process using Jython; The acquisition module is used to acquire the data collected by the script; The collection and upload module is used to upload the data collected by the script to the database.

7. The device for dynamically extending discovery capabilities of a Java automatic discovery agent combined with Jython according to claim 6, characterized in that: It also includes a sleep module, which is used to return and restart the function of the acquisition module after a sleep time T.

8. The device for dynamically extending discovery capabilities of a Java automatic discovery agent combined with Jython according to claim 6, characterized in that: It also includes a linear pooling unit, which includes the following modules: The linear pool creation unit is used to create a thread pool through ExecutorService and dynamically set the size of the linear pool according to the number of tools and system resource conditions; The linear pool encapsulation submission unit is used to encapsulate the Python script of each tool into a Callable object and submit it to the thread pool for execution; The linear pool execution collection unit is used to execute the linear pool and collect all execution results using the Future object after the execution is completed.

9. An electronic device, characterized in that It includes: One or more processors; Memory; one or more applications; One or more of the applications are stored in the memory and configured to be executed by one or more of the processors, and one or more of the applications are configured to: execute the method for dynamically extending the discovery capability of the Java automatic discovery agent combined with Jython according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for dynamically extending the discovery capability of a Java automatic discovery agent combined with Jython as described in any one of claims 1 to 5 is implemented.