Network environment display method, device, storage medium and electronic device
By building a fake network environment in terminal devices, the problem of inconvenience in terminal devices is solved, efficient testing and automated testing are achieved, and dependence on real network environments is reduced.
Patent Information
- Application Number
- CN202111227052.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-10-21
AI Technical Summary
In the prior art, terminal equipment is inconvenient to use in weak network environments, and it is necessary to frequently replace the real network environment to test the performance under different network environments, resulting in high dependence and difficulty in realizing automated testing.
By building a fake network environment in the terminal device, obtaining network parameters different from the real network, displaying the network environment association controls to simulate different network types and resource parameters, and implementing the operation performance of the terminal device sensing the fake network environment.
It improves the convenience of terminal equipment, significantly improves testing efficiency, supports automation and batch testing, and reduces dependence on real network environments.
Smart Images

Figure CN113891368B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a network environment display method, device, storage medium and electronic device. Background Art
[0002] In the related technology, the terminal equipment needs to be used based on a real network. For example, if the user wants to use the terminal equipment in a weak network environment such as an elevator or underground garage, he needs to carry the terminal equipment to the real weak network environment such as an elevator or underground garage, so that the terminal equipment can produce the application performance corresponding to the weak network environment. For another example, if the user wants the terminal equipment to run the application in a traffic-free card environment, he needs to install a real traffic-free card for the device, and the frequent plugging and unplugging of the traffic-free card is also time-consuming and laborious. In other words, the related technology lacks the means to independently build a specific network environment, which causes the inconvenience of using terminal equipment based on a specific network environment. Summary of the invention
[0003] In order to improve the convenience of using a terminal device based on a specific network environment, the embodiments of the present application provide a network environment display method, device, storage medium and electronic device.
[0004] On the one hand, an embodiment of the present application provides a network environment display method, which is applied to a terminal device and includes:
[0005] Establishing a connection with a first network, wherein a parameter of the first network is a first network parameter;
[0006] In response to a trigger instruction for setting a network environment control, obtaining a second network parameter, where the second network parameter is different from the first network parameter;
[0007] Displaying a network environment associated control, where the network environment associated control is a control displayed when a parameter of the network environment in which the terminal device is located is the second network parameter;
[0008] The parameters include network type parameters or network resource parameters.
[0009] On the other hand, an embodiment of the present application provides a network environment display device, which is applied to a terminal device, and the device includes:
[0010] A connection establishing module, establishing a connection with a first network, wherein a parameter of the first network is a first network parameter;
[0011] A network parameter acquisition module, configured to acquire a second network parameter in response to a trigger instruction for setting a network environment control, wherein the second network parameter is different from the first network parameter;
[0012] A control display module, used for displaying a network environment associated control, wherein the network environment associated control is a control displayed when the parameter of the network environment in which the terminal device is located is the second network parameter;
[0013] The parameters include network type parameters or network resource parameters.
[0014] On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned network environment display method.
[0015] On the other hand, an embodiment of the present application provides an electronic device, comprising at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the above-mentioned network environment display method by executing the instructions stored in the memory.
[0016] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which implement the above-mentioned network environment display method when executed by a processor.
[0017] The embodiments of the present application provide a network environment display method, device, storage medium and equipment. The method provided by the embodiments of the present application can enable the terminal device to identify the changed network information as the network information in the real network environment, thereby generating corresponding performance. By constructing a false network environment perceived by the terminal device, the terminal device can generate corresponding performance, thereby getting rid of the dependence on the real network environment, improving the convenience of using the terminal device, and using it in the test scenario can significantly improve the test efficiency, which is conducive to the implementation of automated testing and batch testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is a feasible flow chart of the network environment display method provided in the embodiment of the present application;
[0020] Figure 2 is a schematic diagram of a first control provided in an embodiment of the present application;
[0021] Figure 3 is a schematic diagram of a setting interface of a network type parameter in a second network parameter provided in an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of the operation performance of the terminal device provided in the embodiment of the present application;
[0023] Figure 5 is a schematic diagram of a setting interface of a network resource parameter in a second network parameter provided in an embodiment of the present application;
[0024] Figure 6 It is a schematic diagram of the opening and closing control interface of the method in this embodiment provided by the embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of the operation process of the terminal device when the network status modification control provided in the embodiment of the present application is directed to being closed;
[0026] Figure 8 It is a schematic diagram of the operation process of the terminal device when the network status modification control provided in the embodiment of the present application is turned on;
[0027] Fig. 9 It is a schematic diagram of another operation process of a terminal device when the network status modification control provided in an embodiment of the present application is pointed to be turned on;
[0028] Fig.10 This is a schematic diagram of network scene switching provided by an embodiment of the present application;
[0029] Fig.11 It is a schematic diagram of the implementation framework of the method provided in the embodiment of the present application;
[0030] Fig.12 is a block diagram of a network environment display device provided in an embodiment of the present application;
[0031] Fig.13 It is a schematic diagram of the hardware structure of a device provided in an embodiment of the present application for implementing the method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present application.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0034] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present application more clear, the embodiments of the present application are further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application and are not used to limit the embodiments of the present application.
[0035] In the following, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "multiple" means two or more. In order to facilitate the understanding of the above-mentioned technical solutions and the technical effects produced by the embodiments of the present application, the embodiments of the present application first explain the relevant professional terms:
[0036] Wi-Fi: A wireless communication technology, also known as a mobile hotspot, is primarily a local area network technology that uses radio waves to provide high-speed network access to Wi-Fi-enabled mobile devices. It not only allows mobile devices such as smartphones, laptops, and tablets to connect to the Internet, but also allows them to communicate wirelessly with each other.
[0037] 2G: The second generation of mobile phone communication technology specifications, with digital voice transmission technology as the core. Generally defined as a mobile phone communication technology specification that cannot directly transmit information such as emails and software; it only has the function of making calls and transmitting some information such as time and date. However, mobile phone text messages can be executed in some of its specifications.
[0038] 3G: The third generation of mobile communication technology refers to cellular mobile communication technology that supports high-speed data transmission. 3G services can transmit voice and data information at the same time. 3G is a mobile communication system that combines wireless communication with multimedia communications such as the Internet.
[0039] 4G: Fourth generation mobile information systems, networking technology usually associated with mobile phone systems that use short-range radios to facilitate communication between mobile devices over an area consisting of cells and transceivers. A 4G network means that the device has a cellular plan attached to it that uses cellular signals to connect to the internet.
[0040] 5G: The fifth generation of mobile communication technology is a new generation of broadband mobile communication technology with the characteristics of high speed, low latency and large connection. It is the network infrastructure for realizing the interconnection between man, machine and things.
[0041] Multiple subscriber identity modules (SIM): user identification cards of terminal devices. Different SIM cards can carry different network services. For example, users of Toutiao cards can use Toutiao applications without data charges, users of Mifenwang cards can use applications supported by Mifenwang cards without data charges, and users of Tencent Dawang cards can use applications supported by Tencent Dawang cards without data charges, etc.
[0042] In some scenarios, it may be necessary to place the terminal device in a specific network environment for use. For example, in some situations with high security requirements, the terminal device is required to run in an encrypted low-speed secure network. In some test scenarios, the terminal device is required to run in a network that is compatible with the test scenario. In order to achieve the purpose of using the terminal device in a specific network environment in the related art, it is often necessary to place the terminal device in the real specific network environment, which makes the use of the terminal device inconvenient.
[0043] Taking testing as an example, in order to test the performance of terminal equipment in a variety of different network environments, it is necessary to construct the above-mentioned various network environments for the terminal equipment. For example, if it is required to test the performance of the terminal equipment when carrying a SIM card of a certain network service, it is necessary to insert such a SIM card. It is not very convenient to obtain and insert the SIM card, and it also generates additional costs. Specifically, if you need to test whether the free-flow logic display of the King Card of a certain application on the terminal device is normal in the King Card environment, you first need to go to the operator to activate the King Card, then renew the King Card, manually insert the King Card into the terminal device, and run the above-mentioned application on the terminal device to test whether the free-flow logic display of the King Card is normal. When performing other operations unrelated to the King Card, you may also need to pull out the King Card.
[0044] For example, if the terminal equipment is required to be tested only in a certain weak network environment, the tester needs to carry the test terminal to a real weak network environment for testing. The weak network environment may exist in a running elevator or basement, which obviously further causes inconvenience in testing. If the terminal equipment needs to be tested in multiple network environments, the real network environment of the terminal equipment needs to be changed frequently, which obviously further aggravates this inconvenience. In addition, the high dependence on the real network environment also makes it difficult to automate the test process.
[0045] In view of this, an embodiment of the present application provides a network environment display method, which can be connected to the Internet through real networking, and change the network information obtained by the terminal device in the real networking state, so that the terminal device recognizes the changed network information as the network information in the real network environment, thereby generating corresponding performance. In other words, the network environment constructed in the present application is not a real network environment, but a false network environment perceived by the terminal device. By constructing this false network environment, the terminal device can generate corresponding performance, thereby getting rid of dependence on the real network environment and improving the ease of use of the terminal device. Using it in a test scenario can significantly improve the test efficiency, which is conducive to the implementation of automated testing and batch testing.
[0046] Embodiments of the present application may involve cloud technology and cloud gaming. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or a local area network to achieve data computing, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately, and all kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0047] Cloud gaming is an online gaming technology based on cloud computing. Cloud gaming technology enables lightweight devices with relatively limited graphics processing and data computing capabilities to run high-quality games. Cloud gaming can be used to play games on demand or broadcast them live.
[0048] The following describes a network environment display method according to an embodiment of the present application. Figure 1A flow chart of a network environment display method provided by an embodiment of the present application is shown. The embodiment of the present application provides the method operation steps as described in the embodiment or the flow chart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system, terminal device or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. The above method may include:
[0049] S101. Establish a connection with a first network, where parameters of the first network are first network parameters.
[0050] The network environment display method in the embodiment of the present application can be run on a terminal device, and the terminal device in the embodiment of the present application includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle terminal, etc. The embodiment of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, video media, instant messaging, etc.
[0051] In the disclosed embodiment, the terminal device establishes a connection relationship with the first network so that the terminal device can be in a networked state. This is the basis for the terminal device in the embodiment of the present application to interact and communicate with the server. The server may refer to the server corresponding to the application running in the terminal device. Taking the running of a live broadcast application in a terminal device as an example, the terminal device can communicate with the server corresponding to the live broadcast application based on the first network. The terminal device obtains the data transmitted by the server based on the first network to generate corresponding operating performance, such as playing live broadcast content, displaying live broadcast gifts and other live broadcast rooms, etc. Even if the terminal device runs an application in the false network environment constructed in this application, the communication between the application and the corresponding server is still essentially dependent on the first network. In other words, the first network is the network foundation for the operation of the application in the terminal device.
[0052] The embodiment of the present application does not limit the specific type of the first network, which can be a Wi-Fi network, a 4G network or a 5G network, as long as it can provide a network foundation on which the application in the terminal device depends for running.
[0053] S102. In response to a trigger instruction for a network environment setting control, obtain a second network parameter, where the second network parameter is different from the first network parameter.
[0054] In order to build a false network environment for the terminal device, when the network foundation is built in the previous step, this step obtains the network parameters corresponding to the false network environment. The embodiment of the present application refers to this network parameter as the second network parameter, and the network parameter corresponding to the real network environment (first network) is the first network parameter. The embodiment of the present application does not limit the first network parameter and the second network parameter. Both the first network parameter and the second network parameter can include a network type parameter or a network resource parameter. The network type parameter characterizes the type corresponding to the network, for example, whether it is a wireless network or a wired network, a 3G network or a 5G network. The network resource parameter characterizes the state of the network. The embodiment of the present application does not limit the network resource parameter. For example, it can include bandwidth, network speed, packet loss rate, jitter or delay.
[0055] Exemplarily, the network type parameter in the first network parameter can be a Wi-Fi type, a 4G type, or a 5G type, and the network type parameter in the second network parameter can be a Wi-Fi type, a 3G type, a 2G type, a 4G type, a 5G type, a Bluetooth type, a hotspot type, or a type corresponding to a user identification module carrying a preset network service. The present application embodiment does not limit the preset network service, for example, it can be a Tencent Dawang card service, a Jinri Toutiao card service, or a Mifenwang card service. Exemplarily, the network resource parameter in the first network parameter can be: network delay 50ms, packet loss rate 0.011%, jitter variance 500, and the network resource parameter in the second network parameter can be a network delay 90ms, packet loss rate 0.013%, and jitter variance 520.
[0056] The embodiment of the present application aims to construct a false network environment different from the real network environment, so the second network parameter is different from the first network parameter. In one embodiment, the second network parameter can be set through a visual operation.
[0057] S103. Display a network environment associated control, where the network environment associated control is a control displayed when a parameter of the network environment in which the terminal device is located is the second network parameter.
[0058] In the embodiment of the present application, step 101 establishes a connection with the first network so that the terminal device is in a real networking state, that is, a network foundation for the operation of the application in the terminal device is constructed, and the parameter corresponding to the network foundation is the first network parameter, while the network environment associated control displayed in step 103 is a control displayed under the second network parameter, that is, the application obtains the network state parameter corresponding to the false network environment, thereby achieving such an effect: from the perspective of the application, the application enjoys the real network service under the false network environment, so that the application can run in the network environment, and at the same time believe that the network state of the network environment points to the second network parameter (false network environment), and generate the operation performance corresponding to the second network parameter. Taking the first network as Wi-Fi and the network type parameter of the second network parameter as Dawang Card as an example, the application running on the mobile terminal will mistakenly believe that it is running in the network provided by Dawang Card, thereby generating the corresponding operation performance, without actually building a real Dawang Card network for the application.
[0059] In order to display the network environment associated controls adapted to the second network parameters, the embodiment of the present application can output a first response according to the above-mentioned second network parameters in response to the acquisition of the network status request, and display the above-mentioned network environment associated controls according to the above-mentioned first response. Specifically, the application can obtain false network parameters (second network parameters) through hijacking operations. In one embodiment, the above-mentioned network status request can be hijacked, and the above-mentioned first response can be generated and output according to the above-mentioned second network parameters. In another embodiment, the second response can be hijacked, and the above-mentioned first network parameter in the above-mentioned second response can be modified to the above-mentioned second network parameter to obtain the above-mentioned first response, and the above-mentioned first response is output, and the above-mentioned second response is the response of the operating system to the above-mentioned network status request.
[0060] In one embodiment, when the network resource parameters in the second network parameters are different from the network resource parameters in the first network parameters, the first resource is adjusted based on the network resource parameters in the second network parameters, and the first resource is the resource of the first network received by the terminal device. The embodiment of the present application does not limit the method of adjusting the first resource, and the first resource can be adjusted by itself or connected to an open source software development kit (SDK) for adjustment.
[0061] The embodiment of the present application can select a fake network environment to be constructed based on the scenario, that is, the second network parameter can be adapted to the first scenario, and the first scenario is the real usage scenario or test scenario of the terminal device. For example, if the terminal device needs to be tested in a weak network scenario, the network type in the second network parameter can be set to 2G or 3G, and the bandwidth can be appropriately reduced.
[0062] In one embodiment, when the network environment setting control includes a first control, in response to a trigger instruction for the first control, the scene pointed to by the first control is used as the first scene, and the second network parameter is determined according to the first scene. Figure 2 , which shows a schematic diagram of the first control. The first control may include five scenarios: normal network, elevator (WiFi and traffic), elevator (extremely poor signal), elevator (good signal), elevator (base station switching), and China Unicom. The operator in each scenario can be selected, such as China Telecom, China Unicom, or China Mobile. By selecting any of the five scenarios, the corresponding second network parameters can be determined, so that the bandwidth, operator, delay, packet loss rate, etc. in the second network parameters automatically fit the selected scenario. Figure 2 The setting of the first control can flexibly switch scenes and provide different false network environments for terminal devices, which is convenient for use or testing. It can also allow users to truly see whether the simulation scene is consistent with the test scene in the test environment, avoiding inconsistent scenes during testing.
[0063] In one embodiment, when the network environment setting control includes a second control, in response to a trigger instruction for the second control, the network type parameter in the second network parameter is assigned according to the network type pointed to by the second control. Figure 3, which shows a schematic diagram of the setting interface of the network type parameter in the second network parameter. The clear mark indicates that a false network environment is not constructed, the free mark indicates that a network environment of a SIM card carrying certain preset network services is constructed (such as a Dawang card), the wifi mark indicates that a wireless network environment is constructed, the 4G mark indicates that a 4G network environment is constructed, the 3G mark indicates that a 3G network environment is constructed, the 2G mark indicates that a 2G network environment is constructed, and the none mark indicates that no network environment is constructed. For example, if the application in the terminal device needs to run in the Dawang card environment, the free mark can be selected to set the network type parameter of the second network parameter to the network type corresponding to the Dawang card. The terminal device can obtain a false network environment of the Dawang card type after executing steps S101-S103. After the application is run on the terminal device, the application can generate the running performance under the Dawang card environment. When the application needs to switch to the 4G environment for operation, it only needs to select the 4G mark to set the network type parameter in the second network parameter to the network type corresponding to 4G, thereby obtaining a false network environment of the 4G type. After the application is run on the terminal device, the application can generate the running performance under the 4G environment. When the application needs to switch to 2G or 3G or even run in a network-free environment, it only needs to select the corresponding logo. It can be seen that the switching of network types no longer requires changing the real network or plugging in the King Card, which is convenient and efficient.
[0064] Please refer to Figure 4 , which shows a schematic diagram of the operation performance of the terminal device. The leftmost image is the operation performance of the terminal device when the wifi logo is selected, the upper left image is the operation performance of the terminal device when the wifi logo is selected, the upper right image is the operation performance of the terminal device when the none logo is selected, the lower left image is the operation performance of the terminal device when the free logo is selected in a non-5G network, and the lower right image is the operation performance of the terminal device when the free logo is selected in a 5G network.
[0065] In another embodiment, when the network environment setting control includes a third control, in response to a trigger instruction for the third control, the network resource parameter in the second network parameter is assigned according to the resource parameter pointed to by the third control. Figure 5, which shows a schematic diagram of the setting interface of the network resource parameters in the second network parameters. The network resource parameters in the second network parameters can be set by setting parameters such as bandwidth, packet loss rate, delay, jitter variance, etc. For example, if the bandwidth of the network resource parameters in the second network parameters is lower than the bandwidth in the first network parameters, the first network accessed by the terminal device is speed-limited to adapt it to the bandwidth in the second network parameters, so that the application running on the terminal device can generate an operating performance corresponding to the second network parameters.
[0066] Of course, in some embodiments, it is also possible to further control whether the method in the embodiment of the present application is implemented. Figure 6 , which shows a schematic diagram of the on / off control interface of the method in this embodiment. By triggering the network status modification control, it is possible to control whether the method in the embodiment of the present application is implemented. When the network status modification control points to off, the method in the embodiment of the present application is not triggered, and when the network status modification control points to on, the method in the embodiment of the present application is triggered.
[0067] Please refer to Figure 7 , which shows a schematic diagram of the operation process of the terminal device when the network status modification control is turned off. When the terminal device is running, it is connected to a real network (which can be a Wi-Fi network). After starting the application, the application can obtain the network status. The network status has not been modified, so the application generates the operation performance corresponding to the real network.
[0068] Please refer to Figure 8 , which shows a schematic diagram of the operation process of the terminal device when the network status modification control is turned on. When the terminal device is running, it connects to a real network (which can be a Wi-Fi network). After starting the application, set the second network parameter (such as selecting the free logo), which can trigger the application to obtain the network status, and modify the first network parameter of the real network environment to the second network parameter (such as modifying Wi-Fi to the Dawang Card network environment). Then the application generates the corresponding operation performance under the Dawang Card network environment. Specifically, the test user first connects to the real Wi-Fi to confirm that the Wi-Fi network is normal. At this time, start to enter the corresponding application, open the debugging panel of the application, and then switch to the free mode through the debugging switch. At this time, the application will re-trigger to obtain the network status, and obviously, the first network parameter (Wi-Fi) obtained at this time, the hijacking method is started to force the first network parameter to be modified to the second network parameter (free). The application will think that the user is connected to the Dawang Card at this time, so the test user can perform the user interface (UserInterface, UI) test related to the Dawang Card without actually inserting the Dawang Card, but the underlying network is still the Wi-Fi network.
[0069] Please refer to Fig. 9 , which shows another operating process diagram of the terminal device when the network status modification control is turned on. When the terminal device is running, it is connected to a real network (which can be a Wi-Fi network). After starting the application, the second network parameters are set (for example, the bandwidth is set to a low value and the network type is selected as 2G), which can trigger the application to obtain the network status, and modify the first network parameters of the real network environment to the second network parameters (for example, modify Wi-Fi to 2G), which can trigger the network adjustment program to limit the bandwidth corresponding to the first network, so that the application generates the operating performance corresponding to the weak network environment with low bandwidth under 2G.
[0070] Please refer to Fig.10 , which shows a schematic diagram of network scene switching in an exemplary embodiment. During the test, the test user can first connect to Wi-Fi (first network) so that the application program has a real accessible network environment, and then switch the network scene according to the test requirements. For example, if the 4G logo is selected, the application can default to the connected network as 4G, but the underlying network bandwidth will not change, that is, the real bandwidth of the first network. Then, at this time, the application can pop up a 4G traffic viewing prompt, according to which the traffic viewing prompt logic of the application can be tested to see whether it is correct, and click to confirm whether the stream can be pulled and watched normally. After the required test case is executed, the test user can restore it to the default state by selecting the clear logo, so that it can quickly restore to the default test state without affecting the execution of other test cases. Other network environment test methods are based on the same conception and will not be repeated here. It should be noted here that if it is necessary to test the viewing experience of the application program for the network quality, it is necessary to change the network resource parameters in the second network parameters, for example, to create a weak network environment such as an elevator, and to see in real time whether the bandwidth and packet loss rate jitter rate of the network in these scenarios meet the test requirements, and to perform transparent testing to avoid deviations in test results due to unreasonable scene settings. If the test user selects a weak network, the first network may be speed-limited to achieve the purpose of simulating a weak network.
[0071] Please refer to Fig.11, which shows a schematic diagram of the implementation framework of the method in the embodiment of the present application. The solid line portion reflects the logic of setting the network parameters of the false network environment perceived by the terminal device to the network type parameters in the second network parameters, which can be achieved through a hijacking operation. The dotted line portion reflects the logic of setting the network resource parameters of the false network environment to the network resource parameters in the second network parameters, which can be achieved through an external SDK. By providing a false network environment for the terminal device, the use and testing of the terminal device no longer rely on the real network environment, which significantly improves the convenience of user operation. Taking the UI test of the application on the terminal device as an example, UI automated testing can be implemented, which significantly improves the test efficiency. Please refer to Table 1, which shows the difference between the present application and the related technology in the test scenario:
[0072] Table 1
[0073]
[0074] A network environment display method provided in an embodiment of the present application can enable a terminal device to recognize the changed network information as the network information in the real network environment, thereby generating corresponding performance. By constructing a false network environment perceived by the terminal device, the terminal device can generate corresponding performance, thereby getting rid of the dependence on the real network environment and improving the ease of use of the terminal device. When used in a test scenario, it can significantly improve the test efficiency and is conducive to the implementation of automated testing and batch testing.
[0075] Please refer to Fig.12 , which shows a block diagram of a network environment display device in this embodiment, the device includes:
[0076] A connection establishing module 101 is used to establish a connection with a first network, wherein the parameters of the first network are first network parameters;
[0077] A network parameter acquisition module 102, configured to acquire a second network parameter in response to a trigger instruction for setting a network environment control, wherein the second network parameter is different from the first network parameter;
[0078] A control display module 103, used for displaying a network environment associated control, wherein the network environment associated control is a control displayed when the parameter of the network environment in which the terminal device is located is the second network parameter;
[0079] The above parameters include network type parameters or network resource parameters.
[0080] In one embodiment, the above-mentioned device also includes a network status processing module, which is used to output a first response according to the above-mentioned second network parameter in response to obtaining a network status request; the above-mentioned control display module is used to display the above-mentioned network environment associated control according to the above-mentioned first response.
[0081] In one embodiment, the network status processing module is used to perform the following operations:
[0082] hijacking the network status request, generating and outputting the first response according to the second network parameter;
[0083] or,
[0084] Hijack the second response, modify the first network parameter in the second response to the second network parameter to obtain the first response, output the first response, and the second response is a response of the operating system to the network status request.
[0085] In one embodiment, the above-mentioned network status processing module is also used to adjust the first resource based on the network resource parameters in the above-mentioned second network parameters when the network resource parameters in the above-mentioned second network parameters are different from the network resource parameters in the above-mentioned first network parameters. The above-mentioned first resource is the resource of the above-mentioned first network received by the above-mentioned terminal device.
[0086] In one embodiment, the second network parameter is adapted to a first scenario, and the first scenario is a real usage scenario or a test scenario of the terminal device.
[0087] In one embodiment, the network parameter acquisition module is used to perform the following operations:
[0088] In the case where the network environment setting control includes a first control, in response to a trigger instruction of the first control, taking the scene pointed to by the first control as the first scene, and determining the second network parameter according to the first scene;
[0089] or,
[0090] In the case where the network environment setting control includes a second control, in response to a trigger instruction for the second control, assigning a network type parameter in the second network parameter according to a network type pointed to by the second control;
[0091] or,
[0092] In the case where the network environment setting control includes a third control, in response to a trigger instruction for the third control, the network resource parameters in the second network parameters are assigned according to the resource parameters pointed to by the third control.
[0093] In one embodiment, when the above-mentioned second network parameter includes the above-mentioned network type parameter, the above-mentioned network type parameter includes Wi-Fi type, 3G type, 2G type, 4G type, 5G type, Bluetooth type, hotspot type or a type corresponding to a user identification module carrying a preset network service.
[0094] Specifically, the network environment display device disclosed in the embodiment of the present application and the corresponding method embodiment described above are based on the same inventive concept. For details, please refer to the method embodiment, which will not be repeated here.
[0095] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned network environment display method.
[0096] The embodiment of the present application further provides a computer-readable storage medium, which can store a plurality of instructions. The instructions can be suitable for being loaded by a processor and executing the network environment display method described in the embodiment of the present application.
[0097] In one embodiment, the above-mentioned network environment display method includes:
[0098] Establishing a connection with a first network, wherein a parameter of the first network is a first network parameter;
[0099] In response to a trigger instruction for setting a network environment control, obtaining a second network parameter, where the second network parameter is different from the first network parameter;
[0100] Displaying a network environment associated control, where the network environment associated control is a control displayed when the parameter of the network environment where the terminal device is located is the second network parameter;
[0101] The parameters include network type parameters or network resource parameters.
[0102] In another embodiment, before displaying the network environment associated control, the method further comprises: in response to obtaining a network status request, outputting a first response according to the second network parameter;
[0103] The displaying of the network environment associated control includes: displaying the network environment associated control according to the first response.
[0104] In another embodiment, in response to obtaining the network status request, outputting a first response according to the second network parameter includes:
[0105] hijacking the network status request, generating and outputting the first response according to the second network parameter;
[0106] or,
[0107] Hijack the second response, modify the first network parameter in the second response to the second network parameter to obtain the first response, output the first response, and the second response is a response of the operating system to the network status request.
[0108] In another embodiment, after obtaining the second network parameter in response to the trigger instruction of the network environment setting control, the method further includes:
[0109] When the network resource parameters in the second network parameters are different from the network resource parameters in the first network parameters, the first resource is adjusted based on the network resource parameters in the second network parameters, and the first resource is the resource of the first network received by the terminal device.
[0110] In another embodiment, the method further comprises:
[0111] The second network parameter is adapted to a first scenario, and the first scenario is a real usage scenario or a test scenario of the terminal device.
[0112] In another embodiment, the obtaining of the second network type in response to a trigger instruction for setting a control for a network environment includes:
[0113] In a case where the network environment setting control includes a first control, in response to a trigger instruction for the first control, taking a scene pointed to by the first control as the first scene, and determining the second network parameter according to the first scene;
[0114] or,
[0115] In a case where the network environment setting control includes a second control, in response to a trigger instruction for the second control, assigning a network type parameter in the second network parameter according to a network type pointed to by the second control;
[0116] or,
[0117] In the case where the network environment setting control includes a third control, in response to a trigger instruction for the third control, the network resource parameters in the second network parameters are assigned according to the resource parameters pointed to by the third control.
[0118] In another embodiment, when the second network parameter includes the network type parameter, the network type parameter includes a Wi-Fi type, a 3G type, a 2G type, a 4G type, a 5G type, a Bluetooth type, a hotspot type, or a type corresponding to a user identification module carrying a preset network service.
[0119] Further, Fig.13A schematic diagram of the hardware structure of a device for implementing the method provided in the embodiment of the present application is shown. The above device may participate in constituting or include the apparatus or system provided in the embodiment of the present application. Fig.13 As shown, the device 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Fig.13 The structure shown is for illustration only and does not limit the structure of the electronic device. Fig.13 More or fewer components as shown, or with Fig.13 Different configurations are shown.
[0120] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0121] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the above-mentioned method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned network environment display method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0122] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the device 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0123] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of device 10 (or mobile device).
[0124] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of the embodiments of the present application are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0125] Each embodiment in the embodiments of the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0126] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program. The above program may be stored in a computer-readable storage medium, and the above storage medium may be a read-only memory, a disk or an optical disk, etc.
[0127] The above is only a preferred embodiment of the embodiment of the present application and is not intended to limit the embodiment of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiment of the present application should be included in the protection scope of the embodiment of the present application.
Claims
1. A network environment display method, characterized in that: The method is applied to a terminal device, and the method comprises: Establishing a connection with a real network environment, wherein a network parameter corresponding to the real network environment is a first network parameter; In response to a trigger instruction for setting a network environment control, obtaining a second network parameter, where the second network parameter is different from the first network parameter and is a network status parameter corresponding to a false network environment; Generate and output a first response according to the second network parameter by hijacking the network status request or a response generated by the operating system in response to the network status request; Displaying a network environment associated control according to the first response, so that the network environment associated control instructs the application of the terminal device to use the real network environment corresponding to the first network parameter and mistakenly believes that the application is running in the false network environment indicated by the second network parameter; In a case where the network resource parameters in the second network parameters are different from the network resource parameters in the first network parameters, adjusting the resources of the real network environment received by the terminal device based on the network resource parameters in the second network parameters; Among them, the first network parameter includes a network type parameter or a network resource parameter, and the second network parameter includes a network type parameter or a network resource parameter; when the second network parameter includes the network type parameter, the network type parameter includes the type corresponding to the user identification module carrying the preset network service.
2. The method according to claim 1, characterized in that The method of hijacking the network status request or the response generated by the operating system in response to the network status request, and generating and outputting a first response according to the second network parameter, comprises: hijacking the network status request, generating and outputting the first response according to the second network parameter; or, Hijacking a response generated by the operating system in response to the network status request, modifying the first network parameter in the response generated by the operating system in response to the network status request to the second network parameter to obtain the first response, and outputting the first response.
3. The method according to claim 1 or 2, characterized in that: The second network parameter is adapted to a first scenario, and the first scenario is a real usage scenario or a test scenario of the terminal device.
4. The method according to claim 3, characterized in that The step of obtaining the second network type in response to a trigger instruction for setting a control for a network environment includes: In a case where the network environment setting control includes a first control, in response to a trigger instruction for the first control, taking a scene pointed to by the first control as the first scene, and determining the second network parameter according to the first scene; or, In a case where the network environment setting control includes a second control, in response to a trigger instruction for the second control, assigning a network type parameter in the second network parameter according to a network type pointed to by the second control; or, In the case where the network environment setting control includes a third control, in response to a trigger instruction for the third control, the network resource parameters in the second network parameters are assigned according to the resource parameters pointed to by the third control.
5. The method according to claim 1, characterized in that In the case where the second network parameter includes the network type parameter, the network type parameter includes Wi-Fi type, 3G type, 2G type, 4G type, 5G type, Bluetooth type, and hotspot type.
6. A network environment display device, characterized in that: The device is applied to a terminal device, and the device includes: A connection establishing module, used to establish a connection with a real network environment, wherein the network parameter corresponding to the real network environment is a first network parameter; A network parameter acquisition module, configured to acquire a second network parameter in response to a trigger instruction for setting a network environment control, wherein the second network parameter is different from the first network parameter and is a network status parameter corresponding to a false network environment; A control display module, configured to generate and output a first response according to the second network parameter by hijacking a network status request or a response generated by the operating system in response to the network status request; and display a network environment associated control according to the first response, so that the network environment associated control instructs the application of the terminal device to use the real network environment corresponding to the first network parameter, and mistakenly believes that the application is running in the false network environment indicated by the second network parameter. In a case where the network resource parameters in the second network parameters are different from the network resource parameters in the first network parameters, adjusting the resources of the real network environment received by the terminal device based on the network resource parameters in the second network parameters; Among them, the first network parameter includes a network type parameter or a network resource parameter, and the second network parameter includes a network type parameter or a network resource parameter; when the second network parameter includes the network type parameter, the network type parameter includes the type corresponding to the user identification module carrying the preset network service.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a network environment display method according to any one of claims 1 to 5.
8. An electronic device, characterized in that: It includes at least one processor and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements a network environment display method as described in any one of claims 1 to 5 by executing the instructions stored in the memory.
9. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, a network environment display method according to any one of claims 1 to 5 is implemented.
