A micro-office authenticated multi-user automated testing method and system

By configuring multiple network IPs on a single test terminal and adopting a two-dimensional redirection detection mechanism, the problems of high hardware cost and single detection method in multi-user authentication testing of micro-office gateways are solved, and efficient and reliable automated testing of multi-user authentication is achieved.

CN122475906APending Publication Date: 2026-07-28BEIJING ANBOTONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ANBOTONG TECH CO LTD
Filing Date
2026-04-29
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing technologies for multi-user authentication testing of micro-office gateways suffer from high hardware costs, limited redirection detection methods, and difficulties in obtaining dynamic parameters, resulting in low testing efficiency and insufficient accuracy.

Method used

By configuring multiple network IPs on a single test terminal, and employing a two-dimensional redirection detection mechanism (HTTP 302 status code and HTML meta refresh redirection) combined with a dynamic authentication parameter acquisition mechanism, automated testing of multi-user authentication can be achieved.

Benefits of technology

It enables the simulation of full-process authentication for multiple end users on a single PC, reducing test resource consumption and costs, improving parameter capture success rate and test result reliability, and increasing test efficiency by more than 10 times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122475906A_ABST
    Figure CN122475906A_ABST
Patent Text Reader

Abstract

The application provides a micro-office authentication multi-user automatic test method and system, and the method comprises the following steps: obtaining a plurality of network IPs configured on a test terminal; binding a network IP in the plurality of network IPs to access a preset external network address, and receiving a redirection response returned by a micro-office gateway; based on a two-dimensional detection mechanism of HTTP 302 status code redirection and HTML meta refresh redirection, extracting a redirection URL from the redirection response; parsing the address and port of the micro-office gateway from the redirection URL, and calling an authentication parameter interface of the micro-office gateway based on the address and port to obtain dynamic authentication parameters; obtaining a user identifier, sending an online request to an online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier, and completing micro-office authentication of a terminal user corresponding to the network IP. The application improves the reliability and automation degree of the authentication test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network security equipment certification testing technology, specifically to a multi-user automated testing method and system for micro-office authentication. Background Technology

[0002] As a core authentication device for enterprise intranet terminals accessing the external network, the Micro Office Gateway's standard authentication process is as follows: When a terminal accesses the external network, the gateway pushes an authentication page carrying a QR code. The user completes identity authentication by scanning the code using the Micro Office APP before gaining external network access. During the research, development, testing, and maintenance phases of the Micro Office Gateway, comprehensive testing of the gateway's authentication functions, concurrent processing capabilities, and long-term stability is required.

[0003] The existing testing solutions have the following technical shortcomings: 1. Low efficiency of manual testing and high hardware cost for multi-user simulation: Single-user testing requires completing the entire process of "PC triggering authentication page + mobile phone QR code authentication," while multi-user testing requires repetitive operations and cannot omit the QR code scanning step. Traditional solutions require deploying PC terminals matching the number of users or purchasing dedicated network testing equipment costing hundreds of thousands of yuan. A single PC cannot simulate multi-user authentication scenarios, resulting in high test resource consumption and costs. 2. Limited redirection detection methods and low parameter capture success rate: Existing automated authentication tools only support HTTP 302 redirection detection and cannot identify the HTML meta refresh redirection method used by some micro-office gateways, resulting in an authentication parameter capture success rate of only about 60% and insufficient test accuracy. 3. Lack of automated acquisition capability for dynamic authentication parameters: Existing technologies are mostly designed for static authentication scenarios of "fixed IP + fixed parameters," and cannot automatically parse the gateway address and port from the redirection URL or call dedicated interfaces to obtain dynamic authentication parameters, making it difficult to replicate the complete data interaction logic behind manual QR code scanning.

[0004] Therefore, there is an urgent need for a multi-user automated testing method and system for micro-office authentication that can meet the needs of multi-user simulation, dual-dimensional redirection detection, and automatic acquisition of dynamic parameters, so as to improve testing efficiency, parameter capture success rate, and single-machine multi-user simulation capability. Summary of the Invention

[0005] In view of this, it is necessary to provide a multi-user automated testing method and system for micro-office authentication to solve the technical problems in the existing technology, such as high cost due to reliance on a large amount of hardware resources for multi-user simulation, low parameter capture success rate due to support for only a single redirection detection method, and inability to automatically obtain dynamic authentication parameters to complete the whole process simulation.

[0006] To address the aforementioned technical problems, in a first aspect, the present invention provides a multi-user automated testing method for micro-office authentication, applied to a single test terminal, wherein the test terminal is configured with multiple network IPs for simulating multiple terminal users, and the method includes: Obtain the multiple network IPs configured on the test terminal; For each of the multiple network IPs, bind the network IP to access the preset external network address and receive the redirection response returned by the micro-office gateway; Based on a two-dimensional detection mechanism of HTTP 302 status code redirection and HTML meta refresh redirection, the redirect URL is extracted from the redirect response; The address and port of the Micro Office Gateway are parsed from the redirected URL, and the authentication parameter interface of the Micro Office Gateway is called based on the address and port to obtain dynamic authentication parameters; Obtain the pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.

[0007] In one possible implementation, obtaining the plurality of network IPs configured on the test terminal includes: The system interface of the test terminal is invoked using PowerShell commands to obtain the IPv4 address, and loopback addresses and link-local temporary IPs are automatically filtered to obtain the multiple network IPs; If PowerShell fails to retrieve the IP address, the local machine's egress IP address is obtained by connecting to a public DNS server, and this local egress IP address is used as the network IP address.

[0008] In one possible implementation, the two-dimensional detection mechanism based on HTTP 302 status code redirection and HTML metarefresh redirection extracts the redirect URL from the redirection response, including: Obtain and parse the response header of the network request sent to the external address. When the HTTP 302 status code is identified, extract the Location field from the response header as the redirect URL. When the HTTP 302 status code is not recognized, the HTML meta refresh tag in the response header is parsed, and the HTML meta refresh tag is matched using multiple regular expression matching rules to obtain the redirect URL.

[0009] In one possible implementation, the method further includes: When the dynamic authentication parameters cannot be successfully obtained, a retry operation is triggered; When the number of retry operations is less than the preset maximum number, the dynamic authentication parameters are reacquired in response to the retry operation.

[0010] In one possible implementation, the user identifier is a username, then obtaining the pre-configured user identifier includes: The preset list of usernames is cyclically assigned to each of the network IPs to achieve dynamic adaptation in single-user multi-IP or multi-user multi-IP scenarios.

[0011] In one possible implementation, when a single network IP fails to send an online request to the micro-office gateway's online interface based on the dynamic authentication parameters and the user identifier, only the single network IP is marked as having failed the test, without interrupting the testing process of other network IPs.

[0012] In one possible implementation, the method further includes: Based on the preset number of loops and the waiting time between rounds, the automated testing operations on all network IPs are repeatedly executed to achieve stress testing or stability testing.

[0013] In one possible implementation, the method further includes: Acquire test logs, perform statistical analysis on the test logs based on preset quantitative indicators, and generate and output a structured test report; The structured test report includes the number of IPs identified, the number of successful parameter captures, the number of failed parameter captures, the number of successful deployments, the number of failed deployments, the parameter capture success rate, and the deployment success rate, and marks the failed IPs and the reasons for the failures.

[0014] In one possible implementation, the dynamic authentication parameters include the terminal source IP address, user unique identifier, timestamp, and signature.

[0015] Secondly, the present invention also provides a multi-user automated testing system for micro-office authentication, applied to a single testing terminal, wherein the testing terminal is configured with multiple network IPs for simulating multiple terminal users; the system includes: The IP acquisition module is used to acquire the multiple network IPs configured on the test terminal; The redirection response module is used to bind each of the multiple network IPs to a preset external network address and receive a redirection response returned by the micro-office gateway. A two-dimensional redirection detection module is used to extract the redirection URL from the redirection response through a two-dimensional detection mechanism based on HTTP 302 status code redirection and HTML meta refresh redirection. The dynamic parameter acquisition module is used to parse the address and port of the micro-office gateway from the redirected URL, and call the authentication parameter interface of the micro-office gateway based on the address and port to obtain dynamic authentication parameters; The online request module is used to obtain a pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.

[0016] The beneficial effects of this invention are as follows: The multi-user automated testing method for micro-office authentication provided by this invention, by configuring multiple network IPs on a single test terminal and independently executing binding access, redirection detection, parameter acquisition, and online request for each IP, achieves for the first time the simulation of the entire micro-office authentication process for multiple terminal users on a single PC. It eliminates the need to deploy multiple PCs or purchase dedicated testing equipment, reducing test resource consumption by over 90% and test costs by approximately 95%. Simultaneously, it replaces manual QR code scanning, reducing the authentication simulation of a single batch of 100 users from several hours to minutes.

[0017] Secondly, this invention simultaneously supports the detection and parsing of HTTP 302 status code redirects and HTML meta refresh redirects, and is compatible with the redirection implementation methods of different micro-office gateways. Compared to existing technologies that only support HTTP 302 status code redirection detection, resulting in a 60% capture success rate, this invention increases the success rate to over 95%, solving the test interruption problem caused by the special redirection method.

[0018] Furthermore, this invention automatically replicates the manual authentication logic throughout the entire process by binding a network IP to access the external network to trigger redirection, resolving the gateway address and port, calling the authentication parameter interface to obtain dynamic authentication parameters, and sending an online request in combination with the user identifier. This achieves full-process simulation, and the test process is consistent with the data interaction logic of manual operation, thus improving the reliability of the test results. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic flowchart of an embodiment of the multi-user automated testing method for micro-office authentication provided by the present invention; Figure 2 For the present invention Figure 1A schematic diagram of an embodiment of step S101; Figure 3 For the present invention Figure 1 A schematic flowchart of an embodiment of step S103; Figure 4 This is a schematic diagram of an embodiment of the multi-user automated testing system for micro-office authentication provided by the present invention. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0022] It should be understood that the illustrative drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the invention. It should be understood that the operations in the flowcharts may be implemented out of order, and steps without logical contextual relationships may be reversed or performed simultaneously. Furthermore, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0023] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0024] This invention provides a multi-user automated testing method and system for micro-office authentication, which will be described below.

[0025] The multi-user automated testing method for micro-office authentication proposed in this invention is applied to a single test terminal, which is configured with multiple network IPs to simulate multiple terminal users. Figure 1 This is a schematic flowchart of an embodiment of the multi-user automated testing method for micro-office authentication provided by the present invention, as shown below. Figure 1As shown, the multi-user automated testing methods for micro-office authentication include: S101. Obtain multiple network IPs configured on the test terminal.

[0026] The test terminal refers to a single personal computer.

[0027] S102. For each of the multiple network IPs, bind the network IP to the preset external network address and receive the redirection response returned by the Micro Office Gateway.

[0028] Among them, the Micro Office Gateway is a core authentication device deployed between the enterprise intranet and the Internet. It is used to control the access permissions of intranet terminals to the external network. When an intranet terminal attempts to access the external network, the Micro Office Gateway will push an authentication page with a QR code, requiring the user to scan the code through the Micro Office APP to complete identity authentication before obtaining Internet access.

[0029] It should be noted that in step S102, after binding the network IP to the test terminal, a network request needs to be sent to the preset external network address first.

[0030] S103, a two-dimensional detection mechanism based on HTTP 302 status code redirection and HTML meta refresh redirection, extracts the redirect URL from the redirection response; S104. Parse the address and port of the Micro Office Gateway from the redirected URL, and call the authentication parameter interface of the Micro Office Gateway based on the address and port to obtain dynamic authentication parameters.

[0031] In a specific embodiment of the present invention, the dynamic authentication parameters include the terminal source IP address, the user unique identifier (uid), the timestamp, and the signature. The user unique identifier is a unique identifier generated for each user when initiating an external network request, and the timestamp is the authentication start time.

[0032] The signature can be obtained by hashing the terminal source IP address, user unique identifier and timestamp, which is used to prevent it from being tampered with during the authentication process.

[0033] Meanwhile, by setting dynamic authentication parameters including four parameters—terminal source IP address, user unique identifier, timestamp, and signature—the embodiments of the present invention further prevent tampering during the authentication process and further improve the reliability of the authentication process.

[0034] S105. Obtain the pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.

[0035] Among them, the user identifier refers to the information field pre-configured in the test terminal to uniquely represent the identity of each simulated terminal user. In actual micro-office authentication scenarios, the user identifier can be an employee's employee number, username, or mobile phone number, etc.

[0036] It should be noted that each network IP needs to execute steps S102-S105 to achieve automated testing of multiple IPs.

[0037] It should be understood that the multi-user automated testing method for micro-office authentication in this embodiment of the invention can be implemented in any device based on this method, such as personal computers, laptops, industrial control computers, cloud servers, automated testing nodes in production lines, or embedded testing modules integrated into network devices. Specifically, the multi-user automated testing method for micro-office authentication is stored in the aforementioned devices as a pre-compiled program or software library. When a test task is scheduled for execution or a preset test trigger condition is reached, the program is invoked to complete the entire micro-office authentication process.

[0038] Compared with existing technologies, the multi-user automated testing method for micro-office authentication provided in this invention, by configuring multiple network IPs on a single test terminal and independently executing binding access, redirection detection, parameter acquisition, and online request for each IP, achieves for the first time the simulation of the entire micro-office authentication process for multiple terminal users on a single PC. It eliminates the need to deploy multiple PCs or purchase dedicated testing equipment, reducing test resource consumption by over 90% and test costs by approximately 95%. Simultaneously, it replaces manual QR code scanning, reducing the authentication simulation of a single batch of 100 users from several hours to minutes.

[0039] Secondly, this invention supports the detection and parsing of both HTTP 302 status code redirects and HTML meta refresh redirects, and is compatible with the redirection implementation methods of different micro-office gateways. Compared to existing technologies that only support HTTP 302 status code redirection detection, resulting in a 60% capture success rate, this invention increases the success rate to over 95%, solving the test interruption problem caused by the special redirection method.

[0040] Furthermore, this embodiment of the invention automatically replicates the manual authentication logic throughout the entire process by binding a network IP to access the external network to trigger redirection, resolving the gateway address and port, calling the authentication parameter interface to obtain dynamic authentication parameters, and sending an online request in combination with the user identifier. This achieves full-process simulation, and the test process is consistent with the data interaction logic of manual operation, thus improving the reliability of the test results.

[0041] In existing testing protocols, testers need to manually identify and configure the list of valid IP addresses on the test terminals. This process is not only tedious and inefficient but also prone to errors. Because the terminal's network card may contain invalid addresses that cannot be used for actual network communication, such as loopback addresses (e.g., the 127.0.0.1 range) and link-local temporary IPs (e.g., 169.254.xx), manual configuration often mistakenly includes these addresses in the IP list. This leads to subsequent binding access failures or authentication requests that cannot be correctly routed, ultimately causing test interruptions or invalid results. Furthermore, when the terminal's network environment changes (e.g., switching network segments or plugging / unplugging network cables), the configured IP list becomes inapplicable, requiring manual verification and modification, further reducing the reliability and automation of the test.

[0042] To solve the above-mentioned technical problems, in some embodiments of the present invention, such as Figure 2 As shown, step S101 includes: S201. By calling the system interface of the test terminal through PowerShell commands, the IPv4 address is obtained, and loopback addresses and link-local temporary IPs are automatically filtered to obtain multiple network IPs.

[0043] When the test terminal is running a Windows system, the system interface is Get-NetIPAddress.

[0044] The loopback address is an address in the 127.0.0.1 range, and the link-local temporary IP is an IP address starting with 169.254.

[0045] S202. If PowerShell fails to obtain the IP address, then obtain the local egress IP address by connecting to a public DNS server and use the local egress IP address as the network IP address.

[0046] Specifically, the socket backup mechanism is triggered to connect to the public DNS server, where the address of the public DNS server is 8.8.8:80.

[0047] This invention employs a dual-mechanism strategy of PowerShell command-based acquisition and socket backup acquisition to ensure that at least one usable network IP can be obtained in any scenario. Furthermore, the automated network IP acquisition method eliminates the need for manual IP list configuration, preventing test failures caused by misconfigured invalid addresses from the outset. Simultaneously, it enables the test script to be used plug-and-play in different network environments without any manual adjustments, significantly improving the automation level, environmental adaptability, and result stability of the test.

[0048] In some embodiments of the present invention, such as Figure 3 As shown, step S103 includes: S301. Obtain and parse the response header of the network request sent to the external network address. When the HTTP 302 status code is identified, extract the Location field from the response header as the redirect URL.

[0049] Specifically, obtaining and parsing the response header of a network request sent to the external network address can be achieved in the following way: the test script calls the system command-line tool to initiate an HTTP request, and captures all the protocol interaction logs output by the tool to the standard error stream (stderr), obtaining the stderr text. By parsing the captured stderr text, the response header can be obtained.

[0050] S302. When the HTTP 302 status code is not recognized, parse the HTML meta refresh tag in the response header and match the HTML meta refresh tag using multiple regular expression matching rules to obtain the redirect URL.

[0051] Specifically, the multiple regular expression matching rules cover all mainstream tag formats such as content="0; url=xxx", content="0; url='xxx'", and content='0; url="xxx"', in order to further improve the success rate of obtaining redirected URLs.

[0052] In existing automated testing solutions, when calling the authentication parameter interface of the micro-office gateway or retrieving dynamic authentication parameters, if there are sudden network fluctuations, temporary high gateway load leading to response timeouts, or request failures due to occasional TCP connection resets, the entire testing process will immediately be interrupted and exit with an error. Due to the lack of any retry compensation mechanism, testers have to manually restart the script, and may even need to troubleshoot each failure and reconfigure the environment. This not only severely reduces testing efficiency but also makes long-term unattended stability testing infeasible.

[0053] To address the aforementioned technical problems, in some embodiments of the present invention, the multi-user automated testing method for micro-office authentication further includes: When dynamic authentication parameters cannot be successfully obtained, a retry operation is triggered; When the number of retries is less than the preset maximum, the system will respond to the retry operation and reacquire the dynamic authentication parameters.

[0054] The inability to successfully obtain dynamic authentication parameters includes the following situations: First, the authentication parameter interface cannot be called successfully; second, dynamic authentication parameters cannot be obtained; and third, the obtained dynamic authentication parameters are missing.

[0055] It should be noted that if the number of retries is greater than or equal to the preset maximum number and the dynamic authentication parameters still cannot be successfully obtained, the parameter capture for this network IP will be marked as failed, and subsequent authentication operations for this network IP will be terminated.

[0056] It should be understood that the preset maximum number of times can be configured in advance according to the actual application scenario or needs. In a specific embodiment of the present invention, the preset maximum number of times can be three.

[0057] This invention, by setting up automatic retry operations when authentication parameter interface calls fail, dynamic authentication parameter retrieval fails, or parameters are missing, repeatedly attempts to retrieve parameters before reaching a preset maximum number of retries. This effectively shields against interference from transient network failures and occasional gateway timeouts, ensuring that a single request failure no longer interrupts the overall test. Instead, the normal execution process is restored with a high probability through a limited number of retries, significantly enhancing the robustness of the test process. Furthermore, since temporary faults can be automatically bypassed without manual intervention, operational costs and the probability of test interruptions are greatly reduced.

[0058] While the above embodiments can configure multiple network IPs on a single test terminal and execute the authentication and online process independently for each IP, achieving the basic function of simulating multiple users with multiple IPs, the relationship between the user identifier and the network IP is not clear. Strictly speaking, the above embodiments implement a scenario where all network IPs share the same user identifier, i.e., a single-user multi-IP mode. However, in actual multi-user testing requirements of micro-office gateways, it is often necessary to simulate multiple different real users (each user has a unique employee ID or username) simultaneously going online through different terminal IPs to verify the gateway's ability to handle concurrent authentication for multiple users, i.e., a multi-user multi-IP scenario.

[0059] To enable multi-user, multi-IP scenarios, in some embodiments of the present invention, obtaining a pre-configured user identifier includes: The preset list of usernames is cyclically assigned to each network IP, enabling dynamic adaptation in single-user multi-IP or multi-user multi-IP scenarios.

[0060] This invention introduces a cyclic allocation mechanism, automatically and cyclically allocating a pre-defined list of usernames to each network IP address according to their index order. When the length of the username list equals the number of network IP addresses, a one-to-one mapping is automatically achieved, with each IP address receiving a unique username. This perfectly simulates the typical scenario in a real enterprise where multiple employees access the external network using independent terminals. When the username list length is 1, it automatically degenerates into a single-user, multi-IP mode, where the same username is cyclically assigned to each IP address. This can be used to verify the gateway's handling logic for the same user simultaneously accessing the network on multiple source IP addresses. When the username list length falls between these two extremes, the fairness of the allocation is still ensured through modulo operations. In other words, this invention achieves automated testing in a multi-user, multi-IP mode, significantly reducing the configuration complexity and manual intervention costs of multi-user testing scenarios.

[0061] Furthermore, to avoid interrupting the overall batch testing and affecting testing efficiency due to a failure in a single network IP test, in a specific embodiment of the present invention, when a single network IP fails to send an online request to the online interface of the micro-office gateway based on dynamic authentication parameters and user identifier, only the single network IP test is marked as failed, without interrupting the testing process of other network IPs.

[0062] Request failures include, but are not limited to, timeouts, connection errors, and incorrect response codes.

[0063] This invention introduces a single IP fault isolation strategy, which ensures that the overall batch testing process is not interrupted when a single network IP fails, thus guaranteeing testing efficiency.

[0064] The above embodiments can complete multi-user authentication simulation tests in a single batch, verifying the functional correctness and parameter capture capabilities of the micro-office gateway under a one-time batch request. However, in actual gateway testing requirements, in addition to functional verification, it is also necessary to evaluate the long-term stability of the gateway under continuous high load and its ability to withstand periodic authentication storms. For example, scenarios such as a large number of employees re-authenticating simultaneously after get off work or frequent reconnections due to network fluctuations all require the gateway to stably handle continuous multi-round authentication requests. Existing technologies cannot automatically repeat multi-round authentication processes. If stress testing or 24 / 7 stability testing is required, testers must manually and repeatedly start scripts or use external scheduled task tools, which is inefficient.

[0065] To address the aforementioned technical problems, in some embodiments of the present invention, the multi-user automated testing method for micro-office authentication further includes: Based on the preset number of loops and the waiting time between rounds, the automated testing operations on all network IPs are repeatedly executed to achieve stress testing or stability testing.

[0066] Specifically, when the number of loops is set to 1, it is a single-batch test, i.e., a stress test. When the number of loops is set to more than 1, multiple rounds of loop testing can be performed, i.e., a stability test, supporting 24 / 7 unattended operation. In other words, this embodiment of the invention, based on the number of loops and the waiting time between rounds, transforms the stability test, which originally required continuous human monitoring for several days, into a fully automated process, shortening the test cycle by more than 80% and greatly improving test efficiency.

[0067] To achieve rapid fault location in test failures, in some embodiments of the present invention, the multi-user automated testing method for micro-office authentication is characterized by further comprising: Acquire test logs, perform statistical analysis on the test logs based on preset quantitative indicators, and generate and output a structured test report.

[0068] When the quantitative indicators include the number of IPs identified, the number of successful parameter captures, the number of failed parameter captures, the number of skipped authentications (without redirection), the number of successful deployments, and the number of failed deployments, the structured test report includes the above quantitative indicators, the parameter capture success rate and deployment success rate calculated from the above quantitative indicators, and the failed IPs and reasons for failure based on the quantitative indicators, parameter capture success rate and deployment success rate.

[0069] This invention generates and outputs a structured test report, which clearly marks the failed IP address and the reason for the failure, enabling rapid fault location.

[0070] To illustrate the specific process of the multi-user automated testing method for micro-office authentication proposed in this embodiment of the invention, the following description is provided.

[0071] First, the implementation of this invention is based on a PC terminal with a Windows operating system. Multiple network IPs are configured on the PC's network card in advance, and a Python 3.6 or higher environment is installed, along with basic dependency libraries such as requests, re, json, socket, and subprocess. The core execution carrier is an automated test script, which triggers different test scenarios by configuring fixed parameters. The following are three typical examples: batch functional testing, multi-user stress testing, and 7×24-hour stability testing, which illustrate the core application scenarios.

[0072] Example 1: Single-round batch function test This embodiment is used to verify the effectiveness of the core authentication function of the micro-office gateway. A small number of network IPs are configured to perform a single batch test.

[0073] Fixed parameter configuration: Target external network address: http: / / www.ce.cn (used to trigger the gateway authentication page); Micro Office Gateway IP: 172.16.2.1, Gateway Port: 2070; Test username list: ["010801", "010802", "010803"]; Number of loops: 1 (single test), inter-round waiting time: 65 seconds; Request timeout: 20 seconds, number of parameter retries: 3.

[0074] IP identification execution: The script uses the PowerShell command `Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias ​​-notmatch 'Loopback' -and $_.IPAddress -notmatch '^169\.'} | Select-Object -ExpandProperty IPAddress` to identify the list of valid IPs configured on the test PC: ["192.168.1.101", "192.168.1.102"].

[0075] Redirection detection and parameter capture: For IP 192.168.1.101, when accessing http: / / www.ce.cn by binding the source IP, the HTML metarefresh redirect URL is detected as http: / / 172.16.2.1:2070 / auth?xxx; the gateway authentication interface http: / / 172.16.2.1:2070 / weibangong_auth_info.cgi is called to obtain the authentication parameters: {"ip":"192.168.1.101","uid":"123456","timestamp":"1718000000", "sign":"abcdef"}; For IP 192.168.1.102, capture the authentication parameters using the same process: {"ip":"192.168.1.102", "uid":"654321", "timestamp":"1718000010", "sign":"fedcba"}; The parameter capture success rate was 100% this time.

[0076] Batch deployment request: According to the circular allocation rule, 010801 is assigned to 192.168.1.101, and 010802 is assigned to 192.168.1.102; Concatenate the deployment request parameters and initiate an HTTPS request: https: / / 172.16.2.1:2070 / wbg / ?ip=192.168.1.101&name=010801&uid=123456&logintype=0×tamp=1718000000&sign=abcdef; Parsing the gateway response, both network IPs have a response code of 1 (authentication successful), indicating a 100% success rate for going online.

[0077] Test result statistics: IP identification count: 2, Parameter capture success count: 2, Authentication skipped count: 0, Successful online count: 2, Failed online count: 0; Parameter capture success rate: 100%; Go-live success rate: 100% Test conclusion: The core authentication function of the Micro Office Gateway is effective.

[0078] Example 2: Multi-user concurrent stress test This embodiment is used to verify the multi-user concurrent processing capability of the micro-office gateway. 100 network IPs are configured and a single batch test is performed to simulate 100 users authenticating and going online at the same time.

[0079] Fixed parameter configuration: Target external website address: http: / / www.ce.cn; Micro Office Gateway IP: 172.16.2.1, Gateway Port: 2070; Test username list: ["010801", "010802", ..., "010900"] (100 usernames); Number of loops: 1, waiting time between rounds: 65 seconds; Request timeout: 20 seconds, number of parameter retries: 3.

[0080] IP identification execution: The script identified 100 network IPs configured on the test PC: ["192.168.1.101", "192.168.1.102", ..., "192.168.1.200"].

[0081] Redirection detection and parameter capture: Redirect detection and parameter capture were performed on 100 IPs in batch. Parameters were successfully captured on 98 IPs, while parameter capture failed on 2 IPs due to temporary gateway lag (failed after 3 retries). The parameter capture success rate was 98%.

[0082] Batch deployment request: Usernames were assigned to the 98 IPs whose parameters were captured in a loop, and batch online requests were initiated. 93 IPs were successfully online, and 5 IPs timed out due to excessive gateway concurrency pressure. The online success rate was 94.9% (93 / 98).

[0083] Test Result Statistics and Analysis: IP identification count: 100, successful parameter capture count: 98, failed parameter capture count: 2, successful online count: 93, failed online count: 5; Test results: The concurrent processing capacity of the micro-office gateway is approximately 90-95 users / time. Slight lag occurs when there are 100 concurrent users, indicating that the gateway's concurrent processing performance needs to be optimized.

[0084] Example 3: 7×24-hour stability test This example is used to verify the long-term operational stability of the micro-office gateway. It is configured with 20 network IPs and performs a 7×24-hour cyclical test, with one round every 5 minutes.

[0085] Fixed parameter configuration: Target external website address: http: / / www.ce.cn; Micro Office Gateway IP: 172.16.2.1, Gateway Port: 2070; Test username list: ["010801", ..., "010820"] (20 usernames); Number of cycles: Unlimited (7 x 24 hours), waiting time between cycles: 300 seconds (5 minutes / cycle); Request timeout: 20 seconds, number of parameter retries: 3.

[0086] Test execution: The script automatically loops through IP identification, parameter capture, and batch deployment processes, operating 24 / 7 without human intervention, and recording test logs and statistical results for each round.

[0087] Test results statistics (7 days): Total number of cycles: 2016; Cumulative number of authenticated IPs: 20 × 2016 = 40320 times; Overall parameter capture success rate: 99.8%; Overall deployment success rate: 99.5%. Failure reasons statistics: Network fluctuations caused parameter capture failures in 0.15% of cases, temporary gateway lag caused online failures in 0.35% of cases, and there were no persistent failures.

[0088] Test conclusion: During the long-term operation of the micro-office gateway for 7×24 hours, the authentication function is stable without persistent failures. There are only a small number of occasional failures caused by network fluctuations and temporary lags, meeting the actual usage requirements of enterprises.

[0089] In summary, the multi-user automated testing method for micro-office authentication proposed in the embodiments of the present invention: 1. It首创a multi-user simulation mode with a single PC + multiple IP configurations for the first time, breaking through the hardware limitation of traditional single-user testing that requires a single PC. Without a dedicated tester, the test resource occupancy is reduced by 90%, and the test cost is reduced by 95% compared to using a dedicated tester. It replaces manual QR code scanning operations, and the batch testing efficiency is increased by more than 10 times. It only takes 5 minutes to test 100 users in a single batch, solving the industry pain points of high test resource costs and low efficiency for multi-user testing. 2. It首次实现the full automation replication of the entire process of manual authentication of the micro-office gateway for the first time. From triggering the QR code authentication page to parameter interaction and then to user online, each step is consistent with the logic and data interaction of manual operations. The authentication parameters captured through two-dimensional redirect detection completely replace the core data interaction link of manual QR code scanning, and the consistency between the test results and manual measurements reaches 99%, solving the technical problem that automated testing cannot restore the real authentication process. 3. It首次将HTML meta refresh redirect纳入the detection scope for the first time and designs multiple regular expression matching rules to cover all mainstream tag formats. The success rate of capturing authentication parameters is increased from 60% to over 95%, solving the problem of parameter capture failure caused by special redirect methods of some micro-office gateways. 3. It集成three core scenarios of functional testing, multi-user concurrent stress testing, and 7×24-hour stability testing: A single batch test can verify the concurrent processing ability of the gateway (stress testing), multiple rounds of loop testing can verify the long-term operation stability of the gateway (stability testing), and the parameter capture and online results of each round can verify the core authentication function of the gateway (functional testing). Compared with traditional single-functional testing schemes, the test coverage is increased by 80%, and the stability testing cycle is shortened by 80%, achieving one test and full-dimensional verification. 4. Three fault tolerance designs of dual-mechanism IP collection, 3 times of parameter retry, and single-IP fault isolation enable normal operation even during network fluctuations and interface anomalies, greatly improving the test stability. It is compatible with multi-IP configurations of the Windows system and adapts to micro-office gateway devices of different manufacturers. Without modifying the core logic, only the configuration items need to be adjusted to quickly adapt to the test requirements of different enterprises. It is fully automated, supports unattended operation for 7×24 hours, automatically generates a structured test report, and does not require manual recording and statistics, reducing the workload of testers by more than 90%. 5. It实现the quantitative output of all test results, and at the same time clearly marks the failed IP and the reasons for failure (parameter missing, request timeout, response failure, etc.). The operation and maintenance personnel can directly locate the gateway fault points based on the report, and the fault location efficiency is increased by more than 80%.

[0090] It should be noted that there are some inaccuracies in the original Chinese text which may affect the understanding. For example, "首创" should be "creates for the first time", "首次实现" should be "realizes for the first time", "首次将" should be "includes for the first time", "集成" should be "integrates", "实现" should be "achieves" in a more accurate English expression. But according to the translation requirements, the above translation is based on the original text.On the other hand, embodiments of the present invention also provide a multi-user automated testing system for micro-office authentication, applied to a single test terminal, wherein the test terminal is configured with multiple network IPs for simulating multiple terminal users; such as Figure 4 As shown, the Micro Office Certification Multi-User Automated Testing System 400 includes: IP acquisition module 401 is used to acquire the multiple network IPs configured on the test terminal; The redirection response module 402 is used to bind the network IP to a preset external network address for each of the plurality of network IPs and to receive the redirection response returned by the micro-office gateway. The dual-dimensional redirection detection module 403 is used to extract the redirection URL from the redirection response through a dual-dimensional detection mechanism based on HTTP 302 status code redirection and HTML metarefresh redirection. The dynamic parameter acquisition module 404 is used to parse the address and port of the micro-office gateway from the redirected URL, and call the authentication parameter interface of the micro-office gateway based on the address and port to obtain dynamic authentication parameters; The online request module 405 is used to obtain a pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.

[0091] The multi-user automated testing system 400 for micro-office authentication provided in the above embodiments can implement the technical solutions described in the above embodiments of the multi-user automated testing method for micro-office authentication. The specific implementation principles of each module or unit can be found in the corresponding content in the above embodiments of the multi-user automated testing method for micro-office authentication, and will not be repeated here.

[0092] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0093] The above provides a detailed description of the multi-user automated testing method and system for micro-office authentication provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A multi-user automated testing method for micro-office authentication, characterized in that, Applied to a single test terminal, the test terminal is configured with multiple network IPs for simulating multiple terminal users, the method includes: Obtain the multiple network IPs configured on the test terminal; For each of the multiple network IPs, bind the network IP to access the preset external network address and receive the redirection response returned by the micro-office gateway; Based on a two-dimensional detection mechanism of HTTP 302 status code redirection and HTML meta refresh redirection, the redirect URL is extracted from the redirect response; The address and port of the Micro Office Gateway are parsed from the redirected URL, and the authentication parameter interface of the Micro Office Gateway is called based on the address and port to obtain dynamic authentication parameters; Obtain the pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.

2. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, The step of obtaining the plurality of network IPs configured on the test terminal includes: The system interface of the test terminal is invoked using PowerShell commands to obtain the IPv4 address, and loopback addresses and link-local temporary IPs are automatically filtered to obtain the multiple network IPs; If PowerShell fails to retrieve the IP address, the local machine's egress IP address is obtained by connecting to a public DNS server, and this local egress IP address is used as the network IP address.

3. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, The dual-dimensional detection mechanism based on HTTP 302 status code redirection and HTML meta refresh redirection extracts the redirect URL from the redirection response, including: Obtain and parse the response header of the network request sent to the external address. When the HTTP 302 status code is identified, extract the Location field from the response header as the redirect URL. When the HTTP 302 status code is not recognized, the HTML meta refresh tag in the response header is parsed, and the HTML meta refresh tag is matched using multiple regular expression matching rules to obtain the redirect URL.

4. The multi-user automated testing method for micro-office authentication according to claim 1 or 3, characterized in that, The method further includes: When the dynamic authentication parameters cannot be successfully obtained, a retry operation is triggered; When the number of retry operations is less than the preset maximum number, the dynamic authentication parameters are reacquired in response to the retry operation.

5. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, If the user identifier is a username, then obtaining the pre-configured user identifier includes: The preset list of usernames is cyclically assigned to each of the network IPs to achieve dynamic adaptation in single-user multi-IP or multi-user multi-IP scenarios.

6. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, When a single network IP fails to send an online request to the micro-office gateway's online interface based on the dynamic authentication parameters and the user identifier, only that single network IP is marked as having failed the test, without interrupting the testing process for other network IPs.

7. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, The method further includes: Based on the preset number of loops and the waiting time between rounds, the automated testing operations on all network IPs are repeatedly executed to achieve stress testing or stability testing.

8. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, The method further includes: Acquire test logs, perform statistical analysis on the test logs based on preset quantitative indicators, and generate and output a structured test report; The structured test report includes the number of IPs identified, the number of successful parameter captures, the number of failed parameter captures, the number of successful deployments, the number of failed deployments, the parameter capture success rate, and the deployment success rate, and marks the failed IPs and the reasons for the failures.

9. The multi-user automated testing method for micro-office authentication according to claim 1, characterized in that, The dynamic authentication parameters include the terminal source IP address, user unique identifier, timestamp, and signature.

10. A multi-user automated testing system for micro-office authentication, characterized in that, The system is applied to a single test terminal, which is configured with multiple network IPs for simulating multiple terminal users; the system includes: The IP acquisition module is used to acquire the multiple network IPs configured on the test terminal; The redirection response module is used to bind each of the multiple network IPs to a preset external network address and receive a redirection response returned by the micro-office gateway. A two-dimensional redirection detection module is used to extract the redirection URL from the redirection response through a two-dimensional detection mechanism based on HTTP 302 status code redirection and HTML meta refresh redirection. The dynamic parameter acquisition module is used to parse the address and port of the micro-office gateway from the redirected URL, and call the authentication parameter interface of the micro-office gateway based on the address and port to obtain dynamic authentication parameters; The online request module is used to obtain a pre-configured user identifier, and send an online request to the online interface of the micro-office gateway based on the dynamic authentication parameters and the user identifier to complete the micro-office authentication of the terminal user corresponding to the network IP.