Method for optimizing event trigger test efficiency

By using Notepad or Excel to organize the event library in event trigger tests, and using Python to write automated scripts for multi-thread concurrency, the problem of inefficient testing in the existing technology is solved and efficient event trigger testing is achieved.

CN120448281AInactive Publication Date: 2025-08-08BEIJING ANDY TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510941044.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-08-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, event triggering testing is inefficient, and it requires manual triggering of events to consume a lot of human resources, and the test cycle is long.

Method used

Use Notepad or Excel to organize the event library, use equivalent class division method for classification management, use Python programming language to write automated scripts, simulate manual operations, realize batch sending of events and multi-threaded concurrency, and optimize the event triggering test process.

Benefits of technology

The test efficiency has been improved, reaching more than 20 times that of manual operation, reducing the test cycle, and shortening it from 4 days to 1 day.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448281A_ABST
    Figure CN120448281A_ABST
Patent Text Reader

Abstract

The invention discloses a method for optimizing event trigger test efficiency, which relates to the technical field of software testing, and comprises the following steps: S1, arranging an event library by using a notebook or Excel, collecting and storing information related to events, and carrying out classified management on the events; s2, according to a test requirement, setting a sending frequency and a data type of an event, writing a sending related code, and appointing a sending target server; and S3, after network communication is debugged to be normal, executing a sending program, sending event information to a platform, and checking the condition of a rule triggered after the data is sent at the platform side. According to the method for optimizing the event trigger test efficiency, the technology is used for simulating the operation behavior of a person, generating events, collecting the events into an event library, compiling an automatic script by using a Python language, and sending the events which are pre-stored in the event library in advance to a platform in batches, so that the effect generated by manual operation is achieved, manual operation is replaced, and the efficiency is improved by more than 20 times.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a method for optimizing event-triggered testing efficiency. Background Art

[0002] The existing related technology is that when a person manually performs an event on the computer, such as plugging or unplugging a USB flash drive, or connecting an external optical disk, the event is reported to the platform. The platform triggers the alarm rules, generates alarm information, and notifies the security operation and maintenance personnel to make timely security policy controls and handle the alarm information in a timely manner.

[0003] However, in practice, this approach suffers from low testing efficiency, requiring manual triggering of events on the host or computer, which consumes significant human resources and results in a long testing cycle. Multiple experiments have shown that testing 100 alarm rules requires approximately four days. Therefore, there is an urgent need to improve this shortcoming. The present invention addresses this long testing cycle, saving labor costs and shortening the testing cycle to just one day. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for optimizing the efficiency of event-triggered testing to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention provides the following technical solution: a method for optimizing event-triggered testing efficiency, comprising the following steps:

[0006] S1. Use Notepad or Excel to organize the event library, collect and store event-related information, such as event type, description, trigger conditions, expected results, etc., and classify and manage events into valid equivalence classes and invalid equivalence classes;

[0007] S2. According to the test requirements, set the event sending frequency and data type, write the relevant sending code, and specify the target server for sending, namely the Industrial Internet Security Management and Situation Analysis Platform;

[0008] S3. After debugging the network communication and it is normal, execute the sending program. If the program runs normally, send the event information to the platform. On the platform side, check whether the rules are triggered after the data is sent to verify the test effect.

[0009] S4. Check the hardware resources, including CPU, memory, and disk space, through system properties or related tools. Based on the inspection results, adjust or optimize the operating environment to meet the program's operating requirements.

[0010] Furthermore, in step S1, data is input manually or imported into a notepad or Excel file to record the event and its related information.

[0011] Furthermore, in step S1, the event library supports long-term accumulation, continuous improvement and enrichment, and classifies and displays events in the form of tables or lists.

[0012] Furthermore, in step S1, the specific operation of event classification management is to use the equivalence partitioning (EP) method to divide events into valid equivalence classes and invalid equivalence classes, and manage them separately, as follows:

[0013] ValidEquivalenceClass: Events that meet the system's expected input range, can be triggered normally and produce correct results, that is, valid events, perform stress testing, and multi-threaded batch sending;

[0014] Invalid Equivalence Class: Events that do not conform to the system's expected input range may cause errors, exceptions, or rejections. These are invalid events and require non-stress testing, regression operations, and retransmission.

[0015] Furthermore, in step S2, the Python programming language is used in combination with the development and debugging tool PyCharm to write code to obtain stress testing code blocks and non-stress testing code blocks for sending the read event information to the specified target server;

[0016] The stress testing code block is a code segment designed to be executed under high concurrency and high load conditions, used to perform stress testing of valid events and multi-threaded batch sending (multi-threading: using multi-threading technology to send multiple events simultaneously to improve testing efficiency; batch sending: combining multiple events into a batch for sending to reduce the overhead of a single send);

[0017] The non-stress testing code blocks are code segments executed under normal conditions. They do not need to withstand high concurrency or high load pressure and are used to perform non-stress testing, regression operations, and one-pass sending of invalid events.

[0018] Furthermore, in step S2, the batch loop reading of the event library is realized through Python I / O operations or related library functions, the event type (valid event or invalid event) is read, and the corresponding stress testing code block or non-stress testing code block is selected.

[0019] Furthermore, in step S3, code debugging is performed in a development environment such as PyCharm to ensure that network communication works normally, and the written sending program is run to observe the program output and log information to confirm that the event information has been successfully sent.

[0020] Furthermore, in step S3, the specific operation of rule triggering detection is: logging into the Industrial Internet Security Management and Situation Analysis Platform, checking whether the alarm information is triggered as expected, and verifying the accuracy of the alarm rules.

[0021] Furthermore, in step S4, the operating environment requirements are as follows:

[0022] 1) The CPU can install the Python environment;

[0023] 2) Memory must be 2GB or above;

[0024] 3) In addition to the disk space occupied by the system itself, 2GB of disk space is reserved for the program alone.

[0025] The present invention provides a method for optimizing the efficiency of event-triggered testing, which has the following beneficial effects:

[0026] The present invention uses technology to simulate human operation behavior, generate events, collect events into an event library, and use Python language to write automation scripts to send events in the pre-stored event library in batches to the platform, achieving the effect produced by human operation, replacing manual operation, and improving efficiency by more than 20 times.

[0027] 1. Use Notepad TXT files or Excel files to manage the event library, which is convenient for operation and maintenance and supports more than thousands of events;

[0028] 2. Develop the event sending module in Python language to automate document operation, read events, and send event effects;

[0029] 3. The sending mechanism supports starting, pausing, single-threaded sending, and multi-threaded concurrent stress testing at any time;

[0030] 4. Easy to operate, control, and execute, it is more than 20 times more efficient than manual operations and can solve scenarios that cannot be completed manually, such as event concurrency stress testing and long-term load testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A schematic diagram of the operation flow of a method for optimizing event-triggered testing efficiency according to the present invention;

[0032] Figure 2 The present invention is a schematic diagram of the operation flow of a method for optimizing event-triggered testing efficiency. DETAILED DESCRIPTION

[0033] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.

[0034] like Figure 1-Figure 2 As shown, a method for optimizing event-triggered testing efficiency includes the following steps:

[0035] S1. Use Notepad or Excel to organize the event library, collect and store event-related information, such as event type, description, trigger conditions, expected results, etc., and classify events into valid equivalence classes and invalid equivalence classes.

[0036] In this step, data is input manually or imported into Notepad or Excel, and the event and related information are recorded. The event library supports long-term accumulation, continuous improvement and enrichment, and uses tables or lists to classify and display events.

[0037] In this embodiment, an equivalence partitioning (EP) method is used to divide events into valid equivalence classes and invalid equivalence classes, and manage them separately, as follows:

[0038] ValidEquivalenceClass: Events that meet the system's expected input range, can be triggered normally and produce correct results, that is, valid events, perform stress testing, and multi-threaded batch sending;

[0039] Invalid Equivalence Class: Events that do not conform to the system's expected input range may cause errors, exceptions, or rejections. These are invalid events and require non-stress testing, regression operations, and retransmission.

[0040] S2. According to the test requirements, set the event sending frequency and data type, write the sending related code, and specify the target server for sending, namely the Industrial Internet Security Management and Situation Analysis Platform.

[0041] In this embodiment, the Python programming language is used in combination with the development and debugging tool PyCharm to write code, obtain stress testing code blocks and non-stress testing code blocks, and send the read event information to the specified target server.

[0042] Stress testing code block: A code segment designed to execute under high concurrency and high load conditions. It is used to perform stress testing of valid events and multi-threaded batch sending (multi-threading: using multi-threading technology to send multiple events simultaneously to improve testing efficiency; batch sending: combining multiple events into a batch for sending to reduce the overhead of a single send).

[0043] Non-stress testing code blocks: Code segments executed under normal conditions. They do not need to withstand high concurrency or high load pressure and are used to perform non-stress testing, regression operations, and one-pass sending of invalid events.

[0044] In addition, through Python I / O operations or related library functions, batch loop reading of the event library is implemented to read the event type (valid event or invalid event), and select the corresponding stress testing code block or non-stress testing code block.

[0045] S3. After debugging and confirming that the network communication is normal, execute the sending program. The program runs normally and sends the event information to the platform. Check on the platform side whether the rules are triggered after the data is sent. Verify the test effect, that is, log in to the Industrial Internet Security Management and Situation Analysis Platform, check whether the alarm information is triggered as expected, and verify the accuracy of the alarm rules.

[0046] In this embodiment, code debugging is performed in a development environment such as PyCharm to ensure that network communication works normally, and the written sending program is run to observe the program output and log information to confirm that the event information has been successfully sent.

[0047] S4. Check the hardware resources, including CPU, memory, and disk space, through system properties or related tools, and adjust or optimize the operating environment based on the inspection results to meet the program's operating requirements. In this embodiment, the operating environment requirements specifically include the following:

[0048] 1) There is no CPU requirement, as long as the Python environment can be installed;

[0049] 2) Memory must be 2GB or above;

[0050] 3) In addition to the disk space occupied by the system itself, 2GB of disk space is reserved for the program alone.

[0051] The embodiments of the present invention are presented for purposes of illustration and description and are not intended to be exhaustive or to limit the invention to the disclosed forms. Many modifications and variations will be apparent to those skilled in the art. The embodiments are chosen and described in order to better illustrate the principles of the invention and its practical application and to enable those skilled in the art to understand the invention and design various embodiments with various modifications as suited for specific applications.

Claims

1. A method for optimizing event-triggered testing efficiency, characterized in that: The following steps are involved: S1. Use Notepad or Excel to organize the event library, collect and store information related to the event, and classify the events into valid equivalence classes and invalid equivalence classes; S2. According to the test requirements, set the event sending frequency and data type, write the relevant sending code, and specify the target server for sending, namely the Industrial Internet Security Management and Situation Analysis Platform; S3. After debugging the network communication to be normal, execute the sending program to send the event information to the platform. On the platform side, check whether the rules are triggered after the data is sent to verify the test effect; S4. Check the CPU, memory, and disk space through system properties, and adjust or optimize the operating environment based on the inspection results to meet the program running requirements.

2. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S1, data is input manually or imported into a notepad or Excel file to record the event and its related information.

3. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S1, the event library supports long-term accumulation, continuous improvement and enrichment, and classifies and displays events in the form of tables or lists.

4. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S1, the specific operation of event classification management is to use the equivalence class division method to divide the events into valid equivalence classes and invalid equivalence classes, and manage them separately, as follows: Valid equivalence class: Events that meet the system's expected input range, can be triggered normally and produce correct results. These are valid events and can be used for stress testing and multi-threaded batch sending. Invalid equivalence class: Events that do not conform to the system's expected input range will result in errors, exceptions, or rejections. These are invalid events, and non-stress testing, regression operations, and retransmission are performed.

5. The method for optimizing event-triggered testing efficiency according to claim 4, characterized in that: In step S2, the Python programming language is used in combination with the development and debugging tool PyCharm to write code to obtain stress testing code blocks and non-stress testing code blocks for sending the read event information to the specified target server; The stress testing code block is a code segment designed to be executed under high concurrency and high load conditions, used to perform stress testing and multi-threaded batch sending of valid events; The non-stress testing code block is a code segment executed under normal conditions, which does not need to withstand the pressure of high concurrency or high load, and is used to perform non-stress testing, regression operations, and one-time sending of invalid events.

6. The method for optimizing event-triggered testing efficiency according to claim 5, characterized in that: In step S2, batch loop reading of the event library is implemented through Python I / O operations or related library functions, the event type is read, that is, valid event or invalid event, and the corresponding stress testing code block or non-stress testing code block is selected.

7. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S3, code debugging is performed in the PyCharm development environment to ensure that network communication works normally, and the written sending program is run to observe the program output and log information to confirm that the event information has been successfully sent.

8. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S3, the specific operation of rule triggering detection is: logging into the Industrial Internet Security Management and Situation Analysis Platform, checking whether the alarm information is triggered as expected, and verifying the accuracy of the alarm rules.

9. The method for optimizing event-triggered testing efficiency according to claim 1, characterized in that: In step S4, the operating environment requirements are as follows: 1) The CPU can install the Python environment; 2) Memory must be 2GB or above; 3) In addition to the disk space occupied by the system itself, 2GB of disk space is reserved for the program.

Citation Information

Patent Citations

  • Reuse based design and implementation method for radar software testing

    CN105183645A

  • Method for automatically generating Ice interface test case and test script

    CN113419946A

  • Automatic testing method, system and equipment based on internet of things model and medium

    CN119201718A

  • System, method, and computer program for generating event tests associated with a testing project

    US9787534B1