Method and device for detecting operating system

By determining the set of objects to be detected and the detection strategy set, using script files to collect data and manage detection indicators, the problem of low manual detection accuracy is solved, and the automatic detection and accuracy improvement of the operating system is achieved.

CN120371606APending Publication Date: 2025-07-25CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510411919.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

In the prior art, the detection results of manual detection operating systems are low, making it difficult to ensure comprehensive detection and accuracy.

Method used

By determining the set of objects to be detected and the set of detection policies, collecting detection data using script files, and automatically detecting them based on the alarm threshold, and using the target policy template to manage the changes in detection indicators and thresholds.

Benefits of technology

It realizes automated detection of the operating system, improves detection accuracy, avoids the shortcomings of manual detection, and ensures the accuracy and comprehensiveness of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371606A_ABST
    Figure CN120371606A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an operating system detection method and device, and the method comprises the steps: determining a to-be-detected object set, the to-be-detected object set comprises N to-be-detected objects, a target operating system is installed on the to-be-detected objects, and N is an integer; a detection strategy set is determined according to the to-be-detected object set, the detection strategy set comprises N detection strategies, and the detection strategies are in one-to-one correspondence with the to-be-detected objects; and detecting the target operating system according to the detection strategy set. Through the method and the device, the problem of low detection result accuracy caused by manual operation system detection in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of communications, and more particularly, to a method and apparatus for detecting an operating system. Background Art

[0002] In the related art, detecting the status and performance metrics of an operating system is an important and indispensable task in operations and maintenance work, which can ensure that operations and maintenance personnel can detect abnormal status or performance bottlenecks of the operating system as early as possible and intervene in a timely manner to avoid problems such as system service interruptions. Currently, the detection of operating systems is usually carried out by staff themselves. Manual detection depends on the professional ability of the staff, which is difficult to ensure a comprehensive detection of the operating system, and there may be problems with inaccurate detection results.

[0003] In view of the above problems, there is currently no effective solution. Summary of the Invention

[0004] Embodiments of the present invention provide a method and apparatus for detecting an operating system, so as to at least solve the problem of low accuracy of detection results caused by manual detection of an operating system in the related art.

[0005] According to an embodiment of the present invention, there is provided a method for detecting an operating system, including: determining a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, and a target operating system is installed on the objects to be detected, and N is an integer; determining a set of detection strategies according to the set of objects to be detected, where the set of detection strategies includes N detection strategies, and the detection strategies correspond to the objects to be detected one by one; and detecting the target operating system according to the set of detection strategies.

[0006] In an exemplary embodiment, determining a set of detection strategies according to the set of objects to be detected includes: determining detection metrics of the target operating system to obtain M detection metrics, where M is an integer; determining alarm thresholds of each of the detection objects on each of the detection metrics; and creating the detection strategies according to the detection metrics and the corresponding alarm thresholds to obtain the set of detection strategies.

[0007] In an exemplary embodiment, detecting the target operating system according to the set of detection strategies includes: running script files corresponding to each of the detection metrics on each of the detection objects to collect detection data of each of the detection objects on the corresponding detection metrics through the script files; and determining detection results of each of the detection objects under the corresponding detection metrics according to the detection data and the corresponding alarm thresholds, where the detection results of the target operating system include the detection results of each of the detection objects under each of the detection metrics.

[0008] In an exemplary embodiment, running the script files corresponding to the respective detection metrics on each of the detection objects to collect the detection data of each of the detection objects on the corresponding detection metrics through the script files, including: running the j-th script file corresponding to the j-th detection metric on the i-th detection object to collect the detection data of the i-th detection object on the j-th detection metric, so as to obtain the target detection data, where i and j are integers;

[0009] Determining the detection results of each of the detection objects under the corresponding metrics according to the detection data and the corresponding alarm thresholds, including: when the alarm threshold for the j-th detection metric on the i-th detection object is the target alarm threshold and the target detection data reaches the target alarm threshold, determining that the detection result for the j-th detection metric on the i-th detection object is abnormal; otherwise, the detection result is normal.

[0010] In an exemplary embodiment, after creating the detection policy according to the detection metrics and the corresponding alarm thresholds, the method further includes: when the detection metrics of the target operating system change, changing the detection metrics in the N detection policies through the target policy template, where the target policy template has an associated relationship with each of the detection policies.

[0011] In an exemplary embodiment, when the detection metrics of the target operating system change, changing the detection metrics in the N detection policies through the target policy template includes: when there is a newly added detection metric in the target operating system, adding the newly added detection metric to the target policy template so as to synchronously add the newly added detection metric to the N detection policies through the target policy template; when deleting the first detection metric of the target operating system, deleting the first detection metric in the target policy template so as to synchronously delete the first detection metric in the N detection policies through the target policy template; when updating the alarm threshold for the second detection metric of the target operating system, updating the alarm threshold for the second detection metric in the target policy template so as to synchronously update the alarm threshold for the second detection metric in the N detection policies through the target policy template.

[0012] According to another embodiment of the present invention, there is provided a detection device for an operating system, including: a first determination module configured to determine a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, and the target operating system is installed on the objects to be detected, and N is an integer; a second determination module configured to determine a set of detection strategies according to the set of objects to be detected, where the set of detection strategies includes N detection strategies, and the detection strategies correspond to the objects to be detected one by one; and a detection module configured to detect the target operating system according to the set of detection strategies.

[0013] According to still another embodiment of the present invention, there is also provided a computer-readable storage medium in which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.

[0014] According to still another embodiment of the present invention, there is also provided an electronic device including a memory and a processor. 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.

[0015] According to still another embodiment of the present invention, there is also provided a computer program product including a computer program. When the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.

[0016] By means of the present invention, a set of objects to be detected is determined. The set of objects to be detected includes N objects to be detected, and the target operating system is installed on the objects to be detected, and N is an integer; a set of detection strategies is determined according to the set of objects to be detected. The set of detection strategies includes N detection strategies, and the detection strategies correspond to the objects to be detected one by one; and the target operating system is detected according to the set of detection strategies. The purpose of automatically detecting the target operating system based on the detection strategies is achieved. Therefore, the problem of low accuracy of detection results caused by manual detection of the operating system in the related art can be solved, and the effect of improving the accuracy of operating system detection can be achieved. Description of the Drawings

[0017] Figure 1 is a hardware structure block diagram of a mobile terminal for a method of detecting an operating system according to an embodiment of the present invention;

[0018] Figure 2 is a flowchart of a method of detecting an operating system according to an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of an index module according to an embodiment of the present invention;

[0020] Figure 4Schematic diagram of a policy module according to an embodiment of the present invention;

[0021] Figure 5 Schematic diagram of an acquisition module according to an embodiment of the present invention;

[0022] Figure 6 Schematic diagram of a resource module according to an embodiment of the present invention;

[0023] Figure 7 Schematic diagram of a deployment detection process according to an embodiment of the present invention;

[0024] Figure 8 Schematic diagram of an update index according to an embodiment of the present invention;

[0025] Figure 9 Block diagram of the structure of a detection device for an operating system according to an embodiment of the present invention. Detailed implementation manners

[0026] Embodiments of the present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.

[0028] The method embodiments provided in the embodiments of the present application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is the hardware block diagram of a mobile terminal of a detection method for an operating system according to an embodiment of the present invention. As Figure 1 shown, the mobile terminal may include one or more ( Figure 1 only one is shown in Figure 1 a processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Among them, the above-mentioned mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that, Figure 1 the structure shown in Figure 1 is only schematic and does not limit the structure of the above-mentioned mobile terminal. For example, the mobile terminal may further include more or fewer components than

[0029] 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 detection method of the operating system in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned method is implemented. 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 memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the mobile terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] In this embodiment, a detection method for an operating system running on the above-mentioned mobile terminal is provided. Figure 2 It is a flowchart of the detection method for the operating system according to the embodiments of the present invention, as Figure 2 shown. The process includes the following steps:

[0032] Step S202, determine a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, and the object to be detected is installed with a target operating system, and N is an integer;

[0033] The target operating system can be any operating system in the prior art, such as RedHat Linux, OracleLinux, Kylin OS, etc. The object to be detected is any device installed with the target operating system, such as: host, server, mobile phone, tablet computer, etc. The number of N can be determined according to the actual situation, such as 100, 1000, etc.

[0034] Step S204, determine a set of detection strategies according to the set of objects to be detected, where the set of detection strategies includes N detection strategies, and the detection strategies correspond to the objects to be detected one by one;

[0035] Taking the detection object as the host as an example, each host corresponds to a detection policy, and the detection policy includes detection indicators, alarm thresholds for the detection indicators, detection frequencies, etc.

[0036] Specifically, determine the detection indicators of the target operating system to obtain M detection indicators, where M is an integer; determine the alarm thresholds of each detection object for each detection indicator; create the detection policy according to the detection indicators and the corresponding alarm thresholds to obtain the detection policy set.

[0037] The stable and effective operation of business application programs is based on the guarantee provided by the network, storage, and system. Operating system detection mainly refers to collecting data on the resource conditions of the central processing unit (CPU), network, memory, disk I / O, disk partitions, processes, and file systems that can reflect the running status of the current instance (the instance in this application is the object to be detected, such as a host), and at the same time setting alarm thresholds, comparing the collected detection data with the pre-set alarm thresholds, and if the alarm threshold is triggered, an alarm is issued to notify the operation and maintenance personnel to pay attention and solve the problem. The detection indicators are shown in Table 1 below:

[0038] Table 1

[0039]

[0040]

[0041] Some or all of the detection indicators in Table 1 above can be selected to detect the target operating system. For the same detection indicator, the alarm thresholds for different detection objects can be set to the same value or different values. For example, for the CPU usage rate of different hosts, the alarm thresholds can be set to the same value or different values.

[0042] The following is illustrated by a specific embodiment:

[0043] The detection object set includes {Host 1, Host 2,..., Host N}, and Host 1, Host 2,..., Host N are all installed with the target operating system. The detection indicators of the target operating system selected from Table 1 above include: CPU usage rate, memory usage rate (the selection of specific indicators needs to be set according to the actual scenario, and this embodiment is only used as a simple example for explanation). For the CPU usage rate, the alarm thresholds for Host 1, Host 2,..., Host N can be set to the same value of 80% (or different alarm thresholds can also be set). For the memory usage rate, the alarm thresholds for Host 1, Host 2,..., Host N can be set to the same value of 90% (or different alarm thresholds can also be set). In this way, N detection policies can be obtained, one host corresponds to one detection policy, and each detection policy includes the CPU usage rate, memory usage rate, and the alarm thresholds for each detection indicator.

[0044] In the above embodiments, by setting detection metrics and corresponding alarm thresholds for each detection object, the purpose of automatically detecting the target operating system can be achieved based on the detection strategy, avoiding the problem of low accuracy of manual detection in the prior art and achieving the effect of improving the detection accuracy of the target operating system.

[0045] Step S206, detecting the target operating system according to the set of detection strategies.

[0046] Run the script files corresponding to the respective detection metrics on each of the detection objects to collect, through the script files, the detection data of each of the detection objects on the corresponding detection metrics;

[0047] Determine the detection results of each of the detection objects under the corresponding detection metrics according to the detection data and the corresponding alarm thresholds, where the detection results of the target operating system include the detection results of each of the detection objects under each detection metric.

[0048] Collect the detection data of the detection metrics of the detection objects through the script files, and there is one or more script files corresponding to each detection metric. The detection data of the detection objects under the corresponding metrics are collected in real time through the corresponding script files.

[0049] The implementation methods of the script files are divided into two types: the first is the built-in script, developed using Python, calling the Python plugin package, and referencing modules such as os and psutils to obtain the detection data of the target operating system under each detection metric. The second is the custom script, developed using shell, and collecting the detection data of the various detection metrics of the system through commands from the host.

[0050] For example, run the j-th script file corresponding to the j-th detection metric on the i-th detection object to collect, through the j-th script file, the detection data of the i-th detection object on the j-th detection metric, to obtain the target detection data, where i and j are integers;

[0051] Determining the detection results of each of the detection objects under the corresponding metrics according to the detection data and the corresponding alarm thresholds includes: when the alarm threshold on the j-th detection metric of the i-th detection object is the target alarm threshold and the target detection data reaches the target alarm threshold, determining that the detection result on the j-th detection metric of the i-th detection object is abnormal; otherwise, the detection result is normal.

[0052] In the above embodiments, the detected data is compared with the alarm threshold, and if the alarm threshold is reached, an alarm is given, achieving the effect of giving an alarm in a timely manner when the detection data of a detection object on a certain detection metric is abnormal.

[0053] The detection system of the operating system of this application includes: an index module, a collection module, a policy module, and a resource module. The index module includes all detection indexes required for operating system detection. The detection indexes are applicable to any operation in the prior art and include CPU, SWAP, memory, disk I / O, disk partition, network, process, file handle, ICMP, NAS, NTP, log, etc.

[0054] As Figure 3 shown, it is a schematic diagram of the index module. Each index corresponds to a script. The detection data of each object to be detected under the corresponding index. For example, the detection data (parameter m1) of index i1 in the figure is obtained by detecting through the corresponding script j1.

[0055] As Figure 4 shown, the policy module contains all detection policies created by operation and maintenance personnel and the association relationships of the detection policies. The detection policy is a logical concept that defines how to detect a group of detection indexes, including the corresponding relationship between the detection indexes and the scripts, the configuration of the default parameters in the scripts, the alarm threshold of the index value, the frequency of collecting indexes, etc.

[0056] To facilitate the management of large-scale resource instances, an inheritance relationship can be set between detection policies. The inherited policies will retain the detection indexes of the inherited policies and can also flexibly customize and modify the thresholds of the indexes, which is applicable to different resource requirements in different application scenarios such as online / batch, application / database, etc. At the same time, the inherited policies will also automatically synchronize the index updates of the inherited policies, thus facilitating the maintenance and management of operation and maintenance personnel.

[0057] As Figure 5 The collection module automatically collects information through scripts, distributes the scripts for collecting indexes to the specific operating system resource instances to be detected, and runs this script to collect the data information on the objects to be detected.

[0058] Figure 6 It is a schematic diagram of the resource module. The resource module contains all operating system instance objects to be detected. When binding the detection policy, the corresponding detection object is selected through the resource module. Figure 6 The instances in

[0059] As Figure 7The following is a schematic diagram of the deployment detection process. For the detection, deployment, and management scenarios of large-scale operating system instances, a general detection strategy A is usually set: First, select the detection indicators (i1, i2,... im) of the operating system to be detected, set the corresponding scripts (j1, j2,... jn) for these detection indicators, as well as the thresholds (k1, k2,... kl) for which alarms need to be triggered. The collection frequency is defined according to the indicator dimension (x1, x2,... xm), and is usually set according to expert experience and actual requirements. The collection frequencies can be the same. For example, x1 = x2 = 60s, that is, collect once every 1 minute. Then select the resource instances (h1, h2,... hz) to be detected, that is, the hosts where the operating system servers to be detected are located. Bind the corresponding resource instances to the detection strategy defined above, so as to associate the strategy with the host. The collection module will send the scripts, default parameters, threshold rules, and collection frequencies corresponding to the indicators in the strategy to the host, run according to the collection frequency, report the results to the server, and perform threshold comparison to trigger an alarm.

[0060] In an exemplary embodiment, after creating the detection strategy according to the detection indicators and the corresponding alarm thresholds, the method further includes:

[0061] In the case where the detection indicators of the target operating system change, change the detection indicators in the N detection strategies through a target policy template, where the target policy template has an associated relationship with each of the detection strategies.

[0062] For example, in the case where there are new detection indicators in the target operating system, add the new detection indicators to the target policy template, so as to synchronously add the new detection indicators to the N detection strategies through the target policy template; in the case of deleting the first detection indicator of the target operating system, delete the first detection indicator in the target policy template, so as to synchronously delete the first detection indicator in the N detection strategies through the target policy template; in the case of updating the alarm threshold of the second detection indicator of the target operating system, update the alarm threshold of the second detection indicator in the target policy template, so as to synchronously update the alarm threshold of the second detection indicator in the N detection strategies through the target policy template.

[0063] As Figure 8 shown in the schematic diagram of updated indicators, when the i1 CPU usage rate of a certain system will stably exceed the set threshold of k1 = 80% due to a long-term batch job, the operation and maintenance management personnel can inherit a new strategy A1 on the basis of the general detection strategy, adjust the k1 threshold of the A1 strategy to 90%, and send it to the host of the corresponding system, so as to reduce the number of alarms.

[0064] When the operation and maintenance management personnel need to add a new detection index i for the operating system m+1 , only need to add the index i to the general detection policy A m+1 and the corresponding script j n+1 threshold k l+1 and the acquisition rule x m+1 . Other policies B that have an inheritance relationship with the general detection policy can automatically synchronize and add the above-mentioned indexes and rules.

[0065] In the above embodiment, through the target policy template (for example, policy template A), multiple policies with an association relationship ( Figure 4 policy A1 associated with policy template A in ) can be added, modified, or deleted for detection indexes at the same time, achieving the purpose of batch processing of indexes and improving the efficiency of index change in the policy.

[0066] The following Table 2 is a policy example table. By managing the detection objects and detection content through the detection policy, the relationship between the operating system instances and the detection items is explicitized, which helps in the management of a large number of detection objects. It can meet the personalized requirements of detection thresholds in different scenarios. At the same time, through the association relationship between the detection policies, the coverage rate of detection updates is ensured, facilitating the operation and maintenance personnel to update and maintain the detection policy.

[0067] Table 2

[0068]

[0069]

[0070]

[0071]

[0072] Optionally, the execution subject of the above steps can be a background processor, or other devices with similar processing capabilities, or a machine at least integrated with an image acquisition device and a data processing device. Among them, the image acquisition device can include graphic acquisition modules such as cameras, and the data processing device can include terminals such as computers and mobile phones, but is not limited thereto.

[0073] Through the above steps, a set of objects to be detected is determined. The set of objects to be detected includes N objects to be detected, where a target operating system is installed on the objects to be detected, and N is an integer. A set of detection policies is determined according to the set of objects to be detected. The set of detection policies includes N detection policies, and the detection policies correspond to the objects to be detected one by one. The target operating system is detected according to the set of detection policies. The purpose of automatically detecting the target operating system based on the detection policies is achieved. Therefore, the problem of low accuracy of detection results caused by manual detection of the operating system in the related art can be solved, and the effect of improving the accuracy of operating system detection can be achieved.

[0074] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0075] In this embodiment, a device is further provided. The device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can implement a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0076] Figure 8 is a structural block diagram of a detection device for an operating system according to an embodiment of the present invention. As Figure 8 shown, the device includes:

[0077] A first determination module 82, configured to determine a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, a target operating system is installed on the objects to be detected, and N is an integer;

[0078] A second determination module 84, configured to determine a set of detection policies according to the set of objects to be detected, where the set of detection policies includes N detection policies, and the detection policies correspond to the objects to be detected one by one;

[0079] A detection module 86, configured to detect the target operating system according to the set of detection policies.

[0080] In an exemplary embodiment, the above device is further configured to determine detection metrics of the target operating system to obtain M detection metrics, where M is an integer; determine alarm thresholds of each of the detection objects for each of the detection metrics; and create the detection policy according to the detection metrics and the corresponding alarm thresholds to obtain the detection policy set.

[0081] In an exemplary embodiment, the above device is further configured to run a script file corresponding to each of the detection metrics on each of the detection objects to collect detection data of each of the detection objects for the corresponding detection metric through the script file; and determine a detection result of each of the detection objects for the corresponding detection metric according to the detection data and the corresponding alarm threshold, where the detection result of the target operating system includes the detection results of each of the detection objects for each of the detection metrics.

[0082] In an exemplary embodiment, the above device is further configured to run the j-th script file corresponding to the j-th detection metric on the i-th detection object to collect detection data of the i-th detection object for the j-th detection metric through the j-th script file to obtain target detection data, where i and j are integers;

[0083] Determining the detection result of each of the detection objects for the corresponding metric according to the detection data and the corresponding alarm threshold includes: when the alarm threshold for the j-th detection metric on the i-th detection object is the target alarm threshold and the target detection data reaches the target alarm threshold, determining that the detection result of the j-th detection metric on the i-th detection object is abnormal; otherwise, the detection result is normal.

[0084] In an exemplary embodiment, the above device is further configured to, after creating the detection policy according to the detection metrics and the corresponding alarm thresholds, when the detection metrics of the target operating system change, change the detection metrics in the N detection policies through a target policy template, where the target policy template has an association relationship with each of the detection policies.

[0085] In an exemplary embodiment, the above device is further configured to, when there is a newly added detection index in the target operating system, add the newly added detection index to the target policy template, so as to synchronously add the newly added detection index to the N detection policies through the target policy template; when deleting the first detection index of the target operating system, delete the first detection index in the target policy template, so as to synchronously delete the first detection index in the N detection policies through the target policy template; when updating the alarm threshold of the second detection index of the target operating system, update the alarm threshold of the second detection index in the target policy template, so as to synchronously update the alarm threshold of the second detection index in the N detection policies through the target policy template.

[0086] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.

[0087] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.

[0088] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical disks and other various media that can store computer programs.

[0089] An embodiment of the present invention further provides an electronic device, including a memory and a processor, 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.

[0090] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0091] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0092] An embodiment of the present invention further provides a computer program product, including a computer program, where when the computer program is executed by a processor, the steps of the methods described in the various embodiments of the present application are implemented.

[0093] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a sequence different from that here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0094] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A detection method for an operating system, characterized in that, Including: Determine a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, and a target operating system is installed on the objects to be detected, and N is an integer; Determine a set of detection strategies according to the set of objects to be detected, where the set of detection strategies includes N detection strategies, and the detection strategies correspond to the objects to be detected one by one; Detect the target operating system according to the set of detection strategies.

2. The method according to claim 1, characterized in that Determine a set of detection strategies according to the set of objects to be detected, including: Determine the detection metrics of the target operating system to obtain M detection metrics, where M is an integer; Determine the alarm thresholds of each of the detection objects for each of the detection metrics; Create the detection strategies according to the detection metrics and the corresponding alarm thresholds to obtain the set of detection strategies.

3. The method according to claim 2, characterized in that, Detect the target operating system according to the set of detection strategies, including: Run the script files corresponding to each of the detection metrics on each of the detection objects to collect the detection data of each of the detection objects for the corresponding detection metrics through the script files; Determine the detection results of each of the detection objects for the corresponding detection metrics according to the detection data and the corresponding alarm thresholds, where the detection results of the target operating system include the detection results of each of the detection objects for each of the detection metrics.

4. The method according to claim 3, wherein Running the script files corresponding to each of the detection metrics on each of the detection objects to collect the detection data of each of the detection objects for the corresponding detection metrics through the script files, including: Running the j-th script file corresponding to the j-th detection metric on the i-th detection object to collect the detection data of the i-th detection object for the j-th detection metric through the j-th script file to obtain target detection data, where i and j are integers; Determine the detection results of each of the detection objects for the corresponding metrics according to the detection data and the corresponding alarm thresholds, including: When the alarm threshold for the j-th detection metric on the i-th detection object is the target alarm threshold and the target detection data reaches the target alarm threshold, determine that the detection result for the j-th detection metric on the i-th detection object is abnormal, otherwise the detection result is normal.

5. The method according to claim 2, wherein After creating the detection strategies according to the detection metrics and the corresponding alarm thresholds, the method further includes: When the detection metrics of the target operating system change, change the detection metrics in the N detection strategies through a target policy template, where the target policy template has an associated relationship with each of the detection strategies.

6. The method according to claim 5, characterized in that, When the detection metrics of the target operating system change, change the detection metrics in the N detection strategies through a target policy template, including: When there are new detection metrics in the target operating system, add the new detection metrics to the target policy template to synchronously add the new detection metrics to the N detection strategies through the target policy template; When the first detection index of the target operating system is deleted, delete the first detection index in the target policy template, so as to synchronously delete the first detection index in the N detection policies through the target policy template; When the alarm threshold of the second detection index of the target operating system is updated, update the alarm threshold of the second detection index in the target policy template, so as to synchronously update the alarm threshold of the second detection index in the N detection policies through the target policy template.

7. A detection device for an operating system, characterized in that, Including: A first determination module, configured to determine a set of objects to be detected, where the set of objects to be detected includes N objects to be detected, and the object to be detected is installed with a target operating system, and N is an integer; A second determination module, configured to determine a set of detection policies according to the set of objects to be detected, where the set of detection policies includes N detection policies, and the detection policies correspond to the objects to be detected one by one; A detection module, configured to detect the target operating system according to the set of detection policies.

8. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.

9. An electronic 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 method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.