A method and device for adaptive adaptation of a DDOS security device based on extended SPI

CN115809088BActive Publication Date: 2026-09-11CHINA UNITECHS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211554498.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2026-09-11
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

[0003]为了解决现有技术存在的上述问题,本发明提供一种基于扩展SPI自适应适配DDOS安全设备的方法及装置,通过扩展标准的SPI,当调用某种具体的设备厂商,加载该厂商的扩展点,实现按需加载,通过扩展标准的SPI可以自定义插件实现多厂商和多版本的DDOS安全设备的纳管,并解决硬编码导致程序不灵活,加载资源耗时和资源浪费等问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115809088B_ABST
    Figure CN115809088B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for adaptively adapting DDOS security equipment based on extended SPI, wherein the method comprises the following steps: defining the interface of the DDOS security equipment and encapsulating the corresponding interface implementation class according to the service capability requirement of the DDOS security equipment, configuring the annotation on the interface implementation class, and specifying the key of the corresponding DDOS security equipment which needs to be adapted; loading the DDOS security equipment which needs to be adapted according to the current key value through the self-defined extension loader, and generating the starting method of the adapted DDOS security equipment for calling. The method and device can load the extension point of a certain manufacturer by extending the standard SPI when calling the manufacturer, realize on-demand loading, and can realize the management of multiple manufacturers and multiple versions of the DDOS security equipment through the self-defined plug-in by extending the standard SPI, and solve the problems of inflexible program, time-consuming and resource waste caused by hard coding and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of DDoS security device management, and in particular to a method and apparatus for adaptively adapting DDoS security devices based on extended SPI. Background Technology

[0002] As the number of security devices requiring management in protection projects increases, adapting to different manufacturers and versions of security devices becomes increasingly complex. Existing DDoS protection systems mostly manage DDoS security devices through configuration files or databases, requiring hard-coding of specific device protection capabilities when programs invoke them. With increasing business volume and the growing number of managed security devices, the implementation of management and protection program calls becomes increasingly complex. Service discovery through SPI (Service Provider Interface) is needed to achieve backward compatibility and enable automatic matching of corresponding device capabilities for business calls. The various abstract modules in the system often have many different implementation schemes; for example, the implementation of the cleaning module needs to be compatible with Huawei and DP devices. In object-oriented design, it is generally recommended that modules program based on interfaces, avoiding hard-coding of implementation classes. Once specific implementation classes are involved in the code, the pluggable principle is violated, requiring code modification if a different implementation needs to be replaced. To achieve module assembly without dynamically specifying implementations in the program, a service discovery mechanism is needed. The Java Development Kit (JDK), also known as the Java Interface Provider Interface, provides a mechanism for finding service implementations for a given interface. Its function is to decouple the interface from its concrete implementation, automatically construct an adaptation layer, ensure compatibility with various vendors' underlying implementations, and enable programs to automatically use imported components. This is somewhat similar to the concept of Inversion of Control (IoC), which moves assembly control outside the program. This mechanism is particularly important in modular design. The standard SPI instantiates all implementations of the extension point at once, creating objects for all implementation classes. Initializing extension implementations is time-consuming, but loading unused implementations is wasteful of resources, meaning it cannot achieve on-demand loading. Therefore, the standard SPI needs to traverse all implementations, instantiate them, and then find the required implementation in a loop. Furthermore, the JDK configuration file simply lists all extension implementations without naming them, making it difficult to accurately reference them in the program. For these reasons, the native JDK SPI needs to be extended to solve the problems mentioned above. Summary of the Invention

[0003] To address the aforementioned problems in existing technologies, this invention provides a method and apparatus for adaptively adapting to DDoS security devices based on extended SPI. By extending the standard SPI, when a specific device manufacturer is called, the manufacturer's extension points are loaded, achieving on-demand loading. Through the extended standard SPI, custom plugins can be used to manage DDoS security devices from multiple manufacturers and versions, and the problems of inflexible programs, time-consuming loading of resources, and resource waste caused by hard coding are solved.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] In one embodiment of the present invention, a method for adaptively adapting to DDoS security devices based on extended SPI is proposed, the method comprising:

[0006] Based on the service capability requirements of the DDoS security device, define the interface of the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device that needs to be adapted.

[0007] By using a custom extension loader, the corresponding DDoS security device that needs to be adapted is loaded according to the current key value, and the method to enable the adapted DDoS security device is generated for invocation.

[0008] Furthermore, when adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

[0009] Furthermore, define the interface for the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device to be adapted, including:

[0010] Define the interface that the call capability module adapts to in the application, as well as the corresponding interface implementation class name and parameters, and create the configuration file path in the resource directory of the call capability module where the interface is located;

[0011] Create a configuration file in this path. The key of the configuration file is the English abbreviation of the DDoS security device that needs to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the DDoS security device that needs to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

[0012] Furthermore, through a custom extension loader, based on the current key value, the corresponding DDoS security device that needs to be adapted is loaded, and the method for enabling the adapted DDoS security device is generated for invocation, including:

[0013] By using a custom extension loader, the corresponding DDoS security device that needs to be adapted can be loaded based on the current key value;

[0014] Iterate through the interface implementation classes corresponding to the interfaces that need to be adapted to DDoS security devices;

[0015] Determine whether the interface implementation class has at least one annotation configured;

[0016] If the interface implementation class is configured with at least one annotation, then code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class are generated. The instantiation is completed through compilation and loading, thereby generating the appropriate DDOS security device start method for calling.

[0017] If the interface implementation class does not have any annotations configured, then exception code will be generated.

[0018] In one embodiment of the present invention, a device for adaptively adapting to a DDoS security device based on extended SPI is also proposed, the device comprising:

[0019] The device interface definition module is used to define the interface of the DDoS security device according to the service capability requirements of the DDoS security device and encapsulate the corresponding interface implementation class. Annotations are configured on the interface implementation class, and the corresponding key of the DDoS security device to be adapted is specified.

[0020] The adaptive adaptation module is used to load the corresponding DDoS security device that needs to be adapted based on the current key value through a custom extension loader, and generate the start method of the adapted DDoS security device for invocation.

[0021] Furthermore, define the interface for the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device to be adapted, including:

[0022] Define the interface that the call capability module adapts to in the application, as well as the corresponding interface implementation class name and parameters, and create the configuration file path in the resource directory of the call capability module where the interface is located;

[0023] Create a configuration file in this path. The key of the configuration file is the English abbreviation of the DDoS security device that needs to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the DDoS security device that needs to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

[0024] Furthermore, through a custom extension loader, based on the current key value, the corresponding DDoS security device that needs to be adapted is loaded, and the method for enabling the adapted DDoS security device is generated for invocation, including:

[0025] By using a custom extension loader, the corresponding DDoS security device that needs to be adapted can be loaded based on the current key value;

[0026] Iterate through the interface implementation classes corresponding to the interfaces that need to be adapted to DDoS security devices;

[0027] Determine whether the interface implementation class has at least one annotation configured;

[0028] If the interface implementation class is configured with at least one annotation, then code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class are generated. The instantiation is completed through compilation and loading, thereby generating the appropriate DDOS security device start method for calling.

[0029] If the interface implementation class does not have any annotations configured, then exception code will be generated.

[0030] Furthermore, when adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

[0031] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the aforementioned extended SPI adaptive DDOS security device.

[0032] In one embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that executes a DDoS security device based on an extended SPI adaptive compliant device.

[0033] Beneficial effects:

[0034] 1. This invention uses SPI extension to adaptively adapt to DDoS security devices from different manufacturers, enabling the calling program to be compatible with DDoS security devices from different manufacturers and versions.

[0035] 2. This invention achieves on-demand loading by extending the standard SPI. When a specific device manufacturer is called, the extension point of that device manufacturer is loaded to achieve on-demand loading, thus solving the problems of inflexible program loading, time-consuming loading, and waste of resources caused by hard coding. Attached Figure Description

[0036] Figure 1 This is a schematic diagram of the method for adaptively adapting to DDoS security devices based on extended SPI according to the present invention;

[0037] Figure 2 This is a flowchart illustrating the startup process of a DDOS cleaning device adapted via SPI extension according to an embodiment of the present invention.

[0038] Figure 3 This is a schematic diagram of the device structure of the present invention based on extended SPI adaptive DDoS security device;

[0039] Figure 4 This is a schematic diagram of the computer device structure of the present invention. Detailed Implementation

[0040] The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0041] Those skilled in the art will recognize that embodiments of the present invention can be implemented as an apparatus, device, node, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0042] The present invention proposes a method and apparatus for adaptively adapting to DDoS security devices based on extended SPI. By extending the standard SPI, when a specific device manufacturer is called, the extension point of that manufacturer is loaded to achieve on-demand loading. By extending the standard SPI, custom plugins can be used to manage DDoS security devices from multiple manufacturers and versions, and the problems of inflexible programs, time-consuming loading of resources, and resource waste caused by hard coding are solved.

[0043] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.

[0044] Figure 1 This is a schematic diagram of the method for adaptively adapting to DDoS security devices based on extended SPI according to the present invention. Figure 1 As shown, the method includes:

[0045] 1. Based on the service capability requirements of the DDoS security device, define the interface to be adapted to the calling capability module and the corresponding interface implementation class name and parameters in the application, and create a configuration file path in the resources directory of the calling capability module where the interface is located, with the path address being META-INF / services.

[0046] 2. Create a configuration file in this path. The key of the configuration file is the English abbreviation of the different DDoS security devices that need to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the different DDoS security devices that need to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

[0047] 3. When calling, the adaptation method `ExtensionLoader.getExtensionLoader(XX.class).getAvalibaleExtension()` of the custom extension loader `CustomerExtensionLoader` is used. Based on the current key value, the corresponding DDoS security device that needs to be adapted is loaded. The interface implementation classes corresponding to the interfaces that need to be adapted to the DDoS security device are traversed, and it is determined whether the interface implementation class has at least one annotation configured. If the interface implementation class has at least one annotation configured, the adaptation code is generated; if the interface implementation class has no annotation configured, the exception code is generated.

[0048] 4. By concatenating strings, generate code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class. Obtain the class compiler and loader. You can use Javassist (a library for editing and creating Java bytecode) as the compiler to compile and dynamically load the generated class.

[0049] 5. After the above steps are completed, the device is compiled and loaded, and finally instantiated, generating the method to enable the adapted DDoS security device. To call this method, simply pass the key of the DDoS security device to be adapted from the annotation; this will allow for dynamic, on-demand invocation of the generated method.

[0050] 6. When adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

[0051] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0052] To provide a clearer explanation of the above-described method for adaptively adapting to DDoS security devices based on extended SPI, a specific embodiment will be used for illustration below. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation of the present invention.

[0053] Example 1: Adaptive activation of DDOS cleaning equipment via SPI extension, such as... Figure 2 As shown;

[0054] Step 1: Define the CleanServiceInterface interface for the cleaning equipment manufacturer, and encapsulate the corresponding interface implementation CleanStart method, including how to start the manufacturer's cleaning method. Configure the @Join annotation in the CleanStart method implementation.

[0055] Step 2: Based on the defined CleanServiceInterface interface for cleaning equipment manufacturers, implement the CleanStart method required by the corresponding cleaning equipment manufacturer. The CleanStart method implemented by cleaning equipment manufacturer A is compatible with the specific cleaning capabilities of manufacturer A, and the CleanStart method implemented by cleaning equipment manufacturer B is compatible with the specific cleaning capabilities of manufacturer B, providing the same interface capability calls to the outside world.

[0056] Step 3: Create a new directory named MATE-INF under the resources directory of the calling program, and create an SPI configuration file named com.xx.CleanServiceInterface under this directory. In this configuration file, fill in cleanA = com.xx.ACleanService, cleanB = com.xx.BCleanService (the interface implementation class of a certain device).

[0057] Step 4: When calling a specific cleaning function, obtain the program's runtime context to get the device type A that needs to be called, and set it in the current program runtime context environment context.put("device", cleanA). Then, pass the current program runtime context environment to the implementation CleanStart method of the call: ExtensionLoader.getExtensionLoader(CleanServiceInterface.cl ass).getAvalibaleExtension().CleanStart(context) (to enable the cleaning function through the adapter class).

[0058] Step 5: The program will automatically select the corresponding cleaning device implementation to start the cleaning method based on the device type A contained in the current program execution context. When a new device type is added to start the cleaning method, there is no need to modify the original business logic or customize new interfaces and their implementation classes. If it is just a regular class, only a configuration file needs to be added to the ClassPath (class execution environment). It is simple to use and will not affect the existing code. It conforms to the Open / Closed Principle. Switching the implementation class of the extension point only requires modifying the specific implementation class in the configuration file, without changing the code. It is convenient to use. When calling a specific device manufacturer, it loads the extension point of that manufacturer to achieve on-demand loading, solving the problems of inflexible program loading, time-consuming loading, and waste of resources caused by hard coding.

[0059] Example 2: Adaptive DDOS detection device activation via SPI extension;

[0060] Step 1: Define the interface for the testing equipment manufacturer and encapsulate the corresponding interface implementation of the StartDetect method, including how to enable the manufacturer's testing method. Configure the @Adaptive annotation in the StartDetect method implementation and specify the key of the corresponding testing equipment in the annotation parameters to implement different calls.

[0061] Step 2: Based on the defined testing equipment manufacturer interface, implement the StartDetect method required by the corresponding testing equipment manufacturer. The StartDetect method implemented by testing equipment manufacturer A is compatible with the specific testing capabilities of manufacturer A, and the StartDetect method implemented by testing equipment manufacturer B is compatible with the specific testing capabilities of manufacturer B, providing the same interface capability calls to the outside world.

[0062] Step 3: Create a folder named / META-INF / services under the resources directory of the calling program, and then create a configuration file named with the full path name of the SPI interface. The directory contains the keys of different devices and their corresponding implementation classes. The corresponding configurations are as follows: detection device detectA and its corresponding full path name implementation class DetectA, detection device detectB and its corresponding full path name implementation class DetectB.

[0063] detectA=org.xx.common.extension.impl.DetectA

[0064] detectB=org.xx.common.extension.impl.DetectB

[0065] Step 4: When calling specific detection capabilities, the program obtains the program's runtime context. When different keys representing different detection devices are passed on the page, if the passed key = detectA, the program will obtain the value of the current key, detectA. The custom extension loader will dynamically load the corresponding detection device org.xx.common.extension.impl.DetectA based on the value of the current key, and further generate a method to enable detection for detection device A.

[0066] If the passed key = detectB, the program will obtain the value of the current key, detectB. The custom extension loader will dynamically load the corresponding detection device org.xx.common.extension.impl.DetectB based on the value of the current key, and further generate a method to enable detection for detection device B.

[0067] Step 5: The program will automatically select and call the generated detection device A or B to start the detection method based on the device type contained in the passed context. When a new device type is added to implement the detection method, there is no need to change the original business logic. You can simply customize the new interface and its implementation class.

[0068] Based on the same inventive concept, this invention also proposes an apparatus for an extended SPI adaptive DDOS security device. The implementation of this apparatus can refer to the implementation of the method described above, and repeated details will not be repeated. The term "module" as used below can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0069] Figure 3 This is a schematic diagram of the device structure for the present invention, which is based on extended SPI adaptive DDoS security device. Figure 3 As shown, the device includes:

[0070] The device interface definition module 101 is used to define the interface of the DDoS security device according to the service capability requirements of the DDoS security device, encapsulate the corresponding interface implementation class, configure annotations on the interface implementation class, and specify the key of the corresponding DDoS security device to be adapted; as follows:

[0071] Based on the service capability requirements of the DDoS security device, define the interface to be adapted to the calling capability module and the corresponding interface implementation class name and parameters in the application, and create the configuration file path in the resource directory of the calling capability module where the interface is located;

[0072] Create a configuration file in this path. The key of the configuration file is the English abbreviation of the DDoS security device that needs to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the DDoS security device that needs to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

[0073] The adaptive adaptation module 102 is used to load the corresponding DDoS security device that needs to be adapted based on the current key value through a custom extension loader, and generate the enabling method of the adapted DDoS security device for invocation; as detailed below:

[0074] By using a custom extension loader, the corresponding DDoS security device that needs to be adapted can be loaded based on the current key value;

[0075] Iterate through the interface implementation classes corresponding to the interfaces that need to be adapted to DDoS security devices;

[0076] Determine whether the interface implementation class has at least one annotation configured;

[0077] If the interface implementation class is configured with at least one annotation, then code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class are generated. The instantiation is completed through compilation and loading, thereby generating the appropriate DDOS security device start method for calling.

[0078] If the interface implementation class does not have any annotations configured, then exception code will be generated.

[0079] When adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

[0080] It should be noted that although several modules of the apparatus based on the extended SPI adaptive DDOS security device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.

[0081] Based on the aforementioned inventive concept, such as Figure 4 As shown, the present invention also proposes a computer device 200, including a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 230, it implements the aforementioned method for adaptively adapting to DDOS security devices based on extended SPI.

[0082] Based on the aforementioned inventive concept, the present invention also proposes a computer-readable storage medium storing a computer program that executes the aforementioned extended SPI adaptive DDOS security device.

[0083] The present invention proposes a method and apparatus for adaptively adapting to DDoS security devices based on extended SPI. By extending SPI to adaptively adapt to DDoS security devices from different manufacturers, the calling program can be compatible with DDoS security devices from different manufacturers and different versions. By extending the standard SPI, on-demand loading is achieved. When a specific device manufacturer is called, the extension point of that device manufacturer is loaded, thus solving the problems of inflexible program loading, time-consuming loading, and waste of resources caused by hard coding.

[0084] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

[0085] Regarding the limitation of the scope of protection of this invention, those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solution of this invention are still within the scope of protection of this invention.

Claims

1. A method for adaptively adapting to DDoS security devices based on extended SPI, characterized in that, The method includes: Based on the service capability requirements of the DDoS security device, define the interface of the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device that needs to be adapted. By using a custom extension loader, the corresponding DDoS security device that needs to be adapted is loaded based on the current key value, and the method for enabling the adapted DDoS security device is generated for invocation, including: By using a custom extension loader, the corresponding DDoS security device that needs to be adapted can be loaded based on the current key value; Iterate through the interface implementation classes corresponding to the interfaces that need to be adapted to DDoS security devices; Determine whether the interface implementation class has at least one annotation configured; If the interface implementation class is configured with at least one annotation, then code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class are generated. The instantiation is completed through compilation and loading, thereby generating the appropriate DDOS security device start method for calling. If the interface implementation class does not have any annotations configured, then exception code will be generated.

2. The method for adaptively adapting to DDoS security devices based on extended SPI according to claim 1, characterized in that, When adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

3. The method for adaptively adapting to DDoS security devices based on extended SPI according to claim 1, characterized in that, Define the interface for the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device to be adapted, including: Define the interface that the call capability module adapts to in the application, as well as the corresponding interface implementation class name and parameters, and create the configuration file path in the resource directory of the call capability module where the interface is located; Create a configuration file in this path. The key of the configuration file is the English abbreviation of the DDoS security device that needs to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the DDoS security device that needs to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

4. A device for adaptively adapting to DDoS security devices based on extended SPI, characterized in that, The device includes: The device interface definition module is used to define the interface of the DDoS security device according to the service capability requirements of the DDoS security device and encapsulate the corresponding interface implementation class. Annotations are configured on the interface implementation class, and the corresponding key of the DDoS security device to be adapted is specified. The adaptive adaptation module is used to load the corresponding DDoS security device that needs to be adapted based on the current key value through a custom extension loader, and generate the enabling method of the adapted DDoS security device for invocation, including: By using a custom extension loader, the corresponding DDoS security device that needs to be adapted can be loaded based on the current key value; Iterate through the interface implementation classes corresponding to the interfaces that need to be adapted to DDoS security devices; Determine whether the interface implementation class has at least one annotation configured; If the interface implementation class is configured with at least one annotation, then code to obtain the default interface implementation class, code to determine if the interface implementation class is empty, and code to call the interface implementation class are generated. The instantiation is completed through compilation and loading, thereby generating the appropriate DDOS security device start method for calling. If the interface implementation class does not have any annotations configured, then exception code will be generated.

5. The apparatus for adaptive DDoS security devices based on extended SPI according to claim 4, characterized in that, Define the interface for the DDoS security device and encapsulate the corresponding interface implementation class. Configure annotations on the interface implementation class and specify the key of the corresponding DDoS security device to be adapted, including: Define the interface that the call capability module adapts to in the application, as well as the corresponding interface implementation class name and parameters, and create the configuration file path in the resource directory of the call capability module where the interface is located; Create a configuration file in this path. The key of the configuration file is the English abbreviation of the DDoS security device that needs to be adapted, and the value of the configuration file is the full path name of the interface implementation class of the DDoS security device that needs to be adapted. Configure the annotation on the interface implementation class and specify the corresponding key in the annotation parameter.

6. The apparatus for adaptive DDoS security devices based on extended SPI according to claim 4, characterized in that, When adding new DDoS security devices that need to be adapted, simply define a new interface and its corresponding implementation class.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1-3.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Strategy loading and injection method and device

    CN106095508A

  • Management and control method and equipment compatible with MDM interface of mobile equipment of multiple manufacturers

    CN115328542A