Matlab driver loading method and device, storage medium and electronic equipment
By obtaining and loading the Matlab configuration file, the Matlab driver library is dynamically loaded, which solves the problem of Matlab version incompatibility, improves the compatibility and integration of different versions, and meets the computing needs of JAVA projects.
Patent Information
- Application Number
- CN202410689145.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-09-17
AI Technical Summary
In the existing technology, the underlying driver library of the Matlab version is incompatible, which makes it difficult to use programs between different versions and has extremely poor compatibility.
By obtaining the configuration file, including Matlab's shared session name and driver path, the Matlab driver library is loaded, and the compatibility of different versions of Matlab is achieved using a method similar to a dynamic library, allowing dynamic loading and switching of different Matlab versions in JAVA projects.
It achieves compatibility of different Matlab versions, allowing you to easily manage and switch different versions of driver libraries in JAVA projects without relying on the Matlab version installed in the system, ensuring integration and compatibility with JAVA and providing greater flexibility. and selectivity.
Smart Images

Figure CN118656144A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a Matlab driver loading method, a Matlab driver loading device, a machine-readable storage medium and an electronic device. Background Art
[0002] Matlab is a powerful mathematical computing software, especially suitable for tasks such as control system modeling, simulation, optimization, and parameter identification. Through Matlab's Simulink module, Simulink is a block diagram environment for multi-domain simulation and model-based design. Users can use a graphical interface to model the system and simulate the system to verify its performance, which greatly improves the efficiency and reliability of control system design. JAVA, as a general programming language, has good scalability and maintainability, and performs well in processing complex control logic and data structures in industrial control systems. Therefore, JAVA calling Matlab can realize the rapid implementation and verification of algorithms and models in industrial control systems.
[0003] Please see Figure 2 , Figure 2 The schematic diagram of static library loading in the prior art is schematically shown. The traditional method of JAVA calling Matlab is to introduce the underlying driver library of Matlab into the project through the project management tool (maven), package it into a jar package, and run it on the JAVA virtual machine (Java Virtual Machine, JVM) through the JAVA runtime environment (Java Runtime Environment, JRE). This method is similar to the static library (.lib) of the windows operating system or the .a library of the linux operating system.
[0004] However, since there are many versions of Matlab, the underlying driver libraries are not compatible. Therefore, the program compiled in the static library mode is difficult to be used between different versions of Matlab, and the portability is extremely poor. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a Matlab driver loading method, a Matlab driver loading device, a machine-readable storage medium and an electronic device. The Matlab driver loading method can realize the loading of different versions of Matlab, thereby improving compatibility.
[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a Matlab driver loading method, comprising:
[0007] Obtain a configuration file, the configuration file including a shared session name and a driver path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path;
[0008] Based on the configuration file, the driver library of Matlab is loaded.
[0009] In the embodiment of the present application, the loading of the Matlab driver library based on the configuration file includes:
[0010] Based on the configuration file, load the jar package corresponding to the Matlab driver library;
[0011] After the jar package corresponding to the Matlab driver library is loaded, the shared session of Matlab is connected based on the jar package and the shared session name to complete the loading of the Matlab driver library.
[0012] In the embodiment of the present application, the jar package corresponding to the Matlab driver library is loaded based on the configuration file, including:
[0013] Respectively detect whether the Matlab shared session name and driver path in the configuration file are empty;
[0014] When it is determined that the shared session name and the driver path of Matlab in the configuration file are not empty, the jar package corresponding to the driver library of Matlab is loaded based on the configuration file.
[0015] In the embodiment of the present application, the connection to the shared session of Matlab based on the jar package and the shared session name includes:
[0016] Get the function signature in the jar package;
[0017] Based on the function signature, determine to obtain a connection function;
[0018] Based on the shared session name, the connection function is used to connect the shared session of Matlab.
[0019] In an embodiment of the present application, the Matlab driver loading method further includes:
[0020] Get test variable information through the command line window to declare and write test variables to the shared session of Matlab.
[0021] In an embodiment of the present application, the Matlab driver loading method further includes:
[0022] Get the Matlab shared session name and driver path;
[0023] A configuration file is generated based on the Matlab shared session name and driver path.
[0024] In the embodiment of the present application, before obtaining the configuration file, a process of preparing the engineering environment is also included, including:
[0025] Install Matlab software in the engineering environment;
[0026] Creating a shared session in the Matlab software and determining a shared session name;
[0027] After the shared session is successfully created, the project environment preparation is completed.
[0028] A second aspect of the present application provides a Matlab driver loading device, comprising:
[0029] An acquisition module is used to acquire a configuration file, wherein the configuration file includes a shared session name and a driver path of Matlab, wherein a shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path;
[0030] A loading module is used to load the driver library of the Matlab based on the configuration file.
[0031] A third aspect of the present application provides an electronic device, the electronic device comprising:
[0032] at least one processor;
[0033] a memory connected to the at least one processor;
[0034] The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the above-mentioned Matlab driver loading method by executing the instructions stored in the memory.
[0035] A fourth aspect of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned Matlab driver loading method.
[0036] Through the above technical solution, by obtaining a configuration file, the configuration file includes a shared session name and a driving path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and the driving path stores the driving library of Matlab; based on the configuration file, the driving library of Matlab is loaded. The driver library of Matlab is loaded through the configuration file. When switching the Matlab version or increasing the version later, it can be realized by modifying the configuration file, and the Matlab driver is loaded in a manner similar to a dynamic library, so that different versions of Matlab can be loaded, and compatibility is improved. In a JAVA project, the driver library of a specific version of Matlab runtime is used, without relying on the Matlab version installed in the system, and the driver library of different versions of Matlab runtime can be easily managed and switched, thereby ensuring integration and compatibility with JAVA. This flexible integration method provides users with more choices. Users can choose the appropriate Matlab version according to project requirements, so as to better meet computing needs.
[0037] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0039] Figure 1 A schematic diagram of a process flow of a Matlab driver loading method according to an embodiment of the present application is shown;
[0040] Figure 2 The schematic diagram of static library loading in the prior art is schematically shown;
[0041] Figure 3 A schematic diagram schematically shows loading in a manner similar to a dynamic library according to an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a loading test according to an embodiment of the present application is schematically shown;
[0043] Figure 5 The structure block diagram of a Matlab driven loading device according to an embodiment of the present application is schematically shown;
[0044] Figure 6 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown.
[0045] Description of Reference Numerals
[0046] 410 - acquisition module; 420 - loading module; A01 - processor; A02 - network interface; A03 - internal memory; A04 - display screen; A05 - input device; A06 - non-volatile storage medium; B01 - operating system; B02 - computer program. DETAILED DESCRIPTION
[0047] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0048] Please see Figure 3 , Figure 3 The schematic diagram of loading in a manner similar to a dynamic library according to an embodiment of the present application is schematically shown. This embodiment provides a method for loading a Matlab driver, which uses a method similar to a dynamic library to achieve compatibility of different versions of Matlab.
[0049] Please see Figure 1 , Figure 1 The following is a schematic diagram of a process flow of a Matlab driver loading method according to an embodiment of the present application. The Matlab driver loading method comprises the following steps:
[0050] Step 210: Obtain a configuration file, the configuration file including a shared session name and a driver path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and the driver library of Matlab is stored under the driver path;
[0051] In this embodiment, the above configuration file may be pre-set, including the shared session name and driver path that need to load Matlab. The above Matlab shared session is a shared memory pre-set in Matlab for access by subsequent JAVA-side code. The above driver path is used to store the driver library of Matlab. The above shared session name and driver path can be determined after the engineering environment is prepared. It should be noted that the above shared session name and driver path can be multiple groups, each group corresponding to a Matlab version.
[0052] In some embodiments, the process of constructing the configuration file includes:
[0053] First, obtain the Matlab shared session name and driver path;
[0054] Then, a configuration file is generated based on the Matlab shared session name and driver path.
[0055] In this embodiment, after obtaining the shared session name and driver path, the information of the Matlab underlying driver library can be configured for dynamic loading and use by the JAVA program. For example, the configuration file includes:
[0056] source = Matlab
[0057] share_name=qyy
[0058] jar_url=D:\\application\\matlab\\extern\\engine\\java\\jar\\engine.jar
[0059] In the above example, share_name indicates the shared session name, jar_url indicates the driver path, engine.jar indicates the jar package corresponding to the Matlab driver library, and source indicates the corresponding Matlab version.
[0060] Generate a configuration file through Matlab's shared session name and driver path. When switching Matlab versions or adding versions later, you only need to modify the configuration file, which greatly reduces the workload and improves work efficiency.
[0061] In some embodiments, before obtaining the configuration file, a process of preparing the engineering environment is also included, including the following steps:
[0062] First, install Matlab software in the engineering environment;
[0063] Then, creating a shared session in the Matlab software and determining a shared session name;
[0064] Finally, after successfully creating a shared session, the project environment preparation is completed.
[0065] In this embodiment, the Matlab software can install the corresponding version according to actual needs, for example, install the application Matlab R2022b, then use Matlab R2022b to create a shared session and specify the session name, which can be matlab.engine.shareEngine('qyy'). Then check whether the session is successfully created. If it is confirmed that the creation is successful, it means that the engineering environment preparation is completed.
[0066] Step 220: Based on the configuration file, load the Matlab driver library.
[0067] In this embodiment, the above loading can be to use the URLClassLoader class to load external JAR files or other resource files, so as to load the external files into the JAVA application at runtime. Such a dynamic loading mechanism enables the JAVA application to load and use external resources as needed at runtime, thereby enhancing the flexibility and scalability of the program.
[0068] In some embodiments, loading the Matlab driver library based on the configuration file includes:
[0069] First, based on the configuration file, load the jar package corresponding to the Matlab driver library;
[0070] In this embodiment, the configuration file stores a Matlab driver path, under which a jar package is stored. The jar package corresponding to the Matlab driver library can be loaded by reading the path.
[0071] In order to ensure successful loading into the jar package, in some embodiments, the jar package corresponding to the Matlab driver library is loaded based on the configuration file, including:
[0072] The first step is to detect whether the Matlab shared session name and the driver path in the configuration file are empty;
[0073] The second step is to load the jar package corresponding to the Matlab driver library based on the configuration file when it is determined that the Matlab shared session name and the driver path in the configuration file are not empty.
[0074] In this embodiment, the above check can be to check whether the values corresponding to the shared session name parameter and the driver path parameter are empty respectively. Only when both values are not empty, start loading the jar package corresponding to the Matlab driver library, otherwise do not load it.
[0075] By detecting whether the Matlab shared session name and the driver path in the configuration file are empty, it can be ensured that the jar package is successfully loaded, which helps to correctly load the Matlab driver.
[0076] Then, after the jar package corresponding to the Matlab driver library is loaded, the shared session of Matlab is connected based on the jar package and the shared session name to complete the loading of the Matlab driver library.
[0077] In this embodiment, after the jar package is loaded, the shared session connection of Matlab may be initialized, and then the shared session of Matlab may be reconnected to according to the shared session name.
[0078] In some embodiments, the shared session connected to Matlab may be connected using a reflection mechanism. Specifically, the connection to the shared session of Matlab based on the jar package and the shared session name includes:
[0079] First, obtain the function signature in the jar package;
[0080] Then, based on the function signature, a connection function is determined;
[0081] Finally, based on the shared session name, the connection function is used to connect the shared session of Matlab.
[0082] In this embodiment, after loading the jar package, the function signature in the driver library can be obtained. After obtaining the connection function, the connection function and the shared session name are used to connect to the shared session, thus completing the loading of the Matlab driver.
[0083] In the above implementation process, by obtaining a configuration file, the configuration file includes a shared session name and a driving path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and the driving path stores the driving library of Matlab; based on the configuration file, the driving library of Matlab is loaded. The driver library of Matlab is loaded through the configuration file. When switching the Matlab version or adding the version later, it can be realized by modifying the configuration file, and the method of loading the Matlab driver in a manner similar to a dynamic library is adopted, so that different versions of Matlab can be loaded, and compatibility is improved. In the JAVA project, the driver library of a specific version of Matlab runtime is used, without relying on the Matlab version installed in the system, and the driver library of different versions of Matlab runtime can be easily managed and switched, thereby ensuring integration and compatibility with JAVA. This flexible integration method provides users with more choices. Users can choose the appropriate Matlab version according to project requirements to better meet computing needs.
[0084] In some embodiments, the Matlab driver loading method further includes: obtaining test variable information through a command line window to declare and write test variables into a shared session of Matlab.
[0085] In this embodiment, after loading the Matlab driver library, a test can be performed to determine whether the loading is successful. Specifically, the test variable information can be entered in the command line window of the JAVA application, and then the corresponding information input can be checked in the Matlab shared session to realize the test function. For example: please refer to Figure 4 , Figure 4 The schematic diagram of the loading test according to the embodiment of the present application is schematically shown. Declare and write the variable Arrayreal in the shared session of Matlab from JAVA. Check whether the data has been received in the workspace of Matlab. If received, it means that the loading is successful, and the subsequent Matlab algorithm can use the data for calculation. If not received, it means that the loading failed.
[0086] By obtaining the test variable information through the command line window, you can test whether the loading is successful to ensure that JAVA can successfully call Matlab.
[0087] Figure 1 FIG. 1 is a flow chart of a Matlab driver loading method in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0088] This embodiment provides a Matlab driver loading device. Figure 5 , Figure 5 The structure block diagram of a Matlab driver loading device according to an embodiment of the present application is schematically shown. The Matlab driver loading device includes an acquisition module 410 and a loading module 420, wherein:
[0089] The acquisition module 410 is used to acquire a configuration file, wherein the configuration file includes a shared session name and a driver path of Matlab, wherein the shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path;
[0090] The loading module 420 is used to load the driver library of the Matlab based on the configuration file.
[0091] The Matlab driver loading device includes a processor and a memory. The acquisition module 410 and the loading module 420 are stored in the memory as program units. The processor executes the program units stored in the memory to realize corresponding functions.
[0092] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the Matlab driver can be loaded in a similar way to a dynamic library by adjusting the kernel parameters, so that different versions of Matlab can be loaded, improving compatibility.
[0093] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0094] The embodiment of the present invention provides a machine-readable storage medium on which a program is stored. When the program is executed by a processor, the Matlab driver loading method is implemented.
[0095] An embodiment of the present invention provides a processor, which is used to run a program, wherein the Matlab driver loading method is executed when the program is running.
[0096] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected by a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a Matlab driver loading method is implemented. The display screen A04 of the computer device can be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.
[0097] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0098] In one embodiment, the Matlab driver loading device provided in the present application can be implemented in the form of a computer program. The computer program can be Figure 6 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the Matlab driver loading device, for example, Figure 5 The acquisition module 410 and the loading module 420 are shown. The computer program composed of various program modules enables the processor to execute the steps of the Matlab driver loading method of each embodiment of the present application described in this specification.
[0099] Figure 6 The computer device shown can be Figure 5 The jump code segment acquisition module 410 in the Matlab driver loading device shown executes step 210. The computer device can execute step 220 through the loading module 420.
[0100] The embodiment of the present application provides an electronic device, which includes: at least one processor; a memory connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the above-mentioned Matlab driver loading method by executing the instructions stored in the memory. When the processor executes the instructions, the following steps are implemented:
[0101] Obtain a configuration file, the configuration file including a shared session name and a driver path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path;
[0102] Based on the configuration file, the driver library of Matlab is loaded.
[0103] In one embodiment, the loading of the Matlab driver library based on the configuration file includes:
[0104] Based on the configuration file, load the jar package corresponding to the Matlab driver library;
[0105] After the jar package corresponding to the Matlab driver library is loaded, the shared session of Matlab is connected based on the jar package and the shared session name to complete the loading of the Matlab driver library.
[0106] In one embodiment, the loading of the jar package corresponding to the Matlab driver library based on the configuration file includes:
[0107] Respectively detect whether the Matlab shared session name and driver path in the configuration file are empty;
[0108] When it is determined that the shared session name and the driver path of Matlab in the configuration file are not empty, the jar package corresponding to the driver library of Matlab is loaded based on the configuration file.
[0109] In one embodiment, the connecting to the shared session of Matlab based on the jar package and the shared session name includes:
[0110] Get the function signature in the jar package;
[0111] Based on the function signature, determine to obtain a connection function;
[0112] Based on the shared session name, the connection function is used to connect the shared session of Matlab.
[0113] In one embodiment, the Matlab driver loading method further includes:
[0114] Get test variable information through the command line window to declare and write test variables to the shared session of Matlab.
[0115] In one embodiment, the Matlab driver loading method further includes:
[0116] Get the Matlab shared session name and driver path;
[0117] A configuration file is generated based on the Matlab shared session name and driver path.
[0118] In one embodiment, before obtaining the configuration file, a process of preparing the engineering environment is also included, including:
[0119] Install Matlab software in the engineering environment;
[0120] Creating a shared session in the Matlab software and determining a shared session name;
[0121] After the shared session is successfully created, the project environment preparation is completed.
[0122] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0123] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0124] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0125] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0126] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0127] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0128] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0129] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0130] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A Matlab driver loading method, characterized in that: include: Obtain a configuration file, the configuration file including a shared session name and a driver path of Matlab, the shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path; Based on the configuration file, the driver library of Matlab is loaded.
2. The Matlab driver loading method according to claim 1, characterized in that: The step of loading the Matlab driver library based on the configuration file comprises: Based on the configuration file, load the jar package corresponding to the Matlab driver library; After the jar package corresponding to the Matlab driver library is loaded, the shared session of Matlab is connected based on the jar package and the shared session name to complete the loading of the Matlab driver library.
3. The Matlab driver loading method according to claim 2, characterized in that, Based on the configuration file, loading the jar package corresponding to the Matlab driver library includes: Respectively detect whether the Matlab shared session name and driver path in the configuration file are empty; When it is determined that the shared session name and the driver path of Matlab in the configuration file are not empty, the jar package corresponding to the driver library of Matlab is loaded based on the configuration file.
4. The Matlab driver loading method according to claim 2, characterized in that: The method of connecting to the shared session of Matlab based on the jar package and the shared session name includes: Get the function signature in the jar package; Based on the function signature, determine to obtain a connection function; Based on the shared session name, the connection function is used to connect the shared session of Matlab.
5. The Matlab driver loading method according to claim 1, characterized in that: The Matlab driver loading method also includes: Get test variable information through the command line window to declare and write test variables to the shared session of Matlab.
6. The Matlab driver loading method according to claim 1, characterized in that: The Matlab driver loading method also includes: Get the Matlab shared session name and driver path; A configuration file is generated based on the Matlab shared session name and driver path.
7. The Matlab driver loading method according to claim 1, characterized in that: Before obtaining the configuration file, the process of preparing the engineering environment is also included, including: Install Matlab software in the engineering environment; Creating a shared session in the Matlab software and determining a shared session name; After the shared session is successfully created, the project environment preparation is completed.
8. A Matlab driver loading device, characterized in that: include: An acquisition module is used to acquire a configuration file, wherein the configuration file includes a shared session name and a driver path of Matlab, wherein a shared memory corresponding to the shared session name is used for JAVA access, and a driver library of Matlab is stored under the driver path; A loading module is used to load the driver library of the Matlab based on the configuration file.
9. An electronic device, characterized in that: The electronic device includes: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the Matlab driver loading method according to any one of claims 1 to 7 by executing the instructions stored in the memory.
10. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the Matlab driver loading method according to any one of claims 1 to 7.
