Software control method, system and equipment based on plug-in type DSP audio
Through the plug-in DSP audio software control method, integrated control of different audio devices on one platform is achieved, solving the problems of inconvenient operation and poor scalability in the existing technology, providing plug-and-play device adaptation and high-stability operation, and improving user experience and system reliability.
Patent Information
- Application Number
- CN202510787654.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-12
AI Technical Summary
Existing desktop DSP audio control software runs independently, making it difficult to control multiple different types of audio devices at the same time. It is inconvenient to operate and has poor scalability.
It adopts a plug-in DSP audio software control method, integrates the control software modules of different audio devices on a single platform through plug-in base class abstraction and reflective dynamic loading mechanism, supports plug-and-play, and realizes unlimited expansion of device types through dynamic enumeration dictionary and factory mapping technology.
It realizes the integrated control of multiple DSP audio devices on a single software platform, improves software scalability, reduces device adaptation cycle, ensures stable operation in high-continuity scenarios, reduces memory peak, eliminates the risk of audio interruption, and improves user interaction experience and system reliability.
Smart Images

Figure CN120631325A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio program control, and in particular to a software control method, system and device based on plug-in DSP audio. Background Art
[0002] Currently, in desktop DSP audio control applications, most software runs independently. For example, one software controls one or several audio devices. When many different types of audio devices need to be controlled simultaneously, multiple software programs need to be opened, which is extremely inconvenient and has poor software scalability. Summary of the Invention
[0003] The purpose of the present invention is to provide a software control method, system and device based on plug-in DSP audio, so that different DSP audio control software can be integrated into a software platform, and new device control software modules can be subsequently integrated into the software platform as a plug-in, so that all devices can be controlled by one set of software, and the software has good scalability, aiming to solve the problems in the existing technology.
[0004] The present invention is implemented as follows: a software control method based on plug-in DSP audio is applied to electronic equipment, specifically comprising the following steps: S101: Receive a definition request for the base class PluginBase, request the definition of the abstract plug-in base class PluginBase and declare the plug-in feature parameter method. When developing a specific audio plug-in, inherit PluginBase and implement its abstract method. Each plug-in is compiled into an independent DLL dynamic library. By adding the [ExportAttribute] attribute to the plug-in main interface class, it is marked as an exportable module to complete the plug-in function encapsulation. S102: Create a component type enumeration, assign a unique identifier to each DSP audio device type, and when starting the software platform, scan all DLL files in the specified disk directory and select valid plug-in files containing the [ExportAttribute] attribute; S103: Dynamically load each plug-in DLL through the reflection mechanism, parse its metadata and identify the export class carrying [ExportAttribute], map the enumeration value of the component type enumeration with the corresponding plug-in factory object, generate a global dictionary ViewFactoryDic and store it in memory; S104: When the user requests to operate a specific type of DSP device, an enumeration identifier is obtained from the component type enumeration according to the device type, the identifier is used as a key to query the dictionary, the target plug-in factory object is located, and the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase; S105: Call the device characteristic parameter method through the plug-in instance to establish IP communication with the DSP device, exclusive control GUI and upload preset audio scene parameters, or obtain the current scene configuration of the device. After the acquisition is completed, the connection with the DSP device is disconnected.
[0005] Furthermore, a definition request for the base class PluginBase is received, requesting the definition of the abstract plug-in base class PluginBase and declaring the plug-in feature parameter method, wherein the plug-in feature parameter method includes: plug-in title attributes, device IP attributes, main interface attributes, default scene upload method, default scene acquisition method, device connection method and disconnection method.
[0006] Furthermore, in the plug-in feature parameter method: The IP attribute is defined as a readable and writable string used to store the network address of the target DSP device; The main interface properties require returning a control object inherited from the UI framework base class; The default scene upload method requires serializing audio scene parameters and sending them to the device via TCP / UDP protocol; The default scene acquisition method needs to parse the audio scene data packet returned by the device and convert it into the platform's internal data structure; The specific plug-in needs to handle the device authentication protocol when implementing the device connection method and release the network socket and buffer resources in the disconnection method; The DLL export interface of each plug-in must contain a version number and compatibility check field to ensure binary compatibility with the platform main program.
[0007] Furthermore, mark the plug-in main interface class as an exportable module by adding the [ExportAttribute] attribute to it, including: Define the attribute class ExportAttribute and inherit it from System.Attribute. Its constructor receives the enumeration parameter of the component type enumeration to bind the device type. The attribute class ExportAttribute contains the plug-in name, manufacturer ID, and minimum platform version number attributes; The compiler writes this feature information into the assembly metadata when generating the plug-in DLL; The plug-in loading module extracts feature data through dynamic loading and security verification of reflective plug-ins, verifies the version compatibility of the plug-in and the platform, and refuses to load if there is a version conflict.
[0008] Furthermore, in S102, when the software platform is started, all DLL files in the specified disk directory are scanned, including: Specify the disk directory path as the \Plugins\AudioDSP subfolder under the platform installation directory; Use the file system monitor to monitor the DLL addition and deletion events in the directory in real time; When loading, the SHA-256 hash value of each DLL is calculated and compared with the whitelist to prevent unsigned plug-ins from loading. The component type enumeration includes at least the following device types: mixer, effector, amplifier controller, matrix processor, and audio capture card.
[0009] Furthermore, in S104, the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase, including: The user request originates from the node selection event of the platform device tree control, and the node data is bound to the component type enumeration value. The dictionary query operation uses the plug-in instantiation high-reliability access method to match the key value. If no match is found, a PluginNotFoundException is thrown. The instantiation process calls the dynamic instantiation method of the plug-in of the factory class. The dynamic instantiation method of the plug-in class executes the constructor of the plug-in class to initialize the device IP and load the local configuration; The generated plug-in instance is injected into the control container of the platform main window and displayed as a floating window.
[0010] Furthermore, in S105, the device characteristic parameter method is called through the plug-in instance to establish IP communication with the DSP device, a dedicated control GUI, and upload preset audio scene parameters, including: When the device connection method is executed, it first checks the validity of the device's IP address, then creates a background thread to establish a socket connection. After the connection is successful, it starts the heartbeat packet monitoring thread and sends status query instructions every 5 seconds. The default scene upload method encodes the platform's internal EQ parameters, routing configuration, and dynamic range data into a device-specific binary protocol, compresses it with Zlib, and transmits it in fragments. When the connection is disconnected, a device status snapshot is saved and all audio and video buffer resources are released. The default scene acquisition method sends the SCENE_QUERY command to the device, parses the returned JSON data packet and maps it to a platform scene object. The scene data packet contains a three-level structure: device basic information layer, channel configuration layer, and DSP parameter layer. When uploading the scene, a differential synchronization strategy is adopted, and only the modified parameter block is transmitted.
[0011] Compared with the prior art, the software control method, system and device based on plug-in DSP audio provided by the present invention have the following beneficial effects: 1. This technology provides a plug-in DSP audio control application architecture concept, which integrates different DSP audio control software into a single software platform. In addition, new device control software modules can be integrated into the software platform as plug-ins in the future, so that all devices can be controlled by one set of software, and the software has good scalability.
[0012] 2. Through the dual evolution of architectural innovation and operational control, it has brought revolutionary breakthroughs to the field of DSP audio software. At the system architecture level, the pioneering plug-in base class abstraction and reflective dynamic loading mechanism completely reconstruct the traditional tightly coupled device control model. No need to modify the core platform code, only inheriting the standardized base class to develop independent plug-ins can achieve plug-and-play support for new devices, reducing the device adaptation cycle from weeks to hours. The platform uses dynamic enumeration dictionary and factory mapping technology to achieve unlimited scalability of device types. At the same time, the on-demand loading mechanism significantly optimizes resource usage, reducing memory peaks in scenarios with thousands of device libraries. In addition, the file monitor-driven hot update technology completely eliminates the need for system downtime for upgrades, ensuring stable 24 / 7 operation in high-continuity scenarios such as broadcast centers and performance venues. 3. In terms of audio control, a three-in-one control system has been established, featuring precise protocol synchronization, intelligent interface adaptation, and active security defense. A differential parameter transmission strategy is adopted during scene switching, compressing traditional second-level delays to milliseconds, completely eliminating the risk of audio interruption in performance scenes. Device parameter readback ensures 100% configuration capture accuracy through multi-layer structured analysis. In terms of security protection, digital signature authentication and device heartbeat monitoring form a dual defense barrier, achieving a qualitative leap in user interaction experience. The synergistic effect of abnormality capture and disconnection self-healing mechanism has increased the system's mean time between failures to over 10,000 hours, providing rock-solid technical support for professional audio engineering.
[0013] A software control system based on plug-in DSP audio is used to execute the above-mentioned software control method, and the software control system includes: The plug-in development module provides an abstract plug-in base class, PluginBase, which declares plug-in title properties, device IP properties, main interface properties, default scene upload methods, default scene acquisition methods, device connection methods, and disconnection methods. Multiple independently compiled DLL dynamic libraries serve as specific audio plug-ins. Each plug-in includes a main interface class that inherits PluginBase and implements its abstract methods. The main interface class is marked as an exportable module using the [ExportAttribute] attribute. Plug-in loading module: contains a predefined component type enumeration for identifying different DSP device types; the module integrates a file scanner, a reflection engine, and a dictionary memory. When started, it scans the DLL files in the specified directory, extracts the export classes with [ExportAttribute] through reflection, and constructs a global dictionary ViewFactoryDic that maps the enumeration values of the component type enumeration to the plug-in factory object; Running platform module: includes device management interface, GUI rendering engine and communication protocol stack; when the user selects the target device type, the ViewFactoryDic dictionary is queried according to the enumeration value to obtain the corresponding factory object, a plug-in instance is generated and injected into the platform interface container, an IP connection with the DSP device is established through the device connection method of the plug-in instance, the default scene upload method or the default scene acquisition method is called to perform audio scene synchronization, the device-specific control panel is rendered using the main interface properties, and the device resources are released through the disconnection method after the operation is completed.
[0014] The plug-in loading module includes: Dynamic monitoring unit: Integrates FileSystemWatcher file system monitor to monitor DLL file change events in the plug-in directory in real time; Security verification unit: Calculates the SHA-256 hash value of the scanned DLL file, compares it with the pre-stored digital signature whitelist, and blocks unauthorized plug-in loading; Hot update unit: When a new DLL is detected or updated, it unloads the old version of the assembly and reloads the new version, and sends a PluginReloaded notification to the platform through the event bus; Error handling unit: Captures the ReflectionTypeLoadException exception when reflection loading fails, records the error log and triggers the platform alarm interface.
[0015] A software control device based on plug-in DSP audio includes a storage device and a processor. The storage device is used to store a computer program. The processor runs the computer program to enable the software control device to execute the software control method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic flow chart of the software control method based on plug-in DSP audio proposed by the present invention; Figure 2 This is a schematic block diagram of the process of calling the instantiation feature parameter method of the factory object in the software control method based on plug-in DSP audio proposed by the present invention to generate a specific plug-in instance that inherits PluginBase; Figure 3This is a schematic diagram of the structure of the software control system based on plug-in DSP audio proposed by the present invention; Figure 4 This is a software operation control logic diagram of the software control system based on plug-in DSP audio proposed by the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0018] The implementation of the present invention is described in detail below with reference to specific embodiments.
[0019] The same or similar numbers in the drawings of this embodiment correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "up", "down", "left", "right", etc. indicate directions or positional relationships, they are based on the directions or positional relationships shown in the drawings. This is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0020] Reference Figure 1-2 As shown, the software control method based on plug-in DSP audio is applied to electronic equipment and specifically includes the following steps: S101: Receive a definition request for the base class PluginBase, request the definition of the abstract plug-in base class PluginBase and declare the plug-in feature parameter method. When developing a specific audio plug-in, inherit PluginBase and implement its abstract method. Each plug-in is compiled into an independent DLL dynamic library. By adding the [ExportAttribute] attribute to the plug-in main interface class, it is marked as an exportable module to complete the plug-in function encapsulation. Among them, a definition request for the base class PluginBase is received, requesting the definition of the abstract plug-in base class PluginBase and declaring the plug-in feature parameter method. The plug-in feature parameter method includes: plug-in title attribute, device IP attribute, main interface attribute, default scene upload method, default scene acquisition method, device connection method and disconnection method; and in the plug-in feature parameter method: The IP attribute is defined as a readable and writable string used to store the network address of the target DSP device; The main interface properties require returning a control object inherited from the UI framework base class; The default scene upload method requires serializing audio scene parameters and sending them to the device via TCP / UDP protocol; The default scene acquisition method needs to parse the audio scene data packet returned by the device and convert it into the platform's internal data structure; The specific plug-in needs to handle the device authentication protocol when implementing the device connection method and release the network socket and buffer resources in the disconnection method; Each plug-in's DLL export interface must include a version number and compatibility check fields to ensure binary compatibility with the platform's main program; S102: Create a component type enumeration, assign a unique identifier to each DSP audio device type, and when starting the software platform, scan all DLL files in the specified disk directory and select valid plug-in files containing the [ExportAttribute] attribute; When the software platform is started, all DLL files in the specified disk directory are scanned, including: Specify the disk directory path as the \Plugins\AudioDSP subfolder under the platform installation directory; Use the file system monitor to monitor the DLL addition and deletion events in the directory in real time; When loading, the SHA-256 hash value of each DLL is calculated and compared with the whitelist to prevent unsigned plug-ins from loading. The component type enumeration includes at least the following device types: mixer, effector, amplifier controller, matrix processor, and audio capture card. S103: Dynamically load each plug-in DLL through the reflection mechanism, parse its metadata and identify the export class with [ExportAttribute], map the enumeration value of the component type enumeration with the corresponding plug-in factory object, generate a global dictionary ViewFactoryDic and store it in memory; use Assembly.LoadFrom to dynamically load the DLL assembly; obtain the class type marked with [ExportAttribute] through Type.GetType; call Activator.CreateInstance to create a plug-in factory class instance, which implements the IPluginFactory interface and contains the CreatePlugin method; the dictionary ViewFactoryDic uses a thread-safe ConcurrentDictionary<Enum_ComponentType,IPluginFactory> Implementation, support for multi-threaded concurrent access; generate error logs and trigger platform notification events when loading fails; S104: When the user requests to operate a specific type of DSP device, an enumeration identifier is obtained from the component type enumeration according to the device type, the identifier is used as a key to query the dictionary, the target plug-in factory object is located, and the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase; Among them, the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase, including: The user request originates from the node selection event of the platform device tree control, and the node data is bound to the component type enumeration value. The dictionary query operation uses the plug-in instantiation high-reliability access method to match the key value. If no match is found, a PluginNotFoundException is thrown. The instantiation process calls the dynamic instantiation method of the plug-in of the factory class. The constructor of the plug-in class is executed internally in the dynamic instantiation method to initialize the device IP and load the local configuration. The generated plug-in instance is injected into the control container of the platform main window and displayed as a floating window; S105: Calling the device characteristic parameter method through the plug-in instance establishes IP communication with the DSP device, a dedicated control GUI, and uploads preset audio scene parameters, or obtains the device's current scene configuration. After the acquisition is completed, the connection with the DSP device is completed and disconnected. Through the dual evolution of architectural innovation and operational control, it has brought revolutionary breakthroughs to the field of DSP audio software. At the system architecture level, the pioneering plug-in base class abstraction and reflective dynamic loading mechanism completely reconstruct the traditional tightly coupled device control model. No need to modify the platform core code, only inheriting the standardized base class to develop independent plug-ins can achieve plug-and-play support for new devices, shortening the device adaptation cycle from weeks to hours. The platform uses dynamic enumeration dictionary and factory mapping technology to achieve unlimited scalability of device types. At the same time, the on-demand loading mechanism significantly optimizes resource usage, reducing memory peaks in scenarios with thousands of device libraries. In addition, the file monitor-driven hot update technology completely eliminates the need for system downtime upgrades, ensuring stable 24 / 7 operation in high-continuity scenarios such as broadcast centers and performance venues.
[0021] In S101 of this embodiment, the [ExportAttribute] attribute is added to the plug-in main interface class to mark it as an exportable module, including: Define the attribute class ExportAttribute and inherit it from System.Attribute. Its constructor receives the enumeration parameter of the component type enumeration to bind the device type. The attribute class ExportAttribute contains the plug-in name, manufacturer ID, and minimum platform version number attributes; The compiler writes this feature information into the assembly metadata when generating the plug-in DLL; The plug-in loading module extracts feature data through dynamic loading and security verification of reflective plug-ins, verifies the version compatibility of the plug-in and the platform, and refuses to load if there is a version conflict.
[0022] In S105 of this embodiment, the device characteristic parameter method is called through the plug-in instance to establish IP communication with the DSP device, a dedicated control GUI, and upload preset audio scene parameters, including: When the device connection method is executed, it first checks the validity of the device's IP address, then creates a background thread to establish a socket connection. After the connection is successful, it starts the heartbeat packet monitoring thread and sends status query instructions every 5 seconds. The default scene upload method encodes the platform's internal EQ parameters, routing configuration, and dynamic range data into a device-specific binary protocol, compresses it with Zlib, and transmits it in fragments. When the connection is disconnected, a device status snapshot is saved and all audio and video buffer resources are released. The default scene acquisition method sends the SCENE_QUERY command to the device, parses the returned JSON data packet and maps it to the platform scene object. The scene data packet contains a three-level structure: device basic information layer, channel configuration layer, and DSP parameter layer. When uploading the scene, a differential synchronization strategy is adopted, and only the modified parameter block is transmitted. This technology provides a plug-in DSP audio control application architecture idea, which enables different DSP audio control software to be integrated into a software platform. In the future, the new device control software module can be integrated into the software platform as a plug-in, so that all devices can be controlled by one set of software, and the software has good scalability.
[0023] Through the dual evolution of architectural innovation and operational control, it has brought revolutionary breakthroughs to the field of DSP audio software. At the system architecture level, the pioneering plug-in base class abstraction and reflective dynamic loading mechanism have completely reconstructed the traditional tightly coupled device control model. No need to modify the platform core code, only inheriting the standardized base class to develop independent plug-ins can achieve plug-and-play support for new devices, reducing the device adaptation cycle from weeks to hours. The platform uses dynamic enumeration dictionary and factory mapping technology to achieve unlimited scalability of device types. At the same time, the on-demand loading mechanism significantly optimizes resource usage, reducing memory peaks in scenarios with thousands of device libraries. In addition, the file monitor-driven hot update technology completely eliminates the need for system downtime upgrades, ensuring stable 24 / 7 operation in high-continuity scenarios such as broadcast centers and performance venues. In the audio control dimension, a control system integrating precise protocol synchronization, intelligent interface adaptation, and active security defense has been established. A differential parameter transmission strategy is adopted during scene switching to compress the traditional second-level delay to millisecond level, completely eliminating the risk of audio interruption in performance scenes. Device parameter readback ensures 100% configuration capture accuracy through multi-layer structured analysis. In terms of security protection, digital signature authentication and device heartbeat monitoring build a double defense barrier, achieving a qualitative leap in user interaction experience. The synergistic effect of abnormal capture and disconnection self-healing mechanism has increased the system's average failure-free time to over 10,000 hours, providing rock-solid technical support for professional audio engineering.
[0024] When the ConnectDevice() method is executed, it first checks the validity of the device's IP address and then creates a background thread to establish a Socket connection. After a successful connection, the heartbeat packet monitoring thread is started, sending status query instructions every 5 seconds. The audio scene upload method UploadDefaultScene() encodes the platform's internal EQ parameters, routing configuration, and dynamic range data into a device-specific binary protocol, compresses it using Zlib, and transmits it in fragments. When disconnecting, a device status snapshot is saved and all audio and video buffer resources are released.
[0025] In S105 of this embodiment, audio scene management includes: the default scene acquisition method GetDefaultScene sends a SCENE_QUERY instruction to the device, parses the returned JSON data packet and maps it to a platform scene object; the scene data packet contains a three-level structure: a device basic information layer (firmware version, sampling rate), a channel configuration layer (input / output matrix, mute status), and a DSP parameter layer (filter coefficients, delay time, dynamic threshold); a differential synchronization strategy is adopted when uploading the scene, and only the modified parameter blocks are transmitted.
[0026] Specifically, the main interface rendering in S105 includes: the control object returned by the plug-in main interface properties must implement the IDSPControlView interface, which defines the waveform display area, parameter adjustment panel, and device status indicator components; the platform main program passes the device control handle to the interface control through dependency injection; when the control is initialized, it automatically loads the device preset library and generates a frequency response curve; when the user operates the interface control, the audio parameter modification method of the plug-in base class is called in real time to trigger the device parameter update; It also includes a dynamic plug-in update mechanism: when the DLL file in the plug-in directory changes, the file system monitor triggers the OnPluginChanged event; the loading module unloads the old version of the assembly and releases related resources, and reloads the new version of the DLL; during the update process, instantiation requests for the plug-in are blocked; after the update is complete, a PluginReloaded message is sent to the platform event bus. After receiving the message, the existing plug-in instance automatically reestablishes the connection and restores the status data.
[0027] Reference Figure 3-4 As shown, a software control system based on plug-in DSP audio is used to execute the above-mentioned software control method. The software control system includes: a plug-in development module, which is used to provide an abstract plug-in base class PluginBase, which declares plug-in title properties, device IP properties, main interface properties, default scene upload method, default scene acquisition method, device connection method and disconnection method; multiple independently compiled DLL dynamic libraries as specific audio plug-ins, each plug-in contains a main interface class that inherits PluginBase and implements its abstract method, and the main interface class is marked as an exportable module through the [ExportAttribute] feature; a plug-in loading module: contains a predefined component type enumeration for identifying different DSP device types; the module integrates a file scanner, a reflection engine and a dictionary memory, scans the DLL files in the specified directory at startup, extracts the export class with [ExportAttribute] through reflection, and constructs a global dictionary ViewFactoryDic that maps the enumeration value of the component type enumeration to the plug-in factory object; a running platform module: includes a device management interface, a GUI rendering Engine and communication protocol stack. When the user selects the target device type, the ViewFactoryDic dictionary is queried based on the enumeration value to obtain the corresponding factory object. A plug-in instance is generated and injected into the platform interface container. The plug-in instance's device connection method is used to establish an IP connection with the DSP device. The default scene upload method or the default scene retrieval method is called to synchronize audio scenes. The device-specific control panel is rendered using the main interface properties. After the operation is completed, the device resources are released using the disconnect method. In the audio control dimension, a three-in-one control system is established, combining precise protocol synchronization, intelligent interface adaptation, and active security defense. A differential parameter transmission strategy is used during scene switching, reducing traditional second-level latency to milliseconds, completely eliminating the risk of audio interruption in performances. Device parameter readback uses multi-layer structured analysis to ensure 100% configuration capture accuracy. In terms of security, digital signature authentication and device heartbeat monitoring form a dual defense barrier, achieving a qualitative leap in user interaction experience. The synergistic effect of exception capture and disconnection self-healing mechanisms has increased the system's mean time between failures to over 10,000 hours, providing rock-solid technical support for professional audio engineering.
[0028] In this city's instance, the plug-in loading module includes: a dynamic monitoring unit: an integrated FileSystemWatcher file system monitor that monitors DLL file change events in the plug-in directory in real time; a security verification unit: calculating the SHA-256 hash value of the scanned DLL file, comparing it with the pre-stored digital signature whitelist, and intercepting unauthorized plug-in loading; a hot update unit: when a new DLL is detected or updated, the old version of the assembly is uninstalled and the new version is reloaded, and a PluginReloaded notification is sent to the platform through the event bus; an error handling unit: when reflection loading fails, the ReflectionTypeLoadException exception is captured, the error log is recorded, and the platform alarm interface is triggered.
[0029] A software control device based on plug-in DSP audio includes a storage device and a processor. The storage device is used to store a computer program. The processor runs the computer program to enable the software control device to execute the software control method described above.
[0030] This technology provides a plug-in DSP audio control application architecture concept, which integrates different DSP audio control software into a single software platform. In the future, new device control software modules can be integrated into the software platform as a plug-in, so that all devices can be controlled by one set of software. The software has good scalability and has brought revolutionary breakthroughs to the field of DSP audio software through the dual evolution of architectural innovation and operational control. At the system architecture level, the pioneering plug-in base class abstraction and reflective dynamic loading mechanism completely reconstruct the traditional tightly coupled device control mode. There is no need to modify the core code of the platform. Only by inheriting the standardized base class and developing independent plug-ins can plug-and-play support for new devices be achieved, and the device adaptation cycle can be compressed from weeks to hours.
[0031] Reference Figure 4 The system operation logic diagram is implemented by code: Define a PluginBase abstract class, the class definition is as follows, public abstract class PluginBase public abstract IPAddress DevIP { get; set;} public abstract string Title{ get; set;} public abstract Enum_ComponentType PluginType{ get; set;} public abstract UIElement MainView { get; set;} public abstract Task <bool>Connect(); public abstract void DisConnect(); Public abstract void RegisterEvent(); public abstract void UnRegisterEvent(); This abstract class defines properties such as device IP, plugin title, plugin enumeration type, module main interface, etc. It also defines methods for connecting and disconnecting devices, event registration, and unregistration. The pseudo code for the plugin enumeration definition is as follows: public enum Enum_ComponentType { Plugin1, Plugin2, Plugin3, ...... Plugin1000 } For each specific plugin add Export and ExportMetadata properties, such as: [Export(typeof(PluginBase))] [ExportMetadata("PluginType", Enum_ComponentType.Plugin1)] public class Plugin1:PluginBase { ...... } Next, add the plug-in loading module. First, all plug-ins are placed in a folder. Then the plug-in loading module obtains the path of each plug-in through Directory.GetFiles (folder path), and then obtains the plug-in assembly through Assembly.LoadFrom (filepath). Through CompositionContainer, ViewFactoryDic is created, and the plug-in is instantiated through ViewFactoryDic. After obtaining the plug-in instance, the title of each plug-in is placed in a collection and displayed in the left menu bar. When the left menu bar is clicked, the specific plug-in main interface is loaded into the right interface display bar, thus achieving the plug-in loading effect. The pseudo code is as follows: public static class PluginLoader { [Export("extViewPlugins")] [ImportMany(typeof(PluginBase))] public IEnumerable<ExportFactory<PluginBase, IDictionary<string, object>>>ExtViewPlugins { get; set;} private static readonly string ModulesFilePath = " / Plugins / "; public static Dictionary<Enum_ComponentType, ExportFactory<IPluginBase, IDictionary<string, object>>>ViewFactoryDic { get; set;} public static void LoadPluginFactory() { var filePaths = Directory.GetFiles(ModulesFilePath); var catalogModules = new AggregateCatalog(); foreach (var filepath in filePaths) { var assembly = Assembly.LoadFrom(filepath); catalogModules.Catalogs.Add(new AssemblyCatalog(assembly)); } var aggregateCatalog = new AggregateCatalog(catalogModules); var container = new CompositionContainer(aggregateCatalog); if (ViewFactoryDic == null) { var exportFactories = container.GetExportedValue <IEnumerable<ExportFactory<PluginBase, IDictionary<string, object> >>>("extViewPlugins"); ViewFactoryDic = new Dictionary <Enum_ComponentType,ExportFactory<IPluginBase, IDictionary<string, object> >>(); foreach (var factory in exportFactories) { IDictionary<string, object> metadata =factory.Metadata; if (metadata != null) { ViewFactoryDic[(Enum_ComponentType)metadata[MetadataKey]] = factory; } } } } } Each plug-in inherits and implements PluginBase based on its own functionality. The main program doesn't need to worry about how each plug-in is implemented; it only needs to call the abstract class method and display the control interface. This enables dynamic loading of plug-ins, allowing for easy integration of various DSP device control software functions with just one software platform. For subsequent new device control applications, simply inherit and implement the PluginBase abstract class, compile it into a DLL, and seamlessly integrate it into the software platform. This allows for strong scalability, and unneeded functionality can be added by removing DLLs, enabling a single software platform to control multiple devices.
[0032] In this embodiment, the entire operation process can be controlled by a computer to provide signal feedback to implement the steps in sequence. These are all conventional knowledge of current automated control and will not be described in detail in this embodiment.
[0033] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.< / bool>
Claims
1. A software control method based on plug-in DSP audio, characterized in that: Applied to electronic equipment, specifically including the following steps: S101: Receive a definition request for the base class PluginBase, request the definition of the abstract plug-in base class PluginBase and declare the plug-in feature parameter method. When developing a specific audio plug-in, inherit PluginBase and implement its abstract method. Each plug-in is compiled into an independent DLL dynamic library. By adding the [ExportAttribute] attribute to the plug-in main interface class, it is marked as an exportable module to complete the plug-in function encapsulation. S102: Create a component type enumeration, assign a unique identifier to each DSP audio device type, and when starting the software platform, scan all DLL files in the specified disk directory and select valid plug-in files containing the [ExportAttribute] attribute; S103: Dynamically load each plug-in DLL through the reflection mechanism, parse its metadata and identify the export class carrying [ExportAttribute], map the enumeration value of the component type enumeration with the corresponding plug-in factory object, generate a global dictionary ViewFactoryDic and store it in memory; S104: When the user requests to operate a specific type of DSP device, an enumeration identifier is obtained from the component type enumeration according to the device type, the identifier is used as a key to query the dictionary, the target plug-in factory object is located, and the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase; S105: Call the device characteristic parameter method through the plug-in instance to establish IP communication with the DSP device, exclusive control GUI and upload preset audio scene parameters, or obtain the current scene configuration of the device. After the acquisition is completed, the connection with the DSP device is disconnected.
2. The software control method based on plug-in DSP audio according to claim 1, wherein: In S101, a definition request for the base class PluginBase is received, requesting the definition of the abstract plug-in base class PluginBase and declaring the plug-in feature parameter method, wherein the plug-in feature parameter method includes: plug-in title attribute, device IP attribute, main interface attribute, default scene upload method, default scene acquisition method, device connection method and disconnection method.
3. The software control method based on plug-in DSP audio according to claim 2, wherein: In the plugin feature parameter method: The IP attribute is defined as a readable and writable string used to store the network address of the target DSP device; The main interface properties require returning a control object inherited from the UI framework base class; The default scene upload method requires serializing audio scene parameters and sending them to the device via TCP / UDP protocol; The default scene acquisition method needs to parse the audio scene data packet returned by the device and convert it into the platform's internal data structure; The specific plug-in needs to handle the device authentication protocol when implementing the device connection method and release the network socket and buffer resources in the disconnection method; The DLL export interface of each plug-in must contain a version number and compatibility check field to ensure binary compatibility with the platform main program.
4. The software control method based on plug-in DSP audio according to claim 3, wherein: Mark the plug-in main interface class as an exportable module by adding the [ExportAttribute] attribute to it, including: Define the attribute class ExportAttribute and inherit it from System.Attribute. Its constructor receives the enumeration parameter of the component type enumeration to bind the device type. The attribute class ExportAttribute contains the plug-in name, manufacturer ID, and minimum platform version number attributes; The compiler writes this feature information into the assembly metadata when generating the plug-in DLL; The plug-in loading module extracts feature data through dynamic loading and security verification of reflective plug-ins, verifies the version compatibility of the plug-in and the platform, and refuses to load if there is a version conflict.
5. The software control method based on plug-in DSP audio according to claim 4, characterized in that, In S102, when the software platform is started, all DLL files in the specified disk directory are scanned, including: Specify the disk directory path as the \Plugins\AudioDSP subfolder under the platform installation directory; Use the file system monitor to monitor the DLL addition and deletion events in the directory in real time; When loading, the SHA-256 hash value of each DLL is calculated and compared with the whitelist to prevent unsigned plug-ins from loading. The component type enumeration includes at least the following device types: mixer, effector, amplifier controller, matrix processor, and audio capture card.
6. The software control method based on plug-in DSP audio according to claim 5, characterized in that: In S104, the instantiation feature parameter method of the factory object is called to generate a specific plug-in instance that inherits PluginBase, including: The user request originates from the node selection event of the platform device tree control, and the node data is bound to the component type enumeration value. The dictionary query operation uses the plug-in instantiation high-reliability access method to match the key value. If no match is found, a PluginNotFoundException is thrown. The instantiation process calls the dynamic instantiation method of the plug-in of the factory class. The dynamic instantiation method of the plug-in class executes the constructor of the plug-in class to initialize the device IP and load the local configuration; The generated plug-in instance is injected into the control container of the platform main window and displayed as a floating window.
7. The software control method based on plug-in DSP audio according to claim 6, characterized in that: In S105, the device characteristic parameter method is called through the plug-in instance to establish IP communication with the DSP device, a dedicated control GUI, and upload preset audio scene parameters, including: When the device connection method is executed, it first checks the validity of the device's IP address, then creates a background thread to establish a socket connection. After the connection is successful, it starts the heartbeat packet monitoring thread and sends status query instructions every 5 seconds. The default scene upload method encodes the platform's internal EQ parameters, routing configuration, and dynamic range data into a device-specific binary protocol, compresses it with Zlib, and transmits it in fragments. When the connection is disconnected, a device status snapshot is saved and all audio and video buffer resources are released. The default scene acquisition method sends the SCENE_QUERY command to the device, parses the returned JSON data packet and maps it to a platform scene object. The scene data packet contains a three-level structure: device basic information layer, channel configuration layer, and DSP parameter layer. When uploading the scene, a differential synchronization strategy is adopted, and only the modified parameter block is transmitted.
8. A software control system based on plug-in DSP audio, characterized in that: Used to execute the software control method according to any one of claims 1 to 7, the software control system comprising: The plug-in development module provides an abstract plug-in base class, PluginBase, which declares plug-in title properties, device IP properties, main interface properties, default scene upload methods, default scene acquisition methods, device connection methods, and disconnection methods. Multiple independently compiled DLL dynamic libraries serve as specific audio plug-ins. Each plug-in includes a main interface class that inherits PluginBase and implements its abstract methods. The main interface class is marked as an exportable module using the [ExportAttribute] attribute. The plug-in loading module contains a predefined component type enumeration for identifying different DSP device types. The module integrates a file scanner, a reflection engine, and a dictionary memory. When started, it scans the DLL files in the specified directory, extracts the export classes with [ExportAttribute] through reflection, and constructs a global dictionary ViewFactoryDic that maps the enumeration values of the component type enumeration to the plug-in factory object. Run the platform module, including the device management interface, GUI rendering engine and communication protocol stack; when the user selects the target device type, query the ViewFactoryDic dictionary according to the enumeration value to obtain the corresponding factory object, generate a plug-in instance and inject it into the platform interface container, establish an IP connection with the DSP device through the device connection method of the plug-in instance, call the default scene upload method or the default scene acquisition method to perform audio scene synchronization, use the main interface properties to render the device-specific control panel, and release device resources through the disconnection method after the operation is completed.
9. The software control system based on plug-in DSP audio according to claim 8, characterized in that: The plug-in loading module includes: Dynamic monitoring unit: Integrates FileSystemWatcher file system monitor to monitor DLL file change events in the plug-in directory in real time; Security verification unit: Calculates the SHA-256 hash value of the scanned DLL file, compares it with the pre-stored digital signature whitelist, and blocks unauthorized plug-in loading; Hot update unit: When a new DLL is detected or updated, it unloads the old version of the assembly and reloads the new version, and sends a PluginReloaded notification to the platform through the event bus; Error handling unit: Captures the ReflectionTypeLoadException exception when reflection loading fails, records the error log and triggers the platform alarm interface.
10. A software-controlled device based on plug-in DSP audio, characterized in that: The software control device comprises a storage device and a processor, wherein the storage device is used to store a computer program, and the processor runs the computer program to enable the software control device to execute the software control method according to any one of claims 1 to 7.
Citation Information
Cited By
Audio host control method and device, computer equipment and readable storage medium
CN121888164A
MRI sequence generation system and method
CN121918805A