Test method and device, electronic equipment and storage medium

By establishing a binding relationship between the device and the test environment in Internet testing and dynamically managing the connection between the device and the test environment, the complex problems of manual operation in the existing methods are solved, simple device and test environment operation is achieved, and team collaboration efficiency and test quality are improved.

CN120583010APending Publication Date: 2025-09-02BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510674925.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

Existing Internet testing methods rely too much on manual operation, resulting in complex connection relationships between the device and the test environment, frequent configuration conflicts, and low team collaboration efficiency.

Method used

By establishing a binding relationship between the target device and the target test environment, dynamically manage the connection between the device and the test environment, using domain name mapping rules to automatically point to the target network resources, supports multiple domain name resolution methods, and is compatible with dual-mode resolution protocols.

Benefits of technology

Simplifies the connection operation between the device and the test environment, avoids configuration conflicts, improves team collaboration efficiency and test quality, and reduces communication costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583010A_ABST
    Figure CN120583010A_ABST
Patent Text Reader

Abstract

The invention relates to a test method and device, electronic equipment and a storage medium, and the method provided by the embodiment of the invention comprises the steps: responding to a test environment access operation for target equipment, building a binding relation between the target equipment and a target test environment, and when a domain name access request from the target equipment is received, sending the domain name access request to the target equipment; and according to a domain name mapping rule corresponding to the target test environment, pointing a target domain name requested to be accessed by the target equipment to an address of a corresponding target network resource in the target test environment, so that the target equipment tests the target network resource in the target test environment. According to the mode, the access operation of the user is responded, the binding relationship between the target equipment and the target test environment is dynamically managed, the operation is simple and convenient, the problems that the binding relationship between the equipment and the test environment is manually managed and the operation is complicated are solved, the test efficiency and the test quality of team cooperation are further ensured, and the team communication cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of the Internet, more and more Internet products need to be tested, which in turn drives the rapid development of the testing field.

[0003] In the prior art, there are several testing methods, such as the independent test domain name method, the Hosts hijacking method, the independent wireless network method, etc. Although these methods can meet the testing needs to a certain extent, they generally have a disadvantage: excessive reliance on manual operations, especially when frequently adjusting the connection relationship between the device and the test environment, the complexity of the operation increases sharply, which in turn leads to frequent configuration conflicts and high team collaboration and communication costs. For example, in the independent test domain name method, due to the significant differences in certificate and network resource configuration between the test domain name and the production domain name, problems such as certificate verification failure and cross-domain access anomalies frequently occur, seriously affecting the smooth progress of the test; the Hosts hijacking method requires frequent synchronization of Hosts configuration rules during the team collaboration process, which not only increases communication costs, but also greatly reduces team collaboration efficiency; the independent wireless network method requires testers to frequently manually switch the wireless network to which the device is connected. This process is complex, tedious and time-consuming, seriously affecting test efficiency. Summary of the Invention

[0004] The present application provides a testing method, device, electronic device and storage medium to solve the technical problems that existing testing methods rely too much on manual and frequent operation of the connection between the device and the test environment, and the operation is complicated, which easily leads to frequent configuration conflicts and high costs of team collaboration and communication.

[0005] In a first aspect, the present application provides a testing method, comprising:

[0006] In response to a test environment access operation for a target device, establishing a binding relationship between the target device and a target test environment; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments;

[0007] When a domain name access request is received from the target device, the target domain name requested to be accessed by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0008] In a possible implementation, in response to the test environment access operation on the target device, establishing a binding relationship between the target device and the target test environment includes:

[0009] In response to a test environment access operation on a target device, triggering a test environment access request, wherein the test environment access request is used to instruct the target device to access a target test environment;

[0010] A binding relationship between the target device and the target test environment is established.

[0011] In a possible implementation, in response to the test environment access operation on the target device, establishing a binding relationship between the target device and the target test environment includes:

[0012] In response to a test environment access operation on a target device, triggering a test environment switching request, wherein the test environment switching request is used to instruct the target device to switch to a target test environment;

[0013] The binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

[0014] In a possible implementation, establishing a binding relationship between the target device and the target test environment includes:

[0015] Determining a target test environment indicated by the test environment access operation;

[0016] Obtaining a user account corresponding to the target device;

[0017] In a case where it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

[0018] In a possible implementation, establishing a binding relationship between the target device and the target test environment includes:

[0019] Obtain the current IP address of the target device;

[0020] Establishing an association relationship between the current IP address of the target device and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment;

[0021] After establishing the binding relationship between the target device and the target test environment, the method further includes:

[0022] When it is monitored that the IP address of the target device is changed, the IP address in the association relationship is updated using the changed IP address of the target device.

[0023] In a possible implementation, establishing an association relationship between the current IP address of the target device and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment includes:

[0024] Obtaining unique identification information of the target device;

[0025] Establishing an association between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment;

[0026] Updating the IP address in the association relationship using the changed IP address of the target device includes:

[0027] Searching for a target association relationship containing the unique identity information of the target device from the multiple established association relationships;

[0028] The IP address in the target association relationship is updated using the changed IP address of the target device.

[0029] In a possible implementation manner, after establishing the binding relationship between the target device and the target test environment, the following steps are included:

[0030] When it is detected that the target device has not accessed the target test environment within a set time period, the binding relationship between the target device and the target test environment is released.

[0031] In a second aspect, the present application provides a testing device, comprising:

[0032] a binding relationship establishing module, configured to establish a binding relationship between the target device and a target test environment in response to a test environment access operation on the target device; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments;

[0033] The test module is used to, when receiving a domain name access request from the target device, point the target domain name requested by the target device to the address of the corresponding target network resource in the target test environment according to the domain name mapping rules corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0034] In a possible implementation, the binding relationship establishing module is configured to:

[0035] In response to a test environment access operation on a target device, triggering a test environment access request, wherein the test environment access request is used to instruct the target device to access a target test environment;

[0036] A binding relationship between the target device and the target test environment is established.

[0037] In a possible implementation, the binding relationship establishing module is configured to:

[0038] In response to a test environment access operation on a target device, triggering a test environment switching request, wherein the test environment switching request is used to instruct the target device to switch to a target test environment;

[0039] The binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

[0040] In a possible implementation, the binding relationship establishing module is configured to:

[0041] Determining a target test environment indicated by the test environment access operation;

[0042] Obtaining a user account corresponding to the target device;

[0043] In a case where it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

[0044] In a possible implementation, the binding relationship establishing module includes:

[0045] An IP address acquisition unit, configured to acquire the current IP address of the target device;

[0046] a binding relationship establishing unit, configured to establish an association relationship between the current IP address of the target device and the area identifier of the target test environment, so as to establish a binding relationship between the target device and the target test environment;

[0047] After establishing the binding relationship between the target device and the target test environment, the method further includes:

[0048] When it is monitored that the IP address of the target device is changed, the IP address in the association relationship is updated using the changed IP address of the target device.

[0049] In a possible implementation, the binding relationship establishing unit is configured to:

[0050] Obtaining unique identity information of the target device;

[0051] Establishing an association between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment;

[0052] Updating the IP address in the association relationship using the changed IP address of the target device includes:

[0053] Searching for a target association relationship containing the unique identity information of the target device from the multiple established association relationships;

[0054] The IP address in the target association relationship is updated using the changed IP address of the target device.

[0055] In a possible implementation manner, after establishing the binding relationship between the target device and the target test environment, the following steps are included:

[0056] When it is detected that the target device has not accessed the target test environment within a set time period, the binding relationship between the target device and the target test environment is released.

[0057] In a third aspect, the present application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to:

[0058] In response to a test environment access operation for a target device, establishing a binding relationship between the target device and a target test environment; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments;

[0059] When a domain name access request is received from the target device, the target domain name requested to be accessed by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0060] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the testing method described in the first aspect of the present application.

[0061] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, in response to the test environment access operation of the target device, establishes a binding relationship between the target device and the target test environment, and when receiving a domain name access request from the target device, points the target domain name requested by the target device to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment. This method realizes the dynamic management of the binding relationship between the target device and the target test environment in response to the user's access operation, is easy to operate, avoids excessive reliance on manual frequent operation of the connection relationship between the device and the test environment and the problem of complex operation, thereby ensuring the test efficiency and test quality of team collaboration and reducing team communication costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0064] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0065] Figure 1 A flow chart of an embodiment of a testing method provided in an embodiment of the present application;

[0066] Figure 2 A flow chart of another testing method provided in an embodiment of the present application;

[0067] Figure 3 A flow chart of another testing method provided in an embodiment of the present application;

[0068] Figure 4 A flow chart of another testing method provided in an embodiment of the present application;

[0069] Figure 5 A schematic diagram of the structure of a testing device provided in an embodiment of the present application;

[0070] Figure 6A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0072] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.

[0073] The existing Hosts hijacking method is to modify the local Hosts file used for domain name resolution in the operating system to force a specific domain name to point to a specified IP address. For example, the specific domain name "aiqiyXX.com" is pointed to the IP address of the test environment server. Although this method points the specific domain name to the corresponding IP address, it only supports manual modification of the Hosts file on a computer and does not support other devices such as mobile phones and TVs. Moreover, after modifying the Hosts file and completing the test, the user may easily forget to manually change back to the original Hosts file, resulting in residual configuration and causing traffic to enter the wrong environment. It can be seen that when applying the Hosts hijacking method, the Hosts configuration rules need to be frequently synchronized during team collaboration, resulting in high communication costs and low team collaboration efficiency.

[0074] The independent test domain name method is a test environment construction method that assigns a dedicated domain name (such as test.api.com) to the test environment and isolates it from the production environment domain name (such as api.com) in terms of network resolution and physical deployment. Domain name isolation achieves physical isolation between the test environment and the production environment, preventing testing activities from affecting production services. In this way, the code of the test environment may differ from the code logic of the production environment, resulting in the failure to expose production environment-specific problems during testing in the test environment. In addition, due to significant differences in the certificate and network resource configurations between the test domain name and the production domain name, problems such as certificate verification failure and cross-domain access anomalies frequently occur, requiring additional configuration to resolve.

[0075] The independent wireless network method is a method of building an independent test network environment by deploying physically isolated wireless routers. Its core is to utilize the physical independence of the wireless network and the domain name resolution hijacking capabilities of the router to isolate the test environment traffic from the production environment. This method builds a test network by deploying dedicated wireless routers. Each router corresponds to an independent test environment. The test equipment needs to manually connect to the wireless network of a specific router to ensure that network traffic flows only within the test environment and is completely isolated from the production network. This method will cause frequency band competition among multiple routers in the same space, resulting in network signal attenuation, which in turn affects the stability of the test. When collaborating in a team, poor network signals often occur, making collaborative testing difficult and affecting test efficiency. In addition, this method requires testers to manually switch the wireless network to which the device is connected, which is complicated and cumbersome, affecting test efficiency.

[0076] In order to solve the technical problems that the existing testing methods are overly dependent on manual and frequent operation of the connection relationship between the device and the test environment, and the operation is complicated, which easily leads to frequent configuration conflicts and high costs of team collaboration and communication, the solution of the present application responds to the test environment access operation of the target device, establishes a binding relationship between the target device and the target test environment, and when a domain name access request from the target device is received, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment. This method realizes the dynamic management of the binding relationship between the target device and the target test environment in response to the user's access operation, is easy to operate, avoids the frequent manual operation of the connection relationship between the device and the test environment, and further avoids the defects of the existing testing methods, that is, there is no need to manually change the wireless network frequently to switch the test environment, and it will not cause problems such as certificate verification failure and cross-domain access anomalies, thereby ensuring the test efficiency and test quality of team collaboration and reducing the cost of team communication. The embodiments of the present application will be described in detail below.

[0077] Figure 1 This is a flow chart of an embodiment of a test method provided in the embodiment of the present application. Figure 1 As shown, the following steps are included:

[0078] Step 101: In response to a test environment access operation for a target device, a binding relationship between the target device and the target test environment is established.

[0079] The target devices include, but are not limited to, mobile phones, computers, and televisions. Users can select various types of device terminals as target devices for testing. Therefore, the technical solution provided by the embodiments of the present application supports multiple types of device terminals, such as computers, mobile phones, and televisions, thereby resolving the drawback of existing testing methods that only support testing using computers.

[0080] The above-mentioned target test environment refers to one of the pre-built logically isolated test environments. Specifically, the test environment partitioning technology can be used to divide the existing test environment set into multiple independent and logically non-interfering test environments, that is, logically isolated test environments. Here, regarding multiple logically isolated test environments, it can be understood that: each test environment corresponds to an area, and the area does not refer to the division of physical space, but a logical concept definition, representing an independent and complete test scenario category. Among them, each area contains the mapping rule information of the current test environment. These rule information defines the key elements such as data flow, processing logic, etc. in the test environment. At the same time, in order to facilitate identification and management, each test environment corresponds to a regional identifier, thereby ensuring that each test environment is logically isolated.

[0081] In one embodiment, in response to the test environment access operation of the target device, a binding relationship between the target device and the target test environment is established. Specifically, at the client level, the user can select a device as the target device through the visual interface provided by the execution subject of the embodiment of the present application, and select a test environment that the user wants to access using the above-mentioned target device from multiple pre-built logically isolated test environments as the target test environment, and then operate the access operation to the target device and the corresponding target test environment. For example, an "access" icon may be provided on the above-mentioned visual interface, and the user can click on the icon to trigger the test environment access operation for the target device.

[0082] At the server level, in response to the test environment access operation on the target device, a binding relationship between the target device and the target test environment selected by the user is established.

[0083] For example, a user can view all device information (such as device 1, device 2, and device 3) under their account and multiple logically isolated test environments (such as test environment 1, test environment 2, and test environment 3) on the client interface. The user selects a target device (such as device 1) and a target test environment (such as test environment 2) from the aforementioned device information and multiple logically isolated test environments, and then operates the target device to connect to the target test environment (connecting test environment 2 to device 2). At the server level, in response to the test environment access operation on the target device, a binding relationship between the target device and the target test environment is established (binding device 2 to test environment 2).

[0084] It can be seen that by simply selecting a device and accessing the test environment of the target device on the visual interface, the user can trigger the execution subject of the embodiment of the present application to establish a binding relationship between the target device and the target test environment, and access the target device to the target test environment, thereby making the user's connection operation between the device and the test environment simpler and more convenient, without the need to frequently operate the connection relationship between different devices and test environments.

[0085] In one embodiment, the specific implementation method of establishing the binding relationship between the target device and the target test environment is: obtaining the current IP address of the target device; establishing an association relationship between the current IP address of the target device and the regional identifier of the target test environment to establish the binding relationship between the target device and the target test environment.

[0086] Specifically, in the process of establishing a binding relationship between the target device and the target test environment, the execution entity of the technical solution provided in the embodiment of the present application binds the target device and the target test environment based on the network IP address to which the target device is currently connected and the regional identifier of the target test environment. Therefore, the embodiment of the present application first obtains the network IP address to which the target device is currently connected and the regional identifier of the target test environment, and then establishes an association relationship between the current network IP address of the target device and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment.

[0087] For example, the user connects test environment 3 to the target device. At this time, the network IP address to which the target device is currently connected: 123.1.2.X3X, and the regional identifier of the target test environment 3: XX3a are obtained. Then, an association relationship is established between the network IP address and the regional identifier of the target test environment 3: {123.1.2.X3X-XX3a}, to establish a binding relationship between the above-mentioned target device and the target test environment 3.

[0088] Step 102: When a domain name access request is received from a target device, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0089] The domain name access request includes, but is not limited to, the domain name address information currently being accessed by the target device. The domain name mapping rules corresponding to the target test environment refer to a set of mapping relationships between domain names in the target test environment and the server IP addresses of network resources. This set of mapping relationships includes mappings between all domain names in the target test environment and their corresponding server IP addresses of network resources. This mapping relationship is used to direct the domain name of the target test environment to the server IP address of the corresponding network resource, thereby accessing the corresponding network resource.

[0090] In one embodiment, when a domain name access request is received from a target device, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rules corresponding to the target test environment, so that the target device can test the target network resource in the target test environment. Specifically, when a domain name access request is received from a target device, the domain name access request is parsed to obtain the target domain name, and the domain name mapping rules of the target test environment are searched according to the target domain name, that is, the set of mapping relationships between the domain name of the target test environment and the server IP address of the network resource, and the server IP address of the target network resource corresponding to the target domain name is found. The target domain name requested by the target device is pointed to the server IP address of the target network resource, so that the target device can access and test the target network resource in the target test environment.

[0091] For example, when a domain name access request is received from a target device, the domain name access request is parsed to obtain a target domain name "aiqX.com". According to the above target domain name, a mapping relationship set of the domain name corresponding to the target test environment and the server IP address of the network resource is searched: {aiqX.com-101.1.12.X, ioX.com-102.1.2.X, qo.X.com-213.1.3.X, ro.X.com-212.2.3.X, ...} is searched to determine the server IP address "101.1.12.X" of the network resource corresponding to the target domain name. The target domain name "aiqX.com" requested to be accessed by the target device is pointed to the server IP address "101.1.12.X" of the above network resource, so that the target device can test the target network resource in the target test environment.

[0092] The method provided in the embodiment of the present application establishes a binding relationship between the target device and the target test environment in response to the test environment access operation of the target device. When a domain name access request is received from the target device, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment. This method realizes the dynamic management of the binding relationship between the target device and the target test environment in response to the user's access operation, is easy to operate, avoids excessive reliance on manual frequent operation of the connection relationship between the device and the test environment, and avoids the problem of complex operation, thereby ensuring the test efficiency and test quality of team collaboration and reducing team communication costs.

[0093] Figure 2 This is a flow chart of another testing method provided in the embodiments of the present application. Figure 2 exist Figure 1 Based on the process shown, this article mainly describes how to dynamically switch the target test environment to which the target device is connected. The main steps include:

[0094] Step 201: In response to a test environment access operation on a target device, a test environment access request is triggered, and a binding relationship between the target device and the target test environment is established.

[0095] Step 202: In response to the test environment access operation for the target device, a test environment switching request is triggered, the binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

[0096] The following is a unified description of the above steps 201 and 202:

[0097] In one embodiment, in response to a test environment access operation on a target device, a test environment access request is triggered, and a binding relationship between the target device and the target test environment is established. Specifically, a user can select a device as a target device and a test environment to be connected to the target device as a target test environment through a visual interface provided by an execution subject of an embodiment of the present application. In response to the user's test environment access operation on the target device, a test environment access request is triggered, the test environment access request carrying the device information of the target device selected by the user on the visual interface and the region identifier of the target test environment. Based on the target test environment region identifier and the device information of the target device carried in the request, a binding relationship between the target device and the target test environment is established.

[0098] The test environment access request is used to instruct the target device to access the target test environment when the current target device is not connected to any test environment.

[0099] For example, if the current target device is not connected to any test environment, that is, the current target device cannot access any test environment, and the user performs an operation on the visual interface to connect the target device to test environment 1, a test environment access request will be triggered. In response to the device information of the target device and the region identifier of the target test environment carried in the test environment access request, the technical solution provided in the embodiment of the present application can connect the target device to target test environment 1.

[0100] In one embodiment, in response to a test environment access operation on a target device, a test environment switching request is triggered, the binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

[0101] Specifically, when the current target device is connected to the target test environment, the user performs an operation on the visual interface to connect the target device to the new target test environment. In response to the user's access operation on the target device to the new target test environment, a test environment switching request is triggered. According to the test environment switching request, the new target test environment indicated by the above switching request is determined, the binding relationship between the target device and the current target test environment is released, and the binding relationship between the target device and the new target test environment is established to achieve the switching of the target device to the target test environment.

[0102] The test environment switching request is used to instruct the target device to switch access to a target test environment when the current target device has been connected to a certain test environment.

[0103] For example, the target device is currently connected to test environment 1. At this time, the user wants to switch the target device to test environment 2. In this case, the user performs an operation to connect the target device to test environment 2, which triggers a test environment switch access request. In response to the test environment switch access request, the technical solution provided in the embodiment of the present application can release the binding relationship between the target device and the current test environment 1, switch the target device to the target test environment 2, and establish a binding relationship between the target device and the target test environment 2.

[0104] Step 203: When a domain name access request is received from the target device, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0105] For a detailed description of step 203, see the Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0106] The solution provided in the embodiment of the present application, after establishing the binding relationship between the target device and the target test environment, supports both traditional DNS (Domain Name System) and HttpsDNS (DNS over HTTPS, Domain Name System based on HTTPS) domain name resolution methods, that is, it is compatible with dual-mode resolution protocols. Among them, the above-mentioned traditional DNS refers to directly converting the domain name into a server IP address that can be recognized by the computer, that is, plain text transmission. The above-mentioned HttpsDNS refers to encrypting the domain name and then communicating directly with the server through a specific transmission channel, that is, encrypted transmission. HttpsDNS is not supported in the configuration of some test environments, and special processing is required to point the encrypted transmitted domain name to the server IP address of the corresponding target network resource. The above-mentioned special processing often causes deviations between the test environment and the real online environment, which in turn causes some functions in the test environment to be used normally, but the real online environment does have functional abnormalities.

[0107] The solution provided in the embodiment of the present application is compatible with the dual-mode resolution protocol. Regardless of the domain name transmission method used, the target domain name can be pointed to the server IP address of the corresponding target network resource. It is compatible with different test environment configurations and can simulate more realistic user scenarios. At the same time, there is no need to manually disable HttpsDNS, simplifying the testing process.

[0108] The above embodiment describes how to dynamically switch the target test environment to access the target device. By simply selecting the target test environment to switch the target device to on the visual interface, the target device can be switched to the corresponding target test environment. There is no need to manually switch the wireless network connected to the device frequently to switch the test environment to which the target device is connected. There will be no certificate verification failure and cross-domain access exceptions, and there is no need to manually disable HttpsDNS, which simplifies user operations while simplifying the testing process.

[0109] Figure 3 This is a flow chart of another testing method provided in the embodiments of the present application. Figure 3 exist Figure 1 Based on the process shown in the figure, this article mainly describes how to establish a binding relationship between the current user's target device and the target test environment based on the current user's access rights. The main steps include:

[0110] Step 301: In response to a test environment access operation on a target device, determine a target test environment indicated by the test environment access operation.

[0111] Step 302: Obtain the user account corresponding to the target device.

[0112] Step 303: When it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

[0113] Step 304: When a domain name access request is received from the target device, the target domain name requested by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0114] The following is a unified description of steps 301 to 304:

[0115] The above user account refers to the account information of the user currently logged in on the target device.

[0116] In one embodiment, in response to a test environment access operation on a target device, the target test environment indicated by the test environment access operation is determined, a user account corresponding to the target device is obtained, and when it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

[0117] Specifically, in response to a user's test environment access operation on a target device, the target test environment indicated by the test environment access operation is first determined. Then, the user account information corresponding to the target device is obtained. The user's permission information stored in the database is searched based on the user account information. The permission information includes the set of test environments to which the current user account has access rights. Then, based on the permission information of the current user account, it is determined whether the user has access rights to the target test environment. If it is determined that the user account has access rights to the target test environment, a binding relationship is established between the target device and the target test environment.

[0118] An access permission control mechanism is set up in the technical solution provided in the embodiment of the present application. After the user logs in to the unified management platform provided by the executive entity of the embodiment of the present application through the user account, the user can see all device information of the currently logged-in user account and all test environment sets to which the current user has access permissions on the visual interface. The user can establish a binding relationship between any target device and any target test environment based on the device information and test environment set of the current interface, so that the user can operate the target device to access the corresponding target test environment.

[0119] When a user attempts to access the target device's test environment, an access permission verification mechanism is triggered to prevent the user from accessing a test environment they don't have access to, which could cause conflicts in the team's test configuration. If the permission verification passes, meaning the user has access to the target test environment, a binding relationship is established between the target device and the target test environment.

[0120] For example, in the above embodiment, in response to the user's access operation to the test environment 3 of the target device, the user account L of the current user is obtained, and the permission information stored in the database is searched according to the above user account L, that is, the set of test environments to which the current user has access rights: {test environment 1, test environment 3, test environment 5, test environment 6}. It can be known that the user account L has access rights to the test environment 3, and then the binding relationship between the above target device and the test environment 3 is established.

[0121] For a detailed description of step 304 , please refer to the relevant description of the above embodiment.

[0122] The relevant description of the above embodiment, by setting up a corresponding access permission control mechanism, verifies the access permission of the user account logged in to the target test environment to be bound before establishing the binding relationship between the target device and the target test environment, thereby preventing test configuration conflicts between team members caused by accessing the wrong test environment, ensuring smooth team collaboration, and improving the testing efficiency of team collaboration.

[0123] Figure 4 This is a flow chart of another testing method provided in the present application. Figure 4 exist Figure 1 Based on the process shown in the figure, this article mainly describes how to establish a binding relationship between the target device and the target test environment, and automatically unbind the relationship when the conditions are met. The main steps include:

[0124] Step 401: In response to a test environment access operation on a target device, obtain the current IP address and unique identity information of the target device.

[0125] The current IP address of the target device is the network IP address of the network to which the target device is currently connected. The unique identity information of the target device is the device identifier and user account of the target device.

[0126] In one embodiment, in response to a test environment access operation on a target device, the current IP address and unique identity information of the target device are obtained. Specifically, a user can operate the test environment access operation on the target device through a visual interface. The technical solution provided in this embodiment of the application can obtain the current IP address information and unique identity information of the target device in response to such user operation.

[0127] For example, a user logs in to user account L and clicks on the access operation of the target device (device ID: a01X) to access the test environment 3 on the visual interface. At this time, the technical solution of the embodiment of the present application can obtain the currently connected network IP address of the target device: 123.1.2.X3X, unique identity identification information: device ID: a01X, user account: L.

[0128] In actual applications, users are often unable to accurately identify the identity of the target device based on the network IP address. To solve the above problem, the technical solution provided in the embodiment of the present application designs a dynamic identity tracking mechanism. The client agent can collect the fingerprint of the device (such as MAC address, device model, network IP address, login account, etc.) in real time, and dynamically generate the device identification information of the target device based on the above collected information using the preset device identification generation rules. At the same time, the association relationship between the network IP address-device identification-user account of the target device is dynamically constructed, and the accurate association between the network IP address-device identification-user account is always maintained.

[0129] Among them, the client agent refers to a type of software program or module running on a client device (such as a personal computer, mobile phone, IoT terminal, embedded device, etc.), which is used to actively report the multi-dimensional fingerprint information of the client device collected in real time (such as MAC address, device model, network IP address, login account and other hardware characteristics, network identification and user account information).

[0130] The above-mentioned dynamic identity tracking mechanism not only supports the current user's usage rights of the target device (i.e., the device information under the current user account name) and access rights to the test environment (i.e., which test environments the current user account can access), but also when the user switches the test environment connected to the target device or adds the target device to the test environment, it is completely free from manual dependence on the currently connected network address (i.e., network IP address). There is no need to manually switch the currently connected network IP address, nor is there any need to pay attention to what the network IP address currently connected to the target device is. You can switch the test environment currently connected to the target device. The operation is very simple and improves the testing efficiency.

[0131] In addition, the precise association of the above network IP address-device identifier-user account can be stored in the database in the form of a ternary mapping table. The system will dynamically update the [network IP address-device identifier-user account] ternary mapping table based on the device information reported in real time by the client agent.

[0132] Furthermore, for terminal devices that cannot install the Agent (such as televisions and set-top boxes), these devices are often unable to proactively report their identity information and are generally classified as "dumb terminals." Because dumb terminals cannot proactively report their identity information in real time, it may be impossible to associate the device identity with the user account. To address this issue, the system can provide users with a dumb terminal registration portal, allowing them to manually enter the device's MAC address and model. For example, "Xiaomi TV XX20XX model, MAC address: 00:11:XX:22:44:XX." Based on the information entered by the user, a corresponding [network IP address - device identifier - user account] ternary mapping table can be generated.

[0133] Specifically, the MAC address entered by the user is used as the device identifier, and the network IP address to which the target device is currently connected is obtained based on the MAC address authentication information of the dumb terminal, and the user account of the current user is obtained, thereby building a precise association between the network IP address, the device identifier, and the user account.

[0134] It can be seen that regardless of whether the target device supports the Agent to report data information in real time, the dynamic identity tracking mechanism provided in the embodiment of the present application can obtain the unique identity identification information of these devices, thereby realizing the accurate association between the user account and the target device. At the same time, it can cover various types of terminal test devices, provide testers with more equipment options, reduce the cost of purchasing test equipment, and improve the test efficiency of testers.

[0135] Step 402: Establish an association between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment.

[0136] The current IP address of the above-mentioned target device refers to the IP address of the network to which the target device is currently connected, that is, the network IP address. The key to establishing a binding relationship between the target device and the target test environment is to associate the network IP address with the target test environment. The system background does not care which target device the network IP address belongs to. However, in order to allow users to only focus on the association between the device and the test environment in the client interface without paying attention to the network IP address, based on the dynamic identity tracking mechanism of the above steps, the embodiment of the present application establishes an association relationship between the unique identity identifier of the target device, the network IP address and the target test environment. In this case, when the network IP address changes, the above-mentioned association relationship is directly updated, and the user does not need to pay attention to whether his network IP changes or not, and can still use the current target device to normally access the corresponding target test environment. The change of the network IP address will be described in detail in the relevant steps below.

[0137] In one real-time example, an association is established between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment. Specifically, based on the current network IP address and unique identity of the target device obtained in the above steps, an association is established between the unique identity of the target device, the network IP address, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment.

[0138] For example, the unique identity information of the target device obtained in the above steps is the device identifier: a01X, the user account L, and the current network IP address of the target device obtained is: 123.1.2.X3X, the regional identifier of the target test environment is obtained: XX3a, and the association relationship between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment is established: {L-a01X-123.1.2.X3X-XX3a}, so as to establish a binding relationship between the target device and the target test environment.

[0139] Step 403: When a change in the IP address of the target device is detected, a target association relationship containing the unique identity information of the target device is found from the established multiple association relationships, and the IP address in the target association relationship is updated using the changed IP address of the target device.

[0140] Since the IP address of the network to which the target device is currently connected is not fixed, the user may switch the network to which the target device is currently connected, and the automatic allocation mechanism of the office network may also cause the network IP address of the target device to change. Therefore, the executor of the technical solution provided in the embodiment of the present application will dynamically update the IP address in the above-mentioned association relationship using the changed network IP address when monitoring the change of the network IP address of the target device. The user does not need to worry about whether the IP address of the network to which the target device is connected has changed, thereby ensuring the continuity and accuracy of the testing process.

[0141] In one embodiment, when a change in the IP address of the target device is detected, a target association relationship containing the unique identity information of the target device is found from multiple established association relationships, and the IP address in the target association relationship is updated using the changed IP address of the target device.

[0142] Specifically, the network billing logs obtained by the system at regular intervals or the wireless controller can be monitored in real time to determine whether the network IP address of the current target device has changed. In addition, other methods can be used to monitor whether the network IP address of the current target device has changed. This embodiment of the present application does not limit this.

[0143] Among them, when it is monitored that the network IP address of the target device has changed, the target association relationship containing the unique identity information of the target device is found from the multiple association relationships established in the above step 402, and the network IP address in the target association relationship is updated using the network IP address after the target device is changed.

[0144] For example, based on the network billing logs regularly acquired by the system, it is determined that the network IP address of target device a01X has changed to 123.2.2.X3X. Based on the device identifier of the target device, the target association relationship between the corresponding target device's unique identity information and the target test environment is found: {L-a01X-123.1.2.X3X-XX3a}. The network IP address in the target association relationship is then updated with the changed network IP address: 123.2.2.X3X. The updated target association relationship is: {L-a01X-123.2.2.X3X-XX3a}.

[0145] The relevant technical solutions in the above embodiments, targeting the dynamic network IP allocation characteristics of the office network, can parse the obtained network billing logs in real time, capture network IP change events, and dynamically update the target association relationship between the unique identity of the target device and the regional identifier of the target test environment when a network IP change is discovered, so that the user does not need to re-connect the target device to the target test environment to maintain the continuity of the user's access to the target test environment, and is unaware of the change in the network IP address.

[0146] Step 404: If it is detected that the target device has not accessed the target test environment within a set period of time, the binding relationship between the target device and the target test environment is released.

[0147] In one embodiment, if it is detected that the target device has not accessed the target test environment within a set period of time, the binding relationship between the target device and the target test environment is released. Specifically, the set period of time during which the user has not accessed the target test environment is monitored in real time. If the set period of time is greater than or equal to a set threshold, the binding relationship between the target device and the target test environment is released.

[0148] For example, if it is detected that the target device has not accessed the target test environment within 20 minutes, and 20 minutes is greater than the set threshold of 15 minutes, the binding relationship between the target device and the target test environment is released.

[0149] The above embodiment process is based on a dynamic identity tracking mechanism and builds an association between the unique identity identifier of the target device, the network IP address, and the target test environment area identifier, which supports the current user's use rights to the target device and the access rights to the test environment. In the case of a change in the network IP address, the user does not need to pay attention to the current network IP address of the target device or whether it has changed. He can continue to use the target device to access the target test environment, and at the same time avoid interruption of the test process, thereby improving test efficiency and test quality.

[0150] Figure 5 A schematic diagram of the structure of a test device provided in the embodiment of the present application is shown in FIG. Figure 5 As shown, it mainly includes:

[0151] A binding relationship establishing module 51 is configured to establish a binding relationship between the target device and a target test environment in response to a test environment access operation on the target device; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments;

[0152] The test module 52 is used to, when receiving a domain name access request from the target device, point the target domain name requested by the target device to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0153] In a possible implementation, the binding relationship establishing module 51 is configured to:

[0154] In response to a test environment access operation on a target device, triggering a test environment access request, wherein the test environment access request is used to instruct the target device to access a target test environment;

[0155] A binding relationship between the target device and the target test environment is established.

[0156] In a possible implementation, the binding relationship establishing module 51 is configured to:

[0157] In response to a test environment access operation on a target device, triggering a test environment switching request, wherein the test environment switching request is used to instruct the target device to switch to a target test environment;

[0158] The binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

[0159] In a possible implementation, the binding relationship establishing module 51 is configured to:

[0160] Determining a target test environment indicated by the test environment access operation;

[0161] Obtaining a user account corresponding to the target device;

[0162] In a case where it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

[0163] In a possible implementation, the binding relationship establishing module 51 includes:

[0164] An IP address acquisition unit, configured to acquire the current IP address of the target device;

[0165] a binding relationship establishing unit, configured to establish an association relationship between the current IP address of the target device and the area identifier of the target test environment, so as to establish a binding relationship between the target device and the target test environment;

[0166] After establishing the binding relationship between the target device and the target test environment, the method further includes:

[0167] When it is monitored that the IP address of the target device is changed, the IP address in the association relationship is updated using the changed IP address of the target device.

[0168] In a possible implementation, the binding relationship establishing unit is configured to:

[0169] Obtaining unique identity information of the target device;

[0170] Establishing an association between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment;

[0171] Updating the IP address in the association relationship using the changed IP address of the target device includes:

[0172] Searching for a target association relationship containing the unique identity information of the target device from the multiple established association relationships;

[0173] The IP address in the target association relationship is updated using the changed IP address of the target device.

[0174] In a possible implementation manner, after establishing the binding relationship between the target device and the target test environment, the following steps are included:

[0175] When it is detected that the target device has not accessed the target test environment within a set time period, the binding relationship between the target device and the target test environment is released.

[0176] like Figure 6 As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0177] Memory 113, for storing computer programs;

[0178] In one embodiment of the present application, the processor 111 is configured to implement the test method provided by any of the aforementioned method embodiments when executing a program stored in the memory 113, including:

[0179] In response to a test environment access operation for a target device, establishing a binding relationship between the target device and a target test environment; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments;

[0180] When a domain name access request is received from the target device, the target domain name requested to be accessed by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

[0181] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the test method provided in any of the aforementioned method embodiments are implemented.

[0182] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0183] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.

[0184] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0185] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A testing method, characterized in that: The method comprises: In response to a test environment access operation for a target device, establishing a binding relationship between the target device and a target test environment; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments; When a domain name access request is received from the target device, the target domain name requested to be accessed by the target device is pointed to the address of the corresponding target network resource in the target test environment according to the domain name mapping rule corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

2. The method according to claim 1, characterized in that The establishing a binding relationship between the target device and the target test environment in response to the test environment access operation of the target device includes: In response to a test environment access operation on a target device, triggering a test environment access request, wherein the test environment access request is used to instruct the target device to access a target test environment; A binding relationship between the target device and the target test environment is established.

3. The method according to claim 1 or 2, characterized in that The establishing a binding relationship between the target device and the target test environment in response to the test environment access operation of the target device includes: In response to a test environment access operation on a target device, triggering a test environment switching request, wherein the test environment switching request is used to instruct the target device to switch to a target test environment; The binding relationship between the target device and the current test environment is released, and a binding relationship between the target device and the target test environment is established.

4. The method according to claim 1, wherein The establishing of the binding relationship between the target device and the target test environment includes: Determining a target test environment indicated by the test environment access operation; Obtaining a user account corresponding to the target device; In a case where it is determined that the user account has access rights to the target test environment, a binding relationship between the target device and the target test environment is established.

5. The method according to claim 1, wherein The establishing of the binding relationship between the target device and the target test environment includes: Obtain the current IP address of the target device; Establishing an association relationship between the current IP address of the target device and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment; After establishing the binding relationship between the target device and the target test environment, the method further includes: When it is monitored that the IP address of the target device is changed, the IP address in the association relationship is updated using the changed IP address of the target device.

6. The method according to claim 5, characterized in that The establishing of an association relationship between the current IP address of the target device and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment includes: Obtaining unique identification information of the target device; Establishing an association between the unique identity information of the target device, the current IP address of the target device, and the regional identifier of the target test environment to establish a binding relationship between the target device and the target test environment; Updating the IP address in the association relationship using the changed IP address of the target device includes: Searching for a target association relationship containing the unique identity information of the target device from the multiple established association relationships; The IP address in the target association relationship is updated using the changed IP address of the target device.

7. The method according to claim 1, characterized in that After the binding relationship between the target device and the target test environment is established, the following steps are included: When it is detected that the target device has not accessed the target test environment within a set time period, the binding relationship between the target device and the target test environment is released.

8. A testing device, characterized in that: The device comprises: a binding relationship establishing module, configured to establish a binding relationship between the target device and a target test environment in response to a test environment access operation on the target device; wherein the target test environment is one selected from a plurality of pre-built logically isolated test environments; The test module is used to, when receiving a domain name access request from the target device, point the target domain name requested by the target device to the address of the corresponding target network resource in the target test environment according to the domain name mapping rules corresponding to the target test environment, so that the target device can test the target network resource in the target test environment.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is configured to execute a test program stored in the memory to implement the test method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the testing method according to any one of claims 1 to 7.