通用信息模型Common Information Model

通用信息模型 (CIM) 是一个可扩展并面向对象的数据模型,含有与企业各个部门有关的信息。The Common Information Model (CIM) is an extensible, object-oriented data model that contains information about different parts of an enterprise. CIM是分布式管理任务组 (DMTF) 所维护的跨平台标准。The CIM is a cross-platform standard maintained by the Distributed Management Task Force (DMTF). 通过 WMI,开发人员可以使用 CIM 来创建表示硬盘驱动器、应用程序、网络路由器甚至用户定义的技术(例如联网空调)的类。Through WMI, a developer can use the CIM to create classes that represent hard disk drives, applications, network routers, or even user-defined technologies, such as a networked air conditioner. 通过查看和更改 CIM 类,管理员可以控制企业的各个方面。By viewing and making changes to a CIM class, a manager can control different aspects of the enterprise. 例如,管理员可以查询表示桌面工作站的 CIM 类实例,For example, a manager could query a CIM class instance representing a desktop workstation. 然后,管理员可以运行一个脚本来修改该 CIM 工作站实例。The manager could then run a script to modify the CIM workstation instance. WMI 会将对工作站 CIM 类实例所做的任何更改转换为对实际工作站所做的更改。WMI would translate any change to the workstation CIM class instance into a change to the actual workstation.

CIM 是一种与语言无关的编程模型,它使用面向对象的技术来描述企业。The CIM is a language-independent programming model that uses object-oriented techniques to describe an enterprise. 使用三个级别的父/子继承,CIM 可以同时描述企业的一般和特定方面。Using three levels of parent/child inheritance, the CIM can describe both general and specific aspects of an enterprise. CIM 还使用称为 "关联" 的技术将企业模型的不同部分链接在一起,并使用架构来区分不同的管理环境。The CIM also uses a technique called "association" to link different parts of the enterprise model together, and uses schemas to distinguish different management environments.

CIM 旨在提供管理环境中逻辑和物理对象的一致视图。The CIM is designed to present a consistent view of logical and physical objects in a management environment. CIM 使用称为 "类" 的面向对象的构造来表示托管的对象。The CIM represents managed objects using an object-oriented construct called a "class." 与 c + + 或 COM 类一样,CIM 类可以包括用于描述数据的属性和用于描述行为的方法。Like a C++ or COM class, a CIM class can include properties to describe data and methods to describe behavior. 与一组 COM 类一样,CIM 并不绑定到任何平台。Like a set of COM classes, the CIM is not tied to any platform. 但是,WMI 包含对 CIM 的扩展,用于描述 Microsoft Windows 操作系统平台。However, WMI includes an extension to the CIM that describes the Microsoft Windows operating system platforms.

CIM 定义了三个级别的类:The CIM defines three levels of classes:

  • 核心Core

    核心类表示适用于所有管理区域的托管对象。Core classes represent managed objects that apply to all areas of management. 这些类提供了一个基本词汇,用于分析和描述托管系统。These classes provide a basic vocabulary for analyzing and describing managed systems. _ _ 参数_ _ SystemSecurity类是核心类的示例。The __Parameters and __SystemSecurity classes are examples of core classes.

  • 通用Common

    常见类表示适用于特定管理区域的托管对象。Common classes represent managed objects that apply to specific management areas. 但是,公共类与特定的实现或技术无关。However, common classes are independent from a particular implementation or technology. 常见类是核心类的扩展。Common classes are an extension of the core classes. CIM _ UnitaryComputerSystem类是一个公共类的示例。The CIM_UnitaryComputerSystem class is an example of a common class.

  • 外延支持Extended

    扩展类表示一些托管对象,这些对象是对公共类的特定于技术的补充。Extended classes represent managed objects that are technology-specific additions to the common classes. 扩展类通常适用于特定平台,如 UNIX 或 Microsoft Win32 环境。An extended class typically applies to a specific platform, such as UNIX or the Microsoft Win32 environment. Win32 程序类是扩展类的一个示例。 _The Win32_ComputerSystem class is an example of an extended class.

开发人员可以从其他类派生类。A developer can derive a class from another class. 派生类表示父类的特殊情况,继承了父类的所有属性和方法。A derived class represents a special case of the parent class, and inherits all of the properties and methods of the parent. 例如,Win32 程序从 CIM _ UnitaryComputerSystem继承。 _For example, Win32_ComputerSystem inherits from CIM_UnitaryComputerSystem. 继承关系可以使用系统属性 _ _ 派生_ _ Dynasty_ _ 超类 来确定。Inheritance relationships may be determined using the system properties __Derivation, __Dynasty, and __SuperClass. _ _ 派生 系统属性是一个字符串数组,其中列出了包含在 _ _ Dynasty 中的整个继承链,并包括根类。The __Derivation system property is an array of strings listing the entire chain of inheritance up to and including the root class, which is also included in __Dynasty. _ _ 超类 系统属性显示当前类的直接父级。The __SuperClass system property shows the immediate parent of the current class.

WMI 还支持关联。WMI also supports associations. 关联是两个或多个不同的 WMI 类之间的关系。An association is a relationship between two or more different WMI classes. 例如,正在运行的工作站通常有一个处理器。For example, a running workstation usually has a processor. WMI association 类 win32 _ ComputerSystemProcessor 将工作站类 win32 程序 程序 _ 与 processor 类 win32 _ 处理器关联起来。The WMI association class Win32_ComputerSystemProcessor associates the workstation class Win32_ComputerSystem with the processor class Win32_Processor. 但是,association 类不必同时关联两个相关的类。However, an association class does not have to tie two dependent classes together. 事实上,association 类的主要目的是显示不一定相互依赖的类之间的关系。In fact, the primary purpose of an association class is to show relationships between classes that are not necessarily dependent on each other. 有关详细信息,请参阅 声明关联类For more information, see Declaring an Association Class.

最后,WMI 支持架构的概念。Finally, WMI supports the concept of schemas. 在 WMI 上下文中,架构是一组描述特定管理环境的类。In the context of WMI, a schema is a group of classes that describe a particular management environment. Microsoft Windows 软件开发工具包 (SDK) 使用两个架构: CIM 架构和 Win32 架构。The Microsoft Windows Software Development Kit (SDK) uses two schemas: the CIM schema and the Win32 schema. CIM 架构类名称以 cim _开头,win32 架构类名称以 win32 _开头。The CIM schema class names begin with CIM_, and the Win32 schema class names begin with Win32_. CIM 架构包含核心和常见类的定义,而 Win32 架构包含 Win32 环境所共有的扩展类的定义。The CIM schema contains the definitions for the core and common classes, while the Win32 schema contains the definitions for the extended classes that are common to the Win32 environment. 但是,第三方供应商可以创建自己的架构来描述特定于供应商的要求。However, a third-party vendor can create their own schemas to describe vendor-specific requirements. 由于架构被设计为可无限扩展,因此开发人员始终可以添加新类来描述现有环境中的新托管对象。Because schemas are designed to be infinitely extensible, a developer can always add new classes to describe new managed objects in an existing environment. 然而,为简单起见,大多数供应商选择创建从 CIM 或 Win32 架构继承属性的架构。For simplicity, however, most vendors choose to create schemas that inherit properties from the CIM or Win32 schemas.