Terminal control method and device and computer equipment
By obtaining configuration files and graphical user interface operating parameters, the terminal equipment is automatically controlled, which solves the problem of low terminal equipment control efficiency and achieves efficient and accurate terminal equipment management.
Patent Information
- Application Number
- CN202410658026.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-10-08
AI Technical Summary
The control process of terminal equipment in the existing technology is inefficient and requires manual scripting and configuration, which is prone to errors, resulting in low control efficiency.
By obtaining the configuration parameters in the configuration file, it is determined whether the terminal is connected. If connected, the operating parameters are obtained through the graphical user interface, and the terminal control operation is performed based on the operating parameters and the configuration file to realize automatic control of the terminal device.
It improves the efficiency of terminal equipment control, realizes automated, efficient and precise control of terminal equipment, simplifies the operating process and reduces the error rate.
Smart Images

Figure CN118747089A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of communication equipment management, and in particular to a terminal control method, device and computer equipment. Background Art
[0002] When testing a terminal device, it is often necessary to manage and control the terminal device, for example, to control the terminal device to access signals sent by external devices such as 4G or 5G base stations, or to control the terminal device to perform uplink and downlink packet injection operations to simulate and test the data transmission performance of the terminal in the network. These terminal management and control operations are used in scenarios such as network optimization, fault diagnosis, and performance evaluation.
[0003] In the prior art, when performing management operations such as access / release and uplink / downlink service packet filling on a terminal, technicians need to write different scripts for each operating system and hardware device, manually configure and intervene to achieve management and control of the terminal device. However, the terminal control process based on manual operation is too cumbersome and prone to errors, resulting in low control efficiency.
[0004] With respect to the problem of low efficiency of the terminal control process existing in the related art, no effective solution has been proposed so far. Summary of the invention
[0005] In this embodiment, a terminal control method, apparatus and computer device are provided to solve the problem of low efficiency of the terminal control process in the related art.
[0006] In a first aspect, a terminal control method is provided in this embodiment, the method comprising:
[0007] Obtain a configuration file, wherein the configuration file stores configuration parameters;
[0008] Based on the configuration parameters in the configuration file, determining whether the target terminal is connected;
[0009] If the target terminal is connected, the operation parameters are obtained through the graphical user interface; and the terminal control operation is performed based on the operation parameters and the configuration file to control the target terminal to perform the target task.
[0010] In some embodiments, before obtaining the configuration file, wherein the configuration file stores the configuration parameters, the process includes:
[0011] Generate an initial configuration file, wherein the initial configuration file includes parameter names of various configuration parameters;
[0012] Generate a parameter configuration subwindow based on the initial configuration file;
[0013] Acquire parameter values corresponding to each parameter name based on the parameter configuration subwindow;
[0014] The parameter value is saved in the initial configuration file to obtain a configuration file.
[0015] In some embodiments, the step of saving the parameter value to the initial configuration file to obtain the configuration file includes:
[0016] Determining whether the parameter value passes verification;
[0017] If the parameter values of each of the configuration parameters pass the verification, all the parameter values are saved in the initial configuration file to obtain a configuration file;
[0018] If there are parameter values that fail to pass the verification, a prompt is generated to re-enter the correct parameter value.
[0019] In some of the embodiments, after determining whether the target terminal is connected based on the configuration parameters in the configuration file, the method further includes:
[0020] If the target terminal is connected, the connection status area of the graphical user interface displays "connected", and the device disconnect button of the graphical user interface changes from a non-clickable state to a clickable state;
[0021] If the target terminal is not connected, the connection status area of the graphical user interface displays "not connected", and the device connection button of the graphical user interface is clickable; in the graphical user interface, except for the device connection button, the other buttons are not clickable.
[0022] In some embodiments, performing a terminal control operation based on the operation parameter and the configuration file to control the target terminal to perform a target task includes:
[0023] The graphical user interface includes a first function operation area, and the first function operation area includes a first control button; determining a state when the first control button is triggered;
[0024] If the first control button is triggered to be in the execution operation state, a terminal operation is performed to control the target terminal to perform an access task or a release task; wherein the terminal operation includes: acquiring a first operation parameter from the first function operation area, the first operation parameter including an execution mode and a packet capture duration, wherein the execution mode is preset to be either terminal access or terminal release; based on the first operation parameter and the configuration file, an access operation or a release operation is performed, the access operation is used to control the target terminal to perform an access task; the release operation is used to control the target terminal to perform a release task;
[0025] If the first control button is in a suspend operation state when it is triggered, a first suspend thread operation is performed to control the target terminal to stop executing the access task or the release task.
[0026] In some embodiments, performing an access operation or a release operation based on the first operation parameter and the configuration file includes:
[0027] Based on the execution mode set as the terminal access, the packet capture duration and the configuration file, concurrently executing the terminal access method and the packet capture operation method; analyzing the first packet capture content obtained by the packet capture operation method to obtain an access analysis result; and judging whether the access is successful based on the access analysis result;
[0028] Alternatively, based on the execution mode set for the terminal release, the packet capture duration and the configuration file, the terminal release method and the packet capture operation method are executed concurrently; the second packet capture content obtained by the packet capture operation method is analyzed to obtain a release analysis result; and whether the release is successful is determined based on the release analysis result.
[0029] In some embodiments, the performing a terminal control operation based on the operating parameter and the configuration file to control the target terminal to perform a target task further includes:
[0030] The graphical user interface further includes a second function operation area, the second function operation area includes a second control button; after the access operation is successful, determining the state of the second control button when it is triggered;
[0031] If the second control button is triggered to be in the execution operation state, the packet filling operation is executed to control the target terminal to execute the packet filling task; wherein the execution of the packet filling operation includes: obtaining a second operation parameter from the second function operation area, the second operation parameter including a packet filling type, a packet filling mode, a packet filling time, a packet filling size, a packet filling port, and a packet filling length; executing a packet filling method based on the second operation parameter and the configuration file, the packet filling method being used to control the target terminal to execute the packet filling task;
[0032] If the second control button is in the suspend operation state when being triggered, a second suspend thread operation is executed to control the target terminal to stop executing the packet filling task.
[0033] In some of the embodiments, after performing a packet filling operation based on the second operation parameter and the configuration file to control the target terminal to perform the packet filling task, the method further includes:
[0034] Obtaining a printing result and a flow byte stream based on the packet filling task;
[0035] The print result is saved to a tool log file, and the traffic byte stream is displayed in the graphical user interface.
[0036] In a second aspect, a terminal control device is provided in this embodiment, and the device includes:
[0037] A configuration module, used to obtain a configuration file, wherein the configuration file stores configuration parameters;
[0038] A connection module, used to determine whether a target terminal is connected based on the configuration parameters in the configuration file;
[0039] The execution module is used to obtain operation parameters through a graphical user interface if the target terminal is connected; and perform terminal control operations based on the operation parameters and the configuration file to control the target terminal to perform a target task.
[0040] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the terminal control method described in the first aspect is implemented.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the terminal control method described in the first aspect is implemented.
[0042] Compared with the related art, a terminal control method provided in this embodiment obtains a configuration file, wherein the configuration file stores configuration parameters; based on the configuration parameters in the configuration file, determines whether a target terminal is connected; if the target terminal is connected, obtains operation parameters through a graphical user interface; based on the operation parameters and the configuration file, performs terminal control operations to control the target terminal, thereby solving the problem of low efficiency of the terminal control process existing in the related art, realizing automated, efficient and precise control of terminal devices, and greatly improving the efficiency of terminal device control.
[0043] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0045] Figure 1A hardware structure block diagram of a terminal in a terminal control method in one embodiment;
[0046] Figure 2 A schematic diagram of a flow chart of a terminal control method in an embodiment;
[0047] Figure 3 A schematic diagram of a process for obtaining configuration parameters in an embodiment;
[0048] Figure 4 A schematic diagram of a parameter configuration sub-window in one embodiment;
[0049] Figure 5 A schematic diagram of a process for saving configuration parameters in one embodiment;
[0050] Figure 6 A schematic diagram of a process flow of device connection in one embodiment;
[0051] Figure 7 is a schematic diagram of the architecture of a graphical user interface in one embodiment;
[0052] Figure 8 A schematic diagram of a process for executing terminal operations in one embodiment;
[0053] Fig. 9 A schematic diagram of a process for performing a bag filling operation in one embodiment;
[0054] Fig.10 A schematic diagram of a flow chart of a terminal control method in a preferred embodiment;
[0055] Fig.11 FIG. 4 is a structural block diagram of a terminal control device in an embodiment.
[0056] Reference numerals: 102, processor; 104, memory; 106, transmission device; 108, input / output device; 10, configuration module; 20, connection module; 30, execution module. DETAILED DESCRIPTION
[0057] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0058] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0059] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the terminal control method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0060] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the terminal control method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above 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 may be connected to the terminal 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.
[0061] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as 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, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0062] In this embodiment, a terminal control method is provided. Figure 2 is a flow chart of the terminal control method of this embodiment. Figure 2 As shown, the process includes the following steps:
[0063] Step S210, obtaining a configuration file, wherein the configuration file stores configuration parameters.
[0064] Specifically, the tester can directly write the configuration file, or obtain the modified configuration parameters through the terminal control tool and save them to the configuration file. The configuration file can be reused after being saved, so that the tester does not need to reconfigure the data every time he reopens the terminal control tool to execute the terminal control method in this embodiment, which reduces efficiency.
[0065] Among them, the configuration parameters are the parameters required for the target terminal device to communicate with the base station, including but not limited to the base station address, target terminal address, packet injection maintenance IP, packet injection task IP, local intranet IP, packet capture network port, packet capture path, iperf2 path and other parameters.
[0066] Step S220: judging whether the target terminal is connected based on the configuration parameters in the configuration file.
[0067] Specifically, the configuration parameters in the configuration file are read to obtain the parameter value of the configuration parameter of the target terminal address, and whether the target terminal is connected to the terminal control tool is determined based on whether the parameter value of the target terminal address is configured correctly. If the parameter value of the target terminal address is configured correctly, it means that the connection is established; if the parameter value of the target terminal address is configured incorrectly, it means that the connection is established.
[0068] Step S230: if the target terminal is connected, obtain operation parameters through the graphical user interface; perform terminal control operations based on the operation parameters and the configuration file to control the target terminal to perform the target task.
[0069] Specifically, the graphical user interface includes operation controls such as a drop-down box or an input box, which are used to obtain the operation parameters input by the tester. The operation parameters include a first operation parameter and a second operation parameter. The first operation parameter is used to assist the terminal control tool to perform terminal operations such as access and release, and the second operation parameter is used to assist the terminal control tool to perform packet filling operations. Different operations can control the target terminal to perform different target tasks. The target tasks include access tasks, that is, the target terminal establishes a connection with the target signal of the base station; release tasks, that is, the target terminal disconnects the target signal of the base station; and packet filling tasks, that is, simulating the base station and the target terminal to perform data transmission to test the elasticity and stability of the network. In one embodiment, the terminal control tool performs an access operation based on the first operation parameter and the configuration file. After the access is successful, the terminal control tool performs a packet filling operation based on the second operation parameter and the configuration file. After the packet filling operation is completed, the operation process is terminated. In another embodiment, the terminal control tool performs a release operation based on the first operation parameter and the configuration file. After the release is completed, the operation process is terminated, or the terminal control tool performs an access operation based on the first operation parameter and the configuration file. After the access is completed, the operation process is terminated.
[0070] It is worth noting that the terminal control method involved in this embodiment is executed by a terminal control tool, which is an application based on a graphical user interface. A script can be written based on the graphical user interface development framework of PyQt5 to obtain a terminal control tool that can automatically adapt to different operating systems and hardware devices and realize automated operations. The terminal control tool can integrate operations such as access and packet filling into an operation interface. Testers do not need to manually operate different interfaces or write additional scripts. They only need to operate the graphical user interface in the terminal control tool to achieve control of the terminal device.
[0071] Compared with the related art, a terminal control method provided in this embodiment obtains a configuration file, which stores configuration parameters; based on the configuration parameters in the configuration file, determines whether the target terminal is connected; if the target terminal is connected, obtains operation parameters through a graphical user interface; based on the operation parameters and the configuration file, performs terminal control operations to control the target terminal, which solves the problem of low efficiency of the terminal control process in the related art, realizes automated, efficient and accurate control of the terminal device, and greatly improves the efficiency of terminal device control.
[0072] In one embodiment, see Figure 3 Based on the above step S210, before obtaining the configuration file and storing the configuration parameters in the configuration file, the following steps are specifically included:
[0073] Step S310: Generate an initial configuration file, which includes parameter names of various configuration parameters.
[0074] Step S320: Generate a parameter configuration sub-window based on the initial configuration file, and obtain parameter values corresponding to each parameter name based on the parameter configuration sub-window.
[0075] Step S330, saving the parameter value to the initial configuration file to obtain the configuration file.
[0076] Specifically, when the configuration parameters need to be modified, the parameter values of the configuration parameters can be obtained through the terminal control tool. After the terminal control tool is started, an initial configuration file is generated. The parameter names in the initial configuration file can be entered by the tester or directly obtained from the terminal control tool. Exemplarily, the initial configuration file records different parameter names in the form of file parameters of "self.textN", such as self.text1 corresponding to the base station address and self.text2 corresponding to the target terminal address. After obtaining the initial configuration file, the file parameters in the initial configuration file are read to generate the following: Figure 4 The parameter configuration subwindow is shown. The tester enters the modified parameter value in the parameter configuration subwindow and clicks the Save button on the parameter configuration subwindow, which enables the terminal control tool to obtain the parameter value and save each parameter value together with the corresponding parameter name in the initial configuration file to form a configuration file that can be used to perform terminal control operations.
[0077] In this implementation, the configuration parameter values are obtained through the initial configuration file and the parameter configuration sub-window, which makes it easy for the staff to modify the configuration parameters.
[0078] In one embodiment, see Figure 5 Based on the above step S330, the parameter value is saved in the initial configuration file to obtain the configuration file, which specifically includes the following steps:
[0079] Step S331, determine whether the parameter value passes the verification.
[0080] Specifically, check whether the parameter value corresponding to each parameter name is empty.
[0081] Step S332: If the parameter values of all configuration parameters pass the verification, all parameter values are saved in the initial configuration file to obtain the configuration file.
[0082] Step S333: If there are parameter values that fail to pass the verification, a prompt is generated to re-enter the correct parameter value.
[0083] In this embodiment, by verifying the configuration parameters, the reliability of the configuration file is improved and the stability of program operation is improved.
[0084] In one embodiment, see Figure 6 Based on step S220, after determining whether the target terminal is connected based on the configuration parameters in the configuration file, the method further includes:
[0085] Step S410: If the target terminal is connected, the connection status area of the graphical user interface displays that it is connected, and the device disconnect button of the graphical user interface changes from a non-clickable state to a clickable state. In addition, a prompt message and a prompt sub-window for successful device connection can also be generated.
[0086] Step S420: If the target terminal is not connected, the connection status area of the graphical user interface displays "not connected", and the device connection button of the graphical user interface is clickable; in the graphical user interface, except for the device connection button, the remaining buttons are not clickable. In addition, a prompt message and a prompt sub-window of device connection failure can also be generated, and the prompt message suggests checking whether the device connection is normal.
[0087] The architecture of the graphical user interface is as follows Figure 7 As shown, Figure 7 As shown, the graphical user interface includes a terminal connection area, in which controls such as a drop-down box for device selection, a device connection button and a device disconnection button are provided, and there is also a connection status area for displaying the words "connected" and "not connected".
[0088] In one embodiment, see Figure 7 and Figure 8 Based on the above step S230, a terminal control operation is performed based on the operation parameters and the configuration file to control the target terminal to perform the target task, including:
[0089] Step S231: The graphical user interface includes a first function operation area, and the first function operation area includes a first control button. The state of the first control button when it is triggered is determined.
[0090] Step S232, if the first control button is in the execution operation state when it is triggered, the terminal operation is executed to control the target terminal to perform an access task or a release task; wherein the terminal operation includes: obtaining a first operation parameter from a first function operation area, the first operation parameter includes an execution mode and a packet capture duration, wherein the execution mode is preset to any one of terminal access and terminal release; based on the first operation parameter and the configuration file, an access operation or a release operation is executed, the access operation is used to control the target terminal to perform an access task; the release operation is used to control the target terminal to perform a release task.
[0091] Exemplarily, when it is detected that the first control button is triggered and is in the execution operation state, the parameter values of the five configuration parameters, namely the base station address, the target terminal address, the local intranet IP, the packet capture network port, and the packet capture path, in the configuration file are read; based on the five parameter values of the base station address, the target terminal address, the local intranet IP, the packet capture network port, and the packet capture path, as well as the parameter values of the execution mode and the packet capture duration, the terminal access method and the packet capture operation method, or the terminal release method and the packet capture operation method, are executed.
[0092] In addition, during the terminal operation, the first control button changes from the execution operation state to the termination operation state. The first control button can be set as a single button control, which has two states, or can be set as two button controls, each of which controls one state.
[0093] Step S233: If the first control button is in the suspend operation state when it is triggered, a first suspend thread operation is performed to control the target terminal to stop executing the access task or release the task.
[0094] The first thread-termination operation includes: generating a prompt in the graphical user interface to confirm whether to terminate the operation. If an instruction to confirm termination is received, the thread-termination operation process is executed, and the first control button is changed from the termination operation state to the clickable execution operation state. During the process of terminating the thread operation process, the first control button is in a non-clickable state, and becomes a clickable execution operation state after the termination is completed. If an instruction to confirm not to terminate is received, the terminal operation is continued.
[0095] In this embodiment, the terminal control tool can automatically identify and access the target network without the need for the tester to manually operate different interfaces, thereby simplifying the operation process.
[0096] In one embodiment, based on the above step S232, based on the first operation parameter and the configuration file, performing an access operation or a release operation includes:
[0097] Based on the execution mode, packet capture duration and configuration file set as terminal access, a terminal access method and a packet capture operation method are executed concurrently; the first packet capture content obtained by the packet capture operation method is analyzed to obtain an access analysis result; based on the access analysis result, whether the access is successful is judged; or, based on the execution mode, packet capture duration and configuration file set as terminal release, a terminal release method and a packet capture operation method are executed concurrently; the second packet capture content obtained by the packet capture operation method is analyzed to obtain a release analysis result; based on the release analysis result, whether the release is successful is judged.
[0098] In one embodiment, see Figure 7 and Fig. 9 , based on the above step S230, performing a terminal control operation based on the operation parameters and the configuration file to control the target terminal to perform the target task, further comprising:
[0099] Step S234: the graphical user interface further includes a second function operation area, and the second function operation area includes a second control button. After the access operation is successful, the state of the second control button when it is triggered is determined.
[0100] Step S235, if the second control button is triggered to be in the execution operation state, then the packet filling operation is performed to control the target terminal to perform the packet filling task; wherein the packet filling operation includes: obtaining a second operation parameter from the second function operation area, the second operation parameter including the packet filling type, the packet filling mode, the packet filling time, the packet filling size, the packet filling port, and the packet filling length; executing a packet filling method based on the second operation parameter and the configuration file, the packet filling method being used to control the target terminal to perform the packet filling task.
[0101] Exemplarily, when it is detected that the second control button is triggered and is in the execution operation state, the parameter values of the four configuration parameters of the base station address, the target terminal address, the packet filling maintenance IP, the packet filling task IP, and the iperf2 path in the configuration file are read, and based on the four parameter values of the target terminal address, the packet filling maintenance IP, the packet filling task IP, and the iperf2 path and the parameter values of the packet filling type, packet filling mode, packet filling time, packet filling size, packet filling port, and packet filling length, the packet filling method is executed.
[0102] In addition, during the process of executing the bag filling operation, the first control button will change from the execution operation state to the suspension operation state.
[0103] Step S236: If the second control button is in the stop operation state when it is triggered, a second stop thread operation is executed to control the target terminal to stop executing the packet filling task.
[0104] Specifically, the second thread termination operation includes generating a prompt on the graphical user interface to confirm whether to terminate the operation. If an instruction to confirm termination is received, the thread termination operation process and the port number closing method are executed, and after the termination is completed, the first control button is changed from the termination operation state to the clickable execution operation state. During the process of terminating the thread operation process, the first control button is not clickable. If an instruction to confirm not to terminate is received, the packet injection operation is continued.
[0105] In this embodiment, after the terminal control tool accesses the target network, the terminal control tool can automatically execute the packet injection service without being affected by various environmental factors, thereby improving the stability of the execution result.
[0106] In one of the embodiments, after executing the packaging method based on the second operating parameter and the configuration file, the method further includes:
[0107] Step S501, obtaining the printing result and the traffic byte stream based on the packet filling task.
[0108] Step S502, saving the printing result to the tool log file, and displaying the traffic byte stream in the graphical user interface.
[0109] Specifically, the tool log file is automatically generated when the terminal control tool is started. Figure 7 , the traffic byte stream is displayed in the area corresponding to "Operation information print:".
[0110] In this embodiment, important information of the terminal control tool is displayed and recorded, which is convenient for operators to analyze abnormalities and reduce the difficulty of maintenance.
[0111] The present application is described below by means of a preferred embodiment. In this preferred embodiment, the terminal control method is applicable to a terminal control tool developed based on PyQt5, and the terminal control tool is used to control a customer premise equipment (CPE). As shown in FIG10 , the terminal control method comprises the following steps:
[0112] S1, start the terminal control tool developed based on PyQt5 to generate files, which include the configuration file jizhan_config.ini and the tool log file Toolfile_log.log. The configuration file jizhan_config.ini is used to save configuration parameters. The newly generated configuration file jizhan_config.ini includes file parameters. Each file parameter corresponds to a parameter name of a configuration parameter, and the parameter value of the file parameter is empty. The tool log file Toolfile_log.log is used for maintenance and measurement means observation.
[0113] S2, reading file parameters in the configuration file jizhan_config.ini, generating a parameter configuration subwindow based on the file parameters; and obtaining parameter values of each configuration parameter based on the parameter configuration subwindow.
[0114] S3, save the obtained parameter values to the configuration file jizhan_config.ini.
[0115] S4, judging whether the CEP terminal is connected to the terminal control device based on the target terminal address (CPE IP address) in the configuration file jizhan_config.ini.
[0116] S5, after the CEP terminal is connected to the terminal control device, the terminal operation is performed according to the configuration parameters. The terminal operation includes: reading the values of the five configuration parameters of the base station address, CPE IP address, local intranet IP, packet capture network port, and packet capture path in the configuration file jizhan_config.ini, and obtaining the parameter values of the execution mode and packet filling time from the graphical user interface; based on the base station address, CPE IP address, local intranet IP, packet capture network port, packet capture path, execution mode and packet filling time, the terminal access / release method is executed.
[0117] S6, after the CEP terminal successfully accesses the target signal, executes service packet filling according to the configuration parameters. Service packet filling includes: reading the values of the four configuration parameters of CPE IP address, packet filling maintenance IP, packet filling service IP, and iperf2 path in the configuration file jizhan_config.ini, and obtaining the parameter values of packet filling type, packet filling mode, packet filling time, packet filling size, packet filling port, and packet filling length from the graphical user interface; based on the packet filling type, packet filling mode, packet filling time, packet filling size, packet filling port, packet filling length, CPE IP address, packet filling maintenance IP, packet filling service IP, and iperf2 path, execute the packet filling method, output the print results to the tool log Toolfile_log.log, and output the traffic byte stream in the graphical user interface.
[0118] Through this preferred embodiment, the following beneficial effects can be achieved: 1. By using the graphical user interface development framework of PyQt5, an automated access script is written so that the terminal control tool can automatically identify and access the target network without manually operating different interfaces, thereby simplifying the operation process and reducing the complexity of development and maintenance. 2. After the terminal control tool accesses the target network, by writing an automated packet filling service script, the terminal control tool can automatically execute the packet filling service without being affected by various environmental factors, thereby improving the stability of the execution result. 3. By using the simple and easy-to-use characteristics of PyQt5, a concise and easy-to-understand script language is written to reduce the technical threshold for script writing and execution, so that non-technical personnel can also use it easily, thereby improving the user experience. 4. By writing a unified adaptation script, the same terminal control tool can automatically adapt to different operating systems and hardware devices, without having to write different scripts for each operating system and hardware device, thereby further reducing the complexity of development and maintenance.
[0119] In this embodiment, a terminal control device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0120] Fig.11 is a structural block diagram of the terminal control device of this embodiment, such as Fig.11 As shown, the device includes: a configuration module 10, a connection module 20 and an execution module 30.
[0121] The configuration module 10 is used to obtain a configuration file, wherein the configuration file stores configuration parameters.
[0122] The connection module 20 is used to determine whether the target terminal is connected based on the configuration parameters in the configuration file.
[0123] The execution module 30 is used to obtain operation parameters through a graphical user interface if the target terminal is connected; and perform terminal control operations based on the operation parameters and the configuration file to control the target terminal to perform a target task.
[0124] Compared with the related art, a terminal control device provided in this embodiment obtains a configuration file, which stores configuration parameters; based on the configuration parameters in the configuration file, determines whether the target terminal is connected; if the target terminal is connected, obtains operation parameters through a graphical user interface; based on the operation parameters and the configuration file, performs terminal control operations to control the target terminal, which solves the problem of low efficiency of the terminal control process in the related art, realizes automated, efficient and accurate control of the terminal equipment, and greatly improves the efficiency of terminal equipment control.
[0125] Some of the embodiments further include a file generation module, which is used to generate an initial configuration file, wherein the initial configuration file includes parameter names of various configuration parameters; generate a parameter configuration subwindow based on the initial configuration file; obtain parameter values corresponding to each parameter name based on the parameter configuration subwindow; and save the parameter values to the initial configuration file to obtain a configuration file.
[0126] In some of the embodiments, the file generation module is also used to determine whether the parameter value has passed the verification; if the parameter value of each configuration parameter has passed the verification, all the parameter values are saved in the initial configuration file to obtain a configuration file; if there are parameter values that have not passed the verification, a prompt is generated to re-enter the correct parameter value.
[0127] In some of the embodiments, the connection module 20 is also used to, if the target terminal is connected, display connected in the connection status area of the graphical user interface, and change the device disconnect button of the graphical user interface from a non-clickable state to a clickable state; if the target terminal is not connected, display not connected in the connection status area of the graphical user interface, and the device connection button of the graphical user interface is clickable; in the graphical user interface, except for the device connection button, the remaining buttons are all in a non-clickable state.
[0128] In some embodiments, the execution module 30 is also used to: the graphical user interface includes a first function operation area, the first function operation area includes a first control button; determine the state of the first control button when it is triggered; if the first control button is in the execution operation state when it is triggered, execute the terminal operation to control the target terminal to perform an access task or a release task; wherein the terminal operation includes: obtaining a first operation parameter from the first function operation area, the first operation parameter includes an execution mode and a packet capture duration, wherein the execution mode is preset to any one of terminal access and terminal release; based on the first operation parameter and the configuration file, execute an access operation or a release operation, the access operation is used to control the target terminal to perform an access task; the release operation is used to control the target terminal to perform a release task; if the first control button is in the termination operation state when it is triggered, execute a first termination thread operation to control the target terminal to stop executing the access task or the release task.
[0129] In some embodiments, the execution module 30 is also used to concurrently execute a terminal access method and a packet capture operation method based on the execution mode set for terminal access, the packet capture duration, and the configuration file; analyze the first packet capture content obtained by the packet capture operation method to obtain an access analysis result; and judge whether the access is successful based on the access analysis result; or, based on the execution mode set for terminal release, the packet capture duration, and the configuration file, concurrently execute a terminal release method and a packet capture operation method; analyze the second packet capture content obtained by the packet capture operation method to obtain a release analysis result; and judge whether the release is successful based on the release analysis result.
[0130] In some embodiments, the execution module 30 is also used for: the graphical user interface also includes a second function operation area, the second function operation area includes a second control button; after the access operation is successful, determine the state of the second control button when it is triggered; if the second control button is in the execution operation state when it is triggered, execute the packet filling operation to control the target terminal to execute the packet filling task; wherein, the execution of the packet filling operation includes: obtaining a second operation parameter from the second function operation area, the second operation parameter including the packet filling type, packet filling mode, packet filling time, packet filling size, packet filling port, and packet filling length; executing a packet filling method based on the second operation parameter and the configuration file, the packet filling method being used to control the target terminal to execute the packet filling task; if the second control button is in the termination operation state when it is triggered, execute a second termination thread operation to control the target terminal to stop executing the packet filling task.
[0131] In some embodiments, the execution module 30 is further used to obtain a printing result and a traffic byte stream based on the packet filling task; save the printing result to a tool log file, and display the traffic byte stream in the graphical user interface.
[0132] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0133] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0134] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0135] In addition, in combination with the terminal control method provided in the above embodiments, a storage medium may be provided in this embodiment to implement the terminal control method. The storage medium stores a computer program, and when the computer program is executed by a processor, any terminal control method in the above embodiments is implemented.
[0136] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0137] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0138] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0139] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A terminal control method, characterized in that: The method comprises: Obtain a configuration file, wherein the configuration file stores configuration parameters; Based on the configuration parameters in the configuration file, determining whether the target terminal is connected; If the target terminal is connected, the operation parameters are obtained through the graphical user interface; and the terminal control operation is performed based on the operation parameters and the configuration file to control the target terminal to perform the target task.
2. The terminal control method according to claim 1, characterized in that: Before obtaining the configuration file, which stores the configuration parameters, the following steps are included: Generate an initial configuration file, wherein the initial configuration file includes parameter names of various configuration parameters; Generate a parameter configuration subwindow based on the initial configuration file; Acquire parameter values corresponding to each parameter name based on the parameter configuration subwindow; The parameter value is saved in the initial configuration file to obtain a configuration file.
3. The terminal control method according to claim 2, characterized in that: The step of saving the parameter value to the initial configuration file to obtain the configuration file includes: Determining whether the parameter value passes verification; If the parameter values of each of the configuration parameters pass the verification, all the parameter values are saved in the initial configuration file to obtain a configuration file; If there are parameter values that fail to pass the verification, a prompt is generated to re-enter the correct parameter value.
4. The terminal control method according to claim 1, characterized in that: After determining whether the target terminal is connected based on the configuration parameters in the configuration file, the method further includes: If the target terminal is connected, the connection status area of the graphical user interface displays "connected", and the device disconnect button of the graphical user interface changes from a non-clickable state to a clickable state; If the target terminal is not connected, the connection status area of the graphical user interface displays "not connected", and the device connection button of the graphical user interface is clickable; in the graphical user interface, except for the device connection button, the other buttons are not clickable.
5. The terminal control method according to claim 1, characterized in that: The performing a terminal control operation based on the operation parameter and the configuration file to control the target terminal to perform a target task includes: The graphical user interface includes a first function operation area, and the first function operation area includes a first control button; determining a state when the first control button is triggered; If the first control button is triggered to be in the execution operation state, a terminal operation is performed to control the target terminal to perform an access task or a release task; wherein the terminal operation includes: acquiring a first operation parameter from the first function operation area, the first operation parameter including an execution mode and a packet capture duration, wherein the execution mode is preset to be either terminal access or terminal release; based on the first operation parameter and the configuration file, an access operation or a release operation is performed, the access operation is used to control the target terminal to perform an access task; the release operation is used to control the target terminal to perform a release task; If the first control button is in a suspend operation state when it is triggered, a first suspend thread operation is performed to control the target terminal to stop executing the access task or the release task.
6. The terminal control method according to claim 5, characterized in that: Based on the first operation parameter and the configuration file, performing an access operation or a release operation includes: Based on the execution mode set as the terminal access, the packet capture duration and the configuration file, concurrently executing the terminal access method and the packet capture operation method; analyzing the first packet capture content obtained by the packet capture operation method to obtain an access analysis result; and judging whether the access is successful based on the access analysis result; Alternatively, based on the execution mode set for the terminal release, the packet capture duration and the configuration file, the terminal release method and the packet capture operation method are executed concurrently; the second packet capture content obtained by the packet capture operation method is analyzed to obtain a release analysis result; and whether the release is successful is determined based on the release analysis result.
7. The terminal control method according to claim 5, characterized in that: The performing of the terminal control operation based on the operation parameter and the configuration file to control the target terminal to perform the target task further includes: The graphical user interface further includes a second function operation area, the second function operation area includes a second control button; after the access operation is successful, determining the state of the second control button when it is triggered; If the second control button is triggered to be in the execution operation state, the packet filling operation is executed to control the target terminal to execute the packet filling task; wherein the execution of the packet filling operation includes: obtaining a second operation parameter from the second function operation area, the second operation parameter including a packet filling type, a packet filling mode, a packet filling time, a packet filling size, a packet filling port, and a packet filling length; executing a packet filling method based on the second operation parameter and the configuration file, the packet filling method being used to control the target terminal to execute the packet filling task; If the second control button is in the suspend operation state when being triggered, a second suspend thread operation is executed to control the target terminal to stop executing the packet filling task.
8. The terminal control method according to claim 7, characterized in that: After performing a packet filling operation based on the second operation parameter and the configuration file to control the target terminal to perform the packet filling task, the method further includes: Obtaining a printing result and a flow byte stream based on the packet filling task; The print result is saved to a tool log file, and the traffic byte stream is displayed in the graphical user interface.
9. A terminal control device, characterized in that: The device comprises: A configuration module, used to obtain a configuration file, wherein the configuration file stores configuration parameters; A connection module, used to determine whether a target terminal is connected based on the configuration parameters in the configuration file; The execution module is used to obtain operation parameters through a graphical user interface if the target terminal is connected; and perform terminal control operations based on the operation parameters and the configuration file to control the target terminal to perform a target task.
10. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps of the terminal control method according to any one of claims 1 to 8.
