Firewall API interface test method and device, electronic equipment and storage medium

By using pre-trained AI test models to automatically test the firewall API interface, the problem of low manual testing efficiency in the existing technology is solved, automated testing is realized, labor consumption is reduced, and testing efficiency is improved.

CN120066976APending Publication Date: 2025-05-30ZIGUANG HENGYUE TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510550430.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the prior art, testing of the firewall API interface requires manual execution, resulting in a large amount of manpower and material resources and low testing efficiency. How to improve the testing efficiency is an urgent problem.

Method used

By obtaining the target test request of the firewall API interface, the request is parsed to obtain the objective function and test requirements information, the target test cases are determined using the pre-trained AI test model, and the test is carried out to obtain the test results, thereby automatically testing each function, reducing manpower consumption, and improving testing efficiency.

Benefits of technology

It realizes automated testing of various functions, reduces manpower and material consumption, improves testing efficiency, and can complete API interface testing more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066976A_ABST
    Figure CN120066976A_ABST
Patent Text Reader

Abstract

Embodiments of the invention provide a firewall API interface test method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining a target test request of a firewall API interface; analyzing the target test request of the firewall API interface to obtain a target function and test demand information of the firewall API interface; and according to the trained test model, determining a target test case corresponding to the target function, and testing the test demand information of the target function by adopting the target test case to obtain a target test result corresponding to the target test request, so that after the target test request of the firewall API interface is obtained, the target test request of the firewall API interface is obtained. And testing the target function in the target test request by adopting the pre-trained test model to obtain the test result, so that each function can be automatically tested, the consumption of manpower and material resources is reduced, and the test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technologies, and in particular, to a method, device, electronic device, and storage medium for testing a firewall API interface. Background Art

[0002] An Application Programming Interface (API), also known as an application programming interface, is an agreement for the connection of different components of a software system. Due to the increasing scale of software in recent years, complex systems often need to be divided into small components, and the design of programming interfaces is very important. In the practice of program design, the design of programming interfaces should first reasonably divide the responsibilities of the software system. Good interface design can reduce the mutual dependence of various parts of the system, improve the cohesion of component units, reduce the coupling degree between component units, and thus improve the maintainability and scalability of the system. With the continuous development of network technology, in order to improve data security, firewalls are provided for each device. The firewall includes an API interface for invoking different test requirements. In this way, it is necessary to test the API interface. Currently, it is necessary to manually test each API interface, which not only consumes a large amount of manpower and material resources, but also has a low test efficiency. How to improve the test efficiency of the firewall API interface is an urgent problem to be solved currently. Summary of the Invention

[0003] Some embodiments of the present application aim to provide a method, device, electronic device, and storage medium for testing a firewall API interface. Through the technical solutions of the embodiments of the present application, a target test request for the firewall API interface is obtained; the target test request for the firewall API interface is parsed to obtain a target function corresponding to the firewall API interface and test requirement information; according to a pre-trained test model, a target test case corresponding to the target function is determined, and the target test case is used to test the test requirement information of the target function to obtain a target test result corresponding to the target test request. Among them, the pre-trained test model is obtained by training an AI model with sample data. In the embodiments of the present application, the AI model is trained by using each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to obtain an AI test model. In this way, after obtaining the target test request for the firewall API interface, the pre-trained test model is used to test the target function in the target test request to obtain a test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0004] In a first aspect, some embodiments of the present application provide a method for testing a firewall API interface, including: Obtain a target test request for the firewall API interface, where the target test request is determined according to user requirements, and the target test request includes at least one or more of character requirements, parameter ranges of valid boundary values, or parameter ranges of outlier values; Parse the target test request for the firewall API interface to obtain the target function corresponding to the firewall API interface and test requirement information; According to a pre-trained test model, determine a target test case corresponding to the target function, and use the target test case to test the test requirement information of the target function to obtain a target test result corresponding to the target test request. Among them, the pre-trained test model is obtained by training an AI model using sample data.

[0005] Some embodiments of the present application use each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to train and learn the AI model to obtain an AI test model. In this way, after obtaining the target test request for the firewall API interface, use the pre-trained test model to test the target function in the target test request to obtain a test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0006] Optionally, the test model is obtained in the following manner: Obtain sample data, where the sample data includes at least each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function; Use the sample data to train and learn the AI model to obtain an AI test model.

[0007] Some embodiments of the present application use each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to train and learn the AI model to obtain an AI test model, improving the accuracy and efficiency of interface testing.

[0008] Optionally, the step of using the sample data to train and learn the AI model to obtain an AI test model includes: Input the functions of the API of the firewall into the AI model, execute the test cases of the test requirements, and obtain a test result corresponding to the test requirements; Judge the test result. If the test result meets the preset requirements, determine that the AI model is the AI test model.

[0009] Optionally, the method further includes: Updating the AI test model.

[0010] In some embodiments of the present application, by setting different test requirements, for each different test requirement, different AI models are trained. Then, as the test requirements change, the training samples are updated, thereby updating the AI test model. In this way, the diversity of interface testing is enriched, and the model can be updated at any time to ensure the accuracy of testing.

[0011] In a second aspect, some embodiments of the present application provide a testing device for a firewall API interface, including: An acquisition module, configured to acquire a target test request for the firewall API interface, where the target test request is determined according to user requirements, and the target test request includes at least one or more of character requirements, parameter ranges of valid boundary values, or parameter ranges of outlier values; A parsing module, configured to parse the target test request for the firewall API interface to obtain a target function corresponding to the firewall API interface and test requirement information; A testing module, configured to determine a target test case corresponding to the target function according to a pre-trained test model, and use the target test case to test the test requirement information of the target function to obtain a target test result corresponding to the target test request, where the pre-trained test model is obtained by training an AI model using sample data.

[0012] In some embodiments of the present application, by using each function in the API of the firewall, the parameters corresponding to the function, and test cases corresponding to the test requirements of the function, an AI model is learned and trained to obtain an AI test model. In this way, after obtaining a target test request for the firewall API interface, the pre-trained test model is used to test the target function in the target test request to obtain a test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0013] Optionally, the device further includes a training module, and the training module is configured to: Acquire sample data, where the sample data includes at least each function in the API of the firewall, the parameters corresponding to the function, and test cases corresponding to the test requirements of the function; Use the sample data to perform learning and training on the AI model to obtain an AI test model.

[0014] Some embodiments of the present application train an AI model by using each function in the API of the firewall, the parameters corresponding to the function, and the test cases corresponding to the test requirements of the function, so as to obtain an AI test model, improving the accuracy and efficiency of interface testing.

[0015] Optionally, the training module is configured to: Input the functions of the API of the firewall into the AI model, execute the test cases of the test requirements, and obtain the test results corresponding to the test requirements; Judge the test results. If the test results meet the preset requirements, determine that the AI model is the AI test model.

[0016] Optionally, the training module is further configured to: Update the AI test model.

[0017] In some embodiments of the present application, by setting different test requirements, for each different test requirement, different AI models are trained. Then, as the test requirements change, the training samples are updated, thereby updating the AI test model. In this way, the diversity of interface testing is enriched, and the model can be updated at any time to ensure the accuracy of testing.

[0018] In a third aspect, some embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. Wherein, when the processor executes the program, the test method of the firewall API interface as described in any embodiment of the first aspect can be implemented.

[0019] In a fourth aspect, some embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the test method of the firewall API interface as described in any embodiment of the first aspect can be implemented.

[0020] In a fifth aspect, some embodiments of the present application provide a computer program product, where the computer program product includes a computer program. When the computer program is executed by a processor, the test method of the firewall API interface as described in any embodiment of the first aspect can be implemented. Description of the Drawings

[0021] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the following will briefly introduce the drawings required to be used in some embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.

[0022] Figure 1 It is a schematic flow chart of a test method for a firewall API interface provided by an embodiment of the present application; Figure 2 It is a schematic structural diagram of a test device for a firewall API interface provided by an embodiment of the present application; Figure 3 It is a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0023] Next, the technical solutions in some embodiments of the present application will be described in conjunction with the accompanying drawings in some embodiments of the present application.

[0024] It should be noted that: similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, the terms "first", "second", etc. are only used for differential description and cannot be construed as indicating or implying relative importance.

[0025] An Application Programming Interface (API), also known as an application programming interface, is an agreement for the connection of different components of a software system. Due to the increasing scale of software in recent years, complex systems often need to be divided into small components, and the design of programming interfaces is very important. In the practice of programming design, the design of programming interfaces should first reasonably divide the responsibilities of the software system. Good interface design can reduce the mutual dependence of various parts of the system, improve the cohesion of component units, and reduce the coupling degree between component units, thereby improving the maintainability and scalability of the system. With the continuous development of network technology, in order to improve data security and provide firewalls for each device, the firewall includes an API interface for calling different test requirements. Therefore, it is necessary to test the API interface. Currently, it is necessary to manually test each API interface, which not only consumes a large amount of manpower and material resources, but also has low test efficiency. How to improve the test efficiency of the firewall API interface is an urgent problem to be solved at present. In view of this, some embodiments of the present application provide a test method for a firewall API interface, and the method includes: obtaining a target test request for the firewall API interface; parsing the target test request for the firewall API interface to obtain the target function corresponding to the firewall API interface and test requirement information; according to the trained test model, determining a target test case corresponding to the target function, and using the target test case to test the test requirement information of the target function to obtain a target test result corresponding to the target test request, wherein the pre-trained test model is obtained by training an AI model with sample data. In the embodiments of the present application, the AI model is learned and trained by using each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function, so as to obtain an AI test model. In this way, after obtaining the target test request for the firewall API interface, the pre-trained test model is used to test the target function in the target test request to obtain a test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0026] As Figure 1 shown, embodiments of the present application provide a test method for a firewall API interface, and the method includes: S101. Obtain a target test request for the firewall API interface, where the target test request is determined according to user requirements, and the target test request includes at least one or more of character requirements, parameter ranges of valid boundary values, or parameter ranges of outlier values; Specifically, in the current era where network security is becoming increasingly important, the firewall, as an important tool for protecting computer systems and networks, plays a crucial role. For Java developers, being able to operate the firewall through programming interfaces (APIs) can not only help achieve automated management but also improve security and efficiency. There is a firewall installed on the terminal device, and the firewall includes an API interface. The firewall API interface refers to the software development interface provided by the firewall device, which allows third-party developers to configure and manage the firewall using programming languages and tools. Through the firewall API, you can achieve the following functions: adding, deleting, and modifying firewall rules, querying the firewall status and log records, and monitoring. Customize more complex firewall operations according to business requirements. In addition, the environmental settings and API correspondence relationships of different operating systems are different. Therefore, it is necessary to test the API interface.

[0027] There is a firewall API interface installed on the terminal device. When testing the API interface, a target test request for the firewall API interface is obtained. This target test request is determined according to test requirements (user requirements), such as character requirements, etc. This target test request can be input by the user or pre-set. The target test request includes at least one or more of character requirements, the parameter range of valid boundary values, or the parameter range of outlier values.

[0028] S102. Parse the target test request for the firewall API interface to obtain the target function corresponding to the firewall API interface and test requirement information; Specifically, the terminal device parses the target test request for the firewall API interface to obtain the target function of the firewall API interface, the test requirement information, and the test requirement information. For example, Internet boundary firewall, NAT boundary firewall, VPC boundary firewall, traffic analysis firewall, intrusion prevention firewall, vulnerability protection firewall, vulnerability protection firewall; among them, the Internet boundary firewall includes the PutDisableAllFwSwitch function (turn off all firewall switches) and the PutEnableFwSwitch function (turn on the firewall switch); the NAT boundary firewall includes the DescribeNatFirewallList function (query NAT firewall) and the CreateSecurityProxy function (create NAT firewall); the traffic analysis firewall includes the DescribeUserAssetIPTrafficInfo function (query traffic information of user-specified assets); the intrusion prevention firewall includes the DescribeRiskEventPayload function (obtain the attack payload of intrusion prevention events) and the DescribeRiskEventGroup function (obtain detailed data of intrusion prevention events); the vulnerability protection firewall includes the DescribeVulnerabilityProtectedList function (obtain the vulnerability protection list). Among them, each function includes at least multiple functions and the scope of the function.

[0029] S103. According to the trained test model, determine the target test case corresponding to the target function, and use the target test case to test the test requirement information of the target function to obtain the target test result corresponding to the target test request, where the pre-trained test model is obtained by training the AI model with sample data.

[0030] Specifically, sample data is pre-loaded on the terminal device. The sample data at least includes each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function. Use each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to train the AI model to obtain the AI test model.

[0031] Among them, the AI model at least includes: large language models, vision large models, multimodal large models, and basic science large models, etc., such as the GPT series, LLaMA, or Wenxin Yiyan.

[0032] After the terminal device parses and obtains the target function of the API interface, it inputs the target function into the trained test model to obtain test cases corresponding to the target function. Then, according to the test requirement information, it selects the target test case corresponding to the test requirement information from multiple test cases and executes the target test case to obtain the target test result corresponding to the target test case.

[0033] For example, the target test request includes the test of valid boundary values. After the terminal device obtains the target test request, according to the test requirement information of the test of valid boundary values, it inputs it into the pre-trained test model to determine the target test case corresponding to the test requirement information, executes the target test case, and obtains the target test result corresponding to the test requirement information.

[0034] Some embodiments of the present application use each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to learn and train the AI model to obtain an AI test model. In this way, after obtaining the target test request of the firewall API interface, the pre-trained test model is used to test the target function in the target test request to obtain the test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0035] Another embodiment of the present application further supplements and explains the test method of the firewall API interface provided in the above embodiment.

[0036] Optionally, the test model is obtained in the following manner: Obtain sample data, where the sample data includes at least each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function; Use the sample data to learn and train the AI model to obtain an AI test model.

[0037] Specifically, the terminal device obtains sample data, that is, obtains each function of each API interface of the firewall, the parameters of each function, and the test cases of the test requirements with different functions corresponding to the function. Then, use each function of each API interface of the firewall, the parameters of each function, and the test cases of the test requirements with different functions corresponding to the function to learn and train the AI model to obtain an AI test model.

[0038] In the actual training process, if it is necessary to test which value of which function, according to the test requirement, the AI model is learned and trained to obtain a test model corresponding to different test requirements.

[0039] Some embodiments of the present application train an AI model by using various functions in the API of the firewall, parameters corresponding to the functions, and test cases corresponding to the test requirements of the functions, to obtain an AI test model, thereby improving the accuracy and efficiency of interface testing.

[0040] Optionally, training the AI model with sample data to obtain an AI test model includes: Input the functions of the API of the firewall into the AI model, execute the test cases of the test requirements, and obtain test results corresponding to the test requirements; Judge the test results. If the test results meet the preset requirements, determine the AI model as the AI test model.

[0041] Optionally, the training module is further configured to: Update the AI test model.

[0042] In some embodiments of the present application, by setting different test requirements, for each different test requirement, different AI models are trained. Then, as the test requirements change, the training samples are updated, thereby updating the AI test model. In this way, the diversity of interface testing is enriched, and the model can be updated at any time to ensure the accuracy of testing.

[0043] Exemplarily, an embodiment of the present application provides a method for testing a firewall API interface, including: 1. The terminal device obtains sample data, which includes: parameters of each function in the API of the firewall, such as specifications for numbers and characters. Exemplarily, string requirements, integer types, long integer types, and also test cases corresponding to the test requirements of the functions; 2. Train the AI model with the sample data to obtain an AI test model; 3. The functions of the API of the firewall input into the AI test model, and the AI test model outputs parameter ranges such as valid boundary values and outlier values of the API interface. The output test results can be set according to user requirements.

[0044] 4. During the training process of the AI model, the training data is each function of the API and test cases corresponding to different functions (test requirements), and test results corresponding to the test cases are output.

[0045] It should be noted that each feasible manner in this embodiment can be implemented independently, or can be combined in any combination manner without conflict. The present application makes no limitation.

[0046] Another embodiment of the present application provides a test device for a firewall API interface, which is used to execute the method for testing a firewall API interface provided in the above embodiment.

[0047] As Figure 2 shown, it is a schematic structural diagram of a test device for a firewall API interface provided by an embodiment of the present application. The test device for the firewall API interface includes an acquisition module 201, a parsing module 202, and a test module 203, where: The acquisition module 201 is configured to acquire a target test request for the firewall API interface. The target test request is determined according to user requirements, and the target test request includes at least one or more of character requirements, parameter ranges of valid boundary values, or parameter ranges of outlier values; The parsing module 202 is configured to parse the target test request for the firewall API interface to obtain a target function corresponding to the firewall API interface and test requirement information; The test module 203 is configured to determine a target test case corresponding to the target function according to a trained test model, and use the target test case to test the test requirement information of the target function to obtain a target test result corresponding to the target test request. Among them, the pre-trained test model is obtained by training an AI model using sample data.

[0048] Regarding the device in this embodiment, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0049] Some embodiments of the present application use each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function to learn and train the AI model to obtain an AI test model. In this way, after obtaining the target test request for the firewall API interface, the pre-trained test model is used to test the target function in the target test request to obtain a test result. In this way, each function can be automatically tested, reducing the consumption of manpower and material resources and improving the test efficiency.

[0050] Another embodiment of the present application further supplements the test device for the firewall API interface provided in the above embodiment.

[0051] Optionally, the device further includes a training module, and the training module is configured to: Acquire sample data, where the sample data includes at least each function in the API of the firewall, the parameters corresponding to the function, and the test cases of the test requirements corresponding to the function; Use the sample data to perform learning and training on the AI model to obtain an AI test model.

[0052] Some embodiments of the present application train an AI model by adopting various functions in the API of the firewall, parameters corresponding to the functions, and test cases corresponding to the test requirements of the functions, so as to obtain an AI test model, improving the accuracy and efficiency of interface testing.

[0053] Optionally, the training module is used to: Input the functions of the API of the firewall into the AI model, execute the test cases of the test requirements, and obtain test results corresponding to the test requirements; Judge the test results. If the test results meet the preset requirements, determine the AI model as the AI test model.

[0054] Optionally, the training module is further used to: Update the AI test model.

[0055] In some embodiments of the present application, by setting different test requirements, for each different test requirement, different AI models are trained. Then, as the test requirements change, the training samples are updated, thereby updating the AI test model. In this way, the diversity of interface testing is enriched, and the model can be updated at any time to ensure the accuracy of testing.

[0056] Regarding the device in this embodiment, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.

[0057] It should be noted that each feasible manner in this embodiment can be implemented independently, or can be combined in any combination manner without conflict. The present application makes no limitation.

[0058] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the operations corresponding to any of the embodiments of the test method for the firewall API interface provided in the above embodiments can be implemented.

[0059] The embodiments of the present application further provide a computer program product. The computer program product includes a computer program, wherein when the computer program is executed by a processor, the operations corresponding to any of the embodiments of the test method for the firewall API interface provided in the above embodiments can be implemented.

[0060] As Figure 3As shown, some embodiments of the present application provide an electronic device 300, which includes: a memory 310, a processor 320, and a computer program stored on the memory 310 and executable on the processor 320. Among them, when the processor 320 reads the program from the memory 310 through the bus 330 and executes the program, it can implement the methods of any of the embodiments included in the above-mentioned firewall API interface test method.

[0061] The processor 320 can process digital signals and can include various computing architectures. For example, a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements a combination of multiple instruction sets. In some examples, the processor 320 can be a microprocessor.

[0062] The memory 310 can be used to store instructions executed by the processor 320 or data related to the execution of the instructions. These instructions and / or data can include code for implementing some or all of the functions of one or more modules described in the embodiments of the present application. The processor 320 of the present disclosure embodiment can be used to execute the instructions in the memory 310 to implement the method shown above. The memory 310 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well-known to those skilled in the art.

[0063] The above are only the embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0064] As described above, this is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or replacements, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

[0065] It should be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

Claims

1. A method for testing a firewall API interface, characterized in that: The method comprises: Obtain a target test request of a firewall API interface, wherein the target test request is determined according to user requirements, and the target test request includes at least one or more of a character requirement, a parameter range of a valid boundary value, or a parameter range of an abnormal value; Parsing the target test request of the firewall API interface to obtain the target function and test requirement information of the firewall API interface; According to a pre-trained test model, a target test case corresponding to the objective function is determined, and the target test case is used to test the test requirement information of the objective function to obtain a target test result corresponding to the target test request, wherein the pre-trained test model is obtained by training the AI ​​model using sample data.

2. The method for testing the firewall API interface according to claim 1, characterized in that: The test model is obtained in the following way: Acquire sample data, where the sample data at least includes each function in the API of the firewall, parameters corresponding to the function, and test cases of test requirements corresponding to the function; The sample data is used to learn and train the AI ​​model to obtain an AI test model.

3. The method for testing the firewall API interface according to claim 2, characterized in that: The using the sample data to learn and train the AI ​​model to obtain the AI ​​test model includes: Input the function of the firewall API into the AI ​​model, execute the test case of the test requirement, and obtain the test result corresponding to the test requirement; The test result is judged, and if the test result meets the preset requirements, the AI ​​model is determined to be the AI ​​test model.

4. The method for testing the firewall API interface according to claim 2, characterized in that: The method further comprises: The AI ​​test model is updated.

5. A test device for a firewall API interface, characterized in that: The device comprises: An acquisition module, used to acquire a target test request of a firewall API interface, wherein the target test request is determined according to user requirements, and the target test request includes at least one or more of a character requirement, a parameter range of a valid boundary value, or a parameter range of an abnormal value; A parsing module, used to parse the target test request of the firewall API interface to obtain the target function and test requirement information of the firewall API interface; A testing module is used to determine a target test case corresponding to the objective function based on a pre-trained test model, and use the target test case to test the test requirement information of the objective function to obtain a target test result corresponding to the target test request, wherein the pre-trained test model is obtained by training the AI ​​model using sample data.

6. The firewall API interface testing device according to claim 5, characterized in that: The device also includes a training module, which is used to: Acquire sample data, where the sample data at least includes each function in the API of the firewall, parameters corresponding to the function, and test cases of test requirements corresponding to the function; The sample data is used to learn and train the AI ​​model to obtain an AI test model.

7. The firewall API interface testing device according to claim 6, characterized in that: The training module is used to: Input the function of the firewall API into the AI ​​model, execute the test case of the test requirement, and obtain the test result corresponding to the test requirement; The test result is judged, and if the test result meets the preset requirements, the AI ​​model is determined to be the AI ​​test model.

8. The firewall API interface testing device according to claim 6, characterized in that: The test requirements at least include character requirements, parameter ranges of valid boundary values, or parameter ranges of abnormal values.

9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the method for testing the firewall API interface as described in any one of claims 1 to 4 when executing the program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the program is executed by a processor, the method for testing the firewall API interface described in any one of claims 1 to 4 can be implemented.

Citation Information

Patent Citations

  • Interface testing method and device based on automatic parameter recognition, equipment and medium

    CN113407450A

  • Interface testing method, related equipment, storage medium and program product

    CN115827417A

  • Interface testing method and device, electronic equipment and storage medium

    CN117033253A

  • Interface testing method and device, equipment, storage medium and product

    CN118820070A

  • Interface testing method, and computer device and computer-readable storage medium

    WO2022134915A1