Operating system service configuration method and device, storage medium and electronic device
Automatically configure operating system services by generating batch files, which solves the problem of cumbersome manual configuration, improves the efficiency and accuracy of selection testing, and realizes the automation of batch service configuration.
Patent Information
- Application Number
- CN202210188822.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-02-28
AI Technical Summary
In personal computer selection testing, manual configuration of operating system services is cumbersome and workload-intensive, and errors are prone to occur, resulting in low efficiency of configuration testing.
By generating batch files, automatically configure operating system services, and use target service identifiers and service configuration information to generate script statements to achieve batch service configuration for multiple computers.
It simplifies the manual operation process, reduces the workload, improves the processing efficiency of configuration testing, reduces the consumption of human resources, and reduces the occurrence of configuration errors.
Smart Images

Figure CN114546535B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a service configuration method and device for an operating system, a storage medium and an electronic device. Background Art
[0002] With the development of computer technology, personal computers (PCs) have become one of the commonly used office equipment in enterprises and organizations. In consideration of upgrading the software and hardware of products, enterprises and organizations usually repurchase personal computers regularly to meet the daily office needs of employees.
[0003] Before purchasing technology products in bulk, enterprises and organizations usually conduct selection tests on candidate products. Selection tests refer to the act of evaluating the applicability of candidate products according to the company's business, technology, and safety production needs, in accordance with the test process or evaluation procedure. In the selection test of personal computers, in order to ensure the accuracy of the test results, the various services of the operating system of each personal computer to be tested must be set to the same state, so that each personal computer to be tested can be tested based on the same configuration.
[0004] At present, testers usually check and modify the status of each service of the operating system on each personal computer to be tested one by one. However, there are many services in the operating system, and the tester manually configures each service of the operating system in each personal computer to be tested. The process is very cumbersome, the workload is huge, and it is easy to make mistakes. The processing efficiency of the configuration test work is low. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method for configuring a service of an operating system to solve the problem that each service of the operating system of each computer needs to be manually configured during the selection test process, which is cumbersome and labor-intensive.
[0006] The embodiment of the present invention also provides a service configuration device for an operating system to ensure the actual implementation and application of the above method.
[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0008] A service configuration method for an operating system, comprising:
[0009] When receiving an instruction to configure each computer to be tested in the current performance test, determining a plurality of target service identifiers corresponding to the current performance test;
[0010] Determine the service configuration information corresponding to each of the target service identifiers;
[0011] Generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system;
[0012] Generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers;
[0013] The batch file is applied to configure each service item in the operating system of each computer.
[0014] In the above method, optionally, the determining of multiple target service identifiers corresponding to the current performance test includes:
[0015] Determine test attribute information corresponding to the current performance test, the test attribute information including computer type, test task type and operating system version;
[0016] Determine, among a plurality of pre-stored historical test attribute records, a target historical test attribute record corresponding to the test attribute information;
[0017] Obtaining the service version number contained in the target historical test attribute record;
[0018] Determine a target historical service configuration record corresponding to the service version number from among a plurality of pre-stored historical service configuration records; the target historical service configuration record includes a plurality of first service identifiers and historical configuration information corresponding to each of the first service identifiers;
[0019] Each of the first service identifiers is used as a target service identifier corresponding to the current performance test.
[0020] In the above method, optionally, the determining of the service configuration information corresponding to each target service identifier includes:
[0021] Displaying a modification interface corresponding to each of the historical configuration information to the user, prompting the user whether to modify each of the historical configuration information;
[0022] In response to the modification operation of the user, the target configuration information corresponding to each of the target service identifiers is determined, and the target configuration information corresponding to each of the target service identifiers is used as the service configuration information corresponding to each of the target service identifiers.
[0023] In the above method, optionally, generating a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier includes:
[0024] For each target service identifier, obtain the service item name, service status, and service startup type contained in the service configuration information corresponding to the target service identifier, and generate a script statement corresponding to the target service identifier based on the service item name, the service status, the service startup type and a preset script generation strategy.
[0025] In the above method, optionally, the applying of the batch file to configure each service item in the operating system of each computer includes:
[0026] The batch processing file is stored in a preset shared access location, and each of the computers runs the batch processing file stored in the preset shared access location to configure each service item in the operating system of each of the computers.
[0027] The above method may optionally further include:
[0028] After applying the batch file to configure each service item in the operating system of each computer, determining a configuration log corresponding to each computer;
[0029] Based on the configuration log corresponding to each of the computers, determine whether the configuration result of each of the computers is configuration failure, and use the computer with the configuration result of configuration failure as the target computer;
[0030] The device information and failure information corresponding to each of the target computers are determined, and the device information and failure information corresponding to each of the target computers are displayed.
[0031] The above method may optionally further include:
[0032] Determine a service configuration record corresponding to the current performance test, wherein the service configuration record corresponding to the current performance test includes each of the target service identifiers and service configuration information corresponding to each of the target service identifiers;
[0033] The service configuration record corresponding to the current performance test is stored in a preset configuration storage location.
[0034] A service configuration device for an operating system, comprising:
[0035] A first determining unit, configured to determine a plurality of target service identifiers corresponding to the current performance test when receiving an instruction to configure each computer to be tested in the current performance test;
[0036] A second determining unit, configured to determine service configuration information corresponding to each of the target service identifiers;
[0037] A first generating unit is used to generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system;
[0038] A second generating unit, configured to generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers;
[0039] The configuration unit is used to apply the batch file to configure each service item in the operating system of each computer.
[0040] A storage medium includes stored instructions, wherein when the instructions are executed, a device where the storage medium is located is controlled to execute the above-mentioned method for configuring the service of the operating system.
[0041] An electronic device includes a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to implement the above-mentioned service configuration method for the operating system.
[0042] Based on the above-mentioned embodiment of the present invention, a method for configuring a service of an operating system includes: when receiving an instruction to configure each computer to be tested, determining multiple target service identifiers corresponding to the current performance test; determining the service configuration information corresponding to each target service identifier; generating a script statement corresponding to each target service identifier based on the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system; generating a batch file, in which the script statements corresponding to each target service identifier are stored; and applying the batch file to configure each service item in the operating system of each computer. By applying the method provided by the embodiment of the present invention, the system can determine multiple target service identifiers corresponding to the current performance test, determine the service configuration information corresponding to each target service identifier and generate the corresponding script statement, and apply the batch file containing each script statement to perform batch service configuration on each computer to be tested. The tester does not need to manually configure each computer, and can realize automated batch configuration. The manual operation process is simple, the workload is small, and a large amount of human resources can be saved. It can also reduce the omissions caused by manual operation and improve the processing efficiency of configuration test work. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A method flow chart of a method for configuring a service of an operating system provided by an embodiment of the present invention;
[0045] Figure 2 A flowchart of another method for configuring a service of an operating system provided by an embodiment of the present invention;
[0046] Figure 3 An example diagram of a terminal in a service configuration scenario of an operating system provided by an embodiment of the present invention;
[0047] Figure 4 An exemplary diagram of a service configuration system for an operating system provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of the structure of a service configuration device for an operating system provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0052] As can be seen from the background technology, in the existing selection test work, the tester usually prepares the service configuration list in advance, logs in to each computer (PC) in turn, and checks the service status of each computer operating system item by item based on the service configuration list. If the service status is found to be inconsistent with the requirements, it is manually modified. The configuration process is very cumbersome, the workload is large, the processing efficiency is low, and manual verification and configuration of a large number of services are also prone to omissions.
[0053] Therefore, an embodiment of the present invention provides a service configuration method for an operating system, which generates corresponding script statements based on each service configuration information, and uses a batch file containing each script statement to configure each computer, thereby realizing automated batch configuration without the need for manual configuration by testers, reducing workload and improving efficiency.
[0054] The embodiment of the present invention provides a method for configuring a service of an operating system. The method can be applied to a service configuration system of an operating system. The execution subject can be a processor of the system. The method flow chart of the method is as follows: Figure 1 As shown, including:
[0055] S101: When receiving an instruction to configure each computer to be tested in a current performance test, determining a plurality of target service identifiers corresponding to the current performance test;
[0056] In the method provided by the embodiment of the present invention, before the performance test of each computer is required, the tester can send instructions for configuring each computer through the front-end interface to trigger the system to configure the service status in the operating system of each computer to be tested. The system type and system version of the operating system of each computer are the same. The type of the computer's operating system can be a Window operating system or a Linux operating system, etc. There are multiple system services in the computer's operating system, and adjustment and configuration of each system service are allowed.
[0057] The computer in the embodiment of the present invention refers to a personal computer, that is, a computer, which can be a desktop computer, a notebook computer, an all-in-one computer, or other types of computer equipment.
[0058] When the processor receives instructions to configure each computer currently to be tested, it can determine multiple target service identifiers corresponding to the current performance test according to a preset strategy, that is, the service identifiers of each service that needs to be configured in the operating system of the computer currently being tested. Specifically, the target service identifiers corresponding to the current performance test can be pre-set for the operating system of the computer to be tested in the current performance test, imported or pre-stored in the system, and the target service identifiers corresponding to the current performance test can be determined by obtaining the pre-set information. It is also possible to pre-store historical service configuration records of previous historical tests, and determine the target service identifiers corresponding to the current performance test with reference to the service configuration records of previous tests.
[0059] It should be noted that the method for determining the target service identifier in actual application can be determined according to actual needs and does not affect the function of implementing the method provided in the embodiment of the present invention.
[0060] S102: Determine the service configuration information corresponding to each target service identifier;
[0061] In the method provided by the embodiment of the present invention, for each target service identifier, the corresponding service configuration information is determined, and the service configuration information is the configuration information of the service corresponding to the corresponding target service identifier, such as the name, status and startup type of the service. Specifically, the tester can input the configuration content of the service corresponding to each target service identifier through the front-end interface, and obtain the content input by the user to determine the service configuration information corresponding to each target service identifier. It is also possible to refer to the historical service configuration records of pre-stored historical tests to determine the service configuration information corresponding to each target service identifier. It is also possible to refer to the historical service configuration records and determine the service configuration information in combination with the adjustments made by the tester.
[0062] It should be noted that the method for determining the service configuration information of an actual application can be determined according to actual needs and does not affect the function of implementing the method provided in the embodiment of the present invention.
[0063] S103: generating a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system;
[0064] In the method provided by the embodiment of the present invention, a command generation strategy for modifying the service configuration can be pre-set according to the system type of the operating system of the computer to be tested, and a command script corresponding to each service configuration information is generated according to the preset strategy and each service configuration information as a script statement corresponding to its corresponding target service identifier.
[0065] S104: Generate a batch file, wherein the batch file stores script statements corresponding to each target service identifier;
[0066] In the method provided in the embodiment of the present invention, a batch file can be created, and the script statements corresponding to each target service identifier can be stored in the batch file, so as to obtain a batch file storing the script statements corresponding to all target service identifiers. A batch file refers to an executable file encapsulating multiple processing commands, such as a bat type file applicable to DOS and Windows operating systems. A bat file is an executable file composed of a series of commands, which may include calls to other programs. Each line of this file is a DOS command, and the role of batch processing is to automatically execute multiple commands in succession. It should be noted that in the actual application process, different types of executable files can be used to implement the execution of script statements according to the requirements of the actual operating system type, which does not affect the function of the method provided in the embodiment of the present invention.
[0067] S105: Apply the batch file to configure each service item in the operating system of each computer.
[0068] In the method provided by the embodiment of the present invention, the automatic configuration of each service item in the operating system of each computer can be achieved through a batch file storing all script statements. For example, the batch file can be sent to each computer respectively to execute the batch file on each computer to configure each service item of the operating system so that the status of each service matches the service configuration information of its corresponding target service identifier.
[0069] Based on the method provided by the embodiment of the present invention, when receiving an instruction to configure each computer to be tested, multiple target service identifiers corresponding to the current performance test and the service configuration information corresponding to each target service identifier can be determined. For each target service identifier, a corresponding script statement is generated based on its corresponding service configuration information. A batch file containing script statements corresponding to all target service identifiers is generated, and the batch file is used to configure each service item in the operating system of each computer. By applying the method provided by the embodiment of the present invention, the system can automatically generate a batch file that meets the service configuration requirements of the current performance test, and use the batch file containing each script statement to perform batch service configuration on each computer to be tested. The tester does not need to manually configure each computer, and can realize automated batch configuration. The manual operation process is simple, the workload is small, and a large amount of human resources can be saved. It can also reduce the omissions caused by manual operation and improve the processing efficiency of configuration testing.
[0070] In order to better illustrate the method provided by the embodiment of the present invention, Figure 1Based on the method shown in FIG. 1 , the embodiment of the present invention provides another method for configuring a service of an operating system, referring to FIG. Figure 2 As shown in the flowchart, in the method provided by the embodiment of the present invention, the process of determining multiple target service identifiers corresponding to the current performance test mentioned in step S101 includes:
[0071] S201: Determine test attribute information corresponding to the current performance test, where the test attribute information includes computer type, test task type, and operating system version;
[0072] In the method provided by the embodiment of the present invention, the tester can input information such as the type of computer tested in the current performance test, the test task type, and the operating system version through the system interface. The type of computer, such as a notebook, desktop or all-in-one computer, etc., the test task type refers to the type of demand for the computer, such as thin and light, versatile, etc., which can be defined by yourself. The operating system version refers to the version of the computer's operating system, such as Windows 7 or Windows 10, etc., which can be refined to the specific series version model of the operating system. The computer type, test task type, operating system version and other information of the current performance test input by the tester are obtained as the test attribute information corresponding to the current performance test.
[0073] S202: Determine a target historical test attribute record corresponding to the test attribute information from among a plurality of pre-stored historical test attribute records;
[0074] In the method provided by the embodiment of the present invention, the historical test attribute records of the performance tests previously performed can be pre-stored, that is, the test attribute information corresponding to the previous performance tests. Specifically, the storage can be performed in the form of a table, or in other data formats. Each historical test attribute record contains information such as the computer type, test task type, and operating system version corresponding to the corresponding performance test. The various information contents contained in the test attribute information corresponding to the current performance test are respectively compared one by one with the various information contents contained in each historical test attribute record. The historical test attribute record whose various information contents match the various information contents in the test attribute information is used as the target historical test attribute record. The information such as the computer type, test task type, and operating system version contained in the target historical test attribute record corresponds to the same information such as the computer type, test task type, and operating system version contained in the test attribute information.
[0075] It should be noted that in the actual application process, there may be more than one historical test attribute record containing contents that match the contents in the test attribute information. At this time, the latest one, that is, the historical test attribute record with the test time closest to the current one, can be selected as the target historical test attribute record.
[0076] S203: Obtaining the service version number contained in the target historical test attribute record;
[0077] In the method provided by the embodiment of the present invention, each historical test attribute record also includes its corresponding service version number, and the service version number is an identifier representing its corresponding service historical configuration record. The corresponding service version number is obtained from the target historical test record.
[0078] S204: Determine a target historical service configuration record corresponding to the service version number from among a plurality of pre-stored historical service configuration records; the target historical service configuration record includes a plurality of first service identifiers and historical configuration information corresponding to each of the first service identifiers;
[0079] In the method provided by the embodiment of the present invention, the historical service configuration records of previous performance tests can be pre-stored, that is, the service configuration information applied when configuring the computer to be tested in the previous performance test work, that is, the service identifiers of each service item required to be configured in the previous performance test, and the corresponding historical configuration information. Each historical service configuration record can be stored in a table or in other data formats. It is associated with the pre-stored historical test attribute record through its corresponding service version number. In each pre-stored historical service configuration record, the target historical service configuration record corresponding to the service version number contained in the target historical test attribute record can be obtained by matching the service version number. The target historical service configuration record contains multiple first service identifiers (the service identifiers of each service item configured by the corresponding performance test), and the historical configuration information corresponding to each first service identifier (the service configuration information corresponding to the service identifier).
[0080] S205: Using each of the first service identifiers as a target service identifier corresponding to the current performance test.
[0081] In the method provided by the embodiment of the present invention, each first service identifier contained in the target historical service configuration record is used as the target service identifier corresponding to the current performance test.
[0082] Based on the method provided in the embodiment of the present invention, it is possible to refer to historical service configuration records to obtain target historical service configuration records that match the test attributes of the current performance test, and determine the target service identifier corresponding to the current performance test based on pre-stored information. No human intervention is required, the processing process is relatively simple, and the processing efficiency is high.
[0083] Further, based on the method provided in the above embodiment, in the method provided in the embodiment of the present invention, the process of determining the service configuration information corresponding to each target service identifier mentioned in step S102 includes:
[0084] Displaying a modification interface corresponding to each of the historical configuration information to the user, prompting the user whether to modify each of the historical configuration information;
[0085] In the method provided by the embodiment of the present invention, the various historical configuration information contained in the target historical service configuration record can be displayed to the user (such as a tester) through the front-end interface. Specifically, it can be displayed in a manner such that the target service identifier corresponds to the historical configuration information. The historical configuration information can be displayed in an input box and can be edited by the user to prompt the user whether it is necessary to modify the various historical configuration information.
[0086] In response to the modification operation of the user, the target configuration information corresponding to each of the target service identifiers is determined, and the target configuration information corresponding to each of the target service identifiers is used as the service configuration information corresponding to each of the target service identifiers.
[0087] In the method provided by the embodiment of the present invention, if the user modifies at least one historical configuration information through the front-end interface, in response to the user's modification operation, the configuration information corresponding to each target service identifier after the user's modification is obtained in the front-end interface as its corresponding target configuration information. The target service identifier whose configuration information is modified by the user, its corresponding configuration information is the configuration information modified and input by the user, and the target service identifier whose configuration information is not modified by the user, its corresponding configuration information is still the same as its corresponding historical configuration information. The target configuration information corresponding to each target service identifier is used as its corresponding service configuration information.
[0088] In the method provided by the embodiment of the present invention, if the user does not modify any historical configuration information, the historical configuration information corresponding to each target service identifier is used as the service configuration information corresponding to each target service identifier.
[0089] Based on the method provided in the embodiment of the present invention, the user can make modifications based on the pre-stored historical configuration information to determine the service configuration information corresponding to each current target service identifier. On the basis of improving processing efficiency, a customized approach can be provided to the user, which is conducive to the user making further modifications based on the actual needs of the current performance test, thereby improving the user's usage experience.
[0090] Further, in Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of generating the script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier mentioned in step S103 includes:
[0091] For each target service identifier, obtain the service item name, service status, and service startup type contained in the service configuration information corresponding to the target service identifier, and generate a script statement corresponding to the target service identifier based on the service item name, the service status, the service startup type and a preset script generation strategy.
[0092] In the method provided by the embodiment of the present invention, a script generation strategy can be pre-configured according to the command form of the operating system. Based on the preset script generation strategy, according to the service item name, service status, service startup type and other information contained in the service configuration information corresponding to each target service identifier, a script statement corresponding to each target service identifier is generated, and the script statement is used to set the service corresponding to the corresponding service item name according to the corresponding service status, service startup type and other content.
[0093] Further, in Figure 1 On the basis of the method shown, in the method provided by the embodiment of the present invention, the process of applying the batch file mentioned in step S105 to configure each service item in the operating system of each computer includes:
[0094] The batch processing file is stored in a preset shared access location, and each of the computers runs the batch processing file stored in the preset shared access location to configure each service item in the operating system of each of the computers.
[0095] In the method provided by the embodiment of the present invention, each computer and the operating device of the configuration system can be connected to the same network, and the batch file can be stored in a preset shared access location, that is, stored in a specified path in the network, and the shared access location can be accessed by each computer. Each computer can execute the batch file stored in the shared access location by accessing it, and each computer can automatically complete the service item configuration task in the operating system by executing the script. Specifically, a script that automatically runs at startup can be configured in each computer, and the location of the running script can be specified to the path where the batch file is located, so that each computer can automatically execute the script after startup to complete the service configuration task.
[0096] Further, in Figure 1 On the basis of the method shown, the method provided in the embodiment of the present invention further includes:
[0097] After applying the batch file to configure each service item in the operating system of each computer, determining a configuration log corresponding to each computer;
[0098] In the method provided by the embodiment of the present invention, after each computer applies a batch file to perform service configuration, a log of each computer after executing the batch file can be obtained as a configuration log corresponding to each computer.
[0099] Based on the configuration log corresponding to each of the computers, determine whether the configuration result of each of the computers is configuration failure, and use the computer with the configuration result of configuration failure as the target computer;
[0100] In the method provided by the embodiment of the present invention, the configuration log corresponding to each computer can be parsed, and the error and success information in the log can be parsed to determine the configuration result of each computer, that is, whether each service item has been successfully configured according to the script. If the configuration result of the computer is a configuration failure, that is, at least one service item has not been successfully configured, the computer is used as the target computer.
[0101] It should be noted that the number of target computers may be one or more, and the number corresponds to the computers whose configuration results are configuration failures. In actual application, there may be no target computer, that is, if all the computers to be tested have successfully completed configuration, then the subsequent steps will not be executed.
[0102] The device information and failure information corresponding to each of the target computers are determined, and the device information and failure information corresponding to each of the target computers are displayed.
[0103] In the method provided by the embodiment of the present invention, for each target computer, the corresponding device information and failure information can be determined through the parsing result of the configuration log, and the device information can include the IP address of the computer, etc., and the failure information can include the name of the service item that failed to be configured and the specific error content, etc. The device information and failure information corresponding to each target computer are displayed to the user through the front-end interface, that is, the user is prompted which computer configuration failed, the specific service item that failed to be configured, and the reason for the failure.
[0104] Based on the method provided in the embodiment of the present invention, relevant information of the configuration failure can be further fed back to the user, which is beneficial for the user to troubleshoot the problem and can further improve the user's usage experience.
[0105] Further, in Figure 1 On the basis of the method shown, the method provided in the embodiment of the present invention further includes:
[0106] Determine a service configuration record corresponding to the current performance test, wherein the service configuration record corresponding to the current performance test includes each of the target service identifiers and service configuration information corresponding to each of the target service identifiers;
[0107] The service configuration record corresponding to the current performance test is stored in a preset configuration storage location.
[0108] In the method provided by the embodiment of the present invention, a service configuration record corresponding to the current performance test can be generated based on each target service identifier and the service configuration information corresponding to each target service identifier, and the service configuration record can be stored in a preset configuration storage location. At the same time, a test attribute record corresponding to the current performance test can also be generated based on the test attribute information corresponding to the current performance test, and stored corresponding to the corresponding service configuration record, which can be used as an information reference for subsequent tests or for work troubleshooting by staff.
[0109] In order to better illustrate the method provided by the embodiment of the present invention, the method provided by the embodiment of the present invention is further described below in combination with actual application scenarios.
[0110] The service configuration process of the operating system provided by the embodiment of the present invention can be implemented by configuring the system. Each terminal involved in the configuration process can be as follows: Figure 3 As shown, it includes various PC (personal computer) terminals to be tested, a control terminal and a database server, and the configuration system can be applied to the control terminal. The operating system of the PC terminal is Windows operating system.
[0111] The architecture of the configuration system may include a display layer, a control layer, and a data layer. Specifically, a browser / server architecture (B / S) or a client / server architecture (C / S) may be used.
[0112] The display layer is used to display data and receive services such as user-transmitted data, and to implement an operating interface for interaction with users.
[0113] The control layer is used to handle business rules, data access, validity checks, etc. It can respond to user operations on the system operation interface and execute the corresponding operation instructions. For example, it interacts with the database of the data layer, receives user interface input data for validity checks, processes data to generate Windows service lists, generates batch scripts, etc.
[0114] The data layer can set up a database to store Windows service list historical data, etc.
[0115] The configuration system may be provided with multiple modules to implement a specific configuration process, which is an instantiation of the service configuration method of the operating system provided in the above embodiment. The structural diagram of the system may be as follows: Figure 4 As shown, it includes: a Windows service list historical version library, a label attribute entry module, a Windows service reference list acquisition module, a Windows service list content adjustment module, a Windows service list generation module, a batch configuration script generation module, a script distribution execution module and a configuration result verification module.
[0116] Windows service list historical version library: used to store the Windows service list content used in historical test tasks.
[0117] The database is used to store the contents of the Windows service list. The main database tables include: label attribute table and Windows service version table. By establishing associations between database tables, the Windows service list used in the test can be archived.
[0118] The fields of the tag attribute table mainly include: PC type, test task type, Windows operating system version, version number, etc. The table structure of the tag attribute table is shown in Table 1. Among them, the version number field is used to establish an association with the Windows service version table.
[0119] Table 1: The table structure of the tag attribute table
[0120]
[0121] The fields of the Windows service version table mainly include: the name of the Windows service item, the status of the Windows service item, the startup type of the Windows service item, the version number, etc. Among them, the version number field is used to establish an association with the tag attribute table. The table structure of the Windows service version table is shown in Table 2.
[0122] Table 2 The table structure of Windows service version table
[0123]
[0124] Tag attribute entry module: used to provide testers with an operation interface to enter basic tag attribute information for this performance test task.
[0125] Basic tag attribute information includes: PC type, test task type, Windows operating system version, etc. The tag attribute value entered by the tester through the operation interface provided by this module is transmitted to the Windows service list history version library, and a record is inserted into the tag attribute table, that is, the basic tag attribute information of this performance test task is stored in the library.
[0126] Windows service reference list acquisition module: used to match the Windows service list with the same label attributes as the current test task from the historical test tasks as the Windows service reference list for the current test task. It can be understood that the Windows service list of the same type of test tasks in the past can be used as a reference for the current test task.
[0127] The specific process is:
[0128] Get the historical test task version number that matches this test task.
[0129] Based on the label attributes of this test task obtained by the label attribute entry module, search in the historical records of the label attribute table in the Windows service list historical version library, find the records in the historical records whose label attributes such as "PC computer type, test task type, Windows operating system version" are consistent with the label attribute values of this test task, and extract the version number field of the record.
[0130] Based on the version number field obtained in the previous step, find the record with the same version number in the Windows service version table, extract the content of the record, generate a list format file and push it to the Windows service reference list acquisition module as the Windows service reference list for this test task.
[0131] Since the same type of test tasks may have been tested multiple times in historical tests, there may be one or more version numbers of the historical records found in the previous step. If there is one matching historical version number, the corresponding Windows service list is found through the version number as the return result. If there are multiple matching historical version numbers, the historical version number with the largest version number is taken (according to the insertion rules of the tag attribute table records, the larger the version number, the newer the version), and the corresponding Windows service list is found through the version number as the return result.
[0132] Windows service list content adjustment module: used to adjust the service status and startup type values in the Windows service reference list obtained from the Windows service reference list acquisition module according to actual test needs.
[0133] This module provides a Windows service item list display function, which is used to display the values of each field in the Windows service reference list to the user. It also provides a Windows service reference list value adjustment function. For example, users can use this module to adjust the status of the Windows update service item in the list from "running" to "stopped", and the startup type from "manual" to "disabled".
[0134] Windows service list generation module: used to generate the latest adjusted Windows service list as the Windows service list used in this test task, and archive it by calling the interface provided by the Windows service list historical version library.
[0135] The specific process of archiving is as follows:
[0136] The tag attribute value entered by the tester through the operation interface provided by the tag attribute entry module is transmitted to the Windows service list historical version library, and a record is inserted into the tag attribute table.
[0137] Insert the Windows service list content generated in this module into the Windows service version table of the Windows service list history version library. Create a record in the database table for each Windows service item. The version number field value is the record version number value inserted in the label attribute table in the previous step. That is, the association relationship between the record in the label attribute table and the record in the Windows service version table is established through the version number.
[0138] Batch configuration script generation module: used to automatically generate batch configuration scripts based on the Windows service list used in this test task.
[0139] Each line in the Windows service list describes a Windows service, including: the name of the Windows service item, the status of the Windows service item, the startup type of the Windows service item, etc. The program automatically reads the Windows service list line by line, parses the name, status (running / stopped), startup type (disabled / automatic / manual) field values of the Windows service item, and generates corresponding script statements that can modify the value of the service item in the Windows Service Control Manager, such as: scconfig wuauserv start=disabled.
[0140] Until all service item rows in the Windows service list generate corresponding script statements, each script statement is stored in a batch processing bat type file.
[0141] Script distribution execution module: used to apply batch configuration Windows service scripts to all participating PC terminals and automatically configure Windows services of each PC terminal.
[0142] This module stores the script (batch type file) generated in the previous step in a specified path on the network, which must be accessible to all participating PC terminals. By configuring Windows group policy, configure the script to automatically run when the computer is turned on, and specify the path where the batch script is located. Apply this policy to the specified test terminal computer. After each participating PC terminal is turned on, the script runs automatically to complete the configuration of the Windows service of each PC terminal.
[0143] Configuration result verification module: used to verify whether the batch configuration of Windows services of all participating PC terminals is successful. In view of the fact that some Windows services cannot be started / stopped normally during actual testing, this module captures the logs of each PC terminal after running the script in the background, parses the error and success information in the logs, and prompts the user through the front-end interface with the PC terminal IP, service item name and specific error information of the failed configuration, so that the user can further troubleshoot the problem.
[0144] The method provided by the embodiment of the present invention can realize remote batch modification of Windows service functions of different PC terminals. It also provides a Windows service version library that has been used in historical test tasks, and can match the historical test tasks based on the attributes of the test tasks, so as to obtain a Windows service list of the same type of test tasks. The operation is simple, and the test efficiency is improved while ensuring the accuracy and consistency of Windows service item modification. It solves the problem of low efficiency and large amount of manpower consumption in the existing technology.
[0145] and Figure 1 Corresponding to the service configuration method of an operating system shown in FIG. 1 , an embodiment of the present invention further provides a service configuration device for an operating system, Figure 1 The specific implementation of the method shown in is shown in the structural diagram Figure 5 As shown, including:
[0146] The first determining unit 301 is used to determine multiple target service identifiers corresponding to the current performance test when receiving an instruction to configure each computer to be tested in the current performance test;
[0147] The second determining unit 302 is used to determine the service configuration information corresponding to each target service identifier;
[0148] The first generating unit 303 is used to generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system;
[0149] The second generating unit 304 is used to generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers;
[0150] The configuration unit 305 is used to apply the batch file to configure each service item in the operating system of each computer.
[0151] Based on the device provided by the embodiment of the present invention, when receiving the instruction to configure each computer to be tested, multiple target service identifiers corresponding to the current performance test and the service configuration information corresponding to each target service identifier can be determined. For each target service identifier, its corresponding script statement is generated according to its corresponding service configuration information. A batch file containing script statements corresponding to all target service identifiers is generated, and the batch file is used to configure each service item in the operating system of each computer. By using the device provided by the embodiment of the present invention, the system can automatically generate a batch file that meets the service configuration requirements of the current performance test, and use the batch file containing each script statement to perform batch service configuration on each computer to be tested. The tester does not need to manually configure each computer, and can realize automated batch configuration. The manual operation process is simple, the workload is small, and a large amount of human resources can be saved. It can also reduce the omissions caused by manual operation and improve the processing efficiency of configuration test work.
[0152] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the first determining unit 301 includes:
[0153] A first determining subunit is used to determine the test attribute information corresponding to the current performance test, wherein the test attribute information includes the computer type, the test task type and the operating system version;
[0154] A second determining subunit, configured to determine a target historical test attribute record corresponding to the test attribute information from among a plurality of pre-stored historical test attribute records;
[0155] A first acquisition subunit is used to acquire a service version number contained in the target historical test attribute record;
[0156] The third determination sub-unit is used to determine the target historical service configuration record corresponding to the service version number among multiple pre-stored historical service configuration records; the target historical service configuration record contains multiple first service identifiers and historical configuration information corresponding to each of the first service identifiers; and each of the first service identifiers is used as the target service identifier corresponding to the current performance test.
[0157] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the second determining unit 302 includes:
[0158] A prompting subunit, used to display a modification interface corresponding to each of the historical configuration information to the user, prompting the user whether to modify each of the historical configuration information;
[0159] The fourth determining subunit is used to determine the target configuration information corresponding to each of the target service identifiers in response to the modification operation of the user, and use the target configuration information corresponding to each of the target service identifiers as the service configuration information corresponding to each of the target service identifiers.
[0160] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the first generating unit 303 includes:
[0161] The second acquisition sub-unit is used to obtain, for each target service identifier, the service item name, service status, and service startup type contained in the service configuration information corresponding to the target service identifier, and generate a script statement corresponding to the target service identifier based on the service item name, the service status, the service startup type and a preset script generation strategy.
[0162] On the basis of the device provided in the above embodiment, in the device provided in the embodiment of the present invention, the configuration unit 305 includes:
[0163] The storage subunit is used to store the batch processing file in a preset shared access location, so that each of the computers runs the batch processing file stored in the preset shared access location to configure each service item in the operating system of each of the computers.
[0164] On the basis of the device provided in the above embodiment, the device provided in the embodiment of the present invention further includes:
[0165] A third determining unit is used to determine a configuration log corresponding to each of the computers after configuring each service item in the operating system of each of the computers by applying the batch file;
[0166] a fourth determining unit, configured to determine whether a configuration result of each of the computers is a configuration failure based on a configuration log corresponding to each of the computers, and to use the computer whose configuration result is a configuration failure as a target computer;
[0167] The display unit is used to determine the device information and failure information corresponding to each of the target computers, and to display the device information and failure information corresponding to each of the target computers.
[0168] On the basis of the device provided in the above embodiment, the device provided in the embodiment of the present invention further includes:
[0169] A recording unit is used to determine the service configuration record corresponding to the current performance test, wherein the service configuration record corresponding to the current performance test includes each of the target service identifiers and the service configuration information corresponding to each of the target service identifiers; and store the service configuration record corresponding to the current performance test in a preset configuration storage location.
[0170] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the service configuration method of the operating system as described above.
[0171] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 6 As shown, it specifically includes a memory 401 and one or more instructions 402, wherein the one or more instructions 402 are stored in the memory 401 and are configured to be executed by one or more processors 403 to perform the following operations:
[0172] When receiving an instruction to configure each computer to be tested in the current performance test, determining a plurality of target service identifiers corresponding to the current performance test;
[0173] Determine the service configuration information corresponding to each of the target service identifiers;
[0174] Generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system;
[0175] Generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers;
[0176] The batch file is applied to configure each service item in the operating system of each computer.
[0177] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0178] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0179] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A service configuration method for an operating system, characterized in that: include: When receiving an instruction to configure each computer to be tested in the current performance test, determining a plurality of target service identifiers corresponding to the current performance test; Determine the service configuration information corresponding to each of the target service identifiers; Generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system; Generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers; Applying the batch file to configure each service item in the operating system of each computer; The step of determining a plurality of target service identifiers corresponding to the current performance test includes: Determine the test attribute information corresponding to the current performance test, the test attribute information including the computer type, the test task type and the operating system version; determine the target historical test attribute record corresponding to the test attribute information among multiple pre-stored historical test attribute records; obtain the service version number contained in the target historical test attribute record; determine the target historical service configuration record corresponding to the service version number among multiple pre-stored historical service configuration records; the target historical service configuration record contains multiple first service identifiers and the historical configuration information corresponding to each of the first service identifiers; use each of the first service identifiers as the target service identifier corresponding to the current performance test; Generating a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier includes: For each target service identifier, obtain the service item name, service status, and service startup type contained in the service configuration information corresponding to the target service identifier, and generate a script statement corresponding to the target service identifier based on the service item name, the service status, the service startup type and a preset script generation strategy.
2. The method according to claim 1, characterized in that The determining of the service configuration information corresponding to each target service identifier includes: Displaying a modification interface corresponding to each of the historical configuration information to the user, prompting the user whether to modify each of the historical configuration information; In response to the modification operation of the user, the target configuration information corresponding to each of the target service identifiers is determined, and the target configuration information corresponding to each of the target service identifiers is used as the service configuration information corresponding to each of the target service identifiers.
3. The method according to claim 1, characterized in that The applying the batch file to configure each service item in the operating system of each computer includes: The batch processing file is stored in a preset shared access location, and each of the computers runs the batch processing file stored in the preset shared access location to configure each service item in the operating system of each of the computers.
4. The method according to claim 1, characterized in that Also includes: After applying the batch file to configure each service item in the operating system of each computer, determining a configuration log corresponding to each computer; Based on the configuration log corresponding to each of the computers, determine whether the configuration result of each of the computers is configuration failure, and use the computer with the configuration result of configuration failure as the target computer; The device information and failure information corresponding to each of the target computers are determined, and the device information and failure information corresponding to each of the target computers are displayed.
5. The method according to claim 1, characterized in that Also includes: Determine a service configuration record corresponding to the current performance test, wherein the service configuration record corresponding to the current performance test includes each of the target service identifiers and service configuration information corresponding to each of the target service identifiers; The service configuration record corresponding to the current performance test is stored in a preset configuration storage location.
6. A service configuration device for an operating system, characterized in that: include: A first determining unit, configured to determine a plurality of target service identifiers corresponding to the current performance test when receiving an instruction to configure each computer to be tested in the current performance test; A second determining unit, configured to determine service configuration information corresponding to each of the target service identifiers; A first generating unit is used to generate a script statement corresponding to each target service identifier according to the service configuration information corresponding to each target service identifier; the script statement corresponding to each target service identifier is used to configure the project value of the service item corresponding to the target service identifier in the operating system; A second generating unit, configured to generate a batch file, wherein the batch file stores script statements corresponding to each of the target service identifiers; A configuration unit, used to apply the batch file to configure each service item in the operating system of each of the computers; Wherein, the first determining unit includes: A first determining subunit is used to determine the test attribute information corresponding to the current performance test, wherein the test attribute information includes the computer type, the test task type and the operating system version; A second determining subunit, configured to determine a target historical test attribute record corresponding to the test attribute information from among a plurality of pre-stored historical test attribute records; A first acquisition subunit is used to acquire a service version number contained in the target historical test attribute record; A third determination subunit is used to determine a target historical service configuration record corresponding to the service version number from a plurality of pre-stored historical service configuration records; the target historical service configuration record includes a plurality of first service identifiers and historical configuration information corresponding to each of the first service identifiers; and each of the first service identifiers is used as a target service identifier corresponding to the current performance test; The first generating unit comprises: The second acquisition sub-unit is used to obtain, for each target service identifier, the service item name, service status, and service startup type contained in the service configuration information corresponding to the target service identifier, and generate a script statement corresponding to the target service identifier based on the service item name, the service status, the service startup type and a preset script generation strategy.
7. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the service configuration method for the operating system according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The system comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the service configuration method of the operating system as claimed in any one of claims 1 to 5.
